@proveanything/smartlinks-auth-ui 0.5.4 → 0.5.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthUIPreview.d.ts","sourceRoot":"","sources":["../../src/components/AuthUIPreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE3D,UAAU,kBAAkB;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,YAAY,EAAE,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACrC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"AuthUIPreview.d.ts","sourceRoot":"","sources":["../../src/components/AuthUIPreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE3D,UAAU,kBAAkB;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,YAAY,EAAE,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACrC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8KtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderButtons.d.ts","sourceRoot":"","sources":["../../src/components/ProviderButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,gBAAgB,CAAC;AAExB,UAAU,oBAAoB;IAC5B,gBAAgB,EAAE,YAAY,EAAE,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ProviderButtons.d.ts","sourceRoot":"","sources":["../../src/components/ProviderButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,gBAAgB,CAAC;AAExB,UAAU,oBAAoB;IAC5B,gBAAgB,EAAE,YAAY,EAAE,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAqI1D,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -321,9 +321,13 @@ const ProviderButtons = ({ enabledProviders, providerOrder, onEmailLogin, onGoog
|
|
|
321
321
|
if (enabledProviders.length === 0)
|
|
322
322
|
return null;
|
|
323
323
|
// Determine the order of providers to display
|
|
324
|
-
const orderedProviders =
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
const orderedProviders = (() => {
|
|
325
|
+
if (!providerOrder || providerOrder.length === 0)
|
|
326
|
+
return enabledProviders;
|
|
327
|
+
const configured = providerOrder.filter((p) => enabledProviders.includes(p));
|
|
328
|
+
const missing = enabledProviders.filter((p) => !configured.includes(p));
|
|
329
|
+
return [...configured, ...missing];
|
|
330
|
+
})();
|
|
327
331
|
// Provider button configurations
|
|
328
332
|
const providerConfigs = {
|
|
329
333
|
email: {
|
|
@@ -14341,7 +14345,7 @@ const SmartlinksAuthUI = ({ apiEndpoint, clientId, clientName, accountData, onAu
|
|
|
14341
14345
|
? 'hsl(var(--muted-foreground, 215 15% 45%))'
|
|
14342
14346
|
: (resolvedTheme === 'dark' ? '#94a3b8' : '#6B7280'),
|
|
14343
14347
|
fontSize: '0.875rem'
|
|
14344
|
-
}, children: successMessage })] })) : mode === 'magic-link' ? (jsx(MagicLinkForm, { onSubmit: handleMagicLink, onCancel: () => setMode('login'), loading: loading, error: error, collectName: config?.collectNameOnPasswordlessSignup })) : mode === 'whatsapp' ? (jsx(WhatsAppAuthForm, { onSend: handleWhatsAppSend, onPollStatus: handleWhatsAppPoll, onVerified: handleWhatsAppVerified, onBack: () => setMode('login'), loading: loading, error: error, collectName: config?.collectNameOnPasswordlessSignup })) : mode === 'phone' ? (jsx(PhoneAuthForm, { onSubmit: handlePhoneAuth, onBack: () => setMode('login'), loading: loading, error: error, collectName: config?.collectNameOnPasswordlessSignup })) : mode === 'reset-password' ? (jsx(PasswordResetForm, { onSubmit: handlePasswordReset, onBack: () => {
|
|
14348
|
+
}, children: successMessage })] })) : mode === 'magic-link' ? (jsx(MagicLinkForm, { onSubmit: handleMagicLink, onCancel: () => setMode('login'), loading: loading, error: error, collectName: config?.collectNameOnPasswordlessSignup })) : mode === 'whatsapp' ? (jsx(WhatsAppAuthForm, { onSend: handleWhatsAppSend, onPollStatus: handleWhatsAppPoll, onVerified: handleWhatsAppVerified, onBack: () => setMode('login'), loading: loading, error: error, collectName: config?.collectNameOnPasswordlessSignup ?? true })) : mode === 'phone' ? (jsx(PhoneAuthForm, { onSubmit: handlePhoneAuth, onBack: () => setMode('login'), loading: loading, error: error, collectName: config?.collectNameOnPasswordlessSignup })) : mode === 'reset-password' ? (jsx(PasswordResetForm, { onSubmit: handlePasswordReset, onBack: () => {
|
|
14345
14349
|
setMode('login');
|
|
14346
14350
|
setResetSuccess(false);
|
|
14347
14351
|
setResetToken(undefined); // Clear token when going back
|
|
@@ -15649,9 +15653,14 @@ const AuthUIPreview = ({ customization, enabledProviders = ['email', 'google', '
|
|
|
15649
15653
|
const showMagicLink = enabledProviders.includes('magic-link');
|
|
15650
15654
|
const showWhatsApp = enabledProviders.includes('whatsapp');
|
|
15651
15655
|
// Determine ordered providers (excluding email if in button mode)
|
|
15652
|
-
const orderedProviders =
|
|
15653
|
-
|
|
15654
|
-
|
|
15656
|
+
const orderedProviders = (() => {
|
|
15657
|
+
const nonEmailProviders = enabledProviders.filter((p) => p !== 'email');
|
|
15658
|
+
if (!providerOrder || providerOrder.length === 0)
|
|
15659
|
+
return nonEmailProviders;
|
|
15660
|
+
const configured = providerOrder.filter((p) => enabledProviders.includes(p) && p !== 'email');
|
|
15661
|
+
const missing = nonEmailProviders.filter((p) => !configured.includes(p));
|
|
15662
|
+
return [...configured, ...missing];
|
|
15663
|
+
})();
|
|
15655
15664
|
const hasOtherProviders = showGoogle || showPhone || showMagicLink || showWhatsApp;
|
|
15656
15665
|
// Render provider button helper
|
|
15657
15666
|
const renderProviderButton = (provider) => {
|