Box
export const BoxDefault = () => (
<Box tag="box">
<Typography>Contenu par défaut</Typography>
</Box>
);
export const BoxPadded = () => (
<Box tag="padded" p="2W">
<Typography>Box avec padding</Typography>
</Box>
);
export const BoxPaddedWithBackground = () => {
const { color } = useTheme();
return (
<Box tag="padded-with-background" backgroundColor={color.light.background['alt-grey']} p="2W">
<Typography>Box avec fond gris clair et padding</Typography>
</Box>
);
};
export const BoxHovered = () => {
const { color } = useTheme();
return (
<Box tag="hovered" backgroundColor={{ hover: color.light.background['alt-grey'] }}>
<Typography>Box avec fond gris changeant au hover</Typography>
</Box>
);
};
export const BoxSansTag = () => {
const { color } = useTheme();
return (
<Box tag="box-comparaison" gap="1W">
<Box backgroundColor={color.light.background['alt-grey']} p="2W">
<Typography>Box sans tag</Typography>
</Box>
<Box tag="div" backgroundColor={color.light.background['alt-grey']} p="2W">
<Typography>Box en div</Typography>
</Box>
</Box>
);
export const BoxFlexDansParentIndefini = () => (
<Box tag="box-flex-parent">
<Box tag="box-flex-en-prop" flex={1}>
<Typography>flex: 1 en prop</Typography>
</Box>
<Box tag="box-flex-en-style" style={{ flex: 1 }}>
<Typography>flex: 1 en style</Typography>
</Box>
<Box tag="box-flex-en-tableau" style={[{ flex: 1 }, { paddingLeft: Spacings['6W'] }]}>
<Typography>flex: 1 en tableau, avec un autre style</Typography>
</Box>
</Box>
export const BoxStyles = () => (
<Box gap="1W">
<Box tag="box-style-objet" style={{ paddingLeft: Spacings['6W'] }}>
<Typography>Style objet</Typography>
</Box>
<Box tag="box-style-tableau" style={[{ paddingLeft: Spacings['6W'] }, { marginTop: Spacings['0V'] }]}>
<Typography>Style en tableau</Typography>
</Box>
<Box tag="box-style-imbrique" style={[[{ paddingLeft: Spacings['6W'] }], { marginTop: Spacings['0V'] }]}>
<Typography>Style en tableau imbriqué</Typography>
</Box>
</Box>
export const BoxTokens = () => (
<Box tag="box-tokens-parent" width={400}>
<Box tag="box-tokens" width={100} p="2W" ml="auto" mr="10%" borderRadius="md">
<Typography>Tokens</Typography>
</Box>
</Box>
);