@makabay/customizedmodal
Advanced tools
Comparing version 0.1.20 to 0.1.21
{ | ||
"name": "@makabay/customizedmodal", | ||
"version": "0.1.20", | ||
"version": "0.1.21", | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"module": "dist/index.js", | ||
"files": [ | ||
"dist", | ||
"README.md" | ||
], | ||
"files": ["dist", "README.md"], | ||
"repository": { | ||
@@ -14,36 +12,25 @@ "type": "git", | ||
}, | ||
"dependencies": { | ||
"@testing-library/jest-dom": "^5.17.0", | ||
"@testing-library/react": "^13.4.0", | ||
"@testing-library/user-event": "^13.5.0" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build ", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject" | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
"dependencies": { | ||
"normalize.css": "^8.0.1" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-scripts": "5.0.1", | ||
"web-vitals": "^2.1.4" | ||
"@types/react": "^18.2.55", | ||
"@types/react-dom": "^18.2.19", | ||
"@typescript-eslint/eslint-plugin": "^6.21.0", | ||
"@typescript-eslint/parser": "^6.21.0", | ||
"@vitejs/plugin-react-swc": "^3.5.0", | ||
"eslint": "^8.56.0", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.4.5", | ||
"sass": "^1.70.0", | ||
"typescript": "^5.2.2", | ||
"vite": "^5.1.0" | ||
}, | ||
@@ -50,0 +37,0 @@ "peerDependencies": { |
@@ -0,1 +1,35 @@ | ||
# React + TypeScript + Vite | ||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
Currently, two official plugins are available: | ||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
## Expanding the ESLint configuration | ||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
- Configure the top-level `parserOptions` property like this: | ||
```js | ||
export default { | ||
// other rules... | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: ['./tsconfig.json', './tsconfig.node.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
} | ||
``` | ||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` | ||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` | ||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list | ||
--- | ||
Hello, this is a simple modal component who can be customized. | ||
@@ -5,10 +39,16 @@ (A style css is already apply on the component but you can customized the text notification and the button text) | ||
Quick start : | ||
1 - You need to install it with the npm command : | ||
1 - If you want to use the library package, you need to install it with the npm command : | ||
npm i @makabay/customizedmodal | ||
Otherwise clone the project on github | ||
2 - Import the component : | ||
```js | ||
// On a Npm library package use case | ||
import { CustomizedModal } from '@makabay/customizedmodal' | ||
// On github clone use case (from ./example/App.tsx) | ||
import CustomizedModal from '../lib/components/CustomizedModal'; | ||
``` | ||
3 - Define a state who will be shared with the component initialize with boolean (false). | ||
@@ -19,11 +59,14 @@ ```js | ||
4 - Define the component : | ||
4 - Define the props component value | ||
```js | ||
<CustomizedModal /> | ||
const closeButtonTextData = { | ||
closeButtonTextValue: 'Close', | ||
textNotificationValue: 'Notification message', | ||
confirmationTextValue: 'Understood' | ||
}; | ||
``` | ||
5 - When you define the component CustomizedModal don't forget to pass the childrens closeButtonText, textNotification, confirmationText, modalState, changeModalState | ||
5 - Define the component with his props : | ||
```js | ||
Example : | ||
```js | ||
<CustomizedModal | ||
@@ -47,5 +90,8 @@ closeButtonText={closeButtonTextData.closeButtonTextValue} | ||
// Components | ||
// Don't forget to import the CustomizedModal like this : | ||
// On a Npm library package use case | ||
import { CustomizedModal } from '@makabay/customizedmodal' | ||
// On github clone use case (from ./example/App.tsx) | ||
// import CustomizedModal from '../lib/components/CustomizedModal'; | ||
// You can replace this App component by the component where you want placed the modal | ||
@@ -97,3 +143,2 @@ export default function App () { | ||
); | ||
} | ||
``` | ||
} |
9138
3
140
Yes
13
+ Addednormalize.css@^8.0.1
+ Addednormalize.css@8.0.1(transitive)
- Removed@testing-library/jest-dom@^5.17.0
- Removed@testing-library/react@^13.4.0
- Removed@testing-library/user-event@^13.5.0
- Removed@adobe/css-tools@4.3.3(transitive)
- Removed@babel/code-frame@7.24.6(transitive)
- Removed@babel/helper-validator-identifier@7.24.6(transitive)
- Removed@babel/highlight@7.24.6(transitive)
- Removed@babel/runtime@7.24.6(transitive)
- Removed@jest/expect-utils@29.7.0(transitive)
- Removed@jest/schemas@29.6.3(transitive)
- Removed@jest/types@29.6.3(transitive)
- Removed@sinclair/typebox@0.27.8(transitive)
- Removed@testing-library/dom@8.20.1(transitive)
- Removed@testing-library/jest-dom@5.17.0(transitive)
- Removed@testing-library/react@13.4.0(transitive)
- Removed@testing-library/user-event@13.5.0(transitive)
- Removed@types/aria-query@5.0.4(transitive)
- Removed@types/istanbul-lib-coverage@2.0.6(transitive)
- Removed@types/istanbul-lib-report@3.0.3(transitive)
- Removed@types/istanbul-reports@3.0.4(transitive)
- Removed@types/jest@29.5.12(transitive)
- Removed@types/node@20.12.13(transitive)
- Removed@types/prop-types@15.7.12(transitive)
- Removed@types/react@18.3.3(transitive)
- Removed@types/react-dom@18.3.0(transitive)
- Removed@types/stack-utils@2.0.3(transitive)
- Removed@types/testing-library__jest-dom@5.14.9(transitive)
- Removed@types/yargs@17.0.32(transitive)
- Removed@types/yargs-parser@21.0.3(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@3.2.14.3.05.2.0(transitive)
- Removedaria-query@5.1.35.3.0(transitive)
- Removedarray-buffer-byte-length@1.0.1(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedbraces@3.0.3(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedchalk@2.4.23.0.04.1.2(transitive)
- Removedci-info@3.9.0(transitive)
- Removedcolor-convert@1.9.32.0.1(transitive)
- Removedcolor-name@1.1.31.1.4(transitive)
- Removedcss.escape@1.5.1(transitive)
- Removedcsstype@3.1.3(transitive)
- Removeddeep-equal@2.2.3(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddequal@2.0.3(transitive)
- Removeddiff-sequences@29.6.3(transitive)
- Removeddom-accessibility-api@0.5.16(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-get-iterator@1.1.3(transitive)
- Removedescape-string-regexp@1.0.52.0.0(transitive)
- Removedexpect@29.7.0(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-bigints@1.0.2(transitive)
- Removedhas-flag@3.0.04.0.0(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedinternal-slot@1.0.7(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-array-buffer@3.0.4(transitive)
- Removedis-bigint@1.0.4(transitive)
- Removedis-boolean-object@1.1.2(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-date-object@1.0.5(transitive)
- Removedis-map@2.0.3(transitive)
- Removedis-number@7.0.0(transitive)
- Removedis-number-object@1.0.7(transitive)
- Removedis-regex@1.1.4(transitive)
- Removedis-set@2.0.3(transitive)
- Removedis-shared-array-buffer@1.0.3(transitive)
- Removedis-string@1.0.7(transitive)
- Removedis-symbol@1.0.4(transitive)
- Removedis-weakmap@2.0.2(transitive)
- Removedis-weakset@2.0.3(transitive)
- Removedisarray@2.0.5(transitive)
- Removedjest-diff@29.7.0(transitive)
- Removedjest-get-type@29.6.3(transitive)
- Removedjest-matcher-utils@29.7.0(transitive)
- Removedjest-message-util@29.7.0(transitive)
- Removedjest-util@29.7.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlz-string@1.5.0(transitive)
- Removedmicromatch@4.0.7(transitive)
- Removedmin-indent@1.0.1(transitive)
- Removedobject-inspect@1.13.1(transitive)
- Removedobject-is@1.1.6(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedpicocolors@1.0.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedpretty-format@27.5.129.7.0(transitive)
- Removedreact-is@17.0.218.3.1(transitive)
- Removedredent@3.0.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedregexp.prototype.flags@1.5.2(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedslash@3.0.0(transitive)
- Removedstack-utils@2.0.6(transitive)
- Removedstop-iteration-iterator@1.0.0(transitive)
- Removedstrip-indent@3.0.0(transitive)
- Removedsupports-color@5.5.07.2.0(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removedundici-types@5.26.5(transitive)
- Removedwhich-boxed-primitive@1.0.2(transitive)
- Removedwhich-collection@1.0.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)