Skip to content

Commit

Permalink
fix: code reveux
Browse files Browse the repository at this point in the history
  • Loading branch information
geotrev committed Apr 30, 2024
1 parent d46ebbb commit 885c177
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 9 additions & 3 deletions packages/datepickers/demo/datepicker.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import README from '../README.md';
<Canvas>
<Story
name="Datepicker"
args={{ dateStyle: DATE_STYLE_OPTIONS[1], eventsEnabled: true, isAnimated: true }}
args={{
dateStyle: DATE_STYLE_OPTIONS[1],
eventsEnabled: true,
isAnimated: true,
message: 'Message'
}}
argTypes={{
value: { control: 'date' },
minValue: { control: 'date' },
Expand All @@ -26,15 +31,16 @@ import README from '../README.md';
options: DATE_STYLE_OPTIONS,
table: { category: 'Story' }
},
hasMessage: { name: 'Message', control: { type: 'boolean' }, table: 'Story' },
message: { name: 'children', control: { type: 'text' }, table: { category: 'Message' } },
validation: {
options: ['success', 'warning', 'error'],
control: { type: 'radio' },
table: { category: 'Message' }
table: { category: 'Input' }
},
validationLabel: {
control: { type: 'text' },
table: { category: 'Message' }
table: { category: 'Input' }
}
}}
parameters={{
Expand Down
8 changes: 5 additions & 3 deletions packages/datepickers/demo/stories/DatepickerStory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { DATE_STYLE } from './types';

interface IArgs extends IDatepickerProps {
dateStyle: DATE_STYLE;
hasMessage?: boolean;
message?: string;
validation?: 'success' | 'warning' | 'error';
validationLabel?: string;
Expand All @@ -22,6 +23,7 @@ interface IArgs extends IDatepickerProps {
export const DatepickerStory: Story<IArgs> = ({
dateStyle,
isCompact,
hasMessage,
message,
validation,
validationLabel,
Expand All @@ -33,13 +35,13 @@ export const DatepickerStory: Story<IArgs> = ({
return (
<Grid>
<Row justifyContent="center" style={{ height: 'calc(100vh - 80px)' }}>
<Col alignSelf="center" xs={12} md={4}>
<Col alignSelf="center">
<Field>
<Label hidden>{Datepicker.displayName}</Label>
<Datepicker {...args} formatDate={formatDate} isCompact={isCompact}>
<Input isCompact={isCompact} />
<Input isCompact={isCompact} validation={validation} />
</Datepicker>
{message && (
{hasMessage && (
<Message validation={validation} validationLabel={validationLabel}>
{message}
</Message>
Expand Down

0 comments on commit 885c177

Please sign in to comment.