-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Storybook story improvements (#294)
1) Add SpaceFinder to Storybook ![SpaceFinder](https://user-images.githubusercontent.com/1113/214763164-4a58544d-19f9-47ba-9d33-c0ef7339dcd9.gif) 2) Add Authenticator to Storybook ![Authenticator](https://user-images.githubusercontent.com/1113/214966004-1a4eabf9-7cd3-47b0-8532-fe2c8f6e91f0.gif) 3) Break Tailwind classes in SpaceFinder, Authenticator and UploadsList down to their raw CSS so that the components work and look good in Storybook. ![UploadsList](https://user-images.githubusercontent.com/1113/214961123-e2083359-227a-466d-9d21-8a1b017e8643.gif) 4) Extract SpaceCreator to a new component ![SpaceCreator](https://user-images.githubusercontent.com/1113/214977038-f32c27e1-e280-44ce-af89-2d859237aab0.gif)
- Loading branch information
Showing
24 changed files
with
554 additions
and
250 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
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.