From dca8d4bccddbfc220d90c80cde76ef5f27ffb1d2 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Wed, 25 Nov 2026 09:55:14 +0200 Subject: [PATCH 1/2] chore(deps): move to @uxfront/oxfmt-config 0.2.0, and add the shared .editorconfig The plugin and its marketplace entry join the formatter's ignore list, since they ship live from main and change only with a version bump. Co-authored-by: multica-agent --- .editorconfig | 20 ++++++++++++++++++++ oxfmt.config.ts | 4 ++++ package.json | 2 +- pnpm-lock.yaml | 10 +++++----- pnpm-workspace.yaml | 1 + 5 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..40838c2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# Shared whitespace rules for every uxfront-com repository. +# The canonical copy is .editorconfig in uxfront-com/.github. Change it there, then copy it. +# It matches @uxfront/oxfmt-config: tabs, with no fixed width, so each reader picks their own. +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +# YAML forbids tabs for indentation. +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + +# Two trailing spaces are a line break in Markdown, so keep them. +[*.md] +trim_trailing_whitespace = false diff --git a/oxfmt.config.ts b/oxfmt.config.ts index bc63b60..80cdb2d 100644 --- a/oxfmt.config.ts +++ b/oxfmt.config.ts @@ -11,6 +11,10 @@ export default defineConfig({ // The component pages show these files byte for byte: `pnpm check-reference` fails // when a page and its file differ. "app/reference/**", + // The agent plugin and its marketplace entry ship live from `main`, and clients cache the + // plugin by its version, so these files change only with a version bump. + ".claude-plugin/**", + "plugins/open-components/**", // Vendored schemas, never edited by hand. "plugins/schemas/**", ], diff --git a/package.json b/package.json index 8f6ed27..be97c6c 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@testing-library/user-event": "^14.6.7", "@testing-library/vue": "^8.1.0", "@types/node": "^24.13.6", - "@uxfront/oxfmt-config": "^0.1.1", + "@uxfront/oxfmt-config": "^0.2.0", "@uxfront/oxlint-config": "^0.2.0", "@vitejs/plugin-vue": "^6.0.9", "ajv": "^8.20.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d5b52c2..2d85d51 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -70,8 +70,8 @@ importers: specifier: ^24.13.6 version: 24.13.6 '@uxfront/oxfmt-config': - specifier: ^0.1.1 - version: 0.1.1(oxfmt@0.79.0) + specifier: ^0.2.0 + version: 0.2.0(oxfmt@0.79.0) '@uxfront/oxlint-config': specifier: ^0.2.0 version: 0.2.0(eslint@10.11.0(jiti@2.7.0))(oxlint@1.94.0) @@ -3729,8 +3729,8 @@ packages: nuxt: ^4.5.0 vue: ^3.5.0 - '@uxfront/oxfmt-config@0.1.1': - resolution: {integrity: sha512-L/z9RAcr0TehuP9cfc070OGWyXQlwONoqGOomIFL/3Y7WjEPn1bHYBU9+M+LGmz5dH1yDyC26JWNmpa5Y96t9Q==} + '@uxfront/oxfmt-config@0.2.0': + resolution: {integrity: sha512-K8+//dJ5DtsbaEQ/1sayQC9BIqXbcYa2LQV5Arr/7iZ5Pqe4HA8M3e8uw8AkTmHAM9o4LHgh26ApClNAhklIxw==} peerDependencies: oxfmt: '>=0.70.0 <1' @@ -11852,7 +11852,7 @@ snapshots: - vite - webpack - '@uxfront/oxfmt-config@0.1.1(oxfmt@0.79.0)': + '@uxfront/oxfmt-config@0.2.0(oxfmt@0.79.0)': dependencies: oxfmt: 0.79.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 36d1112..a2c582c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -25,3 +25,4 @@ minimumReleaseAgeExclude: - '@uxfront/scene@0.5.1' - '@uxfront/ui@0.9.1' - '@uxfront/oxlint-config@0.2.0' + - '@uxfront/oxfmt-config@0.2.0' From db13013357c750a8d4da9ee0d4cc820421bc772a Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Wed, 25 Nov 2026 09:55:57 +0200 Subject: [PATCH 2/2] style: format with the shared oxfmt config Co-authored-by: multica-agent --- app/app.config.ts | 102 +- app/app.css | 18 +- app/app.vue | 12 +- app/components/UContentSurround.vue | 5 +- app/components/app/AppHeaderBody.vue | 22 +- app/components/blog/BlogByline.vue | 41 +- app/components/blog/BlogDate.vue | 4 +- app/components/changelog/ChangelogEntry.vue | 51 +- app/components/content/InklineExample.test.ts | 95 +- app/components/content/InklineExample.vue | 159 +-- .../content/button/ButtonAnatomy.vue | 199 ++-- .../content/button/examples/ButtonExample.vue | 32 +- .../button/examples/ButtonLinkExample.vue | 20 +- app/components/content/card/CardAnatomy.vue | 240 ++--- .../content/card/CardPlayground.vue | 298 +++--- .../card/examples/CardContentExample.vue | 33 +- .../content/card/examples/CardExample.vue | 32 +- .../content/card/examples/CardExampleArt.vue | 18 +- .../card/examples/CardLanguagesExample.vue | 24 +- .../card/examples/CardLayoutExample.vue | 60 +- .../content/card/examples/CardLinkExample.vue | 30 +- .../card/examples/CardStatesExample.vue | 34 +- .../checkbox-group/CheckboxGroupAnatomy.vue | 179 ++-- .../CheckboxGroupPlayground.vue | 289 +++--- .../CheckboxGroupControlledExample.vue | 34 +- .../examples/CheckboxGroupExample.vue | 32 +- .../examples/CheckboxGroupHintExample.vue | 24 +- .../CheckboxGroupLanguagesExample.vue | 20 +- .../CheckboxGroupOrientationExample.vue | 30 +- .../CheckboxGroupSelectAllExample.vue | 24 +- .../examples/CheckboxGroupSizesExample.vue | 27 +- .../examples/CheckboxGroupStatesExample.vue | 80 +- .../CheckboxGroupValidationExample.vue | 84 +- .../content/checkbox/CheckboxAnatomy.vue | 252 ++--- .../content/checkbox/CheckboxPlayground.vue | 282 +++--- .../examples/CheckboxControlledExample.vue | 20 +- .../checkbox/examples/CheckboxExample.vue | 32 +- .../examples/CheckboxIndeterminateExample.vue | 8 +- .../examples/CheckboxLabelExample.vue | 18 +- .../examples/CheckboxLanguagesExample.vue | 14 +- .../examples/CheckboxSizesExample.vue | 16 +- .../examples/CheckboxStatesExample.vue | 80 +- .../examples/CheckboxValidationExample.vue | 74 +- .../content/combobox/ComboboxAnatomy.vue | 484 ++++----- .../content/combobox/ComboboxPlayground.vue | 163 ++-- .../examples/ComboboxDialogExample.vue | 20 +- .../combobox/examples/ComboboxExample.vue | 32 +- .../combobox/examples/ComboboxFormExample.vue | 35 +- .../examples/ComboboxGroupsExample.vue | 18 +- .../examples/ComboboxIconsExample.vue | 38 +- .../examples/ComboboxMultipleExample.vue | 24 +- .../examples/ComboboxNewValuesExample.vue | 45 +- .../examples/ComboboxRestyleExample.vue | 167 ++-- .../examples/ComboboxSizesExample.vue | 24 +- .../examples/ComboboxStatesExample.vue | 30 +- .../content/components-hub/ComponentsHub.vue | 20 +- .../components-hub/ComponentsHubCard.test.ts | 173 ++-- .../components-hub/ComponentsHubCard.vue | 174 ++-- .../components-hub/ComponentsHubPreview.vue | 489 +++++----- app/components/content/components-hub/card.ts | 81 +- .../content/dialog/DialogAnatomy.vue | 255 ++--- .../content/dialog/DialogPlayground.vue | 581 ++++++----- .../dialog/examples/DialogAlertExample.vue | 36 +- .../dialog/examples/DialogContentExample.vue | 52 +- .../content/dialog/examples/DialogExample.vue | 32 +- .../dialog/examples/DialogSizesExample.vue | 40 +- app/components/content/field/FieldAnatomy.vue | 169 ++-- .../content/field/FieldPlayground.vue | 576 ++++++----- .../field/examples/FieldCheckboxExample.vue | 24 +- .../examples/FieldCheckboxGroupExample.vue | 28 +- .../content/field/examples/FieldExample.vue | 32 +- .../field/examples/FieldFormExample.vue | 150 +-- .../field/examples/FieldInputExample.vue | 26 +- .../field/examples/FieldRadioGroupExample.vue | 23 +- .../field/examples/FieldSizesExample.vue | 30 +- .../field/examples/FieldStatesExample.vue | 62 +- .../field/examples/FieldSwitchExample.vue | 17 +- .../field/examples/FieldTextareaExample.vue | 17 +- app/components/content/input/InputAnatomy.vue | 255 ++--- .../content/input/InputPlayground.vue | 639 ++++++------ .../content/input/examples/InputExample.vue | 32 +- .../input/examples/InputLabelExample.vue | 18 +- .../input/examples/InputLanguagesExample.vue | 36 +- .../input/examples/InputPasswordExample.vue | 48 +- .../input/examples/InputSizesExample.vue | 22 +- .../input/examples/InputSlotsExample.vue | 30 +- .../input/examples/InputStatesExample.vue | 72 +- .../input/examples/InputTypesExample.vue | 47 +- .../input/examples/InputValidationExample.vue | 98 +- .../input/examples/InputWidthsExample.vue | 38 +- .../content/popover/PopoverAnatomy.vue | 291 +++--- .../content/popover/PopoverPlayground.vue | 283 +++--- .../popover/examples/PopoverDialogExample.vue | 42 +- .../popover/examples/PopoverExample.vue | 32 +- .../examples/PopoverFiltersExample.vue | 22 +- .../popover/examples/PopoverFormExample.vue | 42 +- .../examples/PopoverPlacementExample.vue | 35 +- .../examples/PopoverToggletipExample.vue | 37 +- .../content/radio-group/RadioGroupAnatomy.vue | 196 ++-- .../radio-group/RadioGroupPlayground.vue | 321 +++--- .../examples/RadioGroupExample.vue | 32 +- .../examples/RadioGroupHintExample.vue | 24 +- .../examples/RadioGroupOrientationExample.vue | 28 +- .../examples/RadioGroupOtherExample.vue | 31 +- .../examples/RadioGroupSizesExample.vue | 32 +- .../examples/RadioGroupStatesExample.vue | 72 +- .../examples/RadioGroupValidationExample.vue | 66 +- .../content/roadmap/RoadmapCheck.vue | 22 +- .../content/select/SelectAnatomy.vue | 412 ++++---- .../content/select/SelectPlayground.vue | 171 ++-- .../select/examples/SelectDialogExample.vue | 20 +- .../content/select/examples/SelectExample.vue | 32 +- .../select/examples/SelectFormExample.vue | 41 +- .../select/examples/SelectGroupsExample.vue | 23 +- .../select/examples/SelectIconsExample.vue | 38 +- .../select/examples/SelectLabelIcon.vue | 8 +- .../select/examples/SelectMultipleExample.vue | 25 +- .../select/examples/SelectNativeExample.vue | 18 +- .../select/examples/SelectRestyleExample.vue | 112 ++- .../select/examples/SelectSizesExample.vue | 34 +- .../select/examples/SelectStatesExample.vue | 35 +- .../content/spinner/SpinnerAnatomy.vue | 126 +-- .../spinner/examples/SpinnerExample.vue | 32 +- .../examples/SpinnerLoadingExample.vue | 40 +- .../spinner/examples/SpinnerSizeExample.vue | 18 +- .../content/switch/SwitchAnatomy.vue | 213 ++-- .../content/switch/SwitchPlayground.vue | 233 ++--- .../content/switch/examples/SwitchExample.vue | 32 +- .../switch/examples/SwitchLabelExample.vue | 20 +- .../examples/SwitchLanguagesExample.vue | 26 +- .../switch/examples/SwitchSavingExample.vue | 70 +- .../switch/examples/SwitchSizesExample.vue | 18 +- .../switch/examples/SwitchStatesExample.vue | 88 +- .../content/tag-group/TagGroupAnatomy.vue | 183 ++-- .../content/tag-group/TagGroupPlayground.vue | 223 +++-- .../tag-group/examples/TagGroupExample.vue | 32 +- .../examples/TagGroupLanguagesExample.vue | 34 +- .../examples/TagGroupLinkExample.vue | 20 +- .../examples/TagGroupRemoveExample.vue | 38 +- .../examples/TagGroupRestyleExample.vue | 36 +- .../examples/TagGroupSizesExample.vue | 28 +- .../examples/TagGroupStatesExample.vue | 54 +- app/components/content/tag/TagAnatomy.vue | 215 ++-- app/components/content/tag/TagPlayground.vue | 209 ++-- .../content/tag/examples/TagExample.vue | 32 +- .../content/tag/examples/TagIconsExample.vue | 28 +- .../tag/examples/TagLanguagesExample.vue | 22 +- .../content/tag/examples/TagLinkExample.vue | 19 +- .../content/tag/examples/TagRemoveExample.vue | 36 +- .../tag/examples/TagRestyleExample.vue | 40 +- .../content/tag/examples/TagSizesExample.vue | 12 +- .../content/tag/examples/TagStatesExample.vue | 50 +- .../content/textarea/TextareaAnatomy.vue | 225 ++--- .../content/textarea/TextareaPlayground.vue | 323 +++--- .../examples/TextareaCountExample.vue | 26 +- .../textarea/examples/TextareaExample.vue | 32 +- .../examples/TextareaHeightExample.vue | 26 +- .../examples/TextareaLabelExample.vue | 20 +- .../examples/TextareaLanguagesExample.vue | 19 +- .../examples/TextareaSizesExample.vue | 26 +- .../examples/TextareaStatesExample.vue | 61 +- .../examples/TextareaValidationExample.vue | 94 +- .../content/tooltip/TooltipAnatomy.vue | 199 ++-- .../content/tooltip/TooltipPlayground.vue | 288 +++--- .../examples/TooltipDescriptionExample.vue | 18 +- .../examples/TooltipDisabledExample.vue | 20 +- .../tooltip/examples/TooltipExample.vue | 32 +- .../tooltip/examples/TooltipLabelExample.vue | 34 +- .../examples/TooltipPlacementExample.vue | 36 +- app/components/docs/DocsAsideLeftBody.vue | 2 +- app/components/docs/DocsNavigation.vue | 24 +- app/components/docs/DocsNavigationList.vue | 151 +-- app/components/docs/DocsPageHeaderLinks.vue | 168 ++-- app/data/frameworks.ts | 14 +- app/data/select-options.ts | 102 +- app/data/site.ts | 2 +- app/error.vue | 30 +- app/lib/formations.ts | 54 +- app/lib/header-links.test.ts | 27 +- app/lib/inkline-embed.test.ts | 229 +++-- app/lib/inkline-embed.ts | 94 +- app/lib/navigation.test.ts | 319 +++--- app/lib/navigation.ts | 58 +- app/lib/reading-time.test.ts | 77 +- app/lib/reading-time.ts | 58 +- app/middleware/split-pages.global.ts | 25 +- app/pages/blog/[slug].vue | 103 +- app/pages/blog/index.vue | 44 +- app/pages/changelog/[slug].vue | 47 +- app/pages/changelog/index.vue | 34 +- app/pages/index.vue | 456 ++++----- app/plugins/framework-selected.client.ts | 12 +- content.config.ts | 66 +- lighthouserc.json | 78 +- mcp/lib/agent-markdown.test.ts | 400 +++++--- mcp/lib/agent-markdown.ts | 135 +-- mcp/lib/frameworks.test.ts | 162 +-- mcp/lib/frameworks.ts | 97 +- mcp/lib/markdown.test.ts | 223 +++-- mcp/lib/markdown.ts | 80 +- mcp/lib/pages.test.ts | 468 +++++---- mcp/lib/pages.ts | 196 ++-- mcp/lib/paging.test.ts | 106 +- mcp/lib/paging.ts | 30 +- mcp/lib/prompts.test.ts | 354 ++++--- mcp/lib/prompts.ts | 159 +-- mcp/lib/rules.test.ts | 97 +- mcp/lib/rules.ts | 76 +- mcp/lib/search.test.ts | 391 ++++---- mcp/lib/search.ts | 352 ++++--- mcp/lib/standard.test.ts | 892 ++++++++++------- mcp/lib/standard.ts | 620 ++++++------ mcp/lib/suggest.test.ts | 106 +- mcp/lib/suggest.ts | 97 +- mcp/lib/types.ts | 218 ++--- mcp/modules/standard.ts | 106 +- mcp/modules/web-transport.ts | 21 +- mcp/nuxt.config.ts | 114 +-- mcp/port.mjs | 3 +- mcp/server/mcp/index.ts | 23 +- mcp/server/mcp/prompts/adopt-token-paths.ts | 24 +- mcp/server/mcp/prompts/build-component.ts | 163 ++-- mcp/server/mcp/prompts/review-component.ts | 78 +- mcp/server/mcp/prompts/review-usage.ts | 80 +- mcp/server/mcp/resources/contract-schema.ts | 20 +- mcp/server/mcp/resources/contracts.ts | 77 +- mcp/server/mcp/resources/pages.ts | 59 +- mcp/server/mcp/tools/get-contract.ts | 36 +- mcp/server/mcp/tools/get-page.ts | 177 ++-- .../mcp/tools/get-reference-implementation.ts | 104 +- mcp/server/mcp/tools/list-components.ts | 64 +- mcp/server/mcp/tools/list-rules.ts | 233 +++-- mcp/server/mcp/tools/search-docs.ts | 88 +- mcp/server/middleware/badge.ts | 24 +- mcp/server/standard.d.ts | 40 +- mcp/server/utils/standard.ts | 42 +- mcp/tsconfig.json | 28 +- mcp/tsconfig.test.json | 16 +- mcp/wrangler.jsonc | 20 +- modules/amplitude.ts | 148 +-- modules/amplitude/runtime/session-replay.ts | 54 +- modules/amplitude/runtime/window.d.ts | 22 +- nuxt.config.ts | 556 +++++------ oxfmt.config.ts | 32 +- oxlint.config.ts | 178 ++-- package.json | 122 +-- plugins/open-components.test.ts | 393 +++++--- plugins/tsconfig.json | 16 +- pnpm-workspace.yaml | 14 +- public/schemas/contract.json | 438 ++++----- scripts/check-mcp.mjs | 922 +++++++++++------- scripts/check-reference.mjs | 59 +- scripts/check-seo.mjs | 700 +++++++------ scripts/dev-mcp.mjs | 15 +- scripts/fetch-history.mjs | 28 +- server.json | 32 +- server/lib/blog.test.ts | 193 ++-- server/lib/blog.ts | 201 ++-- server/lib/checklists.test.ts | 565 ++++++----- server/lib/checklists.ts | 457 +++++---- server/lib/components-hub.test.ts | 96 +- server/lib/contract.test.ts | 87 +- server/lib/contract.ts | 124 +-- server/lib/docs.ts | 28 +- server/lib/git.test.ts | 88 +- server/lib/git.ts | 31 +- server/lib/headers.ts | 10 +- server/lib/raw.test.ts | 799 ++++++++++----- server/lib/raw.ts | 298 +++--- server/lib/wcag.ts | 254 +++-- server/middleware/raw-contract.ts | 24 +- server/middleware/raw-markdown.ts | 43 +- server/plugins/llms-titles.ts | 39 +- server/routes/sitemap.xml.ts | 93 +- tsconfig.json | 32 +- vitest.config.ts | 27 +- wrangler.jsonc | 20 +- 277 files changed, 17171 insertions(+), 14173 deletions(-) diff --git a/app/app.config.ts b/app/app.config.ts index 43008bc..6e86231 100644 --- a/app/app.config.ts +++ b/app/app.config.ts @@ -2,55 +2,55 @@ import { FRAMEWORKS } from "./data/frameworks"; import { BLOG_URL, CHANGELOG_URL, GITHUB_URL } from "./data/site"; export default defineAppConfig({ - // The docs' GitHub, "Edit this page" and "Report an issue" links. Docus reads - // them from the git remote otherwise, which not every checkout has. - github: { - url: GITHUB_URL, - branch: "main", - }, - docsTheme: { - // The frameworks the docs' examples come in (see app/data/frameworks.ts). - frameworks: FRAMEWORKS, - // The docs header's site name, set and signed "by UXFront" the way the - // homepage header does. - wordmark: { bold: "Open", regular: "Components" }, - byline: true, - // The docs header's links, beside its buttons from 768px up and at the top of - // its menu below that, each highlighted on its page and the pages below it. - headerLinks: [ - { label: "Blog", to: BLOG_URL, activeFor: BLOG_URL }, - { label: "Changelog", to: CHANGELOG_URL, activeFor: CHANGELOG_URL }, - // The introduction, rather than /docs, which only redirects to it. - { label: "Documentation", to: "/docs/getting-started/introduction", activeFor: "/docs" }, - ], - }, - ui: { - colors: { - // The periwinkle of the homepage's glow (see app/app.css for its shades). - primary: "indigo", - neutral: "zinc", - }, - prose: { - // Tabs in the docs, like the MCP Server page's clients, scroll sideways on - // small screens rather than cut their labels short, as code groups do. The - // underline under the active tab moves up a pixel, onto the list's border, - // where scrolling doesn't clip it. - tabs: { - slots: { - list: "overflow-x-auto", - trigger: "shrink-0", - indicator: "bottom-0", - }, - }, - // Link cards, like the ones the Button's Overview has for its layers' pages, - // lead with a large icon. A hovered card's tint takes the muted description - // below 4.5:1 in light mode, so it darkens on hover. - card: { - slots: { - description: "group-hover:text-toned", - icon: "size-12 mb-4", - }, - }, - }, - }, + // The docs' GitHub, "Edit this page" and "Report an issue" links. Docus reads + // them from the git remote otherwise, which not every checkout has. + github: { + url: GITHUB_URL, + branch: "main", + }, + docsTheme: { + // The frameworks the docs' examples come in (see app/data/frameworks.ts). + frameworks: FRAMEWORKS, + // The docs header's site name, set and signed "by UXFront" the way the + // homepage header does. + wordmark: { bold: "Open", regular: "Components" }, + byline: true, + // The docs header's links, beside its buttons from 768px up and at the top of + // its menu below that, each highlighted on its page and the pages below it. + headerLinks: [ + { label: "Blog", to: BLOG_URL, activeFor: BLOG_URL }, + { label: "Changelog", to: CHANGELOG_URL, activeFor: CHANGELOG_URL }, + // The introduction, rather than /docs, which only redirects to it. + { label: "Documentation", to: "/docs/getting-started/introduction", activeFor: "/docs" }, + ], + }, + ui: { + colors: { + // The periwinkle of the homepage's glow (see app/app.css for its shades). + primary: "indigo", + neutral: "zinc", + }, + prose: { + // Tabs in the docs, like the MCP Server page's clients, scroll sideways on + // small screens rather than cut their labels short, as code groups do. The + // underline under the active tab moves up a pixel, onto the list's border, + // where scrolling doesn't clip it. + tabs: { + slots: { + list: "overflow-x-auto", + trigger: "shrink-0", + indicator: "bottom-0", + }, + }, + // Link cards, like the ones the Button's Overview has for its layers' pages, + // lead with a large icon. A hovered card's tint takes the muted description + // below 4.5:1 in light mode, so it darkens on hover. + card: { + slots: { + description: "group-hover:text-toned", + icon: "size-12 mb-4", + }, + }, + }, + }, }); diff --git a/app/app.css b/app/app.css index 0b069a0..2ce314d 100644 --- a/app/app.css +++ b/app/app.css @@ -18,18 +18,18 @@ /* Identifiers in a table's first column, like prop names and rule IDs, read as one word: don't break them at their hyphens. */ table td:first-child > code { - white-space: nowrap; + white-space: nowrap; } @layer theme { - /* Nuxt UI draws light-mode links in the 500 shade, below WCAG AA contrast on + /* Nuxt UI draws light-mode links in the 500 shade, below WCAG AA contrast on white. The rules below replace both of its defaults, so dark mode is restated. */ - :root, - .light { - --ui-primary: var(--ui-color-primary-600); - } + :root, + .light { + --ui-primary: var(--ui-color-primary-600); + } - .dark { - --ui-primary: var(--ui-color-primary-400); - } + .dark { + --ui-primary: var(--ui-color-primary-400); + } } diff --git a/app/app.vue b/app/app.vue index e98a4ae..a2c4ccd 100644 --- a/app/app.vue +++ b/app/app.vue @@ -6,16 +6,18 @@ const DocusApp = defineAsyncComponent(() => import("docus/app/app.vue")); const route = useRoute(); const usesDocus = computed(() => - ["/docs", "/changelog", "/blog"].some((base) => route.path === base || route.path.startsWith(`${base}/`)), + ["/docs", "/changelog", "/blog"].some( + (base) => route.path === base || route.path.startsWith(`${base}/`), + ), ); useHead({ - titleTemplate: (title) => (title ? `${title} - Open Components` : "Open Components"), + titleTemplate: (title) => (title ? `${title} - Open Components` : "Open Components"), }); diff --git a/app/components/UContentSurround.vue b/app/components/UContentSurround.vue index 50a84ba..9f19d5b 100644 --- a/app/components/UContentSurround.vue +++ b/app/components/UContentSurround.vue @@ -8,6 +8,7 @@ * It renders Nuxt UI's own with them: keep it in step with how Docus uses it. */ import type { ContentNavigationItem } from "@nuxt/content"; + import ContentSurround from "#ui/components/content/ContentSurround.vue"; import { findSurround, sortNavigation } from "~/lib/navigation"; @@ -18,12 +19,12 @@ const route = useRoute(); // The tree Nuxt Content builds the surround from, with each page's description, // which the links show under their titles, as Docus asks for. const { data: navigation } = await useAsyncData("docs-surround", () => - queryCollectionNavigation("docs", ["description"]), + queryCollectionNavigation("docs", ["description"]), ); // A null where there's no page, which Nuxt UI's leaves a gap for, as Docus's has. const pages = computed(() => findSurround(sortNavigation(navigation.value ?? []), route.path)); diff --git a/app/components/app/AppHeaderBody.vue b/app/components/app/AppHeaderBody.vue index 7b1b063..c3bdfb8 100644 --- a/app/components/app/AppHeaderBody.vue +++ b/app/components/app/AppHeaderBody.vue @@ -11,19 +11,19 @@ import { getFirstPagePath } from "docus/app/composables/useSubNavigation"; const navigation = inject>>("navigation"); const { subNavigationMode } = useSubNavigation(); const items = computed>(() => { - const nav = navigation?.value || []; - if (!subNavigationMode.value) { - return nav; - } - return nav.map(({ children, ...item }) => ({ - ...item, - path: children?.length ? getFirstPagePath({ ...item, children }) : item.path, - })); + const nav = navigation?.value || []; + if (!subNavigationMode.value) { + return nav; + } + return nav.map(({ children, ...item }) => ({ + ...item, + path: children?.length ? getFirstPagePath({ ...item, children }) : item.path, + })); }); diff --git a/app/components/blog/BlogByline.vue b/app/components/blog/BlogByline.vue index eb47599..29ef838 100644 --- a/app/components/blog/BlogByline.vue +++ b/app/components/blog/BlogByline.vue @@ -1,5 +1,6 @@ diff --git a/app/components/blog/BlogDate.vue b/app/components/blog/BlogDate.vue index 3c083b4..1b9a6d7 100644 --- a/app/components/blog/BlogDate.vue +++ b/app/components/blog/BlogDate.vue @@ -8,10 +8,10 @@ const props = defineProps<{ date: string }>(); // Posts are dated like 2026-11-18, which Date reads as midnight UTC: formatted in // UTC, it's the same day in every time zone, on the server and in the browser. const formatted = new Intl.DateTimeFormat("en-GB", { dateStyle: "long", timeZone: "UTC" }).format( - new Date(props.date), + new Date(props.date), ); diff --git a/app/components/changelog/ChangelogEntry.vue b/app/components/changelog/ChangelogEntry.vue index 86e4a38..f65c490 100644 --- a/app/components/changelog/ChangelogEntry.vue +++ b/app/components/changelog/ChangelogEntry.vue @@ -1,6 +1,7 @@ diff --git a/app/components/content/InklineExample.test.ts b/app/components/content/InklineExample.test.ts index b5ed6b9..10a01e3 100644 --- a/app/components/content/InklineExample.test.ts +++ b/app/components/content/InklineExample.test.ts @@ -1,15 +1,17 @@ import { render, screen } from "@testing-library/vue"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { h, nextTick, reactive, ref } from "vue"; + import { INKLINE_PREVIEW_ORIGIN } from "~/lib/inkline-embed"; + import InklineExample from "./InklineExample.vue"; // Nuxt auto-imports these. The reader picked Vue, in light mode. const colorMode = reactive({ value: "light" }); beforeEach(() => { - colorMode.value = "light"; - vi.stubGlobal("useFramework", () => ({ current: ref({ value: "vue", label: "Vue" }) })); - vi.stubGlobal("useColorMode", () => colorMode); + colorMode.value = "light"; + vi.stubGlobal("useFramework", () => ({ current: ref({ value: "vue", label: "Vue" }) })); + vi.stubGlobal("useColorMode", () => colorMode); }); afterEach(() => vi.unstubAllGlobals()); @@ -18,44 +20,51 @@ afterEach(() => vi.unstubAllGlobals()); const code = () => h("pre", { "data-testid": "code" }, ""); describe("InklineExample", () => { - it("shows the example in a lazy frame named for what it shows and the framework it shows it in", async () => { - render(InklineExample, { props: { example: "button/ButtonVariants", title: "Button variants" } }); - - const frame = await screen.findByTitle("Button variants, in Vue"); - expect(frame).toHaveAttribute("loading", "lazy"); - const src = new URL(frame.getAttribute("src")!); - expect(src.searchParams.get("target")).toBe("vue"); - expect(src.searchParams.get("theme")).toBe("light"); - }); - - it("shows the page's code under the frame", async () => { - render(InklineExample, { - props: { example: "button/ButtonVariants", title: "Button variants" }, - slots: { default: code }, - }); - - const frame = await screen.findByTitle("Button variants, in Vue"); - const shown = screen.getByTestId("code"); - expect(frame.compareDocumentPosition(shown) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy(); - }); - - it("sends the mode to a frame that became ready after the mode changed", async () => { - render(InklineExample, { props: { example: "button/ButtonVariants", title: "Button variants" } }); - const frame = (await screen.findByTitle("Button variants, in Vue")) as HTMLIFrameElement; - const post = vi.spyOn(frame.contentWindow!, "postMessage").mockImplementation(() => {}); - - colorMode.value = "dark"; - await nextTick(); - expect(post).not.toHaveBeenCalled(); - - window.dispatchEvent( - new MessageEvent("message", { - origin: INKLINE_PREVIEW_ORIGIN, - source: frame.contentWindow, - data: { type: "unframework:embed", kind: "resize", height: 240 }, - }), - ); - await nextTick(); - expect(post).toHaveBeenCalledWith({ type: "unframework:embed", kind: "theme", theme: "dark" }, INKLINE_PREVIEW_ORIGIN); - }); + it("shows the example in a lazy frame named for what it shows and the framework it shows it in", async () => { + render(InklineExample, { + props: { example: "button/ButtonVariants", title: "Button variants" }, + }); + + const frame = await screen.findByTitle("Button variants, in Vue"); + expect(frame).toHaveAttribute("loading", "lazy"); + const src = new URL(frame.getAttribute("src")!); + expect(src.searchParams.get("target")).toBe("vue"); + expect(src.searchParams.get("theme")).toBe("light"); + }); + + it("shows the page's code under the frame", async () => { + render(InklineExample, { + props: { example: "button/ButtonVariants", title: "Button variants" }, + slots: { default: code }, + }); + + const frame = await screen.findByTitle("Button variants, in Vue"); + const shown = screen.getByTestId("code"); + expect(frame.compareDocumentPosition(shown) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy(); + }); + + it("sends the mode to a frame that became ready after the mode changed", async () => { + render(InklineExample, { + props: { example: "button/ButtonVariants", title: "Button variants" }, + }); + const frame = (await screen.findByTitle("Button variants, in Vue")) as HTMLIFrameElement; + const post = vi.spyOn(frame.contentWindow!, "postMessage").mockImplementation(() => {}); + + colorMode.value = "dark"; + await nextTick(); + expect(post).not.toHaveBeenCalled(); + + window.dispatchEvent( + new MessageEvent("message", { + origin: INKLINE_PREVIEW_ORIGIN, + source: frame.contentWindow, + data: { type: "unframework:embed", kind: "resize", height: 240 }, + }), + ); + await nextTick(); + expect(post).toHaveBeenCalledWith( + { type: "unframework:embed", kind: "theme", theme: "dark" }, + INKLINE_PREVIEW_ORIGIN, + ); + }); }); diff --git a/app/components/content/InklineExample.vue b/app/components/content/InklineExample.vue index c209f57..a4b6cee 100644 --- a/app/components/content/InklineExample.vue +++ b/app/components/content/InklineExample.vue @@ -1,16 +1,17 @@