@oneplatformdev/utils 0.1.1-7 → 0.1.1-70

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/CHANGELOG.md +163 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3 -3
  4. package/{dist/cn → cn}/cn.d.ts +1 -1
  5. package/cn/cn.js +9 -0
  6. package/cn/index.js +5 -0
  7. package/{dist/composeRefs → composeRefs}/composeRefs.d.ts +1 -1
  8. package/composeRefs/composeRefs.js +10 -0
  9. package/composeRefs/index.js +5 -0
  10. package/{dist/index.d.ts → index.d.ts} +1 -0
  11. package/{dist/index.d.ts.map → index.d.ts.map} +1 -1
  12. package/index.js +8 -0
  13. package/isValidReactElement/index.d.ts +2 -0
  14. package/isValidReactElement/index.d.ts.map +1 -0
  15. package/isValidReactElement/index.js +5 -0
  16. package/isValidReactElement/isValidReactElement.d.ts +18 -0
  17. package/isValidReactElement/isValidReactElement.d.ts.map +1 -0
  18. package/isValidReactElement/isValidReactElement.js +8 -0
  19. package/package.json +41 -21
  20. package/types/PartialOne.js +1 -0
  21. package/types/index.js +1 -0
  22. package/dist/cn/cn.js +0 -6
  23. package/dist/cn/index.js +0 -1
  24. package/dist/composeRefs/composeRefs.js +0 -13
  25. package/dist/composeRefs/index.js +0 -1
  26. package/dist/index.js +0 -2
  27. package/dist/types/PartialOne.js +0 -1
  28. package/dist/types/index.js +0 -1
  29. /package/{dist/cn → cn}/cn.d.ts.map +0 -0
  30. /package/{dist/cn → cn}/index.d.ts +0 -0
  31. /package/{dist/cn → cn}/index.d.ts.map +0 -0
  32. /package/{dist/composeRefs → composeRefs}/composeRefs.d.ts.map +0 -0
  33. /package/{dist/composeRefs → composeRefs}/index.d.ts +0 -0
  34. /package/{dist/composeRefs → composeRefs}/index.d.ts.map +0 -0
  35. /package/{dist/types → types}/PartialOne.d.ts +0 -0
  36. /package/{dist/types → types}/PartialOne.d.ts.map +0 -0
  37. /package/{dist/types → types}/index.d.ts +0 -0
  38. /package/{dist/types → types}/index.d.ts.map +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,163 @@
1
+ ## 0.1.1-70 (2025-09-16)
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-69 (2025-09-16)
6
+
7
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
8
+
9
+ ## 0.1.1-68 (2025-09-16)
10
+
11
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
12
+
13
+ ## 0.1.1-67 (2025-09-16)
14
+
15
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
16
+
17
+ ## 0.1.1-66 (2025-09-16)
18
+
19
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
20
+
21
+ ## 0.1.1-65 (2025-09-16)
22
+
23
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
24
+
25
+ ## 0.1.1-64 (2025-09-15)
26
+
27
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
28
+
29
+ ## 0.1.1-63 (2025-09-15)
30
+
31
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
32
+
33
+ ## 0.1.1-62 (2025-09-15)
34
+
35
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
36
+
37
+ ## 0.1.1-61 (2025-09-15)
38
+
39
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
40
+
41
+ ## 0.1.1-60 (2025-09-15)
42
+
43
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
44
+
45
+ ## 0.1.1-59 (2025-09-15)
46
+
47
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
48
+
49
+ ## 0.1.1-58 (2025-09-15)
50
+
51
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
52
+
53
+ ## 0.1.1-57 (2025-09-15)
54
+
55
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
56
+
57
+ ## 0.1.1-56 (2025-09-15)
58
+
59
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
60
+
61
+ ## 0.1.1-55 (2025-09-15)
62
+
63
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
64
+
65
+ ## 0.1.1-54 (2025-09-15)
66
+
67
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
68
+
69
+ ## 0.1.1-53 (2025-09-15)
70
+
71
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
72
+
73
+ ## 0.1.1-52 (2025-09-15)
74
+
75
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
76
+
77
+ ## 0.1.1-51 (2025-09-15)
78
+
79
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
80
+
81
+ ## 0.1.1-50 (2025-09-15)
82
+
83
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
84
+
85
+ ## 0.1.1-49 (2025-09-15)
86
+
87
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
88
+
89
+ ## 0.1.1-48 (2025-09-15)
90
+
91
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
92
+
93
+ ## 0.1.1-47 (2025-09-15)
94
+
95
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
96
+
97
+ ## 0.1.1-46 (2025-09-15)
98
+
99
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
100
+
101
+ ## 0.1.1-45 (2025-09-15)
102
+
103
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
104
+
105
+ ## 0.1.1-44 (2025-09-15)
106
+
107
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
108
+
109
+ ## 0.1.1-43 (2025-09-15)
110
+
111
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
112
+
113
+ ## 0.1.1-41 (2025-09-15)
114
+
115
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
116
+
117
+ ## 0.1.1-40 (2025-09-15)
118
+
119
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
120
+
121
+ ## 0.1.1-39 (2025-09-15)
122
+
123
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
124
+
125
+ ## 0.1.1-38 (2025-09-15)
126
+
127
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
128
+
129
+ ## 0.1.1-37 (2025-09-15)
130
+
131
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
132
+
133
+ ## 0.1.1-36 (2025-09-15)
134
+
135
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
136
+
137
+ ## 0.1.1-35 (2025-09-11)
138
+
139
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
140
+
141
+ ## 0.1.1-34 (2025-09-11)
142
+
143
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
144
+
145
+ ## 0.1.1-32 (2025-09-11)
146
+
147
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
148
+
149
+ ## 0.1.1-28 (2025-09-11)
150
+
151
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
152
+
153
+ ## 0.1.1-27 (2025-09-11)
154
+
155
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
156
+
157
+ ## 0.1.1-26 (2025-09-11)
158
+
159
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
160
+
161
+ ## 0.1.1-25 (2025-09-11)
162
+
163
+ This was a version bump only for @oneplatformdev/utils to align it with other projects, there were no code changes.
package/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/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # utils
1
+ # @oneplatformdev/utils
2
2
 
3
3
  This library was generated with [Nx](https://nx.dev).
4
4
 
5
- ## Building
5
+ ## Running unit tests
6
6
 
7
- Run `nx build utils` to build the library.
7
+ Run `nx test @oneplatformdev/utils` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -1,4 +1,4 @@
1
- import { type ClassValue } from "clsx";
1
+ import { ClassValue } from 'clsx';
2
2
  export declare function cn(...inputs: ClassValue[]): string;
3
3
  export default cn;
4
4
  //# sourceMappingURL=cn.d.ts.map
package/cn/cn.js ADDED
@@ -0,0 +1,9 @@
1
+ import { clsx as t } from "clsx";
2
+ import { twMerge as o } from "tailwind-merge";
3
+ function m(...r) {
4
+ return o(t(r));
5
+ }
6
+ export {
7
+ m as cn,
8
+ m as default
9
+ };
package/cn/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import { cn as e, cn as f } from "./cn.js";
2
+ export {
3
+ e as cn,
4
+ f as default
5
+ };
@@ -1,4 +1,4 @@
1
- import type { Ref } from "react";
1
+ import { Ref } from 'react';
2
2
  export declare function composeRefs<T>(...refs: Array<Ref<T> | undefined | null>): (node: T | null) => void;
3
3
  export default composeRefs;
4
4
  //# sourceMappingURL=composeRefs.d.ts.map
@@ -0,0 +1,10 @@
1
+ function t(...o) {
2
+ return (f) => {
3
+ for (const e of o)
4
+ e && (typeof e == "function" ? e(f) : e.current = f);
5
+ };
6
+ }
7
+ export {
8
+ t as composeRefs,
9
+ t as default
10
+ };
@@ -0,0 +1,5 @@
1
+ import { composeRefs as s, composeRefs as f } from "./composeRefs.js";
2
+ export {
3
+ s as composeRefs,
4
+ f as default
5
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './cn';
2
2
  export * from './composeRefs';
3
+ export * from './isValidReactElement';
3
4
  export type * from './types';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,eAAe,CAAC;AAC9B,mBAAmB,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,mBAAmB,SAAS,CAAC"}
package/index.js ADDED
@@ -0,0 +1,8 @@
1
+ import { cn as r } from "./cn/cn.js";
2
+ import { composeRefs as t } from "./composeRefs/composeRefs.js";
3
+ import { isValidReactElement as p } from "./isValidReactElement/isValidReactElement.js";
4
+ export {
5
+ r as cn,
6
+ t as composeRefs,
7
+ p as isValidReactElement
8
+ };
@@ -0,0 +1,2 @@
1
+ export { isValidReactElement as default, isValidReactElement } from './isValidReactElement';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/isValidReactElement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,IAAI,OAAO,EAAE,mBAAmB,EAAC,MAAM,uBAAuB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { isValidReactElement as t, isValidReactElement as l } from "./isValidReactElement.js";
2
+ export {
3
+ t as default,
4
+ l as isValidReactElement
5
+ };
@@ -0,0 +1,18 @@
1
+ import { JSXElementConstructor, ReactNode } from 'react';
2
+ /**
3
+ * Is Valid React Element.
4
+ *
5
+ * Where {@link ReactNode} represents everything that can be rendered, `ReactElement`
6
+ * only represents JSX.
7
+ * @returns boolean - value is valid react element or not
8
+ * @template Type The type of the component or tag
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * const isValid = isValidReactElement(targetElement);
13
+ * const isValidDiv = isValidReactElement(targetElement, 'div');
14
+ * const isValidButton = isValidReactElement(targetElement, Button);
15
+ * ```
16
+ */
17
+ export declare const isValidReactElement: <Type extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>>(element: ReactNode, type?: Type) => boolean;
18
+ //# sourceMappingURL=isValidReactElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isValidReactElement.d.ts","sourceRoot":"","sources":["../../src/isValidReactElement/isValidReactElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,GAAI,IAAI,SAAS,MAAM,GAAG,qBAAqB,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,qBAAqB,CAAC,GAAG,CAAC,EACxH,SAAS,SAAS,EAClB,OAAO,IAAI,KACV,OAIF,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { isValidElement as e } from "react";
2
+ const o = (i, t) => {
3
+ const r = e(i);
4
+ return t ? r && i.type === t : r;
5
+ };
6
+ export {
7
+ o as isValidReactElement
8
+ };
package/package.json CHANGED
@@ -1,37 +1,57 @@
1
1
  {
2
2
  "name": "@oneplatformdev/utils",
3
- "version": "0.1.1-7",
3
+ "version": "0.1.1-70",
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",
4
23
  "type": "module",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- "./package.json": "./package.json",
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js",
13
- "default": "./dist/index.js"
14
- },
15
- "./*": {
16
- "types": "./dist/*.d.ts",
17
- "import": "./dist/*.js",
18
- "default": "./dist/*.js"
19
- }
24
+ "main": "./index.js",
25
+ "module": "./index.js",
26
+ "types": "./index.d.ts",
27
+ "publishConfig": {
28
+ "directory": "dist"
20
29
  },
21
30
  "files": [
31
+ "**/*",
22
32
  "dist",
23
33
  "!**/*.tsbuildinfo"
24
34
  ],
25
35
  "dependencies": {
26
- "clsx": "^2.1.0",
27
- "tailwind-merge": "^2.5.0",
28
- "tslib": "^2.3.0"
36
+ "class-variance-authority": "^0.7.1",
37
+ "clsx": "^2.1.1",
38
+ "tailwind-merge": "^3.3.1"
29
39
  },
30
40
  "peerDependencies": {
31
- "react": ">=18"
41
+ "react": "^19.0.0",
42
+ "react-dom": "^19.0.0"
43
+ },
44
+ "devDependencies": {
45
+ "react": "19.1.1",
46
+ "react-dom": "19.1.1",
47
+ "@types/react": "19.x",
48
+ "@types/react-dom": "19.x"
32
49
  },
33
50
  "peerDependenciesMeta": {
34
- "react": {
51
+ "@types/react": {
52
+ "optional": true
53
+ },
54
+ "@types/react-dom": {
35
55
  "optional": true
36
56
  }
37
57
  }
@@ -0,0 +1 @@
1
+
package/types/index.js ADDED
@@ -0,0 +1 @@
1
+
package/dist/cn/cn.js DELETED
@@ -1,6 +0,0 @@
1
- import { clsx } from "clsx";
2
- import { twMerge } from "tailwind-merge";
3
- export function cn(...inputs) {
4
- return twMerge(clsx(inputs));
5
- }
6
- export default cn;
package/dist/cn/index.js DELETED
@@ -1 +0,0 @@
1
- export { default, cn } from './cn';
@@ -1,13 +0,0 @@
1
- export function composeRefs(...refs) {
2
- return (node) => {
3
- for (const ref of refs) {
4
- if (!ref)
5
- continue;
6
- if (typeof ref === "function")
7
- ref(node);
8
- else
9
- ref.current = node;
10
- }
11
- };
12
- }
13
- export default composeRefs;
@@ -1 +0,0 @@
1
- export { default, composeRefs } from './composeRefs';
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './cn';
2
- export * from './composeRefs';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes