@tomny-dev/uzi 0.14.0 → 0.15.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.
- package/dist/components/filter-workspace/FilterWorkspace.d.ts +40 -0
- package/dist/components/filter-workspace/FilterWorkspace.d.ts.map +1 -0
- package/dist/components/filter-workspace/FilterWorkspace.test.d.ts +2 -0
- package/dist/components/filter-workspace/FilterWorkspace.test.d.ts.map +1 -0
- package/dist/index.cjs +18 -14
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -15
- package/dist/index57.js +21 -10
- package/dist/index57.js.map +1 -1
- package/dist/index58.cjs +30 -11
- package/dist/index58.cjs.map +1 -1
- package/dist/index58.js +101 -14
- package/dist/index58.js.map +1 -1
- package/dist/index59.cjs +104 -13
- package/dist/index59.cjs.map +1 -1
- package/dist/index59.js +10 -11
- package/dist/index59.js.map +1 -1
- package/dist/index60.cjs +11 -13
- package/dist/index60.cjs.map +1 -1
- package/dist/index60.js +13 -16
- package/dist/index60.js.map +1 -1
- package/dist/index61.cjs +13 -16
- package/dist/index61.cjs.map +1 -1
- package/dist/index61.js +10 -8
- package/dist/index61.js.map +1 -1
- package/dist/index62.cjs +11 -10
- package/dist/index62.cjs.map +1 -1
- package/dist/index62.js +15 -87
- package/dist/index62.js.map +1 -1
- package/dist/index63.cjs +15 -89
- package/dist/index63.cjs.map +1 -1
- package/dist/index63.js +9 -23
- package/dist/index63.js.map +1 -1
- package/dist/index64.cjs +12 -33
- package/dist/index64.cjs.map +1 -1
- package/dist/index64.js +89 -43
- package/dist/index64.js.map +1 -1
- package/dist/index65.cjs +88 -42
- package/dist/index65.cjs.map +1 -1
- package/dist/index65.js +23 -15
- package/dist/index65.js.map +1 -1
- package/dist/index66.cjs +33 -21
- package/dist/index66.cjs.map +1 -1
- package/dist/index66.js +44 -51
- package/dist/index66.js.map +1 -1
- package/dist/index67.cjs +43 -52
- package/dist/index67.cjs.map +1 -1
- package/dist/index67.js +14 -14
- package/dist/index67.js.map +1 -1
- package/dist/index68.cjs +19 -19
- package/dist/index68.cjs.map +1 -1
- package/dist/index68.js +49 -290
- package/dist/index68.js.map +1 -1
- package/dist/index69.cjs +51 -290
- package/dist/index69.cjs.map +1 -1
- package/dist/index69.js +15 -57
- package/dist/index69.js.map +1 -1
- package/dist/index70.cjs +20 -83
- package/dist/index70.cjs.map +1 -1
- package/dist/index70.js +276 -418
- package/dist/index70.js.map +1 -1
- package/dist/index71.cjs +275 -419
- package/dist/index71.cjs.map +1 -1
- package/dist/index71.js +56 -58
- package/dist/index71.js.map +1 -1
- package/dist/index72.cjs +82 -85
- package/dist/index72.cjs.map +1 -1
- package/dist/index72.js +420 -226
- package/dist/index72.js.map +1 -1
- package/dist/index73.cjs +421 -225
- package/dist/index73.cjs.map +1 -1
- package/dist/index73.js +58 -42
- package/dist/index73.js.map +1 -1
- package/dist/index74.cjs +85 -61
- package/dist/index74.cjs.map +1 -1
- package/dist/index74.js +236 -76
- package/dist/index74.js.map +1 -1
- package/dist/index75.cjs +235 -75
- package/dist/index75.cjs.map +1 -1
- package/dist/index75.js +42 -20
- package/dist/index75.js.map +1 -1
- package/dist/index76.cjs +60 -27
- package/dist/index76.cjs.map +1 -1
- package/dist/index76.js +73 -88
- package/dist/index76.js.map +1 -1
- package/dist/index77.cjs +73 -90
- package/dist/index77.cjs.map +1 -1
- package/dist/index77.js +17 -15
- package/dist/index77.js.map +1 -1
- package/dist/index78.cjs +22 -19
- package/dist/index78.cjs.map +1 -1
- package/dist/index78.js +85 -143
- package/dist/index78.js.map +1 -1
- package/dist/index79.cjs +87 -143
- package/dist/index79.cjs.map +1 -1
- package/dist/index79.js +19 -91
- package/dist/index79.js.map +1 -1
- package/dist/index80.cjs +27 -135
- package/dist/index80.cjs.map +1 -1
- package/dist/index80.js +140 -673
- package/dist/index80.js.map +1 -1
- package/dist/index81.cjs +140 -673
- package/dist/index81.cjs.map +1 -1
- package/dist/index81.js +91 -31
- package/dist/index81.js.map +1 -1
- package/dist/index82.cjs +135 -45
- package/dist/index82.cjs.map +1 -1
- package/dist/index82.js +667 -206
- package/dist/index82.js.map +1 -1
- package/dist/index83.cjs +667 -204
- package/dist/index83.cjs.map +1 -1
- package/dist/index83.js +31 -15
- package/dist/index83.js.map +1 -1
- package/dist/index84.cjs +45 -21
- package/dist/index84.cjs.map +1 -1
- package/dist/index84.js +224 -29
- package/dist/index84.js.map +1 -1
- package/dist/index85.cjs +224 -30
- package/dist/index85.cjs.map +1 -1
- package/dist/index85.js +19 -0
- package/dist/index85.js.map +1 -0
- package/dist/index86.cjs +25 -0
- package/dist/index86.cjs.map +1 -0
- package/dist/index86.js +36 -0
- package/dist/index86.js.map +1 -0
- package/dist/index87.cjs +37 -0
- package/dist/index87.cjs.map +1 -0
- package/dist/style.css +53 -0
- package/package.json +1 -1
package/dist/index68.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index68.js","names":[],"sources":["../src/components/auth-page/AuthPage.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { AuthCard } from \"../auth-card/AuthCard\";\nimport { AuthField, AuthForm, AuthModeSwitch, type AuthMode } from \"../auth-form/AuthForm\";\nimport { Input } from \"../input/Input\";\nimport { Button } from \"../button/Button\";\nimport styles from \"./auth-page.module.css\";\n\nexport interface AuthCredentials {\n email: string;\n password: string;\n identifier?: string;\n fields?: Record<string, string>;\n}\n\nexport interface AuthAdditionalField {\n name: string;\n label: string;\n type?: \"text\" | \"email\";\n placeholder?: string;\n autoComplete?: string;\n required?: boolean;\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface AuthIdentifierOptions {\n label?: string;\n type?: \"text\" | \"email\";\n placeholder?: string;\n autoComplete?: string;\n maxLength?: number;\n}\n\nexport interface AuthPageProps {\n /** Brand/logo above the form. */\n brand?: React.ReactNode;\n /** Title for each mode. */\n signInTitle?: string;\n signUpTitle?: string;\n signInSubtitle?: string;\n signUpSubtitle?: string;\n signInIdentifier?: AuthIdentifierOptions;\n signUpFields?: AuthAdditionalField[];\n /** Optional confirmation field; defaults to true. */\n requirePasswordConfirmation?: boolean;\n /** An app-supplied session verification error. */\n initialError?: string;\n footer?: React.ReactNode;\n minSignInPasswordLength?: number;\n passwordMaxLength?: number;\n /** Initial tab; changes to this prop after mount do not reset the selected tab. */\n defaultMode?: AuthMode;\n /** Optional controlled tab, e.g. when sign-in and sign-up use separate routes. */\n mode?: AuthMode;\n onModeChange?: (mode: AuthMode) => void;\n /** App-specific auth callbacks; throwing an Error displays an inline failure. */\n onSignIn?: (credentials: AuthCredentials) => Promise<unknown> | unknown;\n onSignUp?: (credentials: AuthCredentials) => Promise<unknown> | unknown;\n onError?: (error: unknown, mode: AuthMode) => void;\n /** Prefill email without ever populating a password. */\n initialEmail?: string;\n /** Prevent submission until the app's authentication provider is ready. */\n disabled?: boolean;\n /** Minimum password length for account creation; default 8. */\n minPasswordLength?: number;\n /** Optional terms requirement for sign-up only. */\n signUpOptions?: {\n requireTerms?: boolean;\n termsHref?: string;\n termsLabel?: string;\n };\n /** Optional app-owned password recovery route. */\n forgotPasswordHref?: string;\n className?: string;\n layout?: \"fullscreen\" | \"embedded\";\n}\n\n/**\n * Complete app-neutral authentication UX. Uzi owns UI state and validation;\n * the consuming application owns credentials, sessions, API calls and redirects.\n */\nexport function AuthPage({\n brand,\n signInTitle = \"Welcome back\",\n signUpTitle = \"Create your account\",\n signInSubtitle,\n signUpSubtitle,\n signInIdentifier,\n signUpFields = [],\n requirePasswordConfirmation = true,\n initialError,\n footer,\n minSignInPasswordLength = 0,\n passwordMaxLength,\n defaultMode = \"signin\",\n mode: controlledMode,\n onModeChange,\n onSignIn,\n onSignUp,\n onError,\n initialEmail = \"\",\n disabled = false,\n minPasswordLength = 8,\n signUpOptions,\n forgotPasswordHref,\n className,\n layout = \"fullscreen\",\n}: AuthPageProps) {\n const [internalMode, setInternalMode] = React.useState<AuthMode>(defaultMode);\n const mode = controlledMode ?? internalMode;\n const [email, setEmail] = React.useState(initialEmail);\n const [password, setPassword] = React.useState(\"\");\n const [confirmPasswordValue, setConfirmPassword] = React.useState(\"\");\n const [extraValues, setExtraValues] = React.useState<Record<string, string>>({});\n const [acceptedTerms, setAcceptedTerms] = React.useState(false);\n const [showPassword, setShowPassword] = React.useState(false);\n const [pending, setPending] = React.useState(false);\n const pendingRef = React.useRef(false);\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [serverError, setServerError] = React.useState(initialError ?? \"\");\n const id = React.useId();\n const emailId = id + \"-email\";\n const passwordId = id + \"-password\";\n const confirmId = id + \"-confirm\";\n const termsId = id + \"-terms\";\n const signup = mode === \"signup\";\n const identifierIsEmail = signup || (signInIdentifier?.type ?? \"email\") === \"email\";\n const termsRequired = signup && !!signUpOptions?.requireTerms;\n const canSwitch = !!onModeChange || (!!onSignIn && !!onSignUp);\n\n const fieldNames = signUpFields.map((field) => field.name).join(\"\\\\u0000\");\n React.useEffect(() => {\n const activeNames = new Set(fieldNames.split(\"\\\\u0000\").filter(Boolean));\n setExtraValues((previous) => {\n if (Object.keys(previous).every((name) => activeNames.has(name))) return previous;\n return Object.fromEntries(Object.entries(previous).filter(([name]) => activeNames.has(name)));\n });\n }, [fieldNames]);\n\n React.useEffect(() => { setServerError(initialError ?? \"\"); }, [initialError]);\n\n React.useEffect(() => {\n // Changes from an authenticated account may prefill the email after hydration.\n if (initialEmail) setEmail((previous) => previous || initialEmail);\n }, [initialEmail]);\n\n const switchMode = (next: AuthMode) => {\n if (pendingRef.current || next === mode) return;\n setInternalMode(next);\n setPassword(\"\");\n setConfirmPassword(\"\");\n setShowPassword(false);\n setErrors({});\n setServerError(\"\");\n onModeChange?.(next);\n };\n\n const submit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (pendingRef.current || disabled) return;\n const nextErrors: Record<string, string> = {};\n const normalizedEmail = email.trim();\n if (!normalizedEmail) nextErrors.email = (signup ? \"Email\" : signInIdentifier?.label ?? \"Email\") + \" is required\";\n else if (identifierIsEmail && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(normalizedEmail)) nextErrors.email = \"Enter a valid email address\";\n if (!signup && signInIdentifier?.maxLength && normalizedEmail.length > signInIdentifier.maxLength) nextErrors.email = \"Identifier is too long\";\n if (!password) nextErrors.password = \"Password is required\";\n else if (signup && password.length < minPasswordLength) nextErrors.password = `Use at least ${minPasswordLength} characters`;\n if (signup && requirePasswordConfirmation && password !== confirmPasswordValue) nextErrors.confirm = \"Passwords do not match\";\n if (!signup && minSignInPasswordLength && password.length < minSignInPasswordLength) nextErrors.password = `Use at least ${minSignInPasswordLength} characters`;\n if (passwordMaxLength && password.length > passwordMaxLength) nextErrors.password = \"Password is too long\";\n if (signup) {\n for (const field of signUpFields) {\n const value = (extraValues[field.name] ?? \"\").trim();\n if (field.required && !value) nextErrors[field.name] = field.label + \" is required\";\n else if (value && field.minLength && value.length < field.minLength) nextErrors[field.name] = field.label + \" is too short\";\n else if (field.maxLength && value.length > field.maxLength) nextErrors[field.name] = field.label + \" is too long\";\n else if (field.type === \"email\" && value && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) nextErrors[field.name] = \"Enter a valid email address\";\n }\n }\n if (termsRequired && !acceptedTerms) nextErrors.terms = \"Accept the terms to continue\";\n setErrors(nextErrors);\n setServerError(\"\");\n if (Object.keys(nextErrors).length) return;\n\n pendingRef.current = true;\n setPending(true);\n try {\n const credentials: AuthCredentials = { email: normalizedEmail, password };\n if (!signup && signInIdentifier) credentials.identifier = normalizedEmail;\n if (signup && signUpFields.length) {\n credentials.fields = Object.fromEntries(signUpFields.map((field) => [field.name, (extraValues[field.name] ?? \"\").trim()]));\n }\n if (signup) {\n if (!onSignUp) return;\n await onSignUp(credentials);\n } else {\n if (!onSignIn) return;\n await onSignIn(credentials);\n }\n setPassword(\"\");\n setConfirmPassword(\"\");\n setExtraValues({});\n } catch (error) {\n setServerError(error instanceof Error && error.message ? error.message : \"Unable to complete the request. Try again.\");\n onError?.(error, mode);\n } finally {\n pendingRef.current = false;\n setPending(false);\n }\n };\n\n return (\n <AuthCard\n className={className}\n layout={layout}\n brand={brand}\n title={signup ? signUpTitle : signInTitle}\n subtitle={signup ? signUpSubtitle : signInSubtitle}\n footer={footer}\n >\n {canSwitch && <AuthModeSwitch mode={mode} onModeChange={switchMode} />}\n <AuthForm onSubmit={submit} noValidate aria-busy={pending}>\n <AuthField htmlFor={emailId} label={signup ? \"Email\" : signInIdentifier?.label ?? \"Email\"} error={errors.email}>\n <Input\n id={emailId} type={signup ? \"email\" : signInIdentifier?.type ?? \"email\"} placeholder={signup ? \"you@example.com\" : signInIdentifier?.placeholder ?? \"you@example.com\"} value={email}\n autoComplete={signup ? \"email\" : signInIdentifier?.autoComplete ?? \"email\"} maxLength={signup ? 254 : signInIdentifier?.maxLength} required disabled={disabled || pending}\n aria-invalid={!!errors.email} aria-describedby={errors.email ? emailId + \"-error\" : undefined}\n onChange={(event) => { setEmail(event.target.value); setErrors((old) => ({ ...old, email: \"\" })); }}\n />\n </AuthField>\n <AuthField htmlFor={passwordId} label=\"Password\" error={errors.password}>\n <div className={styles.passwordRow}>\n <Input\n id={passwordId} type={showPassword ? \"text\" : \"password\"}\n placeholder={signup ? \"At least \" + minPasswordLength + \" characters\" : \"Enter your password\"}\n value={password} required maxLength={passwordMaxLength} disabled={disabled || pending}\n autoComplete={signup ? \"new-password\" : \"current-password\"}\n aria-invalid={!!errors.password} aria-describedby={errors.password ? passwordId + \"-error\" : undefined}\n onChange={(event) => { setPassword(event.target.value); setErrors((old) => ({ ...old, password: \"\" })); }}\n />\n <button type=\"button\" className={styles.visibility} disabled={disabled || pending}\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n aria-controls={passwordId} aria-pressed={showPassword}\n onClick={() => setShowPassword((old) => !old)}>\n {showPassword ? \"Hide\" : \"Show\"}\n </button>\n </div>\n </AuthField>\n {signup && requirePasswordConfirmation && (\n <AuthField htmlFor={confirmId} label=\"Confirm password\" error={errors.confirm}>\n <Input id={confirmId} type=\"password\" placeholder=\"Re-enter password\" value={confirmPasswordValue}\n autoComplete=\"new-password\" required disabled={disabled || pending}\n aria-invalid={!!errors.confirm} aria-describedby={errors.confirm ? confirmId + \"-error\" : undefined}\n onChange={(event) => { setConfirmPassword(event.target.value); setErrors((old) => ({ ...old, confirm: \"\" })); }} />\n </AuthField>\n )}\n {signup && signUpFields.map((field) => {\n const fieldId = id + \"-\" + field.name;\n return (\n <AuthField key={field.name} htmlFor={fieldId} label={field.label} error={errors[field.name]}>\n <Input id={fieldId} type={field.type ?? \"text\"} value={extraValues[field.name] ?? \"\"}\n placeholder={field.placeholder} autoComplete={field.autoComplete} required={field.required}\n minLength={field.minLength} maxLength={field.maxLength} disabled={disabled || pending}\n aria-invalid={!!errors[field.name]} aria-describedby={errors[field.name] ? fieldId + \"-error\" : undefined}\n onChange={(event) => { setExtraValues((old) => ({ ...old, [field.name]: event.target.value })); setErrors((old) => ({ ...old, [field.name]: \"\" })); }} />\n </AuthField>\n );\n })}\n {termsRequired && (\n <div className={styles.terms}>\n <label htmlFor={termsId} className={styles.termsLabel}>\n <input id={termsId} type=\"checkbox\" checked={acceptedTerms} disabled={disabled || pending}\n aria-invalid={!!errors.terms} aria-describedby={errors.terms ? termsId + \"-error\" : undefined}\n onChange={(event) => { setAcceptedTerms(event.target.checked); setErrors((old) => ({ ...old, terms: \"\" })); }} />\n <span>{signUpOptions?.termsLabel ?? \"I agree to the \"}\n {signUpOptions?.termsHref ? <a href={signUpOptions.termsHref}>Terms of Service</a> : \"Terms of Service\"}\n </span>\n </label>\n {errors.terms && <p className={styles.error} id={termsId + \"-error\"} role=\"alert\">{errors.terms}</p>}\n </div>\n )}\n {!signup && forgotPasswordHref && <a className={styles.forgot} href={forgotPasswordHref}>Forgot password?</a>}\n {serverError && <p className={styles.error} role=\"alert\">{serverError}</p>}\n {!(signup ? onSignUp : onSignIn) && (\n <p className={styles.error} role=\"status\">\n {signup ? \"Sign-up is not available.\" : \"Sign-in is not available.\"}\n </p>\n )}\n <Button type=\"submit\" variant=\"primary\" size=\"lg\" disabled={disabled || pending || (signup ? !onSignUp : !onSignIn)}>\n {pending ? (signup ? \"Creating account...\" : \"Signing in...\") : (signup ? \"Create account\" : \"Sign in\")}\n </Button>\n </AuthForm>\n </AuthCard>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAiFA,SAAgB,SAAS,EACvB,OACA,cAAc,gBACd,cAAc,uBACd,gBACA,gBACA,kBACA,eAAe,CAAC,GAChB,8BAA8B,MAC9B,cACA,QACA,0BAA0B,GAC1B,mBACA,cAAc,UACd,MAAM,gBACN,cACA,UACA,UACA,SACA,eAAe,IACf,WAAW,OACX,oBAAoB,GACpB,eACA,oBACA,WACA,SAAS,gBACO;CAChB,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAmB,WAAW;CAC5E,MAAM,OAAO,kBAAkB;CAC/B,MAAM,CAAC,OAAO,YAAY,MAAM,SAAS,YAAY;CACrD,MAAM,CAAC,UAAU,eAAe,MAAM,SAAS,EAAE;CACjD,MAAM,CAAC,sBAAsB,sBAAsB,MAAM,SAAS,EAAE;CACpE,MAAM,CAAC,aAAa,kBAAkB,MAAM,SAAiC,CAAC,CAAC;CAC/E,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAAS,KAAK;CAC9D,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAS,KAAK;CAC5D,MAAM,CAAC,SAAS,cAAc,MAAM,SAAS,KAAK;CAClD,MAAM,aAAa,MAAM,OAAO,KAAK;CACrC,MAAM,CAAC,QAAQ,aAAa,MAAM,SAAiC,CAAC,CAAC;CACrE,MAAM,CAAC,aAAa,kBAAkB,MAAM,SAAS,gBAAgB,EAAE;CACvE,MAAM,KAAK,MAAM,MAAM;CACvB,MAAM,UAAU,KAAK;CACrB,MAAM,aAAa,KAAK;CACxB,MAAM,YAAY,KAAK;CACvB,MAAM,UAAU,KAAK;CACrB,MAAM,SAAS,SAAS;CACx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AAO;KAAO,MAAK;eAC9B,SAAS,8BAA8B;IACvC,CAAA;IAEL,oBAAC,QAAD;KAAQ,MAAK;KAAS,SAAQ;KAAU,MAAK;KAAK,UAAU,YAAY,YAAY,SAAS,CAAC,WAAW,CAAC;eACvG,UAAW,SAAS,wBAAwB,kBAAoB,SAAS,mBAAmB;IACvF,CAAA;GACA;IACF;;AAEd"}
|
|
1
|
+
{"version":3,"file":"index68.js","names":[],"sources":["../src/components/auth-form/AuthForm.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./auth-form.module.css\";\n\nexport type AuthMode = \"signin\" | \"signup\";\n\nexport interface AuthModeSwitchProps {\n mode: AuthMode;\n onModeChange: (mode: AuthMode) => void;\n signInLabel?: string;\n signUpLabel?: string;\n className?: string;\n}\n\n/** An accessible pair of mode buttons; the host app owns navigation and form state. */\nexport function AuthModeSwitch({\n mode,\n onModeChange,\n signInLabel = \"Sign in\",\n signUpLabel = \"Create account\",\n className,\n}: AuthModeSwitchProps) {\n return (\n <div className={cx(styles.modeSwitch, className)} role=\"group\" aria-label=\"Account action\">\n <button type=\"button\" className={styles.modeButton} aria-pressed={mode === \"signin\"} onClick={() => onModeChange(\"signin\")}>\n {signInLabel}\n </button>\n <button type=\"button\" className={styles.modeButton} aria-pressed={mode === \"signup\"} onClick={() => onModeChange(\"signup\")}>\n {signUpLabel}\n </button>\n </div>\n );\n}\n\nexport type AuthFormProps = React.ComponentPropsWithoutRef<\"form\">;\n\n/** Consistent form rhythm and full-width submit controls, without owning credentials. */\nexport const AuthForm = React.forwardRef<HTMLFormElement, AuthFormProps>(\n ({ className, ...props }, ref) => <form ref={ref} className={cx(styles.form, className)} {...props} />,\n);\nAuthForm.displayName = \"AuthForm\";\n\nexport interface AuthFieldProps {\n label: string;\n htmlFor: string;\n error?: string;\n children: React.ReactNode;\n className?: string;\n}\n\n/** Associates inline errors with a field; consumers pass the error ID to aria-describedby. */\nexport function AuthField({ label, htmlFor, error, children, className }: AuthFieldProps) {\n return (\n <div className={cx(styles.field, className)}>\n <label htmlFor={htmlFor} className={styles.label}>{label}</label>\n {children}\n {error && <p id={htmlFor + \"-error\"} role=\"alert\" className={styles.error}>{error}</p>}\n </div>\n );\n}\n"],"mappings":";;;;;;AAeA,SAAgB,eAAe,EAC7B,MACA,cACA,cAAc,WACd,cAAc,kBACd,aACsB;CACtB,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,yBAAO,YAAY,SAAS;EAAG,MAAK;EAAQ,cAAW;YAA1E,CACE,oBAAC,UAAD;GAAQ,MAAK;GAAS,WAAW,yBAAO;GAAY,gBAAc,SAAS;GAAU,eAAe,aAAa,QAAQ;aACtH;EACK,CAAA,GACR,oBAAC,UAAD;GAAQ,MAAK;GAAS,WAAW,yBAAO;GAAY,gBAAc,SAAS;GAAU,eAAe,aAAa,QAAQ;aACtH;EACK,CAAA,CACL;;AAET;;AAKA,IAAa,WAAW,MAAM,YAC3B,EAAE,WAAW,GAAG,SAAS,QAAQ,oBAAC,QAAD;CAAW;CAAK,WAAW,GAAG,yBAAO,MAAM,SAAS;CAAG,GAAI;AAAQ,CAAA,CACvG;AACA,SAAS,cAAc;;AAWvB,SAAgB,UAAU,EAAE,OAAO,SAAS,OAAO,UAAU,aAA6B;CACxF,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,yBAAO,OAAO,SAAS;YAA1C;GACE,oBAAC,SAAD;IAAgB;IAAS,WAAW,yBAAO;cAAQ;GAAa,CAAA;GAC/D;GACA,SAAS,oBAAC,KAAD;IAAG,IAAI,UAAU;IAAU,MAAK;IAAQ,WAAW,yBAAO;cAAQ;GAAS,CAAA;EAClF;;AAET"}
|
package/dist/index69.cjs
CHANGED
|
@@ -1,300 +1,61 @@
|
|
|
1
1
|
const require_runtime = require("./index2.cjs");
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const require_AuthCard = require("./index65.cjs");
|
|
5
|
-
const require_AuthForm = require("./index67.cjs");
|
|
6
|
-
const require_auth_page_module = require("./index68.cjs");
|
|
2
|
+
const require_cx = require("./index4.cjs");
|
|
3
|
+
const require_auth_form_module = require("./index68.cjs");
|
|
7
4
|
let react = require("react");
|
|
8
5
|
react = require_runtime.__toESM(react, 1);
|
|
9
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
-
//#region src/components/auth-
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const emailId = id + "-email";
|
|
30
|
-
const passwordId = id + "-password";
|
|
31
|
-
const confirmId = id + "-confirm";
|
|
32
|
-
const termsId = id + "-terms";
|
|
33
|
-
const signup = mode === "signup";
|
|
34
|
-
const identifierIsEmail = signup || (signInIdentifier?.type ?? "email") === "email";
|
|
35
|
-
const termsRequired = signup && !!signUpOptions?.requireTerms;
|
|
36
|
-
const canSwitch = !!onModeChange || !!onSignIn && !!onSignUp;
|
|
37
|
-
const fieldNames = signUpFields.map((field) => field.name).join("\\u0000");
|
|
38
|
-
react.useEffect(() => {
|
|
39
|
-
const activeNames = new Set(fieldNames.split("\\u0000").filter(Boolean));
|
|
40
|
-
setExtraValues((previous) => {
|
|
41
|
-
if (Object.keys(previous).every((name) => activeNames.has(name))) return previous;
|
|
42
|
-
return Object.fromEntries(Object.entries(previous).filter(([name]) => activeNames.has(name)));
|
|
43
|
-
});
|
|
44
|
-
}, [fieldNames]);
|
|
45
|
-
react.useEffect(() => {
|
|
46
|
-
setServerError(initialError ?? "");
|
|
47
|
-
}, [initialError]);
|
|
48
|
-
react.useEffect(() => {
|
|
49
|
-
if (initialEmail) setEmail((previous) => previous || initialEmail);
|
|
50
|
-
}, [initialEmail]);
|
|
51
|
-
const switchMode = (next) => {
|
|
52
|
-
if (pendingRef.current || next === mode) return;
|
|
53
|
-
setInternalMode(next);
|
|
54
|
-
setPassword("");
|
|
55
|
-
setConfirmPassword("");
|
|
56
|
-
setShowPassword(false);
|
|
57
|
-
setErrors({});
|
|
58
|
-
setServerError("");
|
|
59
|
-
onModeChange?.(next);
|
|
60
|
-
};
|
|
61
|
-
const submit = async (event) => {
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
if (pendingRef.current || disabled) return;
|
|
64
|
-
const nextErrors = {};
|
|
65
|
-
const normalizedEmail = email.trim();
|
|
66
|
-
if (!normalizedEmail) nextErrors.email = (signup ? "Email" : signInIdentifier?.label ?? "Email") + " is required";
|
|
67
|
-
else if (identifierIsEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(normalizedEmail)) nextErrors.email = "Enter a valid email address";
|
|
68
|
-
if (!signup && signInIdentifier?.maxLength && normalizedEmail.length > signInIdentifier.maxLength) nextErrors.email = "Identifier is too long";
|
|
69
|
-
if (!password) nextErrors.password = "Password is required";
|
|
70
|
-
else if (signup && password.length < minPasswordLength) nextErrors.password = `Use at least ${minPasswordLength} characters`;
|
|
71
|
-
if (signup && requirePasswordConfirmation && password !== confirmPasswordValue) nextErrors.confirm = "Passwords do not match";
|
|
72
|
-
if (!signup && minSignInPasswordLength && password.length < minSignInPasswordLength) nextErrors.password = `Use at least ${minSignInPasswordLength} characters`;
|
|
73
|
-
if (passwordMaxLength && password.length > passwordMaxLength) nextErrors.password = "Password is too long";
|
|
74
|
-
if (signup) for (const field of signUpFields) {
|
|
75
|
-
const value = (extraValues[field.name] ?? "").trim();
|
|
76
|
-
if (field.required && !value) nextErrors[field.name] = field.label + " is required";
|
|
77
|
-
else if (value && field.minLength && value.length < field.minLength) nextErrors[field.name] = field.label + " is too short";
|
|
78
|
-
else if (field.maxLength && value.length > field.maxLength) nextErrors[field.name] = field.label + " is too long";
|
|
79
|
-
else if (field.type === "email" && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) nextErrors[field.name] = "Enter a valid email address";
|
|
80
|
-
}
|
|
81
|
-
if (termsRequired && !acceptedTerms) nextErrors.terms = "Accept the terms to continue";
|
|
82
|
-
setErrors(nextErrors);
|
|
83
|
-
setServerError("");
|
|
84
|
-
if (Object.keys(nextErrors).length) return;
|
|
85
|
-
pendingRef.current = true;
|
|
86
|
-
setPending(true);
|
|
87
|
-
try {
|
|
88
|
-
const credentials = {
|
|
89
|
-
email: normalizedEmail,
|
|
90
|
-
password
|
|
91
|
-
};
|
|
92
|
-
if (!signup && signInIdentifier) credentials.identifier = normalizedEmail;
|
|
93
|
-
if (signup && signUpFields.length) credentials.fields = Object.fromEntries(signUpFields.map((field) => [field.name, (extraValues[field.name] ?? "").trim()]));
|
|
94
|
-
if (signup) {
|
|
95
|
-
if (!onSignUp) return;
|
|
96
|
-
await onSignUp(credentials);
|
|
97
|
-
} else {
|
|
98
|
-
if (!onSignIn) return;
|
|
99
|
-
await onSignIn(credentials);
|
|
100
|
-
}
|
|
101
|
-
setPassword("");
|
|
102
|
-
setConfirmPassword("");
|
|
103
|
-
setExtraValues({});
|
|
104
|
-
} catch (error) {
|
|
105
|
-
setServerError(error instanceof Error && error.message ? error.message : "Unable to complete the request. Try again.");
|
|
106
|
-
onError?.(error, mode);
|
|
107
|
-
} finally {
|
|
108
|
-
pendingRef.current = false;
|
|
109
|
-
setPending(false);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_AuthCard.AuthCard, {
|
|
113
|
-
className,
|
|
114
|
-
layout,
|
|
115
|
-
brand,
|
|
116
|
-
title: signup ? signUpTitle : signInTitle,
|
|
117
|
-
subtitle: signup ? signUpSubtitle : signInSubtitle,
|
|
118
|
-
footer,
|
|
119
|
-
children: [canSwitch && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AuthForm.AuthModeSwitch, {
|
|
120
|
-
mode,
|
|
121
|
-
onModeChange: switchMode
|
|
122
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_AuthForm.AuthForm, {
|
|
123
|
-
onSubmit: submit,
|
|
124
|
-
noValidate: true,
|
|
125
|
-
"aria-busy": pending,
|
|
126
|
-
children: [
|
|
127
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AuthForm.AuthField, {
|
|
128
|
-
htmlFor: emailId,
|
|
129
|
-
label: signup ? "Email" : signInIdentifier?.label ?? "Email",
|
|
130
|
-
error: errors.email,
|
|
131
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Input.Input, {
|
|
132
|
-
id: emailId,
|
|
133
|
-
type: signup ? "email" : signInIdentifier?.type ?? "email",
|
|
134
|
-
placeholder: signup ? "you@example.com" : signInIdentifier?.placeholder ?? "you@example.com",
|
|
135
|
-
value: email,
|
|
136
|
-
autoComplete: signup ? "email" : signInIdentifier?.autoComplete ?? "email",
|
|
137
|
-
maxLength: signup ? 254 : signInIdentifier?.maxLength,
|
|
138
|
-
required: true,
|
|
139
|
-
disabled: disabled || pending,
|
|
140
|
-
"aria-invalid": !!errors.email,
|
|
141
|
-
"aria-describedby": errors.email ? emailId + "-error" : void 0,
|
|
142
|
-
onChange: (event) => {
|
|
143
|
-
setEmail(event.target.value);
|
|
144
|
-
setErrors((old) => ({
|
|
145
|
-
...old,
|
|
146
|
-
email: ""
|
|
147
|
-
}));
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
}),
|
|
151
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AuthForm.AuthField, {
|
|
152
|
-
htmlFor: passwordId,
|
|
153
|
-
label: "Password",
|
|
154
|
-
error: errors.password,
|
|
155
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
156
|
-
className: require_auth_page_module.default.passwordRow,
|
|
157
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Input.Input, {
|
|
158
|
-
id: passwordId,
|
|
159
|
-
type: showPassword ? "text" : "password",
|
|
160
|
-
placeholder: signup ? "At least " + minPasswordLength + " characters" : "Enter your password",
|
|
161
|
-
value: password,
|
|
162
|
-
required: true,
|
|
163
|
-
maxLength: passwordMaxLength,
|
|
164
|
-
disabled: disabled || pending,
|
|
165
|
-
autoComplete: signup ? "new-password" : "current-password",
|
|
166
|
-
"aria-invalid": !!errors.password,
|
|
167
|
-
"aria-describedby": errors.password ? passwordId + "-error" : void 0,
|
|
168
|
-
onChange: (event) => {
|
|
169
|
-
setPassword(event.target.value);
|
|
170
|
-
setErrors((old) => ({
|
|
171
|
-
...old,
|
|
172
|
-
password: ""
|
|
173
|
-
}));
|
|
174
|
-
}
|
|
175
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
176
|
-
type: "button",
|
|
177
|
-
className: require_auth_page_module.default.visibility,
|
|
178
|
-
disabled: disabled || pending,
|
|
179
|
-
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
180
|
-
"aria-controls": passwordId,
|
|
181
|
-
"aria-pressed": showPassword,
|
|
182
|
-
onClick: () => setShowPassword((old) => !old),
|
|
183
|
-
children: showPassword ? "Hide" : "Show"
|
|
184
|
-
})]
|
|
185
|
-
})
|
|
186
|
-
}),
|
|
187
|
-
signup && requirePasswordConfirmation && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AuthForm.AuthField, {
|
|
188
|
-
htmlFor: confirmId,
|
|
189
|
-
label: "Confirm password",
|
|
190
|
-
error: errors.confirm,
|
|
191
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Input.Input, {
|
|
192
|
-
id: confirmId,
|
|
193
|
-
type: "password",
|
|
194
|
-
placeholder: "Re-enter password",
|
|
195
|
-
value: confirmPasswordValue,
|
|
196
|
-
autoComplete: "new-password",
|
|
197
|
-
required: true,
|
|
198
|
-
disabled: disabled || pending,
|
|
199
|
-
"aria-invalid": !!errors.confirm,
|
|
200
|
-
"aria-describedby": errors.confirm ? confirmId + "-error" : void 0,
|
|
201
|
-
onChange: (event) => {
|
|
202
|
-
setConfirmPassword(event.target.value);
|
|
203
|
-
setErrors((old) => ({
|
|
204
|
-
...old,
|
|
205
|
-
confirm: ""
|
|
206
|
-
}));
|
|
207
|
-
}
|
|
208
|
-
})
|
|
209
|
-
}),
|
|
210
|
-
signup && signUpFields.map((field) => {
|
|
211
|
-
const fieldId = id + "-" + field.name;
|
|
212
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AuthForm.AuthField, {
|
|
213
|
-
htmlFor: fieldId,
|
|
214
|
-
label: field.label,
|
|
215
|
-
error: errors[field.name],
|
|
216
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Input.Input, {
|
|
217
|
-
id: fieldId,
|
|
218
|
-
type: field.type ?? "text",
|
|
219
|
-
value: extraValues[field.name] ?? "",
|
|
220
|
-
placeholder: field.placeholder,
|
|
221
|
-
autoComplete: field.autoComplete,
|
|
222
|
-
required: field.required,
|
|
223
|
-
minLength: field.minLength,
|
|
224
|
-
maxLength: field.maxLength,
|
|
225
|
-
disabled: disabled || pending,
|
|
226
|
-
"aria-invalid": !!errors[field.name],
|
|
227
|
-
"aria-describedby": errors[field.name] ? fieldId + "-error" : void 0,
|
|
228
|
-
onChange: (event) => {
|
|
229
|
-
setExtraValues((old) => ({
|
|
230
|
-
...old,
|
|
231
|
-
[field.name]: event.target.value
|
|
232
|
-
}));
|
|
233
|
-
setErrors((old) => ({
|
|
234
|
-
...old,
|
|
235
|
-
[field.name]: ""
|
|
236
|
-
}));
|
|
237
|
-
}
|
|
238
|
-
})
|
|
239
|
-
}, field.name);
|
|
240
|
-
}),
|
|
241
|
-
termsRequired && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
242
|
-
className: require_auth_page_module.default.terms,
|
|
243
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
244
|
-
htmlFor: termsId,
|
|
245
|
-
className: require_auth_page_module.default.termsLabel,
|
|
246
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
247
|
-
id: termsId,
|
|
248
|
-
type: "checkbox",
|
|
249
|
-
checked: acceptedTerms,
|
|
250
|
-
disabled: disabled || pending,
|
|
251
|
-
"aria-invalid": !!errors.terms,
|
|
252
|
-
"aria-describedby": errors.terms ? termsId + "-error" : void 0,
|
|
253
|
-
onChange: (event) => {
|
|
254
|
-
setAcceptedTerms(event.target.checked);
|
|
255
|
-
setErrors((old) => ({
|
|
256
|
-
...old,
|
|
257
|
-
terms: ""
|
|
258
|
-
}));
|
|
259
|
-
}
|
|
260
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [signUpOptions?.termsLabel ?? "I agree to the ", signUpOptions?.termsHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
261
|
-
href: signUpOptions.termsHref,
|
|
262
|
-
children: "Terms of Service"
|
|
263
|
-
}) : "Terms of Service"] })]
|
|
264
|
-
}), errors.terms && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
265
|
-
className: require_auth_page_module.default.error,
|
|
266
|
-
id: termsId + "-error",
|
|
267
|
-
role: "alert",
|
|
268
|
-
children: errors.terms
|
|
269
|
-
})]
|
|
270
|
-
}),
|
|
271
|
-
!signup && forgotPasswordHref && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
272
|
-
className: require_auth_page_module.default.forgot,
|
|
273
|
-
href: forgotPasswordHref,
|
|
274
|
-
children: "Forgot password?"
|
|
275
|
-
}),
|
|
276
|
-
serverError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
277
|
-
className: require_auth_page_module.default.error,
|
|
278
|
-
role: "alert",
|
|
279
|
-
children: serverError
|
|
280
|
-
}),
|
|
281
|
-
!(signup ? onSignUp : onSignIn) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
282
|
-
className: require_auth_page_module.default.error,
|
|
283
|
-
role: "status",
|
|
284
|
-
children: signup ? "Sign-up is not available." : "Sign-in is not available."
|
|
285
|
-
}),
|
|
286
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
|
|
287
|
-
type: "submit",
|
|
288
|
-
variant: "primary",
|
|
289
|
-
size: "lg",
|
|
290
|
-
disabled: disabled || pending || (signup ? !onSignUp : !onSignIn),
|
|
291
|
-
children: pending ? signup ? "Creating account..." : "Signing in..." : signup ? "Create account" : "Sign in"
|
|
292
|
-
})
|
|
293
|
-
]
|
|
7
|
+
//#region src/components/auth-form/AuthForm.tsx
|
|
8
|
+
/** An accessible pair of mode buttons; the host app owns navigation and form state. */
|
|
9
|
+
function AuthModeSwitch({ mode, onModeChange, signInLabel = "Sign in", signUpLabel = "Create account", className }) {
|
|
10
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11
|
+
className: require_cx.cx(require_auth_form_module.default.modeSwitch, className),
|
|
12
|
+
role: "group",
|
|
13
|
+
"aria-label": "Account action",
|
|
14
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
className: require_auth_form_module.default.modeButton,
|
|
17
|
+
"aria-pressed": mode === "signin",
|
|
18
|
+
onClick: () => onModeChange("signin"),
|
|
19
|
+
children: signInLabel
|
|
20
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
21
|
+
type: "button",
|
|
22
|
+
className: require_auth_form_module.default.modeButton,
|
|
23
|
+
"aria-pressed": mode === "signup",
|
|
24
|
+
onClick: () => onModeChange("signup"),
|
|
25
|
+
children: signUpLabel
|
|
294
26
|
})]
|
|
295
27
|
});
|
|
296
28
|
}
|
|
29
|
+
/** Consistent form rhythm and full-width submit controls, without owning credentials. */
|
|
30
|
+
var AuthForm = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("form", {
|
|
31
|
+
ref,
|
|
32
|
+
className: require_cx.cx(require_auth_form_module.default.form, className),
|
|
33
|
+
...props
|
|
34
|
+
}));
|
|
35
|
+
AuthForm.displayName = "AuthForm";
|
|
36
|
+
/** Associates inline errors with a field; consumers pass the error ID to aria-describedby. */
|
|
37
|
+
function AuthField({ label, htmlFor, error, children, className }) {
|
|
38
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
39
|
+
className: require_cx.cx(require_auth_form_module.default.field, className),
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
42
|
+
htmlFor,
|
|
43
|
+
className: require_auth_form_module.default.label,
|
|
44
|
+
children: label
|
|
45
|
+
}),
|
|
46
|
+
children,
|
|
47
|
+
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
48
|
+
id: htmlFor + "-error",
|
|
49
|
+
role: "alert",
|
|
50
|
+
className: require_auth_form_module.default.error,
|
|
51
|
+
children: error
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
297
56
|
//#endregion
|
|
298
|
-
exports.
|
|
57
|
+
exports.AuthField = AuthField;
|
|
58
|
+
exports.AuthForm = AuthForm;
|
|
59
|
+
exports.AuthModeSwitch = AuthModeSwitch;
|
|
299
60
|
|
|
300
61
|
//# sourceMappingURL=index69.cjs.map
|
package/dist/index69.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index69.cjs","names":[],"sources":["../src/components/auth-page/AuthPage.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { AuthCard } from \"../auth-card/AuthCard\";\nimport { AuthField, AuthForm, AuthModeSwitch, type AuthMode } from \"../auth-form/AuthForm\";\nimport { Input } from \"../input/Input\";\nimport { Button } from \"../button/Button\";\nimport styles from \"./auth-page.module.css\";\n\nexport interface AuthCredentials {\n email: string;\n password: string;\n identifier?: string;\n fields?: Record<string, string>;\n}\n\nexport interface AuthAdditionalField {\n name: string;\n label: string;\n type?: \"text\" | \"email\";\n placeholder?: string;\n autoComplete?: string;\n required?: boolean;\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface AuthIdentifierOptions {\n label?: string;\n type?: \"text\" | \"email\";\n placeholder?: string;\n autoComplete?: string;\n maxLength?: number;\n}\n\nexport interface AuthPageProps {\n /** Brand/logo above the form. */\n brand?: React.ReactNode;\n /** Title for each mode. */\n signInTitle?: string;\n signUpTitle?: string;\n signInSubtitle?: string;\n signUpSubtitle?: string;\n signInIdentifier?: AuthIdentifierOptions;\n signUpFields?: AuthAdditionalField[];\n /** Optional confirmation field; defaults to true. */\n requirePasswordConfirmation?: boolean;\n /** An app-supplied session verification error. */\n initialError?: string;\n footer?: React.ReactNode;\n minSignInPasswordLength?: number;\n passwordMaxLength?: number;\n /** Initial tab; changes to this prop after mount do not reset the selected tab. */\n defaultMode?: AuthMode;\n /** Optional controlled tab, e.g. when sign-in and sign-up use separate routes. */\n mode?: AuthMode;\n onModeChange?: (mode: AuthMode) => void;\n /** App-specific auth callbacks; throwing an Error displays an inline failure. */\n onSignIn?: (credentials: AuthCredentials) => Promise<unknown> | unknown;\n onSignUp?: (credentials: AuthCredentials) => Promise<unknown> | unknown;\n onError?: (error: unknown, mode: AuthMode) => void;\n /** Prefill email without ever populating a password. */\n initialEmail?: string;\n /** Prevent submission until the app's authentication provider is ready. */\n disabled?: boolean;\n /** Minimum password length for account creation; default 8. */\n minPasswordLength?: number;\n /** Optional terms requirement for sign-up only. */\n signUpOptions?: {\n requireTerms?: boolean;\n termsHref?: string;\n termsLabel?: string;\n };\n /** Optional app-owned password recovery route. */\n forgotPasswordHref?: string;\n className?: string;\n layout?: \"fullscreen\" | \"embedded\";\n}\n\n/**\n * Complete app-neutral authentication UX. Uzi owns UI state and validation;\n * the consuming application owns credentials, sessions, API calls and redirects.\n */\nexport function AuthPage({\n brand,\n signInTitle = \"Welcome back\",\n signUpTitle = \"Create your account\",\n signInSubtitle,\n signUpSubtitle,\n signInIdentifier,\n signUpFields = [],\n requirePasswordConfirmation = true,\n initialError,\n footer,\n minSignInPasswordLength = 0,\n passwordMaxLength,\n defaultMode = \"signin\",\n mode: controlledMode,\n onModeChange,\n onSignIn,\n onSignUp,\n onError,\n initialEmail = \"\",\n disabled = false,\n minPasswordLength = 8,\n signUpOptions,\n forgotPasswordHref,\n className,\n layout = \"fullscreen\",\n}: AuthPageProps) {\n const [internalMode, setInternalMode] = React.useState<AuthMode>(defaultMode);\n const mode = controlledMode ?? internalMode;\n const [email, setEmail] = React.useState(initialEmail);\n const [password, setPassword] = React.useState(\"\");\n const [confirmPasswordValue, setConfirmPassword] = React.useState(\"\");\n const [extraValues, setExtraValues] = React.useState<Record<string, string>>({});\n const [acceptedTerms, setAcceptedTerms] = React.useState(false);\n const [showPassword, setShowPassword] = React.useState(false);\n const [pending, setPending] = React.useState(false);\n const pendingRef = React.useRef(false);\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [serverError, setServerError] = React.useState(initialError ?? \"\");\n const id = React.useId();\n const emailId = id + \"-email\";\n const passwordId = id + \"-password\";\n const confirmId = id + \"-confirm\";\n const termsId = id + \"-terms\";\n const signup = mode === \"signup\";\n const identifierIsEmail = signup || (signInIdentifier?.type ?? \"email\") === \"email\";\n const termsRequired = signup && !!signUpOptions?.requireTerms;\n const canSwitch = !!onModeChange || (!!onSignIn && !!onSignUp);\n\n const fieldNames = signUpFields.map((field) => field.name).join(\"\\\\u0000\");\n React.useEffect(() => {\n const activeNames = new Set(fieldNames.split(\"\\\\u0000\").filter(Boolean));\n setExtraValues((previous) => {\n if (Object.keys(previous).every((name) => activeNames.has(name))) return previous;\n return Object.fromEntries(Object.entries(previous).filter(([name]) => activeNames.has(name)));\n });\n }, [fieldNames]);\n\n React.useEffect(() => { setServerError(initialError ?? \"\"); }, [initialError]);\n\n React.useEffect(() => {\n // Changes from an authenticated account may prefill the email after hydration.\n if (initialEmail) setEmail((previous) => previous || initialEmail);\n }, [initialEmail]);\n\n const switchMode = (next: AuthMode) => {\n if (pendingRef.current || next === mode) return;\n setInternalMode(next);\n setPassword(\"\");\n setConfirmPassword(\"\");\n setShowPassword(false);\n setErrors({});\n setServerError(\"\");\n onModeChange?.(next);\n };\n\n const submit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (pendingRef.current || disabled) return;\n const nextErrors: Record<string, string> = {};\n const normalizedEmail = email.trim();\n if (!normalizedEmail) nextErrors.email = (signup ? \"Email\" : signInIdentifier?.label ?? \"Email\") + \" is required\";\n else if (identifierIsEmail && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(normalizedEmail)) nextErrors.email = \"Enter a valid email address\";\n if (!signup && signInIdentifier?.maxLength && normalizedEmail.length > signInIdentifier.maxLength) nextErrors.email = \"Identifier is too long\";\n if (!password) nextErrors.password = \"Password is required\";\n else if (signup && password.length < minPasswordLength) nextErrors.password = `Use at least ${minPasswordLength} characters`;\n if (signup && requirePasswordConfirmation && password !== confirmPasswordValue) nextErrors.confirm = \"Passwords do not match\";\n if (!signup && minSignInPasswordLength && password.length < minSignInPasswordLength) nextErrors.password = `Use at least ${minSignInPasswordLength} characters`;\n if (passwordMaxLength && password.length > passwordMaxLength) nextErrors.password = \"Password is too long\";\n if (signup) {\n for (const field of signUpFields) {\n const value = (extraValues[field.name] ?? \"\").trim();\n if (field.required && !value) nextErrors[field.name] = field.label + \" is required\";\n else if (value && field.minLength && value.length < field.minLength) nextErrors[field.name] = field.label + \" is too short\";\n else if (field.maxLength && value.length > field.maxLength) nextErrors[field.name] = field.label + \" is too long\";\n else if (field.type === \"email\" && value && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) nextErrors[field.name] = \"Enter a valid email address\";\n }\n }\n if (termsRequired && !acceptedTerms) nextErrors.terms = \"Accept the terms to continue\";\n setErrors(nextErrors);\n setServerError(\"\");\n if (Object.keys(nextErrors).length) return;\n\n pendingRef.current = true;\n setPending(true);\n try {\n const credentials: AuthCredentials = { email: normalizedEmail, password };\n if (!signup && signInIdentifier) credentials.identifier = normalizedEmail;\n if (signup && signUpFields.length) {\n credentials.fields = Object.fromEntries(signUpFields.map((field) => [field.name, (extraValues[field.name] ?? \"\").trim()]));\n }\n if (signup) {\n if (!onSignUp) return;\n await onSignUp(credentials);\n } else {\n if (!onSignIn) return;\n await onSignIn(credentials);\n }\n setPassword(\"\");\n setConfirmPassword(\"\");\n setExtraValues({});\n } catch (error) {\n setServerError(error instanceof Error && error.message ? error.message : \"Unable to complete the request. Try again.\");\n onError?.(error, mode);\n } finally {\n pendingRef.current = false;\n setPending(false);\n }\n };\n\n return (\n <AuthCard\n className={className}\n layout={layout}\n brand={brand}\n title={signup ? signUpTitle : signInTitle}\n subtitle={signup ? signUpSubtitle : signInSubtitle}\n footer={footer}\n >\n {canSwitch && <AuthModeSwitch mode={mode} onModeChange={switchMode} />}\n <AuthForm onSubmit={submit} noValidate aria-busy={pending}>\n <AuthField htmlFor={emailId} label={signup ? \"Email\" : signInIdentifier?.label ?? \"Email\"} error={errors.email}>\n <Input\n id={emailId} type={signup ? \"email\" : signInIdentifier?.type ?? \"email\"} placeholder={signup ? \"you@example.com\" : signInIdentifier?.placeholder ?? \"you@example.com\"} value={email}\n autoComplete={signup ? \"email\" : signInIdentifier?.autoComplete ?? \"email\"} maxLength={signup ? 254 : signInIdentifier?.maxLength} required disabled={disabled || pending}\n aria-invalid={!!errors.email} aria-describedby={errors.email ? emailId + \"-error\" : undefined}\n onChange={(event) => { setEmail(event.target.value); setErrors((old) => ({ ...old, email: \"\" })); }}\n />\n </AuthField>\n <AuthField htmlFor={passwordId} label=\"Password\" error={errors.password}>\n <div className={styles.passwordRow}>\n <Input\n id={passwordId} type={showPassword ? \"text\" : \"password\"}\n placeholder={signup ? \"At least \" + minPasswordLength + \" characters\" : \"Enter your password\"}\n value={password} required maxLength={passwordMaxLength} disabled={disabled || pending}\n autoComplete={signup ? \"new-password\" : \"current-password\"}\n aria-invalid={!!errors.password} aria-describedby={errors.password ? passwordId + \"-error\" : undefined}\n onChange={(event) => { setPassword(event.target.value); setErrors((old) => ({ ...old, password: \"\" })); }}\n />\n <button type=\"button\" className={styles.visibility} disabled={disabled || pending}\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n aria-controls={passwordId} aria-pressed={showPassword}\n onClick={() => setShowPassword((old) => !old)}>\n {showPassword ? \"Hide\" : \"Show\"}\n </button>\n </div>\n </AuthField>\n {signup && requirePasswordConfirmation && (\n <AuthField htmlFor={confirmId} label=\"Confirm password\" error={errors.confirm}>\n <Input id={confirmId} type=\"password\" placeholder=\"Re-enter password\" value={confirmPasswordValue}\n autoComplete=\"new-password\" required disabled={disabled || pending}\n aria-invalid={!!errors.confirm} aria-describedby={errors.confirm ? confirmId + \"-error\" : undefined}\n onChange={(event) => { setConfirmPassword(event.target.value); setErrors((old) => ({ ...old, confirm: \"\" })); }} />\n </AuthField>\n )}\n {signup && signUpFields.map((field) => {\n const fieldId = id + \"-\" + field.name;\n return (\n <AuthField key={field.name} htmlFor={fieldId} label={field.label} error={errors[field.name]}>\n <Input id={fieldId} type={field.type ?? \"text\"} value={extraValues[field.name] ?? \"\"}\n placeholder={field.placeholder} autoComplete={field.autoComplete} required={field.required}\n minLength={field.minLength} maxLength={field.maxLength} disabled={disabled || pending}\n aria-invalid={!!errors[field.name]} aria-describedby={errors[field.name] ? fieldId + \"-error\" : undefined}\n onChange={(event) => { setExtraValues((old) => ({ ...old, [field.name]: event.target.value })); setErrors((old) => ({ ...old, [field.name]: \"\" })); }} />\n </AuthField>\n );\n })}\n {termsRequired && (\n <div className={styles.terms}>\n <label htmlFor={termsId} className={styles.termsLabel}>\n <input id={termsId} type=\"checkbox\" checked={acceptedTerms} disabled={disabled || pending}\n aria-invalid={!!errors.terms} aria-describedby={errors.terms ? termsId + \"-error\" : undefined}\n onChange={(event) => { setAcceptedTerms(event.target.checked); setErrors((old) => ({ ...old, terms: \"\" })); }} />\n <span>{signUpOptions?.termsLabel ?? \"I agree to the \"}\n {signUpOptions?.termsHref ? <a href={signUpOptions.termsHref}>Terms of Service</a> : \"Terms of Service\"}\n </span>\n </label>\n {errors.terms && <p className={styles.error} id={termsId + \"-error\"} role=\"alert\">{errors.terms}</p>}\n </div>\n )}\n {!signup && forgotPasswordHref && <a className={styles.forgot} href={forgotPasswordHref}>Forgot password?</a>}\n {serverError && <p className={styles.error} role=\"alert\">{serverError}</p>}\n {!(signup ? onSignUp : onSignIn) && (\n <p className={styles.error} role=\"status\">\n {signup ? \"Sign-up is not available.\" : \"Sign-in is not available.\"}\n </p>\n )}\n <Button type=\"submit\" variant=\"primary\" size=\"lg\" disabled={disabled || pending || (signup ? !onSignUp : !onSignIn)}>\n {pending ? (signup ? \"Creating account...\" : \"Signing in...\") : (signup ? \"Create account\" : \"Sign in\")}\n </Button>\n </AuthForm>\n </AuthCard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAiFA,SAAgB,SAAS,EACvB,OACA,cAAc,gBACd,cAAc,uBACd,gBACA,gBACA,kBACA,eAAe,CAAC,GAChB,8BAA8B,MAC9B,cACA,QACA,0BAA0B,GAC1B,mBACA,cAAc,UACd,MAAM,gBACN,cACA,UACA,UACA,SACA,eAAe,IACf,WAAW,OACX,oBAAoB,GACpB,eACA,oBACA,WACA,SAAS,gBACO;CAChB,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAmB,WAAW;CAC5E,MAAM,OAAO,kBAAkB;CAC/B,MAAM,CAAC,OAAO,YAAY,MAAM,SAAS,YAAY;CACrD,MAAM,CAAC,UAAU,eAAe,MAAM,SAAS,EAAE;CACjD,MAAM,CAAC,sBAAsB,sBAAsB,MAAM,SAAS,EAAE;CACpE,MAAM,CAAC,aAAa,kBAAkB,MAAM,SAAiC,CAAC,CAAC;CAC/E,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAAS,KAAK;CAC9D,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAS,KAAK;CAC5D,MAAM,CAAC,SAAS,cA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S,mBAAmB;IACvF,CAAA;GACA;IACF;;AAEd"}
|
|
1
|
+
{"version":3,"file":"index69.cjs","names":[],"sources":["../src/components/auth-form/AuthForm.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cx } from \"../../utils/cx\";\nimport styles from \"./auth-form.module.css\";\n\nexport type AuthMode = \"signin\" | \"signup\";\n\nexport interface AuthModeSwitchProps {\n mode: AuthMode;\n onModeChange: (mode: AuthMode) => void;\n signInLabel?: string;\n signUpLabel?: string;\n className?: string;\n}\n\n/** An accessible pair of mode buttons; the host app owns navigation and form state. */\nexport function AuthModeSwitch({\n mode,\n onModeChange,\n signInLabel = \"Sign in\",\n signUpLabel = \"Create account\",\n className,\n}: AuthModeSwitchProps) {\n return (\n <div className={cx(styles.modeSwitch, className)} role=\"group\" aria-label=\"Account action\">\n <button type=\"button\" className={styles.modeButton} aria-pressed={mode === \"signin\"} onClick={() => onModeChange(\"signin\")}>\n {signInLabel}\n </button>\n <button type=\"button\" className={styles.modeButton} aria-pressed={mode === \"signup\"} onClick={() => onModeChange(\"signup\")}>\n {signUpLabel}\n </button>\n </div>\n );\n}\n\nexport type AuthFormProps = React.ComponentPropsWithoutRef<\"form\">;\n\n/** Consistent form rhythm and full-width submit controls, without owning credentials. */\nexport const AuthForm = React.forwardRef<HTMLFormElement, AuthFormProps>(\n ({ className, ...props }, ref) => <form ref={ref} className={cx(styles.form, className)} {...props} />,\n);\nAuthForm.displayName = \"AuthForm\";\n\nexport interface AuthFieldProps {\n label: string;\n htmlFor: string;\n error?: string;\n children: React.ReactNode;\n className?: string;\n}\n\n/** Associates inline errors with a field; consumers pass the error ID to aria-describedby. */\nexport function AuthField({ label, htmlFor, error, children, className }: AuthFieldProps) {\n return (\n <div className={cx(styles.field, className)}>\n <label htmlFor={htmlFor} className={styles.label}>{label}</label>\n {children}\n {error && <p id={htmlFor + \"-error\"} role=\"alert\" className={styles.error}>{error}</p>}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,e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var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var eyeIcon = "uzi-auth-pages-module__eyeIcon__ab2Ts";
|
|
16
|
-
var checkboxRow = "uzi-auth-pages-module__checkboxRow__Rq-84";
|
|
17
|
-
var checkboxLabel = "uzi-auth-pages-module__checkboxLabel__poKs-";
|
|
18
|
-
var checkbox = "uzi-auth-pages-module__checkbox__KOQQe";
|
|
19
|
-
var forgotLink = "uzi-auth-pages-module__forgotLink__5q-vL";
|
|
20
|
-
var checkboxLink = "uzi-auth-pages-module__checkboxLink__kAkKg";
|
|
21
|
-
var submitButton = "uzi-auth-pages-module__submitButton__mlGxT";
|
|
22
|
-
var spinner = "uzi-auth-pages-module__spinner__seK4F";
|
|
23
|
-
var spin = "uzi-auth-pages-module__spin__hYpWH";
|
|
24
|
-
var divider = "uzi-auth-pages-module__divider__Debmu";
|
|
25
|
-
var authFooter = "uzi-auth-pages-module__authFooter__SEaGh";
|
|
26
|
-
var sentMessage = "uzi-auth-pages-module__sentMessage__vLBoY";
|
|
27
|
-
var sentText = "uzi-auth-pages-module__sentText__qyJkF";
|
|
28
|
-
var backLink = "uzi-auth-pages-module__backLink__ezB3X";
|
|
29
|
-
var auth_pages_module_default = {
|
|
30
|
-
authLayout,
|
|
31
|
-
authCard,
|
|
32
|
-
authBrand,
|
|
33
|
-
authHeader,
|
|
34
|
-
authTitle,
|
|
35
|
-
authSubtitle,
|
|
36
|
-
authForm,
|
|
37
|
-
field,
|
|
38
|
-
label,
|
|
39
|
-
input,
|
|
40
|
-
error,
|
|
41
|
-
passwordWrapper,
|
|
42
|
-
toggle,
|
|
43
|
-
eyeIcon,
|
|
44
|
-
checkboxRow,
|
|
45
|
-
checkboxLabel,
|
|
46
|
-
checkbox,
|
|
47
|
-
forgotLink,
|
|
48
|
-
checkboxLink,
|
|
49
|
-
submitButton,
|
|
50
|
-
spinner,
|
|
51
|
-
spin,
|
|
52
|
-
divider,
|
|
53
|
-
authFooter,
|
|
54
|
-
sentMessage,
|
|
55
|
-
sentText,
|
|
56
|
-
backLink
|
|
1
|
+
//#region src/components/auth-page/auth-page.module.css
|
|
2
|
+
var passwordRow = "uzi-auth-page-module__passwordRow__j-8o9";
|
|
3
|
+
var visibility = "uzi-auth-page-module__visibility__xAl7n";
|
|
4
|
+
var forgot = "uzi-auth-page-module__forgot__N3KHE";
|
|
5
|
+
var terms = "uzi-auth-page-module__terms__Wrnbn";
|
|
6
|
+
var termsLabel = "uzi-auth-page-module__termsLabel__IwyoU";
|
|
7
|
+
var error = "uzi-auth-page-module__error__C1RQx";
|
|
8
|
+
var auth_page_module_default = {
|
|
9
|
+
passwordRow,
|
|
10
|
+
visibility,
|
|
11
|
+
forgot,
|
|
12
|
+
terms,
|
|
13
|
+
termsLabel,
|
|
14
|
+
error
|
|
57
15
|
};
|
|
58
16
|
//#endregion
|
|
59
|
-
export {
|
|
17
|
+
export { auth_page_module_default as default, error, forgot, passwordRow, terms, termsLabel, visibility };
|
|
60
18
|
|
|
61
19
|
//# sourceMappingURL=index69.js.map
|
package/dist/index69.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index69.js","names":[],"sources":["../src/components/auth-
|
|
1
|
+
{"version":3,"file":"index69.js","names":[],"sources":["../src/components/auth-page/auth-page.module.css"],"sourcesContent":[".passwordRow { position: relative; }\n.passwordRow input { padding-right: 4.5rem; }\n.visibility { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: transparent; border: 0; border-radius: 6px; color: var(--muted-foreground); font: inherit; font-size: .8rem; cursor: pointer; padding: .35rem .5rem; }\n.visibility:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); }\n.visibility:disabled { cursor: not-allowed; opacity: .5; }\n.forgot { align-self: flex-end; color: var(--primary); font-size: .875rem; text-decoration: none; }\n.forgot:hover { text-decoration: underline; }\n.terms { display: flex; flex-direction: column; gap: .35rem; }\n.termsLabel { display: flex; align-items: flex-start; gap: .6rem; font-size: .875rem; color: var(--foreground); }\n.termsLabel input { margin-top: .2rem; accent-color: var(--primary); }\n.termsLabel a { color: var(--primary); }\n.error { color: var(--destructive); margin: 0; font-size: .8125rem; }\n"],"mappings":""}
|