@donotdev/auth 0.0.22 → 0.1.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 (62) hide show
  1. package/LICENSE.md +3 -3
  2. package/dist/AuthStore.d.ts +1 -1
  3. package/dist/AuthStore.js +1 -1
  4. package/dist/authHelpers.js +1 -1
  5. package/dist/components/AccountLinking.js +1 -1
  6. package/dist/components/AuthFallback.d.ts +3 -3
  7. package/dist/components/AuthFallback.js +1 -1
  8. package/dist/components/AuthPartnerButton.d.ts +1 -1
  9. package/dist/components/AuthPartnerButton.js +2 -2
  10. package/dist/components/DeleteAccountDialogs.d.ts +4 -4
  11. package/dist/components/DeleteAccountDialogs.js +1 -1
  12. package/dist/components/EmailLinkForm.d.ts +1 -1
  13. package/dist/components/EmailLinkForm.js +1 -1
  14. package/dist/components/EmailPasswordForm.d.ts +1 -1
  15. package/dist/components/EmailPasswordForm.js +1 -1
  16. package/dist/components/EmailVerification.d.ts +1 -1
  17. package/dist/components/EmailVerification.js +1 -1
  18. package/dist/components/Feature.d.ts +6 -6
  19. package/dist/components/Feature.js +1 -1
  20. package/dist/components/FeatureGuard.d.ts +3 -3
  21. package/dist/components/FeatureGuard.js +1 -1
  22. package/dist/components/FeaturePlaceholder.d.ts +3 -3
  23. package/dist/components/FeaturePlaceholder.js +1 -1
  24. package/dist/components/GoogleOneTap.d.ts +1 -1
  25. package/dist/components/GoogleOneTap.js +1 -1
  26. package/dist/components/LoginModal.js +1 -1
  27. package/dist/components/MultipleAuthProviders.d.ts +1 -1
  28. package/dist/components/MultipleAuthProviders.js +1 -1
  29. package/dist/components/NetworkStatusIndicator.d.ts +1 -1
  30. package/dist/components/NetworkStatusIndicator.js +1 -1
  31. package/dist/components/PasswordStrengthIndicator.d.ts +1 -1
  32. package/dist/components/PasswordStrengthIndicator.js +1 -1
  33. package/dist/components/PasswordUpdateDialog.d.ts +1 -1
  34. package/dist/components/PasswordUpdateDialog.js +1 -1
  35. package/dist/components/RateLimitAlert.d.ts +1 -1
  36. package/dist/components/RateLimitAlert.js +1 -1
  37. package/dist/components/index.d.ts +1 -1
  38. package/dist/components/index.js +1 -1
  39. package/dist/constants.d.ts +20 -20
  40. package/dist/constants.js +1 -1
  41. package/dist/hooks/useAccountLinking.d.ts +1 -1
  42. package/dist/hooks/useAccountLinking.js +1 -1
  43. package/dist/hooks/useAuthMethodToggle.d.ts +1 -1
  44. package/dist/hooks/useAuthMethodToggle.js +1 -1
  45. package/dist/hooks/useAuthPartner.d.ts +1 -1
  46. package/dist/hooks/useAuthPartner.js +1 -1
  47. package/dist/hooks/useDeleteAccount.d.ts +2 -2
  48. package/dist/hooks/useDeleteAccount.js +1 -1
  49. package/dist/hooks/useEmailLinkAuth.d.ts +1 -1
  50. package/dist/hooks/useEmailLinkAuth.js +1 -1
  51. package/dist/hooks/useEmailLinkForm.d.ts +3 -3
  52. package/dist/hooks/useEmailLinkForm.js +1 -1
  53. package/dist/hooks/useFedCM.js +1 -1
  54. package/dist/hooks/useGoogleOneTap.js +1 -1
  55. package/dist/hooks/useNetworkStatus.d.ts +1 -1
  56. package/dist/hooks/useNetworkStatus.js +1 -1
  57. package/dist/index.d.ts +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/tsconfig.tsbuildinfo +1 -1
  60. package/dist/useAuth.d.ts +1 -1
  61. package/dist/useAuth.js +1 -1
  62. package/package.json +5 -5
package/LICENSE.md CHANGED
@@ -8,7 +8,7 @@ Copyright © 2025 Ambroise Park Consulting. All rights reserved.
8
8
 
9
9
  ## 1. DEFINITIONS
10
10
 
11
- **1.1 "Framework"** means the DoNotDev commercial software packages (excluding @donotdev/cli and @donotdev/components, which are free), including all compiled JavaScript files, TypeScript definition files, and associated documentation.
11
+ **1.1 "Framework"** means the DoNotDev commercial software packages (excluding @donotdev/cli, @donotdev/components, @donotdev/expo, and @donotdev/templates, which are licensed under MIT), including all compiled JavaScript files, TypeScript definition files, and associated documentation.
12
12
 
13
13
  **1.2 "License Key"** means the unique alphanumeric key provided to you upon purchase, required to suppress watermarks and unlock full Framework functionality.
14
14
 
@@ -231,12 +231,12 @@ Ambroise Park Consulting has no obligation to provide support, updates, or maint
231
231
 
232
232
  Questions about licensing or compliance:
233
233
 
234
- **Email:** mooti.web.app@gmail.com
234
+ **Email:** contact@donotdev.com
235
235
  **Website:** donotdev.com
236
236
 
237
237
  ---
238
238
 
239
239
  **END OF LICENSE AGREEMENT**
240
240
 
241
- **DoNotDev Framework License v2.0**
241
+ **DoNotDev Framework License v1.0**
242
242
  Ambroise Park Consulting – 2025
@@ -3,7 +3,7 @@
3
3
  * @description Zustand store for auth state. Single source of truth with unified FeatureStatus.
4
4
  * Uses status enum ('initializing' | 'ready' | 'degraded' | 'error') for lifecycle management.
5
5
  *
6
- * @version 0.0.3
6
+ * @version 0.1.0
7
7
  * @since 0.0.1
8
8
  * @author AMBROISE PARK Consulting
9
9
  */
package/dist/AuthStore.js CHANGED
@@ -1 +1 @@
1
- import{createDoNotDevStore as i,FEATURE_STATUS as o}from"@donotdev/core";import{PARTNER_STATE as l}from"./constants";const n={user:null,authenticated:!1,userId:null,loading:!1,error:null,userProfile:null,userSubscription:null,partnerStates:{},partnerError:null,authService:null,emailVerification:{status:"pending"},status:o.INITIALIZING},c=i({name:"auth-store",createStore:(t,s)=>({...n,setStatus:r=>{t({status:r})},setPartnerState:(r,e,a)=>{t(u=>({partnerStates:{...u.partnerStates,[r]:e},partnerError:e==="error"&&a?{partnerId:r,error:a}:u.partnerError?.partnerId===r?null:u.partnerError}))},getPartnerState:r=>s().partnerStates[r]||l.IDLE,clearAllPartnerStates:()=>t(r=>({partnerStates:Object.keys(r.partnerStates).reduce((e,a)=>(e[a]=l.IDLE,e),{}),partnerError:null})),setAuthenticated:(r,e,a)=>{t({user:r,authenticated:!0,userId:r.id,loading:!1,error:null,status:o.READY,userSubscription:e,userProfile:a})},setUnauthenticated:()=>{t({user:null,authenticated:!1,userId:null,loading:!1,error:null,status:o.READY,userSubscription:null,userProfile:null})},setAuthLoading:r=>{t({loading:r})},setAuthError:r=>{t({error:r,loading:!1})},clearAuthError:()=>{t({error:null})},getCustomClaim:r=>s().getCustomClaimLocal(r),getCustomClaims:()=>s().getCustomClaimsLocal(),setAuthService:r=>t({authService:r}),getCustomClaimLocal:r=>{const e=s(),a=e.userProfile;return a?.claims&&typeof a.claims=="object"&&r in a.claims?a.claims[r]:a&&typeof a=="object"&&r in a?a[r]:e.user&&typeof e.user=="object"&&r in e.user?e.user[r]:null},getCustomClaimsLocal:()=>{const r=s(),e={};return r.userProfile?.claims&&Object.assign(e,r.userProfile.claims),Object.freeze({...e})},setEmailVerificationStatus:(r,e)=>t({emailVerification:{status:r,error:e}}),setUserProfile:r=>t({userProfile:r}),setUserSubscription:r=>t({userSubscription:r}),setLoading:r=>t({loading:r}),setError:r=>t({error:r}),clearError:()=>t({error:null}),reset:()=>t(n)})});export{c as useAuthStore};
1
+ import{createDoNotDevStore as i,FEATURE_STATUS as l}from"@donotdev/core";import{PARTNER_STATE as n}from"./constants";const o={user:null,authenticated:!1,userId:null,loading:!1,error:null,userProfile:null,userSubscription:null,partnerStates:{},partnerError:null,authService:null,emailVerification:{status:"pending"},status:l.INITIALIZING},S=i({name:"auth-store",createStore:(t,s)=>({...o,setStatus:r=>{t({status:r})},setPartnerState:(r,e,a)=>{t(u=>({partnerStates:{...u.partnerStates,[r]:e},partnerError:e==="error"&&a?{partnerId:r,error:a}:u.partnerError?.partnerId===r?null:u.partnerError}))},getPartnerState:r=>s().partnerStates[r]||n.IDLE,clearAllPartnerStates:()=>t(r=>({partnerStates:Object.keys(r.partnerStates).reduce((e,a)=>(e[a]=n.IDLE,e),{}),partnerError:null})),setAuthenticated:(r,e,a)=>{t({user:r,authenticated:!0,userId:r.id,loading:!1,error:null,status:l.READY,userSubscription:e,userProfile:a})},setUnauthenticated:()=>{t({user:null,authenticated:!1,userId:null,loading:!1,error:null,status:l.READY,userSubscription:null,userProfile:null})},setAuthLoading:r=>{t({loading:r})},setAuthError:r=>{t({error:r,loading:!1})},clearAuthError:()=>{t({error:null})},getCustomClaim:r=>s().getCustomClaimLocal(r),getCustomClaims:()=>s().getCustomClaimsLocal(),setAuthService:r=>t({authService:r}),getCustomClaimLocal:r=>{const e=s(),a=e.userProfile;return a?.claims&&typeof a.claims=="object"&&r in a.claims?a.claims[r]:a&&typeof a=="object"&&r in a?a[r]:e.user&&typeof e.user=="object"&&r in e.user?e.user[r]:null},getCustomClaimsLocal:()=>{const r=s(),e={};return r.userProfile?.claims&&Object.assign(e,r.userProfile.claims),Object.freeze({...e})},setEmailVerificationStatus:(r,e)=>t({emailVerification:{status:r,error:e}}),setUserProfile:r=>t({userProfile:r}),setUserSubscription:r=>t({userSubscription:r}),setLoading:r=>t({loading:r}),setError:r=>t({error:r}),clearError:()=>t({error:null}),reset:()=>t(o)})});export{S as useAuthStore};
@@ -1 +1 @@
1
- import{isClient as e}from"@donotdev/core";import{useAuthStore as t}from"./AuthStore";function s(){return t.getState()}function u(r){return e()?t.subscribe(r):()=>{}}export{s as getAuthState,u as subscribeToAuth};
1
+ import{isClient as e}from"@donotdev/core";import{useAuthStore as t}from"./AuthStore";function i(){return t.getState()}function n(r){return e()?t.subscribe(r):()=>{}}export{i as getAuthState,n as subscribeToAuth};
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as t}from"react/jsx-runtime";import{Suspense as L,lazy as T}from"react";import{Alert as h,ALERT_VARIANT as k,Button as o,BUTTON_VARIANT as c,Stack as a}from"@donotdev/components";import{useTranslation as I,safeSessionStorage as v,handleError as N,isDev as l}from"@donotdev/core";import{EmailLinkForm as R}from"./EmailLinkForm";import S from"./EmailPasswordForm";import{useAccountLinking as y}from"../hooks/useAccountLinking";const $=({className:r="",id:d})=>{const{t:e}=I("auth"),{isRequired:f,email:m,existingProvider:n,newProvider:u,handleSignInWithExistingProvider:w}=y();if(!f)return null;if(n==="password"||n==="emailLink"){l();const s=()=>{v.removeItem("accountLinkingInfo")},g=()=>{l()},p=A=>{N(A)};return i("div",{className:r,id:d,children:i(h,{variant:k.WARNING,role:"alert","aria-live":"polite",title:e("accountLinking.title","Account Linking Required"),description:t(a,{children:[i("p",{children:e("accountLinking.message",`An account with email ${m} already exists with ${n==="password"?"email/password":"email link"}. To link your ${u} account, please sign in with your ${n==="password"?"email and password":"email link"} first.`)}),n==="password"?i("div",{style:{marginTop:"var(--gap-md)"},children:i(S,{mode:"signin",onSuccess:g,onError:p})}):i("div",{style:{marginTop:"var(--gap-md)"},children:i(R,{onSuccess:g,onError:p})}),i(a,{direction:"row",justify:"end",children:i(o,{onClick:s,variant:c.GHOST,children:e("accountLinking.dismiss","Dismiss")})})]})})})}else{l();const s=()=>{v.removeItem("accountLinkingInfo")};return i("div",{className:r,id:d,children:i(h,{variant:k.WARNING,role:"alert","aria-live":"polite",title:e("accountLinking.title","Account Linking Required"),description:t(a,{children:[i("p",{children:e("accountLinking.message",`An account with email ${m} already exists with ${n}. To link your ${u} account, please sign in with ${n} first.`)}),t(a,{direction:"row",children:[i(o,{onClick:w,variant:c.PRIMARY,children:e("accountLinking.signInWith",`Sign in with ${n}`)}),i(o,{onClick:s,variant:c.GHOST,children:e("accountLinking.dismiss","Dismiss")})]})]})})})}},x=T(()=>Promise.resolve({default:$}));function E(r){return i(L,{fallback:null,children:i(x,{...r})})}var P=E;export{P as default};
1
+ "use client";import{jsx as i,jsxs as s}from"react/jsx-runtime";import{Suspense as w,lazy as I}from"react";import{Alert as k,ALERT_VARIANT as p,Button as c,BUTTON_VARIANT as a,Stack as r}from"@donotdev/components";import{useTranslation as T,safeSessionStorage as f,handleError as x,isDev as l}from"@donotdev/core";import{EmailLinkForm as y}from"./EmailLinkForm";import E from"./EmailPasswordForm";import{useAccountLinking as S}from"../hooks/useAccountLinking";const $=({className:o="",id:d})=>{const{t:e}=T("auth"),{isRequired:v,email:u,existingProvider:n,newProvider:m,handleSignInWithExistingProvider:L}=S();if(!v)return null;if(n==="password"||n==="emailLink"){l();const t=()=>{f.removeItem("accountLinkingInfo")},g=()=>{l()},h=A=>{x(A)};return i("div",{className:o,id:d,children:i(k,{variant:p.WARNING,role:"alert","aria-live":"polite",title:e("accountLinking.title","Account Linking Required"),description:s(r,{children:[i("p",{children:e("accountLinking.message",`An account with email ${u} already exists with ${n==="password"?"email/password":"email link"}. To link your ${m} account, please sign in with your ${n==="password"?"email and password":"email link"} first.`)}),n==="password"?i("div",{style:{marginTop:"var(--gap-md)"},children:i(E,{mode:"signin",onSuccess:g,onError:h})}):i("div",{style:{marginTop:"var(--gap-md)"},children:i(y,{onSuccess:g,onError:h})}),i(r,{direction:"row",justify:"end",children:i(c,{onClick:t,variant:a.GHOST,children:e("accountLinking.dismiss","Dismiss")})})]})})})}else{l();const t=()=>{f.removeItem("accountLinkingInfo")};return i("div",{className:o,id:d,children:i(k,{variant:p.WARNING,role:"alert","aria-live":"polite",title:e("accountLinking.title","Account Linking Required"),description:s(r,{children:[i("p",{children:e("accountLinking.message",`An account with email ${u} already exists with ${n}. To link your ${m} account, please sign in with ${n} first.`)}),s(r,{direction:"row",children:[i(c,{onClick:L,variant:a.PRIMARY,children:e("accountLinking.signInWith",`Sign in with ${n}`)}),i(c,{onClick:t,variant:a.GHOST,children:e("accountLinking.dismiss","Dismiss")})]})]})})})}},R=I(()=>Promise.resolve({default:$}));function N(o){return i(w,{fallback:null,children:i(R,{...o})})}var _=N;export{_ as default};
@@ -11,7 +11,7 @@ interface AuthFallbackProps {
11
11
  * Graceful fallback component when auth is not available
12
12
  * Prevents app crashes and provides clear feedback to users
13
13
  *
14
- * @version 0.0.1
14
+ * @version 0.1.0
15
15
  * @since 0.0.1
16
16
  * @author AMBROISE PARK Consulting
17
17
  */
@@ -20,7 +20,7 @@ export declare function AuthFallback({ message, showLoginButton, className, }: A
20
20
  * Higher-order component that wraps auth components
21
21
  * Automatically shows AuthFallback when auth is not available
22
22
  *
23
- * @version 0.0.1
23
+ * @version 0.1.0
24
24
  * @since 0.0.1
25
25
  * @author AMBROISE PARK Consulting
26
26
  * @param Component The auth component to wrap
@@ -34,7 +34,7 @@ export declare function withAuthFallback<P extends object>(Component: ComponentT
34
34
  * @param fallbackProps Props to pass to AuthFallback
35
35
  * @returns Object with component and fallback for conditional rendering
36
36
  *
37
- * @version 0.0.1
37
+ * @version 0.1.0
38
38
  * @since 0.0.1
39
39
  * @author AMBROISE PARK Consulting
40
40
  */
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{FeatureFallback as s,withFeatureFallback as r}from"@donotdev/components";import{isFeatureAvailable as n,FRAMEWORK_FEATURES as i}from"@donotdev/core";function o({message:t="Authentication is not available",showLoginButton:e=!1,className:u=""}){return a(s,{featureName:"Authentication",message:t,icon:"\u{1F512}",showActionButton:e,actionButtonText:"Sign In (Unavailable)",className:u,helpText:"This feature requires authentication to be configured."})}function l(t,e){return r(t,"Authentication",()=>n(i.AUTH),{message:e?.message,showActionButton:e?.showLoginButton,actionButtonText:"Sign In (Unavailable)",icon:"\u{1F512}",helpText:"This feature requires authentication to be configured."})}function c(t){return{isAuthAvailable:n(i.AUTH),AuthFallbackComponent:()=>a(o,{...t})}}export{o as AuthFallback,c as useAuthComponent,l as withAuthFallback};
1
+ import{jsx as a}from"react/jsx-runtime";import{FeatureFallback as u,withFeatureFallback as r}from"@donotdev/components";import{isFeatureAvailable as n,FRAMEWORK_FEATURES as i}from"@donotdev/core";function l({message:t="Authentication is not available",showLoginButton:e=!1,className:o=""}){return a(u,{featureName:"Authentication",message:t,icon:"\u{1F512}",showActionButton:e,actionButtonText:"Sign In (Unavailable)",className:o,helpText:"This feature requires authentication to be configured."})}function A(t,e){return r(t,"Authentication",()=>n(i.AUTH),{message:e?.message,showActionButton:e?.showLoginButton,actionButtonText:"Sign In (Unavailable)",icon:"\u{1F512}",helpText:"This feature requires authentication to be configured."})}function m(t){return{isAuthAvailable:n(i.AUTH),AuthFallbackComponent:()=>a(l,{...t})}}export{l as AuthFallback,m as useAuthComponent,A as withAuthFallback};
@@ -10,7 +10,7 @@ interface AuthPartnerButtonComponentProps extends AuthPartnerButtonProps {
10
10
  * Provides a unified button interface for authentication with various partners
11
11
  * (Google, Facebook, etc.) and methods (OAuth, email/password, email link).
12
12
  *
13
- * @version 0.0.1
13
+ * @version 0.1.0
14
14
  * @since 0.0.1
15
15
  * @author AMBROISE PARK Consulting
16
16
  */
@@ -1,5 +1,5 @@
1
- "use client";import{jsx as a}from"react/jsx-runtime";import{useMemo as I,useState as B}from"react";if(typeof document<"u"&&!document.getElementById("auth-partner-button-styles")){const r=document.createElement("style");r.id="auth-partner-button-styles",r.textContent=`
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import{useMemo as C,useState as D}from"react";if(typeof document<"u"&&!document.getElementById("auth-partner-button-styles")){const n=document.createElement("style");n.id="auth-partner-button-styles",n.textContent=`
2
2
  .dndev-interactive.auth-partner-button-custom[data-variant='outline']:hover {
3
3
  background-color: var(--partner-hover-bg);
4
4
  }
5
- `,document.head.appendChild(r)}import{cn as D,DISPLAY as S,PROVIDER_ICONS as U,DefaultProviderIcon as M,Button as _,BUTTON_VARIANT as $,Spinner as V}from"@donotdev/components";import{AUTH_PARTNERS as W,useTranslation as j}from"@donotdev/core";import{EmailLinkForm as F}from"./EmailLinkForm";import H from"./EmailPasswordForm";import{getAuthMethod as k}from"../constants";import{useAuth as s}from"../useAuth";function K({partnerId:r,method:p,onSuccess:u,onError:l,className:c="",children:b,disabled:h=!1,display:f=S.AUTO,style:g,...q}){const{t:i}=j("auth"),v=s("user"),E=s("signInWithPartner"),A=s("linkWithPartner"),N=s("isAvailable"),[o,y]=B(!1),n=I(()=>W[r],[r]);if(r==="password")return a("div",{className:c,children:a(H,{mode:"signin",onSuccess:()=>u?.(null),onError:l,compact:!0})});if(r==="emailLink")return a("div",{className:c,children:a(F,{onSuccess:()=>u?.(null),onError:l})});const T=I(()=>U[r]||M,[r]),P=n?.firebaseProviderId,d=!!v?.providerData?.some(t=>t.providerId===P),m=v&&!d,w=async()=>{if(!(o||h)){y(!0);try{let t;if(m)t=await A(r,k(p));else{const R=k(p);t=await E(r,R)}t&&u?.(t)}catch(t){l?.(t instanceof Error?t:new Error(String(t)))}finally{y(!1)}}},e=n?.name,O=()=>{if(b)return b;if(m)return o?i("buttons.linking",{partner:e}):d?i("buttons.linked",{partner:e}):i("buttons.link",{partner:e});if(o)return i("buttons.signingIn",{partner:e});const t=n?.button?.textKey;return t?i(t):`Sign in with ${e}`},x=h||o||!N||m&&d||!1,C=n?.button?{backgroundColor:n.button.backgroundColor,color:n.button.textColor,borderColor:n.button.borderColor,"--partner-hover-bg":n.button.hoverBackgroundColor}:void 0,L=g?{...C,...g}:C;return a(_,{variant:$.OUTLINE,onClick:w,disabled:x,"aria-busy":o,display:f,"aria-label":o?`Signing in with ${e}...`:`Sign in with ${e}`,tooltip:void 0,style:L,className:D(n?.button&&"auth-partner-button-custom",c),icon:o?a(V,{"aria-label":"Loading"}):T,children:f!==S.COMPACT&&O()})}var Y=K;export{Y as default};
5
+ `,document.head.appendChild(n)}import{cn as R,DISPLAY as P,PROVIDER_ICONS as M,DefaultProviderIcon as U,Button as W,BUTTON_VARIANT as _,Spinner as $}from"@donotdev/components";import{AUTH_PARTNERS as j,useTranslation as F}from"@donotdev/core";import{EmailLinkForm as K}from"./EmailLinkForm";import V from"./EmailPasswordForm";import{getAuthMethod as A}from"../constants";import{useAuth as s}from"../useAuth";function H({partnerId:n,method:f,onSuccess:u,onError:l,className:c="",children:b,disabled:h=!1,display:g=P.AUTO,style:p,...Y}){const{t:a}=F("auth"),v=s("user"),S=s("signInWithPartner"),T=s("linkWithPartner"),E=s("isAvailable"),[r,k]=D(!1),o=C(()=>j[n],[n]);if(n==="password")return i("div",{className:c,children:i(V,{mode:"signin",onSuccess:()=>u?.(null),onError:l,compact:!0})});if(n==="emailLink")return i("div",{className:c,children:i(K,{onSuccess:()=>u?.(null),onError:l})});const L=C(()=>M[n]||U,[n]),w=o?.firebaseProviderId,d=!!v?.providerData?.some(t=>t.providerId===w),m=v&&!d,x=async()=>{if(!(r||h)){k(!0);try{let t;if(m)t=await T(n,A(f));else{const O=A(f);t=await S(n,O)}t&&u?.(t)}catch(t){l?.(t instanceof Error?t:new Error(String(t)))}finally{k(!1)}}},e=o?.name,I=()=>{if(b)return b;if(m)return r?a("buttons.linking",{partner:e}):d?a("buttons.linked",{partner:e}):a("buttons.link",{partner:e});if(r)return a("buttons.signingIn",{partner:e});const t=o?.button?.textKey;return t?a(t):`Sign in with ${e}`},B=h||r||!E||m&&d||!1,y=o?.button?{backgroundColor:o.button.backgroundColor,color:o.button.textColor,borderColor:o.button.borderColor,"--partner-hover-bg":o.button.hoverBackgroundColor}:void 0,N=p?{...y,...p}:y;return i(W,{variant:_.OUTLINE,onClick:x,disabled:B,"aria-busy":r,display:g,"aria-label":r?`Signing in with ${e}...`:`Sign in with ${e}`,tooltip:void 0,style:N,className:R(o?.button&&"auth-partner-button-custom",c),icon:r?i($,{"aria-label":"Loading"}):L,children:g!==P.COMPACT&&I()})}var nt=H;export{nt as default};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Re-authentication dialog props
3
3
  *
4
- * @version 0.0.1
4
+ * @version 0.1.0
5
5
  * @since 0.0.1
6
6
  * @author AMBROISE PARK Consulting
7
7
  */
@@ -33,7 +33,7 @@ export interface ReauthDialogProps {
33
33
  * />
34
34
  * ```
35
35
  *
36
- * @version 0.0.1
36
+ * @version 0.1.0
37
37
  * @since 0.0.1
38
38
  * @author AMBROISE PARK Consulting
39
39
  */
@@ -41,7 +41,7 @@ export declare function ReauthDialog({ open, isLoading, error, onReauth, onCance
41
41
  /**
42
42
  * Confirmation dialog props
43
43
  *
44
- * @version 0.0.1
44
+ * @version 0.1.0
45
45
  * @since 0.0.1
46
46
  * @author AMBROISE PARK Consulting
47
47
  */
@@ -73,7 +73,7 @@ export interface ConfirmDeleteDialogProps {
73
73
  * />
74
74
  * ```
75
75
  *
76
- * @version 0.0.1
76
+ * @version 0.1.0
77
77
  * @since 0.0.1
78
78
  * @author AMBROISE PARK Consulting
79
79
  */
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as o,Fragment as f}from"react/jsx-runtime";import{Trash2 as y}from"lucide-react";import{useState as A}from"react";import{Dialog as g,Button as s,BUTTON_VARIANT as u,PasswordInput as R,Label as D,Checkbox as k,Alert as C,ALERT_VARIANT as b,Stack as l,Text as v,List as w}from"@donotdev/components";import{useTranslation as T}from"@donotdev/core";function E({open:h,isLoading:c,error:r,onReauth:m,onCancel:a}){const{t:e}=T("auth"),[i,p]=A(""),d=async()=>{await m(i)};return n(g,{open:h,onOpenChange:t=>!t&&a(),title:e("deleteAccount.reauth.title","Confirm Your Identity"),description:e("deleteAccount.reauth.description","For security, please re-enter your password to continue."),footer:o(f,{children:[n(s,{variant:u.OUTLINE,onClick:a,disabled:c,children:e("deleteAccount.reauth.cancel","Cancel")}),n(s,{variant:u.DEFAULT,onClick:d,disabled:c||!i,children:c?e("deleteAccount.reauth.verifying","Verifying..."):e("deleteAccount.reauth.continue","Continue")})]}),children:n("form",{onSubmit:t=>{t.preventDefault(),d()},children:o(l,{children:[n(R,{value:i,onChange:t=>p(t.target.value),label:e("deleteAccount.reauth.password","Password"),disabled:c,placeholder:e("deleteAccount.reauth.passwordPlaceholder","Enter your password"),required:!0,className:"dndev-w-full"}),r&&n(C,{variant:b.ERROR,description:r})]})})})}function x({open:h,isLoading:c,error:r,onConfirm:m,onCancel:a}){const{t:e}=T("auth"),[i,p]=A(!1),d=async()=>{i&&await m()};return n(g,{open:h,onOpenChange:t=>!t&&a(),"data-content-size":"text",title:e("deleteAccount.confirm.title","Delete Your Account?"),description:e("deleteAccount.confirm.description","This action cannot be undone. This will permanently delete your account."),footer:o(f,{children:[n(s,{variant:u.OUTLINE,onClick:a,disabled:c,children:e("deleteAccount.confirm.cancel","Cancel")}),n(s,{variant:u.DESTRUCTIVE,icon:y,onClick:d,disabled:c||!i,children:c?e("deleteAccount.confirm.deleting","Deleting..."):e("deleteAccount.confirm.delete","Delete My Account")})]}),children:o(l,{gap:"large",children:[o(l,{children:[n(v,{as:"h4",level:"h4",children:e("deleteAccount.confirm.whatDeleted","What will be deleted:")}),n(w,{items:[e("deleteAccount.confirm.credentials","Your account and authentication credentials"),e("deleteAccount.confirm.profile","Your profile information"),e("deleteAccount.confirm.oauth","All connected OAuth providers"),e("deleteAccount.confirm.subscriptions","Active subscriptions (will be canceled)")]})]}),o(l,{children:[n(v,{as:"h4",level:"h4",children:e("deleteAccount.confirm.whatKept","What will be kept (anonymized):")}),n(w,{items:[e("deleteAccount.confirm.billing","Billing history for tax/accounting purposes"),e("deleteAccount.confirm.invoices","Past invoices and transaction records")]})]}),o(l,{direction:"row",align:"start",children:[n(k,{id:"confirm-delete",checked:i,onCheckedChange:t=>p(t===!0)}),n(D,{htmlFor:"confirm-delete",children:e("deleteAccount.confirm.checkbox","I understand this action cannot be undone")})]}),r&&n(C,{variant:b.ERROR,description:r})]})})}export{x as ConfirmDeleteDialog,E as ReauthDialog};
1
+ "use client";import{jsx as t,jsxs as i,Fragment as p}from"react/jsx-runtime";import{Trash2 as y}from"lucide-react";import{useState as A}from"react";import{Dialog as b,Button as s,BUTTON_VARIANT as u,PasswordInput as x,Label as D,Checkbox as R,Alert as w,ALERT_VARIANT as v,Stack as a,Text as C,List as g}from"@donotdev/components";import{useTranslation as T}from"@donotdev/core";function F({open:h,isLoading:c,error:r,onReauth:m,onCancel:l}){const{t:e}=T("auth"),[o,f]=A(""),d=async()=>{await m(o)};return t(b,{open:h,onOpenChange:n=>!n&&l(),title:e("deleteAccount.reauth.title","Confirm Your Identity"),description:e("deleteAccount.reauth.description","For security, please re-enter your password to continue."),footer:i(p,{children:[t(s,{variant:u.OUTLINE,onClick:l,disabled:c,children:e("deleteAccount.reauth.cancel","Cancel")}),t(s,{variant:u.DEFAULT,onClick:d,disabled:c||!o,children:c?e("deleteAccount.reauth.verifying","Verifying..."):e("deleteAccount.reauth.continue","Continue")})]}),children:t("form",{onSubmit:n=>{n.preventDefault(),d()},children:i(a,{children:[t(x,{value:o,onChange:n=>f(n.target.value),label:e("deleteAccount.reauth.password","Password"),disabled:c,placeholder:e("deleteAccount.reauth.passwordPlaceholder","Enter your password"),required:!0,className:"dndev-w-full"}),r&&t(w,{variant:v.ERROR,description:r})]})})})}function P({open:h,isLoading:c,error:r,onConfirm:m,onCancel:l}){const{t:e}=T("auth"),[o,f]=A(!1),d=async()=>{o&&await m()};return t(b,{open:h,onOpenChange:n=>!n&&l(),"data-content-size":"text",title:e("deleteAccount.confirm.title","Delete Your Account?"),description:e("deleteAccount.confirm.description","This action cannot be undone. This will permanently delete your account."),footer:i(p,{children:[t(s,{variant:u.OUTLINE,onClick:l,disabled:c,children:e("deleteAccount.confirm.cancel","Cancel")}),t(s,{variant:u.DESTRUCTIVE,icon:y,onClick:d,disabled:c||!o,children:c?e("deleteAccount.confirm.deleting","Deleting..."):e("deleteAccount.confirm.delete","Delete My Account")})]}),children:i(a,{gap:"large",children:[i(a,{children:[t(C,{as:"h4",level:"h4",children:e("deleteAccount.confirm.whatDeleted","What will be deleted:")}),t(g,{items:[e("deleteAccount.confirm.credentials","Your account and authentication credentials"),e("deleteAccount.confirm.profile","Your profile information"),e("deleteAccount.confirm.oauth","All connected OAuth providers"),e("deleteAccount.confirm.subscriptions","Active subscriptions (will be canceled)")]})]}),i(a,{children:[t(C,{as:"h4",level:"h4",children:e("deleteAccount.confirm.whatKept","What will be kept (anonymized):")}),t(g,{items:[e("deleteAccount.confirm.billing","Billing history for tax/accounting purposes"),e("deleteAccount.confirm.invoices","Past invoices and transaction records")]})]}),i(a,{direction:"row",align:"start",children:[t(R,{id:"confirm-delete",checked:o,onCheckedChange:n=>f(n===!0)}),t(D,{htmlFor:"confirm-delete",children:e("deleteAccount.confirm.checkbox","I understand this action cannot be undone")})]}),r&&t(w,{variant:v.ERROR,description:r})]})})}export{P as ConfirmDeleteDialog,F as ReauthDialog};
@@ -17,7 +17,7 @@ export interface EmailLinkFormProps {
17
17
  * 4. Detects when user returns from email
18
18
  * 5. Completes sign-in automatically
19
19
  *
20
- * @version 0.0.1
20
+ * @version 0.1.0
21
21
  * @since 0.0.1
22
22
  * @author AMBROISE PARK Consulting
23
23
  */
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{Mail as o,CheckCircle as S}from"lucide-react";import{Button as c,BUTTON_VARIANT as f,Input as T,Alert as b,ALERT_VARIANT as C,Spinner as R,Stack as n,Text as s}from"@donotdev/components";import{useTranslation as x}from"@donotdev/core";import{useEmailLinkForm as A}from"../hooks/useEmailLinkForm";function m({className:r="",onSuccess:u,onError:h,actionCodeSettings:k}){const{t:i}=x("auth"),{email:t,setEmail:L,isLoading:a,isSent:v,error:d,handleSendLink:p,handleResend:g,canSubmit:E}=A({onSuccess:u,onError:h,actionCodeSettings:k});return v?l(n,{className:r,children:[l(n,{align:"center",children:[e(S,{className:"dndev-size-touch"}),e(s,{as:"h3",level:"h3",children:i("emailLink.checkEmail","Check Your Email")}),e(s,{level:"small",variant:"muted",className:"dndev-text-center",children:i("emailLink.sentMessage",`We've sent a sign-in link to ${t}. Click the link in your email to complete sign-in.`)})]}),e(n,{direction:"row",justify:"center",children:e(c,{variant:f.OUTLINE,onClick:g,icon:o,iconEnd:!1,children:i("emailLink.resend","Resend Link")})})]}):e("form",{onSubmit:p,className:r,children:l(n,{children:[e(T,{type:"email",label:i("emailLink.emailLabel","Email Address"),value:t,onChange:N=>L(N.target.value),placeholder:i("emailLink.emailPlaceholder","Enter your email address"),required:!0,disabled:a,className:"dndev-w-full"}),d&&e(b,{variant:C.ERROR,description:d}),e(c,{type:"submit",disabled:!E,icon:a?e(R,{"aria-label":"Loading"}):o,iconEnd:!1,className:"dndev-w-full",children:a?i("emailLink.sending","Sending Link..."):i("emailLink.sendLink","Send Sign-In Link")}),e(s,{level:"small",variant:"muted",className:"dndev-text-center",children:i("emailLink.helpText","We'll send you a secure link to sign in without a password.")})]})})}var y=m;export{m as EmailLinkForm,y as default};
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Mail as m,CheckCircle as E}from"lucide-react";import{Button as o,BUTTON_VARIANT as x,Input as N,Alert as S,ALERT_VARIANT as T,Spinner as b,Stack as n,Text as r}from"@donotdev/components";import{useTranslation as R}from"@donotdev/core";import{useEmailLinkForm as A}from"../hooks/useEmailLinkForm";function y({className:t="",onSuccess:c,onError:u,actionCodeSettings:h}){const{t:i}=R("auth"),{email:s,setEmail:k,isLoading:l,isSent:L,error:d,handleSendLink:p,handleResend:v,canSubmit:f}=A({onSuccess:c,onError:u,actionCodeSettings:h});return L?a(n,{className:t,children:[a(n,{align:"center",children:[e(E,{className:"dndev-size-touch"}),e(r,{as:"h3",level:"h3",children:i("emailLink.checkEmail","Check Your Email")}),e(r,{level:"small",variant:"muted",className:"dndev-text-center",children:i("emailLink.sentMessage",`We've sent a sign-in link to ${s}. Click the link in your email to complete sign-in.`)})]}),e(n,{direction:"row",justify:"center",children:e(o,{variant:x.OUTLINE,onClick:v,icon:m,iconEnd:!1,children:i("emailLink.resend","Resend Link")})})]}):e("form",{onSubmit:p,className:t,children:a(n,{children:[e(N,{type:"email",label:i("emailLink.emailLabel","Email Address"),value:s,onChange:g=>k(g.target.value),placeholder:i("emailLink.emailPlaceholder","Enter your email address"),required:!0,disabled:l,className:"dndev-w-full"}),d&&e(S,{variant:T.ERROR,description:d}),e(o,{type:"submit",disabled:!f,icon:l?e(b,{"aria-label":"Loading"}):m,iconEnd:!1,className:"dndev-w-full",children:l?i("emailLink.sending","Sending Link..."):i("emailLink.sendLink","Send Sign-In Link")}),e(r,{level:"small",variant:"muted",className:"dndev-text-center",children:i("emailLink.helpText","We'll send you a secure link to sign in without a password.")})]})})}var O=y;export{y as EmailLinkForm,O as default};
@@ -12,7 +12,7 @@ import type { EmailPasswordFormProps } from '../constants';
12
12
  * - Accessible with proper ARIA
13
13
  *
14
14
  * @component
15
- * @version 0.0.4
15
+ * @version 0.1.0
16
16
  */
17
17
  declare function EmailPasswordForm({ mode, onSuccess, onError, className, }: EmailPasswordFormProps): import("react/jsx-runtime").JSX.Element;
18
18
  export default EmailPasswordForm;
@@ -1 +1 @@
1
- "use client";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Info as Y}from"lucide-react";import{useState as p}from"react";import{useForm as Z,Controller as P,useWatch as k}from"react-hook-form";import{Alert as R,ALERT_VARIANT as q,Button as h,BUTTON_VARIANT as w,Checkbox as D,HoverCard as J,Input as Q,Label as X,PasswordInput as L,Stack as t,Text as l,cn as ee}from"@donotdev/components";import{useTranslation as ae}from"@donotdev/core";import{useAuth as c}from"../useAuth";import{PasswordStrengthIndicator as re}from"./PasswordStrengthIndicator";function se({mode:x="signin",onSuccess:T,onError:_,className:y=""}){const{t:e}=ae("auth"),O=c("signInWithEmail"),U=c("createUserWithEmail"),M=c("sendPasswordResetEmail"),W=c("setRememberMe"),$=c("isAvailable"),H=c("loading"),[E,N]=p(x),d=E==="signup",[f,V]=p(!1),[j,F]=p(""),[m,S]=p(!1),[g,I]=p(!1),{control:u,handleSubmit:K,formState:{errors:s,isSubmitting:z},setError:b}=Z({mode:"onChange",defaultValues:{email:"",password:"",confirmPassword:""}}),A=k({control:u,name:"password"}),v=k({control:u,name:"email"}),B=async r=>{try{E==="signin"?(f!==void 0&&await W(f),await O(r.email,r.password)):await U(r.email,r.password),T?.(void 0)}catch(i){const C=i instanceof Error?i.message:String(i);b("root",{message:C}),_?.(i instanceof Error?i:new Error(C))}},G=async()=>{if(!v||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v)){b("email",{message:e("emailRequired","Email is required")});return}S(!0);try{await M(v),I(!0),F(v)}catch(r){const i=r instanceof Error?r.message:String(r);b("root",{message:i})}finally{S(!1)}};if(!$)return a("div",{className:y,children:a(R,{variant:q.WARNING,title:e("unavailable.title","Authentication Unavailable"),description:e("unavailable.description","Please accept cookies to enable authentication.")})});const n=H||z;return a("form",{onSubmit:K(B),className:ee("dndev-auth-form",y),noValidate:!0,children:o(t,{children:[s.root&&a(R,{variant:q.ERROR,description:s.root.message}),g&&a(R,{variant:q.SUCCESS,title:e("forgotPassword.sent","Password reset email sent"),description:e("forgotPassword.checkEmail",`Check your email at ${j} for password reset instructions.`)}),a(P,{name:"email",control:u,rules:{required:e("emailRequired","Email is required"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:e("emailInvalid","Invalid email address")}},render:({field:r})=>o(t,{gap:"tight",children:[a(Q,{...r,type:"email",label:e("email","Email"),placeholder:e("emailPlaceholder","Enter your email"),disabled:n||m,"aria-invalid":!!s.email,"aria-describedby":s.email?"email-error":void 0,className:"dndev-w-full","data-variant":s.email?"destructive":void 0,onChange:i=>{r.onChange(i),g&&I(!1)}}),s.email&&a(l,{as:"span",level:"caption",variant:"destructive",id:"email-error",role:"alert",children:s.email.message})]})}),a(P,{name:"password",control:u,rules:{required:e("passwordRequired","Password is required"),minLength:{value:8,message:e("passwordMinLength","Password must be at least 8 characters")},validate:r=>{if(!r)return!0;if(d){if(!/[A-Z]/.test(r))return e("passwordRequirement.uppercase","Password must contain at least one uppercase letter");if(!/[a-z]/.test(r))return e("passwordRequirement.lowercase","Password must contain at least one lowercase letter");if(!/[0-9]/.test(r))return e("passwordRequirement.number","Password must contain at least one number")}return!0}},render:({field:r})=>{const i=`password-${r.name}`;return o(t,{gap:"tight",children:[a(L,{...r,id:i,label:e("password","Password"),placeholder:e("passwordPlaceholder","Enter your password"),disabled:n||m,"aria-invalid":!!s.password,"aria-describedby":s.password?"password-error":void 0,className:"dndev-w-full","data-variant":s.password?"destructive":void 0}),s.password&&a(l,{as:"span",level:"caption",variant:"destructive",id:"password-error",role:"alert",children:s.password.message})]})}}),d&&a(P,{name:"confirmPassword",control:u,rules:{required:e("confirmPasswordRequired","Please confirm your password"),validate:r=>r!==A?e("confirmPasswordMismatch","Passwords do not match"):!0},render:({field:r})=>o(t,{gap:"tight",children:[a(L,{...r,label:e("confirmPassword","Confirm Password"),placeholder:e("confirmPasswordPlaceholder","Re-enter your password"),disabled:n,"aria-invalid":!!s.confirmPassword,"aria-describedby":s.confirmPassword?"confirm-password-error":void 0,className:"dndev-w-full","data-variant":s.confirmPassword?"destructive":void 0}),s.confirmPassword&&a(l,{as:"span",level:"caption",variant:"destructive",id:"confirm-password-error",role:"alert",children:s.confirmPassword.message})]})}),d&&a(re,{password:A||"",minLength:8,showRequirements:!1}),d&&a(J,{trigger:a(h,{type:"button",variant:w.GHOST,className:"dndev-w-fit dndev-p-0 dndev-h-auto",style:{minHeight:"auto",padding:0},children:o(t,{direction:"row",align:"center",gap:"tight",children:[a(l,{as:"span",level:"caption",variant:"muted",children:e("passwordRequirements","Password requirements")}),a(Y,{className:"dndev-size-xs"})]})}),side:"bottom",align:"start",children:o(t,{gap:"tight",className:"dndev-text-sm",children:[a(l,{as:"strong",level:"small",children:e("passwordRequirements.title","Password Requirements")}),o(t,{gap:"tight",as:"ul",className:"dndev-m-0 dndev-ps-md",children:[a("li",{children:e("passwordRequirement.length","At least 8 characters")}),a("li",{children:e("passwordRequirement.uppercase","One uppercase letter")}),a("li",{children:e("passwordRequirement.lowercase","One lowercase letter")}),a("li",{children:e("passwordRequirement.number","One number")}),a("li",{children:e("passwordRequirement.special","One special character (!@#$%^&*)")})]})]})}),!d&&!g&&o(t,{direction:"row",gap:"tight",align:"center",children:[a(D,{id:"remember-me",checked:f,onCheckedChange:r=>V(r===!0),disabled:n||m}),a(X,{htmlFor:"remember-me",children:e("rememberMe","Remember me")})]}),a(h,{type:"submit",variant:w.PRIMARY,disabled:n,fullWidth:!0,children:n?e("loading","Loading..."):d?e("actions.sign_up_submit","Sign Up"):e("actions.sign_in_submit","Sign In")}),!d&&!g&&o(t,{direction:"row",gap:"tight",justify:"center",align:"center",children:[a(h,{type:"button",variant:w.LINK,disabled:n||m,onClick:G,children:m?e("loading","Loading..."):e("forgotPassword","Forgot password?")}),a(l,{as:"span",variant:"muted",children:"|"}),a(h,{type:"button",variant:w.LINK,disabled:n,onClick:()=>N("signup"),children:e("actions.sign_up_submit","Sign Up")})]}),d&&a(t,{align:"center",children:a(h,{type:"button",variant:w.LINK,disabled:n,onClick:()=>N("signin"),children:e("alreadyHaveAccount","Already have an account? Sign In")})})]})})}var ie=se;export{ie as default};
1
+ "use client";import{jsx as r,jsxs as o}from"react/jsx-runtime";import{Info as Y}from"lucide-react";import{useState as p}from"react";import{useForm as Z,Controller as P,useWatch as L}from"react-hook-form";import{Alert as R,ALERT_VARIANT as q,Button as w,BUTTON_VARIANT as g,Checkbox as D,HoverCard as J,Input as Q,Label as X,PasswordInput as M,Stack as t,Text as l,cn as ee}from"@donotdev/components";import{useTranslation as re}from"@donotdev/core";import{useAuth as c}from"../useAuth";import{PasswordStrengthIndicator as se}from"./PasswordStrengthIndicator";function ae({mode:k="signin",onSuccess:_,onError:x,className:y=""}){const{t:e}=re("auth"),F=c("signInWithEmail"),T=c("createUserWithEmail"),U=c("sendPasswordResetEmail"),O=c("setRememberMe"),W=c("isAvailable"),V=c("loading"),[E,S]=p(k),d=E==="signup",[v,j]=p(!1),[$,H]=p(""),[m,I]=p(!1),[h,A]=p(!1),{control:u,handleSubmit:K,formState:{errors:a,isSubmitting:z},setError:b}=Z({mode:"onChange",defaultValues:{email:"",password:"",confirmPassword:""}}),C=L({control:u,name:"password"}),f=L({control:u,name:"email"}),B=async s=>{try{E==="signin"?(v!==void 0&&await O(v),await F(s.email,s.password)):await T(s.email,s.password),_?.(void 0)}catch(i){const N=i instanceof Error?i.message:String(i);b("root",{message:N}),x?.(i instanceof Error?i:new Error(N))}},G=async()=>{if(!f||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f)){b("email",{message:e("emailRequired","Email is required")});return}I(!0);try{await U(f),A(!0),H(f)}catch(s){const i=s instanceof Error?s.message:String(s);b("root",{message:i})}finally{I(!1)}};if(!W)return r("div",{className:y,children:r(R,{variant:q.WARNING,title:e("unavailable.title","Authentication Unavailable"),description:e("unavailable.description","Please accept cookies to enable authentication.")})});const n=V||z;return r("form",{onSubmit:K(B),className:ee("dndev-auth-form",y),noValidate:!0,children:o(t,{children:[a.root&&r(R,{variant:q.ERROR,description:a.root.message}),h&&r(R,{variant:q.SUCCESS,title:e("forgotPassword.sent","Password reset email sent"),description:e("forgotPassword.checkEmail",`Check your email at ${$} for password reset instructions.`)}),r(P,{name:"email",control:u,rules:{required:e("emailRequired","Email is required"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:e("emailInvalid","Invalid email address")}},render:({field:s})=>o(t,{gap:"tight",children:[r(Q,{...s,type:"email",label:e("email","Email"),placeholder:e("emailPlaceholder","Enter your email"),disabled:n||m,"aria-invalid":!!a.email,"aria-describedby":a.email?"email-error":void 0,className:"dndev-w-full","data-variant":a.email?"destructive":void 0,onChange:i=>{s.onChange(i),h&&A(!1)}}),a.email&&r(l,{as:"span",level:"caption",variant:"destructive",id:"email-error",role:"alert",children:a.email.message})]})}),r(P,{name:"password",control:u,rules:{required:e("passwordRequired","Password is required"),minLength:{value:8,message:e("passwordMinLength","Password must be at least 8 characters")},validate:s=>{if(!s)return!0;if(d){if(!/[A-Z]/.test(s))return e("passwordRequirement.uppercase","Password must contain at least one uppercase letter");if(!/[a-z]/.test(s))return e("passwordRequirement.lowercase","Password must contain at least one lowercase letter");if(!/[0-9]/.test(s))return e("passwordRequirement.number","Password must contain at least one number")}return!0}},render:({field:s})=>{const i=`password-${s.name}`;return o(t,{gap:"tight",children:[r(M,{...s,id:i,label:e("password","Password"),placeholder:e("passwordPlaceholder","Enter your password"),disabled:n||m,"aria-invalid":!!a.password,"aria-describedby":a.password?"password-error":void 0,className:"dndev-w-full","data-variant":a.password?"destructive":void 0}),a.password&&r(l,{as:"span",level:"caption",variant:"destructive",id:"password-error",role:"alert",children:a.password.message})]})}}),d&&r(P,{name:"confirmPassword",control:u,rules:{required:e("confirmPasswordRequired","Please confirm your password"),validate:s=>s!==C?e("confirmPasswordMismatch","Passwords do not match"):!0},render:({field:s})=>o(t,{gap:"tight",children:[r(M,{...s,label:e("confirmPassword","Confirm Password"),placeholder:e("confirmPasswordPlaceholder","Re-enter your password"),disabled:n,"aria-invalid":!!a.confirmPassword,"aria-describedby":a.confirmPassword?"confirm-password-error":void 0,className:"dndev-w-full","data-variant":a.confirmPassword?"destructive":void 0}),a.confirmPassword&&r(l,{as:"span",level:"caption",variant:"destructive",id:"confirm-password-error",role:"alert",children:a.confirmPassword.message})]})}),d&&r(se,{password:C||"",minLength:8,showRequirements:!1}),d&&r(J,{trigger:r(w,{type:"button",variant:g.GHOST,className:"dndev-w-fit dndev-p-0 dndev-h-auto",style:{minHeight:"auto",padding:0},children:o(t,{direction:"row",align:"center",gap:"tight",children:[r(l,{as:"span",level:"caption",variant:"muted",children:e("passwordRequirements","Password requirements")}),r(Y,{className:"dndev-size-xs"})]})}),side:"bottom",align:"start",children:o(t,{gap:"tight",className:"dndev-text-sm",children:[r(l,{as:"strong",level:"small",children:e("passwordRequirements.title","Password Requirements")}),o(t,{gap:"tight",as:"ul",className:"dndev-m-0 dndev-ps-md",children:[r("li",{children:e("passwordRequirement.length","At least 8 characters")}),r("li",{children:e("passwordRequirement.uppercase","One uppercase letter")}),r("li",{children:e("passwordRequirement.lowercase","One lowercase letter")}),r("li",{children:e("passwordRequirement.number","One number")}),r("li",{children:e("passwordRequirement.special","One special character (!@#$%^&*)")})]})]})}),!d&&!h&&o(t,{direction:"row",gap:"tight",align:"center",children:[r(D,{id:"remember-me",checked:v,onCheckedChange:s=>j(s===!0),disabled:n||m}),r(X,{htmlFor:"remember-me",children:e("rememberMe","Remember me")})]}),r(w,{type:"submit",variant:g.PRIMARY,disabled:n,fullWidth:!0,children:n?e("loading","Loading..."):d?e("actions.sign_up_submit","Sign Up"):e("actions.sign_in_submit","Sign In")}),!d&&!h&&o(t,{direction:"row",gap:"tight",justify:"center",align:"center",children:[r(w,{type:"button",variant:g.LINK,disabled:n||m,onClick:G,children:m?e("loading","Loading..."):e("forgotPassword","Forgot password?")}),r(l,{as:"span",variant:"muted",children:"|"}),r(w,{type:"button",variant:g.LINK,disabled:n,onClick:()=>S("signup"),children:e("actions.sign_up_submit","Sign Up")})]}),d&&r(t,{align:"center",children:r(w,{type:"button",variant:g.LINK,disabled:n,onClick:()=>S("signin"),children:e("alreadyHaveAccount","Already have an account? Sign In")})})]})})}var ue=ae;export{ue as default};
@@ -5,7 +5,7 @@ import type { JSX } from 'react';
5
5
  * Shows different states depending on verification status and provides verification button
6
6
  * Uses @donotdev/ui components for styling.
7
7
  *
8
- * @version 0.0.1
8
+ * @version 0.1.0
9
9
  * @since 0.0.1
10
10
  * @author AMBROISE PARK Consulting
11
11
  * @example
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as o}from"react/jsx-runtime";import{useId as h}from"react";import{Card as y,Button as V,BUTTON_VARIANT as A,Alert as b,Spinner as M,Stack as d,Text as T}from"@donotdev/components";import{useTranslation as x,handleError as w}from"@donotdev/core";import{useAuth as n}from"../useAuth";function I({verifyButtonText:j,successMessage:k,sendingMessage:B,alreadyVerifiedMessage:E,notSignedInMessage:R,errorMessage:$,id:u}){const{t:e}=x("auth"),t=n("user"),i=n("emailVerification"),l=n("sendEmailVerification"),s=t?.id,c=h(),a=u||`email-verification-${c}`,f=`${a}-heading`,m=`${a}-button`,g=async()=>{if(!(!t||!s))try{await l()}catch(v){w(v)}};if(!t||!s)return null;const p=()=>{if(i.status!=="pending"&&i.status==="error")return"error"};return r(y,{id:a,title:r("span",{id:f,children:e("emailVerification.title")}),children:o(d,{children:[o(d,{direction:"row",justify:"between",align:"center",children:[r(T,{level:"small",variant:"muted",children:e("emailVerification.status.unknown")}),r(V,{id:m,onClick:g,disabled:i.status==="pending","aria-busy":i.status==="pending",variant:A.PRIMARY,icon:i.status==="pending"?r(M,{"aria-label":"Loading"}):void 0,iconEnd:!1,children:i.status==="pending"?e("status.verifying"):e("buttons.verify","Verify")})]}),i.status!=="verified"&&r(b,{variant:p(),title:i.status==="error"?e("aria.errorAlert"):e("status.verifying"),description:i.status==="error"?("error"in i?i.error:void 0)||e("emailVerification.error","An error occurred"):e("emailVerification.sending","Sending verification email...")})]})})}var S=I;export{S as default};
1
+ "use client";import{jsx as r,jsxs as o}from"react/jsx-runtime";import{useId as h}from"react";import{Card as v,Button as y,BUTTON_VARIANT as I,Alert as A,Spinner as b,Stack as d,Text as x}from"@donotdev/components";import{useTranslation as M,handleError as T}from"@donotdev/core";import{useAuth as a}from"../useAuth";function j({verifyButtonText:E,successMessage:S,sendingMessage:w,alreadyVerifiedMessage:k,notSignedInMessage:B,errorMessage:R,id:c}){const{t:i}=M("auth"),n=a("user"),e=a("emailVerification"),u=a("sendEmailVerification"),s=n?.id,l=h(),t=c||`email-verification-${l}`,f=`${t}-heading`,m=`${t}-button`,g=async()=>{if(!(!n||!s))try{await u()}catch(V){T(V)}};if(!n||!s)return null;const p=()=>{if(e.status!=="pending"&&e.status==="error")return"error"};return r(v,{id:t,title:r("span",{id:f,children:i("emailVerification.title")}),children:o(d,{children:[o(d,{direction:"row",justify:"between",align:"center",children:[r(x,{level:"small",variant:"muted",children:i("emailVerification.status.unknown")}),r(y,{id:m,onClick:g,disabled:e.status==="pending","aria-busy":e.status==="pending",variant:I.PRIMARY,icon:e.status==="pending"?r(b,{"aria-label":"Loading"}):void 0,iconEnd:!1,children:e.status==="pending"?i("status.verifying"):i("buttons.verify","Verify")})]}),e.status!=="verified"&&r(A,{variant:p(),title:e.status==="error"?i("aria.errorAlert"):i("status.verifying"),description:e.status==="error"?("error"in e?e.error:void 0)||i("emailVerification.error","An error occurred"):i("emailVerification.sending","Sending verification email...")})]})})}var O=j;export{O as default};
@@ -8,7 +8,7 @@ interface BaseFeatureProps {
8
8
  /**
9
9
  * Feature ref interface
10
10
  *
11
- * @version 0.0.1
11
+ * @version 0.1.0
12
12
  * @since 0.0.1
13
13
  * @author AMBROISE PARK Consulting
14
14
  */
@@ -19,7 +19,7 @@ export interface FeatureRef {
19
19
  /**
20
20
  * Feature props interface
21
21
  *
22
- * @version 0.0.1
22
+ * @version 0.1.0
23
23
  * @since 0.0.1
24
24
  * @author AMBROISE PARK Consulting
25
25
  */
@@ -30,7 +30,7 @@ export interface FeatureProps extends BaseFeatureProps {
30
30
  /**
31
31
  * Tier feature props interface
32
32
  *
33
- * @version 0.0.1
33
+ * @version 0.1.0
34
34
  * @since 0.0.1
35
35
  * @author AMBROISE PARK Consulting
36
36
  */
@@ -41,7 +41,7 @@ export interface TierFeatureProps extends BaseFeatureProps {
41
41
  /**
42
42
  * Component that conditionally renders content based on subscription features
43
43
  *
44
- * @version 0.0.1
44
+ * @version 0.1.0
45
45
  * @since 0.0.1
46
46
  * @author AMBROISE PARK Consulting
47
47
  */
@@ -49,7 +49,7 @@ export declare const Feature: import("react").ForwardRefExoticComponent<FeatureP
49
49
  /**
50
50
  * Component that renders content only for users with Pro tier or higher
51
51
  *
52
- * @version 0.0.1
52
+ * @version 0.1.0
53
53
  * @since 0.0.1
54
54
  * @author AMBROISE PARK Consulting
55
55
  */
@@ -57,7 +57,7 @@ export declare const ProFeature: import("react").ForwardRefExoticComponent<Omit<
57
57
  /**
58
58
  * Component that renders content only for users with Premium tier
59
59
  *
60
- * @version 0.0.1
60
+ * @version 0.1.0
61
61
  * @since 0.0.1
62
62
  * @author AMBROISE PARK Consulting
63
63
  */
@@ -1 +1 @@
1
- "use client";import{Fragment as t,jsx as s}from"react/jsx-runtime";import{useImperativeHandle as o,forwardRef as i}from"react";import{hasTierAccess as f}from"@donotdev/core";import{useAuth as c}from"../useAuth";const p=i(({featureId:e,fallback:r=null,children:n},l)=>{const a=c("userSubscription")?.features?.includes(e)||!1;return o(l,()=>({enabled:a}),[a]),a?s(t,{children:n}):r?s(t,{children:r}):null}),m=i(({tier:e,fallback:r=null,children:n},l)=>{const a=c("userSubscription"),d=e||"pro",u=f(a?.tier,d);return o(l,()=>({enabled:u}),[u]),u?s(t,{children:n}):r?s(t,{children:r}):null}),h=i((e,r)=>s(m,{ref:r,tier:"pro",...e})),b=i((e,r)=>s(m,{ref:r,tier:"premium",...e}));export{p as Feature,b as PremiumFeature,h as ProFeature};
1
+ "use client";import{Fragment as s,jsx as t}from"react/jsx-runtime";import{useImperativeHandle as m,forwardRef as u}from"react";import{hasTierAccess as f}from"@donotdev/core";import{useAuth as l}from"../useAuth";const S=u(({featureId:e,fallback:r=null,children:i},o)=>{const n=l("userSubscription")?.features?.includes(e)||!1;return m(o,()=>({enabled:n}),[n]),n?t(s,{children:i}):r?t(s,{children:r}):null}),a=u(({tier:e,fallback:r=null,children:i},o)=>{const p=l("userSubscription"),n=e||"pro",c=f(p?.tier,n);return m(o,()=>({enabled:c}),[c]),c?t(s,{children:i}):r?t(s,{children:r}):null}),g=u((e,r)=>t(a,{ref:r,tier:"pro",...e})),T=u((e,r)=>t(a,{ref:r,tier:"premium",...e}));export{S as Feature,T as PremiumFeature,g as ProFeature};
@@ -82,7 +82,7 @@ declare function SubscriptionExpired(): import("react/jsx-runtime").JSX.Element;
82
82
  * @param props - FeatureGuard configuration
83
83
  * @returns Protected component or fallback component
84
84
  *
85
- * @version 0.0.1
85
+ * @version 0.1.0
86
86
  * @since 0.0.1
87
87
  * @author AMBROISE PARK Consulting
88
88
  */
@@ -110,7 +110,7 @@ export declare function FeatureGuard({ children, role, tier, subscription, valid
110
110
  * @param config - Feature access configuration
111
111
  * @returns True if user can access the feature, false otherwise
112
112
  *
113
- * @version 0.0.1
113
+ * @version 0.1.0
114
114
  * @since 0.0.1
115
115
  * @author AMBROISE PARK Consulting
116
116
  */
@@ -143,7 +143,7 @@ export declare function useCanAccessFeature(config: {
143
143
  * @param config - Feature access configuration
144
144
  * @returns Wrapped component with feature protection
145
145
  *
146
- * @version 0.0.1
146
+ * @version 0.1.0
147
147
  * @since 0.0.1
148
148
  * @author AMBROISE PARK Consulting
149
149
  */
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as a,Fragment as w}from"react/jsx-runtime";import{Stack as f}from"@donotdev/components";import{hasRoleAccess as h,hasTierAccess as m}from"@donotdev/core";import{useAuth as t}from"../useAuth";import{AuthFallback as F}from"./AuthFallback";function g({requiredTier:e,userTier:i}){return r("div",{className:"dndev-surface","data-variant":"default","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--border)",backgroundColor:"var(--muted)"},children:a(f,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--accent)"},children:"\u{1F512}"}),a("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--foreground)"},children:e==="pro"?"Pro Feature":"Premium Feature"}),a("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:["Upgrade to ",e," to access this feature",i&&` (current: ${i})`]})]})]})})}function p({requiredRole:e,userRole:i}){const o=Array.isArray(e)?e.join(" or "):e;return r("div",{className:"dndev-surface","data-variant":"destructive","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--destructive)",backgroundColor:"var(--muted)"},children:a(f,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--destructive)"},children:"\u{1F6AB}"}),a("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--destructive-foreground)"},children:"Access Denied"}),a("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:["This feature requires ",o," role",i&&` (current: ${i})`]})]})]})})}function b(){return r("div",{className:"dndev-surface","data-variant":"default","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--border)",backgroundColor:"var(--muted)"},children:a(f,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--accent)"},children:"\u23F0"}),a("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--foreground)"},children:"Subscription Required"}),r("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:"This feature requires an active subscription"})]})]})})}function y({children:e,role:i,tier:o,subscription:u,validate:n,fallback:s,message:l,showUpgradePrompt:A=!0,showLoginPrompt:S=!0}){const z=t("user"),R=t("loading"),q=t("userProfile"),v=t("userSubscription"),d=q?.role,c=v?.tier;return R?r("div",{style:{height:"2rem",borderRadius:"var(--radius)",backgroundColor:"var(--muted)",animation:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}):!z&&(i||o||u)?S?r(F,{message:l||"Please sign in to access this feature"}):null:i&&!(Array.isArray(i)?i:[i]).some(T=>h(d,T))?s?r(s,{requiredRole:i,userRole:d||void 0}):r(p,{requiredRole:i,userRole:d||void 0}):o&&!m(c,o)?s?r(s,{requiredTier:o,userTier:c||"free"}):A?r(g,{requiredTier:o,userTier:c||"free"}):null:u&&!v?.isActive?s?r(s,{requiresSubscription:!0,hasSubscription:v?.isActive||!1}):r(b,{}):n&&!n(d,c)?s?r(s,{userRole:d,userTier:c}):r(p,{userRole:d}):r(w,{children:e})}function P(e){const i=t("user"),o=t("userProfile"),u=t("userSubscription"),n=o?.role,s=u?.tier;return!(!i&&(e.role||e.tier||e.subscription)||e.role&&!(Array.isArray(e.role)?e.role:[e.role]).some(l=>h(n,l))||e.tier&&!m(s,e.tier)||e.subscription&&!u?.isActive||e.validate&&n&&s&&!e.validate(n,s))}function k(e,i){return o=>r(y,{...i,children:r(e,{...o})})}export{p as AccessDenied,y as FeatureGuard,b as SubscriptionExpired,g as UpgradePrompt,P as useCanAccessFeature,k as withFeatureGuard};
1
+ "use client";import{jsx as r,jsxs as n,Fragment as z}from"react/jsx-runtime";import{Stack as p}from"@donotdev/components";import{hasRoleAccess as g,hasTierAccess as b}from"@donotdev/core";import{useAuth as a}from"../useAuth";import{AuthFallback as D}from"./AuthFallback";function R({requiredTier:e,userTier:i}){return r("div",{className:"dndev-surface","data-variant":"default","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--border)",backgroundColor:"var(--muted)"},children:n(p,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--accent)"},children:"\u{1F512}"}),n("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--foreground)"},children:e==="pro"?"Pro Feature":"Premium Feature"}),n("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:["Upgrade to ",e," to access this feature",i&&` (current: ${i})`]})]})]})})}function v({requiredRole:e,userRole:i}){const s=Array.isArray(e)?e.join(" or "):e;return r("div",{className:"dndev-surface","data-variant":"destructive","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--destructive)",backgroundColor:"var(--muted)"},children:n(p,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--destructive)"},children:"\u{1F6AB}"}),n("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--destructive-foreground)"},children:"Access Denied"}),n("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:["This feature requires ",s," role",i&&` (current: ${i})`]})]})]})})}function y(){return r("div",{className:"dndev-surface","data-variant":"default","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--border)",backgroundColor:"var(--muted)"},children:n(p,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--accent)"},children:"\u23F0"}),n("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--foreground)"},children:"Subscription Required"}),r("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:"This feature requires an active subscription"})]})]})})}function T({children:e,role:i,tier:s,subscription:o,validate:u,fallback:t,message:h,showUpgradePrompt:m=!0,showLoginPrompt:l=!0}){const A=a("user"),S=a("loading"),q=a("userProfile"),f=a("userSubscription"),d=q?.role,c=f?.tier;return S?r("div",{style:{height:"2rem",borderRadius:"var(--radius)",backgroundColor:"var(--muted)",animation:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}):!A&&(i||s||o)?l?r(D,{message:h||"Please sign in to access this feature"}):null:i&&!(Array.isArray(i)?i:[i]).some(x=>g(d,x))?t?r(t,{requiredRole:i,userRole:d||void 0}):r(v,{requiredRole:i,userRole:d||void 0}):s&&!b(c,s)?t?r(t,{requiredTier:s,userTier:c||"free"}):m?r(R,{requiredTier:s,userTier:c||"free"}):null:o&&!f?.isActive?t?r(t,{requiresSubscription:!0,hasSubscription:f?.isActive||!1}):r(y,{}):u&&!u(d,c)?t?r(t,{userRole:d,userTier:c}):r(v,{userRole:d}):r(z,{children:e})}function F(e){const i=a("user"),s=a("userProfile"),o=a("userSubscription"),u=s?.role,t=o?.tier;return!(!i&&(e.role||e.tier||e.subscription)||e.role&&!(Array.isArray(e.role)?e.role:[e.role]).some(l=>g(u,l))||e.tier&&!b(t,e.tier)||e.subscription&&!o?.isActive||e.validate&&u&&t&&!e.validate(u,t))}function G(e,i){return o=>r(T,{...i,children:r(e,{...o})})}export{v as AccessDenied,T as FeatureGuard,y as SubscriptionExpired,R as UpgradePrompt,F as useCanAccessFeature,G as withFeatureGuard};
@@ -35,7 +35,7 @@ interface TierPlaceholderProps {
35
35
  * />
36
36
  * ```
37
37
  *
38
- * @version 0.0.1
38
+ * @version 0.1.0
39
39
  * @since 0.0.1
40
40
  * @author AMBROISE PARK Consulting
41
41
  */
@@ -43,7 +43,7 @@ export declare function FeaturePlaceholder({ featureId, featureName, className,
43
43
  /**
44
44
  * Placeholder for Pro tier features
45
45
  *
46
- * @version 0.0.1
46
+ * @version 0.1.0
47
47
  * @since 0.0.1
48
48
  * @author AMBROISE PARK Consulting
49
49
  */
@@ -51,7 +51,7 @@ export declare const ProFeaturePlaceholder: ({ featureName, className, children,
51
51
  /**
52
52
  * Placeholder for Premium tier features
53
53
  *
54
- * @version 0.0.1
54
+ * @version 0.1.0
55
55
  * @since 0.0.1
56
56
  * @author AMBROISE PARK Consulting
57
57
  */
@@ -1 +1 @@
1
- "use client";import{jsxs as o,jsx as s}from"react/jsx-runtime";import{cn as d}from"@donotdev/components";import{hasTierAccess as m}from"@donotdev/core";import{useAuth as i}from"../useAuth";function f({featureId:e,featureName:r,className:a="",children:t}){if(i("userSubscription")?.features?.includes(e))return null;const n=s("div",{className:d("dndev-surface",a),"data-variant":"muted","data-shadow":"none","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px dashed var(--border)",backgroundColor:"var(--muted)"},children:o("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)",textAlign:"center"},children:[r," is not available on your current plan."]})});return t||n}function u(e,r){return function({featureName:a,className:t="",children:n}){const l=i("userSubscription");if(m(l?.tier,e))return null;const c=s("div",{className:d("dndev-surface",t),"data-variant":"muted","data-shadow":"none","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px dashed var(--border)",backgroundColor:"var(--muted)"},children:o("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)",textAlign:"center"},children:[a," is only available on ",r," tier."]})});return n||c}}const p=u("pro","Pro"),v=u("premium","Premium");export{f as FeaturePlaceholder,v as PremiumFeaturePlaceholder,p as ProFeaturePlaceholder};
1
+ "use client";import{jsxs as d,jsx as c}from"react/jsx-runtime";import{cn as i}from"@donotdev/components";import{hasTierAccess as p}from"@donotdev/core";import{useAuth as u}from"../useAuth";function x({featureId:e,featureName:r,className:o="",children:a}){if(u("userSubscription")?.features?.includes(e)||!1)return null;const t=c("div",{className:i("dndev-surface",o),"data-variant":"muted","data-shadow":"none","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px dashed var(--border)",backgroundColor:"var(--muted)"},children:d("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)",textAlign:"center"},children:[r," is not available on your current plan."]})});return a||t}function l(e,r){return function({featureName:a,className:s="",children:n}){const t=u("userSubscription");if(p(t?.tier,e))return null;const m=c("div",{className:i("dndev-surface",s),"data-variant":"muted","data-shadow":"none","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px dashed var(--border)",backgroundColor:"var(--muted)"},children:d("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)",textAlign:"center"},children:[a," is only available on ",r," tier."]})});return n||m}}const P=l("pro","Pro"),A=l("premium","Premium");export{x as FeaturePlaceholder,A as PremiumFeaturePlaceholder,P as ProFeaturePlaceholder};
@@ -61,7 +61,7 @@ interface GoogleOneTapProps {
61
61
  *
62
62
  * @param props - Component configuration
63
63
  *
64
- * @version 0.0.1
64
+ * @version 0.1.0
65
65
  * @since 0.0.1
66
66
  * @author AMBROISE PARK Consulting
67
67
  */
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as S}from"react/jsx-runtime";import{Card as i,Spinner as w,Stack as I}from"@donotdev/components";import{useTranslation as N}from"@donotdev/core";import{useGoogleOneTap as T}from"../hooks/useGoogleOneTap";function z({clientId:s,onSuccess:l,onError:c,autoSelect:p=!0,cancelOnTapOutside:m=!0,className:g="",disabled:r=!1,promptParentId:h,allowedParentOrigins:a,cspNonce:u,clientOnly:n=!1,showErrorDetails:C=!1,loadingComponent:o,errorComponent:L,browserNotSupportedComponent:P}){const{t:v}=N("auth"),{shouldShow:f,isLoaded:j,isLoading:x,error:O,containerRef:y,fedcmSupported:d,isHydrated:t,browserInfo:E}=T({clientId:s,autoSelect:p,cancelOnTapOutside:m,promptParentId:h,disabled:r,onSuccess:l,onError:c,allowedParentOrigins:a,cspNonce:u,clientOnly:n});return r||!f||n&&!t?null:x?o?e("div",{className:"dndev-fixed",style:{right:"var(--gap-md)",zIndex:50,top:"calc(1rem + var(--header-height, 0px))"},children:e(i,{style:{padding:"var(--gap-md)"},children:e(o,{})})}):e("div",{className:"dndev-fixed",style:{right:"var(--gap-md)",zIndex:50,top:"calc(1rem + var(--header-height, 0px))"},children:e(i,{style:{padding:"var(--gap-md)"},children:S(I,{direction:"row",align:"center",children:[e(w,{}),e("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:v("googleOneTapLoading","Loading Google One Tap...")})]})})}):!d||O?null:e("div",{className:"dndev-fixed",style:{right:"var(--gap-md)",zIndex:50,top:"calc(1rem + var(--header-height, 0px))"},children:e("div",{ref:y,className:`google-one-tap-container ${g}`.trim(),"data-testid":"google-one-tap","data-fedcm-supported":d,"data-hydrated":t,...a&&{"data-allowed-parent-origins":a.join(",")}})})}var b=z;export{b as default};
1
+ "use client";import{jsx as e,jsxs as N}from"react/jsx-runtime";import{Card as i,Spinner as j,Stack as w}from"@donotdev/components";import{useTranslation as z}from"@donotdev/core";import{useGoogleOneTap as C}from"../hooks/useGoogleOneTap";function T({clientId:s,onSuccess:p,onError:l,autoSelect:m=!0,cancelOnTapOutside:c=!0,className:g="",disabled:o=!1,promptParentId:f,allowedParentOrigins:r,cspNonce:h,clientOnly:a=!1,showErrorDetails:I=!1,loadingComponent:t,errorComponent:G,browserNotSupportedComponent:L}){const{t:u}=z("auth"),{shouldShow:v,isLoaded:E,isLoading:x,error:y,containerRef:S,fedcmSupported:n,isHydrated:d,browserInfo:_}=C({clientId:s,autoSelect:m,cancelOnTapOutside:c,promptParentId:f,disabled:o,onSuccess:p,onError:l,allowedParentOrigins:r,cspNonce:h,clientOnly:a});return o||!v||a&&!d?null:x?t?e("div",{className:"dndev-fixed",style:{right:"var(--gap-md)",zIndex:50,top:"calc(1rem + var(--header-height, 0px))"},children:e(i,{style:{padding:"var(--gap-md)"},children:e(t,{})})}):e("div",{className:"dndev-fixed",style:{right:"var(--gap-md)",zIndex:50,top:"calc(1rem + var(--header-height, 0px))"},children:e(i,{style:{padding:"var(--gap-md)"},children:N(w,{direction:"row",align:"center",children:[e(j,{}),e("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:u("googleOneTapLoading","Loading Google One Tap...")})]})})}):!n||y?null:e("div",{className:"dndev-fixed",style:{right:"var(--gap-md)",zIndex:50,top:"calc(1rem + var(--header-height, 0px))"},children:e("div",{ref:S,className:`google-one-tap-container ${g}`.trim(),"data-testid":"google-one-tap","data-fedcm-supported":n,"data-hydrated":d,...r&&{"data-allowed-parent-origins":r.join(",")}})})}var H=T;export{H as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Dialog as a}from"@donotdev/components";import{useTranslation as e}from"@donotdev/core";import{withAuthFallback as s}from"./AuthFallback";import r from"./MultipleAuthProviders";function p({open:n,onOpenChange:i}){const{t:o}=e("auth");return t(a,{open:n,onOpenChange:i,title:o("signIn","Sign In"),description:o("choosePlatform","Choose a platform to sign in with"),children:t(r,{layout:"vertical",showLabels:!0,method:"popup"})})}const m=s(p,{message:"Authentication is not configured",showLoginButton:!0});var l=m;export{l as default};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{Dialog as e}from"@donotdev/components";import{useTranslation as r}from"@donotdev/core";import{withAuthFallback as s}from"./AuthFallback";import a from"./MultipleAuthProviders";function l({open:n,onOpenChange:i}){const{t:o}=r("auth");return t(e,{open:n,onOpenChange:i,title:o("signIn","Sign In"),description:o("choosePlatform","Choose a platform to sign in with"),children:t(a,{layout:"vertical",showLabels:!0,method:"popup"})})}const u=s(l,{message:"Authentication is not configured",showLoginButton:!0});var g=u;export{g as default};
@@ -32,7 +32,7 @@ export interface MultipleAuthProvidersProps {
32
32
  /**
33
33
  * Multiple auth providers component with automatic fallback handling
34
34
  *
35
- * @version 0.0.1
35
+ * @version 0.1.0
36
36
  * @since 0.0.1
37
37
  * @author AMBROISE PARK Consulting
38
38
  */
@@ -1 +1 @@
1
- "use client";import{jsx as a,jsxs as S}from"react/jsx-runtime";import{Suspense as $,lazy as k,useId as y}from"react";import{Alert as E,ALERT_VARIANT as P,Stack as c,Grid as T}from"@donotdev/components";import{useTranslation as j,getEnabledAuthPartners as C}from"@donotdev/core";import{useAuth as m}from"../useAuth";import{withAuthFallback as G}from"./AuthFallback";import M from"./AuthPartnerButton";import{getAuthMethod as O}from"../constants";import{useAccountLinking as q}from"../hooks/useAccountLinking";const B=k(()=>import("./AccountLinking")),F=({providers:h,containerClassName:e="",providerClassName:p="",method:g,size:_="md",layout:r="vertical",showLabels:f=!0,spacing:o="medium",ariaLabel:v,id:A,fullWidth:b=!0,onSuccess:N})=>{const{t:s}=j("auth"),w=y(),n=A||w,{isRequired:R}=q(),l=m("error"),x=m("isAvailable"),z=O(g),i=h||C();if(!i||i.length===0)return a("div",{className:e,children:a("p",{children:"No authentication providers are configured"})});const I=()=>{const d=i.map((t,L)=>a(M,{partnerId:t,method:z,className:`${p} ${b?"dndev-w-full":""}`,tabIndex:L===0?0:void 0,id:`${n}-${t}-button`,onSuccess:N,children:f?void 0:null},t));return r==="grid"?a(T,{cols:2,gap:o,className:e,children:d}):a(c,{direction:r==="horizontal"?"row":"column",wrap:r==="horizontal"?"wrap":void 0,gap:o,align:r==="horizontal"?"center":"stretch",className:e,children:d})};return S(c,{className:"dndev-mx-auto",id:n,role:"region","aria-label":v||s("aria.signInOptions","Sign in options"),children:[I(),l&&x&&a(E,{variant:P.ERROR,description:l.message||s("errorGeneric","Authentication failed. Please try again.")}),R&&a($,{fallback:null,children:a(B,{})})]})},u=G(F,{message:"Authentication providers are not configured",showLoginButton:!0});var V=u;export{u as MultipleAuthProviders,V as default};
1
+ "use client";import{jsx as e,jsxs as I}from"react/jsx-runtime";import{Suspense as N,lazy as j,useId as E}from"react";import{Alert as M,ALERT_VARIANT as S,Stack as l,Grid as $}from"@donotdev/components";import{useTranslation as T,getEnabledAuthPartners as _}from"@donotdev/core";import{useAuth as u}from"../useAuth";import{withAuthFallback as q}from"./AuthFallback";import B from"./AuthPartnerButton";import{getAuthMethod as G}from"../constants";import{useAccountLinking as O}from"../hooks/useAccountLinking";const F=j(()=>import("./AccountLinking")),V=({providers:h,containerClassName:t="",providerClassName:p="",method:f,size:y="md",layout:r="vertical",showLabels:g=!0,spacing:o="medium",ariaLabel:A,id:v,fullWidth:b=!0,onSuccess:x})=>{const{t:s}=T("auth"),P=E(),a=v||P,{isRequired:R}=O(),c=u("error"),k=u("isAvailable"),w=G(f),n=h||_();if(!n||n.length===0)return e("div",{className:t,children:e("p",{children:"No authentication providers are configured"})});const z=()=>{const d=n.map((i,L)=>e(B,{partnerId:i,method:w,className:`${p} ${b?"dndev-w-full":""}`,tabIndex:L===0?0:void 0,id:`${a}-${i}-button`,onSuccess:x,children:g?void 0:null},i));return r==="grid"?e($,{cols:2,gap:o,className:t,children:d}):e(l,{direction:r==="horizontal"?"row":"column",wrap:r==="horizontal"?"wrap":void 0,gap:o,align:r==="horizontal"?"center":"stretch",className:t,children:d})};return I(l,{className:"dndev-mx-auto",id:a,role:"region","aria-label":A||s("aria.signInOptions","Sign in options"),children:[z(),c&&k&&e(M,{variant:S.ERROR,description:c.message||s("errorGeneric","Authentication failed. Please try again.")}),R&&e(N,{fallback:null,children:e(F,{})})]})},m=q(V,{message:"Authentication providers are not configured",showLoginButton:!0});var Z=m;export{m as MultipleAuthProviders,Z as default};
@@ -3,7 +3,7 @@ import type { NetworkStatusIndicatorProps } from '../constants';
3
3
  * Component to show network status with reconnection guidance
4
4
  * Displays an alert when the user is offline or optionally when online
5
5
  *
6
- * @version 0.0.1
6
+ * @version 0.1.0
7
7
  * @since 0.0.1
8
8
  * @author AMBROISE PARK Consulting
9
9
  * @param {NetworkStatusIndicatorProps} props - Component props
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import{Alert as s,Button as l,BUTTON_VARIANT as u,Stack as c}from"@donotdev/components";import{useTranslation as f}from"@donotdev/core";import{useNetworkStatus as d}from"../hooks/useNetworkStatus";function w({showWhenOnline:a=!1,className:i=""}){const{t:e}=f("auth"),{online:n,connectionType:o,isSlowConnection:h}=d();return n&&!a?null:t(s,{variant:n?void 0:"error",className:i,role:"status","aria-live":n?"polite":"assertive",title:n?e("networkStatus.online",{defaultValue:"You are online"}):e("networkStatus.offline",{defaultValue:"You are offline"}),description:n?t("span",{children:e("networkStatus.connectedVia",{connectionType:o||"unknown",defaultValue:`Connected via ${o||"unknown"}`})}):r(c,{children:[t("p",{children:e("networkStatus.offlineMessage",{defaultValue:"Authentication requires an internet connection. Please check your network settings."})}),t(l,{variant:u.GHOST,onClick:()=>{typeof window<"u"&&window.location.reload()},style:{fontSize:"var(--font-size-sm)",textDecoration:"underline",fontWeight:500},children:e("networkStatus.checkAgain",{defaultValue:"Check again"})})]})})}var k=w;export{k as default};
1
+ "use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import{Alert as s,Button as l,BUTTON_VARIANT as u,Stack as c}from"@donotdev/components";import{useTranslation as f}from"@donotdev/core";import{useNetworkStatus as d}from"../hooks/useNetworkStatus";function k({showWhenOnline:i=!1,className:a=""}){const{t:e}=f("auth"),{online:n,connectionType:o,isSlowConnection:w}=d();return n&&!i?null:t(s,{variant:n?void 0:"error",className:a,role:"status","aria-live":n?"polite":"assertive",title:n?e("networkStatus.online",{defaultValue:"You are online"}):e("networkStatus.offline",{defaultValue:"You are offline"}),description:n?t("span",{children:e("networkStatus.connectedVia",{connectionType:o||"unknown",defaultValue:`Connected via ${o||"unknown"}`})}):r(c,{children:[t("p",{children:e("networkStatus.offlineMessage",{defaultValue:"Authentication requires an internet connection. Please check your network settings."})}),t(l,{variant:u.GHOST,onClick:()=>{typeof window<"u"&&window.location.reload()},style:{fontSize:"var(--font-size-sm)",textDecoration:"underline",fontWeight:500},children:e("networkStatus.checkAgain",{defaultValue:"Check again"})})]})})}var T=k;export{T as default};
@@ -16,7 +16,7 @@ export type PasswordStrength = 'weak' | 'fair' | 'good' | 'strong';
16
16
  * Uses Progress component for the strength bar and Text for labels.
17
17
  *
18
18
  * @component
19
- * @version 0.0.2
19
+ * @version 0.1.0
20
20
  */
21
21
  export declare function PasswordStrengthIndicator({ password, minLength, showRequirements, className, }: PasswordStrengthIndicatorProps): import("react/jsx-runtime").JSX.Element;
22
22
  //# sourceMappingURL=PasswordStrengthIndicator.d.ts.map
@@ -1 +1 @@
1
- "use client";import{jsxs as r,jsx as i}from"react/jsx-runtime";import{Check as w,Circle as v}from"lucide-react";import{useMemo as m}from"react";import{Progress as f,Stack as o,Text as l,cn as b}from"@donotdev/components";import{useTranslation as q}from"@donotdev/core";function k(e){if(!e)return"weak";let t=0;return e.length>=8&&(t+=1),e.length>=12&&(t+=1),/[a-z]/.test(e)&&(t+=1),/[A-Z]/.test(e)&&(t+=1),/[0-9]/.test(e)&&(t+=1),/[^a-zA-Z0-9]/.test(e)&&(t+=1),t<=2?"weak":t<=4?"fair":t<=5?"good":"strong"}function S(e,t,a){return[{label:a("passwordRequirement.length",`At least ${t} characters`),met:e.length>=t},{label:a("passwordRequirement.uppercase","One uppercase letter"),met:/[A-Z]/.test(e)},{label:a("passwordRequirement.lowercase","One lowercase letter"),met:/[a-z]/.test(e)},{label:a("passwordRequirement.number","One number"),met:/[0-9]/.test(e)},{label:a("passwordRequirement.special","One special character (!@#$%^&*)"),met:/[^a-zA-Z0-9]/.test(e)}]}const N={weak:25,fair:50,good:75,strong:100},g={weak:"destructive",fair:"warning",good:"accent",strong:"success"};function x({password:e,minLength:t=8,showRequirements:a=!0,className:p}){const{t:s}=q("auth"),d=m(()=>k(e),[e]),u=m(()=>S(e,t,(n,c)=>s(n,c||"")),[e,t,s]),h={weak:s("passwordStrength.weak","Weak"),fair:s("passwordStrength.fair","Fair"),good:s("passwordStrength.good","Good"),strong:s("passwordStrength.strong","Strong")};return r(o,{gap:"tight",className:b("dndev-password-strength",p),children:[r(o,{gap:"tight",children:[r(o,{direction:"row",align:"center",justify:"between",gap:"tight",children:[r(l,{as:"span",level:"caption",variant:"muted",children:[s("passwordStrength.label","Password strength"),":"]}),i(l,{as:"strong",level:"caption",variant:g[d],children:h[d]})]}),i(f,{value:N[d],variant:g[d],className:"dndev-password-strength-bar"})]}),a&&r(o,{gap:"tight",className:"dndev-password-requirements",children:[r(l,{as:"strong",level:"caption",variant:"muted",children:[s("passwordRequirements","Password requirements"),":"]}),i(o,{gap:"tight","data-inset":"true",children:u.map((n,c)=>r(o,{direction:"row",align:"center",gap:"tight",className:"dndev-password-requirement-item",children:[n.met?i(w,{className:"dndev-size-xs","data-variant":"success"}):i(v,{className:"dndev-size-xs","data-variant":"muted"}),i(l,{as:"span",level:"caption",variant:n.met?"success":"muted","data-opacity":n.met?void 0:"70",children:n.label})]},c))})]})]})}export{x as PasswordStrengthIndicator};
1
+ "use client";import{jsxs as n,jsx as s}from"react/jsx-runtime";import{Check as v,Circle as w}from"lucide-react";import{useMemo as g}from"react";import{Progress as b,Stack as i,Text as l,cn as k}from"@donotdev/components";import{useTranslation as S}from"@donotdev/core";function q(e){if(!e)return"weak";let t=0;return e.length>=8&&(t+=1),e.length>=12&&(t+=1),/[a-z]/.test(e)&&(t+=1),/[A-Z]/.test(e)&&(t+=1),/[0-9]/.test(e)&&(t+=1),/[^a-zA-Z0-9]/.test(e)&&(t+=1),t<=2?"weak":t<=4?"fair":t<=5?"good":"strong"}function x(e,t,a){return[{label:a("passwordRequirement.length",`At least ${t} characters`),met:e.length>=t},{label:a("passwordRequirement.uppercase","One uppercase letter"),met:/[A-Z]/.test(e)},{label:a("passwordRequirement.lowercase","One lowercase letter"),met:/[a-z]/.test(e)},{label:a("passwordRequirement.number","One number"),met:/[0-9]/.test(e)},{label:a("passwordRequirement.special","One special character (!@#$%^&*)"),met:/[^a-zA-Z0-9]/.test(e)}]}const P={weak:25,fair:50,good:75,strong:100},u={weak:"destructive",fair:"warning",good:"accent",strong:"success"};function O({password:e,minLength:t=8,showRequirements:a=!0,className:m}){const{t:r}=S("auth"),c=g(()=>q(e),[e]),h=g(()=>x(e,t,(d,f)=>r(d,f||"")),[e,t,r]),p={weak:r("passwordStrength.weak","Weak"),fair:r("passwordStrength.fair","Fair"),good:r("passwordStrength.good","Good"),strong:r("passwordStrength.strong","Strong")};return n(i,{gap:"tight",className:k("dndev-password-strength",m),children:[n(i,{gap:"tight",children:[n(i,{direction:"row",align:"center",justify:"between",gap:"tight",children:[n(l,{as:"span",level:"caption",variant:"muted",children:[r("passwordStrength.label","Password strength"),":"]}),s(l,{as:"strong",level:"caption",variant:u[c],children:p[c]})]}),s(b,{value:P[c],variant:u[c],className:"dndev-password-strength-bar"})]}),a&&n(i,{gap:"tight",className:"dndev-password-requirements",children:[n(l,{as:"strong",level:"caption",variant:"muted",children:[r("passwordRequirements","Password requirements"),":"]}),s(i,{gap:"tight","data-inset":"true",children:h.map((o,d)=>n(i,{direction:"row",align:"center",gap:"tight",className:"dndev-password-requirement-item",children:[o.met?s(v,{className:"dndev-size-xs","data-variant":"success"}):s(w,{className:"dndev-size-xs","data-variant":"muted"}),s(l,{as:"span",level:"caption",variant:o.met?"success":"muted","data-opacity":o.met?void 0:"70",children:o.label})]},d))})]})]})}export{O as PasswordStrengthIndicator};
@@ -11,7 +11,7 @@ interface PasswordUpdateDialogProps {
11
11
  * - Full i18n support
12
12
  * - Accessible with proper ARIA
13
13
  *
14
- * @version 0.0.2
14
+ * @version 0.1.0
15
15
  * @since 0.0.1
16
16
  * @author AMBROISE PARK Consulting
17
17
  */