forked from storybookjs/storybook
-
Notifications
You must be signed in to change notification settings - Fork 0
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
d77bbcf
commit 95c4c7d
Showing
5 changed files
with
41 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export function withStorySource(source: string, locationsMap = {}) { | ||
// eslint-disable-next-line no-console | ||
console.error( | ||
'@storybook/addon-storysource/withStorySource is deprecated, please use paramaters instead.' | ||
); | ||
|
||
return (storyFn: (context: any) => React.ReactNode, context: any) => { | ||
return storyFn(context); | ||
}; | ||
} |
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 @@ | ||
<button>Hello world</button> |
24 changes: 24 additions & 0 deletions
24
examples/html-kitchen-sink/stories/source-loader.stories.js
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,24 @@ | ||
import button from './button.html'; | ||
|
||
export default { | ||
title: 'Addons/Source loader', | ||
}; | ||
|
||
export const Button = () => button; | ||
Button.story = { | ||
parameters: { | ||
storySource: { | ||
source: button, | ||
}, | ||
}, | ||
}; | ||
|
||
export const SimpleStory = () => | ||
`<p> | ||
<strong> | ||
This is a fragment of HTML | ||
</strong> | ||
</p>`; | ||
SimpleStory.story = { | ||
name: 'Very simple story', | ||
}; |