Extract class name composition logic
This commit is contained in:
@ -41,7 +41,7 @@ exports[`babel-tailwind > supports grouped tw 2`] = `
|
||||
`;
|
||||
|
||||
exports[`babel-tailwind > supports styled components usage 1`] = `
|
||||
"import { classed as _classed } from "@aet/tailwind/classed";
|
||||
"import { classed as _classed } from "@aet/tailwind/utils";
|
||||
var Div = _classed("div", "tw-gqn2k6");"
|
||||
`;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import { getBuild, matchSnapshot } from "./utils";
|
||||
describe("emit", () => {
|
||||
const compileESBuild = getBuild("emit");
|
||||
|
||||
it("supports emitting as CSS module", async () => {
|
||||
it.only("supports emitting as CSS module", async () => {
|
||||
const { files } = await compileESBuild({
|
||||
clsx: "emotion",
|
||||
expectFiles: 2,
|
||||
|
@ -68,7 +68,7 @@ describe("merges with existing className attribute", () => {
|
||||
|
||||
const clsName = getClassName("text-center");
|
||||
expect(files.js.text).toContain(
|
||||
`{ ...props, className: typeof _className === "function" ? (...args) => _cx("${clsName}", _className(...args)) : _cx("${clsName}", _className),`
|
||||
`{ ...props, className: _composeClassName("${clsName}", _className),`
|
||||
);
|
||||
});
|
||||
|
||||
@ -90,7 +90,7 @@ describe("merges with existing className attribute", () => {
|
||||
|
||||
const clsName = getClassName("text-center");
|
||||
expect(files.js.text).toContain(
|
||||
`{ className: typeof className === "function" ? (...args) => _cx("${clsName}", className(...args)) : _cx("${clsName}", className),`
|
||||
`{ className: _composeClassName("${clsName}", className),`
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -56,7 +56,7 @@ export function getBuild(name: string) {
|
||||
"@emotion/css",
|
||||
"clsx",
|
||||
"tslib",
|
||||
"@aet/tailwind/classed",
|
||||
"@aet/tailwind/utils",
|
||||
],
|
||||
outdir: "dist",
|
||||
format: "esm",
|
||||
|
Reference in New Issue
Block a user