♻️(frontend) minor components refacto

Improve some props in different components.
This commit is contained in:
Anthony LC
2024-09-30 15:57:46 +02:00
committed by Anthony LC
parent 20a898c978
commit b2480eea74
3 changed files with 13 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ export interface BoxProps {
$effect?: 'show' | 'hide'; $effect?: 'show' | 'hide';
$flex?: boolean; $flex?: boolean;
$gap?: CSSProperties['gap']; $gap?: CSSProperties['gap'];
$hasTransition?: boolean; $hasTransition?: boolean | 'slow';
$height?: CSSProperties['height']; $height?: CSSProperties['height'];
$justify?: CSSProperties['justifyContent']; $justify?: CSSProperties['justifyContent'];
$overflow?: CSSProperties['overflow']; $overflow?: CSSProperties['overflow'];
@@ -53,7 +53,11 @@ export const Box = styled('div')<BoxProps>`
${({ $gap }) => $gap && `gap: ${$gap};`} ${({ $gap }) => $gap && `gap: ${$gap};`}
${({ $height }) => $height && `height: ${$height};`} ${({ $height }) => $height && `height: ${$height};`}
${({ $hasTransition }) => ${({ $hasTransition }) =>
$hasTransition && `transition: all 0.3s ease-in-out;`} $hasTransition && $hasTransition === 'slow'
? `transition: all 0.5s ease-in-out;`
: $hasTransition
? `transition: all 0.3s ease-in-out;`
: ''}
${({ $justify }) => $justify && `justify-content: ${$justify};`} ${({ $justify }) => $justify && `justify-content: ${$justify};`}
${({ $margin }) => $margin && stylesMargin($margin)} ${({ $margin }) => $margin && stylesMargin($margin)}
${({ $maxHeight }) => $maxHeight && `max-height: ${$maxHeight};`} ${({ $maxHeight }) => $maxHeight && `max-height: ${$maxHeight};`}

View File

@@ -24,6 +24,8 @@ const BoxButton = forwardRef<HTMLDivElement, BoxType>(
ref={ref} ref={ref}
as="button" as="button"
$background="none" $background="none"
$margin="none"
$padding="none"
$css={` $css={`
cursor: pointer; cursor: pointer;
border: none; border: none;

View File

@@ -14,7 +14,10 @@ export const IconBG = ({ iconName, ...textProps }: IconBGProps) => {
$size="36px" $size="36px"
$theme="primary" $theme="primary"
$background={colorsTokens()['primary-bg']} $background={colorsTokens()['primary-bg']}
$css={`border: 1px solid ${colorsTokens()['primary-200']}`} $css={`
border: 1px solid ${colorsTokens()['primary-200']};
user-select: none;
`}
$radius="12px" $radius="12px"
$padding="4px" $padding="4px"
$margin="auto" $margin="auto"
@@ -38,6 +41,7 @@ export const IconOptions = ({ isOpen, ...props }: IconOptionsProps) => {
$css={` $css={`
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
transform: rotate(${isOpen ? '90' : '0'}deg); transform: rotate(${isOpen ? '90' : '0'}deg);
user-select: none;
`} `}
> >
more_vert more_vert