@solercia/ui 0.8.1 → 0.8.3

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/llms-full.txt ADDED
@@ -0,0 +1,2632 @@
1
+ # Solercia Design System: complete manual
2
+
3
+ > Every chapter of the Solercia design-system manual (packages @solercia/ui, @solercia/eslint-config and
4
+ > @solercia/chat) followed by the complete @solercia/ui component reference. Generated from
5
+ > docs/manual/*.md and README.md by `npm run docs:llms`; do not edit by hand. Short index: llms.txt.
6
+
7
+ ## Chapters
8
+
9
+ - 00 Introduction: What the Solercia design system is, who it is for and how to read this manual.
10
+ - 01 Principles: The seven decisions behind the Solercia design system and what each one means in code.
11
+ - 02 Architecture: How @solercia/ui, @solercia/eslint-config and @solercia/chat fit together, the host ports and the FSD layers.
12
+ - 03 Getting started: Create an Angular 22 project with @solercia/ui step by step, or adopt the library in an existing project.
13
+ - 04 Theming: Brand an application with a ThemeFile, serve one theme per tenant and use the --sol-* tokens.
14
+ - 05 Internationalization: The SOL_I18N contract, the bundled English and Colombian Spanish catalogs and engine adapters.
15
+ - 06 Components: The 57 public components and directives of @solercia/ui by category, with links to the reference and the live demos.
16
+ - 07 Patterns: How to build screens with @solercia/ui - the five screen states, forms, tables, dialogs on mobile, charts and kanban.
17
+ - 08 Linting and architecture rules: What @solercia/eslint-config enforces - FSD boundaries, file placement, naming, wrapped engines and token-only styles - and how to declare exceptions.
18
+ - 09 Chat: Embed the Solercia AI assistant with @solercia/chat - configuration, components, API contract and theming.
19
+ - 10 For AI agents: Rules, prompts and review checklists for AI coding agents that build Angular screens with the Solercia design system.
20
+ - 11 Releases and contributing: How the Solercia packages are versioned and published, and how to contribute a change.
21
+ - 12 FAQ: Quick answers about adopting, theming, translating and extending the Solercia design system.
22
+ - Appendix: component reference (inputs, outputs, slots and examples of every component)
23
+
24
+ ---
25
+
26
+ <!-- chapter 00: docs/manual/00-index.md -->
27
+
28
+ # Solercia Design System
29
+
30
+ <p align="center"><img src="https://raw.githubusercontent.com/solercia-solutions/solercia-ui/main/.github/assets/solercia-mark.svg" alt="Solercia" width="48" height="92"></p>
31
+
32
+ The Solercia design system is the set of packages, contracts and rules that Solercia Solutions uses to
33
+ build Angular applications for several organizations from one code base. It answers three questions
34
+ for every screen: which component to use, how it looks for the active organization, and where the
35
+ code that uses it belongs.
36
+
37
+ ```bash
38
+ ng add @solercia/ui
39
+ ```
40
+
41
+ That single command installs the component library, applies the default theme, scaffolds a
42
+ Feature-Sliced Design (FSD) project structure and turns the architecture rules into lint rules.
43
+
44
+ ## What it is made of
45
+
46
+ | Package | Role | Source |
47
+ | --- | --- | --- |
48
+ | `@solercia/ui` | Angular 22 component library: 57 standalone components and directives, theme runtime, i18n contract, `ng add` and generators. | [solercia-ui](https://github.com/solercia-solutions/solercia-ui) |
49
+ | `@solercia/eslint-config` | ESLint flat config that enforces FSD boundaries, file placement and token-only styling. | [eslint-config](https://github.com/solercia-solutions/eslint-config) |
50
+ | `@solercia/chat` | Embeddable AI assistant chat (streamed answers, sources, history) that reads the same tokens. | [solercia-chat](https://github.com/solercia-solutions/solercia-chat) |
51
+
52
+ ## Who it is for
53
+
54
+ - **Application developers** building screens: start with [Getting started](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/03-getting-started.md),
55
+ then [Patterns](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/07-patterns.md).
56
+ - **Architects and reviewers** deciding how a project is organized: read [Principles](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/01-principles.md),
57
+ [Architecture](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/02-architecture.md) and [Linting and architecture rules](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/08-linting-and-architecture-rules.md).
58
+ - **Designers and brand owners** defining how an organization looks: read [Theming](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/04-theming.md).
59
+ - **AI coding agents** generating code with the library: read [For AI agents](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/10-for-ai-agents.md), or
60
+ load the whole manual at once from [`llms-full.txt`](https://github.com/solercia-solutions/solercia-ui/blob/main/llms-full.txt).
61
+
62
+ ## How to read this manual
63
+
64
+ Each chapter stands on its own and opens with an example. Chapters explain the reasoning and the
65
+ contracts; the exhaustive list of inputs and outputs of every component lives in one place, the
66
+ [component reference](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#component-reference), and every component has a live demo in the
67
+ showcase application.
68
+
69
+ | Chapter | Read it when you need to |
70
+ | --- | --- |
71
+ | [01 Principles](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/01-principles.md) | Understand the decisions behind the system. |
72
+ | [02 Architecture](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/02-architecture.md) | See how the packages, ports and layers fit together. |
73
+ | [03 Getting started](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/03-getting-started.md) | Create a new project or adopt the library in an existing one. |
74
+ | [04 Theming](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/04-theming.md) | Brand an application or support several organizations. |
75
+ | [05 Internationalization](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/05-i18n.md) | Translate the components or plug in your i18n engine. |
76
+ | [06 Components](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/06-components.md) | Find the right component for a job. |
77
+ | [07 Patterns](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/07-patterns.md) | Build screens: states, forms, tables, dialogs, charts, kanban. |
78
+ | [08 Linting and architecture rules](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/08-linting-and-architecture-rules.md) | Know what the linter enforces and how to declare an exception. |
79
+ | [09 Chat](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/09-chat.md) | Embed the AI assistant chat. |
80
+ | [10 For AI agents](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/10-for-ai-agents.md) | Prompt an agent or review its output. |
81
+ | [11 Releases and contributing](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/11-releases-and-contributing.md) | Change the library and publish a version. |
82
+ | [12 FAQ](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/12-faq.md) | Find quick answers. |
83
+
84
+ ## Where the documentation lives
85
+
86
+ The Markdown files in `docs/manual/` are the single source. They are published three ways:
87
+
88
+ - **Website**: the *Guides* section of the showcase, next to the live demos.
89
+ - **AI file**: [`llms-full.txt`](https://github.com/solercia-solutions/solercia-ui/blob/main/llms-full.txt) at the repository root, with every chapter and the
90
+ component reference in one plain-text file; [`llms.txt`](https://github.com/solercia-solutions/solercia-ui/blob/main/llms.txt) is the short index.
91
+ - **Manual**: a PDF and a Word document generated with `npm run docs:manual`.
92
+
93
+ Change the Markdown and the three outputs follow.
94
+
95
+ ---
96
+
97
+ <!-- chapter 01: docs/manual/01-principles.md -->
98
+
99
+ # Principles
100
+
101
+ ```ts
102
+ // The whole contract between an application and the design system fits in four providers.
103
+ providers: [
104
+ provideTheme(), // tokens on :root
105
+ { provide: THEME_SOURCE, useExisting: AppThemeSource }, // how to load a theme
106
+ { provide: SOL_TENANT_RESOLVER, useExisting: AppTenantResolver }, // who the tenant is
107
+ { provide: SOL_I18N, useExisting: I18nService }, // how to translate
108
+ ]
109
+ ```
110
+
111
+ Every rule in this manual follows from seven principles. When a situation is not covered, decide by
112
+ them.
113
+
114
+ ## 1. Host-agnostic
115
+
116
+ The library never calls your API, never reads your session and never assumes an i18n engine. It
117
+ declares small ports (injection tokens) and the host application implements them. The same build of
118
+ `@solercia/ui` runs in a public-sector portal, a SaaS back office or a mobile web app.
119
+
120
+ In code: no component imports `HttpClient`, a router service or a translation library. Data comes in
121
+ through inputs; events go out through outputs.
122
+
123
+ ## 2. Theme by data, not by code
124
+
125
+ An organization's look is a JSON document, a `ThemeFile`, not a stylesheet or a fork. The library
126
+ resolves it into about 95 `--sol-*` CSS custom properties with light and dark modes, logo, favicon and
127
+ fonts. Adding a tenant means storing one more document; no build, no deploy.
128
+
129
+ ## 3. Tokens only
130
+
131
+ Components and application styles use `var(--sol-*)` for color, typography, spacing, radius, shadow
132
+ and motion. No hexadecimal colors, no literal font families, no `!important`, no `::ng-deep`. The lint
133
+ preset enforces it, so a hardcoded color fails CI instead of slipping through review.
134
+
135
+ ## 4. Accessible by default
136
+
137
+ Every interactive component is reachable and operable with the keyboard and announced correctly by
138
+ screen readers. Dialogs trap and restore focus and close on Escape; icon-only controls require an
139
+ `ariaLabel`; touch targets reach 44 px on touch screens; animations respect `prefers-reduced-motion`.
140
+ Accessibility is part of a component's contract, not an option.
141
+
142
+ ## 5. English by default, any language by contract
143
+
144
+ Without configuration every visible text is English, from a bundled catalog. A host plugs its own
145
+ engine (Transloco, ngx-translate or the bundled one) through the `SOL_I18N` contract, and a Colombian
146
+ Spanish catalog ships with the package. An explicit input always wins over a default text.
147
+
148
+ ## 6. Modern Angular only
149
+
150
+ Standalone components, `ChangeDetectionStrategy.OnPush`, signal inputs and outputs, and no zone.js:
151
+ the library and its showcase run with `provideZonelessChangeDetection()`. There are no NgModules to
152
+ import and no legacy compatibility layers.
153
+
154
+ ## 7. Architecture as code
155
+
156
+ Applications are organized with Feature-Sliced Design: `app`, `pages`, `widgets`, `features`,
157
+ `entities`, `shared`. A layer imports only from layers below it, and each slice exposes a public
158
+ `index.ts`. These rules are not a wiki page: `ng add` scaffolds the structure and
159
+ `@solercia/eslint-config` checks it on every commit.
160
+
161
+ ## What the principles rule out
162
+
163
+ | Temptation | Why it is ruled out | Do this instead |
164
+ | --- | --- | --- |
165
+ | Copy a component and tweak its CSS | Breaks theming and duplicates fixes. | Use inputs, or ask for a new variant. |
166
+ | Import Chart.js directly | Charts would ignore the theme and dark mode. | Use `<sol-chart>`. |
167
+ | Write `color: #1e293b` | One tenant's color becomes everyone's. | Use `var(--sol-color-text-primary)`. |
168
+ | Hardcode Spanish labels | Other organizations cannot translate them. | Use an i18n key or an input. |
169
+ | Fetch data inside a shared component | Couples the design system to one API. | Fetch in a feature; pass data down. |
170
+
171
+ ---
172
+
173
+ <!-- chapter 02: docs/manual/02-architecture.md -->
174
+
175
+ # Architecture
176
+
177
+ ```mermaid
178
+ flowchart LR
179
+ subgraph Host["Host Angular application"]
180
+ direction TB
181
+ Resolver["AppTenantResolver<br/>who is the tenant"]
182
+ Source["AppThemeSource<br/>how to load its theme"]
183
+ I18n["I18nService<br/>how to translate"]
184
+ Screens["pages / widgets / features"]
185
+ end
186
+ subgraph UI["@solercia/ui"]
187
+ direction TB
188
+ Theme["ThemeService<br/>--sol-* tokens on :root"]
189
+ Comp["sol-* components"]
190
+ Ports["THEME_SOURCE · SOL_TENANT_RESOLVER · SOL_I18N"]
191
+ end
192
+ Lint["@solercia/eslint-config<br/>checks layers and styles"]
193
+ Chat["@solercia/chat<br/>reads the same tokens"]
194
+ Resolver --> Ports
195
+ Source --> Ports
196
+ I18n --> Ports
197
+ Ports --> Theme
198
+ Theme --> Comp
199
+ Screens --> Comp
200
+ Screens --> Chat
201
+ Lint -. lints .-> Screens
202
+ ```
203
+
204
+ The design system has three packages. The host application implements a few ports; the library does
205
+ everything else.
206
+
207
+ ## The three packages
208
+
209
+ | Package | Version line | Depends on | Ships |
210
+ | --- | --- | --- | --- |
211
+ | `@solercia/ui` | 0.8 | `@angular/core`, `@angular/common`, `@angular/forms` 22; optional `@angular/cdk`, `chart.js`, `@dagrejs/dagre` | Components, theme runtime, i18n contract and catalogs, `ng add`, generators, secondary entry points `@solercia/ui/theme-studio` and `@solercia/ui/login-appearance` |
212
+ | `@solercia/eslint-config` | 0.2 | `eslint` 10, `typescript-eslint` 8, optional `@eslint/css` | FSD boundary, file placement, naming and token-styling rules |
213
+ | `@solercia/chat` | 0.4 | `@angular/core`, `@angular/common` 22.1 | `<sol-chat>`, `<sol-chat-flotante>`, `provideSolerciaChat()` |
214
+
215
+ `@solercia/ui` is the only required package. `ng add @solercia/ui` installs the lint preset for you;
216
+ the chat is added only by applications that embed an assistant.
217
+
218
+ ## Ports: what the host provides
219
+
220
+ The library owns the mechanism; the host owns the policy. Each port is an Angular `InjectionToken`
221
+ exported from `@solercia/ui`.
222
+
223
+ | Port | Question it answers | Contract | Without it |
224
+ | --- | --- | --- | --- |
225
+ | `THEME_SOURCE` | How do I load a tenant's theme? | `loadTheme(tenantId): Promise<ThemeFile \| null>` | No tenant theme loads; the default applies. |
226
+ | `SOL_TENANT_RESOLVER` | Who is the active tenant? | `activeTenantId(): number \| null` | Single-theme mode. |
227
+ | `SOL_DEFAULT_THEME` | What applies when there is no tenant theme? | `ThemeFile` | The bundled «Vértice» theme. |
228
+ | `SOL_I18N` | How do I translate a key? | `activeLang`, `translate`, `t`, `tMany` | English from the bundled catalog. |
229
+ | `SOL_CHART_ENGINE` | Which chart engine renders `sol-chart`? | `SolChartEngineFactory` | Chart.js, loaded on the first chart. |
230
+ | `SOL_CALENDAR_COLOR` | How are calendar events colored? | `resolve(event, isDark)` | Derived from `event.color` and tokens. |
231
+
232
+ Only `provideTheme()` is required. Everything else is optional and has a working default.
233
+
234
+ ## Degradation levels
235
+
236
+ The theme runtime never leaves the application unstyled. It falls back one level at a time:
237
+
238
+ ```mermaid
239
+ flowchart TD
240
+ A["Tenant active?"] -->|yes| B["THEME_SOURCE.loadTheme(id)"]
241
+ A -->|no| D
242
+ B -->|valid ThemeFile| C["Level 1: tenant theme"]
243
+ B -->|null, error or invalid| D["Level 2: SOL_DEFAULT_THEME (Vértice)"]
244
+ D -->|default set to null| E["Level 3: static :root block in styles.css"]
245
+ ```
246
+
247
+ | Level | Source | Requires the host? |
248
+ | --- | --- | --- |
249
+ | 1. Tenant theme | `THEME_SOURCE.loadTheme(tenantId)` | Yes: resolver and source. |
250
+ | 2. Default theme | `SOL_DEFAULT_THEME`, bundled «Vértice» | No. |
251
+ | 3. Inline CSS | A `:root { --sol-*: … }` block in the host's `styles.css` | Host-owned safety net. |
252
+
253
+ A failed request, a 404 or an invalid document degrades silently from level 1 to level 2 with a
254
+ console warning. See [Theming](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/04-theming.md) for the details.
255
+
256
+ ## Application layers (Feature-Sliced Design)
257
+
258
+ ```mermaid
259
+ flowchart TB
260
+ app["app<br/>bootstrap, routes, providers"] --> pages["pages<br/>one route each"]
261
+ pages --> widgets["widgets<br/>composite blocks"]
262
+ widgets --> features["features<br/>user actions"]
263
+ features --> entities["entities<br/>business models and APIs"]
264
+ entities --> shared["shared<br/>ui, api, i18n, tokens, lib"]
265
+ ```
266
+
267
+ A layer imports only from the layers below it. Inside a layer, code is grouped in slices
268
+ (`features/login`, `entities/project`) and segments (`ui`, `model`, `api`, `lib`, `config`). Other
269
+ slices import a slice only through its `index.ts`.
270
+
271
+ | Layer | Holds | Example |
272
+ | --- | --- | --- |
273
+ | `app` | Bootstrap, root routes, providers | `app.config.ts` with `provideTheme()` |
274
+ | `pages` | One routed screen, composition only | `pages/projects/ui/projects-page.component.ts` |
275
+ | `widgets` | Self-contained blocks reused across pages | A dashboard summary panel |
276
+ | `features` | One user action with its state | `features/invite-member` |
277
+ | `entities` | Business models and their API clients | `entities/project/model`, `entities/project/api` |
278
+ | `shared` | Code with no business knowledge | Theme and i18n adapters in `shared/tokens`, `shared/i18n` |
279
+
280
+ `@solercia/ui` components play the role of `shared/ui` for every application: presentational, driven by
281
+ inputs, unaware of stores and APIs. Applications add their own `shared/ui` components only when the
282
+ library has no equivalent, and those follow the same rules.
283
+
284
+ ## Inside `@solercia/ui`
285
+
286
+ | Path | Content |
287
+ | --- | --- |
288
+ | `src/lib/ui/` | One folder per component family (`sol-*`) |
289
+ | `src/lib/tokens/` | `ThemeService`, theme ports, the bundled default theme |
290
+ | `src/lib/i18n/` | The `SolI18n` contract, `createSolI18n()`, bundled catalogs |
291
+ | `src/public-api.ts` | Everything consumers can import |
292
+ | `schematics/` | `ng add` and the `page`, `feature`, `entity` and `widget` generators |
293
+ | `theme-studio/`, `login-appearance/` | Secondary entry points |
294
+
295
+ Import every symbol from `@solercia/ui` (or a secondary entry point); deep imports into `lib/` are not
296
+ part of the public API.
297
+
298
+ ---
299
+
300
+ <!-- chapter 03: docs/manual/03-getting-started.md -->
301
+
302
+ # Getting started
303
+
304
+ ```bash
305
+ npx -y @angular/cli@22 new acme-portal --style=css --ssr=false
306
+ cd acme-portal
307
+ npx ng add @solercia/ui
308
+ npx ng serve
309
+ ```
310
+
311
+ Four commands give you a zoneless Angular 22 application with the default theme applied, an FSD
312
+ project structure, path aliases, theme and i18n adapters, the lint preset and commit hooks.
313
+
314
+ ## Requirements
315
+
316
+ | Tool | Version |
317
+ | --- | --- |
318
+ | Node.js | 22.14 or later (24 recommended) |
319
+ | Angular | 22 |
320
+ | npm | 11 recommended |
321
+
322
+ ## A. New project
323
+
324
+ ### Step 1. Create the application
325
+
326
+ ```bash
327
+ npx -y @angular/cli@22 new acme-portal --style=css --ssr=false
328
+ ```
329
+
330
+ Angular 22 creates a zoneless application (`provideZonelessChangeDetection()`); `@solercia/ui` needs no
331
+ zone.js.
332
+
333
+ ### Step 2. Add the design system
334
+
335
+ ```bash
336
+ cd acme-portal
337
+ npx ng add @solercia/ui
338
+ ```
339
+
340
+ `ng add` (options `--project`, `--skip-install`) does the following:
341
+
342
+ 1. Creates the FSD layer stubs `src/{pages,widgets,features,entities}/index.ts`.
343
+ 2. Scaffolds `src/shared/tokens/` with `AppThemeSource` and `AppTenantResolver` (both return `null`).
344
+ 3. Scaffolds `src/shared/i18n/i18n.service.ts`, an `I18nService` that implements `SolI18n`.
345
+ 4. Adds the path aliases `@app/*`, `@pages/*`, `@widgets/*`, `@features/*`, `@entities/*`, `@shared/*`.
346
+ 5. Appends the tokens base snippet to `src/styles.css` (page background, text color, font).
347
+ 6. Adds `provideTheme()` to `app.config.ts`.
348
+ 7. Creates `eslint.config.js` extending `@solercia/eslint-config`, unless one exists.
349
+ 8. Sets up Husky, lint-staged and commitlint.
350
+ 9. Installs the dev dependencies (unless `--skip-install`).
351
+
352
+ It does not register `THEME_SOURCE` or `SOL_I18N`; the scaffolded adapters explain how when you need
353
+ them.
354
+
355
+ ### Step 3. Build a first screen
356
+
357
+ Generate a page with the library's generator and use components in its `imports`:
358
+
359
+ ```bash
360
+ npx ng generate @solercia/ui:page projects
361
+ ```
362
+
363
+ ```ts
364
+ import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
365
+ import {
366
+ SolButtonComponent,
367
+ SolCardComponent,
368
+ SolEmptyStateComponent,
369
+ SolPageHeaderComponent,
370
+ } from '@solercia/ui';
371
+
372
+ @Component({
373
+ selector: 'app-projects-page',
374
+ changeDetection: ChangeDetectionStrategy.OnPush,
375
+ imports: [SolPageHeaderComponent, SolCardComponent, SolButtonComponent, SolEmptyStateComponent],
376
+ template: `
377
+ <sol-page-header title="Projects" subtitle="Everything your team is working on">
378
+ <sol-button (clicked)="create()">New project</sol-button>
379
+ </sol-page-header>
380
+ <sol-card>
381
+ @if (projects().length === 0) {
382
+ <sol-empty-state icon="folder-open" titleKey="pages.projects.empty.title">
383
+ <sol-button variant="secondary" (clicked)="create()">Create the first project</sol-button>
384
+ </sol-empty-state>
385
+ } @else {
386
+ @for (project of projects(); track project) {
387
+ <p>{{ project }}</p>
388
+ }
389
+ }
390
+ </sol-card>
391
+ `,
392
+ })
393
+ export class ProjectsPageComponent {
394
+ readonly projects = signal<string[]>([]);
395
+
396
+ create(): void {
397
+ this.projects.update((list) => [...list, `Project ${list.length + 1}`]);
398
+ }
399
+ }
400
+ ```
401
+
402
+ The other generators follow the same layers:
403
+
404
+ | Command | Creates |
405
+ | --- | --- |
406
+ | `ng generate @solercia/ui:page <name>` | `pages/<name>/` with `index.ts`, `<name>.routes.ts` and `ui/<name>-page.component.ts` |
407
+ | `ng generate @solercia/ui:widget <name>` | `widgets/<name>/` with `index.ts` and a standalone `OnPush` component |
408
+ | `ng generate @solercia/ui:feature <name>` | `features/<name>/` with `index.ts` and a component using signal inputs and outputs |
409
+ | `ng generate @solercia/ui:entity <name>` | `entities/<name>/` with `model/` and `api/` |
410
+
411
+ ### Step 4. Add a light and dark toggle
412
+
413
+ ```ts
414
+ import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
415
+ import { SolIconButtonComponent, ThemeService } from '@solercia/ui';
416
+
417
+ @Component({
418
+ selector: 'app-theme-toggle',
419
+ changeDetection: ChangeDetectionStrategy.OnPush,
420
+ imports: [SolIconButtonComponent],
421
+ template: `
422
+ <sol-icon-button
423
+ variant="ghost"
424
+ [icon]="theme.isDark() ? 'sun' : 'moon'"
425
+ [ariaLabel]="theme.isDark() ? 'Switch to light mode' : 'Switch to dark mode'"
426
+ (clicked)="theme.toggleMode()"
427
+ />
428
+ `,
429
+ })
430
+ export class ThemeToggleComponent {
431
+ protected readonly theme = inject(ThemeService);
432
+ }
433
+ ```
434
+
435
+ The user's choice persists in `localStorage` and is independent of the tenant theme.
436
+
437
+ ### Step 5. Check the rules
438
+
439
+ ```bash
440
+ npx eslint .
441
+ ```
442
+
443
+ A clean run is part of the definition of done. See
444
+ [Linting and architecture rules](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/08-linting-and-architecture-rules.md).
445
+
446
+ ## B. Existing project
447
+
448
+ Adopt the library incrementally; nothing forces you to migrate every screen at once.
449
+
450
+ ### Step 1. Install
451
+
452
+ ```bash
453
+ npm install @solercia/ui @angular/cdk chart.js @dagrejs/dagre
454
+ ```
455
+
456
+ `@angular/cdk` is needed by the kanban components, `chart.js` by `sol-chart` and `@dagrejs/dagre` by the
457
+ flow canvas auto-layout. Install only what you use; `ng add @solercia/ui` also works on an existing
458
+ project if you want the scaffolding.
459
+
460
+ ### Step 2. Register the theme runtime
461
+
462
+ ```ts
463
+ import { ApplicationConfig, provideZonelessChangeDetection } from '@angular/core';
464
+ import { provideRouter } from '@angular/router';
465
+ import { provideTheme } from '@solercia/ui';
466
+
467
+ export const appConfig: ApplicationConfig = {
468
+ providers: [provideZonelessChangeDetection(), provideRouter([]), provideTheme()],
469
+ };
470
+ ```
471
+
472
+ ### Step 3. Apply the tokens to the page
473
+
474
+ ```css
475
+ /* src/styles.css */
476
+ body {
477
+ background: var(--sol-bg-page);
478
+ color: var(--sol-color-text-primary);
479
+ font-family: var(--sol-font-family);
480
+ }
481
+ ```
482
+
483
+ ### Step 4. Use components in new screens first
484
+
485
+ Import components into the standalone `imports` of the screen you are building. Replace hand-written
486
+ buttons, tables, dialogs and date pickers as you touch each screen.
487
+
488
+ ### Step 5. Connect your tenant, theme and language (optional)
489
+
490
+ ```ts
491
+ import { ApplicationConfig } from '@angular/core';
492
+ import { SOL_I18N, SOL_TENANT_RESOLVER, THEME_SOURCE, provideTheme } from '@solercia/ui';
493
+ import { AppTenantResolver, AppThemeSource } from '@shared/tokens';
494
+ import { I18nService } from '@shared/i18n';
495
+
496
+ export const appConfig: ApplicationConfig = {
497
+ providers: [
498
+ provideTheme(),
499
+ { provide: THEME_SOURCE, useExisting: AppThemeSource },
500
+ { provide: SOL_TENANT_RESOLVER, useExisting: AppTenantResolver },
501
+ { provide: SOL_I18N, useExisting: I18nService },
502
+ ],
503
+ };
504
+ ```
505
+
506
+ [Theming](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/04-theming.md) shows how to implement `AppThemeSource` and `AppTenantResolver`;
507
+ [Internationalization](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/05-i18n.md) shows the i18n adapter.
508
+
509
+ ### Step 6. Add the lint preset
510
+
511
+ ```bash
512
+ npm install --save-dev @solercia/eslint-config eslint typescript-eslint @eslint/css
513
+ ```
514
+
515
+ ```js
516
+ // eslint.config.js
517
+ import solerciaConfig from '@solercia/eslint-config';
518
+
519
+ export default [
520
+ { ignores: ['.angular/', 'dist/', 'coverage/', 'node_modules/'] },
521
+ ...solerciaConfig,
522
+ ];
523
+ ```
524
+
525
+ In a large legacy code base, start with the style rules on new folders and widen the scope as screens
526
+ move into the FSD layers.
527
+
528
+ ## Verification checklist
529
+
530
+ - [ ] The application renders on the «Vértice» theme with no backend running.
531
+ - [ ] The light and dark toggle switches every component and persists after a reload.
532
+ - [ ] `npx eslint .` passes.
533
+ - [ ] A screen at 390 px wide has no horizontal scroll.
534
+ - [ ] Keyboard only: every action is reachable with Tab and Enter or Space.
535
+
536
+ ---
537
+
538
+ <!-- chapter 04: docs/manual/04-theming.md -->
539
+
540
+ # Theming
541
+
542
+ ```ts
543
+ import { Injectable, signal } from '@angular/core';
544
+ import type { SolTenantResolver, ThemeFile, ThemeSource } from '@solercia/ui';
545
+
546
+ /** WHO: the active organization, null before sign-in. */
547
+ @Injectable({ providedIn: 'root' })
548
+ export class AppTenantResolver implements SolTenantResolver {
549
+ readonly tenantId = signal<number | null>(null);
550
+ activeTenantId(): number | null {
551
+ return this.tenantId();
552
+ }
553
+ }
554
+
555
+ /** HOW: load that organization's theme. Return null to keep the default. */
556
+ @Injectable({ providedIn: 'root' })
557
+ export class AppThemeSource implements ThemeSource {
558
+ async loadTheme(tenantId: number | string): Promise<ThemeFile | null> {
559
+ const response = await fetch(`/api/tenants/${tenantId}/theme`);
560
+ return response.ok ? ((await response.json()) as ThemeFile) : null;
561
+ }
562
+ }
563
+ ```
564
+
565
+ Register both with `useExisting` (see [Getting started](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/03-getting-started.md#step-5-connect-your-tenant-theme-and-language-optional))
566
+ and every component re-skins when `tenantId` changes, without a reload.
567
+
568
+ ## How it works
569
+
570
+ `ThemeService` (`providedIn: 'root'`, started by `provideTheme()`) is the only consumer of the theme
571
+ ports. It:
572
+
573
+ - reads `SOL_TENANT_RESOLVER.activeTenantId()` inside an effect and asks `THEME_SOURCE` for the theme;
574
+ - discards stale responses for a tenant that is no longer active;
575
+ - validates the document with `isRenderableTheme()` and keeps the previous or default theme when it
576
+ is not renderable;
577
+ - writes the resolved `--sol-*` properties on `document.documentElement`;
578
+ - manages light and dark mode as a user preference stored in `localStorage` (`sol-dark-mode`);
579
+ - derives the logo, brand name, favicon and one sanitized Google Fonts link.
580
+
581
+ | Member | Kind | Use |
582
+ | --- | --- | --- |
583
+ | `activeTheme()` | `Signal<ThemeFile \| null>` | The effective theme. |
584
+ | `isDark()` | `Signal<boolean>` | Current mode. |
585
+ | `logo()` | `Signal<ThemeLogo \| null>` | Sanitized logo for the active mode. |
586
+ | `brandName()` | `Signal<string \| null>` | Logo alternative text or tenant slug. |
587
+ | `toggleMode()` / `setDarkMode(dark)` | method | Change the mode and persist it. |
588
+ | `setTenantTheme(theme)` | method | Apply a `ThemeFile` directly, bypassing `THEME_SOURCE` (validated). |
589
+ | `refresh()` | method | Reload the active tenant's theme, for example after saving it. |
590
+
591
+ The library never fetches a theme by itself: where the document comes from (an API, a file, a
592
+ database `jsonb` column) is the host's decision.
593
+
594
+ ## The `ThemeFile`
595
+
596
+ A theme is a three-level token document aligned with the W3C Design Tokens format:
597
+
598
+ ```mermaid
599
+ flowchart LR
600
+ P["primitives<br/>palette, font scale, radius, space"] --> S["modes.light / modes.dark<br/>semantic: primary, text, surface, border"]
601
+ S --> C["component<br/>card, input, button, sidebar, chart, motion"]
602
+ C --> V["--sol-* custom properties"]
603
+ ```
604
+
605
+ ```jsonc
606
+ {
607
+ "meta": { "tenant": "acme", "logo": { "url": "/assets/acme.svg", "altText": "ACME", "width": 120 } },
608
+ "primitives": { "color": { "brand": { "600": "#6D28D9" } } /* font, radius, space, size, z, borderWidth */ },
609
+ "modes": {
610
+ "light": { "semantic": { "color": { "primary": "{color.brand.600}" } /* … */ }, "component": { /* … */ } },
611
+ "dark": { "semantic": { "color": { "primary": "{color.brand.600}" } /* … */ }, "component": { /* … */ } }
612
+ }
613
+ }
614
+ ```
615
+
616
+ - Values can reference primitives with `{path}`, as a whole value or inside a shorthand
617
+ (`"1px solid {color.ink.200}"`).
618
+ - Both `modes.light` and `modes.dark` are required.
619
+ - Blocks introduced after the first version (card, input, button, sidebar, chart, motion, overlay,
620
+ table, calendar) are optional; a missing block emits its baseline default, so older themes keep
621
+ working.
622
+ - Background images accept gradients or `none` only; logos and favicons accept `http`, `https` or
623
+ relative URLs; fonts are Google Fonts built from `family` and `weights`, never from a raw URL.
624
+
625
+ The full contract, with every field and a minimal complete example, is in
626
+ [`THEMING.md`](https://github.com/solercia-solutions/solercia-ui/blob/main/projects/solercia/ui/docs/THEMING.md). The bundled reference theme «Vértice», with
627
+ every optional block filled in, is `SOL_BUNDLED_DEFAULT_THEME`.
628
+
629
+ ## The tokens
630
+
631
+ Use these groups in your own styles. The authoritative list, with the contract path and default of
632
+ each variable, is `EMIT_TABLE`.
633
+
634
+ | Group | Examples |
635
+ | --- | --- |
636
+ | Color | `--sol-color-primary`, `--sol-color-primary-contrast`, `--sol-color-secondary`, `--sol-color-accent`, `--sol-color-success`, `--sol-color-warning`, `--sol-color-danger`, `--sol-color-info` |
637
+ | Text | `--sol-color-text-primary`, `--sol-color-text-secondary`, `--sol-color-text-muted` |
638
+ | Surfaces | `--sol-bg-page`, `--sol-bg-surface`, `--sol-bg-sunken`, `--sol-bg-overlay`, `--sol-bg-page-texture` |
639
+ | Typography | `--sol-font-family`, `--sol-font-family-mono`, `--sol-font-display`, `--sol-font-numeric`, `--sol-font-size-sm`, `--sol-font-size-base`, `--sol-font-size-lg`, `--sol-font-size-xl`, `--sol-font-weight-bold`, `--sol-line-height` |
640
+ | Spacing | `--sol-space-xs`, `--sol-space-sm`, `--sol-space-md`, `--sol-space-lg`, `--sol-space-xl` |
641
+ | Shape | `--sol-border-radius-sm`, `--sol-border-radius-md`, `--sol-border-radius-lg`, `--sol-border-radius-full`, `--sol-border-width-default`, `--sol-border-color-default` |
642
+ | Elevation | `--sol-shadow-sm`, `--sol-shadow-md`, `--sol-shadow-lg`, `--sol-shadow-card` |
643
+ | Sizes | `--sol-size-input-height`, `--sol-size-button-height`, `--sol-size-control-touch`, `--sol-size-header-height`, `--sol-size-sidebar-width` |
644
+ | Layers | `--sol-z-dropdown`, `--sol-z-modal`, `--sol-z-tooltip` |
645
+ | Motion | `--sol-dur-fast`, `--sol-dur-base`, `--sol-dur-slow`, `--sol-ease`, `--sol-ease-entrance` |
646
+ | Components | `--sol-card-*`, `--sol-input-*`, `--sol-button-*`, `--sol-sidebar-*`, `--sol-header-*`, `--sol-chart-1` to `--sol-chart-6` |
647
+
648
+ ```css
649
+ .summary {
650
+ padding: var(--sol-space-lg);
651
+ border: var(--sol-border-width-default) solid var(--sol-border-color-default);
652
+ border-radius: var(--sol-border-radius-lg);
653
+ background: var(--sol-bg-surface);
654
+ color: var(--sol-color-text-primary);
655
+ }
656
+ .summary__value {
657
+ font-family: var(--sol-font-numeric);
658
+ color: var(--sol-color-primary);
659
+ }
660
+ ```
661
+
662
+ ## Your own default theme
663
+
664
+ Provide your brand theme as the default. It becomes level 2 and the look before sign-in:
665
+
666
+ ```ts
667
+ import { SOL_DEFAULT_THEME, type ThemeFile } from '@solercia/ui';
668
+ import brandTheme from './brand.theme.json';
669
+
670
+ export const brandThemeProvider = { provide: SOL_DEFAULT_THEME, useValue: brandTheme as ThemeFile };
671
+ ```
672
+
673
+ ## Level 3: the static safety net
674
+
675
+ Add a `:root { --sol-*: … }` block to `styles.css` with literal values. `ThemeService` removes its inline
676
+ properties when it has no applicable theme, so this block governs only as a last resort. The lint
677
+ preset allows literals where a custom property is defined.
678
+
679
+ ## Editing themes: Theme Studio
680
+
681
+ `@solercia/ui/theme-studio` provides `<sol-theme-studio>`, a complete theme editor with live preview,
682
+ backed by a host store contract (`THEME_STUDIO_STORE`). Use it to let each organization edit its own
683
+ theme and call `ThemeService.refresh()` after saving. See
684
+ [`THEME-STUDIO.md`](https://github.com/solercia-solutions/solercia-ui/blob/main/projects/solercia/ui/docs/THEME-STUDIO.md).
685
+
686
+ ## Themed sign-in
687
+
688
+ A theme can carry a `meta.login` block (photos, motion, per-mode composition). The entry point
689
+ `@solercia/ui/login-appearance` paints it with `<sol-login-frame>` and ships no authentication logic:
690
+ the host projects its own form. See the [README section](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#themed-sign-in-solerciauilogin-appearance).
691
+
692
+ ## Checklist
693
+
694
+ - [ ] With no tenant, the application renders on the default theme.
695
+ - [ ] Switching tenant re-skins the UI live; a failing theme request keeps the default.
696
+ - [ ] Dark mode is independent of the tenant and persists across reloads.
697
+ - [ ] No literal color, font or `!important` in component styles.
698
+
699
+ ---
700
+
701
+ <!-- chapter 05: docs/manual/05-i18n.md -->
702
+
703
+ # Internationalization
704
+
705
+ ```ts
706
+ import { SOL_I18N, createSolI18n } from '@solercia/ui';
707
+
708
+ // Colombian Spanish for every component, no i18n engine needed.
709
+ export const spanishProvider = { provide: SOL_I18N, useFactory: () => createSolI18n({ lang: 'es-CO' }) };
710
+ ```
711
+
712
+ Components never import Transloco, ngx-translate or `@angular/localize`. They depend on one small
713
+ contract, `SolI18n`, that the host binds to `SOL_I18N`. The pattern mirrors Angular Material's `*Intl`
714
+ services.
715
+
716
+ ## The contract
717
+
718
+ ```ts
719
+ import type { Signal } from '@angular/core';
720
+
721
+ interface SolI18n {
722
+ readonly activeLang: Signal<string>;
723
+ translate(key: string, params?: Record<string, unknown>): string; // missing key: returns the key
724
+ t(key: string, params?: Record<string, unknown>): Signal<string>; // recomputes on language change
725
+ tMany(keys: string[]): Signal<string[]>;
726
+ }
727
+ ```
728
+
729
+ | Member | Use for |
730
+ | --- | --- |
731
+ | `activeLang` | Reacting to language changes, for example a language selector. |
732
+ | `translate(key, params?)` | One-off lookups in imperative code. |
733
+ | `t(key, params?)` | Template bindings; call it in an injection context. |
734
+ | `tMany(keys)` | Ordered lists such as stepper labels. |
735
+
736
+ ## Three ways to provide it
737
+
738
+ | Situation | Provider |
739
+ | --- | --- |
740
+ | English is enough | Nothing. `SOL_I18N` defaults to `createSolI18n()`, English from the bundled catalog. |
741
+ | Spanish or another fixed language, no engine | `{ provide: SOL_I18N, useFactory: () => createSolI18n({ lang: 'es-CO' }) }` |
742
+ | The application already uses an engine | A facade with the four members, bound with `useExisting`. |
743
+
744
+ `createSolI18n(options?)` returns a `SolCatalogI18n` with `setLang(lang)`. Its options are `lang`
745
+ (default `'en'`) and `catalogs` (default `{ en: SOL_I18N_EN, 'es-CO': SOL_I18N_ES_CO }`):
746
+
747
+ ```ts
748
+ import { SOL_I18N_EN, createSolI18n, type SolI18nCatalog } from '@solercia/ui';
749
+
750
+ declare const frenchCatalog: SolI18nCatalog;
751
+
752
+ const i18n = createSolI18n({ lang: 'fr', catalogs: { en: SOL_I18N_EN, fr: frenchCatalog } });
753
+ i18n.setLang('en');
754
+ ```
755
+
756
+ ### Adapter for Transloco
757
+
758
+ ```ts
759
+ import { Injectable, Signal, inject } from '@angular/core';
760
+ import { TranslocoService, translateSignal } from '@jsverse/transloco';
761
+
762
+ @Injectable({ providedIn: 'root' })
763
+ export class I18nService {
764
+ private readonly transloco = inject(TranslocoService);
765
+ readonly activeLang: Signal<string> = this.transloco.activeLang;
766
+
767
+ translate(key: string, params?: Record<string, unknown>): string {
768
+ return this.transloco.translate(key, params);
769
+ }
770
+ t(key: string, params?: Record<string, unknown>): Signal<string> {
771
+ return translateSignal(key, params);
772
+ }
773
+ tMany(keys: string[]): Signal<string[]> {
774
+ return translateSignal(keys);
775
+ }
776
+ }
777
+
778
+ // app.config.ts: { provide: SOL_I18N, useExisting: I18nService }
779
+ ```
780
+
781
+ The same shape works for ngx-translate or any other engine: bridge its language-change stream into a
782
+ signal with `toSignal` so `activeLang`, `t` and `tMany` recompute. More examples are in
783
+ [`I18N.md`](https://github.com/solercia-solutions/solercia-ui/blob/main/projects/solercia/ui/docs/I18N.md).
784
+
785
+ ## Bundled catalogs and fallback
786
+
787
+ Every visible default text in the library goes through a `shared.*` key. Both catalogs ship with the
788
+ package:
789
+
790
+ | Catalog | Constant | File |
791
+ | --- | --- | --- |
792
+ | English | `SOL_I18N_EN` | `@solercia/ui/i18n/en.json` |
793
+ | Colombian Spanish | `SOL_I18N_ES_CO` | `@solercia/ui/i18n/es-CO.json` |
794
+
795
+ ```mermaid
796
+ flowchart LR
797
+ A["Explicit input<br/>confirmLabel='Delete'"] -->|set| R["Rendered text"]
798
+ A -->|not set| B["Host engine<br/>translate('shared.confirmDialog.confirm')"]
799
+ B -->|translated| R
800
+ B -->|returns the key unchanged| C["Bundled catalog of the active language<br/>es* → es-CO, else en"]
801
+ C --> R
802
+ ```
803
+
804
+ - An explicit input (`searchPlaceholder`, `actionsLabel`, `confirmLabel`, `label`) always wins.
805
+ - When the host engine does not know a `shared.*` key, the component falls back to the bundled
806
+ catalog of the active language, so a host catalog does not need every library key and keys added in
807
+ later versions keep the host language.
808
+ - With Transloco or ngx-translate you can also merge `@solercia/ui/i18n/es-CO.json` into your `es-CO`
809
+ translations.
810
+
811
+ ## Inputs that take keys
812
+
813
+ Inputs whose name ends in `Key` receive an i18n key, not a text: `titleKey` and `descriptionKey` on
814
+ `sol-empty-state`, `ariaLabelKey` on `sol-chart` and `sol-number-input`, `labelKey` on timeline nodes.
815
+
816
+ ```html
817
+ <sol-empty-state icon="folder-open" titleKey="pages.projects.empty.title" descriptionKey="pages.projects.empty.description" />
818
+ ```
819
+
820
+ ## Rules for application code
821
+
822
+ - Put your own texts in your catalog under your own namespaces (`pages.*`, `features.*`); keep
823
+ `shared.*` for the library.
824
+ - Never hard-code a visible text in a shared component; take it as an input or a key.
825
+ - Tests that assert texts should use the catalogs, not literals typed in the spec.
826
+ - `createIdentitySolI18n()` returns keys unchanged and is meant for tests.
827
+
828
+ ---
829
+
830
+ <!-- chapter 06: docs/manual/06-components.md -->
831
+
832
+ # Components
833
+
834
+ ```ts
835
+ import { SolButtonComponent, SolDataTableComponent, SolModalComponent } from '@solercia/ui';
836
+
837
+ // Every component is standalone: add it to the `imports` of the component that uses it.
838
+ export const projectScreenImports = [SolButtonComponent, SolDataTableComponent, SolModalComponent];
839
+ ```
840
+
841
+ `@solercia/ui` has 57 public components and directives. This chapter helps you choose one; the
842
+ [component reference](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#component-reference) lists every input, output and slot, and the
843
+ showcase demoes each component live, in light and dark mode, down to 390 px.
844
+
845
+ Conventions used across the library:
846
+
847
+ - Selectors start with `sol-`; directives with `sol` (`[solReveal]`, `*solWizardStep`, `*solTreeNodeDef`).
848
+ - Class names are `Sol<Name>Component` or `Sol<Name>Directive`.
849
+ - Form controls implement `ControlValueAccessor`, so `[(ngModel)]` and `formControlName` work.
850
+ - Outputs are past-tense or `*Change` events: `clicked`, `closed`, `valueChange`, `itemMoved`.
851
+ - Inputs ending in `Key` take an i18n key; icon-only controls require `ariaLabel`.
852
+
853
+ ## Actions
854
+
855
+ | Selector | Use it for | Demo |
856
+ | --- | --- | --- |
857
+ | `sol-button` | Text button with `primary`, `secondary`, `danger` and `ghost` variants and a loading state. | [Buttons](https://solercia-solutions.github.io/solercia-ui/buttons) |
858
+ | `sol-icon-button` | Icon-only action; `ariaLabel` is required. | [Buttons](https://solercia-solutions.github.io/solercia-ui/buttons) |
859
+ | `sol-icon` | Inline SVG from a registry of about 140 names. | [Icons](https://solercia-solutions.github.io/solercia-ui/icons) |
860
+
861
+ Reference: [Actions](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#actions).
862
+
863
+ ## Forms
864
+
865
+ | Selector | Use it for | Demo |
866
+ | --- | --- | --- |
867
+ | `sol-input`, `sol-textarea` | Text with label and error message. | [Inputs](https://solercia-solutions.github.io/solercia-ui/inputs) |
868
+ | `sol-form-field` | Label, hint and error around any projected control. | [Inputs](https://solercia-solutions.github.io/solercia-ui/inputs) |
869
+ | `sol-search-input` | A search box that emits the query. | [Inputs](https://solercia-solutions.github.io/solercia-ui/inputs) |
870
+ | `sol-number-input` | Numbers with − and + buttons. | [Inputs](https://solercia-solutions.github.io/solercia-ui/inputs) |
871
+ | `sol-select` | Searchable single or multiple choice; bottom sheet on phones. | [Selection](https://solercia-solutions.github.io/solercia-ui/selection) |
872
+ | `sol-checkbox`, `sol-toggle` | Boolean choices. | [Selection](https://solercia-solutions.github.io/solercia-ui/selection) |
873
+ | `sol-chip`, `sol-chip-group`, `sol-view-toggle` | Filters, choices as chips and segmented controls. | [Chips](https://solercia-solutions.github.io/solercia-ui/chips) |
874
+ | `sol-date-picker`, `sol-day-picker` | A date from a calendar, or a day from the slots the host computed. | [Dates](https://solercia-solutions.github.io/solercia-ui/dates) |
875
+ | `sol-rating-input` | Interactive 1–5 stars. | [Rating](https://solercia-solutions.github.io/solercia-ui/rating) |
876
+ | `sol-file-upload` | Drag-and-drop image picker with validation and preview. | [File upload](https://solercia-solutions.github.io/solercia-ui/file-upload) |
877
+ | `sol-rich-editor` | Rich text with tables, images, mentions; TCPDF-safe HTML output. | [Rich editor](https://solercia-solutions.github.io/solercia-ui/rich-editor) |
878
+
879
+ Reference: [Forms](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#forms).
880
+
881
+ ## Feedback and status
882
+
883
+ | Selector | Use it for | Demo |
884
+ | --- | --- | --- |
885
+ | `sol-badge`, `sol-score-badge`, `sol-trend`, `sol-message-status` | Status, scores, variations and delivery ticks. | [Status](https://solercia-solutions.github.io/solercia-ui/status) |
886
+ | `sol-avatar`, `sol-star-rating` | People and read-only ratings. | [Status](https://solercia-solutions.github.io/solercia-ui/status) |
887
+ | `sol-spinner`, `sol-skeleton`, `sol-progress-bar` | Loading and progress. | [Loading](https://solercia-solutions.github.io/solercia-ui/loading) |
888
+ | `sol-empty-state` | Empty and no-results states with an optional action. | [Empty state](https://solercia-solutions.github.io/solercia-ui/empty-state) |
889
+ | `sol-tooltip` | Hover and focus hints. | [Tooltip](https://solercia-solutions.github.io/solercia-ui/tooltip) |
890
+ | `sol-notification-panel` | An inbox with loading, error, empty and content states. | [Notifications](https://solercia-solutions.github.io/solercia-ui/notifications) |
891
+
892
+ Reference: [Feedback and status](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#feedback--status).
893
+
894
+ ## Overlays
895
+
896
+ | Selector | Use it for | Demo |
897
+ | --- | --- | --- |
898
+ | `sol-modal` | A focused task over the page. | [Overlays](https://solercia-solutions.github.io/solercia-ui/overlays) |
899
+ | `sol-drawer` | Side panel or bottom sheet, with a footer slot. | [Overlays](https://solercia-solutions.github.io/solercia-ui/overlays) |
900
+ | `sol-confirm-dialog` | Confirming a destructive or irreversible action. | [Overlays](https://solercia-solutions.github.io/solercia-ui/overlays) |
901
+
902
+ Reference: [Overlays](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#overlays).
903
+
904
+ ## Navigation
905
+
906
+ | Selector | Use it for | Demo |
907
+ | --- | --- | --- |
908
+ | `sol-tabs` | A tab list; the host renders the active panel. | [Navigation](https://solercia-solutions.github.io/solercia-ui/navigation) |
909
+ | `sol-pagination` | Pages and page size. | [Navigation](https://solercia-solutions.github.io/solercia-ui/navigation) |
910
+ | `sol-page-header` | Page title, subtitle and actions. | [Navigation](https://solercia-solutions.github.io/solercia-ui/navigation) |
911
+ | `sol-stepper`, `sol-wizard` + `*solWizardStep` | Ordered steps, or a full multi-step form. | [Stepper](https://solercia-solutions.github.io/solercia-ui/stepper) |
912
+ | `sol-scope-switcher` | Switching organization, workspace or tenant. | [Scope switcher](https://solercia-solutions.github.io/solercia-ui/scope-switcher) |
913
+ | `sol-tree` + `*solTreeNodeDef` | Hierarchies up to five levels deep, keyboard navigable. | [Tree](https://solercia-solutions.github.io/solercia-ui/tree) |
914
+
915
+ Reference: [Navigation](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#navigation).
916
+
917
+ ## Layout and motion
918
+
919
+ | Selector | Use it for | Demo |
920
+ | --- | --- | --- |
921
+ | `sol-card` | A surface with optional padding and hover elevation. | [Card](https://solercia-solutions.github.io/solercia-ui/card) |
922
+ | `[solReveal]` | Entrance animation from the theme's motion tokens; respects reduced motion. | [Card](https://solercia-solutions.github.io/solercia-ui/card) |
923
+
924
+ Reference: [Layout and motion](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#layout--motion).
925
+
926
+ ## Data
927
+
928
+ | Selector | Use it for | Demo |
929
+ | --- | --- | --- |
930
+ | `sol-data-table` | Sorting, filters, search, pagination, row actions; collapses into cards on phones. | [Data table](https://solercia-solutions.github.io/solercia-ui/data-table) |
931
+ | `sol-virtual-scroll` | Long lists with variable heights, such as chat histories. | [Virtual scroll](https://solercia-solutions.github.io/solercia-ui/virtual-scroll) |
932
+ | `sol-chart` | Line, bar, doughnut and sparkline charts themed from tokens. | [Chart](https://solercia-solutions.github.io/solercia-ui/chart) |
933
+ | `sol-timeline` | A Gantt-like hierarchy on a month axis. | [Timeline](https://solercia-solutions.github.io/solercia-ui/timeline) |
934
+
935
+ Reference: [Data](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#data).
936
+
937
+ ## Planning
938
+
939
+ | Selector | Use it for | Demo |
940
+ | --- | --- | --- |
941
+ | `sol-kanban-board` and `sol-kanban-*` | Columns with drag and drop by mouse, touch and keyboard, with rollback. | [Kanban](https://solercia-solutions.github.io/solercia-ui/kanban) |
942
+ | `sol-calendar` and `sol-calendar-*` | A week or day agenda. | [Calendar](https://solercia-solutions.github.io/solercia-ui/calendar) |
943
+ | `sol-flow-canvas` | A node graph with pan, zoom, connections and auto-layout. | [Flow canvas](https://solercia-solutions.github.io/solercia-ui/flow-canvas) |
944
+
945
+ Reference: [Planning](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#planning).
946
+
947
+ ## Secondary entry points
948
+
949
+ | Entry point | Provides |
950
+ | --- | --- |
951
+ | `@solercia/ui/theme-studio` | `<sol-theme-studio>` theme editor and its store contract. |
952
+ | `@solercia/ui/login-appearance` | `<sol-login-frame>` and the pieces of a themed sign-in screen. |
953
+
954
+ ## Choosing between similar components
955
+
956
+ | If you need | Use | Not |
957
+ | --- | --- | --- |
958
+ | A yes or no that applies immediately | `sol-toggle` | `sol-checkbox` |
959
+ | A yes or no submitted with a form, or a list of options | `sol-checkbox` | `sol-toggle` |
960
+ | Two to five mutually exclusive views | `sol-view-toggle` | `sol-tabs` |
961
+ | Sections of one page with their own content | `sol-tabs` | `sol-view-toggle` |
962
+ | A short decision about a destructive action | `sol-confirm-dialog` | `sol-modal` |
963
+ | A form or task in context | `sol-drawer` | `sol-modal` on phones |
964
+ | A placeholder that keeps the layout while loading | `sol-skeleton` | `sol-spinner` |
965
+ | A busy indicator inside a button or small area | `sol-spinner` or `sol-button [loading]` | `sol-skeleton` |
966
+
967
+ ---
968
+
969
+ <!-- chapter 07: docs/manual/07-patterns.md -->
970
+
971
+ # Patterns
972
+
973
+ ```html
974
+ @switch (state()) {
975
+ @case ('loading') { <sol-skeleton variant="row" count="5" /> }
976
+ @case ('error') {
977
+ <sol-empty-state icon="exclamation-triangle" titleKey="pages.projects.error.title">
978
+ <sol-button variant="secondary" (clicked)="reload()">Try again</sol-button>
979
+ </sol-empty-state>
980
+ }
981
+ @case ('empty') {
982
+ <sol-empty-state icon="folder-open" titleKey="pages.projects.empty.title">
983
+ <sol-button (clicked)="create()">Create project</sol-button>
984
+ </sol-empty-state>
985
+ }
986
+ @case ('no-results') { <sol-empty-state icon="funnel" titleKey="pages.projects.noResults.title" /> }
987
+ @default { <sol-data-table [data]="visible()" [columns]="columns" /> }
988
+ }
989
+ ```
990
+
991
+ A pattern is a proven way to combine components for a recurring screen. Follow these before
992
+ designing something new.
993
+
994
+ ## The five screen states
995
+
996
+ Every screen that shows data has five states. Design and test all of them.
997
+
998
+ | State | Meaning | Component | Rule |
999
+ | --- | --- | --- | --- |
1000
+ | Loading | The request is in flight. | `sol-skeleton` for content areas, `sol-spinner` for small areas, `[loading]` on buttons | Keep the layout: the skeleton has the shape of the content. |
1001
+ | Empty | The request succeeded and there is nothing yet. | `sol-empty-state` with a call to action | Tell the user how to create the first item. |
1002
+ | No results | There is data, but the filters hide all of it. | `sol-empty-state` with a reset action | Never show the "empty" message: offer to clear the filters. |
1003
+ | Error | The request failed. | `sol-empty-state` with a retry action | Never confuse "no data" with "the request failed". |
1004
+ | Success | Data is shown, or an action completed. | The content; a confirmation message | Confirm actions that changed data. |
1005
+
1006
+ Derive the state from signals instead of juggling flags:
1007
+
1008
+ ```ts
1009
+ import { ChangeDetectionStrategy, Component, computed, signal } from '@angular/core';
1010
+ import {
1011
+ SolButtonComponent,
1012
+ SolDataTableComponent,
1013
+ SolEmptyStateComponent,
1014
+ SolSkeletonComponent,
1015
+ type DataTableColumn,
1016
+ type SolDataTableRow,
1017
+ } from '@solercia/ui';
1018
+
1019
+ type ScreenState = 'loading' | 'error' | 'empty' | 'no-results' | 'ready';
1020
+
1021
+ @Component({
1022
+ selector: 'app-projects-list',
1023
+ changeDetection: ChangeDetectionStrategy.OnPush,
1024
+ imports: [SolButtonComponent, SolDataTableComponent, SolEmptyStateComponent, SolSkeletonComponent],
1025
+ template: `
1026
+ @switch (state()) {
1027
+ @case ('loading') { <sol-skeleton variant="row" count="5" /> }
1028
+ @case ('error') {
1029
+ <sol-empty-state icon="exclamation-triangle" titleKey="pages.projects.error.title">
1030
+ <sol-button variant="secondary" (clicked)="reload()">Try again</sol-button>
1031
+ </sol-empty-state>
1032
+ }
1033
+ @case ('empty') { <sol-empty-state icon="folder-open" titleKey="pages.projects.empty.title" /> }
1034
+ @case ('no-results') {
1035
+ <sol-empty-state icon="funnel" titleKey="pages.projects.noResults.title">
1036
+ <sol-button variant="ghost" (clicked)="query.set('')">Clear filters</sol-button>
1037
+ </sol-empty-state>
1038
+ }
1039
+ @default { <sol-data-table [data]="visible()" [columns]="columns" /> }
1040
+ }
1041
+ `,
1042
+ })
1043
+ export class ProjectsListComponent {
1044
+ readonly loading = signal(true);
1045
+ readonly failed = signal(false);
1046
+ readonly rows = signal<SolDataTableRow[]>([]);
1047
+ readonly query = signal('');
1048
+ readonly columns: DataTableColumn[] = [{ key: 'name', label: 'Name', sortable: true }];
1049
+
1050
+ readonly visible = computed(() =>
1051
+ this.rows().filter((row) => String(row['name']).toLowerCase().includes(this.query().toLowerCase())),
1052
+ );
1053
+ readonly state = computed<ScreenState>(() => {
1054
+ if (this.loading()) return 'loading';
1055
+ if (this.failed()) return 'error';
1056
+ if (this.rows().length === 0) return 'empty';
1057
+ return this.visible().length === 0 ? 'no-results' : 'ready';
1058
+ });
1059
+
1060
+ reload(): void {
1061
+ this.failed.set(false);
1062
+ this.loading.set(true);
1063
+ }
1064
+ }
1065
+ ```
1066
+
1067
+ For lists, `sol-data-table [loading]` and `sol-notification-panel [loading] [error]` already render
1068
+ their own loading and empty states.
1069
+
1070
+ ## Forms
1071
+
1072
+ - Use the library controls; they implement `ControlValueAccessor` and work with reactive forms
1073
+ (`formControlName`) and `ngModel`.
1074
+ - Give every control a visible `label`. Use `sol-form-field` to wrap a native or third-party control.
1075
+ - Show validation messages through the `error` input, after the user leaves the field or submits.
1076
+ - If the system knows the valid values, offer them (`sol-select`, `sol-date-picker`, `sol-day-picker`)
1077
+ instead of free text.
1078
+ - Preselect the most likely value; do not start a form empty when a sensible default exists.
1079
+ - Long forms become a `sol-wizard`, one `*solWizardStep` per group of fields.
1080
+
1081
+ ```html
1082
+ <form [formGroup]="form" (ngSubmit)="save()">
1083
+ <sol-input label="Project name" formControlName="name" [error]="nameError()" />
1084
+ <sol-select label="Owner" formControlName="owner" [options]="owners()" />
1085
+ <sol-date-picker formControlName="dueDate" />
1086
+ <sol-button type="submit" [loading]="saving()">Save</sol-button>
1087
+ </form>
1088
+ ```
1089
+
1090
+ ## Tables
1091
+
1092
+ - `sol-data-table` handles sorting, per-column filters (`filter: 'text' | 'select'`), global search and
1093
+ pagination on the client. For server-side paging, pass the current page and use `sol-pagination`.
1094
+ - Below `collapseWidth` (767 px by default) rows collapse into cards, so tables work on phones without
1095
+ horizontal scrolling.
1096
+ - Put the primary action of the screen in the `[tableActions]` slot and row actions in the
1097
+ `#rowActions` template, or use the built-in `editClicked` and `deleteClicked` outputs.
1098
+ - A delete action always goes through `sol-confirm-dialog`.
1099
+
1100
+ ## Dialogs on mobile
1101
+
1102
+ | Component | Phone behavior |
1103
+ | --- | --- |
1104
+ | `sol-confirm-dialog` | Below 640 px it opens as a bottom sheet with full-width stacked actions and Cancel at the bottom, near the thumb. |
1105
+ | `sol-drawer` | `variant="sheet"` opens from the bottom; use it for filters and short forms. |
1106
+ | `sol-select` | Opens as a bottom sheet below `mobileBreakpoint` (640 px). |
1107
+ | `sol-modal` | Keep modals short on phones; prefer a drawer sheet or a page for long forms. |
1108
+
1109
+ All of them are `aria-modal`, trap focus, restore it on close, close on Escape when closeable and lock
1110
+ the page scroll. On touch screens every action reaches the 44 px touch target
1111
+ (`--sol-size-control-touch`).
1112
+
1113
+ ```html
1114
+ <sol-confirm-dialog
1115
+ [open]="confirming()"
1116
+ title="Delete this project?"
1117
+ message="Its tasks and files are deleted too."
1118
+ confirmLabel="Delete"
1119
+ (confirm)="remove()"
1120
+ (cancel)="confirming.set(false)"
1121
+ />
1122
+ ```
1123
+
1124
+ ## Charts
1125
+
1126
+ - Use `sol-chart`; never import Chart.js in application code. The chart reads `--sol-chart-1` to
1127
+ `--sol-chart-6`, re-renders on light and dark changes, and Chart.js loads only when the first chart
1128
+ is created.
1129
+ - `ariaLabelKey` is required: describe what the chart shows.
1130
+ - Show a `sol-skeleton variant="card"` while data loads and a `sol-empty-state` when the series are
1131
+ empty.
1132
+
1133
+ ```html
1134
+ <sol-chart
1135
+ type="bar"
1136
+ ariaLabelKey="pages.dashboard.projectsByStatus"
1137
+ [data]="{ labels: ['Planned', 'Active', 'Done'], series: [{ label: 'Projects', data: [4, 9, 12] }] }"
1138
+ />
1139
+ ```
1140
+
1141
+ ## Kanban
1142
+
1143
+ - Use `sol-kanban-board`; never import `@angular/cdk/drag-drop` in application code. The board
1144
+ supports mouse, touch and a keyboard "Move to…" menu.
1145
+ - Update the columns optimistically and call `rollback()` when persisting fails.
1146
+
1147
+ ```ts
1148
+ import type { KanbanItemMoved, SolKanbanBoardComponent } from '@solercia/ui';
1149
+
1150
+ interface Task {
1151
+ id: string;
1152
+ title: string;
1153
+ }
1154
+
1155
+ declare function moveTask(move: KanbanItemMoved<Task>): Promise<void>;
1156
+
1157
+ export async function persistMove(move: KanbanItemMoved<Task>, board: SolKanbanBoardComponent<Task>): Promise<void> {
1158
+ try {
1159
+ await moveTask(move);
1160
+ } catch {
1161
+ board.rollback();
1162
+ }
1163
+ }
1164
+ ```
1165
+
1166
+ ## Responsive and accessible by default
1167
+
1168
+ - Check every screen at 390 px: no horizontal scroll, no hidden primary action.
1169
+ - Every action must work with the keyboard; icon-only buttons need `ariaLabel`.
1170
+ - Animate with `[solReveal]` and the motion tokens only; they respect `prefers-reduced-motion`.
1171
+
1172
+ ---
1173
+
1174
+ <!-- chapter 08: docs/manual/08-linting-and-architecture-rules.md -->
1175
+
1176
+ # Linting and architecture rules
1177
+
1178
+ ```js
1179
+ // eslint.config.js
1180
+ import solerciaConfig from '@solercia/eslint-config';
1181
+
1182
+ export default [
1183
+ { ignores: ['.angular/', 'dist/', 'coverage/', 'node_modules/'] },
1184
+ ...solerciaConfig,
1185
+ ];
1186
+ ```
1187
+
1188
+ `@solercia/eslint-config` turns the architecture into rules the linter checks on every commit. A file
1189
+ in the wrong folder, an import across layers or a hardcoded color fails CI instead of slipping
1190
+ through review. `ng add @solercia/ui` installs and configures it.
1191
+
1192
+ ## Requirements
1193
+
1194
+ | Dependency | Version | Notes |
1195
+ | --- | --- | --- |
1196
+ | Node.js | 22.14 or later | |
1197
+ | `eslint` | 10 | Flat config only. |
1198
+ | `typescript-eslint` | 8 | Syntactic rules; no type information needed. |
1199
+ | `@eslint/css` | 2, optional | When installed, `.css` files are checked too. |
1200
+
1201
+ ## What it enforces
1202
+
1203
+ | Area | Rule | Enforces |
1204
+ | --- | --- | --- |
1205
+ | Layer boundaries | `no-restricted-imports` | `app → pages → widgets → features → entities → shared`. A layer imports only from layers below it; `shared/**` never imports from upper layers or `@app/*`. |
1206
+ | Public API | `no-restricted-imports` | Slices are consumed through their `index.ts` (`@features/login`), never through deep paths (`@features/login/ui/form`). |
1207
+ | Smart and dumb UI | `no-restricted-imports` | `shared/ui` holds presentational components only: no imports from `entities/`, `features/`, `*.store` or `*.facade`. |
1208
+ | Wrapped engines | `no-restricted-imports`, `no-restricted-syntax` | `chart.js` only inside `shared/ui/chart`, `maplibre-gl` only inside `shared/ui/map`, `@angular/cdk` only through the `sol-kanban-*` components. |
1209
+ | Naming | `@typescript-eslint/naming-convention` | `PascalCase` classes, interfaces and types; `camelCase` variables, functions and parameters. |
1210
+ | File names | `solercia/filename-case` | Every dot-separated segment is kebab-case: `appointment-form.component.ts`. |
1211
+ | File placement | `solercia/fsd-placement` | Every `.ts` file under `src/` belongs to a layer and an allowed segment. |
1212
+ | Theme styles | `solercia/style-tokens` | Inline component `styles` and `style="..."` in inline templates use theme variables. |
1213
+ | Theme styles (CSS) | `solercia/css-style-tokens` | The same checks on `src/**/*.css`, when `@eslint/css` is installed. |
1214
+
1215
+ ### File placement
1216
+
1217
+ ```text
1218
+ src/
1219
+ ├── main.ts allowed outside layers (also test-setup.ts, polyfills.ts, environments/**)
1220
+ ├── app/ anything goes (bootstrap, routes, providers)
1221
+ ├── pages/<slice>/ index.ts, <slice>.routes.ts, ui/
1222
+ ├── widgets/<slice>/<segment>/
1223
+ ├── features/<slice>/<segment>/ segment ∈ ui | model | api | lib | config | testing
1224
+ ├── entities/<slice>/<segment>/ slice groups are allowed: pages/admin/users/ui/
1225
+ └── shared/<segment>/ segment ∈ api | config | crud | i18n | lib | model | tenant | tokens | ui
1226
+ ```
1227
+
1228
+ ### Styles
1229
+
1230
+ | Reported | Use instead |
1231
+ | --- | --- |
1232
+ | Color literals: `#fff`, `rgb()`, `hsl()`, `oklch()`, named colors | `var(--sol-*)` |
1233
+ | A literal `font-family` | `var(--sol-font-family)` or the matching theme variable |
1234
+ | `!important` | A more specific selector or a theme variable |
1235
+ | `::ng-deep` | A CSS custom property exposed by the child component |
1236
+
1237
+ Literals stay allowed where tokens are defined and as fallbacks inside `var()`:
1238
+
1239
+ ```css
1240
+ :host {
1241
+ --sol-card-bg: #ffffff; /* defining a custom property */
1242
+ background: var(--sol-bg-surface, #ffffff); /* fallback inside var() */
1243
+ }
1244
+ ```
1245
+
1246
+ Not covered: external templates (`templateUrl`) and `px` units.
1247
+
1248
+ ## Options
1249
+
1250
+ ```js
1251
+ import { solerciaEslintConfig } from '@solercia/eslint-config';
1252
+
1253
+ export default [
1254
+ ...solerciaEslintConfig({
1255
+ srcDir: 'apps/web/src', // FSD root, default 'src'
1256
+ extraSharedSegments: ['support'], // project-specific shared/ segments
1257
+ allowOutsideLayers: ['main.ts'], // replaces the default bootstrap allow-list
1258
+ }),
1259
+ ];
1260
+ ```
1261
+
1262
+ The style rules accept `{ allowImportant?: boolean, allowNgDeep?: boolean }`.
1263
+
1264
+ ## Declaring exceptions
1265
+
1266
+ Exceptions live in the consuming project's `eslint.config.js`, never in the preset, so they stay
1267
+ visible in code review. Each one carries a comment that explains why.
1268
+
1269
+ ```js
1270
+ export default [
1271
+ ...solerciaEslintConfig({ extraSharedSegments: ['support'] }),
1272
+ // Overrides a third-party theme: !important is intentional here.
1273
+ {
1274
+ files: ['src/assets/legacy-theme.css'],
1275
+ rules: { 'solercia/css-style-tokens': ['error', { allowImportant: true }] },
1276
+ },
1277
+ ];
1278
+ ```
1279
+
1280
+ For a single line, write the reason next to the directive:
1281
+
1282
+ ```css
1283
+ /* eslint-disable-next-line solercia/css-style-tokens -- print stylesheet needs pure black */
1284
+ ```
1285
+
1286
+ | Acceptable exception | Not acceptable |
1287
+ | --- | --- |
1288
+ | Overriding a third-party stylesheet you do not control | Silencing a rule because a deadline is close |
1289
+ | A print stylesheet that needs absolute colors | Disabling a layer rule to import a feature from an entity |
1290
+ | A wrapper around a new engine, declared next to the existing ones | Importing Chart.js in a page |
1291
+
1292
+ ## Commit hooks
1293
+
1294
+ `ng add` also configures Husky: `pre-commit` runs `lint-staged` and `commit-msg` runs commitlint with
1295
+ the Conventional Commits preset, so broken rules and malformed messages stop before they are
1296
+ committed.
1297
+
1298
+ ---
1299
+
1300
+ <!-- chapter 09: docs/manual/09-chat.md -->
1301
+
1302
+ # Chat
1303
+
1304
+ ```ts
1305
+ import { ApplicationConfig } from '@angular/core';
1306
+ import { provideSolerciaChat } from '@solercia/chat';
1307
+
1308
+ export const appConfig: ApplicationConfig = {
1309
+ providers: [
1310
+ provideSolerciaChat({
1311
+ apiBase: '/support/api',
1312
+ textos: { titulo: 'Help' },
1313
+ }),
1314
+ ],
1315
+ };
1316
+ ```
1317
+
1318
+ ```html
1319
+ <sol-chat-flotante
1320
+ [(abierto)]="chatOpen"
1321
+ [lanzador]="true"
1322
+ [contexto]="{ ruta: '/contracts/payment-reports', titulo: 'Payment reports' }"
1323
+ titulo="Assistant"
1324
+ />
1325
+ ```
1326
+
1327
+ `@solercia/chat` is an embeddable assistant: answers streamed over Server-Sent Events, the current
1328
+ screen as optional context, cited sources, conversation history and a floating bubble. It ships the
1329
+ user interface only; the service that answers is separate and implements the API contract below.
1330
+
1331
+ ## Why a separate package
1332
+
1333
+ - Its only peer dependencies are `@angular/core` and `@angular/common` (22.1), so it can be added to
1334
+ applications that do not use `@solercia/ui` yet.
1335
+ - It reads the same `--sol-*` tokens, so inside a Solercia application it follows the tenant theme and
1336
+ dark mode without configuration, and it falls back to its own light and dark palette elsewhere.
1337
+ - It streams with `fetch` and `ReadableStream`; host `HttpClient` interceptors are not involved. Send
1338
+ any header the API needs (XSRF token, authorization) through `cabeceras()`.
1339
+
1340
+ > **Naming note.** The public API uses Spanish identifiers (`contexto`, `titulo`, `cabeceras`) because
1341
+ > the package was born in Spanish-speaking public-sector projects. They are stable API; the English
1342
+ > meaning is given below.
1343
+
1344
+ ## Configuration
1345
+
1346
+ `provideSolerciaChat(config?)` registers `SOLERCIA_CHAT_CONFIG`. To keep the package out of the initial
1347
+ bundle, provide the configuration in the component that uses the chat instead.
1348
+
1349
+ | Field | Meaning | Default |
1350
+ | --- | --- | --- |
1351
+ | `apiBase` | Base URL of the chat API | `'/api'` |
1352
+ | `credentials` | `fetch` credentials mode | `'include'` |
1353
+ | `cabeceras` | Extra request headers, evaluated per request | none |
1354
+ | `textos` | Override any visible text (`Partial<TextosChat>`) | `TEXTOS_CHAT_POR_DEFECTO`, Spanish |
1355
+ | `maxCaracteres` | Maximum question length | `1000` |
1356
+ | `persistir` | Keep the conversation in `sessionStorage` | `true` |
1357
+ | `claveAlmacen` | Storage key; share it to resume a conversation across screens | `'solercia-chat'` |
1358
+ | `maxHistorial` | Previous turns sent to the API | `10` |
1359
+ | `historial` | Enable the saved-conversations list | `false` |
1360
+
1361
+ Default texts are Colombian Spanish; pass `textos` to localize.
1362
+
1363
+ ## Components
1364
+
1365
+ | Component | Use it for | Key inputs and outputs |
1366
+ | --- | --- | --- |
1367
+ | `<sol-chat>` | An inline chat in a page or side panel | `contexto` (screen), `titulo` (title), `subtitulo` (subtitle), `sugerencias` (up to 4 suggested questions), `compacto` (dense), `contraido` (collapsed), `historial`; outputs `respuesta` (answer) and `error` |
1368
+ | `<sol-chat-flotante>` | A floating bubble in the bottom-right corner | `abierto` (open, two-way), `contraido` (minimized, two-way), `lanzador` (launcher button), `conModoCompleto` (full-screen button); outputs `modoCompleto`, `cerrado`, `respuesta`, `error` |
1369
+
1370
+ Only one chat is open at a time: while an inline `<sol-chat>` is mounted, the bubble stays hidden. The
1371
+ context chip can be removed and attached again by the user and travels with the request only while
1372
+ attached.
1373
+
1374
+ ## API contract
1375
+
1376
+ `POST {apiBase}/chat` with `Accept: text/event-stream`:
1377
+
1378
+ ```json
1379
+ {
1380
+ "pregunta": "How do I submit a payment report?",
1381
+ "historial": [{ "rol": "usuario", "texto": "…" }, { "rol": "asistente", "texto": "…" }],
1382
+ "conversacionId": "uuid generated by the browser",
1383
+ "contexto": { "ruta": "/contracts/payment-reports", "titulo": "Payment reports" }
1384
+ }
1385
+ ```
1386
+
1387
+ | Server-Sent Event | Data |
1388
+ | --- | --- |
1389
+ | `fuentes` | Sources retrieved for the answer |
1390
+ | `cola` | Queue position: `posicion`, `esperaEstimadaSegundos` |
1391
+ | `fragmento` | Answer chunk: `texto` |
1392
+ | `fin` | Final answer: `estado`, `respuesta`, `citas`, `documentos`, `casos` |
1393
+ | `error` | Error envelope with `status.appDesc` and `status.appCode` |
1394
+
1395
+ With `historial: true` the chat also calls `GET`, `PATCH` and `DELETE` on `{apiBase}/conversaciones`.
1396
+ The full contract, including history payloads, is in the
1397
+ [`@solercia/chat` README](https://github.com/solercia-solutions/solercia-chat#api-contract).
1398
+
1399
+ ## Rules
1400
+
1401
+ 1. Configure once with `provideSolerciaChat`; do not wrap the API in `HttpClient`.
1402
+ 2. Customize through inputs and `textos`; do not fork templates or style internals.
1403
+ 3. A backend built for the chat implements the API contract exactly, including the event names.
1404
+ 4. Markdown in answers is rendered as an Angular node tree, never through `innerHTML`.
1405
+
1406
+ ---
1407
+
1408
+ <!-- chapter 10: docs/manual/10-for-ai-agents.md -->
1409
+
1410
+ # For AI agents
1411
+
1412
+ ```text
1413
+ Build the "Projects" page with @solercia/ui.
1414
+ Read https://raw.githubusercontent.com/solercia-solutions/solercia-ui/main/llms-full.txt first.
1415
+ Place it in src/pages/projects/ (FSD). Use sol-page-header, sol-data-table and sol-confirm-dialog.
1416
+ Cover loading, empty, no-results, error and success. Style only with var(--sol-*).
1417
+ Texts through i18n keys under pages.projects.*. Run npx eslint on the changed files before finishing.
1418
+ ```
1419
+
1420
+ This chapter is written for two readers: the AI coding agent that generates code with the design
1421
+ system, and the person who prompts it and reviews its output.
1422
+
1423
+ ## What to give an agent
1424
+
1425
+ | Source | Content | When |
1426
+ | --- | --- | --- |
1427
+ | [`llms.txt`](https://github.com/solercia-solutions/solercia-ui/blob/main/llms.txt) | Short index: setup, providers, components by category, rules | Always; it is small. |
1428
+ | [`llms-full.txt`](https://github.com/solercia-solutions/solercia-ui/blob/main/llms-full.txt) | This whole manual plus the complete component reference | Screens that use several components, or a new project. |
1429
+ | `AGENTS.md` of the repository | Repository-specific commands and rules | Changes inside a Solercia repository. |
1430
+ | The matching showcase page in `projects/showcase/src/app/pages/` | A working example | A component the agent has not used before. |
1431
+
1432
+ Both files ship inside the `@solercia/ui` npm package, so an agent can read them from
1433
+ `node_modules/@solercia/ui/` without network access. `@solercia/eslint-config` and `@solercia/chat`
1434
+ ship their own `llms.txt`.
1435
+
1436
+ ## Rules for agents
1437
+
1438
+ 1. **Reuse before you build.** Look up the component list first; do not hand-roll a button, table,
1439
+ modal, date picker or chart that already exists.
1440
+ 2. **Style only with tokens.** `var(--sol-*)` for color, typography, spacing, radius, shadow and
1441
+ motion. No literal colors or fonts, no `!important`, no `::ng-deep`.
1442
+ 3. **Respect required inputs.** Every icon-only control has an `ariaLabel`; `sol-chart` has an
1443
+ `ariaLabelKey`; `sol-empty-state` has a `titleKey`.
1444
+ 4. **Wrap engines, do not import them.** `<sol-chart>` instead of Chart.js; `sol-kanban-*` instead of
1445
+ `@angular/cdk` drag and drop.
1446
+ 5. **Cover every state.** Loading, empty, no results, error and success are part of every screen.
1447
+ 6. **Place files by layer first.** Decide the FSD layer and segment, then write the file. Import slices
1448
+ through their `index.ts`.
1449
+ 7. **Modern Angular only.** Standalone, `OnPush`, `input()` and `output()`, signals, built-in control flow
1450
+ (`@if`, `@for`, `@switch`). Do not add zone.js or NgModules.
1451
+ 8. **Texts through i18n.** Visible texts come from keys or inputs, never hard-coded in shared components.
1452
+ 9. **Never invent APIs.** If an input, output or symbol is not in the reference, it does not exist. Ask,
1453
+ or propose a change to the library instead.
1454
+ 10. **Fix violations at the source.** Do not add `eslint-disable` comments or loosen the config unless the
1455
+ user asks; declare a needed exception in `eslint.config.js` with a reason.
1456
+
1457
+ ## Prompt patterns
1458
+
1459
+ **A new screen**
1460
+
1461
+ ```text
1462
+ Create the <name> page in src/pages/<name>/ using @solercia/ui.
1463
+ Data: <entity> from <endpoint or entity slice>. Actions: <list>.
1464
+ States: loading (skeleton), empty (with create action), no results (clear filters), error (retry).
1465
+ Phone: must work at 390 px. Keyboard: every action reachable.
1466
+ ```
1467
+
1468
+ **A change to an existing screen**
1469
+
1470
+ ```text
1471
+ In <file>, replace the hand-written table with sol-data-table. Keep the current columns and
1472
+ actions. Do not change the API calls. Show the diff and the eslint result.
1473
+ ```
1474
+
1475
+ **A theme**
1476
+
1477
+ ```text
1478
+ Write a ThemeFile for <organization> with primary <color> and secondary <color>.
1479
+ Both light and dark modes. Validate it with isRenderableTheme() in a unit test.
1480
+ ```
1481
+
1482
+ ## Review checklist
1483
+
1484
+ Use it on every change an agent proposes.
1485
+
1486
+ - [ ] Uses existing `sol-*` components; nothing duplicated.
1487
+ - [ ] Every symbol and input exists in the reference.
1488
+ - [ ] No literal colors, fonts, `!important` or `::ng-deep`.
1489
+ - [ ] Files are in the right layer and segment; no deep imports into another slice.
1490
+ - [ ] Loading, empty, no-results, error and success states exist and look right.
1491
+ - [ ] Works at 390 px and with the keyboard; icon-only buttons have `ariaLabel`.
1492
+ - [ ] Texts come from i18n keys or inputs.
1493
+ - [ ] `npx eslint` on the changed files is clean; tests pass.
1494
+
1495
+ ## Definition of done for a screen
1496
+
1497
+ 1. It renders with the default theme and with a tenant theme, in light and dark mode.
1498
+ 2. It handles the five states.
1499
+ 3. It passes lint and its tests.
1500
+ 4. It has no console errors.
1501
+
1502
+ ---
1503
+
1504
+ <!-- chapter 11: docs/manual/11-releases-and-contributing.md -->
1505
+
1506
+ # Releases and contributing
1507
+
1508
+ ```bash
1509
+ # One commit on main = one release
1510
+ npm test && npm run build:showcase
1511
+ git commit -m "feat(solercia): add sol-segmented-progress"
1512
+ git tag v0.9.0
1513
+ git push origin main && git push origin v0.9.0
1514
+ ```
1515
+
1516
+ Every commit that lands on `main` is a release and carries its own version tag. The tag triggers the
1517
+ publish workflow; nobody publishes from a laptop.
1518
+
1519
+ ## The release flow
1520
+
1521
+ ```mermaid
1522
+ flowchart LR
1523
+ A["Change + spec + showcase + docs"] --> B["Bump version<br/>and CHANGELOG"]
1524
+ B --> C["Commit to main"]
1525
+ C --> D["Tag vX.Y.Z"]
1526
+ D --> E["publish.yml<br/>tag = version?"]
1527
+ E -->|yes| F["npm publish<br/>Trusted Publishing + provenance"]
1528
+ E -->|no| G["Fails: fix the tag or the version"]
1529
+ ```
1530
+
1531
+ 1. In the same commit, bump `version` in `projects/solercia/ui/package.json` and add the entry to
1532
+ `projects/solercia/ui/CHANGELOG.md`.
1533
+ 2. Commit, then tag the commit with exactly the library version: `git tag v<version>`.
1534
+ 3. Push the commit and the tag.
1535
+ 4. `.github/workflows/publish.yml` runs the tests, checks that the tag matches the version and publishes
1536
+ to npm only if that version is not published yet.
1537
+
1538
+ An untagged commit on `main` is a defect: tag it before anything else. A pushed tag is never moved or
1539
+ deleted.
1540
+
1541
+ ## Versioning
1542
+
1543
+ The packages follow [Semantic Versioning](https://semver.org/):
1544
+
1545
+ | Change | Bump |
1546
+ | --- | --- |
1547
+ | Fixes, documentation | `patch` |
1548
+ | New components, inputs or outputs | `minor` |
1549
+ | Removing or changing an exported symbol, selector, input or output | `major` |
1550
+
1551
+ While a package is below 1.0, a `minor` version may include breaking changes; the changelog says so
1552
+ explicitly. The changelog follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
1553
+
1554
+ ## Trusted Publishing
1555
+
1556
+ The packages publish with npm Trusted Publishing (OIDC): there is no npm token in the repository or
1557
+ its secrets, and every version carries a provenance statement linking it to the commit and workflow
1558
+ that built it. The Trusted Publisher configured on npmjs.com is organization `solercia-solutions`, the
1559
+ package's repository and workflow `publish.yml`; an `ENEEDAUTH` error means one of the three does not
1560
+ match.
1561
+
1562
+ ## Contributing a change to `@solercia/ui`
1563
+
1564
+ ```bash
1565
+ npm ci
1566
+ npm start # showcase on http://localhost:4200
1567
+ npm test # library + schematics build, then Vitest (zoneless)
1568
+ npm run build:showcase # must pass: CI builds it
1569
+ ```
1570
+
1571
+ A new or changed public component needs, in the same change:
1572
+
1573
+ - [ ] A spec covering its states, keyboard use and accessible names.
1574
+ - [ ] A page or variant in `projects/showcase`.
1575
+ - [ ] Its entry in the README (overview table and reference) and in `llms.txt`.
1576
+ - [ ] The relevant chapter of this manual updated, and `npm run docs:llms` run to regenerate
1577
+ `llms-full.txt` (CI fails when it is out of date).
1578
+ - [ ] New `shared.*` texts in both `i18n/en.json` and `i18n/es-CO.json`.
1579
+
1580
+ Code rules: standalone, `OnPush`, signal inputs and outputs, no zone.js; styles only through
1581
+ `var(--sol-*)`; visible texts through `SOL_I18N` keys or inputs. In specs, create helper templates
1582
+ before the component under test.
1583
+
1584
+ ## Commit messages
1585
+
1586
+ Conventional Commits with scope `solercia`, a header of at most 72 characters in lowercase, and a body
1587
+ of two to four bullets of at most 100 characters. Commits carry no tool or AI attribution.
1588
+
1589
+ ```text
1590
+ fix(solercia): confirm dialog as a bottom sheet on phones
1591
+
1592
+ - opens full width below 640 px with stacked actions and cancel at the bottom
1593
+ - every action reaches the 44 px touch target on touch screens
1594
+ ```
1595
+
1596
+ ## Documentation outputs
1597
+
1598
+ | Command | Produces |
1599
+ | --- | --- |
1600
+ | `npm run docs:site` | The *Guides* pages of the showcase in `projects/showcase/public/docs-content/` (run by `npm start` and `npm run build:showcase`) |
1601
+ | `npm run docs:llms` | `llms-full.txt` at the repository root; `npm run docs:llms:check` fails when it is stale |
1602
+ | `npm run docs:manual` | `dist/manual/solercia-design-system.pdf` and `.docx` (local tool; needs Pandoc and a local Chromium) |
1603
+
1604
+ ---
1605
+
1606
+ <!-- chapter 12: docs/manual/12-faq.md -->
1607
+
1608
+ # FAQ
1609
+
1610
+ ```ts
1611
+ // The smallest working setup: one provider, the bundled theme, English texts.
1612
+ import { ApplicationConfig } from '@angular/core';
1613
+ import { provideTheme } from '@solercia/ui';
1614
+
1615
+ export const appConfig: ApplicationConfig = { providers: [provideTheme()] };
1616
+ ```
1617
+
1618
+ ## Adoption
1619
+
1620
+ **Do I need all three packages?**
1621
+ No. `@solercia/ui` is the only required one. `ng add` installs `@solercia/eslint-config`;
1622
+ `@solercia/chat` is for applications that embed an assistant.
1623
+
1624
+ **Does it need zone.js?**
1625
+ No. The library and the showcase run with `provideZonelessChangeDetection()`, the Angular 22 default.
1626
+
1627
+ **Can I adopt it screen by screen in an existing application?**
1628
+ Yes. Register `provideTheme()`, add the tokens base to `styles.css` and use components in the screens
1629
+ you touch. See [Getting started](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/03-getting-started.md#b-existing-project).
1630
+
1631
+ **Which Angular versions are supported?**
1632
+ Angular 22 (`^22.0.0` peer dependencies).
1633
+
1634
+ ## Theming
1635
+
1636
+ **Where do tenant themes come from?**
1637
+ From your `THEME_SOURCE` implementation: an API, a static file, a database column. The library never
1638
+ fetches a theme itself.
1639
+
1640
+ **What happens if a tenant theme is broken?**
1641
+ `ThemeService` validates every document. An invalid theme, a failed request or a 404 keeps the default
1642
+ theme and logs a console warning; the application never renders unstyled.
1643
+
1644
+ **Is dark mode part of the tenant theme?**
1645
+ Each theme defines both modes, but which mode is active is the user's preference, stored in
1646
+ `localStorage` and toggled with `ThemeService.toggleMode()`.
1647
+
1648
+ **Can I use my own colors in a component?**
1649
+ Use the `--sol-*` tokens. If no token fits, the theme is missing a decision: add it to the theme, not to
1650
+ the component.
1651
+
1652
+ ## Texts and languages
1653
+
1654
+ **Why does a component show a key such as `pages.projects.empty.title`?**
1655
+ The key is missing from your catalog: inputs ending in `Key` receive keys, and an engine returns the
1656
+ key itself when it does not know it. Add the key to your translations.
1657
+
1658
+ **How do I get Spanish texts?**
1659
+ `{ provide: SOL_I18N, useFactory: () => createSolI18n({ lang: 'es-CO' }) }`, or merge
1660
+ `@solercia/ui/i18n/es-CO.json` into your engine's `es-CO` catalog.
1661
+
1662
+ ## Extending
1663
+
1664
+ **The component I need does not exist. What now?**
1665
+ Compose existing components in your application's `shared/ui` or feature first. If the need is
1666
+ general, propose it to the library with a use case; it will get a spec, a showcase page and docs.
1667
+
1668
+ **Can I override a component's internal styles?**
1669
+ No `::ng-deep` and no `!important`. Customize through inputs and the theme tokens a component reads.
1670
+
1671
+ **Can I use Chart.js or the CDK directly?**
1672
+ Not in application code: the lint preset restricts them to the wrappers (`sol-chart`, `sol-kanban-*`)
1673
+ so charts and drag and drop stay themed and accessible.
1674
+
1675
+ ## Documentation
1676
+
1677
+ **Where is the complete list of inputs and outputs?**
1678
+ In the [component reference](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#component-reference) of the README, and live in the
1679
+ showcase.
1680
+
1681
+ **How do I regenerate the PDF and Word manual?**
1682
+ `npm run docs:manual`. It needs Pandoc and a local Chromium; see
1683
+ [Releases and contributing](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/11-releases-and-contributing.md#documentation-outputs).
1684
+
1685
+ **What should an AI agent read?**
1686
+ [`llms-full.txt`](https://github.com/solercia-solutions/solercia-ui/blob/main/llms-full.txt): every chapter and the component reference in one file. See
1687
+ [For AI agents](https://github.com/solercia-solutions/solercia-ui/blob/main/docs/manual/10-for-ai-agents.md).
1688
+
1689
+ ---
1690
+
1691
+ <!-- appendix: README.md, section "Component reference" -->
1692
+
1693
+ # Appendix: component reference
1694
+
1695
+ ### Actions
1696
+
1697
+ #### `sol-button` — `SolButtonComponent`
1698
+ Text button with variants, sizes and a loading state.
1699
+
1700
+ | Input | Type | Default | Req |
1701
+ |---|---|---|---|
1702
+ | `variant` | `'primary' \| 'secondary' \| 'danger' \| 'ghost'` | `'primary'` | |
1703
+ | `size` | `'sm' \| 'md' \| 'lg' \| 'touch'` | `'md'` | |
1704
+ | `disabled` | `boolean` | `false` | |
1705
+ | `type` | `string` | `'button'` | |
1706
+ | `loading` | `boolean` | `false` | |
1707
+
1708
+ Outputs: `clicked: void`. Content: label (`<ng-content>`).
1709
+
1710
+ ```html
1711
+ <sol-button variant="danger" size="sm" [loading]="saving()" (clicked)="remove()">Delete</sol-button>
1712
+ ```
1713
+
1714
+ #### `sol-icon-button` — `SolIconButtonComponent`
1715
+ Icon-only button; `ariaLabel` is mandatory.
1716
+
1717
+ | Input | Type | Default | Req |
1718
+ |---|---|---|---|
1719
+ | `icon` | `SolIconName` | — | yes |
1720
+ | `ariaLabel` | `string` | — | yes |
1721
+ | `type` | `'button' \| 'submit'` | `'button'` | |
1722
+ | `variant` | `'default' \| 'danger' \| 'ghost' \| 'outline'` | `'default'` | |
1723
+ | `size` | `'sm' \| 'md' \| 'lg' \| 'touch'` | `'md'` | |
1724
+ | `disabled` | `boolean` | `false` | |
1725
+
1726
+ Outputs: `clicked: void`.
1727
+
1728
+ ```html
1729
+ <sol-icon-button icon="trash" variant="danger" ariaLabel="Delete project" (clicked)="remove()" />
1730
+ ```
1731
+
1732
+ #### `sol-icon` — `SolIconComponent`
1733
+ Inline SVG from the built-in registry (~140 names: `home`, `menu`, `edit`, `trash`, `calendar`, `bell`, `sun`, `moon`, …; full list in the showcase *Icon* page).
1734
+
1735
+ | Input | Type | Default | Req |
1736
+ |---|---|---|---|
1737
+ | `name` | `SolIconName \| string` | — | yes |
1738
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | |
1739
+ | `variant` | `'outline' \| 'fill'` | `'outline'` | |
1740
+
1741
+ ```html
1742
+ <sol-icon name="star" size="lg" variant="fill" />
1743
+ ```
1744
+
1745
+ ---
1746
+
1747
+ ### Forms
1748
+
1749
+ #### `sol-input` — `SolInputComponent` (CVA, `string`)
1750
+ | Input | Type | Default | Req |
1751
+ |---|---|---|---|
1752
+ | `type` | `string` | `'text'` | |
1753
+ | `placeholder` | `string` | `''` | |
1754
+ | `label` | `string` | `''` | |
1755
+ | `error` | `string` | `''` | |
1756
+ | `disabled` | `boolean` | `false` | |
1757
+ | `autocomplete` | `string \| undefined` | `undefined` | |
1758
+ | `min` | `string \| undefined` | `undefined` | |
1759
+
1760
+ ```html
1761
+ <sol-input label="Email" type="email" autocomplete="email" [(ngModel)]="email" [error]="emailError()" />
1762
+ ```
1763
+
1764
+ #### `sol-textarea` — `SolTextareaComponent` (CVA, `string`)
1765
+ | Input | Type | Default | Req |
1766
+ |---|---|---|---|
1767
+ | `placeholder` | `string` | `''` | |
1768
+ | `label` | `string` | `''` | |
1769
+ | `error` | `string` | `''` | |
1770
+ | `disabled` | `boolean` | `false` | |
1771
+ | `rows` | `number` | `3` | |
1772
+
1773
+ ```html
1774
+ <sol-textarea label="Notes" [rows]="4" formControlName="notes" />
1775
+ ```
1776
+
1777
+ #### `sol-form-field` — `SolFormFieldComponent`
1778
+ Label/hint/error wrapper for any projected control.
1779
+
1780
+ | Input | Type | Default | Req |
1781
+ |---|---|---|---|
1782
+ | `label` | `string` | `''` | |
1783
+ | `error` | `string` | `''` | |
1784
+ | `hint` | `string` | `''` | |
1785
+
1786
+ ```html
1787
+ <sol-form-field label="Website" hint="Include https://"><input formControlName="website" /></sol-form-field>
1788
+ ```
1789
+
1790
+ #### `sol-search-input` — `SolSearchInputComponent`
1791
+ | Input | Type | Default | Req |
1792
+ |---|---|---|---|
1793
+ | `placeholder` | `string` | `shared.searchInput.placeholder` («Search...») | |
1794
+
1795
+ Outputs: `searchChange: string`. (Debounce behavior: not verified.)
1796
+
1797
+ ```html
1798
+ <sol-search-input placeholder="Search projects…" (searchChange)="query.set($event)" />
1799
+ ```
1800
+
1801
+ #### `sol-number-input` — `SolNumberInputComponent` (CVA, `number \| null`)
1802
+ Stepper input with − / + buttons.
1803
+
1804
+ | Input | Type | Default | Req |
1805
+ |---|---|---|---|
1806
+ | `min` | `number` | `0` | |
1807
+ | `max` | `number` | `Number.MAX_SAFE_INTEGER` | |
1808
+ | `step` | `number` | `1` | |
1809
+ | `disabled` | `boolean` | `false` | |
1810
+ | `ariaLabelKey` | `string` (i18n key) | — | yes |
1811
+ | `decrementLabelKey` | `string` | `'shared.numberInput.decrement'` | |
1812
+ | `incrementLabelKey` | `string` | `'shared.numberInput.increment'` | |
1813
+
1814
+ ```html
1815
+ <sol-number-input ariaLabelKey="pages.checkout.seats" [min]="1" [max]="20" [(ngModel)]="seats" />
1816
+ ```
1817
+
1818
+ #### `sol-select` — `SolSelectComponent` (CVA, `string`; `string[]` when `multiple`)
1819
+ Searchable single/multi select; bottom sheet below `mobileBreakpoint`.
1820
+
1821
+ | Input | Type | Default | Req |
1822
+ |---|---|---|---|
1823
+ | `options` | `SolSelectOption[]` (`{ value: string; label: string }`) | `[]` | |
1824
+ | `placeholder` | `string` | `shared.select.placeholder` («Select...») | |
1825
+ | `label` | `string` | `''` | |
1826
+ | `error` | `string` | `''` | |
1827
+ | `disabled` | `boolean` | `false` | |
1828
+ | `searchable` | `boolean` | `true` | |
1829
+ | `multiple` | `boolean` | `false` | |
1830
+ | `showAllOption` | `boolean` | `false` | |
1831
+ | `allOptionLabel` | `string` | `shared.select.all` («All») | |
1832
+ | `ariaLabel` | `string` | `''` | |
1833
+ | `searchPlaceholder` | `string` | `shared.select.searchPlaceholder` («Search...») | |
1834
+ | `emptyLabel` | `string` | `shared.select.empty` («No results») | |
1835
+ | `value` | `string \| null \| undefined` | `undefined` | |
1836
+ | `mobileBreakpoint` | `number` | `640` | |
1837
+
1838
+ Outputs: `valueChange: string`.
1839
+
1840
+ ```html
1841
+ <sol-select label="Country" placeholder="Select a country" searchPlaceholder="Search…" emptyLabel="No results"
1842
+ [options]="[{ value: 'co', label: 'Colombia' }, { value: 'mx', label: 'Mexico' }]" [(ngModel)]="country" />
1843
+ ```
1844
+
1845
+ #### `sol-checkbox` — `SolCheckboxComponent` (CVA, `boolean`)
1846
+ | Input | Type | Default | Req |
1847
+ |---|---|---|---|
1848
+ | `label` | `string` | `''` | |
1849
+ | `disabled` | `boolean` | `false` | |
1850
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | |
1851
+ | `color` | `'primary' \| 'secondary' \| 'success' \| 'danger' \| 'amber' \| 'teal' \| 'indigo' \| 'purple' \| 'pink'` | `'primary'` | |
1852
+ | `shape` | `'rounded' \| 'square' \| 'circle'` | `'rounded'` | |
1853
+ | `ripple` | `boolean` | `true` | |
1854
+ | `icon` | `'check' \| 'minus' \| 'heart' \| 'star'` | `'check'` | |
1855
+ | `linkText` | `string` | `''` | |
1856
+ | `linkHref` | `string` | `''` | |
1857
+
1858
+ Outputs: `changed: boolean`.
1859
+
1860
+ ```html
1861
+ <sol-checkbox label="I accept the" linkText="terms" linkHref="/terms" formControlName="terms" />
1862
+ ```
1863
+
1864
+ #### `sol-toggle` — `SolToggleComponent` (CVA, `boolean`)
1865
+ | Input | Type | Default | Req |
1866
+ |---|---|---|---|
1867
+ | `label` | `string` | `''` | |
1868
+ | `ariaLabel` | `string` | `''` | |
1869
+ | `disabled` | `boolean` | `false` | |
1870
+ | `size` | `'sm' \| 'md'` | `'md'` | |
1871
+ | `onText` | `string \| undefined` | `undefined` | |
1872
+ | `offText` | `string \| undefined` | `undefined` | |
1873
+
1874
+ ```html
1875
+ <sol-toggle label="Email alerts" [(ngModel)]="alerts" />
1876
+ ```
1877
+
1878
+ #### `sol-chip` — `SolChipComponent`
1879
+ Single filter/choice chip.
1880
+
1881
+ | Input | Type | Default | Req |
1882
+ |---|---|---|---|
1883
+ | `value` | `string` | — | yes |
1884
+ | `label` | `string` | — | yes |
1885
+ | `emoji` | `string` | `''` | |
1886
+ | `count` | `number \| null` | `null` | |
1887
+ | `selected` | `boolean` | `false` | |
1888
+ | `disabled` | `boolean` | `false` | |
1889
+ | `size` | `'sm' \| 'md'` | `'md'` | |
1890
+ | `removable` | `boolean` | `false` | |
1891
+ | `role` | `'button' \| 'radio' \| 'checkbox'` | `'button'` | |
1892
+ | `tabIndex` | `number` | `0` | |
1893
+ | `removeLabelKey` | `string` | `'shared.chip.remove'` | |
1894
+
1895
+ Outputs: `toggled: string`, `removed: string` (both emit `value`).
1896
+
1897
+ ```html
1898
+ <sol-chip value="urgent" label="Urgent" emoji="🔥" [count]="3" [selected]="urgent()" (toggled)="toggle($event)" />
1899
+ ```
1900
+
1901
+ #### `sol-chip-group` — `SolChipGroupComponent` (CVA, `string` or `string[]` when `multiple`)
1902
+ | Input | Type | Default | Req |
1903
+ |---|---|---|---|
1904
+ | `options` | `SolChipOption[]` (`{ value, label, emoji?, disabled?, count? }`) | — | yes |
1905
+ | `multiple` | `boolean` | `false` | |
1906
+ | `allowDeselect` | `boolean` | `true` | |
1907
+ | `disabled` | `boolean` | `false` | |
1908
+ | `size` | `'sm' \| 'md'` | `'md'` | |
1909
+ | `removable` | `boolean` | `false` | |
1910
+ | `ariaLabelKey` | `string` (i18n key) | — | yes |
1911
+ | `removeLabelKey` | `string` | `'shared.chip.remove'` | |
1912
+
1913
+ ```html
1914
+ <sol-chip-group ariaLabelKey="pages.projects.categories" [options]="categories" [multiple]="true" [(ngModel)]="selected" />
1915
+ ```
1916
+
1917
+ #### `sol-view-toggle` — `SolViewToggleComponent`
1918
+ Segmented control.
1919
+
1920
+ | Input | Type | Default | Req |
1921
+ |---|---|---|---|
1922
+ | `options` | `SolViewToggleOption[]` (`{ value, label, icon?: SolIconName }`) | — | yes |
1923
+ | `value` | `string` | — | yes |
1924
+
1925
+ Outputs: `valueChange: string`.
1926
+
1927
+ ```html
1928
+ <sol-view-toggle [options]="[{ value: 'list', label: 'List', icon: 'list' }, { value: 'board', label: 'Board', icon: 'view-columns' }]"
1929
+ [value]="view()" (valueChange)="view.set($event)" />
1930
+ ```
1931
+
1932
+ #### `sol-date-picker` — `SolDatePickerComponent` (CVA, `Date \| string \| null`; emits ISO `yyyy-mm-dd`)
1933
+ Calendar popover with day/month/year views.
1934
+
1935
+ | Input | Type | Default | Req |
1936
+ |---|---|---|---|
1937
+ | `value` | `Date \| string \| null` | `null` (assumed) | |
1938
+ | `min` | `Date \| string \| null` | `null` (assumed) | |
1939
+ | `max` | `Date \| string \| null` | `null` (assumed) | |
1940
+ | `placeholder` | `string` | `''` (falls back to `shared.datePicker.placeholder`) | |
1941
+ | `disabled` | `boolean` | `false` | |
1942
+ | `size` | `'sm' \| 'md'` | `'md'` | |
1943
+
1944
+ Outputs: `valueChange: string`.
1945
+
1946
+ ```html
1947
+ <sol-date-picker min="2026-11-24" max="2026-12-24" formControlName="dueDate" />
1948
+ ```
1949
+
1950
+ #### `sol-day-picker` — `SolDayPickerComponent`
1951
+ Horizontal strip of bookable days computed by the host.
1952
+
1953
+ | Input | Type | Default | Req |
1954
+ |---|---|---|---|
1955
+ | `days` | `DayPickerItem[]` (`{ dateStr, dayName, dayNumber, isToday?, isPast }`) | — | yes |
1956
+ | `selectedDate` | `string \| null` | `null` | |
1957
+
1958
+ Outputs: `dateSelected: string`.
1959
+
1960
+ ```html
1961
+ <sol-day-picker [days]="days()" [selectedDate]="date()" (dateSelected)="date.set($event)" />
1962
+ ```
1963
+
1964
+ #### `sol-rating-input` — `SolRatingInputComponent` (CVA, `number \| null`, 1–5)
1965
+ Interactive radiogroup of stars.
1966
+
1967
+ | Input | Type | Default | Req |
1968
+ |---|---|---|---|
1969
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'lg'` | |
1970
+ | `disabled` | `boolean` | `false` | |
1971
+ | `readOnly` | `boolean` | `false` | |
1972
+ | `error` | `string` | `''` | |
1973
+ | `allowClear` | `boolean` | `false` | |
1974
+ | `ariaLabelKey` | `string` | `'shared.ratingInput.groupLabel'` | |
1975
+ | `optionLabelKey` | `string` | `'shared.ratingInput.option'` | |
1976
+ | `clearLabelKey` | `string` | `'shared.ratingInput.clear'` | |
1977
+
1978
+ Outputs: `ratingChanged: number \| null`.
1979
+
1980
+ ```html
1981
+ <sol-rating-input formControlName="rating" [allowClear]="true" (ratingChanged)="save($event)" />
1982
+ ```
1983
+
1984
+ #### `sol-file-upload` — `SolFileUploadComponent`
1985
+ Drag-and-drop image picker with validation and preview.
1986
+
1987
+ | Input | Type | Default | Req |
1988
+ |---|---|---|---|
1989
+ | `accept` | `string` | `'image/jpeg,image/png,image/webp,image/gif'` | |
1990
+ | `maxSizeBytes` | `number` | `5 * 1024 * 1024` | |
1991
+ | `label` | `string` | `shared.fileUpload.label` («Drag or click to upload») | |
1992
+ | `hint` | `string` | `shared.fileUpload.hint` («JPG, PNG, WEBP or GIF · max. 5 MB») | |
1993
+
1994
+ Outputs: `fileSelected: File`, `previewReady: string` (data URL), `fileError: string`, `fileRemoved: void`.
1995
+
1996
+ ```html
1997
+ <sol-file-upload label="Drag your logo here" hint="PNG · max. 200 KB" accept="image/png" [maxSizeBytes]="204800"
1998
+ (fileSelected)="upload($event)" (fileError)="error.set($event)" />
1999
+ ```
2000
+
2001
+ #### `sol-rich-editor` — `SolRichEditorComponent` (CVA, HTML `string`)
2002
+ Rich text editor (headings, lists, alignment, links, tables, images, @mentions, #task links); output HTML is TCPDF-safe.
2003
+
2004
+ | Input | Type | Default | Req |
2005
+ |---|---|---|---|
2006
+ | `placeholder` | `string` | `''` | |
2007
+ | `minHeight` | `string` | `'12rem'` | |
2008
+ | `maxHeight` | `string` | `''` | |
2009
+ | `ariaLabel` | `string` | `''` | |
2010
+ | `disabled` | `boolean` | `false` | |
2011
+ | `imageMaxBytes` | `number` | `5 * 1024 * 1024` | |
2012
+ | `imageUpload` | `SolRichImageUploader \| null` (`(file: File) => Promise<string>`) | `null` | |
2013
+ | `mentionableUsers` | `MentionUser[]` (`{ id, name }`) | `[]` | |
2014
+ | `linkableTasks` | `LinkableTask[]` (`{ key, title }`) | `[]` | |
2015
+
2016
+ Outputs: `valueChange: string`, `mentionsChange: string[]`, `taskLinksChange: string[]`.
2017
+
2018
+ ```html
2019
+ <sol-rich-editor ariaLabel="Description" [imageUpload]="upload" [mentionableUsers]="users" [(ngModel)]="html" />
2020
+ ```
2021
+ ```ts
2022
+ upload: SolRichImageUploader = (file) => this.api.uploadImage(file); // resolves the public URL
2023
+ ```
2024
+
2025
+ ---
2026
+
2027
+ ### Feedback & status
2028
+
2029
+ #### `sol-badge` — `SolBadgeComponent`
2030
+ | Input | Type | Default | Req |
2031
+ |---|---|---|---|
2032
+ | `variant` | `'success' \| 'warning' \| 'danger' \| 'info' \| 'neutral'` | `'neutral'` | |
2033
+ | `size` | `'sm' \| 'md'` | `'sm'` | |
2034
+
2035
+ ```html
2036
+ <sol-badge variant="success">Active</sol-badge>
2037
+ ```
2038
+
2039
+ #### `sol-message-status` — `SolMessageStatusComponent`
2040
+ Delivery ticks with an accessible label.
2041
+
2042
+ | Input | Type | Default | Req |
2043
+ |---|---|---|---|
2044
+ | `status` | `'pending' \| 'sent' \| 'delivered' \| 'read' \| 'failed'` | — | yes |
2045
+
2046
+ ```html
2047
+ <sol-message-status [status]="message.status" />
2048
+ ```
2049
+
2050
+ #### `sol-score-badge` — `SolScoreBadgeComponent`
2051
+ | Input | Type | Default | Req |
2052
+ |---|---|---|---|
2053
+ | `value` | `number \| null` | `null` | |
2054
+ | `max` | `number` | `100` | |
2055
+ | `thresholds` | `readonly SolScoreThreshold[]` (`{ upTo, tone }`) | `DEFAULT_SCORE_THRESHOLDS` (≤50 danger, ≤80 warning, else success) | |
2056
+ | `pending` | `boolean` | `false` | |
2057
+
2058
+ ```html
2059
+ <sol-score-badge [value]="lead.score" />
2060
+ ```
2061
+
2062
+ #### `sol-trend` — `SolTrendComponent`
2063
+ | Input | Type | Default | Req |
2064
+ |---|---|---|---|
2065
+ | `current` | `number` | — | yes |
2066
+ | `previous` | `number \| null` | `null` | |
2067
+ | `invert` | `boolean` | `false` | |
2068
+ | `format` | `(delta: number) => string` | `defaultTrendFormat` | |
2069
+
2070
+ ```html
2071
+ <sol-trend [current]="4" [previous]="6" [invert]="true" /> <!-- lower churn is good -->
2072
+ ```
2073
+
2074
+ #### `sol-avatar` — `SolAvatarComponent`
2075
+ Image or initials on a deterministic palette color.
2076
+
2077
+ | Input | Type | Default | Req |
2078
+ |---|---|---|---|
2079
+ | `name` | `string \| null \| undefined` | — | yes |
2080
+ | `imageUrl` | `string \| null` | `null` | |
2081
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | |
2082
+
2083
+ ```html
2084
+ <sol-avatar [name]="user.fullName" [imageUrl]="user.photo" size="lg" />
2085
+ ```
2086
+
2087
+ #### `sol-star-rating` — `SolStarRatingComponent`
2088
+ Read-only stars (`role="img"`).
2089
+
2090
+ | Input | Type | Default | Req |
2091
+ |---|---|---|---|
2092
+ | `value` | `number \| null` | `null` | |
2093
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'sm'` | |
2094
+ | `showValue` | `boolean` | `false` | |
2095
+
2096
+ ```html
2097
+ <sol-star-rating [value]="4.5" [showValue]="true" />
2098
+ ```
2099
+
2100
+ #### `sol-spinner` — `SolSpinnerComponent`
2101
+ | Input | Type | Default | Req |
2102
+ |---|---|---|---|
2103
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | |
2104
+ | `color` | `string` (CSS color) | `''` (theme primary) | |
2105
+
2106
+ ```html
2107
+ <sol-spinner size="lg" />
2108
+ ```
2109
+
2110
+ #### `sol-skeleton` — `SolSkeletonComponent`
2111
+ | Input | Type | Default | Req |
2112
+ |---|---|---|---|
2113
+ | `variant` | `'text' \| 'title' \| 'stat' \| 'card' \| 'row' \| 'circle' \| 'rounded' \| 'square'` | `'rounded'` | |
2114
+ | `width` | `string` | `''` | |
2115
+ | `height` | `string` | `''` | |
2116
+ | `aspectRatio` | `string` | `''` | |
2117
+ | `count` | `number` (`numberAttribute`) | `1` | |
2118
+
2119
+ ```html
2120
+ <sol-skeleton variant="text" count="3" />
2121
+ ```
2122
+
2123
+ #### `sol-progress-bar` — `SolProgressBarComponent`
2124
+ | Input | Type | Default | Req |
2125
+ |---|---|---|---|
2126
+ | `mode` | `'continuous' \| 'segmented'` | `'continuous'` | |
2127
+ | `value` | `number` | `0` | |
2128
+ | `max` | `number` | `100` | |
2129
+ | `steps` | `number` | `0` | |
2130
+ | `current` | `number` | `0` | |
2131
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | |
2132
+ | `variant` | `'primary' \| 'success' \| 'warning' \| 'danger'` | `'primary'` | |
2133
+ | `showLabel` | `boolean` | `false` | |
2134
+ | `label` | `string` | `''` | |
2135
+ | `ariaLabel` | `string` | `''` | |
2136
+
2137
+ ```html
2138
+ <sol-progress-bar [value]="uploaded()" variant="success" [showLabel]="true" label="Upload" />
2139
+ <sol-progress-bar mode="segmented" [steps]="5" [current]="2" />
2140
+ ```
2141
+
2142
+ #### `sol-empty-state` — `SolEmptyStateComponent`
2143
+ | Input | Type | Default | Req |
2144
+ |---|---|---|---|
2145
+ | `icon` | `SolIconName` | `'list'` | |
2146
+ | `titleKey` | `string` (i18n key) | — | yes |
2147
+ | `descriptionKey` | `string` (i18n key) | `''` | |
2148
+
2149
+ Content: call-to-action (`<ng-content>`).
2150
+
2151
+ ```html
2152
+ <sol-empty-state icon="folder-open" titleKey="pages.projects.empty.title" descriptionKey="pages.projects.empty.description">
2153
+ <sol-button (clicked)="create()">Create project</sol-button>
2154
+ </sol-empty-state>
2155
+ ```
2156
+
2157
+ #### `sol-tooltip` — `SolTooltipComponent`
2158
+ | Input | Type | Default | Req |
2159
+ |---|---|---|---|
2160
+ | `text` | `string` | — | yes |
2161
+
2162
+ ```html
2163
+ <sol-tooltip text="Edit the project"><sol-icon-button icon="edit" ariaLabel="Edit" /></sol-tooltip>
2164
+ ```
2165
+
2166
+ #### `sol-notification-panel` — `SolNotificationPanelComponent`
2167
+ Inbox with loading / error / empty / content states, relative times and unread count.
2168
+
2169
+ | Input | Type | Default | Req |
2170
+ |---|---|---|---|
2171
+ | `items` | `readonly SolNotificationItem[] \| null \| undefined` (`{ id, title, body?, timestamp?, read?, typeLabel?, tone?, data? }`) | `[]` | |
2172
+ | `loading` | `boolean` | `false` | |
2173
+ | `error` | `boolean` | `false` | |
2174
+ | `errorMessage` | `string` | `''` | |
2175
+ | `emptyTitleKey` | `string` | `'shared.notificationPanel.emptyTitle'` | |
2176
+ | `emptyDescriptionKey` | `string` | `'shared.notificationPanel.emptyDescription'` | |
2177
+
2178
+ Outputs: `itemSelected: T`, `markedRead: T`, `markedAllRead: void`, `retryRequested: void`, `closed: void`.
2179
+
2180
+ ```html
2181
+ <sol-notification-panel [items]="notifications()" [loading]="loading()" [error]="failed()"
2182
+ (itemSelected)="open($event)" (markedRead)="markRead($event)" (markedAllRead)="markAll()" (retryRequested)="reload()" (closed)="close()" />
2183
+ ```
2184
+
2185
+ ---
2186
+
2187
+ ### Overlays
2188
+
2189
+ #### `sol-modal` — `SolModalComponent`
2190
+ Host-controlled modal dialog; Escape closes, focus trapped and restored, body scroll locked.
2191
+
2192
+ | Input | Type | Default | Req |
2193
+ |---|---|---|---|
2194
+ | `open` | `boolean` | `false` | |
2195
+ | `title` | `string` | `''` | |
2196
+ | `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | |
2197
+ | `closeable` | `boolean` | `true` | |
2198
+ | `closeOnBackdrop` | `boolean` | `false` | |
2199
+ | `ariaLabel` | `string` | `''` (used only when there is no `title`) | |
2200
+
2201
+ Outputs: `closed: void`. Content: body (single slot; place footer buttons inside). Accessibility: the panel
2202
+ is `role="dialog"` + `aria-modal="true"`, labelled by the title (or `ariaLabel`); focus moves into it on
2203
+ open, Tab/Shift+Tab stay inside, Escape closes when `closeable`, focus returns to the previously focused
2204
+ element and the page scroll is locked while open. The close button reads `shared.modal.close`.
2205
+
2206
+ ```html
2207
+ <sol-modal [open]="open()" title="Invite a teammate" (closed)="open.set(false)">
2208
+ <sol-input label="Email" [(ngModel)]="email" />
2209
+ <sol-button (clicked)="send()">Send invite</sol-button>
2210
+ </sol-modal>
2211
+ ```
2212
+
2213
+ #### `sol-drawer` — `SolDrawerComponent`
2214
+ | Input | Type | Default | Req |
2215
+ |---|---|---|---|
2216
+ | `open` | `boolean` | `false` | |
2217
+ | `title` | `string` | `''` | |
2218
+ | `side` | `'start' \| 'end'` | `'end'` | |
2219
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | |
2220
+ | `variant` | `'panel' \| 'sheet'` | `'panel'` | |
2221
+ | `closeable` | `boolean` | `true` | |
2222
+ | `closeOnBackdrop` | `boolean` | `true` | |
2223
+ | `ariaLabel` | `string` | `''` (used only when there is no `title`) | |
2224
+
2225
+ Outputs: `closed: void`. Content: body + `[drawerFooter]` slot. Same dialog accessibility as `sol-modal`.
2226
+
2227
+ ```html
2228
+ <sol-drawer [open]="filtersOpen()" title="Filters" (closed)="filtersOpen.set(false)">
2229
+ …
2230
+ <div drawerFooter><sol-button (clicked)="apply()">Apply</sol-button></div>
2231
+ </sol-drawer>
2232
+ ```
2233
+
2234
+ #### `sol-confirm-dialog` — `SolConfirmDialogComponent`
2235
+ | Input | Type | Default | Req |
2236
+ |---|---|---|---|
2237
+ | `open` | `boolean` | `false` | |
2238
+ | `title` | `string` | `shared.confirmDialog.title` («Are you sure?») | |
2239
+ | `message` | `string` | `''` | |
2240
+ | `confirmLabel` | `string` | `shared.confirmDialog.confirm` («Confirm») | |
2241
+ | `cancelLabel` | `string` | `shared.confirmDialog.cancel` («Cancel») | |
2242
+ | `variant` | `'danger' \| 'warning' \| 'info'` | `'danger'` | |
2243
+
2244
+ Outputs: `confirm: void`, `cancel: void`. Accessibility: the panel is `role="alertdialog"` +
2245
+ `aria-modal="true"`, labelled by the title and described by the message; focus starts on Cancel (the
2246
+ least destructive action), stays inside, returns to the trigger on close, and the page scroll is locked.
2247
+
2248
+ ```html
2249
+ <sol-confirm-dialog [open]="confirming()" title="Delete this project?" confirmLabel="Delete" cancelLabel="Cancel"
2250
+ (confirm)="remove()" (cancel)="confirming.set(false)" />
2251
+ ```
2252
+
2253
+ ---
2254
+
2255
+ ### Navigation
2256
+
2257
+ #### `sol-tabs` — `SolTabsComponent`
2258
+ Tab list only; the host renders the active panel.
2259
+
2260
+ | Input | Type | Default | Req |
2261
+ |---|---|---|---|
2262
+ | `tabs` | `SolTabItem[]` (`{ id, label, icon? }`) | — | yes |
2263
+ | `activeTab` | `string` | `''` | |
2264
+
2265
+ Outputs: `tabChange: string`.
2266
+
2267
+ ```html
2268
+ <sol-tabs [tabs]="tabs" [activeTab]="tab()" (tabChange)="tab.set($event)" />
2269
+ ```
2270
+
2271
+ #### `sol-pagination` — `SolPaginationComponent`
2272
+ | Input | Type | Default | Req |
2273
+ |---|---|---|---|
2274
+ | `totalItems` | `number` | `0` | |
2275
+ | `pageSize` | `number` | `10` | |
2276
+ | `currentPage` | `number` | `1` | |
2277
+ | `pageSizeOptions` | `number[]` | `[10, 25, 50]` | |
2278
+
2279
+ Outputs: `pageChanged: number`, `pageSizeChanged: number`.
2280
+
2281
+ ```html
2282
+ <sol-pagination [totalItems]="total()" [pageSize]="size()" [currentPage]="page()" (pageChanged)="page.set($event)" (pageSizeChanged)="size.set($event)" />
2283
+ ```
2284
+
2285
+ #### `sol-page-header` — `SolPageHeaderComponent`
2286
+ | Input | Type | Default | Req |
2287
+ |---|---|---|---|
2288
+ | `title` | `string` | — | yes |
2289
+ | `subtitle` | `string` | `''` | |
2290
+
2291
+ Content: actions.
2292
+
2293
+ ```html
2294
+ <sol-page-header title="Projects" subtitle="Manage your portfolio"><sol-button>New project</sol-button></sol-page-header>
2295
+ ```
2296
+
2297
+ #### `sol-stepper` — `SolStepperComponent`
2298
+ | Input | Type | Default | Req |
2299
+ |---|---|---|---|
2300
+ | `steps` | `SolStepperStep[]` (`{ id, labelKey, descriptionKey?, error? }`) | — | yes |
2301
+ | `activeIndex` | `number` | `0` | |
2302
+ | `furthestIndex` | `number \| null` | `null` | |
2303
+ | `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | |
2304
+ | `interactive` | `boolean` | `false` | |
2305
+ | `navigation` | `'linear' \| 'free'` | `'linear'` | |
2306
+ | `ariaLabelKey` | `string` | `'shared.stepper.aria'` | |
2307
+
2308
+ Outputs: `stepSelected: number`.
2309
+
2310
+ ```html
2311
+ <sol-stepper [steps]="steps" [activeIndex]="step()" [interactive]="true" (stepSelected)="step.set($event)" />
2312
+ ```
2313
+
2314
+ #### `sol-wizard` — `SolWizardComponent` + `[solWizardStep]` — `SolWizardStepDirective`
2315
+ Wizard = segmented progress bar + stepper pills + one panel per `*solWizardStep` + Back/Next/Finish footer.
2316
+
2317
+ | Input | Type | Default | Req |
2318
+ |---|---|---|---|
2319
+ | `steps` | `SolWizardStep[]` (`{ id, label?, labelKey?, icon? }`) | — | yes |
2320
+ | `current` | `number` (`model`, use `[(current)]`) | `0` | |
2321
+ | `showProgressBar` | `boolean` | `true` | |
2322
+ | `hidePreviousOnFirst` | `boolean` | `true` | |
2323
+ | `canAdvance` | `boolean \| ((index: number) => boolean)` | `true` | |
2324
+ | `previousLabel` / `nextLabel` / `finishLabel` | `string` | `''` (library defaults; set explicitly for English) | |
2325
+
2326
+ Outputs: `next: void`, `previous: void`, `stepChange: number`, `finish: void`, `currentChange: number`. The directive has no inputs (structural: `*solWizardStep`).
2327
+
2328
+ ```html
2329
+ <sol-wizard [steps]="steps" [(current)]="current" [canAdvance]="canAdvance" nextLabel="Next" previousLabel="Back" finishLabel="Create" (finish)="save()">
2330
+ <ng-container *solWizardStep><sol-input label="Name" [(ngModel)]="name" /></ng-container>
2331
+ <ng-container *solWizardStep>Summary…</ng-container>
2332
+ </sol-wizard>
2333
+ ```
2334
+
2335
+ #### `sol-scope-switcher` — `SolScopeSwitcherComponent`
2336
+ Menu to switch the active organization / workspace / tenant.
2337
+
2338
+ | Input | Type | Default | Req |
2339
+ |---|---|---|---|
2340
+ | `scopes` | `readonly SolScope[]` (`{ id, label, sublabel?, icon?, imageUrl?, data? }`) | `[]` | |
2341
+ | `activeScopeId` | `string \| null \| undefined` | `null` | |
2342
+ | `status` | `'idle' \| 'loading' \| 'error'` | `'idle'` | |
2343
+ | `disabled` | `boolean` | `false` | |
2344
+ | `align` | `'start' \| 'end'` | `'end'` | |
2345
+ | `errorMessage` / `emptyMessage` / `loadingMessage` | `string` | `''` (i18n defaults) | |
2346
+ | `triggerAriaLabel` / `panelAriaLabel` | `string` | `''` (i18n defaults) | |
2347
+
2348
+ Outputs: `scopeSelected: SolScope`, `openChange: boolean`.
2349
+
2350
+ ```html
2351
+ <sol-scope-switcher [scopes]="companies()" [activeScopeId]="activeId()" [status]="status()" (scopeSelected)="switchTo($event)" />
2352
+ ```
2353
+
2354
+ #### `sol-tree` — `SolTreeComponent` + `[solTreeNodeDef]` — `SolTreeNodeDefDirective`
2355
+ Accessible tree (role `tree`), keyboard navigation, max depth 5.
2356
+
2357
+ | Input | Type | Default | Req |
2358
+ |---|---|---|---|
2359
+ | `nodes` | `readonly SolTreeNode[]` (`{ id, label, children?, data? }`) | — | yes |
2360
+ | `expandedIds` | `readonly string[] \| null` (`model`, `[(expandedIds)]`) | `null` | |
2361
+ | `defaultExpandedDepth` | `number` | `1` | |
2362
+ | `maxDepth` | `number` | `SOL_TREE_MAX_DEPTH` (5) | |
2363
+ | `indent` | `number` (px) | `16` | |
2364
+ | `ariaLabel` | `string` | `''` | |
2365
+
2366
+ Outputs: `nodeSelected: SolTreeNode`, `nodeToggled: SolTreeToggleEvent` (`{ node, expanded, expandedIds }`), `expandedIdsChange`.
2367
+ Template context of `solTreeNodeDef`: `$implicit`/`node`, `depth`, `expanded`, `hasChildren` (its `data` is typed `unknown`).
2368
+
2369
+ ```html
2370
+ <sol-tree [nodes]="tree()" [(expandedIds)]="expanded" (nodeSelected)="open($event)">
2371
+ <ng-template solTreeNodeDef let-node let-depth="depth"><span>{{ node.label }}</span></ng-template>
2372
+ </sol-tree>
2373
+ ```
2374
+
2375
+ ---
2376
+
2377
+ ### Layout & motion
2378
+
2379
+ #### `sol-card` — `SolCardComponent`
2380
+ | Input | Type | Default | Req |
2381
+ |---|---|---|---|
2382
+ | `padding` | `boolean` | `true` | |
2383
+ | `hoverable` | `boolean` | `false` | |
2384
+
2385
+ ```html
2386
+ <sol-card [hoverable]="true">…</sol-card>
2387
+ ```
2388
+
2389
+ #### `[solReveal]` — `SolRevealDirective`
2390
+ Entrance animation from the theme motion tokens; respects reduced motion.
2391
+
2392
+ | Input | Type | Default | Req |
2393
+ |---|---|---|---|
2394
+ | `solRevealIndex` | `number` (stagger index) | `0` | |
2395
+ | `solRevealReplay` | `unknown` (change to replay) | `undefined` | |
2396
+
2397
+ ```html
2398
+ @for (item of items(); track item.id; let i = $index) {
2399
+ <sol-card solReveal [solRevealIndex]="i" [solRevealReplay]="filter()">{{ item.name }}</sol-card>
2400
+ }
2401
+ ```
2402
+
2403
+ ---
2404
+
2405
+ ### Data
2406
+
2407
+ #### `sol-data-table` — `SolDataTableComponent`
2408
+ Sorting, per-column filters, global search, pagination, edit/delete actions, row reveal and a collapsed layout below `collapseWidth`.
2409
+
2410
+ | Input | Type | Default | Req |
2411
+ |---|---|---|---|
2412
+ | `data` | `SolDataTableRow[]` (`Record<string, unknown>`) | `[]` | |
2413
+ | `columns` | `DataTableColumn[]` (`{ key, label, sortable?, width?, badge?, filter?: 'text' \| 'select', cellTemplate? }`) | `[]` | |
2414
+ | `loading` | `boolean` | `false` | |
2415
+ | `searchPlaceholder` | `string` | `shared.table.searchPlaceholder` («Search...») | |
2416
+ | `emptyMessage` | `string` | `shared.table.empty` («No data available») | |
2417
+ | `paginated` | `boolean` | `true` | |
2418
+ | `showToolbar` | `boolean` | `true` | |
2419
+ | `filterPosition` | `'left' \| 'right'` | `'left'` | |
2420
+ | `showActions` / `showEditAction` / `showDeleteAction` | `boolean` | `true` | |
2421
+ | `trackByKey` | `string` | `'id'` | |
2422
+ | `actionsLabel` | `string` | `shared.table.actions` («Actions») | |
2423
+ | `actionsPosition` | `'start' \| 'end'` | `'end'` | |
2424
+ | `toggleDetailsLabel` | `string` | `shared.table.toggleDetails` («Show or hide the row details») | |
2425
+ | `rowReveal` | `boolean` | `true` | |
2426
+ | `collapseWidth` | `number` (px) | `767` | |
2427
+ | `variant` | `'clean' \| 'zebra' \| 'bordered' \| 'emphasis-header' \| 'banded' \| null` | `null` (theme) | |
2428
+
2429
+ Outputs: `editClicked: SolDataTableRow`, `deleteClicked: SolDataTableRow`.
2430
+ Content: `[tableFilters]` and `[tableActions]` slots; `<ng-template #rowActions let-row>` replaces the action buttons.
2431
+
2432
+ ```html
2433
+ <sol-data-table [data]="people()" [columns]="columns" searchPlaceholder="Search…" actionsLabel="Actions"
2434
+ (editClicked)="edit($event)" (deleteClicked)="remove($event)">
2435
+ <sol-button tableActions size="sm" (clicked)="create()">New</sol-button>
2436
+ </sol-data-table>
2437
+ ```
2438
+ ```ts
2439
+ columns: DataTableColumn[] = [
2440
+ { key: 'name', label: 'Name', sortable: true, filter: 'text' },
2441
+ { key: 'status', label: 'Status', badge: true, filter: 'select' },
2442
+ ];
2443
+ ```
2444
+
2445
+ #### `sol-virtual-scroll` — `SolVirtualScrollComponent`
2446
+ Windowed list with variable heights; chat-oriented (follows output, loads history at top). Requires an `<ng-template>` child (context `$implicit`, `index`) and a sized container.
2447
+
2448
+ | Input | Type | Default | Req |
2449
+ |---|---|---|---|
2450
+ | `items` | `readonly T[]` | — | yes |
2451
+ | `itemKey` | `(item: T, index: number) => string \| number` | `(_, i) => i` | |
2452
+ | `estimatedItemHeight` | `number` | `56` | |
2453
+ | `bufferPx` | `number` | `240` | |
2454
+ | `followOutput` | `boolean` | `true` | |
2455
+ | `nearTopThreshold` | `number` | `120` | |
2456
+
2457
+ Outputs: `nearTop: void`, `atBottomChange: boolean`.
2458
+
2459
+ ```html
2460
+ <sol-virtual-scroll [items]="messages()" [itemKey]="byId" [estimatedItemHeight]="64" (nearTop)="loadOlder()">
2461
+ <ng-template let-msg let-index="index"><app-message [message]="msg" /></ng-template>
2462
+ </sol-virtual-scroll>
2463
+ ```
2464
+
2465
+ #### `sol-chart` — `SolChartComponent`
2466
+ Chart.js wrapper themed from `--sol-*`; re-renders on light/dark.
2467
+
2468
+ | Input | Type | Default | Req |
2469
+ |---|---|---|---|
2470
+ | `type` | `'line' \| 'bar' \| 'doughnut' \| 'sparkline'` | — | yes |
2471
+ | `data` | `SolChartData` (`{ labels: string[]; series: { label, data: number[], color? }[] }`) | — | yes |
2472
+ | `options` | `SolChartOptions` (`{ legend?, yMax? }`) | `{}` | |
2473
+ | `ariaLabelKey` | `string` (i18n key) | — | yes |
2474
+ | `height` | `string` | `'260px'` | |
2475
+
2476
+ ```html
2477
+ <sol-chart type="line" ariaLabelKey="pages.dashboard.revenue" [data]="{ labels: months, series: [{ label: '2026', data: revenue }] }" />
2478
+ ```
2479
+
2480
+ #### `sol-timeline` — `SolTimelineComponent`
2481
+ Gantt-like hierarchy on a month axis; undated nodes listed apart.
2482
+
2483
+ | Input | Type | Default | Req |
2484
+ |---|---|---|---|
2485
+ | `nodes` | `TimelineNode[]` (`{ id, label?, labelKey?, start?, end?, status?, children?, collapsed? }`) | — | yes |
2486
+ | `statusToken` | `SolTimelineStatusResolver \| null` (`(status) => cssColor`) | `null` (`defaultStatusToken`: done/completed/closed, active/in progress, blocked, at risk, pending) | |
2487
+ | `legend` | `TimelineLegendItem[]` (`{ status, labelKey }`) | `[]` | |
2488
+ | `collapsible` | `boolean` | `true` | |
2489
+
2490
+ Outputs: `nodeToggled: { id, collapsed }`, `nodeClicked: TimelineNode`.
2491
+
2492
+ ```html
2493
+ <sol-timeline [nodes]="plan()" [legend]="[{ status: 'done', labelKey: 'pages.plan.done' }]" (nodeClicked)="open($event)" />
2494
+ ```
2495
+
2496
+ ---
2497
+
2498
+ ### Planning
2499
+
2500
+ #### `sol-kanban-board` — `SolKanbanBoardComponent`
2501
+ Columns with CDK drag and drop (mouse, touch, keyboard “Move to…”), optimistic mirror and `rollback()`.
2502
+
2503
+ | Input | Type | Default | Req |
2504
+ |---|---|---|---|
2505
+ | `columns` | `KanbanColumn<T>[]` (`{ id, title?, titleKey?, items: T[], accent?, droppable?, terminalAnchor? }`) | — | yes |
2506
+ | `cardTemplate` | `TemplateRef<{ $implicit: T; item: T }>` | — | yes |
2507
+ | `headerTemplate` | `TemplateRef<{ $implicit: KanbanColumn }> \| null` | `null` | |
2508
+ | `anchorTemplate` | `TemplateRef<{ $implicit: KanbanColumn }> \| null` (shown when `terminalAnchor`) | `null` | |
2509
+ | `emptyTemplate` | `TemplateRef<unknown> \| null` | `null` | |
2510
+
2511
+ Outputs: `itemMoved: KanbanItemMoved<T>` (`{ item, fromColumnId, toColumnId, previousIndex, currentIndex }`), `columnAction: KanbanColumnAction`, `addRequested: string` (column id), `externalItemDropped: { toColumnId, data }`. Public method: `rollback()`.
2512
+
2513
+ ```html
2514
+ <ng-template #card let-task><p>{{ task.title }}</p></ng-template>
2515
+ <sol-kanban-board #board [columns]="columns()" [cardTemplate]="card" (itemMoved)="persist($event, board)" (addRequested)="create($event)" />
2516
+ ```
2517
+ ```ts
2518
+ async persist(move: KanbanItemMoved<Task>, board: SolKanbanBoardComponent<Task>) {
2519
+ try { await this.api.move(move); } catch { board.rollback(); }
2520
+ }
2521
+ ```
2522
+
2523
+ #### `sol-kanban-column` — `SolKanbanColumnComponent`
2524
+ One column (normally rendered by the board).
2525
+
2526
+ | Input | Type | Default | Req |
2527
+ |---|---|---|---|
2528
+ | `column` | `KanbanColumn<T>` | — | yes |
2529
+ | `cardTemplate` | `TemplateRef<KanbanCardTemplateContext<T>>` | — | yes |
2530
+ | `headerTemplate` / `anchorTemplate` / `emptyTemplate` | as board | `null` | |
2531
+ | `allColumns` | `KanbanColumn<T>[] \| null` (targets for keyboard moves) | `null` | |
2532
+
2533
+ Outputs: `action: KanbanColumnAction`, `dragActiveChanged: boolean`, `itemDropped: KanbanRawDropEvent`.
2534
+
2535
+ ```html
2536
+ <sol-kanban-column [column]="{ id: 'todo', title: 'To do', items: tasks, droppable: false }" [cardTemplate]="card" />
2537
+ ```
2538
+
2539
+ #### `sol-kanban-card` — `SolKanbanCardComponent`
2540
+ | Input | Type | Default | Req |
2541
+ |---|---|---|---|
2542
+ | `item` | `T extends KanbanItem` (`{ id }`) | — | yes |
2543
+ | `cardTemplate` | `TemplateRef<KanbanCardTemplateContext<T>>` | — | yes |
2544
+
2545
+ Outputs: `dragActiveChanged: boolean`.
2546
+
2547
+ ```html
2548
+ <sol-kanban-card [item]="task" [cardTemplate]="card" />
2549
+ ```
2550
+
2551
+ #### `sol-kanban-drag-source` — `SolKanbanDragSourceComponent`
2552
+ External list whose items can be dropped into a board’s columns (board emits `externalItemDropped`).
2553
+
2554
+ | Input | Type | Default | Req |
2555
+ |---|---|---|---|
2556
+ | `items` | `T[]` | — | yes |
2557
+ | `itemTemplate` | `TemplateRef<{ $implicit: T }>` | — | yes |
2558
+ | `connectedTo` | `string[]` (column ids) | `[]` | |
2559
+ | `disabledIds` | `ReadonlySet<string \| number>` | `new Set()` | |
2560
+ | `listId` | `string` | `'sol-kanban-drag-source'` | |
2561
+
2562
+ ```html
2563
+ <sol-kanban-drag-source [items]="backlog()" [connectedTo]="['todo', 'doing']" [itemTemplate]="card" />
2564
+ ```
2565
+
2566
+ #### `sol-calendar` — `SolCalendarComponent`
2567
+ Week/day agenda = header + grid + optional legend.
2568
+
2569
+ | Input | Type | Default | Req |
2570
+ |---|---|---|---|
2571
+ | `events` | `SolCalendarEvent[]` (`{ id, start, end, title, color?, data? }`) | — | yes |
2572
+ | `view` | `'week' \| 'day'` | — | yes |
2573
+ | `currentDate` | `Date` | — | yes |
2574
+ | `eventTemplate` | `TemplateRef<{ $implicit: T; event: T }> \| null` | `null` | |
2575
+ | `legend` | `SolCalendarLegendItem[]` (`{ color, labelKey }`) `\| null` | `null` | |
2576
+
2577
+ Outputs: `eventClicked: T`, `slotClicked: { date: Date; time: string }`. `color` accepts hex, functional colors or `var(--sol-*)`.
2578
+
2579
+ ```html
2580
+ <sol-calendar [events]="appointments()" view="week" [currentDate]="today" (slotClicked)="book($event)" (eventClicked)="open($event)" />
2581
+ ```
2582
+
2583
+ #### `sol-calendar-header` — `SolCalendarHeaderComponent`
2584
+ | Input | Type | Default | Req |
2585
+ |---|---|---|---|
2586
+ | `currentDate` | `Date` | — | yes |
2587
+ | `view` | `'week' \| 'day'` | — | yes |
2588
+
2589
+ Outputs: `dateChange: Date`, `viewChange: SolCalendarView`.
2590
+
2591
+ ```html
2592
+ <sol-calendar-header [currentDate]="date()" [view]="view()" (dateChange)="date.set($event)" (viewChange)="view.set($event)" />
2593
+ ```
2594
+
2595
+ #### `sol-calendar-grid` — `SolCalendarGridComponent`
2596
+ Same inputs/outputs as `sol-calendar` minus `legend`.
2597
+
2598
+ ```html
2599
+ <sol-calendar-grid [events]="events()" view="day" [currentDate]="date()" [eventTemplate]="eventTpl" />
2600
+ ```
2601
+
2602
+ #### `sol-flow-canvas` — `SolFlowCanvasComponent`
2603
+ Pan/zoom node graph: drag nodes, connect ports, keyboard moves with live announcements, “Arrange” auto-layout (dagre, lazy).
2604
+
2605
+ | Input | Type | Default | Req |
2606
+ |---|---|---|---|
2607
+ | `nodes` | `SolFlowCanvasNode[]` (`{ id, label, kind, position: { x, y }, visualState?: 'idle' \| 'running' \| 'ok' \| 'error', badges?, metadata? }`) | `[]` | |
2608
+ | `edges` | `SolFlowCanvasEdge[]` (`{ id, sourceId, targetId, kind: 'condition' \| 'intent' \| 'always', label?, priority? }`) | `[]` | |
2609
+ | `readonly` | `boolean` | `false` | |
2610
+ | `selectedId` | `string \| null` | `null` | |
2611
+ | `highlightedNodeId` | `string \| null` | `null` | |
2612
+ | `nodeTemplate` | `TemplateRef<{ $implicit, node, selected, highlighted }> \| null` | `null` | |
2613
+
2614
+ Outputs: `nodeMoved: { id, position }`, `nodeSelected: { id }`, `connectionCreated: { sourceId, targetId }`, `connectionRemoved: { id }`. The host owns positions and edges.
2615
+
2616
+ ```html
2617
+ <div style="height: 400px">
2618
+ <sol-flow-canvas [nodes]="nodes()" [edges]="edges()" (nodeMoved)="move($event)" (connectionCreated)="connect($event)" />
2619
+ </div>
2620
+ ```
2621
+
2622
+ ---
2623
+
2624
+ ### Secondary entry points (not demoed in the showcase)
2625
+
2626
+ - `@solercia/ui/theme-studio`: `sol-theme-studio`, `sol-theme-studio-preview`, token `THEME_STUDIO_STORE`
2627
+ (host store contract), catalogs `SOL_THEME_STUDIO_I18N_EN` / `SOL_THEME_STUDIO_I18N_ES_CO`, form/theme
2628
+ helpers (`buildThemeFile`, `mapThemeFileToForm`, `parseThemeJson`, …). See `docs/THEME-STUDIO.md`.
2629
+ - `@solercia/ui/login-appearance`: `sol-login-frame`, `sol-login-brand`, `sol-login-scene`, `sol-login-photos`,
2630
+ `sol-login-shapes`, `sol-login-panel-background`, `sol-login-preview`, `sol-login-appearance-editor`, plus
2631
+ `resolveLoginView`, `normalizeLogin`, `normalizeLoginAppearance`, catalogs
2632
+ `SOL_LOGIN_APPEARANCE_I18N_EN` / `SOL_LOGIN_APPEARANCE_I18N_ES_CO`. See [Themed sign-in](https://github.com/solercia-solutions/solercia-ui/blob/main/README.md#themed-sign-in-solerciauilogin-appearance).