-
Notifications
You must be signed in to change notification settings - Fork 26
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2152c56
feat: add SpaceFinder to StoryBook
travis fa9b339
fix: linter
travis 854612b
Merge branch 'main' into storybook-components
travis c67e20c
fix: playwright install before test run
travis 20ec2f3
fix: add SpaceFinder CSS to w3console
travis bf4d24c
feat: port uploads list styles from tailwind to plain CSS
travis d269c37
fix: use dark backgroudns by default
travis f98c37a
feat: add Authenticator to StoryBook
travis 27ff5d6
feat: extract SpaceCreator to its own component
travis cbbde34
Merge branch 'main' into storybook-components
travis 72d128b
fix: linter-galactic
travis 06bf422
fix: updates from PR review from @olizilla
travis ae4a1ef
fix: linter
travis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
<script> | ||
window.global = window; | ||
</script> | ||
</script> | ||
<style> | ||
html { | ||
/* _no one wants to see times new roman_ - @olizilla */ | ||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; | ||
} | ||
</style> |
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 |
---|---|---|
|
@@ -6,4 +6,7 @@ export const parameters = { | |
date: /Date$/, | ||
}, | ||
}, | ||
backgrounds: { | ||
default: 'dark' | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
examples/react/playground/src/stories/AuthenticationSubmitted.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { AuthenticationSubmitted } from '@w3ui/react' | ||
import '@w3ui/react/src/styles/authenticator.css' | ||
|
||
export default { | ||
title: 'w3ui/Authenticator', | ||
component: AuthenticationSubmitted, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
} | ||
} | ||
|
||
export const Submitted = { | ||
args: { | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
examples/react/playground/src/stories/Authenticator.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Authenticator } from '@w3ui/react' | ||
import '@w3ui/react/src/styles/authenticator.css' | ||
|
||
export default { | ||
title: 'w3ui/Authenticator', | ||
component: Authenticator, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
} | ||
} | ||
|
||
export const Primary = { | ||
args: { | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
examples/react/playground/src/stories/SpaceCreator.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { SpaceCreator } from '@w3ui/react' | ||
import '@w3ui/react/src/styles/space-creator.css' | ||
|
||
export default { | ||
title: 'w3ui/SpaceCreator', | ||
component: SpaceCreator, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
} | ||
} | ||
|
||
export const Primary = { | ||
args: { | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
examples/react/playground/src/stories/SpaceCreatorCreating.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { SpaceCreatorCreating } from '@w3ui/react' | ||
import '@w3ui/react/src/styles/space-creator.css' | ||
|
||
export default { | ||
title: 'w3ui/SpaceCreator', | ||
component: SpaceCreatorCreating, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
} | ||
} | ||
|
||
export const Creating = { | ||
args: { | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
examples/react/playground/src/stories/SpaceFinder.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 |
---|---|---|
@@ -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> | ||
) | ||
] | ||
} |
38 changes: 0 additions & 38 deletions
38
examples/react/playground/src/stories/SpaceList.stories.tsx
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 |
---|---|---|
|
@@ -6,6 +6,9 @@ export default { | |
component: Uploader, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
}, | ||
parameters: { | ||
|
||
} | ||
} | ||
|
||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!