@oneplatformdev/utils 0.1.1-21 → 0.1.1-26

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.
Files changed (38) hide show
  1. package/.babelrc +12 -0
  2. package/CHANGELOG.md +7 -0
  3. package/dist/CHANGELOG.md +3 -0
  4. package/dist/LICENSE +21 -0
  5. package/dist/README.md +7 -0
  6. package/dist/package.json +61 -0
  7. package/package.json +4 -6
  8. package/src/cn/cn.ts +7 -0
  9. package/src/cn/index.ts +1 -0
  10. package/src/composeRefs/composeRefs.ts +12 -0
  11. package/src/composeRefs/index.ts +1 -0
  12. package/src/index.ts +3 -0
  13. package/src/types/PartialOne.ts +1 -0
  14. package/src/types/index.ts +1 -0
  15. package/tsconfig.json +10 -0
  16. package/tsconfig.lib.json +34 -0
  17. package/vite.config.ts +60 -0
  18. /package/{cn → dist/cn}/cn.d.ts +0 -0
  19. /package/{cn → dist/cn}/cn.d.ts.map +0 -0
  20. /package/{cn → dist/cn}/cn.js +0 -0
  21. /package/{cn → dist/cn}/index.d.ts +0 -0
  22. /package/{cn → dist/cn}/index.d.ts.map +0 -0
  23. /package/{cn → dist/cn}/index.js +0 -0
  24. /package/{composeRefs → dist/composeRefs}/composeRefs.d.ts +0 -0
  25. /package/{composeRefs → dist/composeRefs}/composeRefs.d.ts.map +0 -0
  26. /package/{composeRefs → dist/composeRefs}/composeRefs.js +0 -0
  27. /package/{composeRefs → dist/composeRefs}/index.d.ts +0 -0
  28. /package/{composeRefs → dist/composeRefs}/index.d.ts.map +0 -0
  29. /package/{composeRefs → dist/composeRefs}/index.js +0 -0
  30. /package/{index.d.ts → dist/index.d.ts} +0 -0
  31. /package/{index.d.ts.map → dist/index.d.ts.map} +0 -0
  32. /package/{index.js → dist/index.js} +0 -0
  33. /package/{types → dist/types}/PartialOne.d.ts +0 -0
  34. /package/{types → dist/types}/PartialOne.d.ts.map +0 -0
  35. /package/{types → dist/types}/PartialOne.js +0 -0
  36. /package/{types → dist/types}/index.d.ts +0 -0
  37. /package/{types → dist/types}/index.d.ts.map +0 -0
  38. /package/{types → dist/types}/index.js +0 -0
package/.babelrc ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@nx/react/babel",
5
+ {
6
+ "runtime": "automatic",
7
+ "useBuiltIns": "usage"
8
+ }
9
+ ]
10
+ ],
11
+ "plugins": []
12
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## 0.1.1-26 (2025-09-11)
2
+
3
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
4
+
5
+ ## 0.1.1-25 (2025-09-11)
6
+
7
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
@@ -0,0 +1,3 @@
1
+ ## 0.1.1-25 (2025-09-11)
2
+
3
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
package/dist/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Oleh Maksimenko
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/dist/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @oneplatformdev/utils
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running unit tests
6
+
7
+ Run `nx test @oneplatformdev/utils` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@oneplatformdev/utils",
3
+ "version": "0.1.1-25",
4
+ "description": "Utility functions for React components.",
5
+ "author": "One Platform Development Team",
6
+ "keywords": [
7
+ "clsx",
8
+ "cn",
9
+ "oneplatform",
10
+ "utils"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/oneplatformdev/core.git",
15
+ "directory": "packages/utils"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/oneplatformdev/core/issues"
19
+ },
20
+ "homepage": "private package",
21
+ "private": false,
22
+ "license": "MIT",
23
+ "type": "module",
24
+ "main": "./index.js",
25
+ "module": "./index.js",
26
+ "types": "./index.d.ts",
27
+ "exports": {
28
+ "./package.json": "./package.json",
29
+ ".": {
30
+ "@oneplatformdev/source": "./src/index.ts",
31
+ "types": "./index.d.ts",
32
+ "import": "./index.js",
33
+ "default": "./index.js"
34
+ },
35
+ "./*": {
36
+ "types": "./*.d.ts",
37
+ "import": "./*.js",
38
+ "default": "./*.js"
39
+ }
40
+ },
41
+ "files": [
42
+ "**/*",
43
+ "dist",
44
+ "README.md",
45
+ "LICENSE",
46
+ "!**/*.tsbuildinfo"
47
+ ],
48
+ "dependencies": {
49
+ "clsx": "^2.1.0",
50
+ "tailwind-merge": "^2.5.0",
51
+ "class-variance-authority": "^0.7.1"
52
+ },
53
+ "peerDependencies": {
54
+ "react": ">=18 || >=19"
55
+ },
56
+ "peerDependenciesMeta": {
57
+ "react": {
58
+ "optional": true
59
+ }
60
+ }
61
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/utils",
3
- "version": "0.1.1-21",
3
+ "version": "0.1.1-26",
4
4
  "description": "Utility functions for React components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [
@@ -38,9 +38,6 @@
38
38
  "default": "./*.js"
39
39
  }
40
40
  },
41
- "publishConfig": {
42
- "directory": "dist"
43
- },
44
41
  "files": [
45
42
  "**/*",
46
43
  "dist",
@@ -50,10 +47,11 @@
50
47
  ],
51
48
  "dependencies": {
52
49
  "clsx": "^2.1.0",
53
- "tailwind-merge": "^2.5.0"
50
+ "tailwind-merge": "^2.5.0",
51
+ "class-variance-authority": "^0.7.1"
54
52
  },
55
53
  "peerDependencies": {
56
- "react": ">=18"
54
+ "react": ">=18 || >=19"
57
55
  },
58
56
  "peerDependenciesMeta": {
59
57
  "react": {
package/src/cn/cn.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { clsx, type ClassValue } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
7
+ export default cn
@@ -0,0 +1 @@
1
+ export { default, cn } from './cn';
@@ -0,0 +1,12 @@
1
+ import type { Ref, RefCallback } from "react";
2
+
3
+ export function composeRefs<T>(...refs: Array<Ref<T> | undefined | null>) {
4
+ return (node: T | null) => {
5
+ for (const ref of refs) {
6
+ if (!ref) continue;
7
+ if (typeof ref === "function") (ref as RefCallback<T>)(node);
8
+ else (ref as { current: T | null }).current = node;
9
+ }
10
+ };
11
+ }
12
+ export default composeRefs;
@@ -0,0 +1 @@
1
+ export { default, composeRefs } from './composeRefs';
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './cn';
2
+ export * from './composeRefs';
3
+ export type * from './types';
@@ -0,0 +1 @@
1
+ export type PartialOne<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
@@ -0,0 +1 @@
1
+ export type * from './PartialOne'
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "files": [],
3
+ "include": [],
4
+ "references": [
5
+ {
6
+ "path": "./tsconfig.lib.json"
7
+ }
8
+ ],
9
+ "extends": "../../tsconfig.base.json"
10
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "module": "esnext",
5
+ "outDir": "dist",
6
+ "types": [
7
+ "node",
8
+ "@nx/react/typings/cssmodule.d.ts",
9
+ "@nx/react/typings/image.d.ts",
10
+ "vite/client"
11
+ ],
12
+ "rootDir": "src",
13
+ "jsx": "react-jsx",
14
+ "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo"
15
+ },
16
+ "exclude": [
17
+ "out-tsc",
18
+ "dist",
19
+ "**/*.spec.ts",
20
+ "**/*.test.ts",
21
+ "**/*.spec.tsx",
22
+ "**/*.test.tsx",
23
+ "**/*.spec.js",
24
+ "**/*.test.js",
25
+ "**/*.spec.jsx",
26
+ "**/*.test.jsx"
27
+ ],
28
+ "include": [
29
+ "src/**/*.js",
30
+ "src/**/*.jsx",
31
+ "src/**/*.ts",
32
+ "src/**/*.tsx"
33
+ ]
34
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,60 @@
1
+ /// <reference types='vitest' />
2
+ import { defineConfig } from 'vite';
3
+ import react from '@vitejs/plugin-react';
4
+ import dts from 'vite-plugin-dts';
5
+ import * as path from 'path';
6
+ import { globSync } from 'glob';
7
+ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
8
+ import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
9
+
10
+ export default defineConfig(() => ({
11
+ root: __dirname,
12
+ cacheDir: '../../node_modules/.vite/packages/utils',
13
+ plugins: [
14
+ react(),
15
+ nxViteTsPaths(),
16
+ nxCopyAssetsPlugin([ '*.md', 'LICENSE', 'package.json' ]),
17
+ dts({
18
+ entryRoot: 'src',
19
+ tsconfigPath: path.join(__dirname, 'tsconfig.lib.json')
20
+ })
21
+ ],
22
+ build: {
23
+ outDir: './dist',
24
+ emptyOutDir: true,
25
+ reportCompressedSize: true,
26
+ commonjsOptions: {
27
+ transformMixedEsModules: true,
28
+ },
29
+ sourcemap: false,
30
+ target: 'es2022',
31
+ lib: {
32
+ name: '@oneplatformdev/utils',
33
+ formats: [ 'es' as const ],
34
+ entry: {
35
+ index: path.resolve(__dirname, 'src/index.ts'),
36
+ ...Object.fromEntries(
37
+ globSync('src/**/*.{ts,tsx}').map((filename) => {
38
+ return [
39
+ path.relative(
40
+ 'src',
41
+ filename.slice(0, filename.length - path.extname(filename).length)
42
+ ),
43
+ path.resolve(__dirname, filename),
44
+ ]
45
+ })
46
+ )
47
+ }
48
+ },
49
+ rollupOptions: {
50
+ external: [ 'react', 'react-dom', 'react/jsx-runtime', "clsx", "tailwind-merge", "class-variance-authority" ],
51
+ output: {
52
+ preserveModules: true,
53
+ preserveModulesRoot: 'src',
54
+ globals: {
55
+ clsx: 'clsx',
56
+ },
57
+ },
58
+ }
59
+ },
60
+ }));
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes