Commit 5f663a7f authored by tom's avatar tom

remove color scheme for tags

parent f0fd62a0
import { Tag as ChakraTag } from '@chakra-ui/react'; import { Tag as ChakraTag } from '@chakra-ui/react';
import * as React from 'react'; import * as React from 'react';
import TruncatedTextTooltip from 'ui/shared/TruncatedTextTooltip';
import { Skeleton } from './skeleton';
export interface TagProps extends ChakraTag.RootProps { export interface TagProps extends ChakraTag.RootProps {
startElement?: React.ReactNode; startElement?: React.ReactNode;
endElement?: React.ReactNode; endElement?: React.ReactNode;
onClose?: VoidFunction; onClose?: VoidFunction;
closable?: boolean; closable?: boolean;
truncated?: boolean;
loading?: boolean;
} }
export const Tag = React.forwardRef<HTMLSpanElement, TagProps>( export const Tag = React.forwardRef<HTMLSpanElement, TagProps>(
...@@ -16,15 +22,24 @@ export const Tag = React.forwardRef<HTMLSpanElement, TagProps>( ...@@ -16,15 +22,24 @@ export const Tag = React.forwardRef<HTMLSpanElement, TagProps>(
onClose, onClose,
closable = Boolean(onClose), closable = Boolean(onClose),
children, children,
truncated = false,
loading,
...rest ...rest
} = props; } = props;
const labelElement = truncated ? (
<TruncatedTextTooltip label={ children }>
<ChakraTag.Label>{ children }</ChakraTag.Label>
</TruncatedTextTooltip>
) : <ChakraTag.Label>{ children }</ChakraTag.Label>;
return ( return (
<Skeleton loading={ loading } asChild>
<ChakraTag.Root ref={ ref } { ...rest }> <ChakraTag.Root ref={ ref } { ...rest }>
{ startElement && ( { startElement && (
<ChakraTag.StartElement>{ startElement }</ChakraTag.StartElement> <ChakraTag.StartElement>{ startElement }</ChakraTag.StartElement>
) } ) }
<ChakraTag.Label>{ children }</ChakraTag.Label> { labelElement }
{ endElement && ( { endElement && (
<ChakraTag.EndElement>{ endElement }</ChakraTag.EndElement> <ChakraTag.EndElement>{ endElement }</ChakraTag.EndElement>
) } ) }
...@@ -34,6 +49,7 @@ export const Tag = React.forwardRef<HTMLSpanElement, TagProps>( ...@@ -34,6 +49,7 @@ export const Tag = React.forwardRef<HTMLSpanElement, TagProps>(
</ChakraTag.EndElement> </ChakraTag.EndElement>
) } ) }
</ChakraTag.Root> </ChakraTag.Root>
</Skeleton>
); );
}, },
); );
...@@ -14,6 +14,14 @@ const semanticTokens: ThemingConfig['semanticTokens'] = { ...@@ -14,6 +14,14 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
DEFAULT: { value: { _light: '{colors.blue.600}', _dark: '{colors.blue.300}' } }, DEFAULT: { value: { _light: '{colors.blue.600}', _dark: '{colors.blue.300}' } },
}, },
}, },
subtle: {
fg: {
DEFAULT: { value: { _light: '{colors.blackAlpha.800}', _dark: '{colors.whiteAlpha.800}' } },
},
bg: {
DEFAULT: { value: { _light: '{colors.blackAlpha.200}', _dark: '{colors.whiteAlpha.200}' } },
},
},
dropdown: { dropdown: {
fg: { fg: {
DEFAULT: { value: { _light: '{colors.blackAlpha.800}', _dark: '{colors.whiteAlpha.800}' } }, DEFAULT: { value: { _light: '{colors.blackAlpha.800}', _dark: '{colors.whiteAlpha.800}' } },
...@@ -292,6 +300,17 @@ const semanticTokens: ThemingConfig['semanticTokens'] = { ...@@ -292,6 +300,17 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
fg: { value: { _light: '{colors.cyan.500}', _dark: '{colors.cyan.100}' } }, fg: { value: { _light: '{colors.cyan.500}', _dark: '{colors.cyan.100}' } },
}, },
}, },
tag: {
root: {
subtle: {
bg: { value: { _light: '{colors.gray.100}', _dark: '{colors.gray.800}' } },
fg: { value: { _light: '{colors.blackAlpha.800}', _dark: '{colors.whiteAlpha.800}' } },
},
},
closeTrigger: {
color: { value: { _light: '{colors.gray.400}', _dark: '{colors.gray.500}' } },
},
},
table: { table: {
header: { header: {
bg: { value: { _light: '{colors.blackAlpha.100}', _dark: '{colors.whiteAlpha.200}' } }, bg: { value: { _light: '{colors.blackAlpha.100}', _dark: '{colors.whiteAlpha.200}' } },
......
...@@ -11,6 +11,9 @@ export const recipe = defineSlotRecipe({ ...@@ -11,6 +11,9 @@ export const recipe = defineSlotRecipe({
position: 'relative', position: 'relative',
borderRadius: 'base', borderRadius: 'base',
color: 'alert.fg', color: 'alert.fg',
_loading: {
bgColor: 'unset',
},
}, },
title: { title: {
fontWeight: '600', fontWeight: '600',
...@@ -27,7 +30,6 @@ export const recipe = defineSlotRecipe({ ...@@ -27,7 +30,6 @@ export const recipe = defineSlotRecipe({
height: '5', height: '5',
_icon: { boxSize: 'full' }, _icon: { boxSize: 'full' },
color: 'alert.fg', color: 'alert.fg',
'--layer-bg': 'transparent',
}, },
content: { content: {
display: 'flex', display: 'flex',
...@@ -39,43 +41,55 @@ export const recipe = defineSlotRecipe({ ...@@ -39,43 +41,55 @@ export const recipe = defineSlotRecipe({
status: { status: {
info: { info: {
root: { root: {
bg: 'alert.bg.info', bgColor: 'alert.bg.info',
'--layer-bg': '{colors.alert.bg.info}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'alert.bg.info',
},
color: 'alert.fg', color: 'alert.fg',
}, },
}, },
warning: { warning: {
root: { root: {
bg: 'alert.bg.warning', bgColor: 'alert.bg.warning',
'--layer-bg': '{colors.alert.bg.warning}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'alert.bg.warning',
},
color: 'alert.fg', color: 'alert.fg',
}, },
}, },
warning_table: { warning_table: {
root: { root: {
bg: 'alert.bg.warning_table', bgColor: 'alert.bg.warning_table',
'--layer-bg': '{colors.alert.bg.warning_table}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'alert.bg.warning_table',
},
color: 'alert.fg', color: 'alert.fg',
}, },
}, },
success: { success: {
root: { root: {
bg: 'alert.bg.success', bgColor: 'alert.bg.success',
'--layer-bg': '{colors.alert.bg.success}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'alert.bg.success',
},
color: 'alert.fg', color: 'alert.fg',
}, },
}, },
error: { error: {
root: { root: {
bg: 'alert.bg.error', bgColor: 'alert.bg.error',
'--layer-bg': '{colors.alert.bg.error}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'alert.bg.error',
},
color: 'alert.fg', color: 'alert.fg',
}, },
}, },
neutral: { neutral: {
root: { root: {
bg: 'alert.bg.neutral', bgColor: 'alert.bg.neutral',
'--layer-bg': '{colors.alert.bg.neutral}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'alert.bg.neutral',
},
color: 'alert.fg', color: 'alert.fg',
}, },
}, },
......
...@@ -9,6 +9,10 @@ export const recipe = defineRecipe({ ...@@ -9,6 +9,10 @@ export const recipe = defineRecipe({
fontWeight: '500', fontWeight: '500',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
userSelect: 'none', userSelect: 'none',
_loading: {
borderRadius: 'sm',
bgColor: 'unset',
},
}, },
variants: { variants: {
variant: { variant: {
...@@ -16,58 +20,80 @@ export const recipe = defineRecipe({ ...@@ -16,58 +20,80 @@ export const recipe = defineRecipe({
}, },
colorPalette: { colorPalette: {
gray: { gray: {
bg: 'badge.gray.bg', bgColor: 'badge.gray.bg',
'--layer-bg': '{colors.badge.gray.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.gray.bg',
},
color: 'badge.gray.fg', color: 'badge.gray.fg',
}, },
green: { green: {
bg: 'badge.green.bg', bgColor: 'badge.green.bg',
'--layer-bg': '{colors.badge.green.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.green.bg',
},
color: 'badge.green.fg', color: 'badge.green.fg',
}, },
red: { red: {
bg: 'badge.red.bg', bgColor: 'badge.red.bg',
'--layer-bg': '{colors.badge.red.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.red.bg',
},
color: 'badge.red.fg', color: 'badge.red.fg',
}, },
purple: { purple: {
bg: 'badge.purple.bg', bgColor: 'badge.purple.bg',
'--layer-bg': '{colors.badge.purple.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.purple.bg',
},
color: 'badge.purple.fg', color: 'badge.purple.fg',
}, },
orange: { orange: {
bg: 'badge.orange.bg', bgColor: 'badge.orange.bg',
'--layer-bg': '{colors.badge.orange.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.orange.bg',
},
color: 'badge.orange.fg', color: 'badge.orange.fg',
}, },
blue: { blue: {
bg: 'badge.blue.bg', bgColor: 'badge.blue.bg',
'--layer-bg': '{colors.badge.blue.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.blue.bg',
},
color: 'badge.blue.fg', color: 'badge.blue.fg',
}, },
yellow: { yellow: {
bg: 'badge.yellow.bg', bgColor: 'badge.yellow.bg',
'--layer-bg': '{colors.badge.yellow.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.yellow.bg',
},
color: 'badge.yellow.fg', color: 'badge.yellow.fg',
}, },
teal: { teal: {
bg: 'badge.teal.bg', bgColor: 'badge.teal.bg',
'--layer-bg': '{colors.badge.teal.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.teal.bg',
},
color: 'badge.teal.fg', color: 'badge.teal.fg',
}, },
cyan: { cyan: {
bg: 'badge.cyan.bg', bgColor: 'badge.cyan.bg',
'--layer-bg': '{colors.badge.cyan.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.cyan.bg',
},
color: 'badge.cyan.fg', color: 'badge.cyan.fg',
}, },
purple_alt: { purple_alt: {
bg: 'badge.purple_alt.bg', bgColor: 'badge.purple_alt.bg',
'--layer-bg': '{colors.badge.purple_alt.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.purple_alt.bg',
},
color: 'badge.purple_alt.fg', color: 'badge.purple_alt.fg',
}, },
blue_alt: { blue_alt: {
bg: 'badge.blue_alt.bg', bgColor: 'badge.blue_alt.bg',
'--layer-bg': '{colors.badge.blue_alt.bg}', '&:not([data-loading], [aria-busy=true])': {
bgColor: 'badge.blue_alt.bg',
},
color: 'badge.blue_alt.fg', color: 'badge.blue_alt.fg',
}, },
}, },
......
...@@ -139,6 +139,21 @@ export const recipe = defineRecipe({ ...@@ -139,6 +139,21 @@ export const recipe = defineRecipe({
bg: 'transparent', bg: 'transparent',
}, },
}, },
subtle: {
bg: 'button.subtle.bg',
color: 'button.subtle.fg',
'&:not([data-loading], [aria-busy=true])': {
bg: 'button.subtle.bg',
},
_hover: {
bg: 'button.subtle.bg',
color: 'link.primary.hover',
},
_disabled: {
bg: 'button.subtle.bg',
color: 'button.subtle.fg',
},
},
link: { link: {
bg: 'transparent', bg: 'transparent',
color: 'link.primary', color: 'link.primary',
......
...@@ -17,6 +17,7 @@ import { recipe as spinner } from './spinner.recipe'; ...@@ -17,6 +17,7 @@ import { recipe as spinner } from './spinner.recipe';
import { recipe as switchRecipe } from './switch.recipe'; import { recipe as switchRecipe } from './switch.recipe';
import { recipe as table } from './table.recipe'; import { recipe as table } from './table.recipe';
import { recipe as tabs } from './tabs.recipe'; import { recipe as tabs } from './tabs.recipe';
import { recipe as tag } from './tag.recipe';
import { recipe as textarea } from './textarea.recipe'; import { recipe as textarea } from './textarea.recipe';
import { recipe as toast } from './toast.recipe'; import { recipe as toast } from './toast.recipe';
import { recipe as tooltip } from './tooltip.recipe'; import { recipe as tooltip } from './tooltip.recipe';
...@@ -45,6 +46,7 @@ export const slotRecipes = { ...@@ -45,6 +46,7 @@ export const slotRecipes = {
'switch': switchRecipe, 'switch': switchRecipe,
table, table,
tabs, tabs,
tag,
toast, toast,
tooltip, tooltip,
}; };
...@@ -30,8 +30,6 @@ export const recipe = defineRecipe({ ...@@ -30,8 +30,6 @@ export const recipe = defineRecipe({
}, },
underlaid: { underlaid: {
color: 'link.primary', color: 'link.primary',
// css-var to override bg property on loaded skeleton
'--layer-bg': '{colors.link.underlaid.bg}',
bgColor: 'link.underlaid.bg', bgColor: 'link.underlaid.bg',
px: '8px', px: '8px',
py: '6px', py: '6px',
...@@ -42,7 +40,10 @@ export const recipe = defineRecipe({ ...@@ -42,7 +40,10 @@ export const recipe = defineRecipe({
textDecoration: 'none', textDecoration: 'none',
}, },
_loading: { _loading: {
bgColor: 'transparent', bgColor: 'unset',
},
'&:not([data-loading], [aria-busy=true])': {
bgColor: 'link.underlaid.bg',
}, },
}, },
menu: { menu: {
......
import { defineSlotRecipe } from '@chakra-ui/react';
export const recipe = defineSlotRecipe({
slots: [ 'root', 'label', 'startElement', 'endElement', 'closeTrigger' ],
base: {
root: {
display: 'inline-flex',
alignItems: 'center',
verticalAlign: 'top',
maxWidth: '100%',
userSelect: 'none',
borderRadius: 'sm',
focusVisibleRing: 'outside',
_loading: {
borderRadius: 'sm',
bgColor: 'unset',
},
},
label: {
lineClamp: '1',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
fontWeight: 'medium',
display: 'inline',
},
closeTrigger: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
outline: '0',
borderRadius: 'none',
color: 'tag.closeTrigger.color',
focusVisibleRing: 'inside',
focusRingWidth: '2px',
_hover: {
color: 'link.primary.hover',
},
},
startElement: {
flexShrink: 0,
boxSize: 'var(--tag-element-size)',
ms: 'var(--tag-element-offset)',
'&:has([data-scope=avatar])': {
boxSize: 'var(--tag-avatar-size)',
ms: 'calc(var(--tag-element-offset) * 1.5)',
},
_icon: { boxSize: '100%' },
},
endElement: {
flexShrink: 0,
boxSize: 'var(--tag-element-size)',
me: 'var(--tag-element-offset)',
_icon: { boxSize: '100%' },
'&:has(button)': {
ms: 'calc(var(--tag-element-offset) * -1)',
},
},
},
variants: {
size: {
md: {
root: {
px: '1',
py: '0.5',
minH: '6',
gap: '1',
'--tag-avatar-size': 'spacing.4',
'--tag-element-size': 'spacing.4',
'--tag-element-offset': '-2px',
},
label: {
textStyle: 'sm',
},
},
},
variant: {
subtle: {
root: {
bgColor: 'tag.root.subtle.bg',
color: 'tag.root.subtle.fg',
'&:not([data-loading], [aria-busy=true])': {
bgColor: 'tag.root.subtle.bg',
},
},
},
},
},
defaultVariants: {
size: 'md',
variant: 'subtle',
},
});
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import { route } from 'nextjs-routes'; import { route } from 'nextjs-routes';
import config from 'configs/app'; import config from 'configs/app';
import { Badge } from 'toolkit/chakra/badge';
import { Link } from 'toolkit/chakra/link'; import { Link } from 'toolkit/chakra/link';
import { Tag } from 'toolkit/chakra/tag'; import { Tag } from 'toolkit/chakra/tag';
import { Tooltip } from 'toolkit/chakra/tooltip'; import { Tooltip } from 'toolkit/chakra/tooltip';
...@@ -23,15 +24,11 @@ const BlockCeloEpochTag = ({ blockQuery }: Props) => { ...@@ -23,15 +24,11 @@ const BlockCeloEpochTag = ({ blockQuery }: Props) => {
const epochBlockNumber = celoConfig.isEnabled && celoConfig.L2UpgradeBlock && blockQuery.data.height <= celoConfig.L2UpgradeBlock ? const epochBlockNumber = celoConfig.isEnabled && celoConfig.L2UpgradeBlock && blockQuery.data.height <= celoConfig.L2UpgradeBlock ?
blockQuery.data.celo.epoch_number * celoConfig.BLOCKS_PER_EPOCH : blockQuery.data.celo.epoch_number * celoConfig.BLOCKS_PER_EPOCH :
undefined; undefined;
const tag = (
// TODO @tom2drum revise tag color scheme
<Tag colorScheme={ epochBlockNumber ? 'gray-blue' : 'gray' } >Epoch #{ blockQuery.data.celo.epoch_number }</Tag>
);
const content = epochBlockNumber ? ( const content = epochBlockNumber ? (
<Link href={ route({ pathname: '/block/[height_or_hash]', query: { height_or_hash: String(epochBlockNumber) } }) }> <Link href={ route({ pathname: '/block/[height_or_hash]', query: { height_or_hash: String(epochBlockNumber) } }) }>
{ tag } <Tag>Epoch #{ blockQuery.data.celo.epoch_number }</Tag>
</Link> </Link>
) : tag; ) : <Badge>Epoch #{ blockQuery.data.celo.epoch_number }</Badge>;
return ( return (
<Tooltip <Tooltip
......
...@@ -18,7 +18,6 @@ import { Switch } from 'toolkit/chakra/switch'; ...@@ -18,7 +18,6 @@ import { Switch } from 'toolkit/chakra/switch';
import { TabsContent, TabsList, TabsRoot, TabsTrigger } from 'toolkit/chakra/tabs'; import { TabsContent, TabsList, TabsRoot, TabsTrigger } from 'toolkit/chakra/tabs';
import { Textarea } from 'toolkit/chakra/textarea'; import { Textarea } from 'toolkit/chakra/textarea';
import { toaster } from 'toolkit/chakra/toaster'; import { toaster } from 'toolkit/chakra/toaster';
import { Tooltip } from 'toolkit/chakra/tooltip';
import ContentLoader from 'ui/shared/ContentLoader'; import ContentLoader from 'ui/shared/ContentLoader';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import PageTitle from 'ui/shared/Page/PageTitle'; import PageTitle from 'ui/shared/Page/PageTitle';
...@@ -28,6 +27,7 @@ import ButtonShowcase from 'ui/showcases/Button'; ...@@ -28,6 +27,7 @@ import ButtonShowcase from 'ui/showcases/Button';
import LinksShowcase from 'ui/showcases/Links'; import LinksShowcase from 'ui/showcases/Links';
import PaginationShowcase from 'ui/showcases/Pagination'; import PaginationShowcase from 'ui/showcases/Pagination';
import TabsShowcase from 'ui/showcases/Tabs'; import TabsShowcase from 'ui/showcases/Tabs';
import TagsShowcase from 'ui/showcases/Tags';
import TooltipsShowcase from 'ui/showcases/Tooltip'; import TooltipsShowcase from 'ui/showcases/Tooltip';
const TEXT = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'; const TEXT = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
...@@ -59,6 +59,7 @@ const ChakraShowcases = () => { ...@@ -59,6 +59,7 @@ const ChakraShowcases = () => {
<TabsTrigger value="links">Links</TabsTrigger> <TabsTrigger value="links">Links</TabsTrigger>
<TabsTrigger value="pagination">Pagination</TabsTrigger> <TabsTrigger value="pagination">Pagination</TabsTrigger>
<TabsTrigger value="tabs">Tabs</TabsTrigger> <TabsTrigger value="tabs">Tabs</TabsTrigger>
<TabsTrigger value="tags">Tags</TabsTrigger>
<TabsTrigger value="tooltips">Tooltips</TabsTrigger> <TabsTrigger value="tooltips">Tooltips</TabsTrigger>
<TabsTrigger value="unsorted">Unsorted</TabsTrigger> <TabsTrigger value="unsorted">Unsorted</TabsTrigger>
</TabsList> </TabsList>
...@@ -69,6 +70,7 @@ const ChakraShowcases = () => { ...@@ -69,6 +70,7 @@ const ChakraShowcases = () => {
<TabsShowcase/> <TabsShowcase/>
<PaginationShowcase/> <PaginationShowcase/>
<TooltipsShowcase/> <TooltipsShowcase/>
<TagsShowcase/>
<TabsContent value="unsorted"> <TabsContent value="unsorted">
<VStack align="flex-start" gap={ 6 }> <VStack align="flex-start" gap={ 6 }>
......
...@@ -40,11 +40,7 @@ const PrevNext = ({ className, onClick, prevLabel, nextLabel, isPrevDisabled, is ...@@ -40,11 +40,7 @@ const PrevNext = ({ className, onClick, prevLabel, nextLabel, isPrevDisabled, is
<IconButton <IconButton
aria-label="prev" aria-label="prev"
borderRadius="sm" borderRadius="sm"
bg="gray.100" variant="subtle"
color="gray.600"
_hover={{
color: 'link.primary.hover',
}}
onClick={ handelPrevClick } onClick={ handelPrevClick }
disabled={ isPrevDisabled } disabled={ isPrevDisabled }
> >
...@@ -55,11 +51,7 @@ const PrevNext = ({ className, onClick, prevLabel, nextLabel, isPrevDisabled, is ...@@ -55,11 +51,7 @@ const PrevNext = ({ className, onClick, prevLabel, nextLabel, isPrevDisabled, is
<IconButton <IconButton
aria-label="next" aria-label="next"
borderRadius="sm" borderRadius="sm"
bg="gray.100" variant="subtle"
color="gray.600"
_hover={{
color: 'link.primary.hover',
}}
ml="10px" ml="10px"
onClick={ handelNextClick } onClick={ handelNextClick }
disabled={ isNextDisabled } disabled={ isNextDisabled }
......
...@@ -9,7 +9,7 @@ import { BODY_TYPEFACE } from 'toolkit/theme/foundations/typography'; ...@@ -9,7 +9,7 @@ import { BODY_TYPEFACE } from 'toolkit/theme/foundations/typography';
interface Props { interface Props {
children: React.ReactNode; children: React.ReactNode;
label: string; label: React.ReactNode;
placement?: Placement; placement?: Placement;
} }
......
...@@ -38,6 +38,14 @@ const AlertsShowcase = () => { ...@@ -38,6 +38,14 @@ const AlertsShowcase = () => {
</Sample> </Sample>
</SamplesStack> </SamplesStack>
</Section> </Section>
<Section>
<SectionHeader>Loading</SectionHeader>
<SamplesStack>
<Sample label="loading: true">
<Alert status="info" title="Info" loading> Alert content </Alert>
</Sample>
</SamplesStack>
</Section>
<Section> <Section>
<SectionHeader>Examples</SectionHeader> <SectionHeader>Examples</SectionHeader>
<SectionSubHeader>Inside table (SocketNewItemsNotice)</SectionSubHeader> <SectionSubHeader>Inside table (SocketNewItemsNotice)</SectionSubHeader>
......
...@@ -47,6 +47,12 @@ const BadgesShowcase = () => { ...@@ -47,6 +47,12 @@ const BadgesShowcase = () => {
</SamplesStack> </SamplesStack>
</Section> </Section>
<Section> <Section>
<SectionHeader>Loading</SectionHeader>
<SamplesStack>
<Sample label="loading: true">
<Badge colorPalette="purple" loading>Content</Badge>
</Sample>
</SamplesStack>
<SectionHeader>Size</SectionHeader> <SectionHeader>Size</SectionHeader>
<SamplesStack> <SamplesStack>
<Sample label="size: md"> <Sample label="size: md">
......
...@@ -157,6 +157,12 @@ const ButtonShowcase = () => { ...@@ -157,6 +157,12 @@ const ButtonShowcase = () => {
</PopoverRoot> </PopoverRoot>
</Sample> </Sample>
<Sample label="variant: subtle">
<Button variant="subtle" size="xs">Default: Now+1h</Button>
<Button variant="subtle" size="xs" data-hover>Hovered: Now+1h</Button>
<Button variant="subtle" size="xs" disabled>Disabled: Now+1h</Button>
</Sample>
<Sample label="variant: plain"> <Sample label="variant: plain">
<Button variant="plain">Default</Button> <Button variant="plain">Default</Button>
<Button variant="plain" data-hover>Hovered</Button> <Button variant="plain" data-hover>Hovered</Button>
......
import React from 'react';
import { Tag } from 'toolkit/chakra/tag';
import { Section, Container, SectionHeader, SamplesStack, Sample } from './parts';
const TagsShowcase = () => {
return (
<Container value="tags">
<Section>
<SectionHeader>Variant</SectionHeader>
<SamplesStack>
<Sample label="variant: ???">
<Tag>My tag</Tag>
<Tag maxW="150px" truncated>Very very very very very looooooonggggg text</Tag>
<Tag loading>My tag</Tag>
<Tag maxW="150px" truncated loading>Very very very very very looooooonggggg text</Tag>
</Sample>
</SamplesStack>
</Section>
</Container>
);
};
export default React.memo(TagsShowcase);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment