website refactor

This commit is contained in:
2026-01-18 22:55:55 +01:00
parent b43a23a48c
commit aeaa43f4d3
179 changed files with 4736 additions and 6832 deletions

View File

@@ -1,18 +1,20 @@
import React, { MouseEventHandler } from 'react';
import React, { forwardRef } from 'react';
import { Button, ButtonProps } from './Button';
import { Icon } from './Icon';
export interface IconButtonProps extends Omit<ButtonProps, 'children' | 'icon'> {
icon: any;
title?: string;
intent?: 'primary' | 'success' | 'warning' | 'critical' | 'telemetry' | 'low' | 'high';
}
export const IconButton = ({
export const IconButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, IconButtonProps>(({
icon,
title,
size = 'md',
intent,
...props
}: IconButtonProps) => {
}, ref) => {
const iconSizeMap = {
sm: 3,
md: 4,
@@ -21,11 +23,14 @@ export const IconButton = ({
return (
<Button
ref={ref}
size={size}
{...props}
>
<Icon icon={icon} size={iconSizeMap[size]} />
<Icon icon={icon} size={iconSizeMap[size]} intent={intent} />
{title && <span className="sr-only">{title}</span>}
</Button>
);
};
});
IconButton.displayName = 'IconButton';