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.
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ type PropsType = {
3
+ children: ReactNode;
4
+ onClick?: () => void;
5
+ };
6
+ declare const Button: ({ children, onClick }: PropsType) => import("react/jsx-runtime").JSX.Element;
7
+ export { Button };
@@ -0,0 +1,6 @@
1
+ declare const useCounter: () => {
2
+ count: number;
3
+ increment: () => void;
4
+ decrement: () => void;
5
+ };
6
+ export { useCounter };
@@ -0,0 +1,2 @@
1
+ export * from './hooks/counter';
2
+ export * from './components/Button';
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
+ }
@@ -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
@@ -0,0 +1,2 @@
1
+ export * from './hooks/counter';
2
+ export * from './components/Button';
package/tsconfig.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target":"ES2020",
4
+ "module": "ESNext",
5
+ "declaration": true,
6
+ "declarationDir": "dist",
7
+ "strict": true,
8
+ "jsx": "react-jsx",
9
+ }
10
+ }
11
+