fix(openapi + story): better UI + translations

This commit is contained in:
Fuma Nama
2026-06-08 20:05:08 +08:00
committed by Fuma Nama
parent 24d75fa9ce
commit 779efff770
11 changed files with 39 additions and 8 deletions
+9
View File
@@ -0,0 +1,9 @@
---
'@fumadocs/language': minor
'fumadocs-ui': minor
'@fumadocs/base-ui': minor
'fumadocs-openapi': minor
'@fumadocs/story': minor
---
Use new translations API
@@ -237,7 +237,11 @@ export function FieldInput({
{typeof item === 'string' ? item : JSON.stringify(item, null, 2)}
</SelectItem>
))}
{!isRequired && <SelectItem value="-1">{t('Unset')}</SelectItem>}
{!isRequired && (
<SelectItem value="-1">
{<span className="text-fd-muted-foreground">{t('Unset')}</span>}
</SelectItem>
)}
</SelectContent>
</Select>
);
@@ -255,7 +259,11 @@ export function FieldInput({
<SelectContent>
<SelectItem value="true">True</SelectItem>
<SelectItem value="false">False</SelectItem>
{!isRequired && <SelectItem value="undefined">{t('Unset')}</SelectItem>}
{!isRequired && (
<SelectItem value="undefined">
<span className="text-fd-muted-foreground">{t('Unset')}</span>
</SelectItem>
)}
</SelectContent>
</Select>
);
+1
View File
@@ -13,6 +13,7 @@ export default defineConfig({
'./src/utils/{id-to-title,url}.ts',
],
unbundle: true,
ignoreWatch: ['src/.translations/**'],
dts: {
sourcemap: false,
},
+1
View File
@@ -9,6 +9,7 @@ export default defineConfig({
target: 'es2023',
entry: ['./src/{index,i18n}.ts', './src/ui/index.tsx', './src/server/index.tsx'],
unbundle: true,
ignoreWatch: ['src/.translations/**'],
dts: {
sourcemap: false,
},
+1
View File
@@ -19,6 +19,7 @@ export default defineConfig({
],
fixedExtension: false,
unbundle: true,
ignoreWatch: ['src/.translations/**'],
dts: {
sourcemap: false,
},
+2 -2
View File
@@ -80,7 +80,7 @@ const translations = {
'Select(playground)': '选择',
'Selected(playground)': '已选取',
'Show Property(playground)': '显示属性',
'Unset(playground)': '取消设置',
'Unset(playground)': '无',
'Upload(playground)': '上传',
'Value in(schema UI)': '值于',
@@ -189,7 +189,7 @@ const translations = {
'Remove Item(arg form)(aria-label)': '移除项目',
'Reset(story error boundary)': '重置',
'True(arg form)': '是',
'Unset(arg form)': '取消设置',
'Unset(arg form)': '无',
} satisfies Translations;
/**
+2 -2
View File
@@ -80,7 +80,7 @@ const translations = {
'Select(playground)': '選擇',
'Selected(playground)': '已選取',
'Show Property(playground)': '顯示屬性',
'Unset(playground)': '取消設定',
'Unset(playground)': '無',
'Upload(playground)': '上傳',
'Value in(schema UI)': '值於',
@@ -189,7 +189,7 @@ const translations = {
'Remove Item(arg form)(aria-label)': '移除項目',
'Reset(story error boundary)': '重設',
'True(arg form)': '是',
'Unset(arg form)': '取消設定',
'Unset(arg form)': '無',
} satisfies Translations;
/**
+1
View File
@@ -20,6 +20,7 @@ export default defineConfig({
'./src/requests/generators/*.ts',
],
unbundle: true,
ignoreWatch: ['src/.translations/**'],
dts: {
sourcemap: false,
},
+1
View File
@@ -20,6 +20,7 @@ export default defineConfig({
],
fixedExtension: false,
unbundle: true,
ignoreWatch: ['src/.translations/**'],
dts: {
sourcemap: false,
},
+10 -2
View File
@@ -175,7 +175,11 @@ export function FieldInput({
{member.label}
</SelectItem>
))}
{!isRequired && <SelectItem value="-1">{t('Unset')}</SelectItem>}
{!isRequired && (
<SelectItem value="-1">
<span className="text-fd-muted-foreground">{t('Unset')}</span>
</SelectItem>
)}
</SelectContent>
</Select>
);
@@ -193,7 +197,11 @@ export function FieldInput({
<SelectContent>
<SelectItem value="true">{t('True')}</SelectItem>
<SelectItem value="false">{t('False')}</SelectItem>
{!isRequired && <SelectItem value="undefined">{t('Unset')}</SelectItem>}
{!isRequired && (
<SelectItem value="undefined">
<span className="text-fd-muted-foreground">{t('Unset')}</span>
</SelectItem>
)}
</SelectContent>
</Select>
);
+1
View File
@@ -13,6 +13,7 @@ export default defineConfig({
'./src/webpack/story.ts',
],
unbundle: true,
ignoreWatch: ['src/.translations/**'],
dts: {
sourcemap: false,
},