From b9ef5a2b46078fdd81343bb7e37553678e6e8c36 Mon Sep 17 00:00:00 2001 From: ghost2023 Date: Wed, 20 May 2026 11:35:00 +0300 Subject: [PATCH] style: finish based global them --- .../src/components/Button/Button.tsx | 57 ------------ .../ui-common/src/components/Button/index.ts | 2 - .../src/components/Layout/DashboardLayout.tsx | 12 +-- .../src/components/Layout/Sidebar.tsx | 13 ++- packages/ui-common/src/components/card.tsx | 92 +++++++++++++++++++ packages/ui-common/src/components/input.tsx | 21 +++++ packages/ui-common/src/components/table.tsx | 2 +- packages/ui-common/src/index.ts | 13 +-- packages/ui-common/src/styles/index.css | 26 +++--- 9 files changed, 143 insertions(+), 95 deletions(-) delete mode 100644 packages/ui-common/src/components/Button/Button.tsx delete mode 100644 packages/ui-common/src/components/Button/index.ts create mode 100644 packages/ui-common/src/components/card.tsx create mode 100644 packages/ui-common/src/components/input.tsx diff --git a/packages/ui-common/src/components/Button/Button.tsx b/packages/ui-common/src/components/Button/Button.tsx deleted file mode 100644 index 04ddd10ad..000000000 --- a/packages/ui-common/src/components/Button/Button.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { ButtonHTMLAttributes, forwardRef } from "react"; -import clsx from "clsx"; - -export type ButtonVariant = "primary" | "secondary" | "ghost" | "danger"; -export type ButtonSize = "sm" | "md" | "lg"; - -export interface ButtonProps extends ButtonHTMLAttributes { - variant?: ButtonVariant; - size?: ButtonSize; - isLoading?: boolean; -} - -const variantClasses: Record = { - primary: "bg-blue-600 text-white hover:bg-blue-700 disabled:bg-blue-300", - secondary: "bg-gray-100 text-gray-900 hover:bg-gray-200 disabled:bg-gray-50", - ghost: "bg-transparent text-gray-900 hover:bg-gray-100", - danger: "bg-red-600 text-white hover:bg-red-700 disabled:bg-red-300", -}; - -const sizeClasses: Record = { - sm: "px-3 py-1.5 text-sm", - md: "px-4 py-2 text-base", - lg: "px-6 py-3 text-lg", -}; - -const Button = forwardRef( - ( - { - variant = "primary", - size = "md", - isLoading, - disabled, - className, - children, - ...rest - }, - ref, - ) => ( - - ), -); - -Button.displayName = "Button"; - -export default Button; diff --git a/packages/ui-common/src/components/Button/index.ts b/packages/ui-common/src/components/Button/index.ts deleted file mode 100644 index 55968f63d..000000000 --- a/packages/ui-common/src/components/Button/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from "./Button"; -export type { ButtonProps, ButtonVariant, ButtonSize } from "./Button"; diff --git a/packages/ui-common/src/components/Layout/DashboardLayout.tsx b/packages/ui-common/src/components/Layout/DashboardLayout.tsx index c5e8b9090..2dc2eb2fe 100644 --- a/packages/ui-common/src/components/Layout/DashboardLayout.tsx +++ b/packages/ui-common/src/components/Layout/DashboardLayout.tsx @@ -123,7 +123,7 @@ const DashboardLayout = ({ ) : null; return ( -
+
-
-
- {title} -
+
+
{title}
-
- {children} -
+
{children}
); diff --git a/packages/ui-common/src/components/Layout/Sidebar.tsx b/packages/ui-common/src/components/Layout/Sidebar.tsx index 7653b8c10..96121cbb2 100644 --- a/packages/ui-common/src/components/Layout/Sidebar.tsx +++ b/packages/ui-common/src/components/Layout/Sidebar.tsx @@ -22,11 +22,11 @@ const Sidebar = ({ onNavigate, headerExtra, }: SidebarProps) => ( -