@marsaude/sira-components 1.0.0 → 1.0.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 CHANGED
@@ -1,63 +1,159 @@
1
- # SiraComponents
1
+ ```markdown
2
+ # Sira UI Components (@marsaude/sira-components)
2
3
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.0.0.
4
+ Biblioteca de componentes Angular reutilizáveis para o Design System Sira.
4
5
 
5
- ## Code scaffolding
6
+ ## 🛠️ Build e Desenvolvimento
6
7
 
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
+ Para compilar a biblioteca localmente:
8
9
 
9
10
  ```bash
10
- ng generate component component-name
11
+ # Compilar uma vez
12
+ ng build @marsaude/sira-components
13
+
14
+ # Compilar em modo "watch" (recompila ao salvar arquivos)
15
+ ng build @marsaude/sira-components --watch
16
+
11
17
  ```
12
18
 
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
19
+ Os arquivos compilados serão gerados na pasta `dist/marsaude/sira-components`.
20
+
21
+ ---
22
+
23
+ ## 📦 Instalação
24
+
25
+ ### Via NPM (Recomendado)
26
+
27
+ Para instalar a versão mais recente publicada no registro:
14
28
 
15
29
  ```bash
16
- ng generate --help
30
+ npm install @marsaude/sira-components
31
+
17
32
  ```
18
33
 
19
- ## Building
34
+ *Caso tenha conflitos de versão do Angular, use:*
20
35
 
21
- To build the library, run:
36
+ ```bash
37
+ npm install @marsaude/sira-components --legacy-peer-deps
38
+
39
+ ```
40
+
41
+ ### Via Arquivo Local (Para testes antes de publicar)
42
+
43
+ Se você gerou um arquivo `.tgz` localmente (`npm pack`), instale assim:
22
44
 
23
45
  ```bash
24
- ng build sira-components
46
+ npm install ./caminho/para/dist/marsaude/sira-components/marsaude-sira-components-1.0.X.tgz
47
+
25
48
  ```
26
49
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
50
+ ---
28
51
 
29
- ### Publishing the Library
52
+ ## 🚀 Como Usar
30
53
 
31
- Once the project is built, you can publish your library by following these steps:
54
+ ### 1. Importar no Componente (Standalone)
32
55
 
33
- 1. Navigate to the `dist` directory:
34
- ```bash
35
- cd dist/sira-components
36
- ```
56
+ Importe os componentes diretamente no `imports` do seu componente Angular:
37
57
 
38
- 2. Run the `npm publish` command to publish your library to the npm registry:
39
- ```bash
40
- npm publish
41
- ```
58
+ ```typescript
59
+ import { Component } from '@angular/core';
60
+ import { AlertComponent, NavCardComponent } from '@marsaude/sira-components';
42
61
 
43
- ## Running unit tests
62
+ @Component({
63
+ selector: 'app-home',
64
+ standalone: true,
65
+ imports: [AlertComponent, NavCardComponent],
66
+ template: `
67
+ <div siraAlert theme="info" title="Bem-vindo">
68
+ Componentes carregados com sucesso!
69
+ </div>
70
+ `
71
+ })
72
+ export class HomeComponent {}
44
73
 
45
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
74
+ ```
75
+
76
+ ### 2. Importar os Estilos (SCSS)
77
+
78
+ Para que os componentes tenham a aparência correta, adicione o import global no seu arquivo `styles.scss` da aplicação:
79
+
80
+ ```scss
81
+ /* No arquivo src/styles.scss */
82
+ @import '@marsaude/sira-components/styles';
83
+
84
+ ```
46
85
 
86
+ ---
87
+
88
+ ## ☁️ Publicação no NPM
89
+
90
+ ### Pré-requisitos
91
+
92
+ Certifique-se de que você está logado ou com o token configurado.
93
+
94
+ ### Passo a Passo para Publicar
95
+
96
+ 1. **Atualize a versão:**
47
97
  ```bash
48
- ng test
98
+ # Opções: patch (1.0.0 -> 1.0.1), minor (1.0.0 -> 1.1.0) ou major (1.0.0 -> 2.0.0)
99
+ cd projects/marsaude/sira-components
100
+ npm version patch
101
+ cd ../../..
102
+
49
103
  ```
50
104
 
51
- ## Running end-to-end tests
52
105
 
53
- For end-to-end (e2e) testing, run:
106
+ 2. **Faça o Build:**
107
+ ```bash
108
+ ng build @marsaude/sira-components
109
+
110
+ ```
111
+
112
+
113
+ 3. **Publique:**
114
+ ```bash
115
+ cd dist/marsaude/sira-components
116
+ npm publish --access public
117
+
118
+ ```
119
+
120
+
121
+
122
+ ---
123
+
124
+ ## 🔑 Renovação do Token de Acesso (Granular Token)
125
+
126
+ Utilizamos **Granular Access Tokens** para publicar sem precisar digitar OTP (2FA) a cada comando. Esses tokens expiram e precisam ser renovados periodicamente.
127
+
128
+ ### Quando o token expirar (Erro 401/403 no publish):
129
+
130
+ 1. Acesse [npmjs.com](https://www.npmjs.com/) e faça login.
131
+ 2. Clique na **Foto de Perfil** > **Access Tokens**.
132
+ 3. Clique em **Generate New Token** > **Granular Access Token**.
133
+ 4. Configure assim:
134
+ * **Name:** "Computador [Seu Nome] - Publish"
135
+ * **Expiration:** 90 dias (ou Custom)
136
+ * **Permissions:**
137
+ * Packages and scopes: Selecione `@marsaude` (ou sua organização).
138
+ * Permissions: **Read and write**.
139
+
140
+
141
+ * **✅ Bypass 2FA requirements:** **Marque esta opção** (obrigatório para publish direto sem digitar código OTP).
142
+
143
+
144
+ 5. Clique em **Generate Token** e copie o código (`npm_...`).
145
+
146
+ ### Atualizar no computador local:
147
+
148
+ No terminal, rode o comando abaixo substituindo pelo novo token:
54
149
 
55
150
  ```bash
56
- ng e2e
151
+ npm config set //registry.npmjs.org/:_authToken=npm_seu_novo_token_aqui
152
+
57
153
  ```
58
154
 
59
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
155
+ Pronto! Você pode voltar a publicar normalmente.
60
156
 
61
- ## Additional Resources
157
+ ```
62
158
 
63
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
159
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marsaude/sira-components",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.0",
6
6
  "@angular/core": "^21.1.0"
@@ -4,6 +4,8 @@
4
4
  flex-direction: column;
5
5
  align-items: flex-start;
6
6
  align-self: stretch;
7
+ background: var(--mar-surface-primary) ;
8
+ overflow: hidden;
7
9
 
8
10
  &--body {
9
11
  > .content-wrapper {