style(ui): add icon-only button sizing and fix action column alignment
This commit is contained in:
@@ -80,7 +80,7 @@ const RolesPageClient = () => {
|
||||
noWrap: true,
|
||||
align: 'right',
|
||||
render: (role) => (
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center justify-end gap-2">
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
@@ -96,7 +96,6 @@ const RolesPageClient = () => {
|
||||
onClick={() => handleDelete(role)}
|
||||
icon={<Cancel01Icon className="w-4 h-4" />}
|
||||
>
|
||||
Supprimer
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -31,6 +31,14 @@ const Button = ({
|
||||
md: 'px-[14px] py-[7px] text-[13px] gap-2',
|
||||
lg: 'px-6 py-3 text-base gap-2.5'
|
||||
};
|
||||
|
||||
const iconOnlySizes = {
|
||||
sm: 'p-[6px] text-[12px]',
|
||||
md: 'p-[7px] text-[13px]',
|
||||
lg: 'p-3 text-base'
|
||||
};
|
||||
|
||||
const isIconOnly = icon && !children;
|
||||
|
||||
const iconSizes = {
|
||||
sm: 'w-3.5 h-3.5',
|
||||
@@ -53,7 +61,7 @@ const Button = ({
|
||||
type={type}
|
||||
onClick={handleClick}
|
||||
disabled={disabled || loading}
|
||||
className={`${baseClassName} ${variants[variant]} ${sizes[size]} ${className}`}
|
||||
className={`${baseClassName} ${variants[variant]} ${isIconOnly ? iconOnlySizes[size] : sizes[size]} ${className}`}
|
||||
{...props}
|
||||
>
|
||||
{loading ? (
|
||||
|
||||
Reference in New Issue
Block a user