feat: migrate ColorSwatch and public color boundary
This commit is contained in:
@@ -49,6 +49,42 @@ for (const id of process.argv.slice(2)) {
|
||||
.base()
|
||||
.includes("hv-select--secondary"),
|
||||
);
|
||||
if (id === "color-swatch") {
|
||||
assert(lib.ColorSwatch === lib.ColorSwatchRoot);
|
||||
assert(
|
||||
lib
|
||||
.colorSwatchVariants({ shape: "square", size: "xl" })
|
||||
.includes("hv-color-swatch--square"),
|
||||
);
|
||||
assert(
|
||||
lib
|
||||
.colorSwatchVariants({ shape: "square", size: "xl" })
|
||||
.includes("hv-color-swatch--xl"),
|
||||
);
|
||||
assert(lib.parseColor("#f008").toString("hexa") === "#FF000088");
|
||||
assert(
|
||||
lib.parseColor("rgba(4, 133, 247, 0.5)").getChannelValue("alpha") === 0.5,
|
||||
);
|
||||
const valueDts = readFileSync(
|
||||
new URL(
|
||||
"./node_modules/@heroui-vue/components/dist/components/color/value.d.ts",
|
||||
import.meta.url,
|
||||
),
|
||||
"utf8",
|
||||
);
|
||||
const swatchDts = readFileSync(
|
||||
new URL(
|
||||
"./node_modules/@heroui-vue/components/dist/components/color-swatch/ColorSwatch.vue.d.ts",
|
||||
import.meta.url,
|
||||
),
|
||||
"utf8",
|
||||
);
|
||||
assert(!valueDts.includes("reka-ui"), "Color declarations leak Reka types");
|
||||
assert(
|
||||
!swatchDts.includes("reka-ui"),
|
||||
"ColorSwatch declarations leak Reka types",
|
||||
);
|
||||
}
|
||||
if (id === "b03-tag-error-message") {
|
||||
assert(/\.hv-tag-group\s*\[data-slot=["']?error-message/.test(css));
|
||||
assert(lib.tagVariants({ size: "sm" }).base().includes("hv-tag--sm"));
|
||||
|
||||
Reference in New Issue
Block a user