-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from discretize/storybook-8-webpack
chore: upgrade to storybook@8
- Loading branch information
Showing
51 changed files
with
3,111 additions
and
5,937 deletions.
There are no files selected for viewing
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
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
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,9 +1,23 @@ | ||
import { dirname, join } from 'node:path'; | ||
|
||
module.exports = { | ||
stories: ['../src/**/*.stories.tsx'], | ||
addons: [ | ||
'@storybook/addon-actions', | ||
'@storybook/addon-essentials', | ||
'storybook-css-modules-preset', | ||
getAbsolutePath('@storybook/addon-actions'), | ||
getAbsolutePath('@storybook/addon-essentials'), | ||
getAbsolutePath('storybook-css-modules-preset'), | ||
'@storybook/addon-webpack5-compiler-babel', | ||
], | ||
framework: '@storybook/react', | ||
framework: { | ||
name: getAbsolutePath('@storybook/react-webpack5'), | ||
options: {}, | ||
}, | ||
docs: {}, | ||
typescript: { | ||
reactDocgen: 'react-docgen-typescript', | ||
}, | ||
}; | ||
|
||
function getAbsolutePath(value) { | ||
return dirname(require.resolve(join(value, 'package.json'))); | ||
} |
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 |
---|---|---|
|
@@ -10,3 +10,5 @@ export const parameters = { | |
}, | ||
}, | ||
}; | ||
|
||
// export const tags = ['autodocs']; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"sourceType": "unambiguous", | ||
"presets": [ | ||
["@babel/preset-env", { "targets": "defaults" }], | ||
"@babel/preset-typescript", | ||
["@babel/preset-react", { "runtime": "automatic" }] | ||
], | ||
"plugins": [] | ||
} |
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
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,20 +1,24 @@ | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import type { Meta, StoryFn, StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
import Attribute from './Attribute'; | ||
|
||
export default { | ||
const meta: Meta<typeof Attribute> = { | ||
title: 'Components/Attribute', | ||
component: Attribute, | ||
argTypes: { | ||
className: { control: false }, | ||
}, | ||
} as ComponentMeta<typeof Attribute>; | ||
}; | ||
export default meta; | ||
|
||
const Template: ComponentStory<typeof Attribute> = (args) => { | ||
const Template: StoryFn<typeof Attribute> = (args) => { | ||
return <Attribute {...args} />; | ||
}; | ||
|
||
export const BoonDuration = Template.bind({}); | ||
BoonDuration.args = { | ||
name: 'Boon Duration', | ||
export const BoonDuration: StoryObj<typeof Attribute> = { | ||
render: Template, | ||
|
||
args: { | ||
name: 'Boon Duration', | ||
}, | ||
}; |
18 changes: 11 additions & 7 deletions
18
gw2-ui/src/components/Augmentation/Augmentation.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,20 +1,24 @@ | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import type { Meta, StoryFn, StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
import Augmentation from './Augmentation'; | ||
|
||
export default { | ||
const meta: Meta<typeof Augmentation> = { | ||
title: 'Components/Augmentation', | ||
component: Augmentation, | ||
argTypes: { | ||
className: { control: false }, | ||
}, | ||
} as ComponentMeta<typeof Augmentation>; | ||
}; | ||
export default meta; | ||
|
||
const Template: ComponentStory<typeof Augmentation> = (args) => { | ||
const Template: StoryFn<typeof Augmentation> = (args) => { | ||
return <Augmentation {...args} />; | ||
}; | ||
|
||
export const God = Template.bind({}); | ||
God.args = { | ||
name: 'Mist Attunement 4', | ||
export const God: StoryObj<typeof Augmentation> = { | ||
render: Template, | ||
|
||
args: { | ||
name: 'Mist Attunement 4', | ||
}, | ||
}; |
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,20 +1,24 @@ | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import type { Meta, StoryFn, StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
import Aura from './Aura'; | ||
|
||
export default { | ||
const meta: Meta<typeof Aura> = { | ||
title: 'Components/Aura', | ||
component: Aura, | ||
argTypes: { | ||
className: { control: false }, | ||
}, | ||
} as ComponentMeta<typeof Aura>; | ||
}; | ||
export default meta; | ||
|
||
const Template: ComponentStory<typeof Aura> = (args) => { | ||
const Template: StoryFn<typeof Aura> = (args) => { | ||
return <Aura {...args} />; | ||
}; | ||
|
||
export const Simple = Template.bind({}); | ||
Simple.args = { | ||
name: 'Light', | ||
export const Simple: StoryObj<typeof Aura> = { | ||
render: Template, | ||
|
||
args: { | ||
name: 'Light', | ||
}, | ||
}; |
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,20 +1,24 @@ | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import type { Meta, StoryFn, StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
import Boon from './Boon'; | ||
|
||
export default { | ||
const meta: Meta<typeof Boon> = { | ||
title: 'Components/Boon', | ||
component: Boon, | ||
argTypes: { | ||
className: { control: false }, | ||
}, | ||
} as ComponentMeta<typeof Boon>; | ||
}; | ||
export default meta; | ||
|
||
const Template: ComponentStory<typeof Boon> = (args) => { | ||
const Template: StoryFn<typeof Boon> = (args) => { | ||
return <Boon {...args} />; | ||
}; | ||
|
||
export const BoonMight = Template.bind({}); | ||
BoonMight.args = { | ||
name: 'Might', | ||
export const BoonMight: StoryObj<typeof Boon> = { | ||
render: Template, | ||
|
||
args: { | ||
name: 'Might', | ||
}, | ||
}; |
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,20 +1,24 @@ | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import type { Meta, StoryFn, StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
import Coin from './Coin'; | ||
|
||
export default { | ||
const meta: Meta<typeof Coin> = { | ||
title: 'Components/Coin', | ||
component: Coin, | ||
argTypes: { | ||
className: { control: false }, | ||
}, | ||
} as ComponentMeta<typeof Coin>; | ||
}; | ||
export default meta; | ||
|
||
const Template: ComponentStory<typeof Coin> = (args) => { | ||
const Template: StoryFn<typeof Coin> = (args) => { | ||
return <Coin {...args} />; | ||
}; | ||
|
||
export const CoinMight = Template.bind({}); | ||
CoinMight.args = { | ||
value: 1234123, | ||
export const CoinMight: StoryObj<typeof Coin> = { | ||
render: Template, | ||
|
||
args: { | ||
value: 1234123, | ||
}, | ||
}; |
18 changes: 11 additions & 7 deletions
18
gw2-ui/src/components/CommonEffect/CommonEffect.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
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,20 +1,24 @@ | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import type { Meta, StoryFn, StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
import Condition from './Condition'; | ||
|
||
export default { | ||
const meta: Meta<typeof Condition> = { | ||
title: 'Components/Condition', | ||
component: Condition, | ||
argTypes: { | ||
className: { control: false }, | ||
}, | ||
} as ComponentMeta<typeof Condition>; | ||
}; | ||
export default meta; | ||
|
||
const Template: ComponentStory<typeof Condition> = (args) => { | ||
const Template: StoryFn<typeof Condition> = (args) => { | ||
return <Condition {...args} />; | ||
}; | ||
|
||
export const Bleed = Template.bind({}); | ||
Bleed.args = { | ||
name: 'Bleeding', | ||
export const Bleed: StoryObj<typeof Condition> = { | ||
render: Template, | ||
|
||
args: { | ||
name: 'Bleeding', | ||
}, | ||
}; |
18 changes: 11 additions & 7 deletions
18
gw2-ui/src/components/ConsumableEffect/ConsumableEffect.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,20 +1,24 @@ | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import type { Meta, StoryFn, StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
import ConsumableEffect from './ConsumableEffect'; | ||
|
||
export default { | ||
const meta: Meta<typeof ConsumableEffect> = { | ||
title: 'Components/ConsumableEffect', | ||
component: ConsumableEffect, | ||
argTypes: { | ||
className: { control: false }, | ||
}, | ||
} as ComponentMeta<typeof ConsumableEffect>; | ||
}; | ||
export default meta; | ||
|
||
const Template: ComponentStory<typeof ConsumableEffect> = (args) => { | ||
const Template: StoryFn<typeof ConsumableEffect> = (args) => { | ||
return <ConsumableEffect {...args} />; | ||
}; | ||
|
||
export const Simple = Template.bind({}); | ||
Simple.args = { | ||
name: 'Enhancement', | ||
export const Simple: StoryObj<typeof ConsumableEffect> = { | ||
render: Template, | ||
|
||
args: { | ||
name: 'Enhancement', | ||
}, | ||
}; |
18 changes: 11 additions & 7 deletions
18
gw2-ui/src/components/ControlEffect/ControlEffect.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
Oops, something went wrong.