feat: loosen up the zod validations and return null instead of throwing

This commit is contained in:
Simon Emanuelsson
2024-06-07 10:36:23 +02:00
parent 5c50ac060d
commit aca9221ea6
89 changed files with 1117 additions and 821 deletions

View File

@@ -23,12 +23,6 @@
.input,
.listBoxItem {
color: var(--UI-Grey-60);
font-family: var(--typography-Body-Regular-fontFamily);
font-size: var(--typography-Body-Regular-fontSize);
font-weight: var(--typography-Body-Regular-fontWeight);
font-weight: var(--typography-Body-Regular-fontWeight);
letter-spacing: var--typography-Body-Regular-letterSpacing;
line-height: var(--typography-Body-Regular-lineHeight);
}
.button {

View File

@@ -14,6 +14,8 @@ import {
import { useController, useFormContext } from "react-hook-form"
import { useIntl } from "react-intl"
import Body from "@/components/TempDesignSystem/Text/Body"
import SelectChevron from "../SelectChevron"
import { countries } from "./countries"
@@ -53,11 +55,13 @@ export default function CountrySelect({
selectedKey={field.value}
>
<div className={styles.comboBoxContainer}>
<Input
aria-label={selectCountryLabel}
className={styles.input}
placeholder={selectCountryLabel}
/>
<Body asChild fontOnly>
<Input
aria-label={selectCountryLabel}
className={styles.input}
placeholder={selectCountryLabel}
/>
</Body>
<Button className={styles.button}>
<SelectChevron />
</Button>
@@ -79,14 +83,15 @@ export default function CountrySelect({
>
<ListBox>
{countries.map((country, idx) => (
<ListBoxItem
aria-label={country.name}
className={styles.listBoxItem}
id={country.code}
key={`${country.code}-${idx}`}
>
{country.name}
</ListBoxItem>
<Body asChild fontOnly key={`${country.code}-${idx}`}>
<ListBoxItem
aria-label={country.name}
className={styles.listBoxItem}
id={country.code}
>
{country.name}
</ListBoxItem>
</Body>
))}
</ListBox>
</Popover>