catarina 20.3.3 → 20.3.5
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 +45 -52
- package/fesm2022/catarina.mjs +204 -120
- package/fesm2022/catarina.mjs.map +1 -1
- package/index.d.ts +23 -13
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,69 +1,72 @@
|
|
|
1
|
-
## Catarina – Design System
|
|
1
|
+
## Catarina – Design System for Angular
|
|
2
2
|
|
|
3
|
-
**Catarina**
|
|
4
|
-
|
|
3
|
+
**Catarina** is a UI component library for Angular 20.3.x.
|
|
4
|
+
It includes buttons, icons, form controls, panels, and utilities related to _theming_ and icons.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
The library is published under the name:
|
|
7
7
|
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
8
|
+
- **npm package**: `catarina`
|
|
9
|
+
- **Version**: `1.0.1`
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Requirements
|
|
14
14
|
|
|
15
|
-
`catarina`
|
|
15
|
+
`catarina` declares the following _peerDependencies_:
|
|
16
16
|
|
|
17
17
|
- `@angular/core`: `^20.3.0`
|
|
18
18
|
- `@angular/common`: `^20.3.0`
|
|
19
|
+
- `@angular/cdk`: `^20.2.0` (required for Dialog and Drawer components)
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
And depends on:
|
|
21
22
|
|
|
22
23
|
- `tslib`: `^2.3.0`
|
|
23
24
|
|
|
24
25
|
---
|
|
25
26
|
|
|
26
|
-
##
|
|
27
|
+
## Installation
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
In an Angular 20 project:
|
|
29
30
|
|
|
30
31
|
```bash
|
|
31
|
-
npm install catarina
|
|
32
|
+
npm install catarina @angular/cdk
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
It can also be installed with `pnpm` or `yarn` using the same package name.
|
|
36
|
+
|
|
37
|
+
**Note**: `@angular/cdk` is required if you plan to use the `Dialog` or `Drawer` components. These components use CDK Overlay internally to automatically manage overlays, z-index, and scroll.
|
|
35
38
|
|
|
36
39
|
---
|
|
37
40
|
|
|
38
|
-
## API
|
|
41
|
+
## Public API
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
The `public-api.ts` file exposes the main elements of the design system:
|
|
41
44
|
|
|
42
|
-
- **
|
|
45
|
+
- **Design components**:
|
|
43
46
|
- `Icon` (`cat-icon`)
|
|
44
47
|
- `Button` (`cat-button`)
|
|
45
|
-
-
|
|
46
|
-
- **
|
|
48
|
+
- Panels (`card`, `accordion`, `accordion-group`)
|
|
49
|
+
- **Form components**:
|
|
47
50
|
- `cat-input`, `color-input`, `select-input`, `date-input`, `file-input`,
|
|
48
51
|
`password-input`, `range-input`, `text-area-input`, `time-input`
|
|
49
52
|
- **Overlays**:
|
|
50
53
|
- `dialog`
|
|
51
|
-
- **
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
+
- **Services and directives**:
|
|
55
|
+
- Drag directive (`drag`)
|
|
56
|
+
- Theming utilities
|
|
54
57
|
- **Tokens**:
|
|
55
58
|
- `ICON_PROVIDER`
|
|
56
|
-
- **
|
|
59
|
+
- **Icon utilities**:
|
|
57
60
|
- `getIconPath`, `iconList`, `IconName`, `ICON_BASE_PATH`
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
All these symbols are imported directly from the `catarina` package.
|
|
60
63
|
|
|
61
64
|
---
|
|
62
65
|
|
|
63
|
-
##
|
|
66
|
+
## Icon configuration
|
|
64
67
|
|
|
65
|
-
`catarina`
|
|
66
|
-
|
|
68
|
+
`catarina` uses the `ICON_PROVIDER` token to resolve icon paths.
|
|
69
|
+
This token can be configured using the integrated utilities in `catarina`:
|
|
67
70
|
|
|
68
71
|
```ts
|
|
69
72
|
// app.config.ts
|
|
@@ -83,16 +86,16 @@ export const appConfig: ApplicationConfig = {
|
|
|
83
86
|
};
|
|
84
87
|
```
|
|
85
88
|
|
|
86
|
-
|
|
89
|
+
With this configuration, `catarina` components that use icons resolve paths using the integrated utilities.
|
|
87
90
|
|
|
88
|
-
###
|
|
91
|
+
### Assets configuration in `angular.json`
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
To use external SVG icons, you need to add the following entry in the `assets` section of `angular.json` so that SVG files are copied to the output directory:
|
|
91
94
|
|
|
92
95
|
```json
|
|
93
96
|
{
|
|
94
97
|
"projects": {
|
|
95
|
-
"
|
|
98
|
+
"your-project": {
|
|
96
99
|
"architect": {
|
|
97
100
|
"build": {
|
|
98
101
|
"options": {
|
|
@@ -113,13 +116,13 @@ Para usar iconos SVG externos, es necesario añadir la siguiente entrada en la s
|
|
|
113
116
|
}
|
|
114
117
|
```
|
|
115
118
|
|
|
116
|
-
**
|
|
119
|
+
**Note**: If you use the `safirial-icons` package from npm, this configuration copies SVG files from `node_modules/safirial-icons/assets` to the `safirial-icons` folder in the output directory. The utilities `getIconPath` and `iconList` are available directly from `catarina` without needing to install `safirial-icons`.
|
|
117
120
|
|
|
118
121
|
---
|
|
119
122
|
|
|
120
|
-
##
|
|
123
|
+
## Basic component usage
|
|
121
124
|
|
|
122
|
-
|
|
125
|
+
Example usage of `cat-button` and `Icon` within an application component:
|
|
123
126
|
|
|
124
127
|
```ts
|
|
125
128
|
// app.component.ts
|
|
@@ -131,7 +134,7 @@ import { Button as CatarinaButton, Icon as CatarinaIcon } from 'catarina';
|
|
|
131
134
|
imports: [CatarinaButton, CatarinaIcon],
|
|
132
135
|
template: `
|
|
133
136
|
<cat-button variant="primary" size="md" iconLeft="home">
|
|
134
|
-
|
|
137
|
+
Catarina Button
|
|
135
138
|
</cat-button>
|
|
136
139
|
|
|
137
140
|
<cat-icon name="sun" [size]="'32px'"></cat-icon>
|
|
@@ -140,7 +143,7 @@ import { Button as CatarinaButton, Icon as CatarinaIcon } from 'catarina';
|
|
|
140
143
|
export class AppComponent {}
|
|
141
144
|
```
|
|
142
145
|
|
|
143
|
-
|
|
146
|
+
Icon `name` values must match the names defined in the `iconList` exported from `catarina`. You can import `iconList` for autocomplete and validation:
|
|
144
147
|
|
|
145
148
|
```ts
|
|
146
149
|
import { iconList, IconName } from 'catarina';
|
|
@@ -148,21 +151,21 @@ import { iconList, IconName } from 'catarina';
|
|
|
148
151
|
|
|
149
152
|
---
|
|
150
153
|
|
|
151
|
-
##
|
|
154
|
+
## Building and publishing
|
|
152
155
|
|
|
153
|
-
|
|
156
|
+
To compile the library from the workspace:
|
|
154
157
|
|
|
155
158
|
```bash
|
|
156
159
|
ng build catarina
|
|
157
160
|
```
|
|
158
161
|
|
|
159
|
-
|
|
162
|
+
The output is generated in:
|
|
160
163
|
|
|
161
164
|
```bash
|
|
162
165
|
dist/catarina
|
|
163
166
|
```
|
|
164
167
|
|
|
165
|
-
|
|
168
|
+
To publish to npm (from the workspace):
|
|
166
169
|
|
|
167
170
|
```bash
|
|
168
171
|
ng build catarina
|
|
@@ -172,19 +175,9 @@ npm publish
|
|
|
172
175
|
|
|
173
176
|
---
|
|
174
177
|
|
|
175
|
-
##
|
|
176
|
-
|
|
177
|
-
Esta documentación está disponible en español. Para la versión en inglés, consulta [README.en.md](./README.en.md).
|
|
178
|
-
|
|
179
|
-
This documentation is available in Spanish. For the English version, see [README.en.md](./README.en.md).
|
|
180
|
-
|
|
181
|
-
---
|
|
178
|
+
## Language / Idioma
|
|
182
179
|
|
|
183
|
-
|
|
180
|
+
This documentation is available in English. For the Spanish version, see [README.en.md](./README.en.md).
|
|
184
181
|
|
|
185
|
-
Esta documentación
|
|
182
|
+
Esta documentación está disponible en inglés. Para la versión en español, consulta [README.en.md](./README.en.md).
|
|
186
183
|
|
|
187
|
-
- **Herramienta**: Cursor IDE
|
|
188
|
-
- **Modelo**: Auto (agente router de Cursor)
|
|
189
|
-
- **Idioma**: Español
|
|
190
|
-
- **Instrucciones**: Analizar todos los proyectos del workspace y actualizar la documentación para consumo, sin incluir errores, mejoras ni sugerencias, solo información factual sobre instalación, configuración y uso de las librerías.
|