-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b449747
commit 3e90139
Showing
7 changed files
with
159 additions
and
115 deletions.
There are no files selected for viewing
36 changes: 22 additions & 14 deletions
36
packages/skeleton-loader/src/CardSkeleton/CardSkeleton.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
import React from 'react'; | ||
import { storybookArgTypes } from '@lg-tools/storybook-utils'; | ||
import { StoryFn } from '@storybook/react'; | ||
import { StoryMetaType, StoryType } from '@lg-tools/storybook-utils'; | ||
|
||
import { CardSkeleton } from '..'; | ||
|
||
export default { | ||
title: 'Components/SkeletonLoader', | ||
component: CardSkeleton, | ||
parameters: { | ||
default: null, | ||
controls: { exclude: ['darkMode', 'ref'] }, | ||
generate: { | ||
storyNames: ['Card'], | ||
combineArgs: { | ||
darkMode: [false, true], | ||
}, | ||
decorator: Instance => ( | ||
<div style={{ width: 500 }}> | ||
<Instance /> | ||
</div> | ||
), | ||
}, | ||
}, | ||
args: { | ||
enableAnimations: false, | ||
}, | ||
argTypes: { | ||
darkMode: storybookArgTypes.darkMode, | ||
enableAnimations: { control: 'boolean' }, | ||
}, | ||
decorators: [ | ||
(Story: StoryFn) => ( | ||
<div style={{ width: 700 }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
}; | ||
} satisfies StoryMetaType<typeof CardSkeleton>; | ||
|
||
export const Card: StoryFn<typeof CardSkeleton> = props => ( | ||
<CardSkeleton {...props} /> | ||
); | ||
export const Card: StoryType<typeof CardSkeleton> = () => <></>; |
36 changes: 22 additions & 14 deletions
36
packages/skeleton-loader/src/CodeSkeleton/CodeSkeleton.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
import React from 'react'; | ||
import { storybookArgTypes } from '@lg-tools/storybook-utils'; | ||
import { StoryFn } from '@storybook/react'; | ||
import { StoryMetaType, StoryType } from '@lg-tools/storybook-utils'; | ||
|
||
import { CodeSkeleton } from '..'; | ||
|
||
export default { | ||
title: 'Components/SkeletonLoader', | ||
component: CodeSkeleton, | ||
parameters: { | ||
default: null, | ||
controls: { exclude: ['darkMode', 'ref'] }, | ||
generate: { | ||
storyNames: ['Code'], | ||
combineArgs: { | ||
darkMode: [false, true], | ||
}, | ||
decorator: Instance => ( | ||
<div style={{ width: 500 }}> | ||
<Instance /> | ||
</div> | ||
), | ||
}, | ||
}, | ||
args: { | ||
enableAnimations: false, | ||
}, | ||
argTypes: { | ||
darkMode: storybookArgTypes.darkMode, | ||
enableAnimations: { control: 'boolean' }, | ||
}, | ||
decorators: [ | ||
(Story: StoryFn) => ( | ||
<div style={{ width: 700 }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
}; | ||
} satisfies StoryMetaType<typeof CodeSkeleton>; | ||
|
||
export const Code: StoryFn<typeof CodeSkeleton> = props => ( | ||
<CodeSkeleton {...props} /> | ||
); | ||
export const Code: StoryType<typeof CodeSkeleton> = () => <></>; |
36 changes: 22 additions & 14 deletions
36
packages/skeleton-loader/src/FormSkeleton/FormSkeleton.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
import React from 'react'; | ||
import { storybookArgTypes } from '@lg-tools/storybook-utils'; | ||
import { StoryFn } from '@storybook/react'; | ||
import { StoryMetaType, StoryType } from '@lg-tools/storybook-utils'; | ||
|
||
import { FormSkeleton } from '.'; | ||
|
||
export default { | ||
title: 'Components/SkeletonLoader', | ||
component: FormSkeleton, | ||
parameters: { | ||
controls: { exclude: ['darkMode', 'ref'] }, | ||
default: null, | ||
generate: { | ||
storyNames: ['Form'], | ||
combineArgs: { | ||
darkMode: [false, true], | ||
}, | ||
decorator: Instance => ( | ||
<div style={{ width: 500 }}> | ||
<Instance /> | ||
</div> | ||
), | ||
}, | ||
}, | ||
args: { | ||
enableAnimations: false, | ||
}, | ||
argTypes: { | ||
darkMode: storybookArgTypes.darkMode, | ||
enableAnimations: { control: 'boolean' }, | ||
}, | ||
decorators: [ | ||
(Story: StoryFn) => ( | ||
<div style={{ width: 700 }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
}; | ||
} satisfies StoryMetaType<typeof FormSkeleton>; | ||
|
||
export const Form: StoryFn<typeof FormSkeleton> = props => ( | ||
<FormSkeleton {...props} /> | ||
); | ||
export const Form: StoryType<typeof FormSkeleton> = () => <></>; |
47 changes: 23 additions & 24 deletions
47
packages/skeleton-loader/src/ListSkeleton/ListSkeleton.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
import React from 'react'; | ||
import { StoryMetaType, StoryType } from '@lg-tools/storybook-utils'; | ||
|
||
import { ListSkeleton, type ListSkeletonProps } from '.'; | ||
import { ListSkeleton } from '.'; | ||
|
||
const meta: StoryMetaType<typeof ListSkeleton> = { | ||
title: 'Components/SkeletonLoader/List', | ||
export default { | ||
title: 'Components/SkeletonLoader', | ||
component: ListSkeleton, | ||
parameters: { | ||
default: null, | ||
controls: { exclude: ['darkMode', 'ref', 'size'] }, | ||
generate: { | ||
storyNames: ['List'], | ||
combineArgs: { | ||
darkMode: [false, true], | ||
bulletsOnly: [false, true], | ||
}, | ||
decorator: Instance => ( | ||
<div style={{ width: 256 }}> | ||
<Instance /> | ||
</div> | ||
), | ||
}, | ||
}, | ||
args: { | ||
enableAnimations: false, | ||
count: 5, | ||
bulletsOnly: false, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Basic: StoryType<typeof ListSkeleton> = ( | ||
args: ListSkeletonProps, | ||
) => { | ||
return ( | ||
<div style={{ width: 256 }}> | ||
<ListSkeleton {...args} /> | ||
</div> | ||
); | ||
}; | ||
argTypes: { | ||
enableAnimations: { control: 'boolean' }, | ||
count: { control: 'number' }, | ||
}, | ||
} satisfies StoryMetaType<typeof ListSkeleton>; | ||
|
||
export const BulletsOnly: StoryType<typeof ListSkeleton> = () => { | ||
return ( | ||
<div style={{ width: 256 }}> | ||
<ListSkeleton bulletsOnly /> | ||
</div> | ||
); | ||
}; | ||
export const List: StoryType<typeof ListSkeleton> = () => <></>; |
40 changes: 24 additions & 16 deletions
40
packages/skeleton-loader/src/ParagraphSkeleton/ParagraphSkeleton.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
import React from 'react'; | ||
import { storybookArgTypes } from '@lg-tools/storybook-utils'; | ||
import { StoryFn } from '@storybook/react'; | ||
import { StoryMetaType, StoryType } from '@lg-tools/storybook-utils'; | ||
|
||
import { ParagraphSkeleton } from '.'; | ||
import { ParagraphSkeleton } from './ParagraphSkeleton'; | ||
|
||
export default { | ||
title: 'Components/SkeletonLoader', | ||
component: ParagraphSkeleton, | ||
parameters: { | ||
controls: { exclude: ['darkMode', 'ref'] }, | ||
default: null, | ||
generate: { | ||
storyNames: ['Paragraph'], | ||
combineArgs: { | ||
darkMode: [false, true], | ||
withHeader: [true, false], | ||
}, | ||
decorator: Instance => ( | ||
<div style={{ width: 500 }}> | ||
<Instance /> | ||
</div> | ||
), | ||
}, | ||
}, | ||
args: { | ||
enableAnimations: false, | ||
}, | ||
argTypes: { | ||
darkMode: storybookArgTypes.darkMode, | ||
withHeader: { control: 'boolean' }, | ||
enableAnimations: { control: 'boolean' }, | ||
}, | ||
decorators: [ | ||
(Story: StoryFn) => ( | ||
<div style={{ width: 700 }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
}; | ||
} satisfies StoryMetaType<typeof ParagraphSkeleton>; | ||
|
||
export const Paragraph: StoryFn<typeof ParagraphSkeleton> = props => ( | ||
<ParagraphSkeleton {...props} /> | ||
); | ||
export const Paragraph: StoryType<typeof ParagraphSkeleton> = () => <></>; |
43 changes: 26 additions & 17 deletions
43
packages/skeleton-loader/src/Skeleton/Skeleton.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,36 @@ | ||
import React from 'react'; | ||
import { storybookArgTypes } from '@lg-tools/storybook-utils'; | ||
import { StoryFn } from '@storybook/react'; | ||
import { StoryMetaType, StoryType } from '@lg-tools/storybook-utils'; | ||
|
||
import { Size, Skeleton } from '.'; | ||
|
||
export default { | ||
title: 'Components/SkeletonLoader', | ||
component: Skeleton, | ||
argTypes: { | ||
darkMode: storybookArgTypes.darkMode, | ||
size: { | ||
control: 'select', | ||
options: Object.values(Size), | ||
defaultValue: Size.Default, | ||
parameters: { | ||
controls: { exclude: ['darkMode', 'ref', 'size'] }, | ||
default: null, | ||
generate: { | ||
storyNames: ['Basic'], | ||
combineArgs: { | ||
darkMode: [false, true], | ||
size: Object.values(Size), | ||
}, | ||
args: { | ||
enableAnimations: false, | ||
}, | ||
decorator: Instance => ( | ||
<div style={{ width: 256 }}> | ||
<Instance /> | ||
</div> | ||
), | ||
}, | ||
}, | ||
decorators: [ | ||
(Story: StoryFn) => ( | ||
<div style={{ width: 700 }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
}; | ||
args: { | ||
enableAnimations: false, | ||
}, | ||
argTypes: { | ||
enableAnimations: { control: 'boolean' }, | ||
}, | ||
} satisfies StoryMetaType<typeof Skeleton>; | ||
|
||
export const Basic: StoryFn<typeof Skeleton> = props => <Skeleton {...props} />; | ||
export const Basic: StoryType<typeof Skeleton> = () => <></>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters