@authrim/sveltekit 0.1.0 → 0.1.2
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/LICENSE +191 -191
- package/README.md +527 -531
- package/dist/components/AuthProvider.svelte +56 -56
- package/dist/components/ProtectedRoute.svelte +71 -71
- package/dist/components/SignInButton.svelte +93 -93
- package/dist/components/SignOutButton.svelte +72 -72
- package/dist/components/UserProfile.svelte +71 -71
- package/dist/ui/account/LinkAccountButton.svelte +133 -133
- package/dist/ui/account/LinkedAccountsList.svelte +233 -233
- package/dist/ui/account/UnlinkAccountButton.svelte +179 -179
- package/dist/ui/forms/EmailCodeForm.svelte +224 -224
- package/dist/ui/forms/PasskeyConditionalInput.svelte +173 -173
- package/dist/ui/forms/SocialLoginButtons.svelte +209 -209
- package/dist/ui/helpers/AuthError.svelte +124 -124
- package/dist/ui/helpers/AuthLoading.svelte +83 -83
- package/dist/ui/helpers/OTPInput.svelte +214 -214
- package/dist/ui/helpers/ResendCodeButton.svelte +140 -140
- package/dist/ui/passkey/PasskeyDeleteButton.svelte +177 -177
- package/dist/ui/passkey/PasskeyList.svelte +225 -225
- package/dist/ui/passkey/PasskeyRegisterButton.svelte +52 -52
- package/dist/ui/session/SessionExpiryIndicator.svelte +109 -109
- package/dist/ui/session/SessionList.svelte +231 -231
- package/dist/ui/session/SessionRevokeButton.svelte +72 -72
- package/dist/ui/shared/Badge.svelte +100 -100
- package/dist/ui/shared/Button.svelte +213 -213
- package/dist/ui/shared/Card.svelte +85 -85
- package/dist/ui/shared/Input.svelte +192 -192
- package/dist/ui/shared/Spinner.svelte +75 -75
- package/dist/ui/styles/base.css +168 -168
- package/dist/ui/styles/theme.css +279 -279
- package/dist/ui/templates/AccountSettingsTemplate.svelte +205 -205
- package/dist/ui/templates/LoginTemplate.svelte +234 -234
- package/dist/ui/templates/SignUpTemplate.svelte +345 -345
- package/package.json +112 -111
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Spinner Component
|
|
3
|
-
Animated loading indicator with refined motion
|
|
4
|
-
-->
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import type { Size } from '../types.js';
|
|
7
|
-
|
|
8
|
-
export let size: Size = 'md';
|
|
9
|
-
let className = '';
|
|
10
|
-
export { className as class };
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<svg
|
|
14
|
-
class="authrim-spinner authrim-spinner--{size} {className}"
|
|
15
|
-
viewBox="0 0 24 24"
|
|
16
|
-
fill="none"
|
|
17
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
-
aria-hidden="true"
|
|
19
|
-
{...$$restProps}
|
|
20
|
-
>
|
|
21
|
-
<circle
|
|
22
|
-
class="authrim-spinner__track"
|
|
23
|
-
cx="12"
|
|
24
|
-
cy="12"
|
|
25
|
-
r="10"
|
|
26
|
-
stroke="currentColor"
|
|
27
|
-
stroke-width="2.5"
|
|
28
|
-
stroke-linecap="round"
|
|
29
|
-
/>
|
|
30
|
-
<circle
|
|
31
|
-
class="authrim-spinner__indicator"
|
|
32
|
-
cx="12"
|
|
33
|
-
cy="12"
|
|
34
|
-
r="10"
|
|
35
|
-
stroke="currentColor"
|
|
36
|
-
stroke-width="2.5"
|
|
37
|
-
stroke-linecap="round"
|
|
38
|
-
stroke-dasharray="62.83"
|
|
39
|
-
stroke-dashoffset="47.12"
|
|
40
|
-
/>
|
|
41
|
-
</svg>
|
|
42
|
-
|
|
43
|
-
<style>
|
|
44
|
-
.authrim-spinner {
|
|
45
|
-
display: inline-block;
|
|
46
|
-
animation: spin 0.8s linear infinite;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@keyframes spin {
|
|
50
|
-
to { transform: rotate(360deg); }
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.authrim-spinner--sm {
|
|
54
|
-
width: 16px;
|
|
55
|
-
height: 16px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.authrim-spinner--md {
|
|
59
|
-
width: 24px;
|
|
60
|
-
height: 24px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.authrim-spinner--lg {
|
|
64
|
-
width: 32px;
|
|
65
|
-
height: 32px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.authrim-spinner__track {
|
|
69
|
-
opacity: 0.15;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.authrim-spinner__indicator {
|
|
73
|
-
opacity: 0.9;
|
|
74
|
-
}
|
|
75
|
-
</style>
|
|
1
|
+
<!--
|
|
2
|
+
Spinner Component
|
|
3
|
+
Animated loading indicator with refined motion
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import type { Size } from '../types.js';
|
|
7
|
+
|
|
8
|
+
export let size: Size = 'md';
|
|
9
|
+
let className = '';
|
|
10
|
+
export { className as class };
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<svg
|
|
14
|
+
class="authrim-spinner authrim-spinner--{size} {className}"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
fill="none"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
aria-hidden="true"
|
|
19
|
+
{...$$restProps}
|
|
20
|
+
>
|
|
21
|
+
<circle
|
|
22
|
+
class="authrim-spinner__track"
|
|
23
|
+
cx="12"
|
|
24
|
+
cy="12"
|
|
25
|
+
r="10"
|
|
26
|
+
stroke="currentColor"
|
|
27
|
+
stroke-width="2.5"
|
|
28
|
+
stroke-linecap="round"
|
|
29
|
+
/>
|
|
30
|
+
<circle
|
|
31
|
+
class="authrim-spinner__indicator"
|
|
32
|
+
cx="12"
|
|
33
|
+
cy="12"
|
|
34
|
+
r="10"
|
|
35
|
+
stroke="currentColor"
|
|
36
|
+
stroke-width="2.5"
|
|
37
|
+
stroke-linecap="round"
|
|
38
|
+
stroke-dasharray="62.83"
|
|
39
|
+
stroke-dashoffset="47.12"
|
|
40
|
+
/>
|
|
41
|
+
</svg>
|
|
42
|
+
|
|
43
|
+
<style>
|
|
44
|
+
.authrim-spinner {
|
|
45
|
+
display: inline-block;
|
|
46
|
+
animation: spin 0.8s linear infinite;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@keyframes spin {
|
|
50
|
+
to { transform: rotate(360deg); }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.authrim-spinner--sm {
|
|
54
|
+
width: 16px;
|
|
55
|
+
height: 16px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.authrim-spinner--md {
|
|
59
|
+
width: 24px;
|
|
60
|
+
height: 24px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.authrim-spinner--lg {
|
|
64
|
+
width: 32px;
|
|
65
|
+
height: 32px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.authrim-spinner__track {
|
|
69
|
+
opacity: 0.15;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.authrim-spinner__indicator {
|
|
73
|
+
opacity: 0.9;
|
|
74
|
+
}
|
|
75
|
+
</style>
|
package/dist/ui/styles/base.css
CHANGED
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authrim UI Base Styles
|
|
3
|
-
* Global resets and utility classes
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/* === Base Reset === */
|
|
7
|
-
.authrim-ui,
|
|
8
|
-
.authrim-ui *,
|
|
9
|
-
.authrim-ui *::before,
|
|
10
|
-
.authrim-ui *::after {
|
|
11
|
-
box-sizing: border-box;
|
|
12
|
-
margin: 0;
|
|
13
|
-
padding: 0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.authrim-ui {
|
|
17
|
-
font-family: var(--authrim-font-sans);
|
|
18
|
-
font-size: var(--authrim-text-base);
|
|
19
|
-
line-height: var(--authrim-leading-normal);
|
|
20
|
-
color: var(--authrim-color-text);
|
|
21
|
-
-webkit-font-smoothing: antialiased;
|
|
22
|
-
-moz-osx-font-smoothing: grayscale;
|
|
23
|
-
text-rendering: optimizeLegibility;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* === Focus Management === */
|
|
27
|
-
.authrim-ui :focus {
|
|
28
|
-
outline: none;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.authrim-ui :focus-visible {
|
|
32
|
-
outline: none;
|
|
33
|
-
box-shadow: var(--authrim-shadow-focus);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* === Screen Reader Only === */
|
|
37
|
-
.authrim-sr-only {
|
|
38
|
-
position: absolute;
|
|
39
|
-
width: 1px;
|
|
40
|
-
height: 1px;
|
|
41
|
-
padding: 0;
|
|
42
|
-
margin: -1px;
|
|
43
|
-
overflow: hidden;
|
|
44
|
-
clip: rect(0, 0, 0, 0);
|
|
45
|
-
white-space: nowrap;
|
|
46
|
-
border: 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* === Animations === */
|
|
50
|
-
@keyframes authrim-spin {
|
|
51
|
-
to { transform: rotate(360deg); }
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@keyframes authrim-pulse {
|
|
55
|
-
0%, 100% { opacity: 1; }
|
|
56
|
-
50% { opacity: 0.5; }
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@keyframes authrim-fade-in {
|
|
60
|
-
from { opacity: 0; }
|
|
61
|
-
to { opacity: 1; }
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@keyframes authrim-fade-up {
|
|
65
|
-
from {
|
|
66
|
-
opacity: 0;
|
|
67
|
-
transform: translateY(8px);
|
|
68
|
-
}
|
|
69
|
-
to {
|
|
70
|
-
opacity: 1;
|
|
71
|
-
transform: translateY(0);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@keyframes authrim-fade-down {
|
|
76
|
-
from {
|
|
77
|
-
opacity: 0;
|
|
78
|
-
transform: translateY(-8px);
|
|
79
|
-
}
|
|
80
|
-
to {
|
|
81
|
-
opacity: 1;
|
|
82
|
-
transform: translateY(0);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@keyframes authrim-scale-in {
|
|
87
|
-
from {
|
|
88
|
-
opacity: 0;
|
|
89
|
-
transform: scale(0.95);
|
|
90
|
-
}
|
|
91
|
-
to {
|
|
92
|
-
opacity: 1;
|
|
93
|
-
transform: scale(1);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@keyframes authrim-shake {
|
|
98
|
-
0%, 100% { transform: translateX(0); }
|
|
99
|
-
10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
|
|
100
|
-
20%, 40%, 60%, 80% { transform: translateX(4px); }
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@keyframes authrim-slide-in-right {
|
|
104
|
-
from {
|
|
105
|
-
opacity: 0;
|
|
106
|
-
transform: translateX(16px);
|
|
107
|
-
}
|
|
108
|
-
to {
|
|
109
|
-
opacity: 1;
|
|
110
|
-
transform: translateX(0);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
@keyframes authrim-bounce-subtle {
|
|
115
|
-
0%, 100% { transform: translateY(0); }
|
|
116
|
-
50% { transform: translateY(-2px); }
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
@keyframes authrim-glow-pulse {
|
|
120
|
-
0%, 100% {
|
|
121
|
-
box-shadow: 0 0 0 0 var(--authrim-color-primary-subtle);
|
|
122
|
-
}
|
|
123
|
-
50% {
|
|
124
|
-
box-shadow: 0 0 0 8px transparent;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
@keyframes authrim-digit-pop {
|
|
129
|
-
0% { transform: scale(1); }
|
|
130
|
-
50% { transform: scale(1.1); }
|
|
131
|
-
100% { transform: scale(1); }
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/* === Animation Utilities === */
|
|
135
|
-
.authrim-animate-spin {
|
|
136
|
-
animation: authrim-spin 1s linear infinite;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.authrim-animate-pulse {
|
|
140
|
-
animation: authrim-pulse 2s ease-in-out infinite;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.authrim-animate-fade-in {
|
|
144
|
-
animation: authrim-fade-in var(--authrim-duration-normal) var(--authrim-ease-out);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.authrim-animate-fade-up {
|
|
148
|
-
animation: authrim-fade-up var(--authrim-duration-normal) var(--authrim-ease-out);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.authrim-animate-scale-in {
|
|
152
|
-
animation: authrim-scale-in var(--authrim-duration-normal) var(--authrim-ease-bounce);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.authrim-animate-shake {
|
|
156
|
-
animation: authrim-shake 0.5s ease-in-out;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/* === Reduced Motion === */
|
|
160
|
-
@media (prefers-reduced-motion: reduce) {
|
|
161
|
-
.authrim-ui *,
|
|
162
|
-
.authrim-ui *::before,
|
|
163
|
-
.authrim-ui *::after {
|
|
164
|
-
animation-duration: 0.01ms !important;
|
|
165
|
-
animation-iteration-count: 1 !important;
|
|
166
|
-
transition-duration: 0.01ms !important;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Authrim UI Base Styles
|
|
3
|
+
* Global resets and utility classes
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* === Base Reset === */
|
|
7
|
+
.authrim-ui,
|
|
8
|
+
.authrim-ui *,
|
|
9
|
+
.authrim-ui *::before,
|
|
10
|
+
.authrim-ui *::after {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.authrim-ui {
|
|
17
|
+
font-family: var(--authrim-font-sans);
|
|
18
|
+
font-size: var(--authrim-text-base);
|
|
19
|
+
line-height: var(--authrim-leading-normal);
|
|
20
|
+
color: var(--authrim-color-text);
|
|
21
|
+
-webkit-font-smoothing: antialiased;
|
|
22
|
+
-moz-osx-font-smoothing: grayscale;
|
|
23
|
+
text-rendering: optimizeLegibility;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* === Focus Management === */
|
|
27
|
+
.authrim-ui :focus {
|
|
28
|
+
outline: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.authrim-ui :focus-visible {
|
|
32
|
+
outline: none;
|
|
33
|
+
box-shadow: var(--authrim-shadow-focus);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* === Screen Reader Only === */
|
|
37
|
+
.authrim-sr-only {
|
|
38
|
+
position: absolute;
|
|
39
|
+
width: 1px;
|
|
40
|
+
height: 1px;
|
|
41
|
+
padding: 0;
|
|
42
|
+
margin: -1px;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
clip: rect(0, 0, 0, 0);
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
border: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* === Animations === */
|
|
50
|
+
@keyframes authrim-spin {
|
|
51
|
+
to { transform: rotate(360deg); }
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@keyframes authrim-pulse {
|
|
55
|
+
0%, 100% { opacity: 1; }
|
|
56
|
+
50% { opacity: 0.5; }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@keyframes authrim-fade-in {
|
|
60
|
+
from { opacity: 0; }
|
|
61
|
+
to { opacity: 1; }
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@keyframes authrim-fade-up {
|
|
65
|
+
from {
|
|
66
|
+
opacity: 0;
|
|
67
|
+
transform: translateY(8px);
|
|
68
|
+
}
|
|
69
|
+
to {
|
|
70
|
+
opacity: 1;
|
|
71
|
+
transform: translateY(0);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@keyframes authrim-fade-down {
|
|
76
|
+
from {
|
|
77
|
+
opacity: 0;
|
|
78
|
+
transform: translateY(-8px);
|
|
79
|
+
}
|
|
80
|
+
to {
|
|
81
|
+
opacity: 1;
|
|
82
|
+
transform: translateY(0);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@keyframes authrim-scale-in {
|
|
87
|
+
from {
|
|
88
|
+
opacity: 0;
|
|
89
|
+
transform: scale(0.95);
|
|
90
|
+
}
|
|
91
|
+
to {
|
|
92
|
+
opacity: 1;
|
|
93
|
+
transform: scale(1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@keyframes authrim-shake {
|
|
98
|
+
0%, 100% { transform: translateX(0); }
|
|
99
|
+
10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
|
|
100
|
+
20%, 40%, 60%, 80% { transform: translateX(4px); }
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@keyframes authrim-slide-in-right {
|
|
104
|
+
from {
|
|
105
|
+
opacity: 0;
|
|
106
|
+
transform: translateX(16px);
|
|
107
|
+
}
|
|
108
|
+
to {
|
|
109
|
+
opacity: 1;
|
|
110
|
+
transform: translateX(0);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@keyframes authrim-bounce-subtle {
|
|
115
|
+
0%, 100% { transform: translateY(0); }
|
|
116
|
+
50% { transform: translateY(-2px); }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@keyframes authrim-glow-pulse {
|
|
120
|
+
0%, 100% {
|
|
121
|
+
box-shadow: 0 0 0 0 var(--authrim-color-primary-subtle);
|
|
122
|
+
}
|
|
123
|
+
50% {
|
|
124
|
+
box-shadow: 0 0 0 8px transparent;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@keyframes authrim-digit-pop {
|
|
129
|
+
0% { transform: scale(1); }
|
|
130
|
+
50% { transform: scale(1.1); }
|
|
131
|
+
100% { transform: scale(1); }
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* === Animation Utilities === */
|
|
135
|
+
.authrim-animate-spin {
|
|
136
|
+
animation: authrim-spin 1s linear infinite;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.authrim-animate-pulse {
|
|
140
|
+
animation: authrim-pulse 2s ease-in-out infinite;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.authrim-animate-fade-in {
|
|
144
|
+
animation: authrim-fade-in var(--authrim-duration-normal) var(--authrim-ease-out);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.authrim-animate-fade-up {
|
|
148
|
+
animation: authrim-fade-up var(--authrim-duration-normal) var(--authrim-ease-out);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.authrim-animate-scale-in {
|
|
152
|
+
animation: authrim-scale-in var(--authrim-duration-normal) var(--authrim-ease-bounce);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.authrim-animate-shake {
|
|
156
|
+
animation: authrim-shake 0.5s ease-in-out;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* === Reduced Motion === */
|
|
160
|
+
@media (prefers-reduced-motion: reduce) {
|
|
161
|
+
.authrim-ui *,
|
|
162
|
+
.authrim-ui *::before,
|
|
163
|
+
.authrim-ui *::after {
|
|
164
|
+
animation-duration: 0.01ms !important;
|
|
165
|
+
animation-iteration-count: 1 !important;
|
|
166
|
+
transition-duration: 0.01ms !important;
|
|
167
|
+
}
|
|
168
|
+
}
|