@purpurds/common-types 0.0.1
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/dist/LICENSE.txt +1 -0
- package/dist/common-types.cjs.js +2 -0
- package/dist/common-types.cjs.js.map +1 -0
- package/dist/common-types.d.ts +10 -0
- package/dist/common-types.d.ts.map +1 -0
- package/dist/common-types.es.js +2 -0
- package/dist/common-types.es.js.map +1 -0
- package/eslint.config.mjs +2 -0
- package/package.json +58 -0
- package/src/common-types.ts +11 -0
package/dist/LICENSE.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
No third parties dependencies
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-types.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, JSX } from 'react';
|
|
2
|
+
|
|
3
|
+
type WithoutChildren<T> = Omit<T, "children">;
|
|
4
|
+
export type BaseProps<T extends keyof JSX.IntrinsicElements = "div"> = T extends "input" ? WithoutChildren<ComponentPropsWithRef<T>> & {
|
|
5
|
+
[key: `data-${string}`]: string | undefined;
|
|
6
|
+
} : ComponentPropsWithRef<T> & {
|
|
7
|
+
[key: `data-${string}`]: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=common-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-types.d.ts","sourceRoot":"","sources":["../src/common-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAExD,KAAK,eAAe,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AAE9C,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,iBAAiB,GAAG,KAAK,IAAI,CAAC,SAAS,OAAO,GACpF,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,GAAG;IAC1C,CAAC,GAAG,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;CAC7C,GACD,qBAAqB,CAAC,CAAC,CAAC,GAAG;IACzB,CAAC,GAAG,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;CAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-types.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@purpurds/common-types",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "AGPL-3.0-only",
|
|
5
|
+
"main": "./dist/common-types.cjs.js",
|
|
6
|
+
"types": "./dist/common-types.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"require": "./dist/common-types.cjs.js",
|
|
10
|
+
"types": "./dist/common-types.d.ts",
|
|
11
|
+
"default": "./dist/common-types.es.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"source": "src/common-types.ts",
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/node": "20.12.12",
|
|
17
|
+
"@types/react-dom": "^19.0.4",
|
|
18
|
+
"@types/react": "^19.0.10",
|
|
19
|
+
"eslint": "9.24.0",
|
|
20
|
+
"jsdom": "~22.1.0",
|
|
21
|
+
"lint-staged": "15.5.0",
|
|
22
|
+
"prettier": "~2.8.8",
|
|
23
|
+
"react-dom": "^19.0.0",
|
|
24
|
+
"react": "^19.0.0",
|
|
25
|
+
"typescript": "^5.6.3",
|
|
26
|
+
"vite": "^6.2.1",
|
|
27
|
+
"vitest": "^3.1.2",
|
|
28
|
+
"@purpurds/component-rig": "1.0.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@types/react": "^18 || ^19",
|
|
32
|
+
"@types/react-dom": "^18 || ^19",
|
|
33
|
+
"react": "^18 || ^19",
|
|
34
|
+
"react-dom": "^18 || ^19"
|
|
35
|
+
},
|
|
36
|
+
"peerDependenciesMeta": {
|
|
37
|
+
"@types/react": {
|
|
38
|
+
"optional": true
|
|
39
|
+
},
|
|
40
|
+
"@types/react-dom": {
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build:dev": "vite",
|
|
46
|
+
"build:watch": "vite build --watch",
|
|
47
|
+
"build": "vite build",
|
|
48
|
+
"ci:build": "rushx build",
|
|
49
|
+
"coverage": "vitest run --coverage",
|
|
50
|
+
"lint:fix": "eslint . --fix",
|
|
51
|
+
"lint": "lint-staged --no-stash 2>&1",
|
|
52
|
+
"sbdev": "rush sbdev",
|
|
53
|
+
"test:unit": "vitest run --passWithNoTests",
|
|
54
|
+
"test:watch": "vitest --watch",
|
|
55
|
+
"test": "rushx test:unit",
|
|
56
|
+
"typecheck": "tsc -p ./tsconfig.json"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, JSX } from "react";
|
|
2
|
+
|
|
3
|
+
type WithoutChildren<T> = Omit<T, "children">;
|
|
4
|
+
|
|
5
|
+
export type BaseProps<T extends keyof JSX.IntrinsicElements = "div"> = T extends "input"
|
|
6
|
+
? WithoutChildren<ComponentPropsWithRef<T>> & {
|
|
7
|
+
[key: `data-${string}`]: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
: ComponentPropsWithRef<T> & {
|
|
10
|
+
[key: `data-${string}`]: string | undefined;
|
|
11
|
+
};
|