1
- import type { Meta , StoryObj } from '@storybook/html'
1
+ import type { Meta } from '@storybook/html'
2
2
import { CosmosStoryProps } from '@/graph/stories/create-cosmos'
3
+ import { createStory , Story } from '@/graph/stories/create-story'
3
4
import { WithLabelsStory } from './clusters/with-labels'
4
5
import { WormStory } from './clusters/worm'
5
6
import { RadialStory } from './clusters/radial'
@@ -19,35 +20,39 @@ const meta: Meta<CosmosStoryProps> = {
19
20
} ,
20
21
}
21
22
22
- type Story = StoryObj < CosmosStoryProps > ;
23
-
24
23
const sourceCodeAddonParams = [
25
24
{ name : 'create-cosmos' , code : createCosmosRaw } ,
26
25
{ name : 'generate-mesh-data' , code : generateMeshDataRaw } ,
27
26
]
28
27
29
- export const Worm = WormStory as Story
30
- Worm . parameters = {
31
- sourceCode : [
32
- { name : 'Story' , code : wormStory } ,
33
- ...sourceCodeAddonParams ,
34
- ] ,
28
+ export const Worm : Story = {
29
+ ...createStory ( WormStory ) ,
30
+ parameters : {
31
+ sourceCode : [
32
+ { name : 'Story' , code : wormStory } ,
33
+ ...sourceCodeAddonParams ,
34
+ ] ,
35
+ } ,
35
36
}
36
37
37
- export const Radial = RadialStory as Story
38
- Radial . parameters = {
39
- sourceCode : [
40
- { name : 'Story' , code : radialStory } ,
41
- ...sourceCodeAddonParams ,
42
- ] ,
38
+ export const Radial : Story = {
39
+ ...createStory ( RadialStory ) ,
40
+ parameters : {
41
+ sourceCode : [
42
+ { name : 'Story' , code : radialStory } ,
43
+ ...sourceCodeAddonParams ,
44
+ ] ,
45
+ } ,
43
46
}
44
47
45
- export const WithLabels = WithLabelsStory as Story
46
- WithLabels . parameters = {
47
- sourceCode : [
48
- { name : 'Story' , code : withLabelsStory } ,
49
- ...sourceCodeAddonParams ,
50
- ] ,
48
+ export const WithLabels : Story = {
49
+ ...createStory ( WithLabelsStory ) ,
50
+ parameters : {
51
+ sourceCode : [
52
+ { name : 'Story' , code : withLabelsStory } ,
53
+ ...sourceCodeAddonParams ,
54
+ ] ,
55
+ } ,
51
56
}
52
57
53
58
// eslint-disable-next-line import/no-default-export
0 commit comments