pack-to-ui-pro 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/components/Button.d.ts +7 -0
- package/dist/hooks/counter.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +27 -0
- package/package.json +23 -0
- package/rollup.config.js +13 -0
- package/src/components/Button.tsx +27 -0
- package/src/hooks/counter.tsx +14 -0
- package/src/index.ts +2 -0
- package/tsconfig.json +11 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
import { useState } from 'react';
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
3
|
+
|
4
|
+
const useCounter = () => {
|
5
|
+
const [count, setCount] = useState(0);
|
6
|
+
const increment = () => {
|
7
|
+
setCount(count + 1);
|
8
|
+
};
|
9
|
+
const decrement = () => {
|
10
|
+
setCount(count - 1);
|
11
|
+
};
|
12
|
+
return { count, increment, decrement };
|
13
|
+
};
|
14
|
+
|
15
|
+
const Button = ({ children, onClick }) => {
|
16
|
+
return (jsx("button", { onClick: onClick, style: {
|
17
|
+
padding: "10px 20px",
|
18
|
+
fontSize: "1.2em",
|
19
|
+
borderRadius: "5px",
|
20
|
+
cursor: "pointer",
|
21
|
+
backgroundColor: "blue",
|
22
|
+
color: "white",
|
23
|
+
border: "none",
|
24
|
+
}, children: children }));
|
25
|
+
};
|
26
|
+
|
27
|
+
export { Button, useCounter };
|
package/package.json
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"name": "pack-to-ui-pro",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"description": "",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"types": "dist/index.d.ts",
|
7
|
+
"type": "module",
|
8
|
+
"scripts": {
|
9
|
+
"build": "npx rollup -c"
|
10
|
+
},
|
11
|
+
"keywords": [],
|
12
|
+
"author": "",
|
13
|
+
"license": "ISC",
|
14
|
+
"devDependencies": {
|
15
|
+
"@rollup/plugin-babel": "^6.0.4",
|
16
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
17
|
+
"@types/react": "^19.1.3",
|
18
|
+
"react": "^19.1.0",
|
19
|
+
"react-dom": "^19.1.0",
|
20
|
+
"rollup": "^4.40.2",
|
21
|
+
"tslib": "^2.8.1"
|
22
|
+
}
|
23
|
+
}
|
package/rollup.config.js
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
import { defineConfig } from "rollup";
|
2
|
+
import typescript from "@rollup/plugin-typescript";
|
3
|
+
|
4
|
+
export default defineConfig({
|
5
|
+
input: "src/index.ts",
|
6
|
+
output: {
|
7
|
+
dir: "dist",
|
8
|
+
format: "es",
|
9
|
+
name: "smart-copy2clip",
|
10
|
+
},
|
11
|
+
external: ["react", "react-dom"],
|
12
|
+
plugins: [typescript({ tsconfig: "tsconfig.json" })],
|
13
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import { ReactNode } from "react";
|
3
|
+
|
4
|
+
type PropsType = {
|
5
|
+
children: ReactNode;
|
6
|
+
onClick?: () => void;
|
7
|
+
};
|
8
|
+
const Button = ({ children, onClick }: PropsType) => {
|
9
|
+
return (
|
10
|
+
<button
|
11
|
+
onClick={onClick}
|
12
|
+
style={{
|
13
|
+
padding: "10px 20px",
|
14
|
+
fontSize: "1.2em",
|
15
|
+
borderRadius: "5px",
|
16
|
+
cursor: "pointer",
|
17
|
+
backgroundColor: "blue",
|
18
|
+
color: "white",
|
19
|
+
border: "none",
|
20
|
+
}}
|
21
|
+
>
|
22
|
+
{children}
|
23
|
+
</button>
|
24
|
+
);
|
25
|
+
};
|
26
|
+
|
27
|
+
export { Button };
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { useState } from "react";
|
2
|
+
const useCounter = () => {
|
3
|
+
const [count, setCount] = useState(0);
|
4
|
+
const increment = () => {
|
5
|
+
setCount(count + 1);
|
6
|
+
};
|
7
|
+
const decrement = () => {
|
8
|
+
setCount(count - 1);
|
9
|
+
};
|
10
|
+
|
11
|
+
return { count, increment, decrement };
|
12
|
+
};
|
13
|
+
|
14
|
+
export { useCounter };
|
package/src/index.ts
ADDED