website refactor

This commit is contained in:
2026-01-17 15:46:55 +01:00
parent 4d5ce9bfd6
commit 72a626ce71
346 changed files with 19308 additions and 8605 deletions

View File

@@ -0,0 +1,42 @@
import React, { ComponentProps } from 'react';
import { Eye, EyeOff, Lock } from 'lucide-react';
import { Input } from './Input';
import { Box } from './Box';
interface PasswordFieldProps extends ComponentProps<typeof Input> {
showPassword?: boolean;
onTogglePassword?: () => void;
}
/**
* PasswordField
*
* A specialized input for passwords with visibility toggling.
* Stateless UI component.
*/
export function PasswordField({ showPassword, onTogglePassword, ...props }: PasswordFieldProps) {
return (
<Box position="relative" fullWidth>
<Input
{...props}
type={showPassword ? 'text' : 'password'}
icon={<Lock size={16} />}
/>
{onTogglePassword && (
<Box
as="button"
type="button"
onClick={onTogglePassword}
position="absolute"
right="3"
top={props.label ? "34px" : "50%"}
style={props.label ? {} : { transform: 'translateY(-50%)' }}
zIndex={10}
className="text-gray-500 hover:text-gray-300 transition-colors"
>
{showPassword ? <EyeOff size={16} /> : <Eye size={16} />}
</Box>
)}
</Box>
);
}