From 21eb67ef5e59d36b996392f60b5045f152a64604 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 1 Apr 2022 22:57:12 +0200 Subject: chore: add a labelled select field component --- src/components/atoms/forms/select.stories.tsx | 10 ++-------- src/components/atoms/forms/select.tsx | 6 +++--- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src/components/atoms/forms') diff --git a/src/components/atoms/forms/select.stories.tsx b/src/components/atoms/forms/select.stories.tsx index 683e3b5..ed487f8 100644 --- a/src/components/atoms/forms/select.stories.tsx +++ b/src/components/atoms/forms/select.stories.tsx @@ -30,12 +30,9 @@ export default { type: 'text', }, description: 'Field id.', - table: { - category: 'Options', - }, type: { name: 'string', - required: false, + required: true, }, }, name: { @@ -43,12 +40,9 @@ export default { type: 'text', }, description: 'Field name.', - table: { - category: 'Options', - }, type: { name: 'string', - required: false, + required: true, }, }, options: { diff --git a/src/components/atoms/forms/select.tsx b/src/components/atoms/forms/select.tsx index 6e46660..e434a82 100644 --- a/src/components/atoms/forms/select.tsx +++ b/src/components/atoms/forms/select.tsx @@ -7,7 +7,7 @@ type SelectOptions = { value: string; }; -type SelectProps = { +export type SelectProps = { /** * Field state. Either enabled (false) or disabled (true). */ @@ -15,11 +15,11 @@ type SelectProps = { /** * Field id attribute. */ - id?: string; + id: string; /** * Field name attribute. */ - name?: string; + name: string; /** * True if the field is required. Default: false. */ -- cgit v1.2.3