@insforge/react 0.6.9 → 0.7.0
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 +2 -1
- package/dist/atoms.cjs +754 -106
- package/dist/atoms.cjs.map +1 -1
- package/dist/atoms.js +728 -84
- package/dist/atoms.js.map +1 -1
- package/dist/components.cjs +1050 -272
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +28 -1
- package/dist/components.d.ts +28 -1
- package/dist/components.js +1044 -271
- package/dist/components.js.map +1 -1
- package/dist/forms.cjs +922 -264
- package/dist/forms.cjs.map +1 -1
- package/dist/forms.js +896 -242
- package/dist/forms.js.map +1 -1
- package/dist/hooks.cjs +2 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.js +2 -0
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +1081 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +114 -2
- package/dist/index.d.ts +114 -2
- package/dist/index.js +1071 -272
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/dist/atoms.cjs
CHANGED
|
@@ -1,15 +1,536 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var styled = require('@emotion/styled');
|
|
4
|
+
var react = require('@emotion/react');
|
|
3
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
6
|
var lucideReact = require('lucide-react');
|
|
5
|
-
var react = require('react');
|
|
7
|
+
var react$1 = require('react');
|
|
6
8
|
require('@insforge/sdk');
|
|
7
|
-
var react$
|
|
9
|
+
var react$2 = require('@insforge/shared/react');
|
|
10
|
+
require('@emotion/cache');
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
15
|
+
|
|
16
|
+
// src/components/atoms/styled.ts
|
|
17
|
+
|
|
18
|
+
// src/styles/theme.ts
|
|
19
|
+
var theme = {
|
|
20
|
+
colors: {
|
|
21
|
+
primary: "#000000",
|
|
22
|
+
primaryHover: "#1f1f1f",
|
|
23
|
+
text: "#000000",
|
|
24
|
+
textSecondary: "#828282",
|
|
25
|
+
textMuted: "#a3a3a3",
|
|
26
|
+
textGray: "#525252",
|
|
27
|
+
border: "#d4d4d4",
|
|
28
|
+
borderGray: "#e4e4e7",
|
|
29
|
+
borderHover: "#9ca3af",
|
|
30
|
+
borderFocus: "#000000",
|
|
31
|
+
bgWhite: "#ffffff",
|
|
32
|
+
bgLight: "#fafafa",
|
|
33
|
+
bgGray: "#f5f5f5",
|
|
34
|
+
bgHover: "#f9fafb",
|
|
35
|
+
error: "#dc2626",
|
|
36
|
+
errorBg: "#fee2e2",
|
|
37
|
+
successBg: "#d1fae5",
|
|
38
|
+
successDark: "#059669",
|
|
39
|
+
black: "#000000",
|
|
40
|
+
zinc900: "#09090b"
|
|
41
|
+
},
|
|
42
|
+
spacing: {
|
|
43
|
+
1: "0.25rem",
|
|
44
|
+
// 4px
|
|
45
|
+
2: "0.5rem",
|
|
46
|
+
// 8px
|
|
47
|
+
3: "0.75rem",
|
|
48
|
+
// 12px
|
|
49
|
+
4: "1rem",
|
|
50
|
+
// 16px
|
|
51
|
+
6: "1.5rem",
|
|
52
|
+
// 32px
|
|
53
|
+
10: "2.5rem"
|
|
54
|
+
// 40px
|
|
55
|
+
},
|
|
56
|
+
radius: {
|
|
57
|
+
// 2px
|
|
58
|
+
sm: "0.25rem",
|
|
59
|
+
// 4px
|
|
60
|
+
md: "0.375rem",
|
|
61
|
+
// 6px
|
|
62
|
+
lg: "0.5rem",
|
|
63
|
+
// 8px
|
|
64
|
+
xl: "0.75rem",
|
|
65
|
+
// 12px
|
|
66
|
+
full: "9999px"
|
|
67
|
+
},
|
|
68
|
+
fontSize: {
|
|
69
|
+
xs: "0.75rem",
|
|
70
|
+
// 12px
|
|
71
|
+
sm: "0.875rem",
|
|
72
|
+
// 14px
|
|
73
|
+
base: "1rem",
|
|
74
|
+
// 20px
|
|
75
|
+
"2xl": "1.5rem"
|
|
76
|
+
// 24px
|
|
77
|
+
},
|
|
78
|
+
lineHeight: {
|
|
79
|
+
// 16px
|
|
80
|
+
normal: "1.25rem",
|
|
81
|
+
// 20px
|
|
82
|
+
relaxed: "1.5rem",
|
|
83
|
+
// 24px
|
|
84
|
+
loose: "2rem"
|
|
85
|
+
// 32px
|
|
86
|
+
},
|
|
87
|
+
fontFamily: {
|
|
88
|
+
base: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif",
|
|
89
|
+
manrope: "'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif"
|
|
90
|
+
},
|
|
91
|
+
fontWeight: {
|
|
92
|
+
normal: 400,
|
|
93
|
+
medium: 500,
|
|
94
|
+
semibold: 600
|
|
95
|
+
},
|
|
96
|
+
shadow: {
|
|
97
|
+
md: "0 1px 2px 0 rgba(0, 0, 0, 0.1)",
|
|
98
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"
|
|
99
|
+
},
|
|
100
|
+
transition: {
|
|
101
|
+
fast: "150ms cubic-bezier(0.4, 0, 0.2, 1)",
|
|
102
|
+
base: "200ms cubic-bezier(0.4, 0, 0.2, 1)"
|
|
103
|
+
},
|
|
104
|
+
sizes: {
|
|
105
|
+
button: {
|
|
106
|
+
height: "2.5rem",
|
|
107
|
+
// 40px for submit
|
|
108
|
+
heightOAuth: "2.25rem"
|
|
109
|
+
// 36px for OAuth
|
|
110
|
+
},
|
|
111
|
+
// 32px
|
|
112
|
+
icon: "1.25rem",
|
|
113
|
+
// 20px
|
|
114
|
+
iconSm: "1.125rem",
|
|
115
|
+
// 18px
|
|
116
|
+
iconLg: "1.5rem",
|
|
117
|
+
// 24px
|
|
118
|
+
verifyCode: "3rem",
|
|
119
|
+
// 48px
|
|
120
|
+
verifyIcon: "4rem",
|
|
121
|
+
// 64px
|
|
122
|
+
verifyIconInner: "2rem"
|
|
123
|
+
// 32px
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var keyframes = {
|
|
127
|
+
spin: `
|
|
128
|
+
from {
|
|
129
|
+
transform: rotate(0deg);
|
|
130
|
+
}
|
|
131
|
+
to {
|
|
132
|
+
transform: rotate(360deg);
|
|
133
|
+
}
|
|
134
|
+
`
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// src/components/atoms/styled.ts
|
|
138
|
+
var spinAnimation = react.keyframes`${keyframes.spin}`;
|
|
139
|
+
var AuthContainerWrapper = styled__default.default.div`
|
|
140
|
+
width: 100%;
|
|
141
|
+
max-width: 400px;
|
|
142
|
+
border-radius: ${theme.radius.xl};
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
box-shadow: ${theme.shadow.lg};
|
|
145
|
+
`;
|
|
146
|
+
var AuthCard = styled__default.default.div`
|
|
147
|
+
background-color: ${theme.colors.bgWhite};
|
|
148
|
+
padding: ${theme.spacing[6]};
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-direction: column;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
align-items: stretch;
|
|
153
|
+
gap: ${theme.spacing[6]};
|
|
154
|
+
`;
|
|
155
|
+
var AuthHeaderWrapper = styled__default.default.div`
|
|
156
|
+
display: flex;
|
|
157
|
+
flex-direction: column;
|
|
158
|
+
justify-content: flex-start;
|
|
159
|
+
align-items: flex-start;
|
|
160
|
+
gap: ${theme.spacing[2]};
|
|
161
|
+
`;
|
|
162
|
+
var AuthHeaderTitle = styled__default.default.h1`
|
|
163
|
+
font-size: ${theme.fontSize["2xl"]};
|
|
164
|
+
font-weight: ${theme.fontWeight.semibold};
|
|
165
|
+
color: ${theme.colors.text};
|
|
166
|
+
line-height: ${theme.lineHeight.loose};
|
|
167
|
+
margin: 0;
|
|
168
|
+
font-family: ${theme.fontFamily.base};
|
|
169
|
+
`;
|
|
170
|
+
var AuthHeaderSubtitle = styled__default.default.p`
|
|
171
|
+
font-size: ${theme.fontSize.sm};
|
|
172
|
+
font-weight: ${theme.fontWeight.normal};
|
|
173
|
+
color: ${theme.colors.textSecondary};
|
|
174
|
+
line-height: ${theme.lineHeight.relaxed};
|
|
175
|
+
margin: 0;
|
|
176
|
+
font-family: ${theme.fontFamily.base};
|
|
177
|
+
`;
|
|
178
|
+
var FormFieldWrapper = styled__default.default.div`
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
justify-content: center;
|
|
182
|
+
align-items: stretch;
|
|
183
|
+
gap: ${theme.spacing[1]};
|
|
184
|
+
`;
|
|
185
|
+
var FormFieldLabel = styled__default.default.label`
|
|
186
|
+
font-size: ${theme.fontSize.sm};
|
|
187
|
+
font-weight: ${theme.fontWeight.normal};
|
|
188
|
+
color: ${theme.colors.text};
|
|
189
|
+
line-height: ${theme.lineHeight.relaxed};
|
|
190
|
+
font-family: ${theme.fontFamily.base};
|
|
191
|
+
`;
|
|
192
|
+
var FormFieldInput = styled__default.default.input`
|
|
193
|
+
width: 100%;
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
gap: ${theme.spacing[2]};
|
|
197
|
+
align-self: stretch;
|
|
198
|
+
padding: ${theme.spacing[2]} ${theme.spacing[3]};
|
|
199
|
+
border-radius: ${theme.radius.sm};
|
|
200
|
+
border: 1px solid ${theme.colors.border};
|
|
201
|
+
background-color: ${theme.colors.bgWhite};
|
|
202
|
+
font-size: ${theme.fontSize.sm};
|
|
203
|
+
font-weight: ${theme.fontWeight.normal};
|
|
204
|
+
line-height: ${theme.lineHeight.normal};
|
|
205
|
+
color: ${theme.colors.text};
|
|
206
|
+
font-family: ${theme.fontFamily.base};
|
|
207
|
+
transition: border-color ${theme.transition.base};
|
|
208
|
+
|
|
209
|
+
&::placeholder {
|
|
210
|
+
color: ${theme.colors.textMuted};
|
|
211
|
+
font-size: ${theme.fontSize.sm};
|
|
212
|
+
font-weight: ${theme.fontWeight.normal};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&:focus {
|
|
216
|
+
outline: none;
|
|
217
|
+
border-color: ${theme.colors.borderFocus};
|
|
218
|
+
}
|
|
219
|
+
`;
|
|
220
|
+
var PasswordFieldWrapper = styled__default.default.div`
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
justify-content: center;
|
|
224
|
+
align-items: stretch;
|
|
225
|
+
gap: ${theme.spacing[1]};
|
|
226
|
+
`;
|
|
227
|
+
var PasswordFieldLabelRow = styled__default.default.div`
|
|
228
|
+
display: flex;
|
|
229
|
+
justify-content: space-between;
|
|
230
|
+
align-items: center;
|
|
231
|
+
`;
|
|
232
|
+
var PasswordFieldLabel = styled__default.default.label`
|
|
233
|
+
font-size: ${theme.fontSize.sm};
|
|
234
|
+
font-weight: ${theme.fontWeight.normal};
|
|
235
|
+
color: ${theme.colors.text};
|
|
236
|
+
line-height: ${theme.lineHeight.relaxed};
|
|
237
|
+
font-family: ${theme.fontFamily.base};
|
|
238
|
+
`;
|
|
239
|
+
var PasswordFieldForgotLink = styled__default.default.a`
|
|
240
|
+
font-size: ${theme.fontSize.sm};
|
|
241
|
+
font-weight: ${theme.fontWeight.normal};
|
|
242
|
+
color: ${theme.colors.textSecondary};
|
|
243
|
+
text-decoration: none;
|
|
244
|
+
transition: color ${theme.transition.fast};
|
|
245
|
+
font-family: ${theme.fontFamily.base};
|
|
246
|
+
cursor: pointer;
|
|
247
|
+
`;
|
|
248
|
+
var PasswordFieldInputWrapper = styled__default.default.div`
|
|
249
|
+
position: relative;
|
|
250
|
+
width: 100%;
|
|
251
|
+
`;
|
|
252
|
+
var PasswordFieldInput = styled__default.default.input`
|
|
253
|
+
width: 100%;
|
|
254
|
+
display: flex;
|
|
255
|
+
align-items: center;
|
|
256
|
+
align-self: stretch;
|
|
257
|
+
padding: ${theme.spacing[2]} ${theme.spacing[3]};
|
|
258
|
+
padding-right: 2.5rem;
|
|
259
|
+
border-radius: ${theme.radius.sm};
|
|
260
|
+
border: 1px solid ${theme.colors.border};
|
|
261
|
+
background-color: ${theme.colors.bgWhite};
|
|
262
|
+
font-size: ${theme.fontSize.sm};
|
|
263
|
+
font-weight: ${theme.fontWeight.normal};
|
|
264
|
+
line-height: ${theme.lineHeight.normal};
|
|
265
|
+
color: ${theme.colors.text};
|
|
266
|
+
font-family: ${theme.fontFamily.base};
|
|
267
|
+
transition: border-color ${theme.transition.base};
|
|
268
|
+
|
|
269
|
+
&::placeholder {
|
|
270
|
+
color: ${theme.colors.textMuted};
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
&:focus {
|
|
274
|
+
outline: none;
|
|
275
|
+
border-color: ${theme.colors.borderFocus};
|
|
276
|
+
}
|
|
277
|
+
`;
|
|
278
|
+
var PasswordFieldToggleButton = styled__default.default.button`
|
|
279
|
+
position: absolute;
|
|
280
|
+
right: ${theme.spacing[1]};
|
|
281
|
+
top: 50%;
|
|
282
|
+
transform: translateY(-50%);
|
|
283
|
+
background: none;
|
|
284
|
+
border: none;
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
padding: ${theme.spacing[1]};
|
|
287
|
+
display: flex;
|
|
288
|
+
align-items: center;
|
|
289
|
+
justify-content: center;
|
|
290
|
+
color: ${theme.colors.textSecondary};
|
|
291
|
+
transition: color ${theme.transition.fast};
|
|
292
|
+
`;
|
|
293
|
+
var SubmitButton = styled__default.default.button`
|
|
294
|
+
border-radius: ${theme.radius.sm};
|
|
295
|
+
background-color: ${theme.colors.primary};
|
|
296
|
+
height: ${theme.sizes.button.height};
|
|
297
|
+
width: 100%;
|
|
298
|
+
display: flex;
|
|
299
|
+
margin-top: ${theme.spacing[4]};
|
|
300
|
+
padding: ${theme.spacing[2]} ${theme.spacing[4]};
|
|
301
|
+
justify-content: center;
|
|
302
|
+
align-items: center;
|
|
303
|
+
gap: 0.625rem;
|
|
304
|
+
align-self: stretch;
|
|
305
|
+
color: ${theme.colors.bgWhite};
|
|
306
|
+
font-weight: ${theme.fontWeight.semibold};
|
|
307
|
+
font-family: ${theme.fontFamily.manrope};
|
|
308
|
+
font-size: ${theme.fontSize.base};
|
|
309
|
+
line-height: normal;
|
|
310
|
+
border: none;
|
|
311
|
+
cursor: pointer;
|
|
312
|
+
transition: background-color ${theme.transition.base};
|
|
313
|
+
|
|
314
|
+
&:hover:not(:disabled) {
|
|
315
|
+
background-color: ${theme.colors.primaryHover};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
&:disabled {
|
|
319
|
+
opacity: 0.5;
|
|
320
|
+
cursor: not-allowed;
|
|
321
|
+
}
|
|
322
|
+
`;
|
|
323
|
+
var SubmitButtonIcon = styled__default.default.div`
|
|
324
|
+
width: ${theme.sizes.icon};
|
|
325
|
+
height: ${theme.sizes.icon};
|
|
326
|
+
display: flex;
|
|
327
|
+
align-items: center;
|
|
328
|
+
justify-content: center;
|
|
329
|
+
|
|
330
|
+
svg {
|
|
331
|
+
width: 100%;
|
|
332
|
+
height: 100%;
|
|
333
|
+
}
|
|
334
|
+
`;
|
|
335
|
+
var SubmitButtonSpinner = styled__default.default.div`
|
|
336
|
+
width: ${theme.sizes.icon};
|
|
337
|
+
height: ${theme.sizes.icon};
|
|
338
|
+
display: flex;
|
|
339
|
+
align-items: center;
|
|
340
|
+
justify-content: center;
|
|
341
|
+
animation: ${spinAnimation} 1s linear infinite;
|
|
342
|
+
|
|
343
|
+
svg {
|
|
344
|
+
width: 100%;
|
|
345
|
+
height: 100%;
|
|
346
|
+
}
|
|
347
|
+
`;
|
|
348
|
+
var OAuthButton = styled__default.default.button`
|
|
349
|
+
display: flex;
|
|
350
|
+
width: 100%;
|
|
351
|
+
height: ${theme.sizes.button.heightOAuth};
|
|
352
|
+
padding: ${(props) => props.$variant === "short" || props.$variant === "iconOnly" ? theme.spacing[2] : `${theme.spacing[2]} ${theme.spacing[3]}`};
|
|
353
|
+
flex-direction: row;
|
|
354
|
+
justify-content: center;
|
|
355
|
+
align-items: center;
|
|
356
|
+
gap: ${(props) => props.$variant === "iconOnly" ? "0" : props.$variant === "short" ? theme.spacing[2] : theme.spacing[3]};
|
|
357
|
+
border-radius: ${theme.radius.md};
|
|
358
|
+
border: 1px solid ${theme.colors.borderGray};
|
|
359
|
+
background-color: ${theme.colors.bgWhite};
|
|
360
|
+
box-shadow: ${theme.shadow.md};
|
|
361
|
+
color: ${theme.colors.zinc900};
|
|
362
|
+
text-align: center;
|
|
363
|
+
font-size: ${theme.fontSize.sm};
|
|
364
|
+
font-weight: ${theme.fontWeight.medium};
|
|
365
|
+
line-height: ${theme.lineHeight.normal};
|
|
366
|
+
cursor: pointer;
|
|
367
|
+
transition: all ${theme.transition.base};
|
|
368
|
+
font-family: ${theme.fontFamily.base};
|
|
369
|
+
|
|
370
|
+
&:hover:not(:disabled) {
|
|
371
|
+
background-color: ${theme.colors.bgHover};
|
|
372
|
+
border-color: ${theme.colors.borderHover};
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
&:disabled {
|
|
376
|
+
opacity: 0.6;
|
|
377
|
+
cursor: not-allowed;
|
|
378
|
+
}
|
|
379
|
+
`;
|
|
380
|
+
var OAuthButtonIcon = styled__default.default.div`
|
|
381
|
+
display: flex;
|
|
382
|
+
align-items: center;
|
|
383
|
+
justify-content: center;
|
|
384
|
+
flex-shrink: 0;
|
|
385
|
+
width: ${theme.sizes.iconSm};
|
|
386
|
+
height: ${theme.sizes.iconSm};
|
|
387
|
+
|
|
388
|
+
svg {
|
|
389
|
+
width: 100%;
|
|
390
|
+
height: 100%;
|
|
391
|
+
}
|
|
392
|
+
`;
|
|
393
|
+
var OAuthProvidersContainer = styled__default.default.div`
|
|
394
|
+
display: flex;
|
|
395
|
+
flex-direction: column;
|
|
396
|
+
gap: ${theme.spacing[3]};
|
|
397
|
+
width: 100%;
|
|
398
|
+
`;
|
|
399
|
+
var AuthLinkWrapper = styled__default.default.div`
|
|
400
|
+
display: flex;
|
|
401
|
+
justify-content: center;
|
|
402
|
+
align-items: center;
|
|
403
|
+
gap: ${theme.spacing[1]};
|
|
404
|
+
font-size: ${theme.fontSize.sm};
|
|
405
|
+
color: ${theme.colors.textSecondary};
|
|
406
|
+
font-family: ${theme.fontFamily.base};
|
|
407
|
+
`;
|
|
408
|
+
var AuthLinkText = styled__default.default.span`
|
|
409
|
+
font-weight: ${theme.fontWeight.normal};
|
|
410
|
+
`;
|
|
411
|
+
var AuthLinkLink = styled__default.default.a`
|
|
412
|
+
font-weight: ${theme.fontWeight.semibold};
|
|
413
|
+
color: ${theme.colors.text};
|
|
414
|
+
text-decoration: none;
|
|
415
|
+
transition: opacity ${theme.transition.fast};
|
|
416
|
+
cursor: pointer;
|
|
417
|
+
`;
|
|
418
|
+
var AuthDividerWrapper = styled__default.default.div`
|
|
419
|
+
display: flex;
|
|
420
|
+
align-items: center;
|
|
421
|
+
text-align: center;
|
|
422
|
+
width: 100%;
|
|
423
|
+
gap: ${theme.spacing[3]};
|
|
424
|
+
`;
|
|
425
|
+
var AuthDividerLine = styled__default.default.div`
|
|
426
|
+
flex: 1;
|
|
427
|
+
border-top: 1px solid ${theme.colors.border};
|
|
428
|
+
`;
|
|
429
|
+
var AuthDividerText = styled__default.default.span`
|
|
430
|
+
font-size: ${theme.fontSize.sm};
|
|
431
|
+
color: ${theme.colors.textSecondary};
|
|
432
|
+
font-weight: ${theme.fontWeight.normal};
|
|
433
|
+
font-family: ${theme.fontFamily.manrope};
|
|
434
|
+
`;
|
|
435
|
+
var ErrorBannerWrapper = styled__default.default.div`
|
|
436
|
+
padding: ${theme.spacing[3]};
|
|
437
|
+
background-color: ${theme.colors.errorBg};
|
|
438
|
+
border-radius: ${theme.radius.md};
|
|
439
|
+
border: 1px solid ${theme.colors.error};
|
|
440
|
+
`;
|
|
441
|
+
var ErrorBannerContent = styled__default.default.div`
|
|
442
|
+
display: flex;
|
|
443
|
+
align-items: center;
|
|
444
|
+
gap: ${theme.spacing[2]};
|
|
445
|
+
`;
|
|
446
|
+
var ErrorBannerIcon = styled__default.default.div`
|
|
447
|
+
width: ${theme.sizes.iconLg};
|
|
448
|
+
height: ${theme.sizes.iconLg};
|
|
449
|
+
flex-shrink: 0;
|
|
450
|
+
color: ${theme.colors.error};
|
|
451
|
+
display: flex;
|
|
452
|
+
align-items: center;
|
|
453
|
+
justify-content: center;
|
|
454
|
+
|
|
455
|
+
svg {
|
|
456
|
+
width: 100%;
|
|
457
|
+
height: 100%;
|
|
458
|
+
}
|
|
459
|
+
`;
|
|
460
|
+
var ErrorBannerText = styled__default.default.p`
|
|
461
|
+
font-size: ${theme.fontSize.sm};
|
|
462
|
+
color: ${theme.colors.error};
|
|
463
|
+
font-weight: ${theme.fontWeight.normal};
|
|
464
|
+
font-family: ${theme.fontFamily.base};
|
|
465
|
+
margin: 0;
|
|
466
|
+
`;
|
|
467
|
+
var AuthBrandingWrapper = styled__default.default.div`
|
|
468
|
+
background-color: ${theme.colors.bgLight};
|
|
469
|
+
padding: ${theme.spacing[4]} ${theme.spacing[2]};
|
|
470
|
+
display: flex;
|
|
471
|
+
flex-direction: row;
|
|
472
|
+
justify-content: center;
|
|
473
|
+
align-items: center;
|
|
474
|
+
gap: ${theme.spacing[1]};
|
|
475
|
+
`;
|
|
476
|
+
var AuthBrandingText = styled__default.default.p`
|
|
477
|
+
font-size: ${theme.fontSize.xs};
|
|
478
|
+
font-weight: ${theme.fontWeight.medium};
|
|
479
|
+
color: ${theme.colors.text};
|
|
480
|
+
font-family: ${theme.fontFamily.manrope};
|
|
481
|
+
margin: 0;
|
|
482
|
+
`;
|
|
483
|
+
var VerificationCodeInputContainer = styled__default.default.div`
|
|
484
|
+
display: flex;
|
|
485
|
+
gap: ${theme.spacing[3]};
|
|
486
|
+
justify-content: center;
|
|
487
|
+
`;
|
|
488
|
+
var VerificationCodeInput = styled__default.default.input`
|
|
489
|
+
width: ${theme.sizes.verifyCode};
|
|
490
|
+
height: ${theme.sizes.verifyCode};
|
|
491
|
+
text-align: center;
|
|
492
|
+
font-size: ${theme.fontSize.base};
|
|
493
|
+
font-weight: ${theme.fontWeight.semibold};
|
|
494
|
+
border: 1px solid ${theme.colors.border};
|
|
495
|
+
border-radius: ${theme.radius.sm};
|
|
496
|
+
transition: border-color ${theme.transition.base};
|
|
497
|
+
font-family: ${theme.fontFamily.manrope};
|
|
498
|
+
|
|
499
|
+
&:focus {
|
|
500
|
+
outline: none;
|
|
501
|
+
border-color: ${theme.colors.borderFocus};
|
|
502
|
+
}
|
|
503
|
+
`;
|
|
504
|
+
var PasswordStrengthWrapper = styled__default.default.div`
|
|
505
|
+
margin-top: ${theme.spacing[2]};
|
|
506
|
+
`;
|
|
507
|
+
styled__default.default.div`
|
|
508
|
+
height: 100%;
|
|
509
|
+
transition:
|
|
510
|
+
width ${theme.transition.base},
|
|
511
|
+
background-color ${theme.transition.base};
|
|
512
|
+
`;
|
|
513
|
+
styled__default.default.span`
|
|
514
|
+
font-size: ${theme.fontSize.xs};
|
|
515
|
+
color: ${theme.colors.textSecondary};
|
|
516
|
+
font-family: ${theme.fontFamily.base};
|
|
517
|
+
`;
|
|
518
|
+
var PasswordStrengthRequirements = styled__default.default.div`
|
|
519
|
+
display: flex;
|
|
520
|
+
flex-direction: column;
|
|
521
|
+
gap: ${theme.spacing[2]};
|
|
522
|
+
font-size: ${theme.fontSize.sm};
|
|
523
|
+
color: ${theme.colors.textGray};
|
|
524
|
+
font-family: ${theme.fontFamily.base};
|
|
525
|
+
`;
|
|
526
|
+
var PasswordStrengthRequirement = styled__default.default.div`
|
|
527
|
+
display: flex;
|
|
528
|
+
align-items: center;
|
|
529
|
+
gap: ${theme.spacing[2]};
|
|
530
|
+
`;
|
|
10
531
|
function AuthBranding() {
|
|
11
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
532
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(AuthBrandingWrapper, { children: [
|
|
533
|
+
/* @__PURE__ */ jsxRuntime.jsx(AuthBrandingText, { children: "Secured by" }),
|
|
13
534
|
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://insforge.dev", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14
535
|
"svg",
|
|
15
536
|
{
|
|
@@ -78,35 +599,35 @@ function AuthBranding() {
|
|
|
78
599
|
] });
|
|
79
600
|
}
|
|
80
601
|
function AuthContainer({ children }) {
|
|
81
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
82
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
602
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(AuthContainerWrapper, { children: [
|
|
603
|
+
/* @__PURE__ */ jsxRuntime.jsx(AuthCard, { children }),
|
|
83
604
|
/* @__PURE__ */ jsxRuntime.jsx(AuthBranding, {})
|
|
84
605
|
] });
|
|
85
606
|
}
|
|
86
607
|
function AuthHeader({ title, subtitle }) {
|
|
87
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
88
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
89
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
608
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(AuthHeaderWrapper, { children: [
|
|
609
|
+
/* @__PURE__ */ jsxRuntime.jsx(AuthHeaderTitle, { children: title }),
|
|
610
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx(AuthHeaderSubtitle, { children: subtitle })
|
|
90
611
|
] });
|
|
91
612
|
}
|
|
92
613
|
function AuthErrorBanner({ error }) {
|
|
93
614
|
if (!error) {
|
|
94
615
|
return null;
|
|
95
616
|
}
|
|
96
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
97
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
98
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
617
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ErrorBannerWrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(ErrorBannerContent, { children: [
|
|
618
|
+
/* @__PURE__ */ jsxRuntime.jsx(ErrorBannerIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, {}) }),
|
|
619
|
+
/* @__PURE__ */ jsxRuntime.jsx(ErrorBannerText, { children: error })
|
|
99
620
|
] }) });
|
|
100
621
|
}
|
|
101
622
|
function AuthFormField({ label, id, ...props }) {
|
|
102
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
103
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
623
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(FormFieldWrapper, { children: [
|
|
624
|
+
/* @__PURE__ */ jsxRuntime.jsx(FormFieldLabel, { htmlFor: id, children: label }),
|
|
625
|
+
/* @__PURE__ */ jsxRuntime.jsx(FormFieldInput, { id, ...props })
|
|
105
626
|
] });
|
|
106
627
|
}
|
|
107
|
-
var NavigationContext = react.createContext(null);
|
|
628
|
+
var NavigationContext = react$1.createContext(null);
|
|
108
629
|
function useNavigationAdapter() {
|
|
109
|
-
const adapter = react.useContext(NavigationContext);
|
|
630
|
+
const adapter = react$1.useContext(NavigationContext);
|
|
110
631
|
if (!adapter) {
|
|
111
632
|
return {
|
|
112
633
|
useSearchParams: () => new URLSearchParams(),
|
|
@@ -126,7 +647,7 @@ function AuthPasswordStrengthIndicator({
|
|
|
126
647
|
config
|
|
127
648
|
}) {
|
|
128
649
|
const requirements = createRequirements(config);
|
|
129
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
650
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PasswordStrengthWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(PasswordStrengthRequirements, { children: requirements.map((req) => /* @__PURE__ */ jsxRuntime.jsxs(PasswordStrengthRequirement, { children: [
|
|
130
651
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
131
652
|
"div",
|
|
132
653
|
{
|
|
@@ -216,9 +737,9 @@ function AuthPasswordField({
|
|
|
216
737
|
}) {
|
|
217
738
|
const searchParams = useSearchParams();
|
|
218
739
|
const { Link } = useNavigationAdapter();
|
|
219
|
-
const [showPassword, setShowPassword] = react.useState(false);
|
|
220
|
-
const [showStrength, setShowStrength] = react.useState(false);
|
|
221
|
-
const resolvedForgotPasswordHref = react.useMemo(
|
|
740
|
+
const [showPassword, setShowPassword] = react$1.useState(false);
|
|
741
|
+
const [showStrength, setShowStrength] = react$1.useState(false);
|
|
742
|
+
const resolvedForgotPasswordHref = react$1.useMemo(
|
|
222
743
|
() => forgotPasswordLink ? resolveAuthUrl(forgotPasswordLink.href, searchParams) : void 0,
|
|
223
744
|
[forgotPasswordLink, searchParams]
|
|
224
745
|
);
|
|
@@ -228,29 +749,27 @@ function AuthPasswordField({
|
|
|
228
749
|
}
|
|
229
750
|
onFocus?.(e);
|
|
230
751
|
};
|
|
231
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
232
|
-
(label || forgotPasswordLink) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
233
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
234
|
-
forgotPasswordLink && resolvedForgotPasswordHref && /* @__PURE__ */ jsxRuntime.jsx(Link, { href: resolvedForgotPasswordHref, className: "
|
|
752
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(PasswordFieldWrapper, { children: [
|
|
753
|
+
(label || forgotPasswordLink) && /* @__PURE__ */ jsxRuntime.jsxs(PasswordFieldLabelRow, { children: [
|
|
754
|
+
/* @__PURE__ */ jsxRuntime.jsx(PasswordFieldLabel, { htmlFor: id, children: label }),
|
|
755
|
+
forgotPasswordLink && resolvedForgotPasswordHref && /* @__PURE__ */ jsxRuntime.jsx(Link, { href: resolvedForgotPasswordHref, className: "", children: /* @__PURE__ */ jsxRuntime.jsx(PasswordFieldForgotLink, { as: "span", children: forgotPasswordLink.text || "Forget Password?" }) })
|
|
235
756
|
] }),
|
|
236
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
757
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PasswordFieldInputWrapper, { children: [
|
|
237
758
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
238
|
-
|
|
759
|
+
PasswordFieldInput,
|
|
239
760
|
{
|
|
240
761
|
id,
|
|
241
762
|
type: showPassword ? "text" : "password",
|
|
242
|
-
className: "if-passwordField-input",
|
|
243
763
|
value,
|
|
244
764
|
onFocus: handleFocus,
|
|
245
765
|
...props
|
|
246
766
|
}
|
|
247
767
|
),
|
|
248
768
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
249
|
-
|
|
769
|
+
PasswordFieldToggleButton,
|
|
250
770
|
{
|
|
251
771
|
type: "button",
|
|
252
772
|
onClick: () => setShowPassword(!showPassword),
|
|
253
|
-
className: "if-passwordField-toggleButton",
|
|
254
773
|
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
255
774
|
children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOff, { size: 20 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { size: 20 })
|
|
256
775
|
}
|
|
@@ -267,36 +786,27 @@ function AuthSubmitButton({
|
|
|
267
786
|
type = "submit",
|
|
268
787
|
onClick
|
|
269
788
|
}) {
|
|
270
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
271
|
-
|
|
272
|
-
{
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
disabled: disabled || isLoading || confirmed,
|
|
276
|
-
onClick,
|
|
277
|
-
children: [
|
|
278
|
-
isLoading && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "if-submitButton-icon if-submitButton-spinner", size: 20 }),
|
|
279
|
-
confirmed && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, { className: "if-submitButton-icon", size: 20 }),
|
|
280
|
-
children
|
|
281
|
-
]
|
|
282
|
-
}
|
|
283
|
-
);
|
|
789
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(SubmitButton, { type, disabled: disabled || isLoading || confirmed, onClick, children: [
|
|
790
|
+
isLoading && /* @__PURE__ */ jsxRuntime.jsx(SubmitButtonSpinner, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { size: 20 }) }),
|
|
791
|
+
confirmed && /* @__PURE__ */ jsxRuntime.jsx(SubmitButtonIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, { size: 20 }) }),
|
|
792
|
+
children
|
|
793
|
+
] });
|
|
284
794
|
}
|
|
285
795
|
function AuthLink({ text, linkText, href }) {
|
|
286
796
|
const searchParams = useSearchParams();
|
|
287
797
|
const { Link } = useNavigationAdapter();
|
|
288
798
|
const finalHref = resolveAuthUrl(href, searchParams);
|
|
289
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
290
|
-
text && /* @__PURE__ */ jsxRuntime.jsx(
|
|
799
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(AuthLinkWrapper, { children: [
|
|
800
|
+
text && /* @__PURE__ */ jsxRuntime.jsx(AuthLinkText, { children: text }),
|
|
291
801
|
text && " ",
|
|
292
|
-
/* @__PURE__ */ jsxRuntime.jsx(Link, { href: finalHref, className: "
|
|
802
|
+
/* @__PURE__ */ jsxRuntime.jsx(Link, { href: finalHref, className: "", children: /* @__PURE__ */ jsxRuntime.jsx(AuthLinkLink, { as: "span", children: linkText }) })
|
|
293
803
|
] });
|
|
294
804
|
}
|
|
295
805
|
function AuthDivider({ text = "or" }) {
|
|
296
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
297
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
298
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
299
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
806
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(AuthDividerWrapper, { children: [
|
|
807
|
+
/* @__PURE__ */ jsxRuntime.jsx(AuthDividerLine, {}),
|
|
808
|
+
/* @__PURE__ */ jsxRuntime.jsx(AuthDividerText, { children: text }),
|
|
809
|
+
/* @__PURE__ */ jsxRuntime.jsx(AuthDividerLine, {})
|
|
300
810
|
] });
|
|
301
811
|
}
|
|
302
812
|
var OAUTH_PROVIDER_CONFIG = {
|
|
@@ -457,23 +967,17 @@ function AuthOAuthButton({
|
|
|
457
967
|
}
|
|
458
968
|
return "";
|
|
459
969
|
};
|
|
460
|
-
const
|
|
461
|
-
"if-oauthButton",
|
|
462
|
-
"if-internal-o4k7w2",
|
|
463
|
-
displayMode === "full" && "if-oauthButton-full",
|
|
464
|
-
displayMode === "short" && "if-oauthButton-short",
|
|
465
|
-
displayMode === "icon" && "if-oauthButton-icon-only"
|
|
466
|
-
].filter(Boolean).join(" ");
|
|
970
|
+
const variant = displayMode === "icon" ? "iconOnly" : displayMode;
|
|
467
971
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
468
|
-
|
|
972
|
+
OAuthButton,
|
|
469
973
|
{
|
|
470
974
|
type: "button",
|
|
471
975
|
onClick: () => onClick(provider),
|
|
472
|
-
|
|
976
|
+
$variant: variant,
|
|
473
977
|
disabled: disabled || loading,
|
|
474
978
|
style,
|
|
475
979
|
children: [
|
|
476
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
980
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(SubmitButtonSpinner, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { size: 18 }) }) : /* @__PURE__ */ jsxRuntime.jsx(OAuthButtonIcon, { children: config.svg }),
|
|
477
981
|
!loading && getButtonText() && /* @__PURE__ */ jsxRuntime.jsx("span", { children: getButtonText() })
|
|
478
982
|
]
|
|
479
983
|
}
|
|
@@ -532,14 +1036,12 @@ function AuthOAuthProviders({
|
|
|
532
1036
|
}
|
|
533
1037
|
};
|
|
534
1038
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
535
|
-
|
|
1039
|
+
OAuthProvidersContainer,
|
|
536
1040
|
{
|
|
537
|
-
className: "if-oauthProviders if-internal-op3m8k",
|
|
538
1041
|
style: {
|
|
539
1042
|
display: "grid",
|
|
540
1043
|
gridTemplateColumns: "repeat(6, 1fr)",
|
|
541
|
-
gap: "0.75rem"
|
|
542
|
-
width: "100%"
|
|
1044
|
+
gap: "0.75rem"
|
|
543
1045
|
},
|
|
544
1046
|
children: providers.map((provider, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
545
1047
|
AuthOAuthButton,
|
|
@@ -563,7 +1065,7 @@ function AuthVerificationCodeInput({
|
|
|
563
1065
|
disabled = false,
|
|
564
1066
|
onComplete
|
|
565
1067
|
}) {
|
|
566
|
-
const inputRefs = react.useRef([]);
|
|
1068
|
+
const inputRefs = react$1.useRef([]);
|
|
567
1069
|
const handleChange = (index, digit) => {
|
|
568
1070
|
if (digit.length > 1) {
|
|
569
1071
|
return;
|
|
@@ -606,8 +1108,8 @@ function AuthVerificationCodeInput({
|
|
|
606
1108
|
}
|
|
607
1109
|
}
|
|
608
1110
|
};
|
|
609
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
610
|
-
|
|
1111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(VerificationCodeInputContainer, { children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1112
|
+
VerificationCodeInput,
|
|
611
1113
|
{
|
|
612
1114
|
ref: (el) => {
|
|
613
1115
|
inputRefs.current[index] = el;
|
|
@@ -620,14 +1122,13 @@ function AuthVerificationCodeInput({
|
|
|
620
1122
|
onKeyDown: (e) => handleKeyDown(index, e),
|
|
621
1123
|
onPaste: handlePaste,
|
|
622
1124
|
disabled,
|
|
623
|
-
className: "if-verificationCode-input",
|
|
624
1125
|
autoComplete: "one-time-code"
|
|
625
1126
|
},
|
|
626
1127
|
index
|
|
627
1128
|
)) });
|
|
628
1129
|
}
|
|
629
1130
|
function useInsforge() {
|
|
630
|
-
const context = react.useContext(react$
|
|
1131
|
+
const context = react$1.useContext(react$2.InsforgeContext);
|
|
631
1132
|
if (!context) {
|
|
632
1133
|
return {
|
|
633
1134
|
user: void 0,
|
|
@@ -654,6 +1155,155 @@ function useInsforge() {
|
|
|
654
1155
|
}
|
|
655
1156
|
return context;
|
|
656
1157
|
}
|
|
1158
|
+
styled__default.default.form`
|
|
1159
|
+
display: flex;
|
|
1160
|
+
flex-direction: column;
|
|
1161
|
+
align-items: stretch;
|
|
1162
|
+
justify-content: center;
|
|
1163
|
+
gap: ${theme.spacing[6]};
|
|
1164
|
+
`;
|
|
1165
|
+
var VerificationStepWrapper = styled__default.default.div`
|
|
1166
|
+
display: flex;
|
|
1167
|
+
flex-direction: column;
|
|
1168
|
+
gap: ${theme.spacing[6]};
|
|
1169
|
+
align-items: stretch;
|
|
1170
|
+
`;
|
|
1171
|
+
var VerificationStepDescriptionContainer = styled__default.default.div`
|
|
1172
|
+
width: 100%;
|
|
1173
|
+
background-color: ${theme.colors.bgGray};
|
|
1174
|
+
border-radius: ${theme.radius.lg};
|
|
1175
|
+
padding: ${theme.spacing[3]} ${theme.spacing[3]} ${theme.spacing[6]} ${theme.spacing[3]};
|
|
1176
|
+
display: flex;
|
|
1177
|
+
flex-direction: column;
|
|
1178
|
+
gap: ${theme.spacing[3]};
|
|
1179
|
+
`;
|
|
1180
|
+
var VerificationStepDescriptionTitle = styled__default.default.h3`
|
|
1181
|
+
color: ${theme.colors.black};
|
|
1182
|
+
font-family: ${theme.fontFamily.base};
|
|
1183
|
+
font-size: ${theme.fontSize.base};
|
|
1184
|
+
font-style: normal;
|
|
1185
|
+
font-weight: ${theme.fontWeight.semibold};
|
|
1186
|
+
line-height: 24px;
|
|
1187
|
+
margin: 0;
|
|
1188
|
+
`;
|
|
1189
|
+
var VerificationStepDescription = styled__default.default.p`
|
|
1190
|
+
font-size: ${theme.fontSize.sm};
|
|
1191
|
+
color: ${theme.colors.textGray};
|
|
1192
|
+
text-align: left;
|
|
1193
|
+
font-family: ${theme.fontFamily.base};
|
|
1194
|
+
margin: 0;
|
|
1195
|
+
`;
|
|
1196
|
+
var VerificationEmail = styled__default.default.span`
|
|
1197
|
+
font-weight: ${theme.fontWeight.medium};
|
|
1198
|
+
color: ${theme.colors.text};
|
|
1199
|
+
`;
|
|
1200
|
+
var VerificationStepCodeContainer = styled__default.default.div`
|
|
1201
|
+
width: 100%;
|
|
1202
|
+
display: flex;
|
|
1203
|
+
flex-direction: column;
|
|
1204
|
+
gap: ${theme.spacing[10]};
|
|
1205
|
+
`;
|
|
1206
|
+
var VerificationStepCodeInputWrapper = styled__default.default.div`
|
|
1207
|
+
display: flex;
|
|
1208
|
+
flex-direction: column;
|
|
1209
|
+
gap: ${theme.spacing[6]};
|
|
1210
|
+
`;
|
|
1211
|
+
styled__default.default.p`
|
|
1212
|
+
font-size: ${theme.fontSize.sm};
|
|
1213
|
+
color: ${theme.colors.textSecondary};
|
|
1214
|
+
text-align: center;
|
|
1215
|
+
font-family: ${theme.fontFamily.base};
|
|
1216
|
+
margin: 0;
|
|
1217
|
+
`;
|
|
1218
|
+
var VerificationStepResendContainer = styled__default.default.div`
|
|
1219
|
+
width: 100%;
|
|
1220
|
+
font-size: ${theme.fontSize.sm};
|
|
1221
|
+
text-align: center;
|
|
1222
|
+
color: ${theme.colors.textSecondary};
|
|
1223
|
+
font-family: ${theme.fontFamily.base};
|
|
1224
|
+
`;
|
|
1225
|
+
var VerificationStepResendButton = styled__default.default.button`
|
|
1226
|
+
color: ${theme.colors.text};
|
|
1227
|
+
font-weight: ${theme.fontWeight.medium};
|
|
1228
|
+
transition: all ${theme.transition.base};
|
|
1229
|
+
background: none;
|
|
1230
|
+
border: none;
|
|
1231
|
+
padding: 0;
|
|
1232
|
+
font-family: ${theme.fontFamily.base};
|
|
1233
|
+
font-size: ${theme.fontSize.sm};
|
|
1234
|
+
|
|
1235
|
+
&:not(:disabled) {
|
|
1236
|
+
cursor: pointer;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
&:disabled {
|
|
1240
|
+
cursor: not-allowed;
|
|
1241
|
+
opacity: 0.5;
|
|
1242
|
+
}
|
|
1243
|
+
`;
|
|
1244
|
+
styled__default.default.div`
|
|
1245
|
+
width: 100%;
|
|
1246
|
+
display: flex;
|
|
1247
|
+
flex-direction: column;
|
|
1248
|
+
align-items: ${(props) => props.$stretch ? "stretch" : "center"};
|
|
1249
|
+
justify-content: center;
|
|
1250
|
+
gap: ${theme.spacing[6]};
|
|
1251
|
+
`;
|
|
1252
|
+
styled__default.default.div`
|
|
1253
|
+
border-radius: ${theme.radius.full};
|
|
1254
|
+
height: ${theme.sizes.verifyCode};
|
|
1255
|
+
width: ${theme.sizes.verifyCode};
|
|
1256
|
+
border-bottom: 2px solid ${theme.colors.primary};
|
|
1257
|
+
`;
|
|
1258
|
+
styled__default.default.div`
|
|
1259
|
+
display: flex;
|
|
1260
|
+
flex-direction: column;
|
|
1261
|
+
align-items: center;
|
|
1262
|
+
gap: ${theme.spacing[4]};
|
|
1263
|
+
`;
|
|
1264
|
+
styled__default.default.div`
|
|
1265
|
+
width: ${theme.sizes.verifyIcon};
|
|
1266
|
+
height: ${theme.sizes.verifyIcon};
|
|
1267
|
+
border-radius: ${theme.radius.full};
|
|
1268
|
+
background-color: ${theme.colors.successBg};
|
|
1269
|
+
display: flex;
|
|
1270
|
+
align-items: center;
|
|
1271
|
+
justify-content: center;
|
|
1272
|
+
`;
|
|
1273
|
+
styled__default.default.div`
|
|
1274
|
+
width: ${theme.sizes.verifyIconInner};
|
|
1275
|
+
height: ${theme.sizes.verifyIconInner};
|
|
1276
|
+
color: ${theme.colors.successDark};
|
|
1277
|
+
display: flex;
|
|
1278
|
+
align-items: center;
|
|
1279
|
+
justify-content: center;
|
|
1280
|
+
|
|
1281
|
+
svg {
|
|
1282
|
+
width: 100%;
|
|
1283
|
+
height: 100%;
|
|
1284
|
+
}
|
|
1285
|
+
`;
|
|
1286
|
+
styled__default.default.p`
|
|
1287
|
+
text-align: center;
|
|
1288
|
+
font-family: ${theme.fontFamily.base};
|
|
1289
|
+
font-size: ${theme.fontSize.sm};
|
|
1290
|
+
color: ${theme.colors.text};
|
|
1291
|
+
margin: 0;
|
|
1292
|
+
`;
|
|
1293
|
+
styled__default.default.div`
|
|
1294
|
+
display: none;
|
|
1295
|
+
`;
|
|
1296
|
+
styled__default.default.span`
|
|
1297
|
+
position: absolute;
|
|
1298
|
+
width: 1px;
|
|
1299
|
+
height: 1px;
|
|
1300
|
+
padding: 0;
|
|
1301
|
+
margin: -1px;
|
|
1302
|
+
overflow: hidden;
|
|
1303
|
+
clip: rect(0, 0, 0, 0);
|
|
1304
|
+
white-space: nowrap;
|
|
1305
|
+
border-width: 0;
|
|
1306
|
+
`;
|
|
657
1307
|
function AuthEmailVerificationStep({
|
|
658
1308
|
email,
|
|
659
1309
|
method,
|
|
@@ -661,14 +1311,14 @@ function AuthEmailVerificationStep({
|
|
|
661
1311
|
emailSent = false
|
|
662
1312
|
}) {
|
|
663
1313
|
const { sendVerificationEmail } = useInsforge();
|
|
664
|
-
const [resendDisabled, setResendDisabled] = react.useState(emailSent ? true : false);
|
|
665
|
-
const [resendCountdown, setResendCountdown] = react.useState(emailSent ? 60 : 0);
|
|
666
|
-
const [isSending, setIsSending] = react.useState(false);
|
|
667
|
-
const [verificationCode, setVerificationCode] = react.useState("");
|
|
668
|
-
const [isVerifying, setIsVerifying] = react.useState(false);
|
|
1314
|
+
const [resendDisabled, setResendDisabled] = react$1.useState(emailSent ? true : false);
|
|
1315
|
+
const [resendCountdown, setResendCountdown] = react$1.useState(emailSent ? 60 : 0);
|
|
1316
|
+
const [isSending, setIsSending] = react$1.useState(false);
|
|
1317
|
+
const [verificationCode, setVerificationCode] = react$1.useState("");
|
|
1318
|
+
const [isVerifying, setIsVerifying] = react$1.useState(false);
|
|
669
1319
|
const isLinkMethod = method === "link";
|
|
670
1320
|
const displayDescription = isLinkMethod ? "We've sent an email to {email}. Please check your email to confirm your account before signing in. The confirmation link expires in 10 minutes." : "We've sent a verification code to your inbox at {email}. Enter it below to proceed.";
|
|
671
|
-
react.useEffect(() => {
|
|
1321
|
+
react$1.useEffect(() => {
|
|
672
1322
|
if (resendDisabled && resendCountdown > 0) {
|
|
673
1323
|
const timer = setInterval(() => {
|
|
674
1324
|
setResendCountdown((prev) => {
|
|
@@ -707,19 +1357,19 @@ function AuthEmailVerificationStep({
|
|
|
707
1357
|
setVerificationCode("");
|
|
708
1358
|
}
|
|
709
1359
|
};
|
|
710
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
711
|
-
isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
712
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
713
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1360
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VerificationStepWrapper, { children: [
|
|
1361
|
+
isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs(VerificationStepDescriptionContainer, { children: [
|
|
1362
|
+
/* @__PURE__ */ jsxRuntime.jsx(VerificationStepDescriptionTitle, { children: "Verify Your Email" }),
|
|
1363
|
+
/* @__PURE__ */ jsxRuntime.jsx(VerificationStepDescription, { children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
714
1364
|
part,
|
|
715
|
-
index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1365
|
+
index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(VerificationEmail, { children: email })
|
|
716
1366
|
] }, index)) })
|
|
717
1367
|
] }),
|
|
718
|
-
!isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
719
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
720
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1368
|
+
!isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs(VerificationStepCodeContainer, { children: [
|
|
1369
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VerificationStepCodeInputWrapper, { children: [
|
|
1370
|
+
/* @__PURE__ */ jsxRuntime.jsx(VerificationStepDescription, { children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
721
1371
|
part,
|
|
722
|
-
index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1372
|
+
index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(VerificationEmail, { children: email })
|
|
723
1373
|
] }, index)) }),
|
|
724
1374
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
725
1375
|
AuthVerificationCodeInput,
|
|
@@ -743,17 +1393,16 @@ function AuthEmailVerificationStep({
|
|
|
743
1393
|
}
|
|
744
1394
|
)
|
|
745
1395
|
] }),
|
|
746
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1396
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VerificationStepResendContainer, { children: [
|
|
747
1397
|
"Didn't receive the email?",
|
|
748
1398
|
" ",
|
|
749
1399
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
750
|
-
|
|
1400
|
+
VerificationStepResendButton,
|
|
751
1401
|
{
|
|
752
1402
|
onClick: () => {
|
|
753
1403
|
void handleResend();
|
|
754
1404
|
},
|
|
755
1405
|
disabled: resendDisabled || isSending,
|
|
756
|
-
className: "if-verificationStep-resendButton",
|
|
757
1406
|
children: isSending ? "Sending..." : resendDisabled ? `Retry in (${resendCountdown}s)` : "Click to resend"
|
|
758
1407
|
}
|
|
759
1408
|
)
|
|
@@ -766,14 +1415,14 @@ function AuthResetPasswordVerificationStep({
|
|
|
766
1415
|
onVerifyCode,
|
|
767
1416
|
onResendEmail
|
|
768
1417
|
}) {
|
|
769
|
-
const [resendDisabled, setResendDisabled] = react.useState(true);
|
|
770
|
-
const [resendCountdown, setResendCountdown] = react.useState(60);
|
|
771
|
-
const [isSending, setIsSending] = react.useState(false);
|
|
772
|
-
const [verificationCode, setVerificationCode] = react.useState("");
|
|
773
|
-
const [isVerifying, setIsVerifying] = react.useState(false);
|
|
1418
|
+
const [resendDisabled, setResendDisabled] = react$1.useState(true);
|
|
1419
|
+
const [resendCountdown, setResendCountdown] = react$1.useState(60);
|
|
1420
|
+
const [isSending, setIsSending] = react$1.useState(false);
|
|
1421
|
+
const [verificationCode, setVerificationCode] = react$1.useState("");
|
|
1422
|
+
const [isVerifying, setIsVerifying] = react$1.useState(false);
|
|
774
1423
|
const isLinkMethod = method === "link";
|
|
775
1424
|
const displayDescription = isLinkMethod ? "We have sent an email to {email}. Please check your email to reset your password. The link expires in 10 minutes." : "We've sent a reset password code to your inbox at {email}. Enter it below to proceed.";
|
|
776
|
-
react.useEffect(() => {
|
|
1425
|
+
react$1.useEffect(() => {
|
|
777
1426
|
if (resendCountdown > 0) {
|
|
778
1427
|
const timer = setInterval(() => {
|
|
779
1428
|
setResendCountdown((prev) => {
|
|
@@ -787,7 +1436,7 @@ function AuthResetPasswordVerificationStep({
|
|
|
787
1436
|
return () => clearInterval(timer);
|
|
788
1437
|
}
|
|
789
1438
|
}, [resendCountdown]);
|
|
790
|
-
const handleResend = react.useCallback(async () => {
|
|
1439
|
+
const handleResend = react$1.useCallback(async () => {
|
|
791
1440
|
setResendDisabled(true);
|
|
792
1441
|
setResendCountdown(60);
|
|
793
1442
|
setIsSending(true);
|
|
@@ -812,16 +1461,16 @@ function AuthResetPasswordVerificationStep({
|
|
|
812
1461
|
setVerificationCode("");
|
|
813
1462
|
}
|
|
814
1463
|
};
|
|
815
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
816
|
-
isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
817
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
818
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1464
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VerificationStepWrapper, { children: [
|
|
1465
|
+
isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs(VerificationStepDescriptionContainer, { children: [
|
|
1466
|
+
/* @__PURE__ */ jsxRuntime.jsx(VerificationStepDescriptionTitle, { children: "Check Your Email" }),
|
|
1467
|
+
/* @__PURE__ */ jsxRuntime.jsx(VerificationStepDescription, { children: displayDescription.split("{email}").map((part, index, array) => /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
819
1468
|
part,
|
|
820
|
-
index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1469
|
+
index < array.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(VerificationEmail, { children: email })
|
|
821
1470
|
] }, index)) })
|
|
822
1471
|
] }),
|
|
823
|
-
!isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
824
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1472
|
+
!isLinkMethod && /* @__PURE__ */ jsxRuntime.jsxs(VerificationStepCodeContainer, { children: [
|
|
1473
|
+
/* @__PURE__ */ jsxRuntime.jsx(VerificationStepCodeInputWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
825
1474
|
AuthVerificationCodeInput,
|
|
826
1475
|
{
|
|
827
1476
|
value: verificationCode,
|
|
@@ -842,17 +1491,16 @@ function AuthResetPasswordVerificationStep({
|
|
|
842
1491
|
}
|
|
843
1492
|
)
|
|
844
1493
|
] }),
|
|
845
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1494
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VerificationStepResendContainer, { children: [
|
|
846
1495
|
"Didn't receive the email?",
|
|
847
1496
|
" ",
|
|
848
1497
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
849
|
-
|
|
1498
|
+
VerificationStepResendButton,
|
|
850
1499
|
{
|
|
851
1500
|
onClick: () => {
|
|
852
1501
|
void handleResend();
|
|
853
1502
|
},
|
|
854
1503
|
disabled: resendDisabled || isSending,
|
|
855
|
-
className: "if-verificationStep-resendButton",
|
|
856
1504
|
children: isSending ? "Sending..." : resendDisabled ? `Retry in (${resendCountdown}s)` : "Click to resend"
|
|
857
1505
|
}
|
|
858
1506
|
)
|