componenteshospitais 1.0.0 → 1.0.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/dist/components/Button.d.ts +6 -0
- package/dist/components/Input.d.ts +6 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +22 -21
- package/src/components/Button.tsx +10 -0
- package/src/components/Input.tsx +10 -0
- package/src/components/index.ts +2 -0
- package/src/index.tsx +1 -10
- package/tsconfig.json +12 -13
- package/webpack.config.js +3 -2
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("myLibrary",[],t):"object"==typeof exports?exports.myLibrary=t():e.myLibrary=t()}(
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("myLibrary",[],t):"object"==typeof exports?exports.myLibrary=t():e.myLibrary=t()}(this,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Button:()=>u,ButtonProps:()=>r.ButtonProps,Input:()=>p,InputProps:()=>o.InputProps});var r={};e.r(r),e.d(r,{$:()=>u});var o={};e.r(o),e.d(o,{p:()=>p});const n=require("react");var a=e.n(n),u=function(e){var t=e.label,r=e.onClick;return a().createElement("button",{onClick:r},t)},p=function(e){var t=e.placeholder,r=e.onChange;return a().createElement("input",{placeholder:t,onChange:r})};return t})()));
|
package/package.json
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "componenteshospitais",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "index.js",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
5
6
|
"scripts": {
|
|
6
|
-
"build": "webpack",
|
|
7
|
+
"build": "webpack && tsc --declaration --emitDeclarationOnly",
|
|
7
8
|
"prepublishOnly": "npm run build"
|
|
8
9
|
},
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"description": "",
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"react": "^18.3.1",
|
|
15
|
-
"react-dom": "^18.3.1"
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"react": "^17.0.0",
|
|
12
|
+
"react-dom": "^17.0.0"
|
|
16
13
|
},
|
|
17
14
|
"devDependencies": {
|
|
18
|
-
"
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"@babel/
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"babel-
|
|
25
|
-
"
|
|
26
|
-
"webpack": "^5.
|
|
27
|
-
"webpack-cli": "^
|
|
28
|
-
"webpack-node-externals": "^
|
|
15
|
+
"typescript": "^4.0.0",
|
|
16
|
+
"@types/react": "^17.0.0",
|
|
17
|
+
"@types/react-dom": "^17.0.0",
|
|
18
|
+
"@babel/core": "^7.0.0",
|
|
19
|
+
"@babel/preset-env": "^7.0.0",
|
|
20
|
+
"@babel/preset-react": "^7.0.0",
|
|
21
|
+
"@babel/preset-typescript": "^7.0.0",
|
|
22
|
+
"babel-loader": "^8.0.0",
|
|
23
|
+
"webpack": "^5.0.0",
|
|
24
|
+
"webpack-cli": "^4.0.0",
|
|
25
|
+
"webpack-node-externals": "^2.0.0"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"react": "^17.0.0",
|
|
29
|
+
"react-dom": "^17.0.0"
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface InputProps {
|
|
4
|
+
placeholder: string;
|
|
5
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const Input: React.FC<InputProps> = ({ placeholder, onChange }) => {
|
|
9
|
+
return <input placeholder={placeholder} onChange={onChange} />;
|
|
10
|
+
};
|
package/src/index.tsx
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface ButtonProps {
|
|
4
|
-
label: string;
|
|
5
|
-
onClick: () => void;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const Button: React.FC<ButtonProps> = ({ label, onClick }) => {
|
|
9
|
-
return <button onClick={onClick}>{label}</button>;
|
|
10
|
-
};
|
|
1
|
+
export * from './components';
|
package/tsconfig.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"jsx": "react",
|
|
9
|
+
"esModuleInterop": true
|
|
10
|
+
},
|
|
11
|
+
"include": ["src"],
|
|
12
|
+
"exclude": ["node_modules", "dist"]
|
|
13
|
+
}
|
package/webpack.config.js
CHANGED
|
@@ -9,10 +9,11 @@ module.exports = {
|
|
|
9
9
|
filename: 'index.js',
|
|
10
10
|
library: 'myLibrary',
|
|
11
11
|
libraryTarget: 'umd',
|
|
12
|
-
umdNamedDefine: true
|
|
12
|
+
umdNamedDefine: true,
|
|
13
|
+
globalObject: 'this'
|
|
13
14
|
},
|
|
14
15
|
resolve: {
|
|
15
|
-
extensions: ['.ts', '.tsx', '.js']
|
|
16
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx']
|
|
16
17
|
},
|
|
17
18
|
module: {
|
|
18
19
|
rules: [
|