mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 01:38:26 +02:00
Fix button styles
This commit is contained in:
@@ -15,6 +15,7 @@ const colorStyles = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type ButtonProps = HTMLAttributes<HTMLButtonElement> & {
|
export type ButtonProps = HTMLAttributes<HTMLButtonElement> & {
|
||||||
|
innerClassName?: string;
|
||||||
color?: keyof typeof colorStyles;
|
color?: keyof typeof colorStyles;
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
size?: 'sm' | 'md' | 'xs';
|
size?: 'sm' | 'md' | 'xs';
|
||||||
@@ -32,6 +33,7 @@ const _Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
|
|||||||
{
|
{
|
||||||
isLoading,
|
isLoading,
|
||||||
className,
|
className,
|
||||||
|
innerClassName,
|
||||||
children,
|
children,
|
||||||
forDropdown,
|
forDropdown,
|
||||||
color,
|
color,
|
||||||
@@ -70,7 +72,7 @@ const _Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
|
|||||||
) : leftSlot ? (
|
) : leftSlot ? (
|
||||||
<div className="mr-1">{leftSlot}</div>
|
<div className="mr-1">{leftSlot}</div>
|
||||||
) : null}
|
) : null}
|
||||||
<div className="max-w-[15em] truncate">{children}</div>
|
<div className={classNames('max-w-[15em] truncate w-full text-left', innerClassName)}>{children}</div>
|
||||||
{rightSlot && <div className="ml-1">{rightSlot}</div>}
|
{rightSlot && <div className="ml-1">{rightSlot}</div>}
|
||||||
{forDropdown && <Icon icon="chevronDown" size={size} className="ml-1 -mr-1" />}
|
{forDropdown && <Icon icon="chevronDown" size={size} className="ml-1 -mr-1" />}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export const IconButton = forwardRef<HTMLButtonElement, Props>(function IconButt
|
|||||||
disabled={icon === 'empty'}
|
disabled={icon === 'empty'}
|
||||||
tabIndex={tabIndex ?? icon === 'empty' ? -1 : undefined}
|
tabIndex={tabIndex ?? icon === 'empty' ? -1 : undefined}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
|
innerClassName="flex items-center justify-center"
|
||||||
className={classNames(
|
className={classNames(
|
||||||
className,
|
className,
|
||||||
'flex-shrink-0 text-gray-700 hover:text-gray-1000',
|
'flex-shrink-0 text-gray-700 hover:text-gray-1000',
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ const FormRow = memo(function FormRow({
|
|||||||
size="sm"
|
size="sm"
|
||||||
title="Delete header"
|
title="Delete header"
|
||||||
onClick={showDelete ? handleDelete : undefined}
|
onClick={showDelete ? handleDelete : undefined}
|
||||||
className="ml-0.5 !opacity-0 group-hover:!opacity-100 focus-visible:!opacity-100"
|
className="ml-0.5 group-hover:!opacity-100 focus-visible:!opacity-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user