-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move @automattic/components
' Storybook to the root Storybook
#76007
Changes from 10 commits
11becfe
71c711c
a770e49
49c5855
3a6df83
6e1f6d8
12efc6c
e4dfae6
284f0a4
b5b66da
015190c
6346462
722e121
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
import { useRef } from 'react'; | ||
import UplotChart from '../'; | ||
|
||
export default { title: 'Chart (uPlot)' }; | ||
export default { title: 'packages/@automattic/components/Chart (uPlot)' }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very minor feedback since naming can be easily adjusted whenever: I think I think I'd prefer sticking with |
||
|
||
const SAMPLE_DATA = [ | ||
[ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Story, Meta } from '@storybook/react'; | ||
import { ComponentProps } from 'react'; | ||
import ThemeCard from './index'; | ||
|
||
export default { | ||
title: 'packages/@automattic/design-picker/ThemeCard', | ||
component: ThemeCard, | ||
parameters: { | ||
viewport: { | ||
defaultViewport: 'SMALL', | ||
}, | ||
}, | ||
} as Meta; | ||
|
||
type ThemeCardStory = Story< ComponentProps< typeof ThemeCard > >; | ||
const Template: ThemeCardStory = ( args ) => <ThemeCard { ...args } />; | ||
|
||
const Image = () => ( | ||
<img | ||
alt="Stewart is a modern blogging theme with a left sidebar. Its default color scheme is a striking combination of orange and light gray, to give your blog a sophisticated appearance from day one." | ||
src="https://i0.wp.com/s2.wp.com/wp-content/themes/pub/stewart/screenshot.png" | ||
></img> | ||
); | ||
const defaultArgs = { | ||
name: 'Stewart', | ||
image: <Image></Image>, | ||
}; | ||
|
||
export const NotActive: ThemeCardStory = Template.bind( {} ); | ||
NotActive.args = { | ||
...defaultArgs, | ||
}; | ||
|
||
export const Active: ThemeCardStory = Template.bind( {} ); | ||
Active.args = { | ||
...defaultArgs, | ||
isActive: true, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep in mind the READMEs and documentation that we need to update:
https://github.com/Automattic/wp-calypso/blob/trunk/packages/components/README.md#L44
Ideally, we should add a more central section that leads to the central Storybook instance, somewhere in
/docs
for example incomponents.md
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing this out, I updated the code about the existing command in this PR. 722e121
And I agree that we must update the document, such as https://github.com/Automattic/wp-calypso/blob/trunk/docs/components.md and https://github.com/Automattic/wp-calypso/blob/trunk/docs/component-libraries.md.