From 3ad5ec869904577a83f058b62ceea5adf16eebd8 Mon Sep 17 00:00:00 2001 From: roshni73 Date: Thu, 6 Jun 2024 15:53:47 +0545 Subject: [PATCH] Fix hint ,validation ,text,error message --- .../src/stories/InputContainer.stories.tsx | 54 ++++++++++++++----- .../src/stories/InputError.stories.tsx | 6 +-- .../src/stories/InputHint.stories.ts | 8 +-- .../src/stories/InputLabel.stories.ts | 6 +-- .../src/stories/LegendItem.stories.tsx | 6 +-- .../src/stories/Message.stories.tsx | 12 ++++- 6 files changed, 63 insertions(+), 29 deletions(-) diff --git a/packages/go-ui-storybook/src/stories/InputContainer.stories.tsx b/packages/go-ui-storybook/src/stories/InputContainer.stories.tsx index f2ed0f61cd..f3a9ee2706 100644 --- a/packages/go-ui-storybook/src/stories/InputContainer.stories.tsx +++ b/packages/go-ui-storybook/src/stories/InputContainer.stories.tsx @@ -6,7 +6,9 @@ import type { import InputContainer from './InputContainer'; -const meta = { +type Story = StoryObj; + +const meta :Meta = { title: 'Components/InputContainer', component: InputContainer, parameters: { @@ -19,33 +21,30 @@ const meta = { }, tags: ['autodocs'], argTypes: {}, -} satisfies Meta; +}; export default meta; -type Story = StoryObj; export const Default: Story = { args: { label: 'Start After', input:
mm/dd/yy
, - icons: , }, }; + export const Disabled: Story = { args: { label: 'Start After', input:
mm/dd/yy
, - icons: , disabled: true, - }, }; + export const WithError: Story = { args: { label: 'Start After', input:
mm/dd/yy
, - icons: , - error:

This is an error message

, + error:

Invalid Date

, }, }; @@ -53,23 +52,54 @@ export const ReadOnly: Story = { args: { label: 'Start After', input:
mm/dd/yy
, - icons: , readOnly: true, }, }; + export const WithHint: Story = { args: { label: 'Start After', input:
mm/dd/yy
, - icons: , - hint: 'Please get this Hint', + hint: 'Enter a date in the format mm/dd/yy that the event should start after.', }, }; + export const WithAsterisk: Story = { args: { label: 'Start After', input:
mm/dd/yy
, - icons: , withAsterisk: true, }, }; + +export const ErrorOnTooltip: Story = { + args: { + label: 'Start After', + input:
mm/dd/yy
, + errorOnTooltip: true, + }, +}; + +export const Variant: Story = { + args: { + label: 'Start After', + input:
mm/dd/yy
, + variant: 'form', + }, +}; + +export const Required: Story = { + args: { + label: 'Start After', + input:
mm/dd/yy
, + required: true, + }, +}; + +export const WithIcon: Story = { + args: { + label: 'Start After', + input:
mm/dd/yy
, + icons: , + }, +}; diff --git a/packages/go-ui-storybook/src/stories/InputError.stories.tsx b/packages/go-ui-storybook/src/stories/InputError.stories.tsx index 7e236720d1..e499c0970c 100644 --- a/packages/go-ui-storybook/src/stories/InputError.stories.tsx +++ b/packages/go-ui-storybook/src/stories/InputError.stories.tsx @@ -23,15 +23,15 @@ const meta: Meta = { }; export default meta; - export const Default: Story = { args: { - children: 'This is an error', + children: 'An error occurred. Please try again.', }, }; + export const Disabled: Story = { args: { - children: 'This is an error ', + children: 'An error occurred. Please try again.', disabled: true, }, }; diff --git a/packages/go-ui-storybook/src/stories/InputHint.stories.ts b/packages/go-ui-storybook/src/stories/InputHint.stories.ts index 212a70a082..3be9f7d269 100644 --- a/packages/go-ui-storybook/src/stories/InputHint.stories.ts +++ b/packages/go-ui-storybook/src/stories/InputHint.stories.ts @@ -25,12 +25,6 @@ type Story = StoryObj; export const Default: Story = { args: { - children: 'This is a Hint', - }, -}; -export const WithClassName: Story = { - args: { - className: 'custom-class', - children: 'This is a Hint with a Class', + children: 'Enter your information in the provided field.', }, }; diff --git a/packages/go-ui-storybook/src/stories/InputLabel.stories.ts b/packages/go-ui-storybook/src/stories/InputLabel.stories.ts index ae7e7ede1e..685db3c724 100644 --- a/packages/go-ui-storybook/src/stories/InputLabel.stories.ts +++ b/packages/go-ui-storybook/src/stories/InputLabel.stories.ts @@ -24,20 +24,20 @@ type Story = StoryObj; export const Default: Story = { args: { - children: 'This is a Default Input-label', + children: 'User Name', }, }; export const Disabled :Story = { args: { - children: 'This is a disabled label', + children: 'User Name', disabled: true, }, }; export const Required : Story = { args: { - children: 'This is a required label', + children: 'User Name', required: true, }, }; diff --git a/packages/go-ui-storybook/src/stories/LegendItem.stories.tsx b/packages/go-ui-storybook/src/stories/LegendItem.stories.tsx index 12d0bb3bc2..b48cde5fb2 100644 --- a/packages/go-ui-storybook/src/stories/LegendItem.stories.tsx +++ b/packages/go-ui-storybook/src/stories/LegendItem.stories.tsx @@ -39,14 +39,14 @@ export default meta; export const Default: Story = { args: { - label: 'Test', + label: 'Early Action Protocol Activation', color: 'red', }, }; export const Color: Story = { args: { - label: 'Test', - color: 'green', + label: 'Multiple types', + color: 'orange', }, }; diff --git a/packages/go-ui-storybook/src/stories/Message.stories.tsx b/packages/go-ui-storybook/src/stories/Message.stories.tsx index 1f7e058336..1ede0b1dd7 100644 --- a/packages/go-ui-storybook/src/stories/Message.stories.tsx +++ b/packages/go-ui-storybook/src/stories/Message.stories.tsx @@ -40,6 +40,7 @@ export default meta; export const Default: Story = { args: { title: 'IFRC supported Operation', + errored: false, }, }; @@ -58,10 +59,19 @@ export const Info :Story = { }, }; +export const Pending :Story = { + args: { + title: 'Fetching data...', + pending: true, + + }, +}; export const Error :Story = { args: { - title: 'Page not found', + title: 'IFRC supported Operation', variant: 'error', + erroredTitle: 'Page Not Found', + errored: true, }, };