@glob-ui/utils 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kevin Martínez E
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,19 @@
1
- # Temporary Holding Version
1
+ # @glob-ui/utils
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Joins class names and merges Tailwind classes, so the last conflicting class wins. It knows the GlobUI radius and shadow scales.
4
+
5
+ > **Internal API.** This package is used by the other GlobUI packages. Its exports can change in any release, so depend on the component packages instead.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pnpm add @glob-ui/utils
11
+ ```
12
+
13
+ ## Documentation
14
+
15
+ Full docs, examples and the accessibility table: [cn()](https://github.com/kevin-martineze/GlobUI/tree/main/apps/docs/content/docs/utilities/cn.mdx).
16
+
17
+ ## License
18
+
19
+ MIT. See [LICENSE](./LICENSE).
@@ -0,0 +1,5 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function cn(...inputs: ClassValue[]): string;
4
+
5
+ export { cn };
@@ -0,0 +1,5 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function cn(...inputs: ClassValue[]): string;
4
+
5
+ export { cn };
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ cn: () => cn
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ var import_clsx = require("clsx");
27
+ var import_tailwind_merge = require("tailwind-merge");
28
+ var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
29
+ extend: {
30
+ theme: {
31
+ radius: ["glob-sm", "glob-md", "glob-lg"],
32
+ shadow: ["glob-sm", "glob-md"]
33
+ }
34
+ }
35
+ });
36
+ function cn(...inputs) {
37
+ return twMerge((0, import_clsx.clsx)(inputs));
38
+ }
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ cn
42
+ });
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { extendTailwindMerge } from \"tailwind-merge\"\n\n// tailwind-merge only knows the default radius/shadow scales. Without this, \"rounded-glob-md\"\n// and a consumer's \"rounded-full\" both survive and the token class can win.\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n radius: [\"glob-sm\", \"glob-md\", \"glob-lg\"],\n shadow: [\"glob-sm\", \"glob-md\"],\n },\n },\n})\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAsC;AACtC,4BAAoC;AAIpC,IAAM,cAAU,2CAAoB;AAAA,EAClC,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,QAAQ,CAAC,WAAW,WAAW,SAAS;AAAA,MACxC,QAAQ,CAAC,WAAW,SAAS;AAAA,IAC/B;AAAA,EACF;AACF,CAAC;AAEM,SAAS,MAAM,QAAsB;AAC1C,SAAO,YAAQ,kBAAK,MAAM,CAAC;AAC7B;","names":[]}
package/dist/index.mjs ADDED
@@ -0,0 +1,18 @@
1
+ // src/index.ts
2
+ import { clsx } from "clsx";
3
+ import { extendTailwindMerge } from "tailwind-merge";
4
+ var twMerge = extendTailwindMerge({
5
+ extend: {
6
+ theme: {
7
+ radius: ["glob-sm", "glob-md", "glob-lg"],
8
+ shadow: ["glob-sm", "glob-md"]
9
+ }
10
+ }
11
+ });
12
+ function cn(...inputs) {
13
+ return twMerge(clsx(inputs));
14
+ }
15
+ export {
16
+ cn
17
+ };
18
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { extendTailwindMerge } from \"tailwind-merge\"\n\n// tailwind-merge only knows the default radius/shadow scales. Without this, \"rounded-glob-md\"\n// and a consumer's \"rounded-full\" both survive and the token class can win.\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n radius: [\"glob-sm\", \"glob-md\", \"glob-lg\"],\n shadow: [\"glob-sm\", \"glob-md\"],\n },\n },\n})\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";AAAA,SAAS,YAA6B;AACtC,SAAS,2BAA2B;AAIpC,IAAM,UAAU,oBAAoB;AAAA,EAClC,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,QAAQ,CAAC,WAAW,WAAW,SAAS;AAAA,MACxC,QAAQ,CAAC,WAAW,SAAS;AAAA,IAC/B;AAAA,EACF;AACF,CAAC;AAEM,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,65 @@
1
1
  {
2
2
  "name": "@glob-ui/utils",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "main": "./dist/index.js",
5
+ "module": "./dist/index.mjs",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": {
10
+ "types": "./dist/index.d.mts",
11
+ "default": "./dist/index.mjs"
12
+ },
13
+ "require": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ }
17
+ },
18
+ "./package.json": "./package.json"
19
+ },
20
+ "files": [
21
+ "dist/",
22
+ "LICENSE",
23
+ "README.md"
24
+ ],
25
+ "dependencies": {
26
+ "clsx": "^2.1.1",
27
+ "tailwind-merge": "^3.6.0"
28
+ },
29
+ "devDependencies": {
30
+ "tsup": "^8.5.1"
31
+ },
32
+ "description": "Joins class names and merges Tailwind classes, so the last conflicting class wins. It knows the GlobUI radius and shadow scales.",
33
+ "keywords": [
34
+ "react",
35
+ "glob-ui",
36
+ "components",
37
+ "accessible",
38
+ "tailwind",
39
+ "utils"
40
+ ],
41
+ "license": "MIT",
42
+ "author": "Kevin Martínez E",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/kevin-martineze/GlobUI.git",
46
+ "directory": "packages/utils"
47
+ },
48
+ "homepage": "https://github.com/kevin-martineze/GlobUI#readme",
49
+ "bugs": {
50
+ "url": "https://github.com/kevin-martineze/GlobUI/issues"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public",
54
+ "provenance": true
55
+ },
56
+ "sideEffects": false,
57
+ "type": "commonjs",
58
+ "engines": {
59
+ "node": ">=18.18"
60
+ },
61
+ "scripts": {
62
+ "build": "tsup",
63
+ "dev": "tsup --watch --no-clean"
64
+ }
6
65
  }