From ef676305aeca2cb9299aa589b7422ac91c7bcf17 Mon Sep 17 00:00:00 2001 From: Julian Roeland Date: Wed, 31 Jan 2024 16:44:59 +0100 Subject: [PATCH] :sparkles: #19 - feat: Implemented the Tabs component --- src/components/button/button.tsx | 16 +++++-- src/components/index.ts | 1 + src/components/tabs/index.ts | 1 + src/components/tabs/tabs.scss | 49 ++++++++++++++++++++++ src/components/tabs/tabs.stories.tsx | 54 ++++++++++++++++++++++++ src/components/tabs/tabs.tsx | 62 ++++++++++++++++++++++++++++ src/settings/tokens.css | 6 +++ 7 files changed, 185 insertions(+), 4 deletions(-) create mode 100644 src/components/tabs/index.ts create mode 100644 src/components/tabs/tabs.scss create mode 100644 src/components/tabs/tabs.stories.tsx create mode 100644 src/components/tabs/tabs.tsx diff --git a/src/components/button/button.tsx b/src/components/button/button.tsx index fe53c65c..9b4b7c0c 100644 --- a/src/components/button/button.tsx +++ b/src/components/button/button.tsx @@ -6,6 +6,7 @@ import "./button.scss"; type BaseButtonProps = { square?: boolean; variant?: "primary" | "outline" | "transparent"; + className?: string; }; export type ButtonProps = React.ButtonHTMLAttributes & @@ -17,17 +18,24 @@ export type ButtonLinkProps = React.AnchorHTMLAttributes & /** * Button component * @param variant + * @param square + * @param className * @param props * @constructor */ export const Button = React.forwardRef( - ({ square = false, variant = "primary", ...props }, ref) => { + ({ square = false, variant = "primary", className, ...props }, ref) => { return ( + {index < tabs.length - 1 &&

|

} + + ))} + +
{tabs[activeTab].content}
+ + ); +}; diff --git a/src/settings/tokens.css b/src/settings/tokens.css index b1e264b2..9f53a233 100644 --- a/src/settings/tokens.css +++ b/src/settings/tokens.css @@ -11,6 +11,7 @@ --theme-color-primary-600: #8d75e6; --theme-color-primary-400: #bdb0ed; --theme-color-primary-200: #ecf1ff; + --theme-color-primary-100: #f2eeff; --theme-color-tertiary-800: #0f172a; --theme-color-tertiary-700: #1e293b; @@ -19,9 +20,13 @@ --theme-shade-1000: #000; --theme-shade-900: #272727; + --theme-shade-800: #4b4b4b; --theme-shade-700: #545454; --theme-shade-400: #b3b3b3; --theme-shade-300: #eaeaea; + --theme-shade-200: #e6e6e6; + --theme-shade-100: #f1f1f1; + --theme-shade-50: #fcfcfc; --theme-shade-0: #fff; --theme-color-success-body: #0b4f00; @@ -33,6 +38,7 @@ /* SPACING */ --border-radus-l: 12px; --border-radus-m: 6px; + --border-radus-s: 4px; --gutter-h-desktop: 12px; --gutter-v-desktop: 24px;