Skip to content

Commit ed319b3

Browse files
fix ai style hallucinations
1 parent 5539211 commit ed319b3

13 files changed

Lines changed: 281 additions & 503 deletions

src/components/custom/coockie-consent.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ export default function CookieConsent({ demo, onAcceptCallback, onDeclineCallbac
5555
return (
5656
<div
5757
className={cn(
58-
'fixed bottom-0 left-0 right-0 z-200 w-full transition-transform duration-700 sm:bottom-4 sm:left-4 sm:max-w-md',
58+
'fixed right-0 bottom-0 left-0 z-[200] w-full transition-transform duration-700 sm:bottom-4 sm:left-4 sm:max-w-md',
5959
!isOpen
6060
? 'translate-y-8 opacity-0 transition-[opacity,transform]'
6161
: 'translate-y-0 opacity-100 transition-[opacity,transform]',
6262
hide && 'hidden'
6363
)}
6464
>
65-
<div className="m-2 rounded-md bg-secondary">
65+
<div className="bg-secondary m-2 rounded-md">
6666
<div className="grid gap-2">
67-
<div className="flex h-14 items-center justify-between border-b border-border p-4">
67+
<div className="border-border flex h-14 items-center justify-between border-b p-4">
6868
<h1 className="text-lg font-medium"> {t('cookie_consent.title', { ns: ['main'] })}</h1>
6969
<CookieIcon className="h-[1.2rem] w-[1.2rem]" />
7070
</div>
@@ -84,7 +84,7 @@ export default function CookieConsent({ demo, onAcceptCallback, onDeclineCallbac
8484
</a>
8585
</p>
8686
</div>
87-
<div className="flex gap-2 border-t border-border bg-background/20 p-4 py-5">
87+
<div className="border-border bg-background/20 flex gap-2 border-t p-4 py-5">
8888
<Button onClick={accept} className="w-full">
8989
{t('cookie_consent.accept', { ns: ['main'] })}
9090
</Button>

src/components/custom/multiple-selector.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
361361
>
362362
<div
363363
className={cn(
364-
'min-h-10 rounded-md border border-input text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2',
364+
'border-input ring-offset-background focus-within:ring-ring min-h-10 rounded-md border text-sm focus-within:ring-2 focus-within:ring-offset-2',
365365
{
366366
'px-3 py-2': selected.length !== 0,
367367
'cursor-text': !disabled && selected.length !== 0,
@@ -379,8 +379,8 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
379379
<Badge
380380
key={option.value}
381381
className={cn(
382-
'data-disabled:bg-muted-foreground data-disabled:text-muted data-disabled:hover:bg-muted-foreground',
383-
'data-fixed:bg-muted-foreground data-fixed:text-muted data-fixed:hover:bg-muted-foreground',
382+
'data-[disabled]:bg-muted-foreground data-[disabled]:text-muted data-[disabled]:hover:bg-muted-foreground',
383+
'data-[fixed]:bg-muted-foreground data-[fixed]:text-muted data-[fixed]:hover:bg-muted-foreground',
384384
badgeClassName
385385
)}
386386
data-fixed={option.fixed}
@@ -389,7 +389,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
389389
{option.label}
390390
<button
391391
className={cn(
392-
'ml-1 rounded-full outline-hidden ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2',
392+
'ring-offset-background focus:ring-ring ml-1 rounded-full outline-none focus:ring-2 focus:ring-offset-2',
393393
(disabled || option.fixed) && 'hidden'
394394
)}
395395
onKeyDown={(e) => {
@@ -403,7 +403,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
403403
}}
404404
onClick={() => handleUnselect(option)}
405405
>
406-
<X className="h-3 w-3 text-muted-foreground hover:text-foreground" />
406+
<X className="text-muted-foreground hover:text-foreground h-3 w-3" />
407407
</button>
408408
</Badge>
409409
)
@@ -431,7 +431,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
431431
}}
432432
placeholder={hidePlaceholderWhenSelected && selected.length !== 0 ? '' : placeholder}
433433
className={cn(
434-
'flex-1 bg-transparent outline-hidden placeholder:text-muted-foreground',
434+
'placeholder:text-muted-foreground flex-1 bg-transparent outline-none',
435435
{
436436
'w-full': hidePlaceholderWhenSelected,
437437
'px-3 py-2': selected.length === 0,
@@ -457,7 +457,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
457457
</div>
458458
<div className="relative">
459459
{open && (
460-
<CommandList className="absolute top-1 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-hidden animate-in">
460+
<CommandList className="bg-popover text-popover-foreground animate-in absolute top-1 z-10 w-full rounded-md border shadow-md outline-none">
461461
{isLoading ? (
462462
<>{loadingIndicator}</>
463463
) : (
@@ -488,7 +488,7 @@ const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorP
488488
setSelected(newOptions)
489489
onChange?.(newOptions)
490490
}}
491-
className={cn('cursor-pointer', option.disable && 'cursor-default text-muted-foreground')}
491+
className={cn('cursor-pointer', option.disable && 'text-muted-foreground cursor-default')}
492492
>
493493
{option.label}
494494
</CommandItem>

src/components/ui/badge.tsx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
1-
import * as React from "react"
2-
import { cva, type VariantProps } from "class-variance-authority"
1+
import * as React from 'react'
2+
import { cva, type VariantProps } from 'class-variance-authority'
33

4-
import { cn } from "@/lib/utils"
4+
import { cn } from '@/lib/utils'
55

66
const badgeVariants = cva(
7-
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",
7+
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
88
{
99
variants: {
1010
variant: {
11-
default:
12-
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
13-
secondary:
14-
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15-
destructive:
16-
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
17-
outline: "text-foreground",
11+
default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
12+
secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
13+
destructive: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
14+
outline: 'text-foreground',
1815
},
1916
},
2017
defaultVariants: {
21-
variant: "default",
18+
variant: 'default',
2219
},
2320
}
2421
)
2522

26-
export interface BadgeProps
27-
extends React.HTMLAttributes<HTMLDivElement>,
28-
VariantProps<typeof badgeVariants> {}
23+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
2924

3025
function Badge({ className, variant, ...props }: BadgeProps) {
31-
return (
32-
<div className={cn(badgeVariants({ variant }), className)} {...props} />
33-
)
26+
return <div className={cn(badgeVariants({ variant }), className)} {...props} />
3427
}
3528

3629
export { Badge, badgeVariants }

src/components/ui/button.tsx

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,46 @@
1-
import * as React from "react"
2-
import { Slot } from "@radix-ui/react-slot"
3-
import { cva, type VariantProps } from "class-variance-authority"
1+
import * as React from 'react'
2+
import { Slot } from '@radix-ui/react-slot'
3+
import { cva, type VariantProps } from 'class-variance-authority'
44

5-
import { cn } from "@/lib/utils"
5+
import { cn } from '@/lib/utils'
66

77
const buttonVariants = cva(
8-
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
8+
'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',
99
{
1010
variants: {
1111
variant: {
12-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
13-
destructive:
14-
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
15-
outline:
16-
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
17-
secondary:
18-
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
19-
ghost: "hover:bg-accent hover:text-accent-foreground",
20-
link: "text-primary underline-offset-4 hover:underline",
12+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
13+
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
14+
outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
15+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
16+
ghost: 'hover:bg-accent hover:text-accent-foreground',
17+
link: 'text-primary underline-offset-4 hover:underline',
2118
},
2219
size: {
23-
default: "h-10 px-4 py-2",
24-
sm: "h-9 rounded-md px-3",
25-
lg: "h-11 rounded-md px-8",
26-
icon: "h-10 w-10",
20+
default: 'h-10 px-4 py-2',
21+
sm: 'h-9 rounded-md px-3',
22+
lg: 'h-11 rounded-md px-8',
23+
icon: 'h-10 w-10',
2724
},
2825
},
2926
defaultVariants: {
30-
variant: "default",
31-
size: "default",
27+
variant: 'default',
28+
size: 'default',
3229
},
3330
}
3431
)
3532

3633
export interface ButtonProps
37-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38-
VariantProps<typeof buttonVariants> {
34+
extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
3935
asChild?: boolean
4036
}
4137

4238
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
4339
({ className, variant, size, asChild = false, ...props }, ref) => {
44-
const Comp = asChild ? Slot : "button"
45-
return (
46-
<Comp
47-
className={cn(buttonVariants({ variant, size, className }))}
48-
ref={ref}
49-
{...props}
50-
/>
51-
)
40+
const Comp = asChild ? Slot : 'button'
41+
return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
5242
}
5343
)
54-
Button.displayName = "Button"
44+
Button.displayName = 'Button'
5545

5646
export { Button, buttonVariants }

src/components/ui/card.tsx

Lines changed: 36 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,41 @@
1-
import * as React from "react"
1+
import * as React from 'react'
22

3-
import { cn } from "@/lib/utils"
3+
import { cn } from '@/lib/utils'
44

5-
const Card = React.forwardRef<
6-
HTMLDivElement,
7-
React.HTMLAttributes<HTMLDivElement>
8-
>(({ className, ...props }, ref) => (
9-
<div
10-
ref={ref}
11-
className={cn(
12-
"rounded-lg border bg-card text-card-foreground shadow-xs",
13-
className
14-
)}
15-
{...props}
16-
/>
5+
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
6+
<div ref={ref} className={cn('bg-card text-card-foreground rounded-lg border shadow-sm', className)} {...props} />
177
))
18-
Card.displayName = "Card"
19-
20-
const CardHeader = React.forwardRef<
21-
HTMLDivElement,
22-
React.HTMLAttributes<HTMLDivElement>
23-
>(({ className, ...props }, ref) => (
24-
<div
25-
ref={ref}
26-
className={cn("flex flex-col space-y-1.5 p-6", className)}
27-
{...props}
28-
/>
29-
))
30-
CardHeader.displayName = "CardHeader"
31-
32-
const CardTitle = React.forwardRef<
33-
HTMLParagraphElement,
34-
React.HTMLAttributes<HTMLHeadingElement>
35-
>(({ className, ...props }, ref) => (
36-
<h3
37-
ref={ref}
38-
className={cn(
39-
"text-2xl font-semibold leading-none tracking-tight",
40-
className
41-
)}
42-
{...props}
43-
/>
44-
))
45-
CardTitle.displayName = "CardTitle"
46-
47-
const CardDescription = React.forwardRef<
48-
HTMLParagraphElement,
49-
React.HTMLAttributes<HTMLParagraphElement>
50-
>(({ className, ...props }, ref) => (
51-
<p
52-
ref={ref}
53-
className={cn("text-sm text-muted-foreground", className)}
54-
{...props}
55-
/>
56-
))
57-
CardDescription.displayName = "CardDescription"
58-
59-
const CardContent = React.forwardRef<
60-
HTMLDivElement,
61-
React.HTMLAttributes<HTMLDivElement>
62-
>(({ className, ...props }, ref) => (
63-
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
64-
))
65-
CardContent.displayName = "CardContent"
66-
67-
const CardFooter = React.forwardRef<
68-
HTMLDivElement,
69-
React.HTMLAttributes<HTMLDivElement>
70-
>(({ className, ...props }, ref) => (
71-
<div
72-
ref={ref}
73-
className={cn("flex items-center p-6 pt-0", className)}
74-
{...props}
75-
/>
76-
))
77-
CardFooter.displayName = "CardFooter"
8+
Card.displayName = 'Card'
9+
10+
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
11+
({ className, ...props }, ref) => (
12+
<div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
13+
)
14+
)
15+
CardHeader.displayName = 'CardHeader'
16+
17+
const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
18+
({ className, ...props }, ref) => (
19+
<h3 ref={ref} className={cn('text-2xl leading-none font-semibold tracking-tight', className)} {...props} />
20+
)
21+
)
22+
CardTitle.displayName = 'CardTitle'
23+
24+
const CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
25+
({ className, ...props }, ref) => (
26+
<p ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
27+
)
28+
)
29+
CardDescription.displayName = 'CardDescription'
30+
31+
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
32+
({ className, ...props }, ref) => <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
33+
)
34+
CardContent.displayName = 'CardContent'
35+
36+
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
37+
({ className, ...props }, ref) => <div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
38+
)
39+
CardFooter.displayName = 'CardFooter'
7840

7941
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }

0 commit comments

Comments
 (0)