@donotdev/auth 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DeleteAccountDialogs.d.ts.map +1 -1
- package/dist/components/DeleteAccountDialogs.js +1 -1
- package/dist/components/EmailLinkForm.d.ts.map +1 -1
- package/dist/components/EmailLinkForm.js +1 -1
- package/dist/components/EmailVerification.d.ts.map +1 -1
- package/dist/components/EmailVerification.js +1 -1
- package/dist/components/LoginModal.d.ts.map +1 -1
- package/dist/components/LoginModal.js +1 -1
- package/dist/components/MultipleAuthProviders.d.ts.map +1 -1
- package/dist/components/MultipleAuthProviders.js +1 -1
- package/dist/components/PasswordStrengthIndicator.d.ts.map +1 -1
- package/dist/components/PasswordStrengthIndicator.js +1 -1
- package/dist/components/PasswordUpdateDialog.d.ts +7 -3
- package/dist/components/PasswordUpdateDialog.d.ts.map +1 -1
- package/dist/components/PasswordUpdateDialog.js +1 -1
- package/dist/hooks/useDeleteAccount.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/useAuth.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteAccountDialogs.d.ts","sourceRoot":"","sources":["../../src/components/DeleteAccountDialogs.tsx"],"names":[],"mappings":"AA+BA;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,IAAI,EAAE,OAAO,CAAC;IAEd,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAC;IAEnB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,gCAAgC;IAChC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C,qBAAqB;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"DeleteAccountDialogs.d.ts","sourceRoot":"","sources":["../../src/components/DeleteAccountDialogs.tsx"],"names":[],"mappings":"AA+BA;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,IAAI,EAAE,OAAO,CAAC;IAEd,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAC;IAEnB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,gCAAgC;IAChC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C,qBAAqB;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE,iBAAiB,2CA8DnB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC,6BAA6B;IAC7B,IAAI,EAAE,OAAO,CAAC;IAEd,sCAAsC;IACtC,SAAS,EAAE,OAAO,CAAC;IAEnB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,+BAA+B;IAC/B,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/B,qBAAqB;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,GACT,EAAE,wBAAwB,2CAqG1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailLinkForm.d.ts","sourceRoot":"","sources":["../../src/components/EmailLinkForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmailLinkForm.d.ts","sourceRoot":"","sources":["../../src/components/EmailLinkForm.tsx"],"names":[],"mappings":"AA4BA,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,kBAAkB,CAAC,EAAE;QACnB,GAAG,EAAE,MAAM,CAAC;QACZ,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;CACH;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAc,EACd,SAAS,EACT,OAAO,EACP,kBAAkB,GACnB,EAAE,kBAAkB,2CA0FpB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailVerification.d.ts","sourceRoot":"","sources":["../../src/components/EmailVerification.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmailVerification.d.ts","sourceRoot":"","sources":["../../src/components/EmailVerification.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC;;;;;;;;;;GAUG;AACH,iBAAS,iBAAiB,CAAC,EACzB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,YAAY,EACZ,EAAE,GACH,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA8F7C;AAKD,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as o}from"react/jsx-runtime";import{Card as h,Button as v,BUTTON_VARIANT as y,Alert as I,Spinner as A,Stack as d}from"@donotdev/components";import{useTranslation as
|
|
1
|
+
"use client";import{jsx as r,jsxs as o}from"react/jsx-runtime";import{Card as h,Button as v,BUTTON_VARIANT as y,Alert as I,Spinner as A,Stack as d,Text as b}from"@donotdev/components";import{useTranslation as x,handleError as M}from"@donotdev/core";import{useAuth as a}from"../useAuth";import{useId as T}from"react";function j({verifyButtonText:E,successMessage:S,sendingMessage:w,alreadyVerifiedMessage:k,notSignedInMessage:B,errorMessage:R,id:c}){const{t:i}=x("auth"),n=a("user"),e=a("emailVerification"),u=a("sendEmailVerification"),s=n?.id,l=T(),t=c||`email-verification-${l}`,f=`${t}-heading`,m=`${t}-button`,g=async()=>{if(!(!n||!s))try{await u()}catch(V){M(V)}};if(!n||!s)return null;const p=()=>{if(e.status!=="pending"&&e.status==="error")return"error"};return r(h,{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(b,{level:"small",variant:"muted",children:i("emailVerification.status.unknown")}),r(v,{id:m,onClick:g,disabled:e.status==="pending","aria-busy":e.status==="pending",variant:y.PRIMARY,icon:e.status==="pending"?r(A,{"aria-label":"Loading"}):void 0,iconEnd:!1,children:e.status==="pending"?i("status.verifying"):i("buttons.verify","Verify")})]}),e.status!=="verified"&&r(I,{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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginModal.d.ts","sourceRoot":"","sources":["../../src/components/LoginModal.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"LoginModal.d.ts","sourceRoot":"","sources":["../../src/components/LoginModal.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAqCpD,QAAA,MAAM,UAAU,qEAGd,CAAC;AAGH,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultipleAuthProviders.d.ts","sourceRoot":"","sources":["../../src/components/MultipleAuthProviders.tsx"],"names":[],"mappings":"AAeA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ9D;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,iEAAiE;IACjE,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,0CAA0C;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yCAAyC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mGAAmG;IACnG,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC3B,yBAAyB;IACzB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,qCAAqC;IACrC,MAAM,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;IAC5C,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAChD,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"MultipleAuthProviders.d.ts","sourceRoot":"","sources":["../../src/components/MultipleAuthProviders.tsx"],"names":[],"mappings":"AAeA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ9D;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,iEAAiE;IACjE,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,0CAA0C;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yCAAyC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mGAAmG;IACnG,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC3B,yBAAyB;IACzB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,qCAAqC;IACrC,MAAM,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;IAC5C,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAChD,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAmID;;;;;;GAMG;AACH,QAAA,MAAM,qBAAqB,gFAGzB,CAAC;AAGH,eAAe,qBAAqB,CAAC;AAGrC,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordStrengthIndicator.d.ts","sourceRoot":"","sources":["../../src/components/PasswordStrengthIndicator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PasswordStrengthIndicator.d.ts","sourceRoot":"","sources":["../../src/components/PasswordStrengthIndicator.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,8BAA8B;IAC7C,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAwFnE;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,EACR,SAAa,EACb,gBAAuB,EACvB,SAAS,GACV,EAAE,8BAA8B,2CAgFhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as
|
|
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};
|
|
@@ -4,10 +4,14 @@ interface PasswordUpdateDialogProps {
|
|
|
4
4
|
/**
|
|
5
5
|
* Password Update Dialog Component
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Best-in-class password update with:
|
|
8
|
+
* - react-hook-form validation
|
|
9
|
+
* - PasswordInput with eye toggle (no confirm field needed)
|
|
10
|
+
* - Password strength indicator
|
|
11
|
+
* - Full i18n support
|
|
12
|
+
* - Accessible with proper ARIA
|
|
9
13
|
*
|
|
10
|
-
* @version 0.0.
|
|
14
|
+
* @version 0.0.2
|
|
11
15
|
* @since 0.0.1
|
|
12
16
|
* @author AMBROISE PARK Consulting
|
|
13
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordUpdateDialog.d.ts","sourceRoot":"","sources":["../../src/components/PasswordUpdateDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PasswordUpdateDialog.d.ts","sourceRoot":"","sources":["../../src/components/PasswordUpdateDialog.tsx"],"names":[],"mappings":"AAkCA,UAAU,yBAAyB;IACjC,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD;AAED;;;;;;;;;;;;;GAaG;AACH,iBAAS,oBAAoB,CAAC,EAAE,cAAc,EAAE,EAAE,yBAAyB,2CA4I1E;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e,jsxs as i,Fragment as P}from"react/jsx-runtime";import{useState as C}from"react";import{useForm as S,Controller as T,useWatch as E}from"react-hook-form";import{Alert as N,ALERT_VARIANT as x,Button as d,BUTTON_VARIANT as u,Dialog as A,PasswordInput as I,Stack as g,Text as L}from"@donotdev/components";import{useTranslation as O}from"@donotdev/core";import{PasswordStrengthIndicator as R}from"./PasswordStrengthIndicator";function U({updatePassword:m}){const{t:r}=O("profile"),[f,n]=C(!1),{control:l,handleSubmit:h,formState:{errors:s,isSubmitting:o},setError:y,reset:p}=S({mode:"onChange",defaultValues:{password:""}}),c=E({control:l,name:"password"}),b=async a=>{try{await m(a.password),n(!1),p()}catch(t){const v=t instanceof Error?t.message:String(t);y("root",{message:v||r("profile.security.password.dialog.error","Failed to update password")})}},w=a=>{n(a),a||p()};return e(A,{open:f,onOpenChange:w,trigger:e(d,{variant:u.OUTLINE,children:r("profile.security.password.change","Change Password")}),title:r("profile.security.password.dialog.title","Change Password"),description:r("profile.security.password.dialog.description","Enter your new password below"),footer:i(P,{children:[e(d,{variant:u.OUTLINE,onClick:()=>w(!1),disabled:o,children:r("profile.security.password.dialog.cancel","Cancel")}),e(d,{onClick:h(b),disabled:o||!c,children:o?r("profile.security.password.dialog.updating","Updating..."):r("profile.security.password.dialog.update","Update Password")})]}),children:i(g,{children:[s.root&&e(N,{variant:x.ERROR,description:s.root.message}),e(T,{name:"password",control:l,rules:{required:r("profile.security.password.dialog.required","Password is required"),minLength:{value:8,message:r("profile.security.password.dialog.minLength","Password must be at least 8 characters")}},render:({field:a})=>i(g,{gap:"tight",children:[e(I,{...a,label:r("profile.security.password.dialog.newPassword","New Password"),placeholder:r("profile.security.password.dialog.placeholder","Enter new password"),disabled:o,"aria-invalid":!!s.password,"aria-describedby":s.password?"password-update-error":void 0,className:"dndev-w-full","data-variant":s.password?"destructive":void 0}),s.password&&e(L,{as:"span",level:"caption",variant:"destructive",id:"password-update-error",role:"alert",children:s.password.message})]})}),e(R,{password:c||"",minLength:8})]})})}var q=U;export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeleteAccount.d.ts","sourceRoot":"","sources":["../../src/hooks/useDeleteAccount.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDeleteAccount.d.ts","sourceRoot":"","sources":["../../src/hooks/useDeleteAccount.tsx"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,iBAAiB,EAAE,OAAO,CAAC;IAE3B,8CAA8C;IAC9C,UAAU,EAAE,OAAO,CAAC;IAEpB,2DAA2D;IAC3D,kBAAkB,EAAE,OAAO,CAAC;IAE5B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,0DAA0D;IAC1D,eAAe,EAAE,MAAM,IAAI,CAAC;IAE5B,uFAAuF;IACvF,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD,4CAA4C;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAwDrD"}
|