-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: Storybook story improvements #294
Changes from 11 commits
2152c56
fa9b339
854612b
c67e20c
20ec2f3
bf4d24c
d269c37
f98c37a
27ff5d6
cbbde34
72d128b
06bf422
ae4a1ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,20 @@ | ||||||
import { AuthenticationSubmitted } from '@w3ui/react' | ||||||
import '@w3ui/react/src/styles/authenticator.css' | ||||||
|
||||||
export default { | ||||||
title: 'w3ui/AuthenticationSubmitted', | ||||||
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. Maybe force this to appear in the same section, and change the export name like
Suggested change
then later in the file export it with a different name to distinguish it from the other one
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. SICK, great idea, this is much nicer |
||||||
component: AuthenticationSubmitted, | ||||||
tags: ['autodocs'], | ||||||
argTypes: { | ||||||
}, | ||||||
parameters: { | ||||||
backgrounds: { | ||||||
default: 'dark' | ||||||
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. this is neat! 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. ooh let's set it in the defaults rather than per story for now 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. while we're noodling with defaults, no one wants to see times new roman lets set at least a nice default font via 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. so real. will do! |
||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
export const Primary = { | ||||||
args: { | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Authenticator } from '@w3ui/react' | ||
import '@w3ui/react/src/styles/authenticator.css' | ||
|
||
export default { | ||
title: 'w3ui/Authenticator', | ||
component: Authenticator, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
}, | ||
parameters: { | ||
backgrounds: { | ||
default: 'dark' | ||
} | ||
} | ||
} | ||
|
||
export const Primary = { | ||
args: { | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { SpaceCreator } from '@w3ui/react' | ||
import '@w3ui/react/src/styles/space-creator.css' | ||
|
||
export default { | ||
title: 'w3ui/SpaceCreator', | ||
component: SpaceCreator, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
}, | ||
parameters: { | ||
backgrounds: { | ||
default: 'dark' | ||
} | ||
} | ||
} | ||
|
||
export const Primary = { | ||
args: { | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,20 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { SpaceCreatorCreating } from '@w3ui/react' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import '@w3ui/react/src/styles/space-creator.css' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export default { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title: 'w3ui/SpaceCreatorCreating', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
component: SpaceCreatorCreating, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tags: ['autodocs'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
argTypes: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
parameters: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
backgrounds: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
default: 'dark' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export const Primary = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
args: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. same here, we can fix up the titles and exports to group states of the same logical components
Suggested change
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. ditto |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react' | ||
import type { DID } from '@ucanto/interface' | ||
import { SpaceFinder } from '@w3ui/react' | ||
import { Space } from '@w3ui/keyring-core' | ||
import '@w3ui/react/src/styles/space-finder.css' | ||
|
||
export default { | ||
title: 'w3ui/SpaceFinder', | ||
component: SpaceFinder, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
setSelected: { action: 'set space' } | ||
} | ||
} | ||
|
||
const spaces = ['did:example:abc123', 'did:example:xyz789', 'did:example:lmn456'].map( | ||
(did: string, i) => new Space(did as DID, { name: `Space ${i}` }) | ||
) | ||
|
||
export const Primary = { | ||
args: { | ||
spaces, | ||
selected: spaces[0] | ||
}, | ||
decorators: [ | ||
(Story) => ( | ||
<div style={{ margin: '3em' }}> | ||
<Story /> | ||
</div> | ||
) | ||
] | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"type": "module", | ||
"scripts": { | ||
"serve": "serve ../../", | ||
"test": "playwright test", | ||
"test": "playwright install && playwright test", | ||
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. This can be reverted now #298 landed |
||
"test:debug": "playwright test --project=chromium --headed" | ||
}, | ||
"author": "olzilla", | ||
|
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.
musing: perhaps we should make the naming consistent here so that we have
ComponentName
andComponentNameStateName
like
SpaceCreator
->SpaceCreatorCreating
or perhaps we should export a "view(s) only" component, that takes a state prop that we can set from a single story per Component, so our docs pages show all the things... tho that would force us to make a component that takes all the needed state and handlers for each of it's states, so perhaps the current pattern is better for now.
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.
yeaaaaa - I'm not totally happy with the naming/structure here either, but similarly uncertain on the best "API design" here - I'll leave it as it is, but am doing a pass getting ready for Adam to come in and do some design work and will keep this in mind as I do, thanks!