@sylphx/auth-solid 0.0.0-stage → 0.1.1
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 +21 -0
- package/README.md +56 -2
- package/dist/browser.js +1135 -0
- package/dist/index.d.ts +4 -0
- package/dist/locale.d.ts +6 -0
- package/dist/messages.d.ts +481 -0
- package/dist/provider-icons.d.ts +5 -0
- package/dist/server.js +1140 -0
- package/dist/sign-in-controller.d.ts +55 -0
- package/dist/sign-in.css +140 -0
- package/dist/sign-in.d.ts +29 -0
- package/package.json +53 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sylphx
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Solid sign-in
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Solid package with compiled browser and SSR entry points. Install both SDKs
|
|
4
|
+
and Solid in your application, then mount the same-origin `@sylphx/auth` routes
|
|
5
|
+
on your application server. It owns the surrounding page, return-path allowlist,
|
|
6
|
+
and legal links; this package does not import a router or an application shell.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { SylphxSignIn } from '@sylphx/auth-solid'
|
|
10
|
+
import '@sylphx/auth-solid/sign-in.css'
|
|
11
|
+
|
|
12
|
+
<SylphxSignIn
|
|
13
|
+
next={allowedNext}
|
|
14
|
+
search={location.search}
|
|
15
|
+
title="Sign in"
|
|
16
|
+
description="Choose how you’d like to sign in."
|
|
17
|
+
/>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`title`, `description`, and `kicker` accept JSX; the first two customize the
|
|
21
|
+
initial step. `agreement` accepts optional host-provided JSX. `loginPath`
|
|
22
|
+
(default `/login`) is the same-origin path used to scrub an email confirmation
|
|
23
|
+
link after reading its proof. Pass the query string for the current login visit;
|
|
24
|
+
remount the sign-in when starting a new visit with a different query.
|
|
25
|
+
|
|
26
|
+
`appearance.classes` adds classes to the named parts. Use
|
|
27
|
+
`appearance={{ unstyled: true, classes }}` with a host CSS module, or import the
|
|
28
|
+
default sheet and set typed `appearance.tokens` CSS custom properties (e.g.
|
|
29
|
+
`--auth-accent`, `--auth-surface`, `--auth-width`). The default stylesheet gives
|
|
30
|
+
controls a minimum 44px touch target; preserve that in host styles.
|
|
31
|
+
|
|
32
|
+
For custom markup call `createSignInController({ next, search, loginPath })`
|
|
33
|
+
under a Solid owner. It loads method configuration on mount; the returned Solid
|
|
34
|
+
accessors expose the current step, error, busy state and method options. Call
|
|
35
|
+
`continueWithEmail`, `submitPassword`, `sendCode`, `verifyCode`, `submitMfa`,
|
|
36
|
+
`passkey`, and `social` from the corresponding controls. Supply input/label
|
|
37
|
+
associations and manage focus in the custom view. Unmount aborts pending work.
|
|
38
|
+
|
|
39
|
+
### Language
|
|
40
|
+
|
|
41
|
+
The component ships English, Traditional Chinese for Hong Kong and Taiwan,
|
|
42
|
+
Simplified Chinese, and Japanese. It renders a language selector below the
|
|
43
|
+
form and preserves values and progress when the language changes. Set
|
|
44
|
+
`showLocaleSelector={false}` if the host already provides a selector.
|
|
45
|
+
|
|
46
|
+
Set `locale` to control the language explicitly, and pass `onLocaleChange` if
|
|
47
|
+
the widget's selector should update host state. Without `locale`, use ordered
|
|
48
|
+
`localePreferences` to seed SSR and hydration from the same values. Without
|
|
49
|
+
those hints, SSR starts in English and the browser's language preferences are
|
|
50
|
+
used after mount. Unsupported or malformed tags fall through to the next hint,
|
|
51
|
+
then English. `resolveAuthLocale` exposes the same negotiation for hosts.
|
|
52
|
+
Supply custom headings, descriptions and legal copy in the active language.
|
|
53
|
+
The widget does not change the language of email sent by the Auth service.
|
|
54
|
+
|
|
55
|
+
Headless clients can render `signInMessages[locale].errors[errorCode]` when
|
|
56
|
+
`controller.errorCode()` is nonempty. The existing `controller.error()` still
|
|
57
|
+
returns English for callers that have not switched to catalogs.
|