diff --git a/apps/deploy-web/postcss.config.js b/apps/deploy-web/postcss.config.js index 6cf694c32..cefb51f3b 100644 --- a/apps/deploy-web/postcss.config.js +++ b/apps/deploy-web/postcss.config.js @@ -1 +1 @@ -module.exports = require('@akashnetwork/ui/postcss') \ No newline at end of file +module.exports = require("@akashnetwork/ui/postcss"); diff --git a/package-lock.json b/package-lock.json index 0512b0b04..5efa03042 100644 --- a/package-lock.json +++ b/package-lock.json @@ -774,6 +774,7 @@ "zod": "^3.22.4" }, "devDependencies": { + "@akashnetwork/dev-config": "*", "@types/json2csv": "^5.0.7", "@types/node": "20.14.0", "@types/react": "18.2.0", diff --git a/packages/dev-config/.prettierrc.js b/packages/dev-config/.prettierrc.js index 33dbfa88d..d8cf64764 100644 --- a/packages/dev-config/.prettierrc.js +++ b/packages/dev-config/.prettierrc.js @@ -13,5 +13,6 @@ module.exports = { arrowParens: "avoid", endOfLine: "crlf", htmlWhitespaceSensitivity: "strict", - plugins: ["prettier-plugin-tailwindcss"] + plugins: ["prettier-plugin-tailwindcss"], + tailwindFunctions: ["cva"] }; diff --git a/packages/ui/.prettierrc.js b/packages/ui/.prettierrc.js new file mode 100644 index 000000000..8e89b39c8 --- /dev/null +++ b/packages/ui/.prettierrc.js @@ -0,0 +1 @@ +module.exports = require("@akashnetwork/dev-config/.prettierrc"); diff --git a/packages/ui/components/button.tsx b/packages/ui/components/button.tsx index de942afec..85a987402 100644 --- a/packages/ui/components/button.tsx +++ b/packages/ui/components/button.tsx @@ -5,53 +5,40 @@ import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "../utils/cn"; const buttonVariants = cva( - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", + "ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { default: "bg-primary text-primary-foreground hover:bg-primary/90", - destructive: - "bg-destructive text-destructive-foreground hover:bg-destructive/90", - outline: - "border border-input bg-background hover:bg-accent hover:text-accent-foreground", - secondary: - "bg-secondary text-secondary-foreground hover:bg-secondary/80", - ghost: "cursor-pointer hover:bg-accent hover:text-accent-foreground", + destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", + outline: "border-input bg-background hover:bg-accent hover:text-accent-foreground border", + secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", + ghost: "hover:bg-accent hover:text-accent-foreground cursor-pointer", text: "hover:text-primary text-current", - link: "text-primary underline-offset-4 hover:underline", + link: "text-primary underline-offset-4 hover:underline" }, size: { default: "h-10 px-4 py-2", sm: "h-9 rounded-md px-3", lg: "h-11 rounded-md px-8", - icon: "h-10 w-10", - }, + icon: "h-10 w-10" + } }, defaultVariants: { variant: "default", - size: "default", - }, + size: "default" + } } ); -export interface ButtonProps - extends React.ButtonHTMLAttributes, - VariantProps { +export interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { asChild?: boolean; } -const Button = React.forwardRef( - ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : "button"; - return ( - - ); - } -); +const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => { + const Comp = asChild ? Slot : "button"; + return ; +}); Button.displayName = "Button"; export { Button, buttonVariants };