erreur du commit précedent
je ne commite que les modifications annoncées dans le commit précédent
This commit is contained in:
@@ -56,22 +56,17 @@ export const DropButton = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Bouton activant le menu avec les propriétés ARIA */}
|
||||
<StyledButton
|
||||
ref={triggerRef}
|
||||
aria-haspopup="menu"
|
||||
aria-expanded={isLocalOpen}
|
||||
onPress={() => onOpenChangeHandler(true)}
|
||||
>
|
||||
<StyledButton ref={triggerRef} onPress={() => onOpenChangeHandler(true)}>
|
||||
<span aria-hidden="true">{button}</span>
|
||||
</StyledButton>
|
||||
|
||||
{/* Menu accessible */}
|
||||
{isLocalOpen && (
|
||||
<StyledPopover as="div" role="menu">
|
||||
{children}
|
||||
</StyledPopover>
|
||||
)}
|
||||
<StyledPopover
|
||||
triggerRef={triggerRef}
|
||||
isOpen={isLocalOpen}
|
||||
onOpenChange={onOpenChangeHandler}
|
||||
>
|
||||
{children}
|
||||
</StyledPopover>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//import { t } from 'i18next';
|
||||
import { PropsWithChildren, useState } from 'react';
|
||||
import { css } from 'styled-components';
|
||||
|
||||
@@ -55,19 +56,16 @@ export const DropdownMenu = ({
|
||||
showArrow ? (
|
||||
<Box $direction="row" $align="center">
|
||||
<div>{children}</div>
|
||||
<span aria-hidden="true">
|
||||
<Icon
|
||||
role="presentation"
|
||||
$variation="600"
|
||||
$css={
|
||||
arrowCss ??
|
||||
css`
|
||||
color: var(--c--theme--colors--primary-600);
|
||||
`
|
||||
}
|
||||
iconName={isOpen ? 'arrow_drop_up' : 'arrow_drop_down'}
|
||||
/>
|
||||
</span>
|
||||
<Icon
|
||||
$variation="600"
|
||||
$css={
|
||||
arrowCss ??
|
||||
css`
|
||||
color: var(--c--theme--colors--primary-600);
|
||||
`
|
||||
}
|
||||
iconName={isOpen ? 'arrow_drop_up' : 'arrow_drop_down'}
|
||||
/>
|
||||
</Box>
|
||||
) : (
|
||||
children
|
||||
@@ -136,14 +134,12 @@ export const DropdownMenu = ({
|
||||
>
|
||||
<Box $direction="row" $align="center" $gap={spacings['base']}>
|
||||
{option.icon && (
|
||||
<span aria-hidden="true">
|
||||
<Icon
|
||||
$size="20px"
|
||||
$theme="greyscale"
|
||||
$variation={isDisabled ? '400' : '1000'}
|
||||
iconName={option.icon}
|
||||
/>
|
||||
</span>
|
||||
<Icon
|
||||
$size="20px"
|
||||
$theme="greyscale"
|
||||
$variation={isDisabled ? '400' : '1000'}
|
||||
iconName={option.icon}
|
||||
/>
|
||||
)}
|
||||
<Text $variation={isDisabled ? '400' : '1000'}>
|
||||
{option.label}
|
||||
|
||||
@@ -8,27 +8,8 @@ type IconProps = TextType & {
|
||||
};
|
||||
export const Icon = ({ iconName, ...textProps }: IconProps) => {
|
||||
return (
|
||||
<Text
|
||||
$isMaterialIcon
|
||||
{...textProps}
|
||||
aria-hidden="true"
|
||||
$css={`
|
||||
visibility: hidden;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
`}
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
visibility: 'visible',
|
||||
}}
|
||||
>
|
||||
{iconName}
|
||||
</span>
|
||||
<Text $isMaterialIcon {...textProps}>
|
||||
{iconName}
|
||||
</Text>
|
||||
);
|
||||
};
|
||||
@@ -43,7 +24,6 @@ export const IconBG = ({ iconName, ...textProps }: IconBGProps) => {
|
||||
return (
|
||||
<Text
|
||||
$isMaterialIcon
|
||||
aria-hidden="true"
|
||||
$size="36px"
|
||||
$theme="primary"
|
||||
$variation="600"
|
||||
|
||||
@@ -68,7 +68,6 @@ const Text = forwardRef<HTMLElement, ComponentPropsWithRef<typeof TextStyled>>(
|
||||
<TextStyled
|
||||
ref={ref}
|
||||
as="span"
|
||||
aria-hidden={$isMaterialIcon ? 'true' : undefined}
|
||||
$theme="greyscale"
|
||||
$variation="text"
|
||||
className={`${className || ''}${$isMaterialIcon ? ' material-icons' : ''}`}
|
||||
|
||||
Reference in New Issue
Block a user