mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 10:29:52 +00:00
feat(frontend): added storybook with tailwind integration
chore(frontend): added some required radix components
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { ButtonHTMLAttributes, forwardRef, ReactNode } from 'react';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
type Props = {
|
||||
children: ReactNode;
|
||||
isDisabled?: boolean;
|
||||
// loading state
|
||||
isLoading?: boolean;
|
||||
// various button sizes
|
||||
size: 'sm' | 'md' | 'lg';
|
||||
};
|
||||
|
||||
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & Props;
|
||||
|
||||
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
({ children, isDisabled = false, className, ...props }, ref): JSX.Element => {
|
||||
return (
|
||||
<button
|
||||
ref={ref}
|
||||
aria-disabled={isDisabled}
|
||||
type="button"
|
||||
className={twMerge(
|
||||
'bg-primary hover:opacity-80 transition-all text-sm px-4 py-2 font-bold rounded',
|
||||
className
|
||||
)}
|
||||
disabled={isDisabled}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
Button.displayName = 'Button';
|
||||
Reference in New Issue
Block a user