diff --git a/apps/app/src/components/BaseModal/BaseModal.tsx b/apps/app/src/components/BaseModal/BaseModal.tsx index 1447230d..9dbf97b0 100644 --- a/apps/app/src/components/BaseModal/BaseModal.tsx +++ b/apps/app/src/components/BaseModal/BaseModal.tsx @@ -44,7 +44,7 @@ export const BaseModal = ({ isOpen, onClose, children }: BaseModalProps) => { >
{ // stop propagation to avoid triggering `onClick` on the backdrop behind the modal event.stopPropagation(); diff --git a/apps/app/src/components/Button/Button.stories.ts b/apps/app/src/components/Button/Button.stories.ts index 5af7e50e..a2577b74 100644 --- a/apps/app/src/components/Button/Button.stories.ts +++ b/apps/app/src/components/Button/Button.stories.ts @@ -36,3 +36,10 @@ export const Alternative: Story = { variant: "alternative", }, }; + +export const MobileAction: Story = { + args: { + variant: "mobileAction", + children: "+", + }, +}; diff --git a/apps/app/src/components/Button/Button.tsx b/apps/app/src/components/Button/Button.tsx index dbb6a772..48081632 100644 --- a/apps/app/src/components/Button/Button.tsx +++ b/apps/app/src/components/Button/Button.tsx @@ -1,14 +1,29 @@ import { ButtonHTMLAttributes } from "react"; import { twMerge } from "tailwind-merge"; +const defaultStyles = + "min-w-[160px] appearance-none rounded-md border border-transparent px-8 py-1 text-sm leading-8 transition-colors duration-100 disabled:cursor-not-allowed sm:py-0"; + const variants = { - alert: "text-white font-bold bg-red-branding hover:bg-red-branding-dark disabled:bg-[#bfbfbf]", - branding: - "text-violet-700 dark:text-neutral-200 border-violet-700 dark:border-neutral-200 bg-transparent hover:bg-violet-50 hover:dark:bg-violet-900 focus:shadow-[0_0_10px] focus:shadow-primary", - brandingInverse: - "border-white bg-primary text-white hover:text-violet-700 dark:hover:text-white transition-opacity hover:bg-violet-200 focus:shadow-[0_0_10px] focus:shadow-white disabled:opacity-50 hover:dark:bg-violet-700", - alternative: - "text-white-dark border-white-dark bg-yellow-branding hover:bg-yellow-branding-dark focus:shadow-[0_0_10px] focus:shadow-yellow-branding", + alert: twMerge( + defaultStyles, + "text-white font-bold bg-red-branding enabled:hover:bg-red-branding-dark disabled:bg-[#bfbfbf]", + ), + branding: twMerge( + defaultStyles, + "text-violet-700 dark:text-neutral-200 border-violet-700 dark:border-neutral-200 bg-transparent enabled:hover:bg-violet-50 enabled:hover:dark:bg-violet-900 focus:shadow-[0_0_10px] focus:shadow-primary", + ), + brandingInverse: twMerge( + defaultStyles, + "border-white bg-primary text-white enabled:hover:text-violet-700 enabled:dark:hover:text-white transition-opacity enabled:hover:bg-violet-200 focus:shadow-[0_0_10px] focus:shadow-white disabled:opacity-50 enabled:hover:dark:bg-violet-700", + ), + alternative: twMerge( + defaultStyles, + "text-white-dark border-white-dark bg-yellow-branding enabled:hover:bg-yellow-branding-dark focus:shadow-[0_0_10px] focus:shadow-yellow-branding", + ), + mobileAction: twMerge( + "flex h-11 w-11 items-center justify-center rounded-full border-none p-0 shadow-md shadow-neutral-600 dark:shadow-neutral-900 bg-primary hover:bg-violet-800 dark:hover:bg-violet-700 text-white", + ), }; type ButtonProps = Readonly<{ @@ -17,12 +32,5 @@ type ButtonProps = Readonly<{ ButtonHTMLAttributes; export const Button = ({ variant, className, ...props }: ButtonProps) => ( -