-
Notifications
You must be signed in to change notification settings - Fork 16
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
web/ui #1342
Merged
Merged
web/ui #1342
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
226c29b
ui package imports
TalDerei 9a3308b
fix(ui): move penumbra packages to dev dependencies
VanishMax 4ba9954
fix(ui): don't export components directory from UI
VanishMax cfe8035
feat(ui): #1336: start separating ui components
VanishMax 912054c
feat(ui): #1336: Put all components in directories
VanishMax c0f849a
fix(ui): linting and tests
VanishMax 26b4fe1
chore: add changesets
VanishMax c4eee52
fix: put the repo/ui package name back
VanishMax 27b3269
Merge branch 'main' into ui-package
VanishMax e9f30c5
fix: after the merge
VanishMax 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@penumbra-zone/ui': major | ||
'node-status': patch | ||
'minifront': patch | ||
--- | ||
|
||
UI: refactor the package to provide better and more clear exports. Includes a readme with setting up the UI package and more storybook stories. |
2 changes: 1 addition & 1 deletion
2
apps/minifront/src/components/dashboard/assets-table/equivalent-values.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
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
4 changes: 2 additions & 2 deletions
4
apps/minifront/src/components/shared/selectors/asset-selector.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
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
2 changes: 1 addition & 1 deletion
2
apps/minifront/src/components/staking/account/delegation-value-view/index.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
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
2 changes: 1 addition & 1 deletion
2
apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.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
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
2 changes: 1 addition & 1 deletion
2
...i/components/ui/account-switcher.test.tsx → ...ccount-switcher/account-switcher.test.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
6 changes: 3 additions & 3 deletions
6
...ges/ui/components/ui/account-switcher.tsx → .../components/ui/account-switcher/index.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
63 changes: 63 additions & 0 deletions
63
packages/ui/components/ui/address-view/address-view.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,63 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { AddressViewComponent } from '.'; | ||
import { | ||
Address, | ||
AddressIndex, | ||
AddressView, | ||
AddressView_Decoded, | ||
} from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; | ||
import { addressFromBech32m } from '@penumbra-zone/bech32m/penumbra'; | ||
|
||
const meta: Meta<typeof AddressViewComponent> = { | ||
component: AddressViewComponent, | ||
title: 'AddressViewComponent', | ||
tags: ['autodocs'], | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof AddressViewComponent>; | ||
|
||
const EXAMPLE_VIEW = new AddressView({ | ||
addressView: { | ||
case: 'decoded', | ||
|
||
value: new AddressView_Decoded({ | ||
address: new Address({ inner: new Uint8Array(80) }), | ||
index: new AddressIndex({ | ||
account: 0, | ||
randomizer: new Uint8Array([0, 0, 0]), | ||
}), | ||
}), | ||
}, | ||
}); | ||
|
||
const EXAMPLE_VIEW_OPAQUE = new AddressView({ | ||
addressView: { | ||
case: 'opaque', | ||
value: { | ||
address: addressFromBech32m( | ||
'penumbra1e8k5cyds484dxvapeamwveh5khqv4jsvyvaf5wwxaaccgfghm229qw03pcar3ryy8smptevstycch0qk3uu0rgkvtjpxy3cu3rjd0agawqtlz6erev28a6sg69u7cxy0t02nd4', | ||
), | ||
}, | ||
}, | ||
}); | ||
|
||
export const Decoded: Story = { | ||
args: { | ||
view: EXAMPLE_VIEW, | ||
}, | ||
}; | ||
|
||
export const Copiable: Story = { | ||
args: { | ||
view: EXAMPLE_VIEW, | ||
copyable: true, | ||
}, | ||
}; | ||
|
||
export const Opaque: Story = { | ||
args: { | ||
view: EXAMPLE_VIEW_OPAQUE, | ||
}, | ||
}; |
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
6 changes: 3 additions & 3 deletions
6
...ui/components/ui/tx/view/address-view.tsx → ...s/ui/components/ui/address-view/index.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
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...es/ui/components/ui/address-component.tsx → ...mponents/ui/address/address-component.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
4 changes: 2 additions & 2 deletions
4
packages/ui/components/ui/address-icon.tsx → ...ui/components/ui/address/address-icon.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
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,2 @@ | ||
export { AddressIcon, type AddressIconProps } from './address-icon'; | ||
export { AddressComponent, type AddressComponentProps } from './address-component'; |
44 changes: 44 additions & 0 deletions
44
packages/ui/components/ui/asset-icon/asset-icon.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,44 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { AssetIcon } from '.'; | ||
import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; | ||
|
||
const meta: Meta<typeof AssetIcon> = { | ||
component: AssetIcon, | ||
title: 'AssetIcon', | ||
tags: ['autodocs'], | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof AssetIcon>; | ||
|
||
const EXAMPLE_METADATA = new Metadata({ | ||
base: 'upenumbra', | ||
display: 'penumbra', | ||
symbol: 'UM', | ||
images: [ | ||
{ | ||
svg: 'https://raw.githubusercontent.com/prax-wallet/registry/main/images/um.svg', | ||
}, | ||
], | ||
}); | ||
|
||
export const Small: Story = { | ||
args: { | ||
metadata: EXAMPLE_METADATA, | ||
}, | ||
}; | ||
|
||
export const ExtraSmall: Story = { | ||
args: { | ||
metadata: EXAMPLE_METADATA, | ||
size: 'xs', | ||
}, | ||
}; | ||
|
||
export const Large: Story = { | ||
args: { | ||
metadata: EXAMPLE_METADATA, | ||
size: 'lg', | ||
}, | ||
}; |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...omponents/ui/tx/view/asset-icon/index.tsx → ...ges/ui/components/ui/asset-icon/index.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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ui/components/ui/auction-id-component.tsx → ...ponents/ui/auction-id-component/index.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
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 type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { Avatar, AvatarImage } from '.'; | ||
|
||
const meta: Meta<typeof Avatar> = { | ||
component: Avatar, | ||
title: 'Avatar', | ||
tags: ['autodocs'], | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof Avatar>; | ||
|
||
const EXAMPLE_URL = | ||
'https://images.unsplash.com/photo-1473830394358-91588751b241?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D'; | ||
|
||
export const Full: Story = { | ||
args: {}, | ||
render: args => { | ||
return ( | ||
<Avatar {...args}> | ||
<AvatarImage src={EXAMPLE_URL} /> | ||
</Avatar> | ||
); | ||
}, | ||
}; |
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.
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.
Most of the components (still not all) have their meaningful Storybook stories