Skip to content

Commit 51aaa1b

Browse files
committed
wip
1 parent f25a58f commit 51aaa1b

File tree

47 files changed

+729
-217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+729
-217
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import * as React from "react";
2+
import type { Story } from "@ladle/react";
3+
import Box from "../src/ui/box";
4+
import ChainListItem from "../src/ui/chain-list-item";
5+
import { ChainListItemProps } from "../src/ui/chain-list-item/chain-list-item.types";
6+
7+
// @ts-ignore
8+
import ATOM_ICON from "../static/networks/Cosmos.png";
9+
10+
const chainItem: Pick<
11+
ChainListItemProps,
12+
"iconUrl" | "name" | "tokenName" | "amount" | "notionalValue"
13+
> = {
14+
iconUrl: ATOM_ICON,
15+
name: "Cosmos",
16+
tokenName: "ATOM",
17+
amount: "0.00000000022",
18+
};
19+
20+
export const DefaultChainListItem: Story<{
21+
width: number;
22+
size: ChainListItemProps["size"];
23+
}> = (props) => (
24+
<Box>
25+
<Box
26+
backgroundColor="$background"
27+
boxShadow="$sm"
28+
p="$4"
29+
borderRadius="$lg"
30+
width={`${props.width}px`}
31+
display="flex"
32+
justifyContent="center"
33+
alignItems="center"
34+
flexDirection="column"
35+
gap="$4"
36+
>
37+
<ChainListItem
38+
size={props.size}
39+
_css={{
40+
width: "100%",
41+
display: "flex",
42+
justifyContent: "flex-start",
43+
alignItems: "center",
44+
}}
45+
{...chainItem}
46+
/>
47+
48+
<ChainListItem
49+
size={props.size}
50+
isDisabled
51+
_css={{
52+
width: "100%",
53+
display: "flex",
54+
justifyContent: "flex-start",
55+
alignItems: "center",
56+
}}
57+
{...chainItem}
58+
/>
59+
60+
<ChainListItem
61+
size={props.size}
62+
isSelected
63+
_css={{
64+
width: "100%",
65+
display: "flex",
66+
justifyContent: "flex-start",
67+
alignItems: "center",
68+
}}
69+
{...chainItem}
70+
/>
71+
72+
<ChainListItem
73+
size={props.size}
74+
isActive
75+
_css={{
76+
width: "100%",
77+
display: "flex",
78+
justifyContent: "flex-start",
79+
alignItems: "center",
80+
}}
81+
{...chainItem}
82+
/>
83+
</Box>
84+
</Box>
85+
);
86+
87+
DefaultChainListItem.meta = {
88+
component: "ListItem",
89+
};
90+
91+
DefaultChainListItem.args = {
92+
size: "sm",
93+
};
94+
95+
DefaultChainListItem.argTypes = {
96+
width: {
97+
control: { type: "number" },
98+
defaultValue: 200,
99+
},
100+
size: {
101+
options: ["sm", "md"] satisfies ChainListItemProps["size"][],
102+
control: { type: "select" },
103+
defaultValue: "md",
104+
},
105+
};

packages/react/showroom/ListItem.show.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ import * as React from "react";
22
import type { Story } from "@ladle/react";
33
import Box from "../src/ui/box";
44
import ListItem from "../src/ui/list-item";
5-
import { ListItemSize } from "../src/ui/list-item/list-item.types";
5+
import {
6+
ListItemSize,
7+
ListItemShape,
8+
} from "../src/ui/list-item/list-item.types";
69

710
export const DefaultListItem: Story<{
811
width: number;
912
size: ListItemSize;
13+
shape: ListItemShape;
1014
}> = (props) => (
1115
<Box>
1216
<Box
@@ -85,6 +89,7 @@ DefaultListItem.meta = {
8589

8690
DefaultListItem.args = {
8791
size: "sm",
92+
shape: "default",
8893
};
8994

9095
DefaultListItem.argTypes = {
@@ -97,4 +102,9 @@ DefaultListItem.argTypes = {
97102
control: { type: "select" },
98103
defaultValue: "md",
99104
},
105+
shape: {
106+
options: ["default", "rounded"] satisfies ListItemShape[],
107+
control: { type: "select" },
108+
defaultValue: "default",
109+
},
100110
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
import * as React from "react";
2+
import type { Story } from "@ladle/react";
3+
import Box from "../src/ui/box";
4+
import WalletConnectorInfo from "../src/ui/wallet-connector/wallet-connector-info";
5+
import WalletConnectorFrame from "../src/ui/wallet-connector/wallet-connector-frame";
6+
import WalletConnectorHead from "../src/ui/wallet-connector/wallet-connector-head";
7+
import WalletConnectorStatus from "../src/ui/wallet-connector/wallet-connector-status";
8+
9+
// @ts-ignore
10+
import KEPLR_ICON from "../static/keplr.png";
11+
12+
export const WalletConnectorInfoDefault: Story<{
13+
address: string;
14+
}> = () => (
15+
<Box>
16+
<WalletConnectorInfo
17+
iconSrc={KEPLR_ICON}
18+
address="cosmos1veawurwraxw4kq30ygdpjn85jjxv67x3remaxu"
19+
/>
20+
</Box>
21+
);
22+
23+
WalletConnectorInfoDefault.storyName = "WalletConnectorInfo";
24+
25+
type WalletConnectorStatusProps = React.ComponentProps<
26+
typeof WalletConnectorStatus
27+
>;
28+
29+
export const WalletConnectorStatusDefault: Story<{
30+
status: WalletConnectorStatusProps["status"];
31+
wallet: WalletConnectorStatusProps["wallet"];
32+
}> = (props) => (
33+
<Box>
34+
<WalletConnectorFrame>
35+
<WalletConnectorHead
36+
hasBackButton={true}
37+
hasCloseButton={true}
38+
title="Keplr"
39+
/>
40+
41+
<WalletConnectorStatus
42+
status={props.status}
43+
wallet={{
44+
name: "Keplr",
45+
prettyName: "Keplr",
46+
logo: KEPLR_ICON,
47+
subLogo: KEPLR_ICON,
48+
btmLogo: KEPLR_ICON,
49+
mobileDisabled: false,
50+
downloadUrl:
51+
"https://chrome.google.com/webstore/detail/keplr/dmkamcknogkgcdfhhbddcghachkejeap",
52+
rejectMessage: "Please install Keplr extension to connect",
53+
originalWallet: {},
54+
badge: "Keplr",
55+
shape: "square",
56+
}}
57+
state={{
58+
Connecting: {
59+
title: "Requesting connection",
60+
description: "Open the Keplr extension to connect",
61+
},
62+
NotExist: {
63+
title: "Keplr not installed",
64+
description:
65+
"Please install the Keplr wallet first and refresh the page to connect your wallet.",
66+
installButtonLabel: "Install Keplr",
67+
popoverAction: {
68+
type: "reload",
69+
label: "Try Again",
70+
onClick: () => {
71+
console.log("Reload");
72+
},
73+
},
74+
},
75+
}}
76+
/>
77+
</WalletConnectorFrame>
78+
</Box>
79+
);
80+
81+
WalletConnectorStatusDefault.storyName = "WalletConnectorStatus";
82+
83+
WalletConnectorStatusDefault.args = {
84+
status: "Connecting",
85+
};
86+
87+
WalletConnectorStatusDefault.argTypes = {
88+
status: {
89+
control: {
90+
type: "select",
91+
},
92+
options: [
93+
"Connecting",
94+
"NotExist",
95+
"Connected",
96+
"Disconnected",
97+
"Error",
98+
"Rejected",
99+
] as WalletConnectorStatusProps["status"][],
100+
defaultValue: "Connecting",
101+
},
102+
};

0 commit comments

Comments
 (0)