@tomny-dev/uzi 0.12.0 → 0.13.0-pr.108.359.1.db8e67d
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/auth-form/AuthForm.d.ts +24 -0
- package/dist/components/auth-form/AuthForm.d.ts.map +1 -0
- package/dist/components/auth-form/AuthForm.test.d.ts +2 -0
- package/dist/components/auth-form/AuthForm.test.d.ts.map +1 -0
- package/dist/components/auth-pages/AuthPages.d.ts.map +1 -1
- package/dist/index.cjs +13 -9
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -10
- package/dist/index63.js +15 -21
- package/dist/index63.js.map +1 -1
- package/dist/index64.cjs +21 -30
- package/dist/index64.cjs.map +1 -1
- package/dist/index64.js +51 -44
- package/dist/index64.js.map +1 -1
- package/dist/index65.cjs +52 -43
- package/dist/index65.cjs.map +1 -1
- package/dist/index65.js +14 -50
- package/dist/index65.js.map +1 -1
- package/dist/index66.cjs +15 -69
- package/dist/index66.cjs.map +1 -1
- package/dist/index66.js +25 -414
- package/dist/index66.js.map +1 -1
- package/dist/index67.cjs +25 -416
- package/dist/index67.cjs.map +1 -1
- package/dist/index67.js +56 -58
- package/dist/index67.js.map +1 -1
- package/dist/index68.cjs +82 -85
- package/dist/index68.cjs.map +1 -1
- package/dist/index68.js +420 -226
- package/dist/index68.js.map +1 -1
- package/dist/index69.cjs +421 -225
- package/dist/index69.cjs.map +1 -1
- package/dist/index69.js +58 -42
- package/dist/index69.js.map +1 -1
- package/dist/index70.cjs +85 -61
- package/dist/index70.cjs.map +1 -1
- package/dist/index70.js +236 -76
- package/dist/index70.js.map +1 -1
- package/dist/index71.cjs +235 -75
- package/dist/index71.cjs.map +1 -1
- package/dist/index71.js +42 -20
- package/dist/index71.js.map +1 -1
- package/dist/index72.cjs +60 -27
- package/dist/index72.cjs.map +1 -1
- package/dist/index72.js +73 -88
- package/dist/index72.js.map +1 -1
- package/dist/index73.cjs +73 -90
- package/dist/index73.cjs.map +1 -1
- package/dist/index73.js +17 -15
- package/dist/index73.js.map +1 -1
- package/dist/index74.cjs +22 -19
- package/dist/index74.cjs.map +1 -1
- package/dist/index74.js +85 -143
- package/dist/index74.js.map +1 -1
- package/dist/index75.cjs +87 -143
- package/dist/index75.cjs.map +1 -1
- package/dist/index75.js +19 -91
- package/dist/index75.js.map +1 -1
- package/dist/index76.cjs +27 -135
- package/dist/index76.cjs.map +1 -1
- package/dist/index76.js +140 -673
- package/dist/index76.js.map +1 -1
- package/dist/index77.cjs +140 -673
- package/dist/index77.cjs.map +1 -1
- package/dist/index77.js +91 -31
- package/dist/index77.js.map +1 -1
- package/dist/index78.cjs +135 -45
- package/dist/index78.cjs.map +1 -1
- package/dist/index78.js +667 -206
- package/dist/index78.js.map +1 -1
- package/dist/index79.cjs +667 -204
- package/dist/index79.cjs.map +1 -1
- package/dist/index79.js +31 -15
- package/dist/index79.js.map +1 -1
- package/dist/index80.cjs +45 -21
- package/dist/index80.cjs.map +1 -1
- package/dist/index80.js +224 -29
- package/dist/index80.js.map +1 -1
- package/dist/index81.cjs +224 -30
- package/dist/index81.cjs.map +1 -1
- package/dist/index81.js +19 -0
- package/dist/index81.js.map +1 -0
- package/dist/index82.cjs +25 -0
- package/dist/index82.cjs.map +1 -0
- package/dist/index82.js +36 -0
- package/dist/index82.js.map +1 -0
- package/dist/index83.cjs +37 -0
- package/dist/index83.cjs.map +1 -0
- package/dist/style.css +13 -3
- package/package.json +1 -1
package/dist/index66.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index66.js","names":[],"sources":["../src/components/auth-pages/AuthPages.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./auth-pages.module.css\";\n\n// ── Eye icon (show/hide password) ──\nfunction EyeIcon({ open }: { open: boolean }) {\n if (open) {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\" className={styles.eyeIcon}>\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" stroke=\"currentColor\" strokeWidth=\"2\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" stroke=\"currentColor\" strokeWidth=\"2\" />\n </svg>\n );\n }\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\" className={styles.eyeIcon}>\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94\" stroke=\"currentColor\" strokeWidth=\"2\" />\n <path d=\"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19\" stroke=\"currentColor\" strokeWidth=\"2\" />\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\" stroke=\"currentColor\" strokeWidth=\"2\" />\n </svg>\n );\n}\n\n// ── Internal reusable field ──\ninterface FieldProps {\n label: string;\n id: string;\n children: React.ReactNode;\n error?: string;\n}\n\nfunction Field({ label, id, children, error }: FieldProps) {\n return (\n <div className={styles.field}>\n <label htmlFor={id} className={styles.label}>\n {label}\n </label>\n {children}\n {error && <span className={styles.error}>{error}</span>}\n </div>\n );\n}\n\n// ── Password input with visibility toggle ──\ninterface PasswordFieldProps {\n id: string;\n label?: string;\n placeholder?: string;\n value?: string;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n error?: string;\n}\n\nfunction PasswordField({ id, label, placeholder, value, onChange, error }: PasswordFieldProps) {\n const [show, setShow] = React.useState(false);\n const toggleRef = React.useRef<HTMLButtonElement>(null);\n\n return (\n <Field label={label ?? \"Password\"} id={id} error={error}>\n <div className={styles.passwordWrapper}>\n <input\n id={id}\n type={show ? \"text\" : \"password\"}\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n className={styles.input}\n />\n <button\n ref={toggleRef}\n type=\"button\"\n onClick={() => setShow((s) => !s)}\n className={styles.toggle}\n aria-label={show ? \"Hide password\" : \"Show password\"}\n >\n <EyeIcon open={show} />\n </button>\n </div>\n </Field>\n );\n}\n\n// ── Checkbox row ──\ninterface CheckboxRowProps {\n label?: string;\n linkText: string;\n linkHref?: string;\n}\n\ninterface CheckboxRowPropsExtended extends CheckboxRowProps {\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n}\n\nfunction CheckboxRow({ label, linkText, linkHref, checked, onChange }: CheckboxRowPropsExtended) {\n if (!label) return null;\n return (\n <div className={styles.checkboxRow}>\n <label className={styles.checkboxLabel}>\n <input\n type=\"checkbox\"\n className={styles.checkbox}\n checked={checked}\n onChange={(e) => onChange?.(e.target.checked)}\n />\n <span>{label}</span>\n </label>\n {linkHref && (\n <a href={linkHref} className={styles.forgotLink}>\n {linkText}\n </a>\n )}\n </div>\n );\n}\n\n// ── Shared props ──\ninterface BaseAuthPageProps {\n /** Page title */\n title: string;\n /** Page subtitle */\n subtitle?: string;\n /** Footer content (e.g., \"No account? Sign up\") */\n footer?: React.ReactNode;\n /** Called with form data on valid submit */\n onSubmit?: (data: Record<string, string | boolean>) => void;\n /** Loading state for the submit button */\n loading?: boolean;\n /** Optional brand/logo element */\n brand?: React.ReactNode;\n /** Extra class for the outer wrapper */\n className?: string;\n}\n\n// ── Sign In Page ──\nexport interface SignInPageProps extends BaseAuthPageProps {\n /** Email placeholder (default \"Email address\") */\n emailPlaceholder?: string;\n /** Password placeholder (default \"Password\") */\n passwordPlaceholder?: string;\n /** \"Remember me\" checkbox label */\n rememberLabel?: string;\n /** \"Forgot password\" link text */\n forgotLinkText?: string;\n /** \"Forgot password\" link href */\n forgotLinkHref?: string;\n}\n\nexport function SignInPage({\n title = \"Sign in\",\n subtitle,\n footer,\n onSubmit,\n loading = false,\n brand,\n className,\n emailPlaceholder = \"Email address\",\n passwordPlaceholder = \"Password\",\n rememberLabel = \"Remember me\",\n forgotLinkText = \"Forgot password?\",\n forgotLinkHref,\n}: SignInPageProps) {\n const id = React.useId();\n const [email, setEmail] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n const [rememberMe, setRememberMe] = React.useState(false);\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [submitted, setSubmitted] = React.useState(false);\n\n const validate = (): boolean => {\n const newErrors: Record<string, string> = {};\n if (!email.trim()) newErrors.email = \"Email is required\";\n else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) newErrors.email = \"Enter a valid email\";\n if (!password) newErrors.password = \"Password is required\";\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setSubmitted(true);\n if (!validate()) return;\n onSubmit?.({ email, password, rememberMe });\n };\n\n return (\n <div className={cx(styles.authLayout, className)}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n <form onSubmit={handleSubmit} className={styles.authForm}>\n <Field label={emailPlaceholder} id={id + \"-email\"} error={submitted ? errors.email : undefined}>\n <input\n id={id + \"-email\"}\n type=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n className={styles.input}\n autoComplete=\"email\"\n autoFocus\n />\n </Field>\n <PasswordField\n label={passwordPlaceholder}\n id={id + \"-password\"}\n placeholder={passwordPlaceholder}\n value={password}\n onChange={(e) => { setPassword(e.target.value); if (submitted) setSubmitted(false); }}\n error={submitted ? errors.password : undefined}\n />\n <CheckboxRow\n label={rememberLabel}\n linkText={forgotLinkText}\n linkHref={forgotLinkHref}\n checked={rememberMe}\n onChange={(c) => { setRememberMe(c); if (submitted) setSubmitted(false); }}\n />\n <button\n type=\"submit\"\n disabled={loading}\n className={styles.submitButton}\n >\n {loading ? (\n <>\n <span className={styles.spinner} />\n Signing in...\n </>\n ) : (\n \"Sign in\"\n )}\n </button>\n </form>\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n}\n\n// ── Sign Up Page ──\nexport interface SignUpPageProps extends BaseAuthPageProps {\n /** Email placeholder */\n emailPlaceholder?: string;\n /** Password placeholder */\n passwordPlaceholder?: string;\n /** Confirm password placeholder */\n confirmPasswordPlaceholder?: string;\n /** Checkbox label (e.g., \"I agree to the Terms of Service\") */\n checkboxLabel?: string;\n /** Checkbox href */\n checkboxLinkText?: string;\n /** Checkbox href */\n checkboxLinkHref?: string;\n}\n\nexport function SignUpPage({\n title = \"Create an account\",\n subtitle,\n footer,\n onSubmit,\n loading = false,\n brand,\n className,\n emailPlaceholder = \"Email address\",\n passwordPlaceholder = \"Password\",\n confirmPasswordPlaceholder = \"Confirm password\",\n checkboxLabel,\n checkboxLinkText,\n checkboxLinkHref,\n}: SignUpPageProps) {\n const id = React.useId();\n const [email, setEmail] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n const [confirmPassword, setConfirmPassword] = React.useState(\"\");\n const [agreed, setAgreed] = React.useState(false);\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [submitted, setSubmitted] = React.useState(false);\n\n const validate = (): boolean => {\n const newErrors: Record<string, string> = {};\n if (!email.trim()) newErrors.email = \"Email is required\";\n else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) newErrors.email = \"Enter a valid email\";\n if (!password) newErrors.password = \"Password is required\";\n else if (password.length < 8) newErrors.password = \"At least 8 characters\";\n if (password !== confirmPassword) newErrors.confirmPassword = \"Passwords do not match\";\n if (!agreed) newErrors.agreed = \"You must agree to continue\";\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setSubmitted(true);\n if (!validate()) return;\n onSubmit?.({ email, password, agreed });\n };\n\n return (\n <div className={cx(styles.authLayout, className)}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n <form onSubmit={handleSubmit} className={styles.authForm}>\n <Field label={emailPlaceholder} id={id + \"-email\"} error={submitted ? errors.email : undefined}>\n <input\n id={id + \"-email\"}\n type=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => { setEmail(e.target.value); if (submitted) setSubmitted(false); }}\n className={styles.input}\n autoComplete=\"email\"\n autoFocus\n />\n </Field>\n <PasswordField\n label={passwordPlaceholder}\n id={id + \"-password\"}\n placeholder={passwordPlaceholder}\n value={password}\n onChange={(e) => { setPassword(e.target.value); if (submitted) setSubmitted(false); }}\n error={submitted ? errors.password : undefined}\n />\n <PasswordField\n label={confirmPasswordPlaceholder}\n id={id + \"-confirm\"}\n placeholder={confirmPasswordPlaceholder}\n value={confirmPassword}\n onChange={(e) => { setConfirmPassword(e.target.value); if (submitted) setSubmitted(false); }}\n error={submitted ? errors.confirmPassword : undefined}\n />\n {checkboxLabel && (\n <div className={styles.checkboxRow}>\n <label className={styles.checkboxLabel}>\n <input\n id={id + \"-agreed\"}\n type=\"checkbox\"\n checked={agreed}\n onChange={(e) => { setAgreed(e.target.checked); if (submitted) setSubmitted(false); }}\n className={styles.checkbox}\n />\n <span>\n {checkboxLinkText ? (\n <>\n I agree to the{\" \"}\n <a href={checkboxLinkHref} className={styles.checkboxLink}>\n {checkboxLinkText}\n </a>\n </>\n ) : (\n checkboxLabel\n )}\n </span>\n </label>\n </div>\n )}\n {submitted && errors.agreed && <span className={styles.error}>{errors.agreed}</span>}\n <button\n type=\"submit\"\n disabled={loading}\n className={styles.submitButton}\n >\n {loading ? (\n <>\n <span className={styles.spinner} />\n Creating account...\n </>\n ) : (\n \"Create account\"\n )}\n </button>\n </form>\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n}\n\n// ── Forgot Password Page ──\nexport interface ForgotPasswordPageProps extends BaseAuthPageProps {\n /** Email placeholder */\n emailPlaceholder?: string;\n /** Button text */\n buttonText?: string;\n /** Back to sign in link text */\n backLinkText?: string;\n /** Back to sign in link href */\n backLinkHref?: string;\n}\n\nexport function ForgotPasswordPage({\n title = \"Reset password\",\n subtitle = \"Enter your email and we'll send a reset link\",\n footer,\n onSubmit,\n loading = false,\n brand,\n className,\n emailPlaceholder = \"Email address\",\n buttonText = \"Send reset link\",\n backLinkText = \"Back to sign in\",\n backLinkHref = \"/signin\",\n}: ForgotPasswordPageProps) {\n const id = React.useId();\n const [email, setEmail] = React.useState(\"\");\n const [error, setError] = React.useState(\"\");\n const [sent, setSent] = React.useState(false);\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n if (!email.trim()) { setError(\"Email is required\"); return; }\n if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) { setError(\"Enter a valid email\"); return; }\n onSubmit?.({ email });\n setSent(true);\n };\n\n return (\n <div className={cx(styles.authLayout, className)}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n {sent ? (\n <div className={styles.sentMessage}>\n <p className={styles.sentText}>\n If an account exists for <strong>{email}</strong>, you'll receive a reset link shortly.\n </p>\n <a href={backLinkHref} className={styles.backLink}>\n {backLinkText}\n </a>\n </div>\n ) : (\n <form onSubmit={handleSubmit} className={styles.authForm}>\n <Field label={emailPlaceholder} id={id + \"-email\"} error={error}>\n <input\n id={id + \"-email\"}\n type=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => { setEmail(e.target.value); setError(\"\"); }}\n className={styles.input}\n autoComplete=\"email\"\n autoFocus\n />\n </Field>\n <button\n type=\"submit\"\n disabled={loading}\n className={styles.submitButton}\n >\n {loading ? (\n <>\n <span className={styles.spinner} />\n Sending...\n </>\n ) : (\n buttonText\n )}\n </button>\n </form>\n )}\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAKA,SAAS,QAAQ,EAAE,QAA2B;CAC5C,IAAI,MACF,OACE,qBAAC,OAAD;EAAK,SAAQ;EAAY,MAAK;EAAO,eAAY;EAAO,WAAW,0BAAO;YAA1E,CACE,oBAAC,QAAD;GAAM,GAAE;GAA+C,QAAO;GAAe,aAAY;EAAK,CAAA,GAC9F,oBAAC,UAAD;GAAQ,IAAG;GAAK,IAAG;GAAK,GAAE;GAAI,QAAO;GAAe,aAAY;EAAK,CAAA,CAClE;;CAGT,OACE,qBAAC,OAAD;EAAK,SAAQ;EAAY,MAAK;EAAO,eAAY;EAAO,WAAW,0BAAO;YAA1E;GACE,oBAAC,QAAD;IAAM,GAAE;IAAkF,QAAO;IAAe,aAAY;GAAK,CAAA;GACjI,oBAAC,QAAD;IAAM,GAAE;IAAyE,QAAO;IAAe,aAAY;GAAK,CAAA;GACxH,oBAAC,QAAD;IAAM,IAAG;IAAI,IAAG;IAAI,IAAG;IAAK,IAAG;IAAK,QAAO;IAAe,aAAY;GAAK,CAAA;EACxE;;AAET;AAUA,SAAS,MAAM,EAAE,OAAO,IAAI,UAAU,SAAqB;CACzD,OACE,qBAAC,OAAD;EAAK,WAAW,0BAAO;YAAvB;GACE,oBAAC,SAAD;IAAO,SAAS;IAAI,WAAW,0BAAO;cACnC;GACI,CAAA;GACN;GACA,SAAS,oBAAC,QAAD;IAAM,WAAW,0BAAO;cAAQ;GAAY,CAAA;EACnD;;AAET;AAYA,SAAS,cAAc,EAAE,IAAI,OAAO,aAAa,OAAO,UAAU,SAA6B;CAC7F,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,KAAK;CAC5C,MAAM,YAAY,MAAM,OAA0B,IAAI;CAEtD,OACE,oBAAC,OAAD;EAAO,OAAO,S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OAAO,KAAK;QAAG,SAAS,EAAE;OAAG;OAC3D,WAAW,0BAAO;OAClB,cAAa;OACb,WAAA;MACD,CAAA;KACI,CAAA,GACP,oBAAC,UAAD;MACE,MAAK;MACL,UAAU;MACV,WAAW,0BAAO;gBAEjB,UACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD,EAAM,WAAW,0BAAO,QAAU,CAAA,GAAC,YAEnC,EAAA,CAAA,IAEF;KAEI,CAAA,CACJ;;IAEP,UACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD,EAAI,WAAW,0BAAO,QAAU,CAAA,GAChC,oBAAC,KAAD;KAAG,WAAW,0BAAO;eAAa;IAAU,CAAA,CAC5C,EAAA,CAAA;GAED;;CACF,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"index66.js","names":[],"sources":["../src/components/auth-card/AuthCard.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./auth-card.module.css\";\n\nexport interface AuthCardProps {\n /** Title displayed at the top of the card. */\n title: React.ReactNode;\n /** Subtitle displayed below the title. */\n subtitle?: React.ReactNode;\n /** Primary form content rendered in the card body. */\n children: React.ReactNode;\n /** Footer links rendered below the divider (e.g., \"No account? Sign up\"). */\n footer?: React.ReactNode;\n /** Optional brand/logo element rendered above the title. */\n brand?: React.ReactNode;\n /** Additional class name for the outer wrapper. */\n className?: string;\n}\n\n/**\n * AuthCard — a centered card layout for auth pages.\n *\n * - Centered vertically and horizontally on screen\n * - Brand → title → subtitle → form → divider → footer\n * - No auth logic — just the visual template\n */\nexport const AuthCard = React.forwardRef<HTMLDivElement, AuthCardProps>(\n ({ title, subtitle, children, footer, brand, className }, ref) => {\n return (\n <div className={cx(styles.authLayout, className)} ref={ref}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n <div className={styles.authBody}>{children}</div>\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n },\n);\n\nAuthCard.displayName = \"AuthCard\";\n"],"mappings":";;;;;;;;;;;;AA0BA,IAAa,WAAW,MAAM,YAC3B,EAAE,OAAO,UAAU,UAAU,QAAQ,OAAO,aAAa,QAAQ;CAChE,OACE,oBAAC,OAAD;EAAK,WAAW,GAAG,yBAAO,YAAY,SAAS;EAAQ;YACrD,qBAAC,OAAD;GAAK,WAAW,yBAAO;aAAvB;IACG,SAAS,oBAAC,OAAD;KAAK,WAAW,yBAAO;eAAY;IAAW,CAAA;IACxD,qBAAC,OAAD;KAAK,WAAW,yBAAO;eAAvB,CACE,oBAAC,MAAD;MAAI,WAAW,yBAAO;gBAAY;KAAU,CAAA,GAC3C,YAAY,oBAAC,KAAD;MAAG,WAAW,yBAAO;gBAAe;KAAY,CAAA,CAC1D;;IACL,oBAAC,OAAD;KAAK,WAAW,yBAAO;KAAW;IAAc,CAAA;IAC/C,UACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD,EAAI,WAAW,yBAAO,QAAU,CAAA,GAChC,oBAAC,KAAD;KAAG,WAAW,yBAAO;eAAa;IAAU,CAAA,CAC5C,EAAA,CAAA;GAED;;CACF,CAAA;AAET,CACF;AAEA,SAAS,cAAc"}
|
package/dist/index67.cjs
CHANGED
|
@@ -1,443 +1,52 @@
|
|
|
1
1
|
const require_runtime = require("./index2.cjs");
|
|
2
2
|
const require_cx = require("./index4.cjs");
|
|
3
|
-
const
|
|
3
|
+
const require_auth_card_module = require("./index66.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
react = require_runtime.__toESM(react, 1);
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
-
//#region src/components/auth-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
stroke: "currentColor",
|
|
17
|
-
strokeWidth: "2"
|
|
18
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
19
|
-
cx: "12",
|
|
20
|
-
cy: "12",
|
|
21
|
-
r: "3",
|
|
22
|
-
stroke: "currentColor",
|
|
23
|
-
strokeWidth: "2"
|
|
24
|
-
})]
|
|
25
|
-
});
|
|
26
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
27
|
-
viewBox: "0 0 24 24",
|
|
28
|
-
fill: "none",
|
|
29
|
-
"aria-hidden": "true",
|
|
30
|
-
className: require_auth_pages_module.default.eyeIcon,
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
33
|
-
d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94",
|
|
34
|
-
stroke: "currentColor",
|
|
35
|
-
strokeWidth: "2"
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
38
|
-
d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19",
|
|
39
|
-
stroke: "currentColor",
|
|
40
|
-
strokeWidth: "2"
|
|
41
|
-
}),
|
|
42
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
|
|
43
|
-
x1: "1",
|
|
44
|
-
y1: "1",
|
|
45
|
-
x2: "23",
|
|
46
|
-
y2: "23",
|
|
47
|
-
stroke: "currentColor",
|
|
48
|
-
strokeWidth: "2"
|
|
49
|
-
})
|
|
50
|
-
]
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function Field({ label, id, children, error }) {
|
|
54
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
55
|
-
className: require_auth_pages_module.default.field,
|
|
56
|
-
children: [
|
|
57
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
58
|
-
htmlFor: id,
|
|
59
|
-
className: require_auth_pages_module.default.label,
|
|
60
|
-
children: label
|
|
61
|
-
}),
|
|
62
|
-
children,
|
|
63
|
-
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
64
|
-
className: require_auth_pages_module.default.error,
|
|
65
|
-
children: error
|
|
66
|
-
})
|
|
67
|
-
]
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function PasswordField({ id, label, placeholder, value, onChange, error }) {
|
|
71
|
-
const [show, setShow] = react.useState(false);
|
|
72
|
-
const toggleRef = react.useRef(null);
|
|
73
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
74
|
-
label: label ?? "Password",
|
|
75
|
-
id,
|
|
76
|
-
error,
|
|
77
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
78
|
-
className: require_auth_pages_module.default.passwordWrapper,
|
|
79
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
80
|
-
id,
|
|
81
|
-
type: show ? "text" : "password",
|
|
82
|
-
placeholder,
|
|
83
|
-
value,
|
|
84
|
-
onChange,
|
|
85
|
-
className: require_auth_pages_module.default.input
|
|
86
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
87
|
-
ref: toggleRef,
|
|
88
|
-
type: "button",
|
|
89
|
-
onClick: () => setShow((s) => !s),
|
|
90
|
-
className: require_auth_pages_module.default.toggle,
|
|
91
|
-
"aria-label": show ? "Hide password" : "Show password",
|
|
92
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EyeIcon, { open: show })
|
|
93
|
-
})]
|
|
94
|
-
})
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function CheckboxRow({ label, linkText, linkHref, checked, onChange }) {
|
|
98
|
-
if (!label) return null;
|
|
99
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
100
|
-
className: require_auth_pages_module.default.checkboxRow,
|
|
101
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
102
|
-
className: require_auth_pages_module.default.checkboxLabel,
|
|
103
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
104
|
-
type: "checkbox",
|
|
105
|
-
className: require_auth_pages_module.default.checkbox,
|
|
106
|
-
checked,
|
|
107
|
-
onChange: (e) => onChange?.(e.target.checked)
|
|
108
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label })]
|
|
109
|
-
}), linkHref && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
110
|
-
href: linkHref,
|
|
111
|
-
className: require_auth_pages_module.default.forgotLink,
|
|
112
|
-
children: linkText
|
|
113
|
-
})]
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
function SignInPage({ title = "Sign in", subtitle, footer, onSubmit, loading = false, brand, className, emailPlaceholder = "Email address", passwordPlaceholder = "Password", rememberLabel = "Remember me", forgotLinkText = "Forgot password?", forgotLinkHref }) {
|
|
117
|
-
const id = react.useId();
|
|
118
|
-
const [email, setEmail] = react.useState("");
|
|
119
|
-
const [password, setPassword] = react.useState("");
|
|
120
|
-
const [rememberMe, setRememberMe] = react.useState(false);
|
|
121
|
-
const [errors, setErrors] = react.useState({});
|
|
122
|
-
const [submitted, setSubmitted] = react.useState(false);
|
|
123
|
-
const validate = () => {
|
|
124
|
-
const newErrors = {};
|
|
125
|
-
if (!email.trim()) newErrors.email = "Email is required";
|
|
126
|
-
else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) newErrors.email = "Enter a valid email";
|
|
127
|
-
if (!password) newErrors.password = "Password is required";
|
|
128
|
-
setErrors(newErrors);
|
|
129
|
-
return Object.keys(newErrors).length === 0;
|
|
130
|
-
};
|
|
131
|
-
const handleSubmit = (e) => {
|
|
132
|
-
e.preventDefault();
|
|
133
|
-
setSubmitted(true);
|
|
134
|
-
if (!validate()) return;
|
|
135
|
-
onSubmit?.({
|
|
136
|
-
email,
|
|
137
|
-
password,
|
|
138
|
-
rememberMe
|
|
139
|
-
});
|
|
140
|
-
};
|
|
7
|
+
//#region src/components/auth-card/AuthCard.tsx
|
|
8
|
+
/**
|
|
9
|
+
* AuthCard — a centered card layout for auth pages.
|
|
10
|
+
*
|
|
11
|
+
* - Centered vertically and horizontally on screen
|
|
12
|
+
* - Brand → title → subtitle → form → divider → footer
|
|
13
|
+
* - No auth logic — just the visual template
|
|
14
|
+
*/
|
|
15
|
+
var AuthCard = react.forwardRef(({ title, subtitle, children, footer, brand, className }, ref) => {
|
|
141
16
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
142
|
-
className: require_cx.cx(
|
|
17
|
+
className: require_cx.cx(require_auth_card_module.default.authLayout, className),
|
|
18
|
+
ref,
|
|
143
19
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
144
|
-
className:
|
|
20
|
+
className: require_auth_card_module.default.authCard,
|
|
145
21
|
children: [
|
|
146
22
|
brand && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
147
|
-
className:
|
|
23
|
+
className: require_auth_card_module.default.authBrand,
|
|
148
24
|
children: brand
|
|
149
25
|
}),
|
|
150
26
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
151
|
-
className:
|
|
27
|
+
className: require_auth_card_module.default.authHeader,
|
|
152
28
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
153
|
-
className:
|
|
29
|
+
className: require_auth_card_module.default.authTitle,
|
|
154
30
|
children: title
|
|
155
31
|
}), subtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
156
|
-
className:
|
|
32
|
+
className: require_auth_card_module.default.authSubtitle,
|
|
157
33
|
children: subtitle
|
|
158
34
|
})]
|
|
159
35
|
}),
|
|
160
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
children: [
|
|
164
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
165
|
-
label: emailPlaceholder,
|
|
166
|
-
id: id + "-email",
|
|
167
|
-
error: submitted ? errors.email : void 0,
|
|
168
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
169
|
-
id: id + "-email",
|
|
170
|
-
type: "email",
|
|
171
|
-
placeholder: "you@example.com",
|
|
172
|
-
value: email,
|
|
173
|
-
onChange: (e) => setEmail(e.target.value),
|
|
174
|
-
className: require_auth_pages_module.default.input,
|
|
175
|
-
autoComplete: "email",
|
|
176
|
-
autoFocus: true
|
|
177
|
-
})
|
|
178
|
-
}),
|
|
179
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PasswordField, {
|
|
180
|
-
label: passwordPlaceholder,
|
|
181
|
-
id: id + "-password",
|
|
182
|
-
placeholder: passwordPlaceholder,
|
|
183
|
-
value: password,
|
|
184
|
-
onChange: (e) => {
|
|
185
|
-
setPassword(e.target.value);
|
|
186
|
-
if (submitted) setSubmitted(false);
|
|
187
|
-
},
|
|
188
|
-
error: submitted ? errors.password : void 0
|
|
189
|
-
}),
|
|
190
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckboxRow, {
|
|
191
|
-
label: rememberLabel,
|
|
192
|
-
linkText: forgotLinkText,
|
|
193
|
-
linkHref: forgotLinkHref,
|
|
194
|
-
checked: rememberMe,
|
|
195
|
-
onChange: (c) => {
|
|
196
|
-
setRememberMe(c);
|
|
197
|
-
if (submitted) setSubmitted(false);
|
|
198
|
-
}
|
|
199
|
-
}),
|
|
200
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
201
|
-
type: "submit",
|
|
202
|
-
disabled: loading,
|
|
203
|
-
className: require_auth_pages_module.default.submitButton,
|
|
204
|
-
children: loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_auth_pages_module.default.spinner }), "Signing in..."] }) : "Sign in"
|
|
205
|
-
})
|
|
206
|
-
]
|
|
207
|
-
}),
|
|
208
|
-
footer && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", { className: require_auth_pages_module.default.divider }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
209
|
-
className: require_auth_pages_module.default.authFooter,
|
|
210
|
-
children: footer
|
|
211
|
-
})] })
|
|
212
|
-
]
|
|
213
|
-
})
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
function SignUpPage({ title = "Create an account", subtitle, footer, onSubmit, loading = false, brand, className, emailPlaceholder = "Email address", passwordPlaceholder = "Password", confirmPasswordPlaceholder = "Confirm password", checkboxLabel, checkboxLinkText, checkboxLinkHref }) {
|
|
217
|
-
const id = react.useId();
|
|
218
|
-
const [email, setEmail] = react.useState("");
|
|
219
|
-
const [password, setPassword] = react.useState("");
|
|
220
|
-
const [confirmPassword, setConfirmPassword] = react.useState("");
|
|
221
|
-
const [agreed, setAgreed] = react.useState(false);
|
|
222
|
-
const [errors, setErrors] = react.useState({});
|
|
223
|
-
const [submitted, setSubmitted] = react.useState(false);
|
|
224
|
-
const validate = () => {
|
|
225
|
-
const newErrors = {};
|
|
226
|
-
if (!email.trim()) newErrors.email = "Email is required";
|
|
227
|
-
else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) newErrors.email = "Enter a valid email";
|
|
228
|
-
if (!password) newErrors.password = "Password is required";
|
|
229
|
-
else if (password.length < 8) newErrors.password = "At least 8 characters";
|
|
230
|
-
if (password !== confirmPassword) newErrors.confirmPassword = "Passwords do not match";
|
|
231
|
-
if (!agreed) newErrors.agreed = "You must agree to continue";
|
|
232
|
-
setErrors(newErrors);
|
|
233
|
-
return Object.keys(newErrors).length === 0;
|
|
234
|
-
};
|
|
235
|
-
const handleSubmit = (e) => {
|
|
236
|
-
e.preventDefault();
|
|
237
|
-
setSubmitted(true);
|
|
238
|
-
if (!validate()) return;
|
|
239
|
-
onSubmit?.({
|
|
240
|
-
email,
|
|
241
|
-
password,
|
|
242
|
-
agreed
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
246
|
-
className: require_cx.cx(require_auth_pages_module.default.authLayout, className),
|
|
247
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
248
|
-
className: require_auth_pages_module.default.authCard,
|
|
249
|
-
children: [
|
|
250
|
-
brand && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
251
|
-
className: require_auth_pages_module.default.authBrand,
|
|
252
|
-
children: brand
|
|
253
|
-
}),
|
|
254
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
255
|
-
className: require_auth_pages_module.default.authHeader,
|
|
256
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
257
|
-
className: require_auth_pages_module.default.authTitle,
|
|
258
|
-
children: title
|
|
259
|
-
}), subtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
260
|
-
className: require_auth_pages_module.default.authSubtitle,
|
|
261
|
-
children: subtitle
|
|
262
|
-
})]
|
|
263
|
-
}),
|
|
264
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
265
|
-
onSubmit: handleSubmit,
|
|
266
|
-
className: require_auth_pages_module.default.authForm,
|
|
267
|
-
children: [
|
|
268
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
269
|
-
label: emailPlaceholder,
|
|
270
|
-
id: id + "-email",
|
|
271
|
-
error: submitted ? errors.email : void 0,
|
|
272
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
273
|
-
id: id + "-email",
|
|
274
|
-
type: "email",
|
|
275
|
-
placeholder: "you@example.com",
|
|
276
|
-
value: email,
|
|
277
|
-
onChange: (e) => {
|
|
278
|
-
setEmail(e.target.value);
|
|
279
|
-
if (submitted) setSubmitted(false);
|
|
280
|
-
},
|
|
281
|
-
className: require_auth_pages_module.default.input,
|
|
282
|
-
autoComplete: "email",
|
|
283
|
-
autoFocus: true
|
|
284
|
-
})
|
|
285
|
-
}),
|
|
286
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PasswordField, {
|
|
287
|
-
label: passwordPlaceholder,
|
|
288
|
-
id: id + "-password",
|
|
289
|
-
placeholder: passwordPlaceholder,
|
|
290
|
-
value: password,
|
|
291
|
-
onChange: (e) => {
|
|
292
|
-
setPassword(e.target.value);
|
|
293
|
-
if (submitted) setSubmitted(false);
|
|
294
|
-
},
|
|
295
|
-
error: submitted ? errors.password : void 0
|
|
296
|
-
}),
|
|
297
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PasswordField, {
|
|
298
|
-
label: confirmPasswordPlaceholder,
|
|
299
|
-
id: id + "-confirm",
|
|
300
|
-
placeholder: confirmPasswordPlaceholder,
|
|
301
|
-
value: confirmPassword,
|
|
302
|
-
onChange: (e) => {
|
|
303
|
-
setConfirmPassword(e.target.value);
|
|
304
|
-
if (submitted) setSubmitted(false);
|
|
305
|
-
},
|
|
306
|
-
error: submitted ? errors.confirmPassword : void 0
|
|
307
|
-
}),
|
|
308
|
-
checkboxLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
309
|
-
className: require_auth_pages_module.default.checkboxRow,
|
|
310
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
311
|
-
className: require_auth_pages_module.default.checkboxLabel,
|
|
312
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
313
|
-
id: id + "-agreed",
|
|
314
|
-
type: "checkbox",
|
|
315
|
-
checked: agreed,
|
|
316
|
-
onChange: (e) => {
|
|
317
|
-
setAgreed(e.target.checked);
|
|
318
|
-
if (submitted) setSubmitted(false);
|
|
319
|
-
},
|
|
320
|
-
className: require_auth_pages_module.default.checkbox
|
|
321
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: checkboxLinkText ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
322
|
-
"I agree to the",
|
|
323
|
-
" ",
|
|
324
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
325
|
-
href: checkboxLinkHref,
|
|
326
|
-
className: require_auth_pages_module.default.checkboxLink,
|
|
327
|
-
children: checkboxLinkText
|
|
328
|
-
})
|
|
329
|
-
] }) : checkboxLabel })]
|
|
330
|
-
})
|
|
331
|
-
}),
|
|
332
|
-
submitted && errors.agreed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
333
|
-
className: require_auth_pages_module.default.error,
|
|
334
|
-
children: errors.agreed
|
|
335
|
-
}),
|
|
336
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
337
|
-
type: "submit",
|
|
338
|
-
disabled: loading,
|
|
339
|
-
className: require_auth_pages_module.default.submitButton,
|
|
340
|
-
children: loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_auth_pages_module.default.spinner }), "Creating account..."] }) : "Create account"
|
|
341
|
-
})
|
|
342
|
-
]
|
|
343
|
-
}),
|
|
344
|
-
footer && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", { className: require_auth_pages_module.default.divider }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
345
|
-
className: require_auth_pages_module.default.authFooter,
|
|
346
|
-
children: footer
|
|
347
|
-
})] })
|
|
348
|
-
]
|
|
349
|
-
})
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
function ForgotPasswordPage({ title = "Reset password", subtitle = "Enter your email and we'll send a reset link", footer, onSubmit, loading = false, brand, className, emailPlaceholder = "Email address", buttonText = "Send reset link", backLinkText = "Back to sign in", backLinkHref = "/signin" }) {
|
|
353
|
-
const id = react.useId();
|
|
354
|
-
const [email, setEmail] = react.useState("");
|
|
355
|
-
const [error, setError] = react.useState("");
|
|
356
|
-
const [sent, setSent] = react.useState(false);
|
|
357
|
-
const handleSubmit = (e) => {
|
|
358
|
-
e.preventDefault();
|
|
359
|
-
if (!email.trim()) {
|
|
360
|
-
setError("Email is required");
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
|
364
|
-
setError("Enter a valid email");
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
onSubmit?.({ email });
|
|
368
|
-
setSent(true);
|
|
369
|
-
};
|
|
370
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
371
|
-
className: require_cx.cx(require_auth_pages_module.default.authLayout, className),
|
|
372
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
373
|
-
className: require_auth_pages_module.default.authCard,
|
|
374
|
-
children: [
|
|
375
|
-
brand && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
376
|
-
className: require_auth_pages_module.default.authBrand,
|
|
377
|
-
children: brand
|
|
378
|
-
}),
|
|
379
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
380
|
-
className: require_auth_pages_module.default.authHeader,
|
|
381
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
382
|
-
className: require_auth_pages_module.default.authTitle,
|
|
383
|
-
children: title
|
|
384
|
-
}), subtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
385
|
-
className: require_auth_pages_module.default.authSubtitle,
|
|
386
|
-
children: subtitle
|
|
387
|
-
})]
|
|
388
|
-
}),
|
|
389
|
-
sent ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
390
|
-
className: require_auth_pages_module.default.sentMessage,
|
|
391
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
392
|
-
className: require_auth_pages_module.default.sentText,
|
|
393
|
-
children: [
|
|
394
|
-
"If an account exists for ",
|
|
395
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: email }),
|
|
396
|
-
", you'll receive a reset link shortly."
|
|
397
|
-
]
|
|
398
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
399
|
-
href: backLinkHref,
|
|
400
|
-
className: require_auth_pages_module.default.backLink,
|
|
401
|
-
children: backLinkText
|
|
402
|
-
})]
|
|
403
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
404
|
-
onSubmit: handleSubmit,
|
|
405
|
-
className: require_auth_pages_module.default.authForm,
|
|
406
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
407
|
-
label: emailPlaceholder,
|
|
408
|
-
id: id + "-email",
|
|
409
|
-
error,
|
|
410
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
411
|
-
id: id + "-email",
|
|
412
|
-
type: "email",
|
|
413
|
-
placeholder: "you@example.com",
|
|
414
|
-
value: email,
|
|
415
|
-
onChange: (e) => {
|
|
416
|
-
setEmail(e.target.value);
|
|
417
|
-
setError("");
|
|
418
|
-
},
|
|
419
|
-
className: require_auth_pages_module.default.input,
|
|
420
|
-
autoComplete: "email",
|
|
421
|
-
autoFocus: true
|
|
422
|
-
})
|
|
423
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
424
|
-
type: "submit",
|
|
425
|
-
disabled: loading,
|
|
426
|
-
className: require_auth_pages_module.default.submitButton,
|
|
427
|
-
children: loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_auth_pages_module.default.spinner }), "Sending..."] }) : buttonText
|
|
428
|
-
})]
|
|
36
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
37
|
+
className: require_auth_card_module.default.authBody,
|
|
38
|
+
children
|
|
429
39
|
}),
|
|
430
|
-
footer && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", { className:
|
|
431
|
-
className:
|
|
40
|
+
footer && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", { className: require_auth_card_module.default.divider }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
41
|
+
className: require_auth_card_module.default.authFooter,
|
|
432
42
|
children: footer
|
|
433
43
|
})] })
|
|
434
44
|
]
|
|
435
45
|
})
|
|
436
46
|
});
|
|
437
|
-
}
|
|
47
|
+
});
|
|
48
|
+
AuthCard.displayName = "AuthCard";
|
|
438
49
|
//#endregion
|
|
439
|
-
exports.
|
|
440
|
-
exports.SignInPage = SignInPage;
|
|
441
|
-
exports.SignUpPage = SignUpPage;
|
|
50
|
+
exports.AuthCard = AuthCard;
|
|
442
51
|
|
|
443
52
|
//# sourceMappingURL=index67.cjs.map
|
package/dist/index67.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index67.cjs","names":[],"sources":["../src/components/auth-pages/AuthPages.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./auth-pages.module.css\";\n\n// ── Eye icon (show/hide password) ──\nfunction EyeIcon({ open }: { open: boolean }) {\n if (open) {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\" className={styles.eyeIcon}>\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" stroke=\"currentColor\" strokeWidth=\"2\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" stroke=\"currentColor\" strokeWidth=\"2\" />\n </svg>\n );\n }\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\" className={styles.eyeIcon}>\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94\" stroke=\"currentColor\" strokeWidth=\"2\" />\n <path d=\"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19\" stroke=\"currentColor\" strokeWidth=\"2\" />\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\" stroke=\"currentColor\" strokeWidth=\"2\" />\n </svg>\n );\n}\n\n// ── Internal reusable field ──\ninterface FieldProps {\n label: string;\n id: string;\n children: React.ReactNode;\n error?: string;\n}\n\nfunction Field({ label, id, children, error }: FieldProps) {\n return (\n <div className={styles.field}>\n <label htmlFor={id} className={styles.label}>\n {label}\n </label>\n {children}\n {error && <span className={styles.error}>{error}</span>}\n </div>\n );\n}\n\n// ── Password input with visibility toggle ──\ninterface PasswordFieldProps {\n id: string;\n label?: string;\n placeholder?: string;\n value?: string;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n error?: string;\n}\n\nfunction PasswordField({ id, label, placeholder, value, onChange, error }: PasswordFieldProps) {\n const [show, setShow] = React.useState(false);\n const toggleRef = React.useRef<HTMLButtonElement>(null);\n\n return (\n <Field label={label ?? \"Password\"} id={id} error={error}>\n <div className={styles.passwordWrapper}>\n <input\n id={id}\n type={show ? \"text\" : \"password\"}\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n className={styles.input}\n />\n <button\n ref={toggleRef}\n type=\"button\"\n onClick={() => setShow((s) => !s)}\n className={styles.toggle}\n aria-label={show ? \"Hide password\" : \"Show password\"}\n >\n <EyeIcon open={show} />\n </button>\n </div>\n </Field>\n );\n}\n\n// ── Checkbox row ──\ninterface CheckboxRowProps {\n label?: string;\n linkText: string;\n linkHref?: string;\n}\n\ninterface CheckboxRowPropsExtended extends CheckboxRowProps {\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n}\n\nfunction CheckboxRow({ label, linkText, linkHref, checked, onChange }: CheckboxRowPropsExtended) {\n if (!label) return null;\n return (\n <div className={styles.checkboxRow}>\n <label className={styles.checkboxLabel}>\n <input\n type=\"checkbox\"\n className={styles.checkbox}\n checked={checked}\n onChange={(e) => onChange?.(e.target.checked)}\n />\n <span>{label}</span>\n </label>\n {linkHref && (\n <a href={linkHref} className={styles.forgotLink}>\n {linkText}\n </a>\n )}\n </div>\n );\n}\n\n// ── Shared props ──\ninterface BaseAuthPageProps {\n /** Page title */\n title: string;\n /** Page subtitle */\n subtitle?: string;\n /** Footer content (e.g., \"No account? Sign up\") */\n footer?: React.ReactNode;\n /** Called with form data on valid submit */\n onSubmit?: (data: Record<string, string | boolean>) => void;\n /** Loading state for the submit button */\n loading?: boolean;\n /** Optional brand/logo element */\n brand?: React.ReactNode;\n /** Extra class for the outer wrapper */\n className?: string;\n}\n\n// ── Sign In Page ──\nexport interface SignInPageProps extends BaseAuthPageProps {\n /** Email placeholder (default \"Email address\") */\n emailPlaceholder?: string;\n /** Password placeholder (default \"Password\") */\n passwordPlaceholder?: string;\n /** \"Remember me\" checkbox label */\n rememberLabel?: string;\n /** \"Forgot password\" link text */\n forgotLinkText?: string;\n /** \"Forgot password\" link href */\n forgotLinkHref?: string;\n}\n\nexport function SignInPage({\n title = \"Sign in\",\n subtitle,\n footer,\n onSubmit,\n loading = false,\n brand,\n className,\n emailPlaceholder = \"Email address\",\n passwordPlaceholder = \"Password\",\n rememberLabel = \"Remember me\",\n forgotLinkText = \"Forgot password?\",\n forgotLinkHref,\n}: SignInPageProps) {\n const id = React.useId();\n const [email, setEmail] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n const [rememberMe, setRememberMe] = React.useState(false);\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [submitted, setSubmitted] = React.useState(false);\n\n const validate = (): boolean => {\n const newErrors: Record<string, string> = {};\n if (!email.trim()) newErrors.email = \"Email is required\";\n else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) newErrors.email = \"Enter a valid email\";\n if (!password) newErrors.password = \"Password is required\";\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setSubmitted(true);\n if (!validate()) return;\n onSubmit?.({ email, password, rememberMe });\n };\n\n return (\n <div className={cx(styles.authLayout, className)}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n <form onSubmit={handleSubmit} className={styles.authForm}>\n <Field label={emailPlaceholder} id={id + \"-email\"} error={submitted ? errors.email : undefined}>\n <input\n id={id + \"-email\"}\n type=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n className={styles.input}\n autoComplete=\"email\"\n autoFocus\n />\n </Field>\n <PasswordField\n label={passwordPlaceholder}\n id={id + \"-password\"}\n placeholder={passwordPlaceholder}\n value={password}\n onChange={(e) => { setPassword(e.target.value); if (submitted) setSubmitted(false); }}\n error={submitted ? errors.password : undefined}\n />\n <CheckboxRow\n label={rememberLabel}\n linkText={forgotLinkText}\n linkHref={forgotLinkHref}\n checked={rememberMe}\n onChange={(c) => { setRememberMe(c); if (submitted) setSubmitted(false); }}\n />\n <button\n type=\"submit\"\n disabled={loading}\n className={styles.submitButton}\n >\n {loading ? (\n <>\n <span className={styles.spinner} />\n Signing in...\n </>\n ) : (\n \"Sign in\"\n )}\n </button>\n </form>\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n}\n\n// ── Sign Up Page ──\nexport interface SignUpPageProps extends BaseAuthPageProps {\n /** Email placeholder */\n emailPlaceholder?: string;\n /** Password placeholder */\n passwordPlaceholder?: string;\n /** Confirm password placeholder */\n confirmPasswordPlaceholder?: string;\n /** Checkbox label (e.g., \"I agree to the Terms of Service\") */\n checkboxLabel?: string;\n /** Checkbox href */\n checkboxLinkText?: string;\n /** Checkbox href */\n checkboxLinkHref?: string;\n}\n\nexport function SignUpPage({\n title = \"Create an account\",\n subtitle,\n footer,\n onSubmit,\n loading = false,\n brand,\n className,\n emailPlaceholder = \"Email address\",\n passwordPlaceholder = \"Password\",\n confirmPasswordPlaceholder = \"Confirm password\",\n checkboxLabel,\n checkboxLinkText,\n checkboxLinkHref,\n}: SignUpPageProps) {\n const id = React.useId();\n const [email, setEmail] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n const [confirmPassword, setConfirmPassword] = React.useState(\"\");\n const [agreed, setAgreed] = React.useState(false);\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [submitted, setSubmitted] = React.useState(false);\n\n const validate = (): boolean => {\n const newErrors: Record<string, string> = {};\n if (!email.trim()) newErrors.email = \"Email is required\";\n else if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) newErrors.email = \"Enter a valid email\";\n if (!password) newErrors.password = \"Password is required\";\n else if (password.length < 8) newErrors.password = \"At least 8 characters\";\n if (password !== confirmPassword) newErrors.confirmPassword = \"Passwords do not match\";\n if (!agreed) newErrors.agreed = \"You must agree to continue\";\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setSubmitted(true);\n if (!validate()) return;\n onSubmit?.({ email, password, agreed });\n };\n\n return (\n <div className={cx(styles.authLayout, className)}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n <form onSubmit={handleSubmit} className={styles.authForm}>\n <Field label={emailPlaceholder} id={id + \"-email\"} error={submitted ? errors.email : undefined}>\n <input\n id={id + \"-email\"}\n type=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => { setEmail(e.target.value); if (submitted) setSubmitted(false); }}\n className={styles.input}\n autoComplete=\"email\"\n autoFocus\n />\n </Field>\n <PasswordField\n label={passwordPlaceholder}\n id={id + \"-password\"}\n placeholder={passwordPlaceholder}\n value={password}\n onChange={(e) => { setPassword(e.target.value); if (submitted) setSubmitted(false); }}\n error={submitted ? errors.password : undefined}\n />\n <PasswordField\n label={confirmPasswordPlaceholder}\n id={id + \"-confirm\"}\n placeholder={confirmPasswordPlaceholder}\n value={confirmPassword}\n onChange={(e) => { setConfirmPassword(e.target.value); if (submitted) setSubmitted(false); }}\n error={submitted ? errors.confirmPassword : undefined}\n />\n {checkboxLabel && (\n <div className={styles.checkboxRow}>\n <label className={styles.checkboxLabel}>\n <input\n id={id + \"-agreed\"}\n type=\"checkbox\"\n checked={agreed}\n onChange={(e) => { setAgreed(e.target.checked); if (submitted) setSubmitted(false); }}\n className={styles.checkbox}\n />\n <span>\n {checkboxLinkText ? (\n <>\n I agree to the{\" \"}\n <a href={checkboxLinkHref} className={styles.checkboxLink}>\n {checkboxLinkText}\n </a>\n </>\n ) : (\n checkboxLabel\n )}\n </span>\n </label>\n </div>\n )}\n {submitted && errors.agreed && <span className={styles.error}>{errors.agreed}</span>}\n <button\n type=\"submit\"\n disabled={loading}\n className={styles.submitButton}\n >\n {loading ? (\n <>\n <span className={styles.spinner} />\n Creating account...\n </>\n ) : (\n \"Create account\"\n )}\n </button>\n </form>\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n}\n\n// ── Forgot Password Page ──\nexport interface ForgotPasswordPageProps extends BaseAuthPageProps {\n /** Email placeholder */\n emailPlaceholder?: string;\n /** Button text */\n buttonText?: string;\n /** Back to sign in link text */\n backLinkText?: string;\n /** Back to sign in link href */\n backLinkHref?: string;\n}\n\nexport function ForgotPasswordPage({\n title = \"Reset password\",\n subtitle = \"Enter your email and we'll send a reset link\",\n footer,\n onSubmit,\n loading = false,\n brand,\n className,\n emailPlaceholder = \"Email address\",\n buttonText = \"Send reset link\",\n backLinkText = \"Back to sign in\",\n backLinkHref = \"/signin\",\n}: ForgotPasswordPageProps) {\n const id = React.useId();\n const [email, setEmail] = React.useState(\"\");\n const [error, setError] = React.useState(\"\");\n const [sent, setSent] = React.useState(false);\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n if (!email.trim()) { setError(\"Email is required\"); return; }\n if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) { setError(\"Enter a valid email\"); return; }\n onSubmit?.({ email });\n setSent(true);\n };\n\n return (\n <div className={cx(styles.authLayout, className)}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n {sent ? (\n <div className={styles.sentMessage}>\n <p className={styles.sentText}>\n If an account exists for <strong>{email}</strong>, you'll receive a reset link shortly.\n </p>\n <a href={backLinkHref} className={styles.backLink}>\n {backLinkText}\n </a>\n </div>\n ) : (\n <form onSubmit={handleSubmit} className={styles.authForm}>\n <Field label={emailPlaceholder} id={id + \"-email\"} error={error}>\n <input\n id={id + \"-email\"}\n type=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => { setEmail(e.target.value); setError(\"\"); }}\n className={styles.input}\n autoComplete=\"email\"\n autoFocus\n />\n </Field>\n <button\n type=\"submit\"\n disabled={loading}\n className={styles.submitButton}\n >\n {loading ? (\n <>\n <span className={styles.spinner} />\n Sending...\n </>\n ) : (\n buttonText\n )}\n </button>\n </form>\n )}\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAKA,SAAS,QAAQ,EAAE,QAA2B;CAC5C,IAAI,MACF,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,SAAQ;EAAY,MAAK;EAAO,eAAY;EAAO,WAAW,0BAAA,QAAO;YAA1E,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,GAAE;GAA+C,QAAO;GAAe,aAAY;EAAK,CAAA,GAC9F,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GAAQ,IAAG;GAAK,IAAG;GAAK,GAAE;GAAI,QAAO;GAAe,aAAY;EAAK,CAAA,CAClE;;CAGT,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,SAAQ;EAAY,MAAK;EAAO,eAAY;EAAO,WAAW,0BAAA,QAAO;YAA1E;GACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,GAAE;IAAkF,QAAO;IAAe,aAAY;GAAK,CAAA;GACjI,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,GAAE;IAAyE,QAAO;IAAe,aAAY;GAAK,CAAA;GACxH,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,IAAG;IAAI,IAAG;IAAI,IAAG;IAAK,IAAG;IAAK,QAAO;IAAe,aAAY;GAAK,CAAA;EACxE;;AAET;AAUA,SAAS,MAAM,EAAE,OAAO,IAAI,UAAU,SAAqB;CACzD,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,W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;KACI,CAAA,GACP,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;MACE,MAAK;MACL,UAAU;MACV,WAAW,0BAAA,QAAO;gBAEjB,UACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,WAAW,0BAAA,QAAO,QAAU,CAAA,GAAC,YAEnC,EAAA,CAAA,IAEF;KAEI,CAAA,CACJ;;IAEP,UACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD,EAAI,WAAW,0BAAA,QAAO,QAAU,CAAA,GAChC,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KAAG,WAAW,0BAAA,QAAO;eAAa;IAAU,CAAA,CAC5C,EAAA,CAAA;GAED;;CACF,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"index67.cjs","names":[],"sources":["../src/components/auth-card/AuthCard.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./auth-card.module.css\";\n\nexport interface AuthCardProps {\n /** Title displayed at the top of the card. */\n title: React.ReactNode;\n /** Subtitle displayed below the title. */\n subtitle?: React.ReactNode;\n /** Primary form content rendered in the card body. */\n children: React.ReactNode;\n /** Footer links rendered below the divider (e.g., \"No account? Sign up\"). */\n footer?: React.ReactNode;\n /** Optional brand/logo element rendered above the title. */\n brand?: React.ReactNode;\n /** Additional class name for the outer wrapper. */\n className?: string;\n}\n\n/**\n * AuthCard — a centered card layout for auth pages.\n *\n * - Centered vertically and horizontally on screen\n * - Brand → title → subtitle → form → divider → footer\n * - No auth logic — just the visual template\n */\nexport const AuthCard = React.forwardRef<HTMLDivElement, AuthCardProps>(\n ({ title, subtitle, children, footer, brand, className }, ref) => {\n return (\n <div className={cx(styles.authLayout, className)} ref={ref}>\n <div className={styles.authCard}>\n {brand && <div className={styles.authBrand}>{brand}</div>}\n <div className={styles.authHeader}>\n <h1 className={styles.authTitle}>{title}</h1>\n {subtitle && <p className={styles.authSubtitle}>{subtitle}</p>}\n </div>\n <div className={styles.authBody}>{children}</div>\n {footer && (\n <>\n <hr className={styles.divider} />\n <p className={styles.authFooter}>{footer}</p>\n </>\n )}\n </div>\n </div>\n );\n },\n);\n\nAuthCard.displayName = \"AuthCard\";\n"],"mappings":";;;;;;;;;;;;;;AA0BA,IAAa,WAAW,MAAM,YAC3B,EAAE,OAAO,UAAU,UAAU,QAAQ,OAAO,aAAa,QAAQ;CAChE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAW,WAAA,GAAG,yBAAA,QAAO,YAAY,SAAS;EAAQ;YACrD,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,WAAW,yBAAA,QAAO;aAAvB;IACG,SAAS,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;KAAK,WAAW,yBAAA,QAAO;eAAY;IAAW,CAAA;IACxD,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;KAAK,WAAW,yBAAA,QAAO;eAAvB,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;MAAI,WAAW,yBAAA,QAAO;gBAAY;KAAU,CAAA,GAC3C,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;MAAG,WAAW,yBAAA,QAAO;gBAAe;KAAY,CAAA,CAC1D;;IACL,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;KAAK,WAAW,yBAAA,QAAO;KAAW;IAAc,CAAA;IAC/C,UACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD,EAAI,WAAW,yBAAA,QAAO,QAAU,CAAA,GAChC,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;KAAG,WAAW,yBAAA,QAAO;eAAa;IAAU,CAAA,CAC5C,EAAA,CAAA;GAED;;CACF,CAAA;AAET,CACF;AAEA,SAAS,cAAc"}
|