structra-ui 0.1.25 → 0.1.27

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
@@ -21,23 +21,26 @@ Se usar **npm 6 ou anterior**, instale explicitamente os mesmos pacotes e versõ
21
21
 
22
22
  ## Estilos globais (obrigatório)
23
23
 
24
- O pacote inclui **`structra-ui.css`** (tema StructraLab: tokens, Material prebuilt, AG Grid, CDK/overlays). Sem este arquivo a UI fica sem estilos.
24
+ O pacote inclui **só um ficheiro de tema:** **`structra-ui.scss`**. É o resultado de compilar o `styles.scss` do monorepo (tokens, Material, AG Grid, CDK, etc.): por dentro é **CSS já resolvido**, mas a extensão é **`.scss`** para alinhar com projetos que só usam SCSS no `angular.json`. Sem este ficheiro na lista `styles`, a UI fica sem estilos.
25
25
 
26
- **Opção A — `angular.json` (recomendado):** em `projects.<app>.architect.build.options.styles`, acrescente **no início** da lista:
26
+ **`angular.json`:** no **início** de `projects.<app>.architect.build.options.styles`:
27
27
 
28
28
  ```json
29
29
  "styles": [
30
- "node_modules/structra-ui/structra-ui.css"
30
+ "node_modules/structra-ui/structra-ui.scss",
31
+ "src/styles.scss"
31
32
  ]
32
33
  ```
33
34
 
34
- **Opção B — `main.ts`:** antes de `bootstrapApplication`:
35
+ **`main.ts` (alternativa):** antes de `bootstrapApplication`:
35
36
 
36
37
  ```ts
37
38
  import 'structra-ui/styles';
38
39
  ```
39
40
 
40
- (equivalente a `import 'structra-ui/structra-ui.css';`. Exige `moduleResolution` compatível com `exports` do npm, por exemplo `bundler` ou `node16`.)
41
+ (Exige `moduleResolution` compatível com `exports` do npm, por exemplo `bundler` ou `node16`.)
42
+
43
+ **Se Material ou AG Grid parecerem «sem tema»** num projeto consumidor: confirme que usa uma versão da lib construída com `npm run lib:build`. O ficheiro `structra-ui.scss` tem de trazer **todo** o CSS (incluindo prebuilt Material e folhas AG Grid) **embutido** — versões antigas do bundle deixavam `@import` para pacotes npm, que **não resolvem** dentro de `node_modules/structra-ui/`.
41
44
 
42
45
  **AG Grid 35+:** registe os módulos Community uma vez na app (ex. `ModuleRegistry.registerModules([AllCommunityModule])` em `main.ts`).
43
46
 
@@ -49,10 +52,9 @@ A entrada publicada é **`src/structra-public-api.ts`** na raiz do monorepo (ver
49
52
 
50
53
  ```bash
51
54
  npm run lib:build
52
- # ou: npx ng build structra-ui
53
55
  ```
54
56
 
55
- gera `dist/structra-ui/` (JavaScript + tipos + **`structra-ui.css`**), pronto para `npm pack` / `npm publish`. O CSS é gerado a partir de `src/styles.scss` do monorepo no passo `npm run lib:styles`.
57
+ Gera `dist/structra-ui/` (JavaScript + tipos + **`structra-ui.scss`**). **Não use `ng build structra-ui`** para publicar: esse comando **não** gera o tema global; o `npm run lib:build` corre o ng-packagr e depois compila `src/styles.scss` para `structra-ui.scss`.
56
58
 
57
59
  ## Uso
58
60
 
package/package.json CHANGED
@@ -1,22 +1,23 @@
1
1
  {
2
2
  "name": "structra-ui",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "description": "Biblioteca de componentes Angular da StructraLab (UI reutilizável).",
5
5
  "homepage": "https://structralab.com/",
6
6
  "license": "MIT",
7
7
  "sideEffects": [
8
- "structra-ui.css"
8
+ "structra-ui.scss"
9
9
  ],
10
10
  "files": [
11
11
  "fesm2022/",
12
12
  "types/",
13
- "structra-ui.css",
13
+ "structra-ui.scss",
14
14
  "README.md",
15
15
  "package.json"
16
16
  ],
17
17
  "exports": {
18
- "./structra-ui.css": "./structra-ui.css",
19
- "./styles": "./structra-ui.css",
18
+ "./structra-ui.scss": "./structra-ui.scss",
19
+ "./styles": "./structra-ui.scss",
20
+ "./global.scss": "./structra-ui.scss",
20
21
  "./package.json": {
21
22
  "default": "./package.json"
22
23
  },