diff --git a/pkgs/webview-ui/app/src/components/button/index.tsx b/pkgs/webview-ui/app/src/components/button/index.tsx index 1571d2227..a49755833 100644 --- a/pkgs/webview-ui/app/src/components/button/index.tsx +++ b/pkgs/webview-ui/app/src/components/button/index.tsx @@ -1,11 +1,13 @@ import { splitProps, type JSX } from "solid-js"; import cx from "classnames"; +import { Typography } from "../Typography"; -type Variants = "dark" | "light"; +type Variants = "dark" | "light" | "ghost"; type Size = "default" | "s"; const variantColors: Record = { dark: cx( + "border border-solid", "border-secondary-950 bg-primary-900 text-white", "shadow-inner-primary", // Hover state @@ -18,6 +20,7 @@ const variantColors: Record = { "disabled:bg-secondary-200 disabled:text-secondary-700 disabled:border-secondary-300", ), light: cx( + "border border-solid", "border-secondary-800 bg-secondary-100 text-secondary-800", "shadow-inner-secondary", // Hover state @@ -29,6 +32,17 @@ const variantColors: Record = { // Disabled "disabled:bg-secondary-50 disabled:text-secondary-200 disabled:border-secondary-700", ), + ghost: cx( + // "shadow-inner-secondary", + // Hover state + // Focus state + // Active state + "hover:bg-secondary-200 hover:text-secondary-900", + "focus:bg-secondary-200 focus:text-secondary-900", + "active:bg-secondary-200 active:text-secondary-950 active:shadow-inner-secondary-active", + // Disabled + "disabled:bg-secondary-50 disabled:text-secondary-200 disabled:border-secondary-700", + ), }; const sizePaddings: Record = { @@ -36,6 +50,11 @@ const sizePaddings: Record = { s: cx("rounded-sm py-[0.375rem] px-3"), }; +const sizeFont: Record = { + default: cx("text-[0.8125rem]"), + s: cx("text-[0.75rem]"), +}; + interface ButtonProps extends JSX.ButtonHTMLAttributes { variant?: Variants; size?: Size; @@ -60,11 +79,13 @@ export const Button = (props: ButtonProps) => { // Layout "inline-flex items-center flex-shrink gap-2 justify-center", // Styles - "border border-solid", "p-4", sizePaddings[local.size || "default"], // Colors variantColors[local.variant || "dark"], + //Font + "leading-none font-semibold", + sizeFont[local.size || "default"], )} {...other} >