@uxf/core 11.93.0 → 11.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -171,6 +171,16 @@ import { capitalize } from "@uxf/core/utils/capitalize";
171
171
  const example = capitalize("hello world"); /* returns "Hello world" */
172
172
  ```
173
173
 
174
+ ## cn
175
+
176
+ A simple tag for template literals that returns the string as-is. Useful for tooling (e.g. Tailwind CSS IntelliSense) to recognize class strings.
177
+
178
+ ```tsx
179
+ import { cn } from "@uxf/core/utils/cn";
180
+
181
+ const className = cn`flex items-center justify-center`;
182
+ ```
183
+
174
184
  ## composeRefs
175
185
 
176
186
  ```tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/core",
3
- "version": "11.93.0",
3
+ "version": "11.95.0",
4
4
  "description": "UXF Core",
5
5
  "author": "Petr Vejvoda <vejvoda@uxf.cz>",
6
6
  "homepage": "https://gitlab.com/uxf-npm/core#readme",
package/utils/cn.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function cn([className]: TemplateStringsArray): string;
package/utils/cn.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cn = cn;
4
+ function cn([className]) {
5
+ return className;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cn_1 = require("./cn");
4
+ test("returns the class name", () => {
5
+ expect((0, cn_1.cn) `foo`).toBe("foo");
6
+ expect((0, cn_1.cn) `foo bar`).toBe("foo bar");
7
+ });