Fix icon picker width and add Icon Title (#2418)
- fixed icon picker width - added icon title
This commit is contained in:
@ -18,7 +18,7 @@ export type LightIconButtonProps = {
|
|||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
focus?: boolean;
|
focus?: boolean;
|
||||||
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
||||||
} & Pick<ComponentProps<'button'>, 'aria-label'>;
|
} & Pick<ComponentProps<'button'>, 'aria-label' | 'title'>;
|
||||||
|
|
||||||
const StyledButton = styled.button<
|
const StyledButton = styled.button<
|
||||||
Pick<LightIconButtonProps, 'accent' | 'active' | 'size' | 'focus'>
|
Pick<LightIconButtonProps, 'accent' | 'active' | 'size' | 'focus'>
|
||||||
@ -90,6 +90,7 @@ export const LightIconButton = ({
|
|||||||
disabled = false,
|
disabled = false,
|
||||||
focus = false,
|
focus = false,
|
||||||
onClick,
|
onClick,
|
||||||
|
title,
|
||||||
}: LightIconButtonProps) => {
|
}: LightIconButtonProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
return (
|
return (
|
||||||
@ -103,6 +104,7 @@ export const LightIconButton = ({
|
|||||||
className={className}
|
className={className}
|
||||||
size={size}
|
size={size}
|
||||||
active={active}
|
active={active}
|
||||||
|
title={title}
|
||||||
>
|
>
|
||||||
{Icon && <Icon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />}
|
{Icon && <Icon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />}
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
|||||||
@ -84,6 +84,7 @@ export const IconPicker = ({
|
|||||||
variant={variant}
|
variant={variant}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
dropdownMenuWidth={168}
|
||||||
dropdownComponents={
|
dropdownComponents={
|
||||||
<DropdownMenu width={168}>
|
<DropdownMenu width={168}>
|
||||||
<DropdownMenuSearchInput
|
<DropdownMenuSearchInput
|
||||||
@ -103,6 +104,7 @@ export const IconPicker = ({
|
|||||||
aria-label={convertIconKeyToLabel(iconKey)}
|
aria-label={convertIconKeyToLabel(iconKey)}
|
||||||
isSelected={selectedIconKey === iconKey}
|
isSelected={selectedIconKey === iconKey}
|
||||||
size="medium"
|
size="medium"
|
||||||
|
title={iconKey}
|
||||||
Icon={icons[iconKey]}
|
Icon={icons[iconKey]}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onChange({ iconKey, Icon: icons[iconKey] });
|
onChange({ iconKey, Icon: icons[iconKey] });
|
||||||
|
|||||||
Reference in New Issue
Block a user