Skip to content

Commit f46e3aa

Browse files
committed
format adjustments
1 parent 7a69703 commit f46e3aa

File tree

4 files changed

+241
-239
lines changed

4 files changed

+241
-239
lines changed

components/ui/dialog.tsx

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
import * as React from "react"
2-
import * as DialogPrimitive from "@radix-ui/react-dialog"
3-
import { XIcon } from "lucide-react"
1+
/* eslint-disable linebreak-style */
2+
/* eslint-disable react/prop-types */
3+
import * as React from 'react';
4+
import * as DialogPrimitive from '@radix-ui/react-dialog';
5+
import { XIcon } from 'lucide-react';
46

5-
import { cn } from "@/lib/utils"
7+
import { cn } from '@/lib/utils';
68

79
function Dialog({
810
...props
911
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
10-
return <DialogPrimitive.Root data-slot="dialog" {...props} />
12+
return <DialogPrimitive.Root data-slot='dialog' {...props} />;
1113
}
1214

1315
function DialogTrigger({
1416
...props
1517
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
16-
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
18+
return <DialogPrimitive.Trigger data-slot='dialog-trigger' {...props} />;
1719
}
1820

1921
function DialogPortal({
2022
...props
2123
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
22-
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
24+
return <DialogPrimitive.Portal data-slot='dialog-portal' {...props} />;
2325
}
2426

2527
function DialogClose({
2628
...props
2729
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
28-
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
30+
return <DialogPrimitive.Close data-slot='dialog-close' {...props} />;
2931
}
3032

3133
function DialogOverlay({
@@ -34,14 +36,14 @@ function DialogOverlay({
3436
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
3537
return (
3638
<DialogPrimitive.Overlay
37-
data-slot="dialog-overlay"
39+
data-slot='dialog-overlay'
3840
className={cn(
39-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
40-
className
41+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
42+
className,
4143
)}
4244
{...props}
4345
/>
44-
)
46+
);
4547
}
4648

4749
function DialogContent({
@@ -50,55 +52,55 @@ function DialogContent({
5052
showCloseButton = true,
5153
...props
5254
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
53-
showCloseButton?: boolean
55+
showCloseButton?: boolean;
5456
}) {
5557
return (
56-
<DialogPortal data-slot="dialog-portal">
58+
<DialogPortal data-slot='dialog-portal'>
5759
<DialogOverlay />
5860
<DialogPrimitive.Content
59-
data-slot="dialog-content"
61+
data-slot='dialog-content'
6062
className={cn(
61-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
62-
className
63+
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
64+
className,
6365
)}
6466
{...props}
6567
>
6668
{children}
6769
{showCloseButton && (
6870
<DialogPrimitive.Close
69-
data-slot="dialog-close"
71+
data-slot='dialog-close'
7072
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
7173
>
7274
<XIcon />
73-
<span className="sr-only">Close</span>
75+
<span className='sr-only'>Close</span>
7476
</DialogPrimitive.Close>
7577
)}
7678
</DialogPrimitive.Content>
7779
</DialogPortal>
78-
)
80+
);
7981
}
8082

81-
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
83+
function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
8284
return (
8385
<div
84-
data-slot="dialog-header"
85-
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
86+
data-slot='dialog-header'
87+
className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
8688
{...props}
8789
/>
88-
)
90+
);
8991
}
9092

91-
function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
93+
function DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {
9294
return (
9395
<div
94-
data-slot="dialog-footer"
96+
data-slot='dialog-footer'
9597
className={cn(
96-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
97-
className
98+
'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',
99+
className,
98100
)}
99101
{...props}
100102
/>
101-
)
103+
);
102104
}
103105

104106
function DialogTitle({
@@ -107,11 +109,11 @@ function DialogTitle({
107109
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
108110
return (
109111
<DialogPrimitive.Title
110-
data-slot="dialog-title"
111-
className={cn("text-lg leading-none font-semibold", className)}
112+
data-slot='dialog-title'
113+
className={cn('text-lg leading-none font-semibold', className)}
112114
{...props}
113115
/>
114-
)
116+
);
115117
}
116118

117119
function DialogDescription({
@@ -120,11 +122,11 @@ function DialogDescription({
120122
}: React.ComponentProps<typeof DialogPrimitive.Description>) {
121123
return (
122124
<DialogPrimitive.Description
123-
data-slot="dialog-description"
124-
className={cn("text-muted-foreground text-sm", className)}
125+
data-slot='dialog-description'
126+
className={cn('text-muted-foreground text-sm', className)}
125127
{...props}
126128
/>
127-
)
129+
);
128130
}
129131

130132
export {
@@ -138,4 +140,4 @@ export {
138140
DialogPortal,
139141
DialogTitle,
140142
DialogTrigger,
141-
}
143+
};

components/ui/table.tsx

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,107 @@
1-
import * as React from "react"
1+
/* eslint-disable linebreak-style */
2+
/* eslint-disable react/prop-types */
3+
import * as React from 'react';
24

3-
import { cn } from "@/lib/utils"
5+
import { cn } from '@/lib/utils';
46

5-
function Table({ className, ...props }: React.ComponentProps<"table">) {
7+
function Table({ className, ...props }: React.ComponentProps<'table'>) {
68
return (
79
<div
8-
data-slot="table-container"
9-
className="relative w-full overflow-x-auto"
10+
data-slot='table-container'
11+
className='relative w-full overflow-x-auto'
1012
>
1113
<table
12-
data-slot="table"
13-
className={cn("w-full caption-bottom text-sm", className)}
14+
data-slot='table'
15+
className={cn('w-full caption-bottom text-sm', className)}
1416
{...props}
1517
/>
1618
</div>
17-
)
19+
);
1820
}
1921

20-
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
22+
function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
2123
return (
2224
<thead
23-
data-slot="table-header"
24-
className={cn("[&_tr]:border-b", className)}
25+
data-slot='table-header'
26+
className={cn('[&_tr]:border-b', className)}
2527
{...props}
2628
/>
27-
)
29+
);
2830
}
2931

30-
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
32+
function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
3133
return (
3234
<tbody
33-
data-slot="table-body"
34-
className={cn("[&_tr:last-child]:border-0", className)}
35+
data-slot='table-body'
36+
className={cn('[&_tr:last-child]:border-0', className)}
3537
{...props}
3638
/>
37-
)
39+
);
3840
}
3941

40-
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
42+
function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
4143
return (
4244
<tfoot
43-
data-slot="table-footer"
45+
data-slot='table-footer'
4446
className={cn(
45-
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
46-
className
47+
'bg-muted/50 border-t font-medium [&>tr]:last:border-b-0',
48+
className,
4749
)}
4850
{...props}
4951
/>
50-
)
52+
);
5153
}
5254

53-
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
55+
function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
5456
return (
5557
<tr
56-
data-slot="table-row"
58+
data-slot='table-row'
5759
className={cn(
58-
"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
59-
className
60+
'hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors',
61+
className,
6062
)}
6163
{...props}
6264
/>
63-
)
65+
);
6466
}
6567

66-
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
68+
function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
6769
return (
6870
<th
69-
data-slot="table-head"
71+
data-slot='table-head'
7072
className={cn(
71-
"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
72-
className
73+
'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
74+
className,
7375
)}
7476
{...props}
7577
/>
76-
)
78+
);
7779
}
7880

79-
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
81+
function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
8082
return (
8183
<td
82-
data-slot="table-cell"
84+
data-slot='table-cell'
8385
className={cn(
84-
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
85-
className
86+
'p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
87+
className,
8688
)}
8789
{...props}
8890
/>
89-
)
91+
);
9092
}
9193

9294
function TableCaption({
9395
className,
9496
...props
95-
}: React.ComponentProps<"caption">) {
97+
}: React.ComponentProps<'caption'>) {
9698
return (
9799
<caption
98-
data-slot="table-caption"
99-
className={cn("text-muted-foreground mt-4 text-sm", className)}
100+
data-slot='table-caption'
101+
className={cn('text-muted-foreground mt-4 text-sm', className)}
100102
{...props}
101103
/>
102-
)
104+
);
103105
}
104106

105107
export {
@@ -111,4 +113,4 @@ export {
111113
TableRow,
112114
TableCell,
113115
TableCaption,
114-
}
116+
};

pages/tools/components/ToolingDetailModal.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ import React, { useEffect, useState } from 'react';
22

33
import CancelIcon from '~/public/icons/cancel.svg';
44
import { Button } from '~/components/ui/button';
5-
import {
6-
Dialog,
7-
DialogContent,
8-
DialogHeader,
9-
DialogTitle,
10-
} from '~/components/ui/dialog';
5+
import { Dialog, DialogContent } from '~/components/ui/dialog';
116

127
import Badge from './ui/Badge';
138
import type { JSONSchemaTool } from '../JSONSchemaTool';
@@ -26,12 +21,12 @@ export default function ToolingDetailModal({
2621
}) {
2722
return (
2823
<Dialog open={true} onOpenChange={() => onClose()}>
29-
<DialogContent
24+
<DialogContent
3025
className='fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] transform-none bg-white dark:bg-slate-800 rounded-lg p-8 max-w-full lg:max-w-4xl w-10/12 lg:w-full max-h-[80vh] overflow-y-auto border-0 shadow-lg z-50'
31-
style={{
26+
style={{
3227
overflowWrap: 'anywhere',
3328
top: 'calc(50% + 16px)', // Offset to match original positioning
34-
transform: 'translate(-50%, -50%)'
29+
transform: 'translate(-50%, -50%)',
3530
}}
3631
showCloseButton={false}
3732
>

0 commit comments

Comments
 (0)