♻️(app-desk) replace classname spacings

Replace the classname spacings with the new
spacing system based on props.
This commit is contained in:
Anthony LC
2024-04-29 14:21:36 +02:00
committed by Anthony LC
parent a45408c93c
commit d88f6a5a51
19 changed files with 74 additions and 47 deletions

View File

@@ -20,7 +20,7 @@ export const TextErrors = ({
causes.map((cause, i) => ( causes.map((cause, i) => (
<Text <Text
key={`causes-${i}`} key={`causes-${i}`}
className="mt-s" $margin={{ top: 'small' }}
$theme="danger" $theme="danger"
$textAlign="center" $textAlign="center"
{...textProps} {...textProps}
@@ -31,7 +31,7 @@ export const TextErrors = ({
{!causes && ( {!causes && (
<Text <Text
className="mt-s" $margin={{ top: 'small' }}
$theme="danger" $theme="danger"
$textAlign="center" $textAlign="center"
{...textProps} {...textProps}

View File

@@ -165,14 +165,14 @@ export const ModalAddMembers = ({
title={ title={
<Box $align="center" $gap="1rem"> <Box $align="center" $gap="1rem">
<IconAddMember width={48} color={colorsTokens()['primary-text']} /> <IconAddMember width={48} color={colorsTokens()['primary-text']} />
<Text $size="h3" className="m-0"> <Text $size="h3" $margin="none">
{t('Add a member')} {t('Add a member')}
</Text> </Text>
</Box> </Box>
} }
> >
<GlobalStyle /> <GlobalStyle />
<Box className="mb-xl mt-l"> <Box $margin={{ bottom: 'xl', top: 'large' }}>
<SearchMembers <SearchMembers
team={team} team={team}
setSelectedMembers={setSelectedMembers} setSelectedMembers={setSelectedMembers}
@@ -180,8 +180,8 @@ export const ModalAddMembers = ({
disabled={isPending} disabled={isPending}
/> />
{selectedMembers.length > 0 && ( {selectedMembers.length > 0 && (
<Box className="mt-s"> <Box $margin={{ top: 'small' }}>
<Text as="h4" $textAlign="left" className="mb-t"> <Text as="h4" $textAlign="left" $margin={{ bottom: 'tiny' }}>
{t('Choose a role')} {t('Choose a role')}
</Text> </Text>
<ChooseRole <ChooseRole

View File

@@ -41,7 +41,7 @@ export const Header = () => {
<StyledHeader> <StyledHeader>
<RedStripe /> <RedStripe />
<Box <Box
className="ml-bx mr-bx" $margin={{ horizontal: 'xbig' }}
$align="center" $align="center"
$justify="space-between" $justify="space-between"
$direction="row" $direction="row"
@@ -56,7 +56,7 @@ export const Header = () => {
/> />
<Box $align="center" $gap="1rem" $direction="row"> <Box $align="center" $gap="1rem" $direction="row">
<Image priority src={IconApplication} alt={t('Equipes Logo')} /> <Image priority src={IconApplication} alt={t('Equipes Logo')} />
<Text className="m-0" as="h2" $theme="primary"> <Text $margin="none" as="h2" $theme="primary">
{t('Equipes')} {t('Equipes')}
</Text> </Text>
</Box> </Box>

View File

@@ -24,7 +24,7 @@ export function MailContent() {
]; ];
return ( return (
<Card className="m-l p-s"> <Card $padding="small" $margin="large">
<DataGrid <DataGrid
columns={[ columns={[
{ {

View File

@@ -96,7 +96,7 @@ export const MemberGrid = ({ team, currentRole }: MemberGridProps) => {
return ( return (
<> <>
{currentRole !== Role.MEMBER && ( {currentRole !== Role.MEMBER && (
<Box className="m-b mb-s" $align="flex-end"> <Box $margin={{ all: 'big', bottom: 'small' }} $align="flex-end">
<Button <Button
aria-label={t('Add members to the team')} aria-label={t('Add members to the team')}
style={{ style={{
@@ -111,10 +111,10 @@ export const MemberGrid = ({ team, currentRole }: MemberGridProps) => {
</Box> </Box>
)} )}
<Card <Card
className="m-b pb-s" $padding={{ bottom: 'small' }}
$margin={{ all: 'big', top: 'none' }}
$overflow="auto" $overflow="auto"
$css={` $css={`
margin-top:0;
& .c__pagination__goto { & .c__pagination__goto {
display: none; display: none;
} }

View File

@@ -83,7 +83,7 @@ export const ModalDelete = ({ access, onClose, team }: ModalDeleteProps) => {
title={ title={
<Box $align="center" $gap="1rem"> <Box $align="center" $gap="1rem">
<IconRemoveMember width={48} color={colorsTokens()['primary-text']} /> <IconRemoveMember width={48} color={colorsTokens()['primary-text']} />
<Text $size="h3" className="m-0"> <Text $size="h3" $margin="none">
{t('Remove the member')} {t('Remove the member')}
</Text> </Text>
</Box> </Box>
@@ -98,7 +98,10 @@ export const ModalDelete = ({ access, onClose, team }: ModalDeleteProps) => {
</Text> </Text>
{isErrorUpdate && ( {isErrorUpdate && (
<TextErrors className="mb-s" causes={errorUpdate.cause} /> <TextErrors
$margin={{ bottom: 'small' }}
causes={errorUpdate.cause}
/>
)} )}
{(isLastOwner || isOtherOwner) && ( {(isLastOwner || isOtherOwner) && (
@@ -107,7 +110,7 @@ export const ModalDelete = ({ access, onClose, team }: ModalDeleteProps) => {
$direction="row" $direction="row"
$align="center" $align="center"
$gap="0.5rem" $gap="0.5rem"
className="m-t" $margin="tiny"
$justify="center" $justify="center"
> >
<span className="material-icons">warning</span> <span className="material-icons">warning</span>
@@ -121,7 +124,7 @@ export const ModalDelete = ({ access, onClose, team }: ModalDeleteProps) => {
<Text <Text
as="p" as="p"
className="p-b" $padding="big"
$direction="row" $direction="row"
$gap="0.5rem" $gap="0.5rem"
$background={colorsTokens()['primary-150']} $background={colorsTokens()['primary-150']}

View File

@@ -87,7 +87,10 @@ export const ModalRole = ({
> >
<Box aria-label={t('Radio buttons to update the roles')}> <Box aria-label={t('Radio buttons to update the roles')}>
{isErrorUpdate && ( {isErrorUpdate && (
<TextErrors className="mb-s" causes={errorUpdate.cause} /> <TextErrors
$margin={{ bottom: 'small' }}
causes={errorUpdate.cause}
/>
)} )}
{(isLastOwner || isOtherOwner) && ( {(isLastOwner || isOtherOwner) && (
@@ -96,7 +99,7 @@ export const ModalRole = ({
$direction="row" $direction="row"
$align="center" $align="center"
$gap="0.5rem" $gap="0.5rem"
className="mb-t" $margin={{ bottom: 'tiny' }}
$justify="center" $justify="center"
> >
<span className="material-icons">warning</span> <span className="material-icons">warning</span>

View File

@@ -19,12 +19,13 @@ export const Menu = () => {
return ( return (
<Box <Box
as="menu" as="menu"
className="m-0 p-0"
$background={colorsTokens()['primary-800']} $background={colorsTokens()['primary-800']}
$height="100%" $height="100%"
$justify="space-between" $justify="space-between"
$padding="none"
$margin="none"
> >
<Box className="pt-l" $direction="column" $gap="0.8rem"> <Box $padding={{ top: 'large' }} $direction="column" $gap="0.8rem">
<MenuItem Icon={IconSearch} label={t('Search')} href="/" /> <MenuItem Icon={IconSearch} label={t('Search')} href="/" />
<MenuItem Icon={IconMail} label={t('Mails')} href="/mails" /> <MenuItem Icon={IconMail} label={t('Mails')} href="/mails" />
<MenuItem Icon={IconFavorite} label={t('Favorite')} href="/favorite" /> <MenuItem Icon={IconFavorite} label={t('Favorite')} href="/favorite" />

View File

@@ -46,7 +46,8 @@ const MenuItem = ({ Icon, label, href }: MenuItemProps) => {
style={{ display: 'block' }} style={{ display: 'block' }}
> >
<Box <Box
className="m-st p-t" $margin="xtiny"
$padding="tiny"
as="li" as="li"
$justify="center" $justify="center"
$css={` $css={`

View File

@@ -26,7 +26,8 @@ export const Tooltip = ({
<Popover parentRef={parentRef} onClickOutside={() => ''} borderless> <Popover parentRef={parentRef} onClickOutside={() => ''} borderless>
<Box <Box
aria-label="tooltip" aria-label="tooltip"
className="ml-t p-t" $padding="tiny"
$margin={{ left: 'tiny' }}
$background={backgroundColor} $background={backgroundColor}
$radius="4px" $radius="4px"
$css={` $css={`

View File

@@ -29,7 +29,7 @@ export const CardCreateTeam = () => {
return ( return (
<Card <Card
className="p-b" $padding="big"
$height="70%" $height="70%"
$justify="space-between" $justify="space-between"
$width="100%" $width="100%"

View File

@@ -73,24 +73,29 @@ export const ModalRemoveTeam = ({ onClose, team }: ModalRemoveTeamProps) => {
title={ title={
<Box $align="center" $gap="1rem"> <Box $align="center" $gap="1rem">
<IconRemove width={48} color={colorsTokens()['primary-text']} /> <IconRemove width={48} color={colorsTokens()['primary-text']} />
<Text $size="h3" className="m-0"> <Text $size="h3" $margin="none">
{t('Deleting the {{teamName}} team', { teamName: team.name })} {t('Deleting the {{teamName}} team', { teamName: team.name })}
</Text> </Text>
</Box> </Box>
} }
> >
<Box className="mb-xl" aria-label={t('Content modal to delete the team')}> <Box
<Text as="p" className="mb-b"> $margin={{ bottom: 'xl' }}
aria-label={t('Content modal to delete the team')}
>
<Text as="p" $margin={{ bottom: 'big' }}>
{t('Are you sure you want to delete {{teamName}} team?', { {t('Are you sure you want to delete {{teamName}} team?', {
teamName: team.name, teamName: team.name,
})} })}
</Text> </Text>
{isError && <TextErrors className="mb-s" causes={error.cause} />} {isError && (
<TextErrors $margin={{ bottom: 'small' }} causes={error.cause} />
)}
<Text <Text
as="p" as="p"
className="p-s" $padding="small"
$direction="row" $direction="row"
$gap="0.5rem" $gap="0.5rem"
$background={colorsTokens()['primary-150']} $background={colorsTokens()['primary-150']}

View File

@@ -76,14 +76,17 @@ export const ModalUpdateTeam = ({ onClose, team }: ModalUpdateTeamProps) => {
title={ title={
<Box $align="center" $gap="1rem"> <Box $align="center" $gap="1rem">
<IconEdit width={48} color={colorsTokens()['primary-text']} /> <IconEdit width={48} color={colorsTokens()['primary-text']} />
<Text $size="h3" className="m-0"> <Text $size="h3" $margin="none">
{t('Update team {{teamName}}', { teamName: team.name })} {t('Update team {{teamName}}', { teamName: team.name })}
</Text> </Text>
</Box> </Box>
} }
> >
<Box className="mb-xl" aria-label={t('Content modal to update the team')}> <Box
<Text as="p" className="mb-b"> $margin={{ bottom: 'xl' }}
aria-label={t('Content modal to update the team')}
>
<Text as="p" $margin={{ bottom: 'big' }}>
{t('Enter the new name of the selected team')} {t('Enter the new name of the selected team')}
</Text> </Text>

View File

@@ -60,7 +60,7 @@ export const Panel = () => {
`} `}
> >
<Box <Box
className="pr-l pl-s pt-s pb-s" $padding={{ all: 'small', right: 'large' }}
$direction="row" $direction="row"
$align="center" $align="center"
$justify="space-between" $justify="space-between"

View File

@@ -54,7 +54,7 @@ export const TeamItem = ({ team }: TeamProps) => {
return ( return (
<Box <Box
className="m-0" $margin="none"
as="li" as="li"
$css={` $css={`
transition: all 0.2s ease-in; transition: all 0.2s ease-in;

View File

@@ -19,7 +19,7 @@ const TeamListState = ({ isLoading, isError, teams }: PanelTeamsStateProps) => {
if (isError) { if (isError) {
return ( return (
<Box $justify="center" className="mb-b"> <Box $justify="center" $margin={{ bottom: 'big' }}>
<Text $theme="danger" $align="center" $textAlign="center"> <Text $theme="danger" $align="center" $textAlign="center">
{t('Something bad happens, please refresh the page.')} {t('Something bad happens, please refresh the page.')}
</Text> </Text>
@@ -29,7 +29,7 @@ const TeamListState = ({ isLoading, isError, teams }: PanelTeamsStateProps) => {
if (isLoading) { if (isLoading) {
return ( return (
<Box $align="center" className="m-l"> <Box $align="center" $margin="large">
<Loader /> <Loader />
</Box> </Box>
); );
@@ -37,8 +37,13 @@ const TeamListState = ({ isLoading, isError, teams }: PanelTeamsStateProps) => {
if (!teams?.length) { if (!teams?.length) {
return ( return (
<Box $justify="center" className="m-s"> <Box $justify="center" $margin="small">
<Text as="p" className="mb-0 mt-0" $theme="greyscale" $variation="500"> <Text
as="p"
$margin={{ vertical: 'none' }}
$theme="greyscale"
$variation="500"
>
{t('0 group to display.')} {t('0 group to display.')}
</Text> </Text>
<Text as="p" $theme="greyscale" $variation="500"> <Text as="p" $theme="greyscale" $variation="500">
@@ -82,7 +87,8 @@ export const TeamList = () => {
}} }}
scrollContainer={containerRef.current} scrollContainer={containerRef.current}
as="ul" as="ul"
className="p-0 mt-0" $margin={{ top: 'none' }}
$padding="none"
role="listbox" role="listbox"
> >
<TeamListState isLoading={isLoading} isError={isError} teams={teams} /> <TeamListState isLoading={isLoading} isError={isError} teams={teams} />

View File

@@ -38,11 +38,11 @@ export const TeamInfo = ({ team, currentRole }: TeamInfoProps) => {
return ( return (
<> <>
<Card className="m-b" style={{ paddingBottom: 0 }}> <Card $margin="big" $padding={{ bottom: 'none' }}>
<Box $css="align-self: flex-end;" className="m-t" $position="absolute"> <Box $css="align-self: flex-end;" $margin="tiny" $position="absolute">
<TeamActions currentRole={currentRole} team={team} /> <TeamActions currentRole={currentRole} team={team} />
</Box> </Box>
<Box className="m-b" $direction="row" $align="center" $gap="1.5rem"> <Box $margin="big" $direction="row" $align="center" $gap="1.5rem">
<IconGroup <IconGroup
width={44} width={44}
color={colorsTokens()['primary-text']} color={colorsTokens()['primary-text']}
@@ -53,7 +53,12 @@ export const TeamInfo = ({ team, currentRole }: TeamInfoProps) => {
}} }}
/> />
<Box> <Box>
<Text as="h3" $weight="bold" $size="1.25rem" className="mt-0"> <Text
as="h3"
$weight="bold"
$size="1.25rem"
$margin={{ top: 'none' }}
>
{t('Members of “{{teamName}}“', { {t('Members of “{{teamName}}“', {
teamName: team.name, teamName: team.name,
})} })}
@@ -66,13 +71,12 @@ export const TeamInfo = ({ team, currentRole }: TeamInfoProps) => {
</Box> </Box>
</Box> </Box>
<Box <Box
className="p-s" $padding={{ all: 'small', left: '1.5rem' }}
$gap="3rem" $gap="3rem"
$direction="row" $direction="row"
$justify="start" $justify="start"
$css={` $css={`
border-top: 1px solid ${colorsTokens()['card-border']}; border-top: 1px solid ${colorsTokens()['card-border']};
padding-left: 1.5rem;
`} `}
> >
<Text $size="s" as="p"> <Text $size="s" as="p">

View File

@@ -18,7 +18,7 @@ const Page: NextPageWithLayout = () => {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<Box $align="center" className="m-auto" $height="70vh" $gap="2rem"> <Box $align="center" $margin="auto" $height="70vh" $gap="2rem">
<Icon404 aria-label="Image 404" role="img" /> <Icon404 aria-label="Image 404" role="img" />
<Text $size="h2" $weight="700" $theme="greyscale" $variation="900"> <Text $size="h2" $weight="700" $theme="greyscale" $variation="900">
@@ -31,7 +31,7 @@ const Page: NextPageWithLayout = () => {
)} )}
</Text> </Text>
<Box className="mt-l"> <Box $margin={{ top: 'large' }}>
<StyledLink href="/"> <StyledLink href="/">
<StyledButton>{t('Back to home page')}</StyledButton> <StyledButton>{t('Back to home page')}</StyledButton>
</StyledLink> </StyledLink>

View File

@@ -6,7 +6,7 @@ import { NextPageWithLayout } from '@/types/next';
const Page: NextPageWithLayout = () => { const Page: NextPageWithLayout = () => {
return ( return (
<Box className="p-l" $justify="center" $align="start" $height="inherit"> <Box $padding="large" $justify="center" $align="start" $height="inherit">
<CardCreateTeam /> <CardCreateTeam />
</Box> </Box>
); );