@igamingcareer/igaming-components 1.0.102 → 1.0.103

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 CHANGED
@@ -69,6 +69,36 @@ export function Example() {
69
69
  }
70
70
  ```
71
71
 
72
+ ## Login (remember me identifier)
73
+
74
+ The `Login` and `LoginForm` components support a real “Remember me” experience by persisting the identifier (email/username)
75
+ separately from the checkbox state. When the user opts in, the identifier is stored in `localStorage`, and on the next visit the
76
+ identifier field is prefilled and focus moves to the password input. Passwords are never persisted.
77
+
78
+ ```tsx
79
+ import { Login } from "@igamingcareer/igaming-components";
80
+ import "@igamingcareer/igaming-components/styles/globals.css";
81
+
82
+ export function LoginScreen() {
83
+ return (
84
+ <Login
85
+ onSubmit={(identifier, password, rememberMe) => {
86
+ // send credentials to your API
87
+ }}
88
+ rememberIdentifierPersistKey="igaming-auth-identifier"
89
+ defaultPrefilledIdentifier="player@example.com"
90
+ />
91
+ );
92
+ }
93
+ ```
94
+
95
+ **Behavior details**
96
+
97
+ - The checkbox state is persisted via `rememberMeStorageKey` (default: `"igaming-auth-remember-me"`).
98
+ - When `rememberMe` is true on submit, the identifier is stored at `rememberIdentifierPersistKey`. If `rememberMe` is false, the
99
+ identifier is removed.
100
+ - On mount, if `rememberMe` is true and a stored identifier exists, the identifier is prefilled and the password input is focused.
101
+
72
102
  ## Notifications (global notification system)
73
103
 
74
104
  The notification system provides a provider, hook, and global helpers to trigger messages from anywhere in your app.