feat: Implement marketing page layout, core sections, and shared UI components.

This commit is contained in:
2026-01-06 12:53:57 +01:00
parent 170c2e9c80
commit 2a057ae3e3
9 changed files with 44 additions and 20 deletions

View File

@@ -7,7 +7,10 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
}
export const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, label, error, onInvalid, ...props }, ref) => {
({ className, type, label, error, onInvalid, id, ...props }, ref) => {
// Generate a unique id for accessibility if not provided
const inputId = id || (label ? label.toLowerCase().replace(/\s+/g, '-') : undefined);
// Default English validation message
const handleInvalid = (e: React.InvalidEvent<HTMLInputElement>) => {
e.target.setCustomValidity('Please fill out this field.');
@@ -21,11 +24,12 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
return (
<div className="space-y-1">
{label && (
<label className="block text-sm font-medium text-gray-700">
<label htmlFor={inputId} className="block text-sm font-medium text-gray-700">
{label}
</label>
)}
<input
id={inputId}
type={type}
className={cn(
'flex h-10 w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',

View File

@@ -41,6 +41,7 @@ export function ScrollToTop() {
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path
strokeLinecap="round"

View File

@@ -8,15 +8,19 @@ interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
}
export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
({ className, label, error, options, ...props }, ref) => {
({ className, label, error, options, id, ...props }, ref) => {
// Generate a unique id for accessibility if not provided
const selectId = id || (label ? `select-${label.toLowerCase().replace(/\s+/g, '-')}` : undefined);
return (
<div className="space-y-1">
{label && (
<label className="block text-sm font-medium text-gray-700">
<label htmlFor={selectId} className="block text-sm font-medium text-gray-700">
{label}
</label>
)}
<select
id={selectId}
className={cn(
'flex h-10 w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
error && 'border-red-500 focus-visible:ring-red-500',