@oneplatformdev/utils 0.0.2-beta.7 → 0.1.1-2
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 +3 -7
- package/{cn → dist/cn}/cn.d.ts +2 -2
- package/dist/cn/cn.d.ts.map +1 -0
- package/dist/cn/cn.js +6 -0
- package/dist/cn/index.d.ts +2 -0
- package/dist/cn/index.d.ts.map +1 -0
- package/dist/composeRefs/composeRefs.d.ts +4 -0
- package/dist/composeRefs/composeRefs.d.ts.map +1 -0
- package/dist/composeRefs/composeRefs.js +13 -0
- package/dist/composeRefs/index.d.ts +2 -0
- package/dist/composeRefs/index.d.ts.map +1 -0
- package/dist/composeRefs/index.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/types/PartialOne.d.ts +2 -0
- package/dist/types/PartialOne.d.ts.map +1 -0
- package/dist/types/PartialOne.js +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/package.json +29 -43
- package/cn/cn.mjs +0 -9
- package/cn/index.mjs +0 -5
- package/cn/package.json +0 -7
- package/index.d.ts +0 -2
- package/index.mjs +0 -6
- package/isValidReactElement/index.d.ts +0 -1
- package/isValidReactElement/index.mjs +0 -5
- package/isValidReactElement/isValidReactElement.d.ts +0 -18
- package/isValidReactElement/isValidReactElement.mjs +0 -1365
- package/isValidReactElement/package.json +0 -7
- /package/{cn/index.d.ts → dist/cn/index.js} +0 -0
package/README.md
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# utils
|
|
2
2
|
|
|
3
3
|
This library was generated with [Nx](https://nx.dev).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
npm instsall @oneplatformdev/utils clsx tailwind-merge
|
|
7
|
-
```
|
|
5
|
+
## Building
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Run `nx test utils` to execute the unit tests via [Vitest](https://vitest.dev/).
|
|
7
|
+
Run `nx build utils` to build the library.
|
package/{cn → dist/cn}/cn.d.ts
RENAMED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/cn/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AACD,eAAe,EAAE,CAAA"}
|
package/dist/cn/cn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cn/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composeRefs.d.ts","sourceRoot":"","sources":["../../src/composeRefs/composeRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAe,MAAM,OAAO,CAAC;AAE9C,wBAAgB,WAAW,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,IAC9D,MAAM,CAAC,GAAG,IAAI,UAOvB;AACD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composeRefs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, composeRefs } from './composeRefs';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +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"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PartialOne.d.ts","sourceRoot":"","sources":["../../src/types/PartialOne.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,54 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneplatformdev/utils",
|
|
3
|
-
"version": "0.
|
|
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
|
-
"main": "./index.mjs",
|
|
22
|
-
"types": "./index.d.ts",
|
|
3
|
+
"version": "0.1.1-2",
|
|
23
4
|
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
24
8
|
"exports": {
|
|
9
|
+
"./package.json": "./package.json",
|
|
25
10
|
".": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
11
|
+
"@oneplatformdev/source": "./src/index.ts",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
29
15
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
16
|
+
"./*": {
|
|
17
|
+
"@oneplatformdev/source": "./src/*.ts",
|
|
18
|
+
"types": "./dist/*.d.ts",
|
|
19
|
+
"import": "./dist/*.js",
|
|
20
|
+
"default": "./dist/*.js"
|
|
34
21
|
}
|
|
35
22
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"node": ">=20"
|
|
45
|
-
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"release": "pnpm publish",
|
|
48
|
-
"build": "vite build"
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"!**/*.tsbuildinfo"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"clsx": "^2.1.0",
|
|
29
|
+
"tailwind-merge": "^2.5.0",
|
|
30
|
+
"tslib": "^2.3.0"
|
|
49
31
|
},
|
|
50
32
|
"peerDependencies": {
|
|
51
|
-
"
|
|
52
|
-
|
|
33
|
+
"react": ">=18"
|
|
34
|
+
},
|
|
35
|
+
"peerDependenciesMeta": {
|
|
36
|
+
"react": {
|
|
37
|
+
"optional": true
|
|
38
|
+
}
|
|
53
39
|
}
|
|
54
|
-
}
|
|
40
|
+
}
|
package/cn/cn.mjs
DELETED
package/cn/index.mjs
DELETED
package/cn/package.json
DELETED
package/index.d.ts
DELETED
package/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { isValidReactElement as default, isValidReactElement } from './isValidReactElement';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { JSXElementConstructor, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Is Valid React Element.
|
|
5
|
-
*
|
|
6
|
-
* Where {@link ReactNode} represents everything that can be rendered, `ReactElement`
|
|
7
|
-
* only represents JSX.
|
|
8
|
-
* @returns boolean - value is valid react element or not
|
|
9
|
-
* @template Type The type of the component or tag
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* const isValid = isValidReactElement(targetElement);
|
|
14
|
-
* const isValidDiv = isValidReactElement(targetElement, 'div');
|
|
15
|
-
* const isValidButton = isValidReactElement(targetElement, Button);
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare const isValidReactElement: <Type extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>>(element: ReactNode, type?: Type) => boolean;
|