Skip to content

Commit

Permalink
add stories
Browse files Browse the repository at this point in the history
  • Loading branch information
MMFane committed Aug 29, 2023
1 parent c513011 commit 18acc3b
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 1 deletion.
32 changes: 32 additions & 0 deletions src/components/NumberFormat/PercentFormatField.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import { StoryObj, Meta } from '@storybook/react';

import { PercentFormatField } from './UnitNumberFormatField';
import { Apple, HelpCircle, TrendingUp } from '@lifeomic/chromicons';

const meta: Meta<typeof PercentFormatField> = {
title: 'Form Components/NumberFormat/PercentFormatField',
Expand Down Expand Up @@ -33,6 +35,36 @@ export const Max: Story = {
},
};

export const Adornments: Story = {
args: {
startAdornment: <Apple />,
endAdornment: <TrendingUp />,
},
};

export const TooltipMessage: Story = {
parameters: {
docs: {
description: {
story:
'Icon and Tooltip Message must be used at the same time for either of them to render.',
},
},
},
args: {
icon: HelpCircle,
tooltipMessage: 'Tooltip Message',
},
};

export const RequiredAndError: Story = {
args: {
hasError: true,
showRequiredLabel: true,
errorMessage: 'This is required',
},
};

export const InverseDark: Story = {
parameters: {
backgrounds: { default: 'dark' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ export const Placeholder: Story = {
},
};

export const Error: Story = {
export const RequiredAndError: Story = {
args: {
hasError: true,
showRequiredLabel: true,
errorMessage: 'This is required',
},
};
Expand Down
32 changes: 32 additions & 0 deletions src/components/NumberFormat/PriceFormatField.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import { StoryObj, Meta } from '@storybook/react';

import { PriceFormatField } from './UnitNumberFormatField';
import { Apple, HelpCircle, TrendingUp } from '@lifeomic/chromicons';

const meta: Meta<typeof PriceFormatField> = {
title: 'Form Components/NumberFormat/PriceFormatField',
Expand Down Expand Up @@ -33,6 +35,36 @@ export const Max: Story = {
},
};

export const Adornments: Story = {
args: {
startAdornment: <Apple />,
endAdornment: <TrendingUp />,
},
};

export const TooltipMessage: Story = {
parameters: {
docs: {
description: {
story:
'Icon and Tooltip Message must be used at the same time for either of them to render.',
},
},
},
args: {
icon: HelpCircle,
tooltipMessage: 'Tooltip Message',
},
};

export const RequiredAndError: Story = {
args: {
hasError: true,
showRequiredLabel: true,
errorMessage: 'This is required',
},
};

export const InverseDark: Story = {
parameters: {
backgrounds: { default: 'dark' },
Expand Down
32 changes: 32 additions & 0 deletions src/components/NumberFormat/UnitNumberFormatField.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import { StoryObj, Meta } from '@storybook/react';

import { UnitNumberFormatField } from './UnitNumberFormatField';
import { Apple, HelpCircle, TrendingUp } from '@lifeomic/chromicons';

const meta: Meta<typeof UnitNumberFormatField> = {
title: 'Form Components/NumberFormat/UnitNumberFormatField',
Expand Down Expand Up @@ -46,6 +48,36 @@ export const PrefixUnits: Story = {
},
};

export const Adornments: Story = {
args: {
startAdornment: <Apple />,
endAdornment: <TrendingUp />,
},
};

export const TooltipMessage: Story = {
parameters: {
docs: {
description: {
story:
'Icon and Tooltip Message must be used at the same time for either of them to render.',
},
},
},
args: {
icon: HelpCircle,
tooltipMessage: 'Tooltip Message',
},
};

export const RequiredAndError: Story = {
args: {
hasError: true,
showRequiredLabel: true,
errorMessage: 'This is required',
},
};

export const InverseDark: Story = {
parameters: {
backgrounds: { default: 'dark' },
Expand Down

0 comments on commit 18acc3b

Please sign in to comment.