-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(explorer): add funcitonality to remove networks (#2401)
- Loading branch information
1 parent
3c881b1
commit e6ffb90
Showing
18 changed files
with
569 additions
and
190 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@kadena/explorer': minor | ||
--- | ||
|
||
add posibility to remove networks |
47 changes: 47 additions & 0 deletions
47
packages/apps/explorer/src/components/CardPattern/CardPattern.css.ts
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,47 @@ | ||
import { atoms, responsiveStyle, token } from '@kadena/kode-ui/styles'; | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
// NOTE: Padding is applied via this container instead of margin to the container to avoid margin collapse with the body | ||
export const paddingContainer = style( | ||
responsiveStyle({ | ||
md: { | ||
paddingBlock: token('size.n32'), | ||
}, | ||
}), | ||
); | ||
|
||
export const container = style([ | ||
atoms({ | ||
borderRadius: 'md', | ||
padding: 'xl', | ||
backgroundColor: 'layer.default', | ||
}), | ||
{ | ||
...responsiveStyle({ | ||
md: { | ||
border: token('border.hairline'), | ||
width: '42rem', | ||
marginInlineStart: '50%', | ||
transform: 'translateX(-50%)', | ||
}, | ||
}), | ||
}, | ||
]); | ||
|
||
export const bodyContent = style([ | ||
{ marginBlockStart: token('spacing.xl'), flex: 1.5 }, | ||
{ | ||
...responsiveStyle({ | ||
md: { | ||
marginBlockStart: token('size.n25'), | ||
}, | ||
}), | ||
selectors: { | ||
"&[data-layout='no-visual']": responsiveStyle({ | ||
md: { | ||
marginBlockStart: token('size.n10'), | ||
}, | ||
}), | ||
}, | ||
}, | ||
]); |
88 changes: 88 additions & 0 deletions
88
packages/apps/explorer/src/components/CardPattern/CardPattern.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,88 @@ | ||
import { SpireKeyKdacolorLogoGreen } from '@kadena/kode-icons/product'; | ||
import { Box, Heading, Stack, Text } from '@kadena/kode-ui'; | ||
import { atoms, token } from '@kadena/kode-ui/styles'; | ||
import React from 'react'; | ||
import { bodyContent, container, paddingContainer } from './CardPattern.css'; | ||
|
||
export const CardContainer = ({ children }: { children: React.ReactNode }) => { | ||
// TODO: replace with card component when it accepts className | ||
return ( | ||
<div className={paddingContainer}> | ||
<div className={container}>{children}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
interface CardContentBlockProps { | ||
title: string; | ||
visual?: React.ReactNode; | ||
description?: string; | ||
children: React.ReactNode; | ||
} | ||
|
||
export const CardContentBlock = ({ | ||
title, | ||
visual, | ||
description, | ||
children, | ||
}: CardContentBlockProps) => { | ||
return ( | ||
<Stack flexDirection={{ xs: 'column', md: 'row' }} gap="md"> | ||
<Stack flexDirection="column" alignItems="flex-start" flex={1}> | ||
<Box>{visual}</Box> | ||
{title && ( | ||
<Heading | ||
className={atoms({ | ||
marginBlockStart: 'sm', | ||
marginBlockEnd: 'md', | ||
})} | ||
> | ||
{title} | ||
</Heading> | ||
)} | ||
{description && <Text as="p">{description}</Text>} | ||
</Stack> | ||
<Stack | ||
flexDirection="column" | ||
className={bodyContent} | ||
data-layout={!visual && 'no-visual'} | ||
> | ||
{children} | ||
</Stack> | ||
</Stack> | ||
); | ||
}; | ||
|
||
interface CardFooterProps { | ||
children: React.ReactNode; | ||
separated?: boolean; | ||
} | ||
|
||
export const CardFooter = ({ | ||
children, | ||
separated = false, | ||
}: CardFooterProps) => { | ||
return ( | ||
<Stack | ||
marginBlockStart="xxl" | ||
gap="md" | ||
justifyContent={separated ? 'space-between' : 'flex-end'} | ||
> | ||
{children} | ||
</Stack> | ||
); | ||
}; | ||
|
||
export const SpireKeyCardContentBlock = ( | ||
props: Omit<CardContentBlockProps, 'visual'>, | ||
) => ( | ||
<CardContentBlock | ||
{...props} | ||
visual={ | ||
<SpireKeyKdacolorLogoGreen | ||
aria-label="SpireKey" | ||
fontSize={token('typography.fontSize.9xl')} | ||
/> | ||
} | ||
/> | ||
); |
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.