From 521615f4489f2a330763fc17292834b0d3d9cdb1 Mon Sep 17 00:00:00 2001 From: mewdev Date: Wed, 23 Oct 2024 21:30:25 +0200 Subject: [PATCH] compactable functionality and answer buttons optimization --- packages/design-system/src/button.tsx | 22 +++++++++---------- packages/design-system/src/buttonAgainst.tsx | 5 +++-- packages/design-system/src/buttonInFavour.tsx | 5 +++-- packages/design-system/src/buttonNeutral.tsx | 5 +++-- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/packages/design-system/src/button.tsx b/packages/design-system/src/button.tsx index ed2086a..7103f13 100644 --- a/packages/design-system/src/button.tsx +++ b/packages/design-system/src/button.tsx @@ -4,7 +4,7 @@ import { cva, VariantProps } from "class-variance-authority"; const buttonVariants = cva( [ - "k1-inline-flex k1-items-center k1-justify-center k1-min-w-fit", + "k1-inline-flex k1-items-center k1-min-w-fit", "data-[hover]:k1-cursor-pointer k1-text-nowrap data-[disabled]:k1-pointer-events-none", "k1-uppercase k1-font-bold", "k1-rounded-l k1-rounded-br", @@ -15,6 +15,7 @@ const buttonVariants = cva( kind: { filled: "k1-p-4 data-[active]:k1-bg-primary-strong-active data-[disabled]:k1-bg-neutral-disaled", + inverse: "k1-border-2 k1-bg-transparent k1-p-4 k1-gap-4", outline: "k1-border-2 k1-bg-transparent k1-p-4", link: [ "k1-bg-transparent k1-text-neutral k1-p-0 k1-gap-2", @@ -70,29 +71,26 @@ const buttonVariants = cva( compoundVariants: [ { - kind: "outline", + kind: "inverse", color: "primary", - wider: true, className: [ - "k1-border-primary-strong k1-text-primary k1-gap-4", + "k1-border-primary-strong k1-text-primary", "data-[hover]:k1-border-primary-strong-hover data-[hover]:k1-text-neutral-inverse data-[hover]:k1-bg-primary-strong-hover", "data-[active]:k1-bg-primary-strong data-[active]:k1-text-neutral-inverse data-[active]:k1-border-primary-strong-active", ], }, { - kind: "outline", + kind: "inverse", color: "secondary", - wider: true, className: [ - "k1-border-secondary-strong k1-text-secondary k1-gap-4", + "k1-border-secondary-strong k1-text-secondary", "data-[hover]:k1-border-secondary-strong-hover data-[hover]:k1-text-neutral-inverse data-[hover]:k1-bg-secondary-strong-hover", "data-[active]:k1-bg-secondary-strong data-[active]:k1-text-neutral-inverse data-[active]:k1-border-secondary-strong-active", ], }, { - kind: "outline", + kind: "inverse", color: "neutral", - wider: true, className: [ "k1-border-neutral-strong k1-text-neutral k1-gap-4", "data-[hover]:k1-border-neutral-strong-hover data-[hover]:k1-text-neutral-inverse data-[hover]:k1-bg-neutral-strong-hover", @@ -131,12 +129,14 @@ const Button = React.forwardRef( return ( {hasIcon ? : null} - {!compactable ? children : null} +
+ {children} +
); }, diff --git a/packages/design-system/src/buttonAgainst.tsx b/packages/design-system/src/buttonAgainst.tsx index 52beeb8..fc52f9f 100644 --- a/packages/design-system/src/buttonAgainst.tsx +++ b/packages/design-system/src/buttonAgainst.tsx @@ -8,17 +8,18 @@ type Props = React.ButtonHTMLAttributes & export default function ButtonAgainst(props: Props) { return ( ); } diff --git a/packages/design-system/src/buttonInFavour.tsx b/packages/design-system/src/buttonInFavour.tsx index 7fccc97..8813f9d 100644 --- a/packages/design-system/src/buttonInFavour.tsx +++ b/packages/design-system/src/buttonInFavour.tsx @@ -8,17 +8,18 @@ type Props = React.ButtonHTMLAttributes & export default function ButtonInFavour(props: Props) { return ( ); } diff --git a/packages/design-system/src/buttonNeutral.tsx b/packages/design-system/src/buttonNeutral.tsx index 508120e..cdf87ae 100644 --- a/packages/design-system/src/buttonNeutral.tsx +++ b/packages/design-system/src/buttonNeutral.tsx @@ -8,17 +8,18 @@ type Props = React.ButtonHTMLAttributes & export default function ButtonNeutral(props: Props) { return ( ); }