```
### CSS module
diff --git a/src/basic.spec.tsx b/src/basic.spec.tsx
index c18c71c..8bee62d 100644
--- a/src/basic.spec.tsx
+++ b/src/basic.spec.tsx
@@ -17,7 +17,7 @@ function Root({
classnames
}}/>
({App__Footer})}
+ className={`${classNamingBasic({App__Footer})}`}
data-classname={`${classNamingBasic({App__Footer})}`}
/>
>
@@ -114,3 +114,28 @@ it("additional type check after rename", () => {
)
})
+
+it("chaining", () => {
+ const props = {className: "Cell", classnames: classNamesCheck()}
+
+ const {className, classnames: {
+ Column_1, Column_2,
+ Row_1, Row_2
+ }} = props
+ , cn1 = classNamingBasic(className, {Column_1})
+ , cn2 = classNamingBasic(className, {Column_2})
+
+ expectRender(
+
,
+
,
+
,
+
,
+
+ ).toSame(
+
,
+
,
+
,
+
,
+
+ )
+})
diff --git a/src/basic.ts b/src/basic.ts
index b815749..3aad907 100644
--- a/src/basic.ts
+++ b/src/basic.ts
@@ -1,27 +1,29 @@
export type { ClassNames } from "./defs"
-import { dehash, wrapper } from "./core"
-import type { ClassNamesMap, ClassNamed, GetClassKeys } from "./defs"
+import { dehash, wrapper, joinWithLead } from "./core"
+import type { ClassNamesMap, ClassNamed, GetClassKeys, ClassValue, ReactRelated } from "./defs"
export default classNamingBasic
/**
* Makes `className` string from imported CSS
- * @example
({ClassName})} />
- * @example
+ * @example
+ * @example
+ * @example const cn = classNamingBasic({C1})({C2});
*/
-function classNamingBasic
(
- classnames: ClassNamesMap>
-): Return extends string ? string : ClassNamed
+function classNamingBasic