-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactorization for update Storybook guidelines
- Loading branch information
prototypa
committed
May 12, 2022
1 parent
dc443b5
commit 65b04f3
Showing
29 changed files
with
664 additions
and
320 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
module.exports = { | ||
stories: [ | ||
"../stories/*.stories.(js|mdx)", | ||
"../stories/docs/*.stories.(js|mdx)", | ||
"../stories/components/*.stories.(js|mdx)", | ||
"../stories/addons/*.stories.(js|mdx)", | ||
], | ||
addons: [ | ||
__dirname + "/../../register", | ||
"../../preset.js", | ||
|
||
"@storybook/addon-storysource", | ||
"@storybook/addon-links", | ||
|
||
"@storybook/addon-viewport", | ||
{ | ||
name: "@storybook/addon-docs", | ||
options: { | ||
sourceLoaderOptions: { | ||
injectStoryParameters: false, | ||
}, | ||
}, | ||
}, | ||
"@storybook/addon-controls", | ||
"@storybook/addon-backgrounds", | ||
], | ||
features: { | ||
postcss: false, | ||
}, | ||
} | ||
}; |
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,13 +1,24 @@ | ||
import { addDecorator, addParameters } from '@storybook/react'; | ||
import { withAmpDecorator } from '../../dist'; | ||
const customStyles = ''; | ||
|
||
const customStyles = ''; // some styles | ||
|
||
addDecorator(withAmpDecorator) | ||
|
||
addParameters({ | ||
export const parameters = { | ||
amp: { | ||
isEnabled: true, | ||
styles: customStyles, // Custom styles from some string | ||
styles: customStyles, | ||
}, | ||
|
||
viewport: { | ||
defaultViewport: 'mobile1', | ||
}, | ||
previewTabs: { | ||
'storybook/docs/panel': { | ||
hidden: true, | ||
}, | ||
}, | ||
controls: { | ||
disabled: true | ||
}, | ||
options: { | ||
isToolshown: true, | ||
showPanel: true, | ||
}, | ||
}); | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,35 @@ | ||
import React from "react"; | ||
|
||
export default { | ||
title: "Tested Addons/Controls", | ||
parameters: { | ||
controls: { | ||
disabled: false, | ||
}, | ||
amp: { | ||
scripts: ` | ||
<script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script> | ||
`, | ||
}, | ||
}, | ||
argTypes: { | ||
videoId: { | ||
control: "select", | ||
options: ["lBTCB7yLs8Y", "9Cfxm7cikMY", "f02mOEt11OQ"], | ||
}, | ||
}, | ||
}; | ||
|
||
export const Base = ({ videoId, ...args }) => ( | ||
<amp-youtube | ||
width="480" | ||
height="270" | ||
layout="responsive" | ||
data-videoid={videoId} | ||
></amp-youtube> | ||
); | ||
|
||
Base.storyName = "Controls"; | ||
Base.args = { | ||
videoId: "lBTCB7yLs8Y", | ||
}; |
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,26 @@ | ||
import React from 'react'; | ||
|
||
export default { | ||
title: 'Tested Addons/Viewport', | ||
parameters: { | ||
viewport: { | ||
defaultViewport: 'tablet', | ||
}, | ||
amp: { | ||
scripts: ` | ||
<script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script> | ||
`, | ||
}, | ||
} | ||
}; | ||
|
||
export const Base = (args) => ( | ||
<amp-youtube | ||
width="480" | ||
height="270" | ||
layout="responsive" | ||
data-videoid='lBTCB7yLs8Y' | ||
></amp-youtube> | ||
); | ||
|
||
Base.storyName = 'Viewport'; |
This file was deleted.
Oops, something went wrong.
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
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 React from "react"; | ||
|
||
export default { | ||
title: "Components/amp-autocomplete", | ||
parameters: { | ||
amp: { | ||
scripts: ` | ||
<script async custom-element="amp-autocomplete" src="https://cdn.ampproject.org/v0/amp-autocomplete-0.1.js"></script> | ||
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script> | ||
<script async custom-element="amp-bind" src="https://cdn.ampproject.org/v0/amp-bind-0.1.js"></script> | ||
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script> | ||
`, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Base = () => ( | ||
<form | ||
className="sample-form" | ||
method="post" | ||
action-xhr="https://amp.dev/documentation/examples/api/echo" | ||
target="_top" | ||
> | ||
<amp-autocomplete filter="substring"> | ||
<input /> | ||
<script | ||
type="application/json" | ||
dangerouslySetInnerHTML={{ | ||
__html: JSON.stringify({ | ||
items: ["apple", "orange", "banana"], | ||
}), | ||
}} | ||
/> | ||
</amp-autocomplete> | ||
</form> | ||
); | ||
|
||
Base.storyName = "amp-autocomplete"; |
Oops, something went wrong.