diff --git a/apps/docs/.vitepress/theme/index.ts b/apps/docs/.vitepress/theme/index.ts index 4958c42..5b1b049 100644 --- a/apps/docs/.vitepress/theme/index.ts +++ b/apps/docs/.vitepress/theme/index.ts @@ -29,6 +29,7 @@ import { import DefaultTheme from 'vitepress/theme' import AgentComponentDemo from '../../src/components/AgentComponentDemo.vue' import AgentComponentsDemo from '../../src/components/AgentComponentsDemo.vue' +import ComponentCatalog from '../../src/components/ComponentCatalog.vue' import DateFieldDemo from '../../src/components/DateFieldDemo.vue' import FormComponentDemo from '../../src/components/FormComponentDemo.vue' import InteractivePreview from '../../src/components/InteractivePreview.vue' @@ -36,6 +37,7 @@ import ListDemo from '../../src/components/ListDemo.vue' import MapDemo from '../../src/components/MapDemo.vue' import MiniProgramBlocksGallery from '../../src/components/MiniProgramBlocksGallery.vue' import PlatformTabsDemo from '../../src/components/PlatformTabsDemo.vue' +import PrimitiveCatalog from '../../src/components/PrimitiveCatalog.vue' import PrimitiveExample from '../../src/components/PrimitiveExample.vue' import PrimitiveInteractionDemo from '../../src/components/PrimitiveInteractionDemo.vue' import PullRefreshDemo from '../../src/components/PullRefreshDemo.vue' @@ -60,11 +62,13 @@ const theme: Theme = { app.component('FormComponentDemo', FormComponentDemo) app.component('InteractivePreview', InteractivePreview) app.component('ListDemo', ListDemo) + app.component('ComponentCatalog', ComponentCatalog) app.component('MiniProgramBlocksGallery', MiniProgramBlocksGallery) app.component('MapDemo', MapDemo) app.component('RobotChatDemo', RobotChatDemo) app.component('PlatformTabsDemo', PlatformTabsDemo) app.component('PullRefreshDemo', PullRefreshDemo) + app.component('PrimitiveCatalog', PrimitiveCatalog) app.component('PrimitiveExample', PrimitiveExample) app.component('SignatureDemo', SignatureDemo) app.component('WatermarkDemo', WatermarkDemo) diff --git a/apps/docs/components/index.md b/apps/docs/components/index.md index af1df93..093eb90 100644 --- a/apps/docs/components/index.md +++ b/apps/docs/components/index.md @@ -7,3 +7,5 @@ outline: false # 组件 选择组件查看双端演示、用法和 API。 + + diff --git a/apps/docs/e2e/docs-smoke.spec.ts b/apps/docs/e2e/docs-smoke.spec.ts index 3a6fbe6..950938e 100644 --- a/apps/docs/e2e/docs-smoke.spec.ts +++ b/apps/docs/e2e/docs-smoke.spec.ts @@ -23,7 +23,7 @@ describe('docs smoke baseline', () => { } }) - it('keeps one concise headless install surface and linked detail pages', () => { + it('keeps one headless install surface and restores the overview catalogs', () => { const config = readFileSync(resolve(docsRoot, '.vitepress/config.ts'), 'utf8') const zhOverview = readFileSync(resolve(docsRoot, 'primitives/index.md'), 'utf8') const enOverview = readFileSync(resolve(docsRoot, 'en/primitives/index.md'), 'utf8') @@ -32,10 +32,10 @@ describe('docs smoke baseline', () => { expect(zhOverview).toContain('pnpm add @varo-ui/headless @varo-ui/h5') expect(enOverview).toContain('pnpm add @varo-ui/headless @varo-ui/weapp') - expect(zhOverview).not.toContain('') + expect(enOverview).toContain('') + expect(zhComponents).toContain('') + expect(enComponents).toContain('') expect(config).toContain('/blocks/build-your-own') expect(config).toContain('/en/blocks/build-your-own') expect(existsSync(resolve(docsRoot, 'blocks/build-your-own.md'))).toBe(true) diff --git a/apps/docs/en/components/index.md b/apps/docs/en/components/index.md index f34e5d5..a37c5bd 100644 --- a/apps/docs/en/components/index.md +++ b/apps/docs/en/components/index.md @@ -7,3 +7,5 @@ outline: false # Components Choose a component to view its demos, usage, and API. + + diff --git a/apps/docs/en/primitives/index.md b/apps/docs/en/primitives/index.md index bf4df87..41a504a 100644 --- a/apps/docs/en/primitives/index.md +++ b/apps/docs/en/primitives/index.md @@ -23,3 +23,7 @@ See [Wevu Registry](/en/guide/shadcn-mode) for global styles and Tailwind config | `@varo-ui/headless` | Platform-neutral state and events | | `@varo-ui/h5/primitives` | DOM, keyboard, and ARIA | | `@varo-ui/weapp/primitives` | WXML, touch, and native events | + +## Catalog + + diff --git a/apps/docs/primitives/index.md b/apps/docs/primitives/index.md index b74917c..508d7a6 100644 --- a/apps/docs/primitives/index.md +++ b/apps/docs/primitives/index.md @@ -23,3 +23,7 @@ pnpm add @varo-ui/headless @varo-ui/weapp | `@varo-ui/headless` | 平台中立状态与事件 | | `@varo-ui/h5/primitives` | DOM、键盘与 ARIA | | `@varo-ui/weapp/primitives` | WXML、触摸与原生事件 | + +## 目录 + + diff --git a/apps/docs/src/components/ComponentCatalog.vue b/apps/docs/src/components/ComponentCatalog.vue new file mode 100644 index 0000000..e4fc1e0 --- /dev/null +++ b/apps/docs/src/components/ComponentCatalog.vue @@ -0,0 +1,551 @@ + + + + + + + {{ copy.eyebrow }} + {{ copy.summary }} + + + {{ visibleComponentCount }} + {{ copy.of }} {{ componentCount }} + {{ copy.count }} + + + + + + {{ copy.searchLabel }} + + + + + + {{ option.label }} + {{ option.count }} + + + + + + + + + {{ group.title }} + {{ group.summary }} + + {{ group.items.length }} + + + + + + {{ item.name }} + {{ item.label }} + + + + {{ target === 'h5' ? copy.h5 : copy.weapp }} + + + + + + + + + + + + {{ copy.empty }} + {{ copy.emptyDetail }} + + {{ copy.reset }} + + + + + + diff --git a/apps/docs/src/components/PrimitiveCatalog.vue b/apps/docs/src/components/PrimitiveCatalog.vue new file mode 100644 index 0000000..a6c72c6 --- /dev/null +++ b/apps/docs/src/components/PrimitiveCatalog.vue @@ -0,0 +1,377 @@ + + + + + + + {{ group.title }} + {{ group.items.length }} + + + + + {{ item.title }} + {{ copy.open }} + + {{ item.summary }} + + {{ copy.parts }} + {{ item.parts }} + + + + + + + + diff --git a/apps/docs/src/docs-navigation.test.ts b/apps/docs/src/docs-navigation.test.ts index 8543582..788f951 100644 --- a/apps/docs/src/docs-navigation.test.ts +++ b/apps/docs/src/docs-navigation.test.ts @@ -80,8 +80,8 @@ describe('docs navigation', () => { expect(primitiveZh).toContain('pnpm add @varo-ui/headless @varo-ui/weapp') expect(primitiveEn).toContain('pnpm add @varo-ui/headless @varo-ui/h5') expect(primitiveEn).toContain('pnpm add @varo-ui/headless @varo-ui/weapp') - expect(primitiveZh).not.toContain('') + expect(primitiveEn).toContain('') expect(primitiveZh).not.toContain('
{{ copy.summary }}
{{ group.summary }}
{{ copy.emptyDetail }}
{{ item.summary }}