Skip to content

Commit

Permalink
prettier, lint and shortcut changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaromír Trnka authored and Jaromír Trnka committed Apr 12, 2024
1 parent fd10d4a commit fd314cb
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 308 deletions.
40 changes: 20 additions & 20 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"semi": true,
"experimentalTernaries": true,
"singleQuote": false,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"trailingComma": "all",
"singleAttributePerLine": true,
"htmlWhitespaceSensitivity": "css",
"vueIndentScriptAndStyle": false,
"proseWrap": "never",
"insertPragma": false,
"printWidth": 100,
"requirePragma": false,
"tabWidth": 4,
"useTabs": false,
"embeddedLanguageFormatting": "auto",
"plugins": ["prettier-plugin-tailwindcss"]
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"semi": true,
"experimentalTernaries": true,
"singleQuote": false,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"trailingComma": "all",
"singleAttributePerLine": true,
"htmlWhitespaceSensitivity": "css",
"vueIndentScriptAndStyle": false,
"proseWrap": "never",
"insertPragma": false,
"printWidth": 100,
"requirePragma": false,
"tabWidth": 4,
"useTabs": false,
"embeddedLanguageFormatting": "auto",
"plugins": ["prettier-plugin-tailwindcss"]
}
14 changes: 7 additions & 7 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function Home() {
initial={{ translateY: -100 }}
animate={{ translateY: 0 }}
transition={{ duration: 0.5, delay: 1, ease: cubicBezier(0.4, 0, 0.2, 1) }}
className="relative top-0 z-50 grid h-fit grid-cols-[inherit] border-b bg-background/50 py-3 shadow-2xl shadow-background/50 backdrop-blur-xl [grid-column:page]"
className="relative top-0 z-50 grid h-fit grid-cols-[inherit] border-b !bg-background/50 py-3 shadow-2xl shadow-background/50 [grid-column:page]"
>
<header className="flex items-end justify-between [grid-column:content]">
<Typography variant="h1">Diorama</Typography>
Expand All @@ -63,7 +63,10 @@ export default function Home() {
asChild
>
<kbd>
<span className="text-xs"></span>K
<span className="text-xs">
{/Mac/.test(navigator.userAgent) ? "⌘" : "ctrl"}
</span>{" "}
K
</kbd>
</Typography>
<Typography variant="muted">to search dioramas</Typography>
Expand All @@ -73,14 +76,11 @@ export default function Home() {
onOpenChange={setCommandOpen}
>
<CommandInput placeholder="Search diorama..." />
<CommandList>
<CommandList className="py-2">
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup>
<CommandItem>
<span>Calendar</span>
</CommandItem>
<CommandItem>
<span>Calendar2</span>
<span>WIP</span>
</CommandItem>
</CommandGroup>
</CommandList>
Expand Down
10 changes: 5 additions & 5 deletions components/ui/aurora.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ export const AuroraBackground = ({
<div
className={cn(
`
after:animate-aurora
pointer-events-none
absolute
-inset-[10px]
opacity-50
blur-[2px]
invert
filter will-change-transform [--aurora:repeating-linear-gradient(100deg,var(--blue-500)_10%,var(--indigo-300)_15%,var(--blue-300)_20%,var(--violet-200)_25%,var(--blue-400)_30%)] [--dark-gradient:repeating-linear-gradient(100deg,var(--black)_0%,var(--black)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--black)_16%)]
[--white-gradient:repeating-linear-gradient(100deg,var(--white)_0%,var(--white)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--white)_16%)] [background-image:var(--white-gradient),var(--aurora)] [background-position:50%_50%,50%_50%] [background-size:300%,_200%]
after:absolute
after:inset-0
filter
will-change-transform [--aurora:repeating-linear-gradient(100deg,var(--blue-500)_10%,var(--indigo-300)_15%,var(--blue-300)_20%,var(--violet-200)_25%,var(--blue-400)_30%)] [--dark-gradient:repeating-linear-gradient(100deg,var(--black)_0%,var(--black)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--black)_16%)] [--white-gradient:repeating-linear-gradient(100deg,var(--white)_0%,var(--white)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--white)_16%)]
[background-image:var(--white-gradient),var(--aurora)] [background-position:50%_50%,50%_50%] [background-size:300%,_200%] after:absolute
after:inset-0
after:animate-aurora
after:mix-blend-difference after:content-[""] after:[background-attachment:fixed]
after:[background-image:var(--white-gradient),var(--aurora)]
after:[background-size:200%,_100%]`,
Expand Down
92 changes: 45 additions & 47 deletions components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,57 +1,55 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";

import { cn } from "@/lib/utils"
import { cn } from "@/lib/utils";

const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default:
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
outline:
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-9 px-4 py-2",
sm: "h-8 rounded-md px-3 text-xs",
lg: "h-10 rounded-md px-8",
icon: "h-9 w-9",
},
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
outline:
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-9 px-4 py-2",
sm: "h-8 rounded-md px-3 text-xs",
lg: "h-10 rounded-md px-8",
icon: "size-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
);

export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean
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}
/>
)
}
)
Button.displayName = "Button"
({ 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 }
export { Button, buttonVariants };
Loading

0 comments on commit fd314cb

Please sign in to comment.