-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78f7b99
commit 60e37e5
Showing
11 changed files
with
226 additions
and
39 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
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
24 changes: 0 additions & 24 deletions
24
src/app/pages/view-secret-key/components/view-secret-key.content.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
|
||
import * as AccessibleIconPrimitive from '@radix-ui/react-accessible-icon'; | ||
|
||
type Props = AccessibleIconPrimitive.AccessibleIconProps; | ||
|
||
export default function AccessibleIcon(props: Props): React.ReactElement { | ||
return <AccessibleIconPrimitive.Root {...props} />; | ||
} |
31 changes: 31 additions & 0 deletions
31
src/app/ui/components/layout/card/account/account.card.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,31 @@ | ||
import type { Meta } from '@storybook/react'; | ||
import { Flex } from 'leather-styles/jsx'; | ||
|
||
import { ArrowDownIcon } from '@app/ui/components/icons/arrow-down-icon'; | ||
import { ArrowUpIcon } from '@app/ui/components/icons/arrow-up-icon'; | ||
import { PlusIcon } from '@app/ui/components/icons/plus-icon'; | ||
import { SwapIcon } from '@app/ui/components/icons/swap-icon'; | ||
import { ActionButton } from '@app/ui/components/layout/card/account/action-button'; | ||
|
||
import { AccountCard as Component } from './account.card'; | ||
|
||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
tags: ['autodocs'], | ||
title: 'Design System/Layout/AccountCard', | ||
}; | ||
|
||
export default meta; | ||
|
||
export function AccountCard() { | ||
return ( | ||
<Component name="leather.btc" balance="$1,000" onClickTrigger={() => null}> | ||
<Flex justify="space-between"> | ||
<ActionButton icon={<ArrowUpIcon />} label="Send" /> | ||
<ActionButton icon={<ArrowDownIcon />} label="Receive" /> | ||
<ActionButton icon={<PlusIcon />} label="Buy" /> | ||
<ActionButton icon={<SwapIcon />} label="Swap" /> | ||
</Flex> | ||
</Component> | ||
); | ||
} |
58 changes: 58 additions & 0 deletions
58
src/app/ui/components/layout/card/account/account.card.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,58 @@ | ||
import type { ReactNode } from 'react'; | ||
|
||
import { SettingsSelectors } from '@tests/selectors/settings.selectors'; | ||
import { Box, Divider, Flex, styled } from 'leather-styles/jsx'; | ||
|
||
import { ChevronDownIcon } from '@app/ui/components/icons/chevron-down-icon'; | ||
import { Link } from '@app/ui/components/link/link'; | ||
|
||
interface AccountCardProps { | ||
name: string; | ||
balance: string; | ||
children: ReactNode; | ||
onClickTrigger(): void; | ||
} | ||
|
||
export function AccountCard({ name, balance, children, onClickTrigger }: AccountCardProps) { | ||
return ( | ||
<Flex | ||
direction="column" | ||
bgColor={{ base: 'ink.2', sm: 'unset' }} | ||
rounded="sm" | ||
px={{ base: 'space.05', sm: '0' }} | ||
pt={{ base: 'space.05', sm: 'space.06' }} | ||
pb={{ base: 'space.02', sm: 'space.06' }} | ||
> | ||
<Link | ||
_before={{ bg: 'transparent' }} | ||
_hover={{ color: 'accent.action-primary-hover' }} | ||
data-testid={SettingsSelectors.SwitchAccountTrigger} | ||
onClick={onClickTrigger} | ||
> | ||
<Flex> | ||
<styled.p data-testid={SettingsSelectors.CurrentAccountDisplayName} textStyle="label.01"> | ||
{name} | ||
</styled.p> | ||
<Box mt="space.01" ml="space.02"> | ||
<ChevronDownIcon /> | ||
</Box> | ||
</Flex> | ||
</Link> | ||
<Flex flexDir={{ base: 'column', md: 'row' }} justify="space-between" alignItems="center"> | ||
<styled.h1 textStyle="heading.02" mb="space.05" mt="space.04"> | ||
{balance} | ||
</styled.h1> | ||
<Divider | ||
position="relative" | ||
color="accent.border-default" | ||
right="space.05" | ||
width="calc(100% + 48px)" | ||
mb="space.02" | ||
hideFrom="sm" | ||
/> | ||
|
||
{children} | ||
</Flex> | ||
</Flex> | ||
); | ||
} |
24 changes: 24 additions & 0 deletions
24
src/app/ui/components/layout/card/account/action-button.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,24 @@ | ||
import { Box, Flex, styled } from 'leather-styles/jsx'; | ||
|
||
import { Button } from '@app/ui/components/button/button'; | ||
import AccessibleIcon from '@app/ui/components/icons/accessible-icon'; | ||
|
||
interface ActionButtonProps extends React.ComponentProps<typeof Button> { | ||
icon: React.ReactNode; | ||
label: string; | ||
} | ||
|
||
export function ActionButton({ icon, label, ...rest }: ActionButtonProps) { | ||
return ( | ||
<Button variant="ghost" key={label} width={['1/4', '', 'unset']} textStyle="label.03" {...rest}> | ||
<Flex gap="space.02" direction="column" align="center"> | ||
<AccessibleIcon label={label}> | ||
<Box height="16px" width="16px"> | ||
{icon} | ||
</Box> | ||
</AccessibleIcon> | ||
<styled.span px="space.02">{label}</styled.span> | ||
</Flex> | ||
</Button> | ||
); | ||
} |
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,57 @@ | ||
import type { Meta } from '@storybook/react'; | ||
import { Box, Flex, Stack } from 'leather-styles/jsx'; | ||
|
||
import { RouteUrls } from '@shared/route-urls'; | ||
|
||
import { ArrowDownIcon } from '@app/ui/components/icons/arrow-down-icon'; | ||
import { ArrowUpIcon } from '@app/ui/components/icons/arrow-up-icon'; | ||
import { PlusIcon } from '@app/ui/components/icons/plus-icon'; | ||
import { SwapIcon } from '@app/ui/components/icons/swap-icon'; | ||
import { ActionButton } from '@app/ui/components/layout/card/account/action-button'; | ||
import { Tabs } from '@app/ui/components/tabs/tabs'; | ||
|
||
import { HomeLayout as Component } from './home.layout'; | ||
|
||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
tags: ['autodocs'], | ||
title: 'Design System/Pages/Home', | ||
}; | ||
|
||
export default meta; | ||
|
||
export function HomeLayout() { | ||
return ( | ||
<Component | ||
name="leather.btc" | ||
balance="$1,000" | ||
onClickTrigger={() => null} | ||
accountActions={ | ||
// TODO don't repeat this, compose story | ||
<Flex justify="space-between"> | ||
<ActionButton icon={<ArrowUpIcon />} label="Send" /> | ||
<ActionButton icon={<ArrowDownIcon />} label="Receive" /> | ||
<ActionButton icon={<PlusIcon />} label="Buy" /> | ||
<ActionButton icon={<SwapIcon />} label="Swap" /> | ||
</Flex> | ||
} | ||
> | ||
<Stack flexGrow={1} mt="space.05" gap="space.06"> | ||
<Tabs.Root> | ||
<Tabs.List> | ||
<Tabs.Trigger data-testid="tab-assets" value={RouteUrls.Home}> | ||
Assets | ||
</Tabs.Trigger> | ||
<Tabs.Trigger | ||
data-testid="tab-activity" | ||
value={`${RouteUrls.Home}${RouteUrls.Activity}`} | ||
> | ||
Activity | ||
</Tabs.Trigger> | ||
</Tabs.List> | ||
</Tabs.Root> | ||
<Box width="100%" height="400px" backgroundColor="lightModeRed.300" /> | ||
</Stack> | ||
</Component> | ||
); | ||
} |
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
20 changes: 20 additions & 0 deletions
20
src/app/ui/components/layout/page/two-column.layout.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,20 @@ | ||
import type { Meta } from '@storybook/react'; | ||
import { Box } from 'leather-styles/jsx'; | ||
|
||
import { TwoColumnLayout as Component } from './two-column.layout'; | ||
|
||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
tags: ['autodocs'], | ||
title: 'Design System/Layout/TwoColumnLayout', | ||
}; | ||
|
||
export default meta; | ||
|
||
export function TwoColumnLayout() { | ||
return ( | ||
<Component title={<>Hello world</>} content={<p>lorem ipsum </p>} action={<>some action</>}> | ||
<Box width="100%" height="600px" backgroundColor="lightModeRed.300" /> | ||
</Component> | ||
); | ||
} |