poc-react-shared-components 1.0.0
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,13 @@
|
|
|
1
|
+
import './employeeCard';
|
|
2
|
+
type Employee = {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
email: string;
|
|
6
|
+
};
|
|
7
|
+
type Props = {
|
|
8
|
+
employee: Employee;
|
|
9
|
+
onEdit?: (employee: Employee) => void;
|
|
10
|
+
onDelete?: (id: number) => void;
|
|
11
|
+
};
|
|
12
|
+
declare function EmployeeCard({ employee, onEdit, onDelete }: Props): JSX.Element;
|
|
13
|
+
export default EmployeeCard;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import './employeeCard';
|
|
3
|
+
function EmployeeCard({ employee, onEdit, onDelete }) {
|
|
4
|
+
return (_jsxs("div", { className: "card", children: [_jsxs("p", { children: [_jsx("strong", { children: "Name:" }), " ", employee.name] }), _jsxs("p", { children: [_jsx("strong", { children: "Email:" }), " ", employee.email] }), _jsx("button", { onClick: () => onEdit === null || onEdit === void 0 ? void 0 : onEdit(employee), children: "Edit" }), _jsx("button", { style: { backgroundColor: "red" }, onClick: () => onDelete === null || onDelete === void 0 ? void 0 : onDelete(employee.id), children: "Delete" })] }));
|
|
5
|
+
}
|
|
6
|
+
export default EmployeeCard;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as EmployeeCard } from './components/Card/employeeCard';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as EmployeeCard } from './components/Card/employeeCard';
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "poc-react-shared-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Reusable shared React components",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": ["dist"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["react", "components", "ui", "shared"],
|
|
12
|
+
"author": "abishek",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"react": "^18",
|
|
17
|
+
"react-dom": "^18"
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"typescript": "^5",
|
|
22
|
+
"@types/react": "^18",
|
|
23
|
+
"@types/react-dom": "^18"
|
|
24
|
+
}
|
|
25
|
+
}
|