diff --git a/apps/docs/.vitepress/theme/Layout.vue b/apps/docs/.vitepress/theme/Layout.vue index b28dcf0..a2c8c2b 100644 --- a/apps/docs/.vitepress/theme/Layout.vue +++ b/apps/docs/.vitepress/theme/Layout.vue @@ -36,6 +36,7 @@ import { PopoverHeading, ScrollShadow, } from "@heroui-vue/components"; +import { buttonVariants } from "@heroui-vue/styles"; import { IconMenu2, IconArrowUpRight, @@ -240,17 +241,17 @@ async function copyMarkdownCode(event: MouseEvent) {
{{ records.join("\n") }}
+ diff --git a/packages/styles/components/number-field.css b/packages/styles/components/number-field.css index a2c169f..a9e8c5e 100644 --- a/packages/styles/components/number-field.css +++ b/packages/styles/components/number-field.css @@ -91,7 +91,7 @@ } .hv-number-field__input { - @apply min-w-0 rounded-none border-0 bg-transparent px-3 py-2 text-base tabular-nums shadow-none outline-none sm:text-sm; + @apply min-w-0 rounded-none border-0 bg-transparent px-3 py-2 text-base tabular-nums shadow-none outline-none placeholder:text-field-placeholder sm:text-sm; /* Remove border radius on left side when decrement button is present */ .hv-number-field__group:has([slot="decrement"]) & { diff --git a/packages/styles/components/search-field.css b/packages/styles/components/search-field.css index 6ddbda0..56219bb 100644 --- a/packages/styles/components/search-field.css +++ b/packages/styles/components/search-field.css @@ -82,7 +82,7 @@ } .hv-search-field__input { - @apply flex-1 rounded-none border-0 bg-transparent px-3 py-2 text-base shadow-none outline-none sm:text-sm; + @apply flex-1 rounded-none border-0 bg-transparent px-3 py-2 text-base shadow-none outline-none placeholder:text-field-placeholder sm:text-sm; /* Hide browser default search clear button */ &::-webkit-search-cancel-button, diff --git a/scripts/prepare-field-placeholder-consumer.mjs b/scripts/prepare-field-placeholder-consumer.mjs new file mode 100644 index 0000000..2b76416 --- /dev/null +++ b/scripts/prepare-field-placeholder-consumer.mjs @@ -0,0 +1,41 @@ +// Add the browser regression to an already-installed check-package consumer. +// Installation/tarball preparation stays exclusively in check-package.mjs. +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +const root = path.resolve(import.meta.dirname, ".."); +const consumer = path.resolve(process.argv[2] ?? ""); +if ( + !process.argv[2] || + consumer === root || + !fs.existsSync(path.join(consumer, "check-client.mjs")) || + !fs.existsSync( + path.join(consumer, "node_modules/@heroui-vue/components/package.json"), + ) +) + throw Error( + "Pass the independent consumer directory printed by node scripts/check-package.mjs handbook-styles", + ); +fs.copyFileSync( + path.join(root, "tests/fixtures/field-placeholder.vue"), + path.join(consumer, "field-placeholder.vue"), +); +fs.writeFileSync( + path.join(consumer, "main.js"), + 'import {createApp} from "vue";\nimport App from "./field-placeholder.vue";\nimport "@heroui-vue/styles/css";\ncreateApp(App).mount("#app");\n', +); +fs.writeFileSync( + path.join(consumer, "index.html"), + 'Published field placeholder regression
', +); +const plugin = fileURLToPath(import.meta.resolve("@vitejs/plugin-vue")); +fs.writeFileSync( + path.join(consumer, "vite.config.js"), + `import vue from ${JSON.stringify(plugin)};\nexport default { plugins:[vue()], resolve:{dedupe:["vue"]} };\n`, +); +console.log( + `Browser fixture prepared at ${consumer}. Components/styles resolve only from installed tarballs; Vite/Vue compilation tooling is shared.`, +); +console.log( + `Run the workspace Vite CLI with this directory as cwd, host 127.0.0.1 and an unused explicit port.`, +); diff --git a/tests/docs-shell.test.ts b/tests/docs-shell.test.ts index 904814d..d3f2ecc 100644 --- a/tests/docs-shell.test.ts +++ b/tests/docs-shell.test.ts @@ -120,6 +120,8 @@ it("uses a native version trigger, button-styled source anchor and detached them expect(version.element.tagName).toBe("BUTTON"); const source = w.get('[aria-label="项目源码"]'); expect(source.element.tagName).toBe("A"); + expect(source.classes()).toContain("hv-link"); + expect(source.attributes("type")).toBeUndefined(); expect(source.attributes("href")).toBe( "https://git.myjdemo.cn/maoyingjie/heroui-vue", ); diff --git a/tests/fixtures/field-placeholder.vue b/tests/fixtures/field-placeholder.vue new file mode 100644 index 0000000..be1b618 --- /dev/null +++ b/tests/fixtures/field-placeholder.vue @@ -0,0 +1,134 @@ + +