@seamless-auth/svelte 0.0.0-stage → 0.2.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/LICENSE +202 -0
  3. package/README.md +253 -2
  4. package/dist/auth.svelte.d.ts +170 -0
  5. package/dist/auth.svelte.js +208 -0
  6. package/dist/config.d.ts +49 -0
  7. package/dist/config.js +6 -0
  8. package/dist/context.d.ts +13 -0
  9. package/dist/context.js +35 -0
  10. package/dist/index.d.ts +18 -0
  11. package/dist/index.js +21 -0
  12. package/dist/kit/index.d.ts +55 -0
  13. package/dist/kit/index.js +121 -0
  14. package/dist/kit/watch.svelte.d.ts +10 -0
  15. package/dist/kit/watch.svelte.js +28 -0
  16. package/dist/navigation.d.ts +40 -0
  17. package/dist/navigation.js +22 -0
  18. package/dist/screens/AuthLayout.svelte +38 -0
  19. package/dist/screens/AuthLayout.svelte.d.ts +8 -0
  20. package/dist/screens/FallbackOptions.svelte +69 -0
  21. package/dist/screens/FallbackOptions.svelte.d.ts +13 -0
  22. package/dist/screens/Login.svelte +253 -0
  23. package/dist/screens/Login.svelte.d.ts +3 -0
  24. package/dist/screens/MagicLinkSent.svelte +74 -0
  25. package/dist/screens/MagicLinkSent.svelte.d.ts +3 -0
  26. package/dist/screens/OAuthCallback.svelte +69 -0
  27. package/dist/screens/OAuthCallback.svelte.d.ts +3 -0
  28. package/dist/screens/OAuthProviderButtons.svelte +49 -0
  29. package/dist/screens/OAuthProviderButtons.svelte.d.ts +6 -0
  30. package/dist/screens/OtpInput.svelte +101 -0
  31. package/dist/screens/OtpInput.svelte.d.ts +10 -0
  32. package/dist/screens/PasskeyLogin.svelte +34 -0
  33. package/dist/screens/PasskeyLogin.svelte.d.ts +3 -0
  34. package/dist/screens/RegisterPasskey.svelte +110 -0
  35. package/dist/screens/RegisterPasskey.svelte.d.ts +3 -0
  36. package/dist/screens/VerifyMagicLink.svelte +195 -0
  37. package/dist/screens/VerifyMagicLink.svelte.d.ts +3 -0
  38. package/dist/screens/VerifyOtp.svelte +141 -0
  39. package/dist/screens/VerifyOtp.svelte.d.ts +7 -0
  40. package/dist/seamless-auth.css +260 -0
  41. package/dist/styles.generated.d.ts +2 -0
  42. package/dist/styles.generated.js +3 -0
  43. package/package.json +76 -4
@@ -0,0 +1,260 @@
1
+ /*
2
+ * Styles for the bundled Seamless Auth screens of the Angular and Vue bindings
3
+ * (and those that follow). One file, so the screens look the same in every
4
+ * framework. Theme them with the same --seamless-* custom properties the React
5
+ * screens read, or override the .sa-* classes. Every rule is scoped under
6
+ * .sa-auth.
7
+ */
8
+
9
+ .sa-auth {
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ color: var(--seamless-text, white);
14
+ font-family: inherit;
15
+ }
16
+
17
+ .sa-auth *,
18
+ .sa-auth *::before,
19
+ .sa-auth *::after {
20
+ box-sizing: border-box;
21
+ }
22
+
23
+ .sa-auth .sa-card {
24
+ background-color: var(--seamless-surface, #1f2937);
25
+ padding: 2rem;
26
+ border-radius: 0.5rem;
27
+ box-shadow: 0 4px 6px var(--seamless-shadow, rgba(0, 0, 0, 0.1));
28
+ width: 100%;
29
+ max-width: 28rem;
30
+ }
31
+
32
+ .sa-auth .sa-heading {
33
+ font-size: 1.5rem;
34
+ font-weight: bold;
35
+ margin: 0 0 1.5rem;
36
+ text-align: center;
37
+ color: var(--seamless-text, white);
38
+ }
39
+
40
+ .sa-auth .sa-subtitle,
41
+ .sa-auth .sa-description {
42
+ color: var(--seamless-text-muted, #d1d5db);
43
+ text-align: center;
44
+ margin: 0 0 1rem;
45
+ }
46
+
47
+ .sa-auth .sa-input-group {
48
+ margin-bottom: 1rem;
49
+ }
50
+
51
+ .sa-auth .sa-label {
52
+ display: block;
53
+ color: var(--seamless-text-muted, #d1d5db);
54
+ }
55
+
56
+ .sa-auth .sa-input {
57
+ width: 100%;
58
+ padding: 0.5rem;
59
+ color: inherit;
60
+ background-color: var(--seamless-surface-raised, #4b5563);
61
+ border: 1px solid var(--seamless-border, #d1d5db);
62
+ border-radius: 0.375rem;
63
+ margin-top: 0.25rem;
64
+ }
65
+
66
+ .sa-auth .sa-input:focus,
67
+ .sa-auth .sa-otp-input:focus {
68
+ outline: none;
69
+ box-shadow: 0 0 0 2px var(--seamless-accent, #3b82f6);
70
+ }
71
+
72
+ .sa-auth .sa-helper-text {
73
+ font-size: 0.75rem;
74
+ color: var(--seamless-text-muted, #9ca3af);
75
+ margin-top: 0.5rem;
76
+ }
77
+
78
+ .sa-auth .sa-error {
79
+ color: var(--seamless-danger, #f87171);
80
+ font-size: 0.875rem;
81
+ }
82
+
83
+ .sa-auth .sa-success {
84
+ color: var(--seamless-success, #68d391);
85
+ font-size: 0.875rem;
86
+ }
87
+
88
+ .sa-auth .sa-button {
89
+ width: 100%;
90
+ border: none;
91
+ background-color: var(--seamless-accent, #2563eb);
92
+ color: var(--seamless-accent-contrast, white);
93
+ padding: 0.5rem;
94
+ border-radius: 0.375rem;
95
+ transition:
96
+ background-color 0.3s,
97
+ opacity 0.3s;
98
+ cursor: pointer;
99
+ margin-top: 1rem;
100
+ font: inherit;
101
+ }
102
+
103
+ .sa-auth .sa-button:hover:not(:disabled) {
104
+ background-color: var(--seamless-accent-hover, #1d4ed8);
105
+ }
106
+
107
+ .sa-auth .sa-button:disabled {
108
+ opacity: 0.6;
109
+ cursor: not-allowed;
110
+ }
111
+
112
+ .sa-auth .sa-secondary {
113
+ width: 100%;
114
+ margin-top: 0.75rem;
115
+ padding: 0.5rem;
116
+ border-radius: 0.375rem;
117
+ background: transparent;
118
+ color: var(--seamless-text, white);
119
+ border: 1px solid var(--seamless-border, #d1d5db);
120
+ cursor: pointer;
121
+ font: inherit;
122
+ }
123
+
124
+ .sa-auth .sa-submit-hint {
125
+ font-size: 0.75rem;
126
+ color: var(--seamless-text-muted, #9ca3af);
127
+ margin-top: 0.5rem;
128
+ text-align: center;
129
+ }
130
+
131
+ .sa-auth .sa-link {
132
+ margin-top: 1rem;
133
+ width: 100%;
134
+ font-size: 0.875rem;
135
+ color: var(--seamless-accent-soft, #60a5fa);
136
+ text-align: center;
137
+ background: none;
138
+ border: none;
139
+ cursor: pointer;
140
+ font-family: inherit;
141
+ }
142
+
143
+ .sa-auth .sa-link:disabled {
144
+ opacity: 0.6;
145
+ cursor: not-allowed;
146
+ }
147
+
148
+ .sa-auth .sa-fallback {
149
+ margin-top: 18px;
150
+ padding: 18px;
151
+ border-radius: 12px;
152
+ background: var(--seamless-surface-raised, rgba(255, 255, 255, 0.04));
153
+ border: 1px solid var(--seamless-border, rgba(255, 255, 255, 0.08));
154
+ display: flex;
155
+ flex-direction: column;
156
+ gap: 14px;
157
+ }
158
+
159
+ .sa-auth .sa-fallback-header {
160
+ font-weight: 600;
161
+ }
162
+
163
+ .sa-auth .sa-fallback-description {
164
+ margin: 0;
165
+ font-size: 0.875rem;
166
+ color: var(--seamless-text-muted, #9ca3af);
167
+ }
168
+
169
+ .sa-auth .sa-actions {
170
+ display: flex;
171
+ flex-direction: column;
172
+ gap: 10px;
173
+ margin-top: 1rem;
174
+ }
175
+
176
+ .sa-auth .sa-action {
177
+ display: flex;
178
+ flex-direction: column;
179
+ align-items: flex-start;
180
+ gap: 2px;
181
+ width: 100%;
182
+ padding: 12px 14px;
183
+ border-radius: 10px;
184
+ background: var(--seamless-surface, rgba(255, 255, 255, 0.02));
185
+ border: 1px solid var(--seamless-border, rgba(255, 255, 255, 0.12));
186
+ color: var(--seamless-text, white);
187
+ cursor: pointer;
188
+ text-align: left;
189
+ font: inherit;
190
+ }
191
+
192
+ .sa-auth .sa-action:hover {
193
+ border-color: var(--seamless-accent, #3b82f6);
194
+ }
195
+
196
+ .sa-auth .sa-action-title {
197
+ font-weight: 600;
198
+ }
199
+
200
+ .sa-auth .sa-action-subtext {
201
+ font-size: 0.8rem;
202
+ color: var(--seamless-text-muted, #9ca3af);
203
+ }
204
+
205
+ .sa-auth .sa-otp {
206
+ display: flex;
207
+ gap: 0.5rem;
208
+ justify-content: center;
209
+ margin: 0.75rem 0;
210
+ }
211
+
212
+ .sa-auth .sa-otp-input {
213
+ width: 2.75rem;
214
+ height: 3rem;
215
+ text-align: center;
216
+ font-size: 1.25rem;
217
+ color: inherit;
218
+ background-color: var(--seamless-surface-raised, #4b5563);
219
+ border: 1px solid var(--seamless-border, #d1d5db);
220
+ border-radius: 0.375rem;
221
+ }
222
+
223
+ .sa-auth .sa-timer {
224
+ font-size: 0.75rem;
225
+ color: var(--seamless-warning, #facc15);
226
+ }
227
+
228
+ .sa-auth .sa-identifier {
229
+ margin: 0.75rem auto;
230
+ padding: 0.25rem 0.75rem;
231
+ width: fit-content;
232
+ border-radius: 999px;
233
+ background: var(--seamless-surface-raised, #4b5563);
234
+ }
235
+
236
+ .sa-auth .sa-center {
237
+ text-align: center;
238
+ }
239
+
240
+ .sa-auth .sa-spinner {
241
+ width: 2rem;
242
+ height: 2rem;
243
+ margin: 1rem auto;
244
+ border: 3px solid var(--seamless-border, rgba(255, 255, 255, 0.2));
245
+ border-top-color: var(--seamless-accent, #3b82f6);
246
+ border-radius: 50%;
247
+ animation: sa-spin 0.9s linear infinite;
248
+ }
249
+
250
+ @keyframes sa-spin {
251
+ to {
252
+ transform: rotate(360deg);
253
+ }
254
+ }
255
+
256
+ @media (prefers-reduced-motion: reduce) {
257
+ .sa-auth .sa-spinner {
258
+ animation: none;
259
+ }
260
+ }
@@ -0,0 +1,2 @@
1
+ declare const css: string;
2
+ export default css;
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/generate-svelte-styles.mjs from resources/styles/seamless-auth.css.
2
+ const css = "/*\n * Styles for the bundled Seamless Auth screens of the Angular and Vue bindings\n * (and those that follow). One file, so the screens look the same in every\n * framework. Theme them with the same --seamless-* custom properties the React\n * screens read, or override the .sa-* classes. Every rule is scoped under\n * .sa-auth.\n */\n\n.sa-auth {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--seamless-text, white);\n font-family: inherit;\n}\n\n.sa-auth *,\n.sa-auth *::before,\n.sa-auth *::after {\n box-sizing: border-box;\n}\n\n.sa-auth .sa-card {\n background-color: var(--seamless-surface, #1f2937);\n padding: 2rem;\n border-radius: 0.5rem;\n box-shadow: 0 4px 6px var(--seamless-shadow, rgba(0, 0, 0, 0.1));\n width: 100%;\n max-width: 28rem;\n}\n\n.sa-auth .sa-heading {\n font-size: 1.5rem;\n font-weight: bold;\n margin: 0 0 1.5rem;\n text-align: center;\n color: var(--seamless-text, white);\n}\n\n.sa-auth .sa-subtitle,\n.sa-auth .sa-description {\n color: var(--seamless-text-muted, #d1d5db);\n text-align: center;\n margin: 0 0 1rem;\n}\n\n.sa-auth .sa-input-group {\n margin-bottom: 1rem;\n}\n\n.sa-auth .sa-label {\n display: block;\n color: var(--seamless-text-muted, #d1d5db);\n}\n\n.sa-auth .sa-input {\n width: 100%;\n padding: 0.5rem;\n color: inherit;\n background-color: var(--seamless-surface-raised, #4b5563);\n border: 1px solid var(--seamless-border, #d1d5db);\n border-radius: 0.375rem;\n margin-top: 0.25rem;\n}\n\n.sa-auth .sa-input:focus,\n.sa-auth .sa-otp-input:focus {\n outline: none;\n box-shadow: 0 0 0 2px var(--seamless-accent, #3b82f6);\n}\n\n.sa-auth .sa-helper-text {\n font-size: 0.75rem;\n color: var(--seamless-text-muted, #9ca3af);\n margin-top: 0.5rem;\n}\n\n.sa-auth .sa-error {\n color: var(--seamless-danger, #f87171);\n font-size: 0.875rem;\n}\n\n.sa-auth .sa-success {\n color: var(--seamless-success, #68d391);\n font-size: 0.875rem;\n}\n\n.sa-auth .sa-button {\n width: 100%;\n border: none;\n background-color: var(--seamless-accent, #2563eb);\n color: var(--seamless-accent-contrast, white);\n padding: 0.5rem;\n border-radius: 0.375rem;\n transition:\n background-color 0.3s,\n opacity 0.3s;\n cursor: pointer;\n margin-top: 1rem;\n font: inherit;\n}\n\n.sa-auth .sa-button:hover:not(:disabled) {\n background-color: var(--seamless-accent-hover, #1d4ed8);\n}\n\n.sa-auth .sa-button:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.sa-auth .sa-secondary {\n width: 100%;\n margin-top: 0.75rem;\n padding: 0.5rem;\n border-radius: 0.375rem;\n background: transparent;\n color: var(--seamless-text, white);\n border: 1px solid var(--seamless-border, #d1d5db);\n cursor: pointer;\n font: inherit;\n}\n\n.sa-auth .sa-submit-hint {\n font-size: 0.75rem;\n color: var(--seamless-text-muted, #9ca3af);\n margin-top: 0.5rem;\n text-align: center;\n}\n\n.sa-auth .sa-link {\n margin-top: 1rem;\n width: 100%;\n font-size: 0.875rem;\n color: var(--seamless-accent-soft, #60a5fa);\n text-align: center;\n background: none;\n border: none;\n cursor: pointer;\n font-family: inherit;\n}\n\n.sa-auth .sa-link:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.sa-auth .sa-fallback {\n margin-top: 18px;\n padding: 18px;\n border-radius: 12px;\n background: var(--seamless-surface-raised, rgba(255, 255, 255, 0.04));\n border: 1px solid var(--seamless-border, rgba(255, 255, 255, 0.08));\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\n.sa-auth .sa-fallback-header {\n font-weight: 600;\n}\n\n.sa-auth .sa-fallback-description {\n margin: 0;\n font-size: 0.875rem;\n color: var(--seamless-text-muted, #9ca3af);\n}\n\n.sa-auth .sa-actions {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-top: 1rem;\n}\n\n.sa-auth .sa-action {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 2px;\n width: 100%;\n padding: 12px 14px;\n border-radius: 10px;\n background: var(--seamless-surface, rgba(255, 255, 255, 0.02));\n border: 1px solid var(--seamless-border, rgba(255, 255, 255, 0.12));\n color: var(--seamless-text, white);\n cursor: pointer;\n text-align: left;\n font: inherit;\n}\n\n.sa-auth .sa-action:hover {\n border-color: var(--seamless-accent, #3b82f6);\n}\n\n.sa-auth .sa-action-title {\n font-weight: 600;\n}\n\n.sa-auth .sa-action-subtext {\n font-size: 0.8rem;\n color: var(--seamless-text-muted, #9ca3af);\n}\n\n.sa-auth .sa-otp {\n display: flex;\n gap: 0.5rem;\n justify-content: center;\n margin: 0.75rem 0;\n}\n\n.sa-auth .sa-otp-input {\n width: 2.75rem;\n height: 3rem;\n text-align: center;\n font-size: 1.25rem;\n color: inherit;\n background-color: var(--seamless-surface-raised, #4b5563);\n border: 1px solid var(--seamless-border, #d1d5db);\n border-radius: 0.375rem;\n}\n\n.sa-auth .sa-timer {\n font-size: 0.75rem;\n color: var(--seamless-warning, #facc15);\n}\n\n.sa-auth .sa-identifier {\n margin: 0.75rem auto;\n padding: 0.25rem 0.75rem;\n width: fit-content;\n border-radius: 999px;\n background: var(--seamless-surface-raised, #4b5563);\n}\n\n.sa-auth .sa-center {\n text-align: center;\n}\n\n.sa-auth .sa-spinner {\n width: 2rem;\n height: 2rem;\n margin: 1rem auto;\n border: 3px solid var(--seamless-border, rgba(255, 255, 255, 0.2));\n border-top-color: var(--seamless-accent, #3b82f6);\n border-radius: 50%;\n animation: sa-spin 0.9s linear infinite;\n}\n\n@keyframes sa-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .sa-auth .sa-spinner {\n animation: none;\n }\n}\n";
3
+ export default css;
package/package.json CHANGED
@@ -1,6 +1,78 @@
1
1
  {
2
2
  "name": "@seamless-auth/svelte",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Svelte bindings for Seamless Auth: a rune-based session, SvelteKit guards, and optional sign-in screens.",
5
+ "type": "module",
6
+ "svelte": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "svelte": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./kit": {
15
+ "types": "./dist/kit/index.d.ts",
16
+ "svelte": "./dist/kit/index.js",
17
+ "default": "./dist/kit/index.js"
18
+ },
19
+ "./seamless-auth.css": "./dist/seamless-auth.css"
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "!dist/**/*.test.*",
24
+ "README.md",
25
+ "CHANGELOG.md",
26
+ "LICENSE"
27
+ ],
28
+ "engines": {
29
+ "node": ">=22",
30
+ "npm": ">=9.0.0 <13.0.0"
31
+ },
32
+ "scripts": {
33
+ "styles": "node ../../scripts/generate-svelte-styles.mjs",
34
+ "build": "npm run styles && node ../../scripts/clean-dist.mjs && svelte-package -i src -o dist && node ../../scripts/finalize-svelte-dist.mjs",
35
+ "typecheck": "npm run styles && svelte-check --tsconfig ./tsconfig.json --fail-on-warnings",
36
+ "test": "npm run styles && vitest run",
37
+ "check-npm-build": "npm pack --dry-run"
38
+ },
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/fells-code/seamless-auth-react.git",
42
+ "directory": "packages/svelte"
43
+ },
44
+ "author": "Fells Code, LLC",
45
+ "license": "Apache-2.0",
46
+ "bugs": {
47
+ "url": "https://github.com/fells-code/seamless-auth-react/issues"
48
+ },
49
+ "homepage": "https://github.com/fells-code/seamless-auth-react/tree/main/packages/svelte#readme",
50
+ "keywords": [
51
+ "svelte",
52
+ "sveltekit",
53
+ "authentication",
54
+ "passkeys",
55
+ "webauthn",
56
+ "seamless-auth"
57
+ ],
58
+ "publishConfig": {
59
+ "access": "public",
60
+ "registry": "https://registry.npmjs.org/",
61
+ "provenance": true
62
+ },
63
+ "peerDependencies": {
64
+ "@sveltejs/kit": "^2.26.0 || ^3.0.0",
65
+ "svelte": "^5.0.0"
66
+ },
67
+ "peerDependenciesMeta": {
68
+ "@sveltejs/kit": {
69
+ "optional": true
70
+ }
71
+ },
72
+ "dependencies": {
73
+ "@seamless-auth/client": "^0.6.0"
74
+ },
75
+ "sideEffects": [
76
+ "*.css"
77
+ ]
78
+ }