@bentoo/react-lazy 0.2.0 → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Manuel Bento
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,28 +1,33 @@
1
1
 
2
2
  # @bentoo/react-lazy
3
3
 
4
- Uma biblioteca para facilitar o a implementação de Lazy Loading com React.
4
+ A library designed to make it easier to implement `Lazy Loading` in `React` applications. It allows components to load only when they become visible on the screen, providing a way to monitor the entry of elements into the viewport.
5
5
 
6
- ## Instalação
6
+ With this tool, you can improve the performance of your application by reducing the initial loading time and ensuring that `only the necessary elements are loaded`. This approach contributes to a more agile and responsive user experience.
7
7
 
8
- Você pode instalar o pacote via NPM:
8
+ ## Installation
9
+
10
+ You can install the package via NPM:
9
11
 
10
12
  ```bash
11
13
  npm install @bentoo/react-lazy
12
14
  ```
13
- ou via Yarn:
15
+
16
+ or via Yarn:
14
17
 
15
18
  ```bash
16
19
  yarn add @bentoo/react-lazy
17
20
  ```
18
- ou via pnpm
21
+
22
+ or via pnpm:
23
+
19
24
  ```bash
20
25
  pnpm add @bentoo/react-lazy
21
26
  ```
22
27
 
23
- ## Uso
28
+ ## Usage
24
29
 
25
- Aqui está um exemplo básico de como usar o `@bentoo/react-lazy` em seu projeto:
30
+ Here’s a basic example of how to use `@bentoo/react-lazy` in your project:
26
31
 
27
32
  ```tsx
28
33
  import React from 'react';
@@ -42,25 +47,25 @@ const App = () => {
42
47
  export default App;
43
48
  ```
44
49
 
45
- ### Propriedades
50
+ ### Props
46
51
 
47
- `LazyComponent` aceita as seguintes propriedades:
52
+ `LazyComponent` accepts the following props:
48
53
 
49
- | Propriedade | Tipo | Descrição |
50
- |-------------|-----------|-------------------------------|
51
- | `fallback` | `ReactNode` | O conteúdo a ser exibido enquanto o componente está sendo carregado.|
52
- |children | `ReactNode` | O conteúdo que será exibido após o carregamento.|
54
+ | Prop | Type | Description |
55
+ |-------------|-------------|-------------------------------------------------------------------|
56
+ | `fallback` | `ReactNode` | The content to display while the component is being loaded. |
57
+ | `children` | `ReactNode` | The content that will be displayed after loading. |
53
58
 
54
- ## Contribuição
59
+ ## Contribution
55
60
 
56
- Se você deseja contribuir, fique à vontade para abrir um pull request ou reportar um problema.
61
+ If you would like to contribute, feel free to open a pull request or report an issue.
57
62
 
58
- 1. Faça um fork do projeto.
59
- 2. Crie sua feature branch (`git checkout -b minha-nova-funcionalidade`).
60
- 3. Commit suas mudanças (`git commit -m 'Adicionando nova funcionalidade'`).
61
- 4. Faça um push para a branch (`git push origin minha-nova-funcionalidade`).
62
- 5. Abra um Pull Request.
63
+ 1. Fork the project.
64
+ 2. Create your feature branch (`git checkout -b my-new-feature`).
65
+ 3. Commit your changes (`git commit -m 'Adding new feature'`).
66
+ 4. Push to the branch (`git push origin my-new-feature`).
67
+ 5. Open a Pull Request.
63
68
 
64
- ## Licença
69
+ ## License
65
70
 
66
- Este projeto está licenciado sob a MIT License. Veja o arquivo [LICENSE](LICENSE) para mais detalhes.
71
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
package/dist/index.js CHANGED
@@ -645,7 +645,7 @@ const yr = ({ elementRef: S }) => {
645
645
  };
646
646
  function Rr({ fallback: S, children: E }) {
647
647
  const T = dr(null), { visible: y, isPending: O } = yr({ elementRef: T });
648
- return /* @__PURE__ */ br.jsx("div", { style: { width: "100%", height: "100%" }, ref: T, children: y && !O ? S : E });
648
+ return /* @__PURE__ */ br.jsx("div", { style: { width: "100%", height: "100%" }, ref: T, children: y && !O ? E : S });
649
649
  }
650
650
  export {
651
651
  Rr as LazyComponent
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "manuelbentomb.223@hotmail.com"
6
6
  },
7
7
  "private": false,
8
- "version": "0.2.0",
8
+ "version": "0.2.2",
9
9
  "type": "module",
10
10
  "module": "./dist/index.js",
11
11
  "types": "./dist/index.d.ts",
@@ -45,5 +45,9 @@
45
45
  "typescript": "^5.5.3",
46
46
  "typescript-eslint": "^8.0.1",
47
47
  "vite": "^5.4.1"
48
- }
48
+ },
49
+ "keywords": [
50
+ "react","nextjs",
51
+ "lazy-loading","react-lazy","react-lazy-load"
52
+ ]
49
53
  }