@proveanything/smartlinks-auth-ui 0.6.2 → 0.6.3

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.
@@ -300,6 +300,8 @@ customization={{
300
300
  | `enabledProviders` | `AuthProvider[]` | No | `['email', 'google', 'phone']` | Auth methods |
301
301
  | `redirectUrl` | string | No | - | Post-auth redirect URL |
302
302
  | `accountData` | `Record<string, any>` | No | - | Additional account data |
303
+ | `prefillEmail` | string | No | - | Pre-fill email in the email/password form |
304
+ | `prefillDisplayName` | string | No | - | Pre-fill full name in the registration form |
303
305
  | `onAuthSuccess` | function | Yes | - | Success callback |
304
306
  | `onAuthError` | function | No | - | Error callback |
305
307
  | `className` | string | No | `''` | Additional CSS class |
package/README.md CHANGED
@@ -126,6 +126,8 @@ Main authentication component with login, registration, password reset, and prov
126
126
  | `clientId` | string | **Yes** | Client identifier for your application |
127
127
  | `clientName` | string | No | Client name for branded emails |
128
128
  | `accountData` | Record<string, any> | No | Custom metadata to store on registration |
129
+ | `prefillEmail` | string | No | Pre-fill email in the email/password form |
130
+ | `prefillDisplayName` | string | No | Pre-fill full name in the registration form |
129
131
  | `onAuthSuccess` | (response: AuthResponse) => void | No | Callback when authentication succeeds |
130
132
  | `onAuthError` | (error: Error) => void | No | Callback when authentication fails |
131
133
  | `onRedirect` | (url: string, reason: RedirectReason) => void | No | Callback for navigation after deep-link auth. When provided, disables automatic redirects. |
@@ -12,6 +12,8 @@ interface EmailAuthFormProps {
12
12
  error?: string;
13
13
  signupProminence?: SignupProminence;
14
14
  signupRedirectUrl?: string;
15
+ prefillEmail?: string;
16
+ prefillDisplayName?: string;
15
17
  schema?: ContactSchemaResponse | null;
16
18
  registrationFieldsConfig?: RegistrationFieldConfig[];
17
19
  /** @deprecated Use schema + registrationFieldsConfig instead */
@@ -1 +1 @@
1
- {"version":3,"file":"EmailAuthForm.d.ts","sourceRoot":"","sources":["../../src/components/EmailAuthForm.tsx"],"names":[],"mappings":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UAAU,kBAAkB;IAC1B,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,MAAM,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACtC,wBAAwB,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAErD,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,UAAU,EAAE,CAAC;CACjC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2RtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SmartlinksAuthUI.d.ts","sourceRoot":"","sources":["../../src/components/SmartlinksAuthUI.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAcpE,OAAO,KAAK,EAAE,qBAAqB,EAAyF,MAAM,UAAU,CAAC;AAwW7I,QAAA,MAAM,mBAAmB,QAAa,OAAO,CAAC,IAAI,CAqBjD,CAAC;AAqDF,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAI/B,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA04E5D,CAAC"}
1
+ {"version":3,"file":"SmartlinksAuthUI.d.ts","sourceRoot":"","sources":["../../src/components/SmartlinksAuthUI.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAcpE,OAAO,KAAK,EAAE,qBAAqB,EAAyF,MAAM,UAAU,CAAC;AAwW7I,QAAA,MAAM,mBAAmB,QAAa,OAAO,CAAC,IAAI,CAqBjD,CAAC;AAqDF,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAI/B,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA84E5D,CAAC"}
package/dist/index.esm.js CHANGED
@@ -257,11 +257,11 @@ const AuthModeToggle = ({ mode, onModeChange, disabled = false, }) => {
257
257
  return (jsxs("div", { className: "auth-mode-toggle", role: "tablist", "aria-label": "Authentication mode", children: [jsx("button", { type: "button", role: "tab", "aria-selected": mode === 'login', className: `auth-mode-toggle-button ${mode === 'login' ? 'auth-mode-toggle-button--active' : ''}`, onClick: () => onModeChange('login'), disabled: disabled, children: "Sign In" }), jsx("button", { type: "button", role: "tab", "aria-selected": mode === 'register', className: `auth-mode-toggle-button ${mode === 'register' ? 'auth-mode-toggle-button--active' : ''}`, onClick: () => onModeChange('register'), disabled: disabled, children: "Create Account" })] }));
258
258
  };
259
259
 
260
- const EmailAuthForm = ({ mode, onSubmit, onModeSwitch, onForgotPassword, loading, error, signupProminence = 'minimal', signupRedirectUrl, schema, registrationFieldsConfig = [], additionalFields = [], }) => {
260
+ const EmailAuthForm = ({ mode, onSubmit, onModeSwitch, onForgotPassword, loading, error, signupProminence = 'minimal', signupRedirectUrl, prefillEmail, prefillDisplayName, schema, registrationFieldsConfig = [], additionalFields = [], }) => {
261
261
  const [formData, setFormData] = useState({
262
- email: '',
262
+ email: prefillEmail || '',
263
263
  password: '',
264
- displayName: '',
264
+ displayName: prefillDisplayName || '',
265
265
  });
266
266
  const [customFieldValues, setCustomFieldValues] = useState({});
267
267
  // Get schema-driven registration fields
@@ -13713,7 +13713,7 @@ const checkSilentGoogleSignIn = async (clientId, googleClientId) => {
13713
13713
  });
13714
13714
  };
13715
13715
  // getFriendlyErrorMessage is now imported from ../utils/errorHandling
13716
- const SmartlinksAuthUI = ({ apiEndpoint, clientId, clientName, accountData, onAuthSuccess, onAuthError, onRedirect, enabledProviders = ['email', 'google', 'phone'], initialMode, signupProminence, redirectUrl, theme = 'light', className, customization, skipConfigFetch = false, minimal = false, logger, proxyMode = false, collectionId, disableConfigCache = false, enableSilentGoogleSignIn = false, nativeAuth, enableSilentNativeSignIn = false, whatsappReply, whatsappPrefillMessage, }) => {
13716
+ const SmartlinksAuthUI = ({ apiEndpoint, clientId, clientName, accountData, prefillEmail, prefillDisplayName, onAuthSuccess, onAuthError, onRedirect, enabledProviders = ['email', 'google', 'phone'], initialMode, signupProminence, redirectUrl, theme = 'light', className, customization, skipConfigFetch = false, minimal = false, logger, proxyMode = false, collectionId, disableConfigCache = false, enableSilentGoogleSignIn = false, nativeAuth, enableSilentNativeSignIn = false, whatsappReply, whatsappPrefillMessage, }) => {
13717
13717
  // Resolve signup prominence from props, customization, config, or default
13718
13718
  const resolvedSignupProminence = signupProminence || customization?.signupProminence || 'minimal';
13719
13719
  // Determine initial mode based on signupProminence setting
@@ -15651,7 +15651,7 @@ const SmartlinksAuthUI = ({ apiEndpoint, clientId, clientName, accountData, onAu
15651
15651
  setShowResendVerification(false);
15652
15652
  setShowRequestNewReset(false);
15653
15653
  setError(undefined);
15654
- }, onForgotPassword: () => setMode('reset-password'), loading: loading, error: error, signupProminence: resolvedSignupProminence, signupRedirectUrl: config?.signupRedirectUrl || customization?.signupRedirectUrl, schema: contactSchema, registrationFieldsConfig: config?.registrationFields, additionalFields: config?.signupAdditionalFields }), emailDisplayMode === 'form' && actualProviders.length > 1 && (jsx(ProviderButtons, { enabledProviders: actualProviders.filter((p) => p !== 'email'), providerOrder: providerOrder, onGoogleLogin: handleGoogleLogin, onAppleLogin: handleAppleLogin, onPhoneLogin: () => setMode('phone'), onMagicLinkLogin: () => setMode('magic-link'), onWhatsAppLogin: () => setMode('whatsapp'), loading: loading }))] }));
15654
+ }, onForgotPassword: () => setMode('reset-password'), loading: loading, error: error, signupProminence: resolvedSignupProminence, signupRedirectUrl: config?.signupRedirectUrl || customization?.signupRedirectUrl, prefillEmail: prefillEmail, prefillDisplayName: prefillDisplayName, schema: contactSchema, registrationFieldsConfig: config?.registrationFields, additionalFields: config?.signupAdditionalFields }), emailDisplayMode === 'form' && actualProviders.length > 1 && (jsx(ProviderButtons, { enabledProviders: actualProviders.filter((p) => p !== 'email'), providerOrder: providerOrder, onGoogleLogin: handleGoogleLogin, onAppleLogin: handleAppleLogin, onPhoneLogin: () => setMode('phone'), onMagicLinkLogin: () => setMode('magic-link'), onWhatsAppLogin: () => setMode('whatsapp'), loading: loading }))] }));
15655
15655
  })()] })) })) : null }));
15656
15656
  };
15657
15657