OpenAPI: Fix minor UI bugs

This commit is contained in:
Fuma Nama
2025-06-27 23:26:59 +08:00
parent 84918b8d1d
commit 504ab2e397
5 changed files with 25 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-openapi': patch
---
Fix minor UI bugs
+2
View File
@@ -166,6 +166,8 @@ export const defaultAdapters = {
s.push('mp := multipart.NewWriter(payload)');
for (const [key, value] of Object.entries(data.body as object)) {
if (!value) continue;
const escaped = escapeString(
inputToString(value, 'application/json'),
'`',
+4 -2
View File
@@ -359,9 +359,11 @@ function SecurityTabs({
{securities.map((security, i) => (
<SelectItem key={i} value={i.toString()}>
{security.map((item) => (
<div key={item.id}>
<div key={item.id} className="max-w-[600px]">
<p className="font-mono font-medium">{item.id}</p>
<p className="text-fd-muted-foreground">{item.description}</p>
<p className="text-fd-muted-foreground whitespace-pre-wrap">
{item.description}
</p>
</div>
))}
</SelectItem>
+13 -3
View File
@@ -266,12 +266,22 @@ export function FieldInput({
className={cn(
buttonVariants({
color: 'secondary',
size: 'sm',
className: 'w-full',
className: 'w-full h-9 gap-2 truncate',
}),
)}
>
{value ? (value as File).name : 'Upload'}
{value instanceof File ? (
<>
<span className="text-fd-muted-foreground text-xs">
Selected
</span>
<span className="truncate w-0 flex-1 text-end">
{value.name}
</span>
</>
) : (
<span className="text-fd-muted-foreground">Upload</span>
)}
</label>
<input
id={fieldName}
@@ -23,7 +23,7 @@ const SelectTrigger = forwardRef<
>
{children}
<SelectPrimitive.Icon asChild>
<ChevronDown className="ms-auto size-3.5 text-fd-muted-foreground" />
<ChevronDown className="ms-auto size-3.5 text-fd-muted-foreground shrink-0" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
));