Skip to content

Commit

Permalink
fix prettier tailwind config
Browse files Browse the repository at this point in the history
  • Loading branch information
baktun14 committed Jun 12, 2024
1 parent c47c4d3 commit e9ab453
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 30 deletions.
2 changes: 1 addition & 1 deletion apps/deploy-web/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('@akashnetwork/ui/postcss')
module.exports = require("@akashnetwork/ui/postcss");
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/dev-config/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ module.exports = {
arrowParens: "avoid",
endOfLine: "crlf",
htmlWhitespaceSensitivity: "strict",
plugins: ["prettier-plugin-tailwindcss"]
plugins: ["prettier-plugin-tailwindcss"],
tailwindFunctions: ["cva"]
};
1 change: 1 addition & 0 deletions packages/ui/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/dev-config/.prettierrc");
43 changes: 15 additions & 28 deletions packages/ui/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
asChild?: boolean;
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
}
);
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />;
});
Button.displayName = "Button";

export { Button, buttonVariants };

0 comments on commit e9ab453

Please sign in to comment.