From dfd7d25de8560395565f35b7a9a993f865fc7689 Mon Sep 17 00:00:00 2001 From: Jonas Brunvoll Larsson <59939294+jonasbrunvoll@users.noreply.github.com> Date: Wed, 2 Oct 2024 07:39:07 +0200 Subject: [PATCH] chore: minor improvements of FileInput component. (#374) * Extend icon to use theme colors. * Make FileInput reachable by using TAB, and possible to open using both space and enter. * Add over to radioBox, iconsButton and FileInput. --- .../contact/components/input/file.tsx | 20 +++++++++++++++---- .../contact/components/input/input.module.css | 20 +++++++++++++++++-- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/page-modules/contact/components/input/file.tsx b/src/page-modules/contact/components/input/file.tsx index b09362a0..269a7d04 100644 --- a/src/page-modules/contact/components/input/file.tsx +++ b/src/page-modules/contact/components/input/file.tsx @@ -4,6 +4,7 @@ import { Typo } from '@atb/components/typography'; import { Button } from '@atb/components/button'; import { MonoIcon } from '@atb/components/icon'; import { PageText, useTranslation } from '@atb/translations'; +import { useTheme } from '@atb/modules/theme'; export type FileInputProps = { label: string; @@ -15,6 +16,7 @@ const MAX_ALLOWED_FILE_SIZE = 10 * 1024 * 1024; // 10MB export function FileInput({ onChange, label, name }: FileInputProps) { const { t } = useTranslation(); const id = useId(); + const { static: staticColors } = useTheme(); const [files, setFiles] = useState([]); const handleFileChange = (event: ChangeEvent) => { @@ -78,8 +80,18 @@ export function FileInput({ onChange, label, name }: FileInputProps) { accept="image/*,.pdf,.doc,docx,.txt" /> -