mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-01 20:55:16 +09:00
- New useOverflowItems hook for tab overflow menus - Refactor ui/tabs and ds/PageTopbar to share overflow logic - New PageLoader component for full-page loading states - New DataTable component with sorting, empty/loading states, custom rows - New ResourceCard / ResourceList for servers/apps/domains/containers - New FormField / FormRow wrappers for consistent forms - New IconButton wrapper for accessible icon-only actions - Add supporting styles in _design-system.scss and _forms.scss
40 lines
910 B
React
40 lines
910 B
React
import React from 'react';
|
|
import { Button } from '@/components/ui/button';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
/**
|
|
* Accessible icon-only button. Always provide a descriptive label; it is used
|
|
* for the aria-label and optional title.
|
|
*
|
|
* <IconButton icon={<RefreshCw size={16} />} label="Refresh" onClick={load} />
|
|
*/
|
|
export function IconButton({
|
|
icon,
|
|
label,
|
|
onClick,
|
|
variant = 'ghost',
|
|
size = 'sm',
|
|
className,
|
|
title,
|
|
disabled,
|
|
...props
|
|
}) {
|
|
return (
|
|
<Button
|
|
type="button"
|
|
variant={variant}
|
|
size="icon"
|
|
className={cn('icon-button', size === 'sm' && 'btn-sm', className)}
|
|
onClick={onClick}
|
|
disabled={disabled}
|
|
aria-label={label}
|
|
title={title || label}
|
|
{...props}
|
|
>
|
|
{icon}
|
|
</Button>
|
|
);
|
|
}
|
|
|
|
export default IconButton;
|