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,
|
noWrap: true,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
render: (role) => (
|
render: (role) => (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center justify-end gap-2">
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -96,7 +96,6 @@ const RolesPageClient = () => {
|
|||||||
onClick={() => handleDelete(role)}
|
onClick={() => handleDelete(role)}
|
||||||
icon={<Cancel01Icon className="w-4 h-4" />}
|
icon={<Cancel01Icon className="w-4 h-4" />}
|
||||||
>
|
>
|
||||||
Supprimer
|
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,6 +31,14 @@ const Button = ({
|
|||||||
md: 'px-[14px] py-[7px] text-[13px] gap-2',
|
md: 'px-[14px] py-[7px] text-[13px] gap-2',
|
||||||
lg: 'px-6 py-3 text-base gap-2.5'
|
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 = {
|
const iconSizes = {
|
||||||
sm: 'w-3.5 h-3.5',
|
sm: 'w-3.5 h-3.5',
|
||||||
@@ -53,7 +61,7 @@ const Button = ({
|
|||||||
type={type}
|
type={type}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
disabled={disabled || loading}
|
disabled={disabled || loading}
|
||||||
className={`${baseClassName} ${variants[variant]} ${sizes[size]} ${className}`}
|
className={`${baseClassName} ${variants[variant]} ${isIconOnly ? iconOnlySizes[size] : sizes[size]} ${className}`}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user