@scmlatam/web-ui 0.0.7 → 0.0.9
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/README.md +17 -64
- package/dist/web-ui.d.ts +2 -1
- package/dist/web-ui.js +3488 -3574
- package/dist/web-ui.umd.cjs +62 -62
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,69 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
## Componentes
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Currently, two official plugins are available:
|
|
6
|
-
|
|
7
|
-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
-
|
|
10
|
-
## Expanding the ESLint configuration
|
|
11
|
-
|
|
12
|
-
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
export default tseslint.config([
|
|
16
|
-
globalIgnores(['dist']),
|
|
17
|
-
{
|
|
18
|
-
files: ['**/*.{ts,tsx}'],
|
|
19
|
-
extends: [
|
|
20
|
-
// Other configs...
|
|
21
|
-
|
|
22
|
-
// Remove tseslint.configs.recommended and replace with this
|
|
23
|
-
...tseslint.configs.recommendedTypeChecked,
|
|
24
|
-
// Alternatively, use this for stricter rules
|
|
25
|
-
...tseslint.configs.strictTypeChecked,
|
|
26
|
-
// Optionally, add this for stylistic rules
|
|
27
|
-
...tseslint.configs.stylisticTypeChecked,
|
|
28
|
-
|
|
29
|
-
// Other configs...
|
|
30
|
-
],
|
|
31
|
-
languageOptions: {
|
|
32
|
-
parserOptions: {
|
|
33
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
34
|
-
tsconfigRootDir: import.meta.dirname,
|
|
35
|
-
},
|
|
36
|
-
// other options...
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
])
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
3
|
+
Para implementar el componente Core primero tienes que importar el CoreProvider en tu archivo princial como se muesta a continuación.
|
|
43
4
|
|
|
44
5
|
```js
|
|
45
|
-
|
|
46
|
-
import
|
|
47
|
-
import
|
|
6
|
+
import { StrictMode } from "react";
|
|
7
|
+
import { createRoot } from "react-dom/client";
|
|
8
|
+
import App from "./App.tsx";
|
|
9
|
+
|
|
10
|
+
// Importar los estilos de la librería web-ui.
|
|
11
|
+
import "@scmlatam/web-ui/dist/web-ui.css";
|
|
12
|
+
import { CoreProvider } from "@scmlatam/web-ui";
|
|
13
|
+
|
|
14
|
+
createRoot(document.getElementById("root")!).render(
|
|
15
|
+
<StrictMode>
|
|
16
|
+
<CoreProvider>
|
|
17
|
+
<App />
|
|
18
|
+
</CoreProvider>
|
|
19
|
+
</StrictMode>
|
|
20
|
+
);
|
|
48
21
|
|
|
49
|
-
export default tseslint.config([
|
|
50
|
-
globalIgnores(['dist']),
|
|
51
|
-
{
|
|
52
|
-
files: ['**/*.{ts,tsx}'],
|
|
53
|
-
extends: [
|
|
54
|
-
// Other configs...
|
|
55
|
-
// Enable lint rules for React
|
|
56
|
-
reactX.configs['recommended-typescript'],
|
|
57
|
-
// Enable lint rules for React DOM
|
|
58
|
-
reactDom.configs.recommended,
|
|
59
|
-
],
|
|
60
|
-
languageOptions: {
|
|
61
|
-
parserOptions: {
|
|
62
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
63
|
-
tsconfigRootDir: import.meta.dirname,
|
|
64
|
-
},
|
|
65
|
-
// other options...
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
])
|
|
69
22
|
```
|
package/dist/web-ui.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { GroupItem } from './core/types/types';
|
|
|
3
3
|
import { Item } from './core/types/types';
|
|
4
4
|
import { JSX } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
export declare const Core: ({ login, logout, sidebarItems }: CoreProps) => JSX.Element;
|
|
6
|
+
export declare const Core: ({ login, logout, sidebarItems, router }: CoreProps) => JSX.Element;
|
|
7
7
|
|
|
8
8
|
export declare const CoreContext: Context<ICoreContext>;
|
|
9
9
|
|
|
@@ -11,6 +11,7 @@ declare interface CoreProps {
|
|
|
11
11
|
login: () => void;
|
|
12
12
|
logout: () => void;
|
|
13
13
|
sidebarItems: GroupItem[];
|
|
14
|
+
router: React.ReactNode;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export declare const CoreProvider: ({ children }: CoreProviderProps) => JSX.Element;
|