-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 #19124 from storybookjs/norbert/sb-577-addon-links
Addon-links: Move stories into addon
- Loading branch information
Showing
31 changed files
with
144 additions
and
196 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import globalThis from 'global'; | ||
import { withLinks } from '@storybook/addon-links'; | ||
|
||
export default { | ||
component: globalThis.Components.Html, | ||
parameters: { | ||
chromatic: { disable: true }, | ||
}, | ||
decorators: [withLinks], | ||
}; | ||
|
||
export const Basic = { | ||
args: { | ||
content: ` | ||
<div> | ||
<a class="link" href="#" data-sb-story="basic">go to basic</a> | ||
</div> | ||
`, | ||
}, | ||
}; | ||
export const Other = { | ||
args: { | ||
content: ` | ||
<div> | ||
<a class="link" href="#" data-sb-story="basic">to to basic</a> | ||
</div> | ||
`, | ||
}, | ||
}; | ||
export const Third = { | ||
args: { | ||
content: ` | ||
<div> | ||
<a class="link" href="#" data-sb-story="other">go to other</a> | ||
</div> | ||
`, | ||
}, | ||
}; |
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,44 @@ | ||
import globalThis from 'global'; | ||
import { linkTo } from '@storybook/addon-links'; | ||
|
||
export default { | ||
component: globalThis.Components.Button, | ||
args: { | ||
children: 'Click Me!', | ||
}, | ||
parameters: { | ||
chromatic: { disable: true }, | ||
}, | ||
}; | ||
|
||
export const ID = { | ||
args: { | ||
onClick: linkTo('addons-links-parameters--basic'), | ||
}, | ||
}; | ||
export const Title = { | ||
args: { | ||
onClick: linkTo('addons-links-parameters'), | ||
}, | ||
}; | ||
export const Basic = { | ||
args: { | ||
onClick: linkTo('addons-links-parameters', 'basic'), | ||
}, | ||
}; | ||
export const Other = { | ||
args: { | ||
onClick: linkTo('addons-links-parameters', 'basic'), | ||
}, | ||
}; | ||
export const Third = { | ||
args: { | ||
onClick: linkTo('addons-links-parameters', 'other'), | ||
}, | ||
}; | ||
|
||
export const Callback = { | ||
args: { | ||
onClick: linkTo('addons-links-parameters', (event: Event) => 'basic'), | ||
}, | ||
}; |
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,41 @@ | ||
import globalThis from 'global'; | ||
import { withLinks } from '@storybook/addon-links'; | ||
|
||
export default { | ||
component: globalThis.Components.Html, | ||
parameters: { | ||
chromatic: { disable: true }, | ||
}, | ||
decorators: [withLinks], | ||
}; | ||
|
||
export const Basic = { | ||
args: { | ||
content: ` | ||
<div> | ||
<div style="marginBottom:100vh"></div> | ||
<a class="link" href="#" data-sb-story="basic">go to basic</a> | ||
</div> | ||
`, | ||
}, | ||
}; | ||
export const Other = { | ||
args: { | ||
content: ` | ||
<div> | ||
<div style="marginBottom:100vh"></div> | ||
<a class="link" href="#" data-sb-story="basic">to to basic</a> | ||
</div> | ||
`, | ||
}, | ||
}; | ||
export const Third = { | ||
args: { | ||
content: ` | ||
<div> | ||
<div style="marginBottom:100vh"></div> | ||
<a class="link" href="#" data-sb-story="other">go to other</a> | ||
</div> | ||
`, | ||
}, | ||
}; |
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 was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
code/examples/angular-cli/src/stories/addons/docs/addon-docs.stories.mdx
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
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,11 +1,10 @@ | ||
import React from 'react'; | ||
import { linkTo } from '@storybook/addon-links'; | ||
import { Welcome } from '../components/react-demo'; | ||
|
||
export default { | ||
title: 'Welcome', | ||
component: Welcome, | ||
}; | ||
|
||
export const Story1 = () => <Welcome showApp={linkTo('Button')} />; | ||
export const Story1 = () => <Welcome showApp={() => {}} />; | ||
Story1.title = 'to Storybook'; |
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
3 changes: 1 addition & 2 deletions
3
code/examples/cra-ts-kitchen-sink/src/stories/0-Welcome.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,12 +1,11 @@ | ||
import React from 'react'; | ||
import { linkTo } from '@storybook/addon-links'; | ||
import { Welcome } from '../components/react-demo'; | ||
|
||
export default { | ||
title: 'Welcome', | ||
component: Welcome, | ||
}; | ||
|
||
export const ToStorybook = () => <Welcome showApp={linkTo('Button')} />; | ||
export const ToStorybook = () => <Welcome showApp={() => {}} />; | ||
|
||
ToStorybook.storyName = 'to Storybook'; |
This file was deleted.
Oops, something went wrong.
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,11 +1,8 @@ | ||
import { withLinks } from '@storybook/addon-links'; | ||
|
||
import './welcome.css'; | ||
import welcome from './welcome.html'; | ||
|
||
export default { | ||
title: 'Welcome', | ||
decorators: [withLinks], | ||
}; | ||
|
||
export const Welcome = () => welcome; |
18 changes: 0 additions & 18 deletions
18
code/examples/official-storybook/stories/addon-links/button.stories.tsx
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
code/examples/official-storybook/stories/addon-links/href.stories.js
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
code/examples/official-storybook/stories/addon-links/link.stories.js
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
code/examples/official-storybook/stories/addon-links/scroll.stories.js
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
code/examples/official-storybook/stories/addon-links/select.stories.js
This file was deleted.
Oops, something went wrong.
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.