norma-library 0.0.9 → 0.1.1
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 +97 -19
- package/dist/components/Form/CheckBox/index.d.ts +4 -0
- package/dist/components/Form/CheckBox/index.d.ts.map +1 -0
- package/dist/components/Form/CheckBox/types.d.ts +21 -0
- package/dist/components/Form/CheckBox/types.d.ts.map +1 -0
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/norma-library.es.js +4022 -3767
- package/dist/norma-library.umd.js +72 -72
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,27 +1,105 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Como usar um pacote Norma Library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
O npm (Node Package Manager) é um gerenciador de pacotes para o ambiente Node.js, permitindo que você instale e gerencie bibliotecas e pacotes em seus projetos. Neste guia, você aprenderá como usar um pacote Norma Library em seu projeto.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Repository GitHub [Norma LIbrary](https://github.com/OlosLive/norma-libraryp).
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
7
|
+
## Passos Básicos
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
### 1. Instalando o pacote em seu projeto
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
Para instalar o pacote Norma em seu projeto execute o comando em seu terminal:
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
### `npm install norma-library`
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
parserOptions: {
|
|
18
|
-
ecmaVersion: 'latest',
|
|
19
|
-
sourceType: 'module',
|
|
20
|
-
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
21
|
-
tsconfigRootDir: __dirname,
|
|
22
|
-
},
|
|
23
|
-
```
|
|
15
|
+
## Components disponível e como usa-lo
|
|
24
16
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
### Button
|
|
18
|
+
|
|
19
|
+
`import { Button } from "norma-library`;
|
|
20
|
+
|
|
21
|
+
`<Button label="Clique-me" onClick={handleButtonClick} />`;
|
|
22
|
+
|
|
23
|
+
#### Props
|
|
24
|
+
|
|
25
|
+
O componente `Button` aceita as seguintes propriedades:
|
|
26
|
+
|
|
27
|
+
- `label` (string, obrigatório): O texto exibido no botão.
|
|
28
|
+
- `sx` (SxProps<Theme>): Estilos personalizados usando o sistema de estilos do Material-UI.
|
|
29
|
+
- `color` (string): A cor do botão (inherit, primary, secondary, success, error, info, warning).
|
|
30
|
+
- `size` (string): O tamanho do botão (small, medium, large).
|
|
31
|
+
- `variant` (string): A variante do botão (text, outlined, contained).
|
|
32
|
+
- `style` (React.CSSProperties): Estilos CSS adicionais.
|
|
33
|
+
- `children` (ReactNode): Conteúdo adicional a ser exibido dentro do botão.
|
|
34
|
+
- `onClick` (função): Uma função de callback para ser executada quando o botão for clicado.
|
|
35
|
+
|
|
36
|
+
### Card
|
|
37
|
+
|
|
38
|
+
`import { Card } from "norma-library`;
|
|
39
|
+
|
|
40
|
+
`<Card title="Titulo do cartão" />conteúdo do card</card>`;
|
|
41
|
+
|
|
42
|
+
#### Props
|
|
43
|
+
|
|
44
|
+
O componente `Card` aceita as seguintes propriedades:
|
|
45
|
+
|
|
46
|
+
- `title` (string, opcional): O título exibido no cabeçalho do card, se fornecido.
|
|
47
|
+
- `children` (ReactNode, obrigatório): O conteúdo do card, que pode incluir qualquer componente ou conteúdo.
|
|
48
|
+
|
|
49
|
+
### Modal
|
|
50
|
+
|
|
51
|
+
`import { Modal} from "norma-library`;
|
|
52
|
+
|
|
53
|
+
`<Modal open={open} onClose={handleClose} aria-labelledby="modal-modal-title" aria-describedby="modal-modal-description" onConfirm={handleConfirm}
|
|
54
|
+
title="Titulo do modal">conteúdo do modal</modal>`;
|
|
55
|
+
|
|
56
|
+
#### Props
|
|
57
|
+
|
|
58
|
+
O componente `Modal` aceita as seguintes propriedades:
|
|
59
|
+
|
|
60
|
+
- `sx` (SxProps<Theme>): Estilos personalizados usando o sistema de estilos do Material-UI.
|
|
61
|
+
- `children` (React.ReactElement | React.ReactElement[]): Elementos filhos do modal.
|
|
62
|
+
- `open` (boolean): Indica se o modal está aberto.
|
|
63
|
+
- `onClose` (função): Função de callback chamada quando o modal é fechado.
|
|
64
|
+
- `className` (string): Classe CSS adicional para estilização.
|
|
65
|
+
- `title` (string): Título do modal.
|
|
66
|
+
- `full` (boolean): Indica se o modal deve ocupar toda a largura.
|
|
67
|
+
- `onConfirm` (função): Função de callback chamada quando o botão "Confirmar" é clicado.
|
|
68
|
+
|
|
69
|
+
### TextField
|
|
70
|
+
|
|
71
|
+
`import { TextField } from "norma-library`;
|
|
72
|
+
|
|
73
|
+
`<TextField id="outlined-basic" label="Outlined" variant="outlined" />`;
|
|
74
|
+
|
|
75
|
+
#### Props
|
|
76
|
+
|
|
77
|
+
O componente `TextField` aceita as seguintes propriedades:
|
|
78
|
+
|
|
79
|
+
- `label` (ReactNode): Rótulo exibido acima do campo de entrada.
|
|
80
|
+
- `variant` (string): A variante do campo (standard, outlined, filled).
|
|
81
|
+
- `value` (TextFieldValue): O valor do campo de entrada.
|
|
82
|
+
- `onChange` (função): Função de callback chamada quando o valor do campo muda.
|
|
83
|
+
- `disabled` (boolean): Indica se o campo de entrada está desabilitado.
|
|
84
|
+
- `required` (boolean): Indica se o campo de entrada é obrigatório.
|
|
85
|
+
- `hasError` (boolean): Indica se o campo de entrada possui erro.
|
|
86
|
+
- E outras propriedades relacionadas a estilos, tamanho, id, etc.
|
|
87
|
+
|
|
88
|
+
### CheckBox
|
|
89
|
+
|
|
90
|
+
`import { CheckBox } from "norma-library`;
|
|
91
|
+
|
|
92
|
+
`<CheckBox id="checkbox-basic" label="Checkbox" label="Selecionar" checked={checked} onChange={handleCheckboxChange} />`;
|
|
93
|
+
|
|
94
|
+
#### Props
|
|
95
|
+
|
|
96
|
+
O componente `CheckBox` aceita as seguintes propriedades:
|
|
97
|
+
|
|
98
|
+
- `label` (ReactNode): Rótulo exibido acima do campo de entrada.
|
|
99
|
+
- `checked ` (boolean): Indica se a caixa de seleção está marcada.
|
|
100
|
+
- `onChange` (função): Função de callback chamada quando o valor do campo muda.
|
|
101
|
+
- `disabled` (boolean): Indica se o campo de entrada está desabilitado.
|
|
102
|
+
- `color ` (string): A cor da caixa de seleção (primary, secondary, error, info, success, warning, default).
|
|
103
|
+
- `size ` (string): O tamanho da caixa de seleção (small, medium).
|
|
104
|
+
- `value` (TextFieldValue): O valor do campo de entrada.
|
|
105
|
+
- E outras propriedades relacionadas a estilos, required, id, etc.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAK3C,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAMhD,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OverridableStringUnion } from '@mui/types';
|
|
2
|
+
import { CheckboxProps as MuiCheckBoxProps, SxProps, Theme } from '@mui/material';
|
|
3
|
+
import { SwitchBaseProps } from '@mui/material/internal/SwitchBase';
|
|
4
|
+
export interface CheckboxPropsSizeOverrides {
|
|
5
|
+
}
|
|
6
|
+
export interface CheckboxPropsColorOverrides {
|
|
7
|
+
}
|
|
8
|
+
export type CheckBoxBaseProps = Pick<MuiCheckBoxProps, 'sx'> & {
|
|
9
|
+
sx?: SxProps<Theme>;
|
|
10
|
+
name?: string;
|
|
11
|
+
checked?: SwitchBaseProps['checked'];
|
|
12
|
+
color?: OverridableStringUnion<'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'default', CheckboxPropsColorOverrides>;
|
|
13
|
+
disabled?: SwitchBaseProps['disabled'];
|
|
14
|
+
id?: SwitchBaseProps['id'];
|
|
15
|
+
onChange?: SwitchBaseProps['onChange'];
|
|
16
|
+
required?: SwitchBaseProps['required'];
|
|
17
|
+
size?: OverridableStringUnion<'small' | 'medium', CheckboxPropsSizeOverrides>;
|
|
18
|
+
value?: SwitchBaseProps['value'];
|
|
19
|
+
defaultChecked?: boolean;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAmB,aAAa,IAAI,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAGnE,MAAM,WAAW,0BAA0B;CAAG;AAE9C,MAAM,WAAW,2BAA2B;CAAG;AAE/C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GAAG;IAC7D,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;IACpC,KAAK,CAAC,EAAE,sBAAsB,CAC5B,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,EAC9E,2BAA2B,CAC5B,CAAA;IACD,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACtC,EAAE,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAC1B,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACtC,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACtC,IAAI,CAAC,EAAE,sBAAsB,CAAC,OAAO,GAAG,QAAQ,EAAE,0BAA0B,CAAC,CAAA;IAC7E,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAA;IAChC,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
export type { ButtonBaseProps } from './Layout/Button/types';
|
|
2
2
|
export type { CardBaseProps } from './Layout/Card/types';
|
|
3
|
-
export type { IconsProps } from './Data/Icon/types';
|
|
4
3
|
export type { ModalBaseProps } from './Layout/Modal/types';
|
|
4
|
+
export type { IconsProps } from './Data/Icon/types';
|
|
5
|
+
export type { TextFieldBaseProps } from './Form/TextField/types';
|
|
6
|
+
export type { CheckBoxBaseProps } from './Form/CheckBox/types';
|
|
5
7
|
export { Button } from './Layout/Button';
|
|
6
8
|
export { Card } from './Layout/Card';
|
|
7
9
|
export { Modal } from './Layout/Modal';
|
|
8
10
|
export { TextField } from './Form/TextField';
|
|
11
|
+
export { CheckBox } from './Form/CheckBox';
|
|
9
12
|
export { Icons as DefaultIconSVG } from './Data/Icon/DefaultIcon';
|
|
10
13
|
export { Icons as NormaIconSVG } from './Data/Icon/NormaIcon';
|
|
11
14
|
export { palette, lightTheme, darkTheme } from '@helpers/colors';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
|