chore(UI, accessibility): more items

- radio icon buttons
- links should be parent of icon
styled links to still line up with sibling components
This commit is contained in:
ElrikUnderlake
2023-03-12 15:50:14 -05:00
parent 60614badaf
commit e3aef20f42
3 changed files with 53 additions and 40 deletions

View File

@@ -8,13 +8,14 @@ import {
import { memo } from 'react';
export type IAIIconButtonProps = IconButtonProps & {
role?: string;
tooltip?: string;
tooltipProps?: Omit<TooltipProps, 'children'>;
isChecked?: boolean;
};
const IAIIconButton = forwardRef((props: IAIIconButtonProps, forwardedRef) => {
const { tooltip = '', tooltipProps, isChecked, ...rest } = props;
const { role, tooltip = '', tooltipProps, isChecked, ...rest } = props;
return (
<Tooltip
@@ -27,6 +28,7 @@ const IAIIconButton = forwardRef((props: IAIIconButtonProps, forwardedRef) => {
>
<IconButton
ref={forwardedRef}
role={role}
aria-checked={isChecked !== undefined ? isChecked : undefined}
{...rest}
/>
@@ -34,4 +36,5 @@ const IAIIconButton = forwardRef((props: IAIIconButtonProps, forwardedRef) => {
);
});
IAIIconButton.displayName = 'IAIIconButton';
export default memo(IAIIconButton);