shirkasoft-ui-components 1.13.17 → 1.14.0

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.
Files changed (89) hide show
  1. package/README.md +419 -42
  2. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +7 -7
  3. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -1
  4. package/fesm2022/shirkasoft-ui-components-button.mjs +11 -11
  5. package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
  6. package/fesm2022/shirkasoft-ui-components-chart.mjs +6 -6
  7. package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -1
  8. package/fesm2022/shirkasoft-ui-components-config.mjs +914 -0
  9. package/fesm2022/shirkasoft-ui-components-config.mjs.map +1 -0
  10. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +8 -8
  11. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
  12. package/fesm2022/shirkasoft-ui-components-date-picker.mjs +900 -750
  13. package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
  14. package/fesm2022/shirkasoft-ui-components-fieldset.mjs +5 -5
  15. package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -1
  16. package/fesm2022/shirkasoft-ui-components-file-upload.mjs +16 -9
  17. package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
  18. package/fesm2022/shirkasoft-ui-components-icons.mjs +646 -0
  19. package/fesm2022/shirkasoft-ui-components-icons.mjs.map +1 -0
  20. package/fesm2022/shirkasoft-ui-components-knob.mjs +44 -17
  21. package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -1
  22. package/fesm2022/shirkasoft-ui-components-loading.mjs +16 -16
  23. package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
  24. package/fesm2022/shirkasoft-ui-components-modal.mjs +42 -31
  25. package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
  26. package/fesm2022/shirkasoft-ui-components-notification.mjs +8 -8
  27. package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
  28. package/fesm2022/shirkasoft-ui-components-price-input.mjs +79 -29
  29. package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
  30. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +7 -7
  31. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
  32. package/fesm2022/shirkasoft-ui-components-select.mjs +20 -15
  33. package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
  34. package/fesm2022/shirkasoft-ui-components-sidebar.mjs +6 -6
  35. package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -1
  36. package/fesm2022/shirkasoft-ui-components-skeleton.mjs +4 -4
  37. package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -1
  38. package/fesm2022/shirkasoft-ui-components-table.mjs +42 -18
  39. package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
  40. package/fesm2022/shirkasoft-ui-components-tabs.mjs +21 -23
  41. package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
  42. package/fesm2022/shirkasoft-ui-components-tag.mjs +9 -9
  43. package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
  44. package/fesm2022/shirkasoft-ui-components-text-field.mjs +63 -30
  45. package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
  46. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs +280 -0
  47. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs.map +1 -0
  48. package/fesm2022/shirkasoft-ui-components-theme.mjs +180 -0
  49. package/fesm2022/shirkasoft-ui-components-theme.mjs.map +1 -0
  50. package/fesm2022/shirkasoft-ui-components-timeline.mjs +10 -22
  51. package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -1
  52. package/fesm2022/shirkasoft-ui-components-toggle.mjs +56 -49
  53. package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
  54. package/fesm2022/shirkasoft-ui-components-tooltip.mjs +6 -6
  55. package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -1
  56. package/fesm2022/shirkasoft-ui-components-utils.mjs +22 -11
  57. package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
  58. package/fesm2022/shirkasoft-ui-components-wizard.mjs +9 -10
  59. package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -1
  60. package/package.json +33 -3
  61. package/src/baseline.css +2472 -0
  62. package/src/theme.css +15 -543
  63. package/src/themes/ocean.css +56 -0
  64. package/src/themes/sunset.css +55 -0
  65. package/src/themes/violet.css +25 -0
  66. package/src/tokens.css +612 -0
  67. package/types/shirkasoft-ui-components-button.d.ts +1 -1
  68. package/types/shirkasoft-ui-components-config.d.ts +368 -0
  69. package/types/shirkasoft-ui-components-confirm-dialog.d.ts +2 -1
  70. package/types/shirkasoft-ui-components-date-picker.d.ts +273 -231
  71. package/types/shirkasoft-ui-components-fieldset.d.ts +2 -1
  72. package/types/shirkasoft-ui-components-file-upload.d.ts +11 -5
  73. package/types/shirkasoft-ui-components-icons.d.ts +1422 -0
  74. package/types/shirkasoft-ui-components-knob.d.ts +28 -7
  75. package/types/shirkasoft-ui-components-modal.d.ts +11 -7
  76. package/types/shirkasoft-ui-components-notification.d.ts +2 -1
  77. package/types/shirkasoft-ui-components-price-input.d.ts +37 -9
  78. package/types/shirkasoft-ui-components-rail-sidebar.d.ts +3 -3
  79. package/types/shirkasoft-ui-components-select.d.ts +12 -8
  80. package/types/shirkasoft-ui-components-sidebar.d.ts +2 -1
  81. package/types/shirkasoft-ui-components-table.d.ts +25 -14
  82. package/types/shirkasoft-ui-components-tag.d.ts +1 -1
  83. package/types/shirkasoft-ui-components-text-field.d.ts +29 -13
  84. package/types/shirkasoft-ui-components-theme-picker.d.ts +83 -0
  85. package/types/shirkasoft-ui-components-theme.d.ts +88 -0
  86. package/types/shirkasoft-ui-components-timeline.d.ts +5 -4
  87. package/types/shirkasoft-ui-components-toggle.d.ts +20 -13
  88. package/types/shirkasoft-ui-components-utils.d.ts +16 -6
  89. package/types/shirkasoft-ui-components-wizard.d.ts +4 -3
package/README.md CHANGED
@@ -15,37 +15,122 @@
15
15
  <img src="projects/showcase/public/readme.png" alt="Shirkasoft UI Components showcase" />
16
16
  </p>
17
17
 
18
- Angular 21+ UI components library built with **Tailwind CSS**, **standalone components**, **Angular signals**, and **light/dark theme** support via CSS custom properties.
18
+ > **You are reading the `1.x` line (Angular 21).** It ships the same features as
19
+ > `2.x` (Angular 22) — install it with `pnpm add shirkasoft-ui-components@ng21`.
20
+ > Docs: https://ui-library.shirkasoft.com/v1/
21
+
22
+ ## Shirkasoft UI Components 2.0
23
+
24
+ > **La 2.0 ha llegado.** Version 2.0 is built on **Angular 22.3** and drops Tailwind from the library in favor of plain CSS driven by `--shk-*` custom properties. It ships **four color themes**, provider-based configuration and explicit `OnPush` change detection across every component.
25
+
26
+ Angular 22 UI component library built with **standalone components**, **Angular signals**, **pure CSS + CSS custom properties**, and **light/dark theme** support.
27
+
28
+ ### Angular compatibility
29
+
30
+ | Angular version | Library line | npm dist-tag | Docs |
31
+ | --------------- | ------------ | ----------------- | ------------------------------------- |
32
+ | 22.3+ | `2.x` | `latest`, `ng22` | https://ui-library.shirkasoft.com/ |
33
+ | 21.2+ | `1.x` | `ng21` | https://ui-library.shirkasoft.com/v1/ |
34
+
35
+ Both lines get the same features (configuration, theme picker, themes, pure
36
+ CSS…) and fixes; each one is built and tested with its own Angular major. If
37
+ your app is on Angular 21:
38
+
39
+ ```bash
40
+ pnpm add shirkasoft-ui-components@ng21
41
+ ```
19
42
 
20
43
  ## Installation
21
44
 
45
+ There is one release line per Angular major, each with its own npm dist-tag and
46
+ documentation site:
47
+
48
+ | Line | Angular | Install | Docs |
49
+ | ----- | ------- | ------------------------------------------ | --------------------------------------- |
50
+ | `2.x` | 22 | `npm install shirkasoft-ui-components` | https://ui-library.shirkasoft.com/ |
51
+ | `1.x` | 21 | `npm install shirkasoft-ui-components@ng21`| https://ui-library.shirkasoft.com/v1/ |
52
+
22
53
  ```bash
23
- pnpm add shirkasoft-ui-components
24
- # or
25
- npm install shirkasoft-ui-components
54
+ pnpm add shirkasoft-ui-components # Angular 22 (latest / @ng22)
55
+ pnpm add shirkasoft-ui-components@ng21 # Angular 21
26
56
  ```
27
57
 
28
58
  ### Peer Dependencies
29
59
 
30
- | Package | Minimum version |
31
- | ------------------ | --------------- |
32
- | @angular/common | ^21.2.0 |
33
- | @angular/core | ^21.2.0 |
34
- | @angular/forms | ^21.2.0 |
35
- | @angular/router | ^21.2.0 |
36
- | rxjs | ^7.8.0 |
37
- | @jsverse/transloco | >= 8.0.0 |
38
- | @lucide/angular | ^1.17.0 |
39
- | chart.js | ^4.4.0 |
60
+ | Package | Minimum version | Required by |
61
+ | ------------------ | --------------- | ------------------------------- |
62
+ | @angular/common | ^21.2.0 | always |
63
+ | @angular/core | ^21.2.0 | always |
64
+ | @angular/forms | ^21.2.0 | form controls (CVA / Signal Forms) |
65
+ | @angular/router | ^21.2.0 | components that link routes |
66
+ | rxjs | ^7.8.0 | always |
67
+ | @jsverse/transloco | >= 8.0.0 | select, table, date-picker, modal, file-upload… |
68
+ | chart.js | ^4.4.0 | chart |
69
+
70
+ `@jsverse/transloco` and `chart.js` are declared as **optional** peers. Icons
71
+ ship with the library as SVG data, so there is no icon peer to install. The root entry point is empty, so you only pay for (and only
72
+ need to install) the peers of the components you actually import.
73
+
74
+ **Tailwind is not a peer dependency.** The library compiles its own CSS, so consumers do not need Tailwind at all. `theme.css` includes `baseline.css`, a generated plain-CSS snapshot of the layout utilities used by the component templates (regenerate it with `pnpm build:baseline` after touching a template). The showcase site uses Tailwind 4, but that is app code, not part of the published package.
75
+
76
+ ## Icons
77
+
78
+ The library renders Lucide icons from plain SVG data through the
79
+ `shirkasoft-ui-components/icons` entry point. No icon package is required and
80
+ no Angular component is created per icon, which keeps the initial bundle small:
81
+
82
+ ```typescript
83
+ import { ICON_NODES, ShkIconDirective } from 'shirkasoft-ui-components/icons';
84
+
85
+ @Component({ imports: [ShkIconDirective], /* ... */ })
86
+ export class MyComponent {
87
+ protected readonly plus = ICON_NODES.LucidePlus;
88
+ }
89
+ ```
90
+
91
+ ```html
92
+ <svg [shkIcon]="plus" class="w-4 h-4"></svg>
93
+ ```
94
+
95
+ The icons used by the library are exported as data (`LucidePlus`,
96
+ `LucideChevronDown`, …) and also by kebab-case name in `ICON_BY_NAME`. The same
97
+ data can be passed to the `icon` inputs of the components, either directly or
98
+ through `getIcon('plus')` from `shirkasoft-ui-components/utils`. To add a new
99
+ icon, import its `LucideX` name anywhere under `projects/` and run
100
+ `pnpm build:icons`: the entry point is generated from the Lucide sources.
40
101
 
41
102
  ## Theme Setup
42
103
 
43
- Import the theme in your global `styles.css`:
104
+ Import the base theme in your global `styles.css`:
105
+
106
+ ```css
107
+ @import 'shirkasoft-ui-components/theme.css';
108
+ ```
109
+
110
+ `theme.css` is self-contained: it imports `tokens.css` (variables and
111
+ hand-written `_shk-*` utilities) and `baseline.css` (the generated plain-CSS
112
+ snapshot of the Tailwind utilities used by the templates). If your app already
113
+ generates those utilities — for example a Tailwind 4 app that scans the library
114
+ templates — import `tokens.css` instead and avoid shipping the baseline twice.
115
+
116
+ The `_shk-*` utilities live in the CSS layer `shk-tokens`, which must sort
117
+ before your utility layer so the templates' `dark:`/`hover:` variants can
118
+ override them. `theme.css` already declares this order. With `tokens.css` and
119
+ Tailwind 4, declare it yourself before the imports:
44
120
 
45
121
  ```css
46
- @import '@shirkasoft/ui-components/theme.css';
122
+ @layer theme, base, components, shk-tokens, utilities;
123
+ @import 'tailwindcss';
124
+ @import 'shirkasoft-ui-components/tokens.css';
47
125
  ```
48
126
 
127
+ > **Unlayered app CSS wins.** CSS outside any `@layer` always beats layered
128
+ > rules, whatever the specificity. A global reset such as `button { background: none }`
129
+ > or an unlayered framework stylesheet would override the library's `_shk-*`
130
+ > utilities (the generated `baseline.css` utilities already behaved this way).
131
+ > Put such styles in a layer declared before `shk-tokens`, for example
132
+ > `@layer reset, shk-tokens, shk-utilities;` and wrap them in `@layer reset { … }`.
133
+
49
134
  The theme is based on `--shk-*` CSS variables. To customize colors, override the variables in `:root` (light mode) and `.dark` (dark mode):
50
135
 
51
136
  ```css
@@ -56,16 +141,250 @@ The theme is based on `--shk-*` CSS variables. To customize colors, override the
56
141
  }
57
142
  ```
58
143
 
144
+ ### Built-in color themes
145
+
146
+ The default (emerald) palette lives in `theme.css`. Three extra packs are shipped as
147
+ separate files scoped by a `data-shk-theme` attribute:
148
+
149
+ | Theme | Import | Attribute |
150
+ | --------- | --------------------------------------------------------- | -------------------------------- |
151
+ | `default` | `shirkasoft-ui-components/theme.css` | — (no attribute) |
152
+ | `ocean` | `shirkasoft-ui-components/themes/ocean.css` | `data-shk-theme="ocean"` |
153
+ | `violet` | `shirkasoft-ui-components/themes/violet.css` | `data-shk-theme="violet"` |
154
+ | `sunset` | `shirkasoft-ui-components/themes/sunset.css` | `data-shk-theme="sunset"` |
155
+
156
+ ```css
157
+ @import 'shirkasoft-ui-components/theme.css';
158
+ @import 'shirkasoft-ui-components/themes/ocean.css';
159
+ @import 'shirkasoft-ui-components/themes/violet.css';
160
+ @import 'shirkasoft-ui-components/themes/sunset.css';
161
+ ```
162
+
163
+ ```html
164
+ <html data-shk-theme="ocean">
165
+ ```
166
+
167
+ ### Theme service and providers
168
+
169
+ The `shirkasoft-ui-components/theme` entry point exposes `ShkThemeService` and
170
+ `provideShkTheme()`. The service persists the selection in `localStorage`, follows
171
+ `prefers-color-scheme` when the scheme is `system`, and only flips an attribute on
172
+ `<html>` — switching themes never re-renders components. `provideShkTheme()` also
173
+ applies the stored/default theme during app initialization, so it is active even if
174
+ no component injects `ShkThemeService`. It returns `EnvironmentProviders`, so register
175
+ it in the application (or route/environment) providers — not in a component's
176
+ `providers` array.
177
+
178
+ ```typescript
179
+ // app.config.ts
180
+ import { provideShkTheme } from 'shirkasoft-ui-components/theme';
181
+
182
+ export const appConfig: ApplicationConfig = {
183
+ providers: [
184
+ provideShkTheme({
185
+ defaultTheme: 'ocean',
186
+ defaultScheme: 'system',
187
+ persist: true,
188
+ }),
189
+ ],
190
+ };
191
+ ```
192
+
193
+ ```typescript
194
+ import { ShkThemeService } from 'shirkasoft-ui-components/theme';
195
+
196
+ @Component({ /* ... */ })
197
+ export class ThemeSwitcher {
198
+ readonly theme = inject(ShkThemeService);
199
+
200
+ setOcean() { this.theme.setTheme('ocean'); }
201
+ toggleDarkMode() { this.theme.toggleDark(); }
202
+ useSystem() { this.theme.setScheme('system'); }
203
+ }
204
+ ```
205
+
206
+ | Option | Default | Description |
207
+ | ------------------ | ----------------- | ---------------------------------------------- |
208
+ | `defaultTheme` | `'default'` | Theme applied when nothing is stored. |
209
+ | `defaultScheme` | `'system'` | `light`, `dark` or `system`. |
210
+ | `persist` | `true` | Store the selection in `localStorage`. |
211
+ | `storageKey` | `'shk-theme'` | Theme storage key. |
212
+ | `schemeStorageKey` | `'shk-scheme'` | Scheme storage key. |
213
+ | `attribute` | `'data-shk-theme'`| Attribute written on `<html>`. |
214
+ | `darkClass` | `'dark'` | Class toggled on `<html>` for dark mode. |
215
+
59
216
  ### Dark mode
60
217
 
61
- Add the `dark` class to the `<html>` element to enable dark mode.
218
+ Dark mode uses the `.dark` class on `<html>` and inverts `--shk-surface-50..900`.
219
+ `ShkThemeService` handles it for you; without the service, toggle the class manually:
62
220
 
63
221
  ```typescript
64
222
  document.documentElement.classList.toggle('dark');
65
223
  ```
66
224
 
225
+ To avoid a flash of the wrong theme, apply the stored values before first paint:
226
+
227
+ ```html
228
+ <script>
229
+ (function () {
230
+ var scheme = localStorage.getItem('shk-scheme');
231
+ var theme = localStorage.getItem('shk-theme');
232
+ var dark = scheme === 'dark' || (scheme !== 'light' && matchMedia('(prefers-color-scheme: dark)').matches);
233
+ if (dark) document.documentElement.classList.add('dark');
234
+ if (theme && theme !== 'default') document.documentElement.setAttribute('data-shk-theme', theme);
235
+ })();
236
+ </script>
237
+ ```
238
+
67
239
  ---
68
240
 
241
+ ## Configuration (`shirkasoft-ui-components/config`)
242
+
243
+ Library-wide options live in a single **options registry**: every option has a
244
+ key (`dates.format`), a module, a type and a default. Configure the modules you
245
+ need at bootstrap; change any option at runtime and every component that uses it
246
+ updates by itself. Component inputs always win over the configured value.
247
+
248
+ ```typescript
249
+ // app.config.ts
250
+ import {
251
+ provideShk, withDates, withNumbers, withTheme, withOptions, withPersistence,
252
+ } from 'shirkasoft-ui-components/config';
253
+
254
+ export const appConfig: ApplicationConfig = {
255
+ providers: [
256
+ provideShk(
257
+ withDates({ locale: 'es', format: 'dd/MM/yyyy', hourFormat: '24' }),
258
+ withNumbers({ locale: 'es-ES', currency: 'EUR', decimals: 2 }),
259
+ withTheme({
260
+ defaultTheme: 'indigo',
261
+ defaultScheme: 'system',
262
+ themes: { indigo: { primary: '#4f46e5', label: 'Índigo' }, marca: '#0f766e' },
263
+ }),
264
+ withOptions([{ key: 'app.pageSize', module: 'app', type: 'number', default: 20, label: 'Filas' }]),
265
+ withPersistence(), // remembers changed options in localStorage
266
+ ),
267
+ ],
268
+ };
269
+ ```
270
+
271
+ | Module | Options | Used by |
272
+ | --------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------- |
273
+ | `withDates` | `dates.locale` · `dates.format` · `dates.displayStyle` · `dates.hourFormat` · `dates.weekStart` | date picker, table `date` columns |
274
+ | `withNumbers` | `numbers.locale` · `numbers.currency` · `numbers.currencySymbol` · `numbers.decimals` | price input, table `currency` columns |
275
+ | `withTheme` | `theme.name` · `theme.scheme` · `theme.primary` | the whole UI (CSS variables) |
276
+ | `withOptions` | your own keys | your app |
277
+
278
+ Without any configuration the components behave as before: dates `dd/MM/yyyy`
279
+ (`MM/dd/yyyy` for English locales), month names in Spanish, `$` and two decimals.
280
+
281
+ **Runtime changes and settings screens.** `ShkConfigService` is the registry:
282
+
283
+ ```typescript
284
+ const config = inject(ShkConfigService);
285
+
286
+ config.options(); // every option: definition + current value
287
+ config.modules(); // ['dates', 'numbers', 'theme', 'app']
288
+ config.get('dates.format')(); // signal → 'dd/MM/yyyy'
289
+ config.set('numbers.currency', 'CUP'); // validated; invalid values throw
290
+ config.reset('numbers.currency'); // back to the default (or reset() for all)
291
+ ```
292
+
293
+ `set` validates against the definition (type, `choices`, `min`/`max`). Options
294
+ with `allowCustom` (locales, currency codes, date patterns) also accept values
295
+ outside their suggested choices.
296
+
297
+ **Date patterns** (`dates.format`, `Column.dateFormat`): `yyyy y yy` year ·
298
+ `MMMM MMM MM M` month · `dd d` day · `EEEE EEE` weekday · `HH H hh h` hour ·
299
+ `mm` · `ss` · `a` · `'literal'` — the common Angular `DatePipe` tokens, so
300
+ existing column patterns such as `'MMM d, y'` keep working. Table columns also
301
+ accept the Angular named formats `shortDate`, `mediumDate`, `longDate`,
302
+ `fullDate`, `short`, `medium`, `long` and `full`. Month and weekday names keep
303
+ the locale's casing (`31 dic 2026`, `Dec 31, 2026`).
304
+
305
+ **Decimals**: `numbers.decimals` defaults to `null`, meaning the currency's own
306
+ digits (`$1,234.50`, `¥1,000`, `BD 1.500`); set a number to force them. The helpers `formatDate`, `formatCurrency`,
307
+ `formatNumber` and `currencySymbol` are exported for app code too.
308
+
309
+ **Custom themes** are generated from one color with CSS `color-mix()`: the color
310
+ becomes `--shk-primary-600` and the rest of the 50–950 scale is derived. They
311
+ are activated like the built-in ones (`theme.name`, `ShkThemeService.setTheme`).
312
+ `theme.primary` overrides the primary color on top of any theme at runtime.
313
+ `withTheme()` replaces `provideShkTheme()`; do not register both.
314
+
315
+ **Surface palettes** (`theme.surface`): `slate`, `gray`, `zinc`, `neutral`,
316
+ `stone` replace the neutral scale (backgrounds, borders, text) on top of any
317
+ theme, in light and dark mode (`<html data-shk-surface="slate">`).
318
+
319
+ ### Theme picker (`shk-theme-picker`)
320
+
321
+ A palette button that opens a panel to change the theme at runtime: **primary
322
+ color** (`theme.primary`), **surface** (`theme.surface`) and **presets** (the
323
+ theme packs, `theme.name`; picking one clears the color/surface overrides).
324
+ It needs `withTheme()`; add `withPersistence()` to remember the choice.
325
+
326
+ ```typescript
327
+ import { ThemePickerComponent } from 'shirkasoft-ui-components/theme-picker';
328
+ ```
329
+
330
+ ```html
331
+ <shk-theme-picker />
332
+ <!-- custom colors / labels -->
333
+ <shk-theme-picker
334
+ [primaryColors]="[{ color: '#0f766e', label: 'Marca' }, { color: '#2563eb', label: 'Azul' }]"
335
+ [showPresets]="false"
336
+ triggerLabel="Personalizar tema"
337
+ />
338
+ ```
339
+
340
+ | Input | Type | Default |
341
+ | --------------- | ------------------ | ----------------------------------------- |
342
+ | `primaryColors` | `ShkPickerColor[]` | 16 colors (Tailwind 600, no red/rose) |
343
+ | `showSurface` | `boolean` | `true` |
344
+ | `showPresets` | `boolean` | `true` (shown with more than one preset) |
345
+ | `triggerLabel` | `string` | `'Personalizar tema'` |
346
+ | `primaryLabel` | `string` | `'Primario'` |
347
+ | `surfaceLabel` | `string` | `'Superficie'` |
348
+ | `presetsLabel` | `string` | `'Temas'` |
349
+
350
+ ## Signal Forms (Angular 22)
351
+
352
+ The form controls implement the new Angular Signal Forms contracts, so they can
353
+ be bound with `[formField]` in addition to `ControlValueAccessor`:
354
+
355
+ | Component | Contract |
356
+ | ----------- | ----------------------------------- |
357
+ | Knob | `FormValueControl<number>` |
358
+ | Toggle | `FormCheckboxControl` |
359
+ | TextField | `FormValueControl<string>` |
360
+ | Select | `FormValueControl<any>` |
361
+ | DatePicker | `FormValueControl<string \| null>` |
362
+ | PriceInput | `FormValueControl<number \| null>` |
363
+ | FileUpload | `FormValueControl<File[]>` |
364
+
365
+ ```typescript
366
+ import { signal } from '@angular/core';
367
+ import { form, FormField } from '@angular/forms/signals';
368
+
369
+ @Component({
370
+ imports: [FormField, KnobComponent, ToggleComponent],
371
+ /* ... */
372
+ })
373
+ export class VolumeForm {
374
+ model = signal({ volume: 60, notifications: true });
375
+ volumeForm = form(this.model);
376
+ }
377
+ ```
378
+
379
+ ```html
380
+ <shk-knob [formField]="volumeForm.volume" [size]="120" />
381
+ <shk-toggle [formField]="volumeForm.notifications" mode="toggle" label="Notificaciones" />
382
+ ```
383
+
384
+ The contracts are imported with `import type`, so they add **zero runtime cost**
385
+ to the library. Both components keep their `ControlValueAccessor` support for
386
+ reactive and template-driven forms.
387
+
69
388
  ## Components
70
389
 
71
390
  | # | Component | Selector | ControlValueAccessor | Associated service |
@@ -84,12 +403,20 @@ document.documentElement.classList.toggle('dark');
84
403
  | 12 | Tooltip | `shk-tooltip` | — | — |
85
404
  | 13 | Sidebar | `shk-sidebar` | — | — |
86
405
  | 14 | Rail Sidebar | `shk-rail-sidebar` | — | — |
87
- | 15 | Skeleton | `shk-skeleton` | — | — |
88
- | 16 | Tag | `shk-tag` | — | — |
89
- | 17 | Button | `shk-button` | — | — |
90
- | 18 | Knob | `shk-knob` | ✅ | — |
91
- | 19 | Loading | `shk-loading-*` | — | — |
92
- | 20 | Tabs | `shk-tabs` | — | — |
406
+ | 15 | Timeline | `shk-timeline` | — | — |
407
+ | 16 | Fieldset | `shk-fieldset` | — | — |
408
+ | 17 | Wizard | `shk-wizard` | — | — |
409
+ | 18 | Skeleton | `shk-skeleton` | — | — |
410
+ | 19 | Tag | `shk-tag` | — | — |
411
+ | 20 | Button | `shk-button` | — | — |
412
+ | 21 | Knob | `shk-knob` | ✅ | — |
413
+ | 22 | Loading | `shk-loading-*` | — | — |
414
+ | 23 | Tabs | `shk-tabs` | — | — |
415
+ | 24 | Breadcrumb | `shk-breadcrumb` | — | `BreadcrumbService` |
416
+
417
+ All form controls also implement the Signal Forms contracts listed above, on top
418
+ of `ControlValueAccessor` (except `FileUpload`, which exposes `value` and
419
+ `touch` for `[formField]` only).
93
420
 
94
421
  ---
95
422
 
@@ -140,7 +467,8 @@ Text input with support for input, textarea, password, search, credit card forma
140
467
 
141
468
  ### Toggle (`shk-toggle`)
142
469
 
143
- Switch or checkbox. Implements `ControlValueAccessor`.
470
+ Switch or checkbox. Implements `ControlValueAccessor` and the Signal Forms
471
+ `FormCheckboxControl` contract.
144
472
 
145
473
  ```html
146
474
  <shk-toggle
@@ -155,12 +483,13 @@ Switch or checkbox. Implements `ControlValueAccessor`.
155
483
  | ---------- | ------------------------ | ----------- |
156
484
  | `label` | `string` | `''` |
157
485
  | `mode` | `'toggle' \| 'checkbox'` | `'toggle'` |
158
- | `checked` | `boolean` | `undefined` |
486
+ | `checked` | `model<boolean>` | `false` |
159
487
  | `disabled` | `boolean` | `false` |
160
488
 
161
489
  | Output | Type |
162
490
  | --------------- | --------- |
163
491
  | `checkedChange` | `boolean` |
492
+ | `touch` | `void` |
164
493
 
165
494
  ---
166
495
 
@@ -961,6 +1290,10 @@ interface RailSidebarItem {
961
1290
  | `openMenuLabel` | `string` | `'Abrir menú'` |
962
1291
  | `closeMenuLabel` | `string` | `'Cerrar menú'` |
963
1292
 
1293
+ The mobile hamburger uses `z-index: var(--shk-rail-hamburger-z, 1)`, enough to sit
1294
+ above the rail's own content without covering your app's fixed layers. If a positioned
1295
+ sibling covers it, raise it: `shk-rail-sidebar { --shk-rail-hamburger-z: 20; }`.
1296
+
964
1297
  | Output | Type |
965
1298
  | ----------------- | ---------------------- |
966
1299
  | `sectionSelected` | `{ key, routerLink? }` |
@@ -1072,7 +1405,9 @@ type ButtonIconPosition = 'left' | 'right' | 'top' | 'bottom';
1072
1405
 
1073
1406
  ### Knob (`shk-knob`)
1074
1407
 
1075
- SVG radial knob with pointer drag and keyboard (arrow keys) support. Implements `ControlValueAccessor` (reactive forms / `[(ngModel)]`), and also offers `[(value)]`.
1408
+ SVG radial knob with pointer drag and keyboard (arrow keys) support. Implements
1409
+ `ControlValueAccessor` (reactive forms / `[(ngModel)]`), the Signal Forms
1410
+ `FormValueControl<number>` contract, and also offers `[(value)]`.
1076
1411
 
1077
1412
  ```html
1078
1413
  <shk-knob [formControl]="scoreCtrl" [min]="0" [max]="10" [step]="0.5" [size]="120" />
@@ -1082,8 +1417,8 @@ SVG radial knob with pointer drag and keyboard (arrow keys) support. Implements
1082
1417
  | Input | Type | Default |
1083
1418
  | ------------- | --------- | -------------------------------- |
1084
1419
  | `value` | `model<number>` | `0` |
1085
- | `min` | `number` | `0` |
1086
- | `max` | `number` | `100` |
1420
+ | `min` | `number \| undefined` | `0` |
1421
+ | `max` | `number \| undefined` | `100` |
1087
1422
  | `step` | `number` | `1` |
1088
1423
  | `size` | `number` | `100` (px) |
1089
1424
  | `strokeWidth` | `number` | `14` |
@@ -1098,6 +1433,7 @@ SVG radial knob with pointer drag and keyboard (arrow keys) support. Implements
1098
1433
  | -------- | -------- |
1099
1434
  | `change` | `number` |
1100
1435
  | `end` | `number` |
1436
+ | `touch` | `void` |
1101
1437
 
1102
1438
  ---
1103
1439
 
@@ -1197,30 +1533,56 @@ pnpm serve
1197
1533
  # Build the showcase
1198
1534
  pnpm build:showcase
1199
1535
 
1536
+ # Build the showcase + stats and print bundle sizes
1537
+ pnpm build:showcase:stats
1538
+ pnpm measure
1539
+
1540
+ # Regenerate the plain-CSS baseline used by the library templates
1541
+ pnpm build:baseline
1542
+
1543
+ # Regenerate the icon data from the Lucide sources
1544
+ pnpm build:icons
1545
+
1546
+ # Lighthouse audit against the production build (requires Chrome)
1547
+ pnpm lighthouse
1548
+
1200
1549
  # Watch for library changes
1201
1550
  pnpm watch
1202
1551
  ```
1203
1552
 
1204
- ### Versioning
1553
+ `pnpm serve` compiles the library straight from `projects/ui-components`
1554
+ (`projects/showcase/tsconfig.app.dev.json`), so library edits reload instantly
1555
+ and you do not need `pnpm build` or `pnpm watch` while developing. Production
1556
+ showcase builds (`pnpm build:showcase`) still resolve the packaged `dist/`
1557
+ output, so run `pnpm build` first for those.
1205
1558
 
1206
- ```bash
1207
- pnpm version:patch # 1.0.23 → 1.0.24 (creates commit + tag locally)
1208
- pnpm version:minor # 1.0.23 → 1.1.0
1209
- pnpm version:major # 1.0.23 → 2.0.0
1210
- ```
1559
+ ### Versioning and release lines
1211
1560
 
1212
- ### Push code (without publishing)
1561
+ Each supported Angular major has its own branch, npm major, dist-tag and docs:
1213
1562
 
1214
- ```bash
1215
- git push origin main
1216
- ```
1563
+ | Branch | npm | Angular | npm dist-tags | Showcase | Support |
1564
+ | ------ | ---- | ------- | ----------------- | -------- | ---------------------------------------- |
1565
+ | `main` | 2.x | 22 | `latest`, `ng22` | `/` | Active |
1566
+ | `1.x` | 1.x | 21 | `ng21` | `/v1/` | Until Angular 21 reaches end of support |
1217
1567
 
1218
- ### Push code + publish to npm
1568
+ Both lines get the same features and fixes: land a change on one branch and
1569
+ `git cherry-pick` it onto the other (code is kept compatible with both majors).
1570
+ The scripts read the current branch and refuse to cross lines:
1219
1571
 
1220
1572
  ```bash
1221
- git push origin main --tags
1573
+ pnpm version:patch # 2.0.0 → 2.0.1 on main, 1.14.0 → 1.14.1 on 1.x (commit + git tag)
1574
+ pnpm version:minor # 2.0.0 → 2.1.0
1575
+ git push origin <branch> --follow-tags
1222
1576
  ```
1223
1577
 
1578
+ There is no `version:major`: a new Angular major gets a new branch and line.
1579
+
1580
+ ### Performance
1581
+
1582
+ Bundle sizes, the before/after comparison and the measurement methodology live
1583
+ in [PERFORMANCE.md](./PERFORMANCE.md). The showcase is **zoneless**: there is no
1584
+ `zone.js` polyfill, and every component uses `OnPush` + signals.
1585
+
1224
1586
  ---
1225
1587
 
1226
1588
  ## Publishing
@@ -1229,8 +1591,23 @@ git push origin main --tags
1229
1591
 
1230
1592
  | Workflow | Trigger | Description |
1231
1593
  | ------------------- | --------------------------------------------- | ------------------------------------------------------------------------- |
1232
- | **Publish to npm** | Manual (`workflow_dispatch`) or push `v*` tag | Builds library, publishes to npm, builds showcase, deploys to public repo |
1233
- | **Deploy Showcase** | Push to `main`/`master` or manual | Builds library + showcase, deploys to GitHub Pages public repo |
1594
+ | **Publish to npm** | Manual (`workflow_dispatch`) or push `v*` tag | Builds the library and publishes it with its line's dist-tag (`latest`+`ng22` for 2.x, `ng21` for 1.x) |
1595
+ | **Deploy Showcase** | Push to `main` or `1.x`, or manual | Builds the line's showcase and deploys it to its gh-pages folder (`/` or `/v1/`), keeping the other |
1596
+ | **Lighthouse CI** | Pull request or manual | Audits the production build (LCP, CLS, TBT) and fails on regressions |
1597
+
1598
+ The showcase deployment publishes `projects/showcase/public/README.md` next to
1599
+ the site, so the public deploy repository always shows the changelog of the
1600
+ version that is online.
1601
+
1602
+ The workflows need the `NPM_TOKEN` repository secret; the deploy uses the
1603
+ built-in `GITHUB_TOKEN`.
1604
+
1605
+ ### Manual deploy of the showcase
1606
+
1607
+ ```bash
1608
+ pnpm deploy:showcase # builds this line's site and commits it to the local gh-pages branch
1609
+ pnpm deploy:showcase -- --push # … and pushes it
1610
+ ```
1234
1611
 
1235
1612
  ### Manual publish (without GitHub Actions)
1236
1613
 
@@ -26,10 +26,10 @@ class BreadcrumbService {
26
26
  getCurrent() {
27
27
  return this.breadcrumbsSubject.getValue();
28
28
  }
29
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
30
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: BreadcrumbService, providedIn: 'root' }); }
29
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
30
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: BreadcrumbService, providedIn: 'root' }); }
31
31
  }
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: BreadcrumbService, decorators: [{
32
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: BreadcrumbService, decorators: [{
33
33
  type: Injectable,
34
34
  args: [{
35
35
  providedIn: 'root',
@@ -83,8 +83,8 @@ class BreadcrumbComponent {
83
83
  ngOnDestroy() {
84
84
  this.serviceSub?.unsubscribe();
85
85
  }
86
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
87
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: BreadcrumbComponent, isStandalone: true, selector: "shk-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, useService: { classPropertyName: "useService", publicName: "useService", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
86
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
87
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: BreadcrumbComponent, isStandalone: true, selector: "shk-breadcrumb", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, useService: { classPropertyName: "useService", publicName: "useService", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
88
88
  <nav class="shk-breadcrumb" aria-label="Breadcrumb">
89
89
  <ol class="shk-breadcrumb-list">
90
90
  @for (item of resolvedItems(); track $index; let last = $last) {
@@ -136,9 +136,9 @@ class BreadcrumbComponent {
136
136
  </nav>
137
137
  `, isInline: true, styles: [":host{display:block}.shk-breadcrumb-list{display:flex;align-items:center;flex-wrap:wrap;gap:.375rem;list-style:none;margin:0;padding:0;font-size:.9375rem;line-height:1.25rem}.shk-breadcrumb-item{display:inline-flex;align-items:center;gap:.375rem;min-width:0}.shk-breadcrumb-link{color:var(--shk-surface-500);text-decoration:none;transition:color .15s ease;cursor:pointer}.shk-breadcrumb-link:hover{color:var(--shk-primary-600)}.shk-breadcrumb-current{color:var(--shk-primary-700);font-weight:600}.shk-breadcrumb-separator{display:inline-flex;align-items:center;justify-content:center;color:var(--shk-surface-300);-webkit-user-select:none;user-select:none;margin:0 .25rem}.shk-breadcrumb-separator-text{font-size:.875rem}.shk-breadcrumb-separator-icon{width:.875rem;height:.875rem}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
138
138
  }
139
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: BreadcrumbComponent, decorators: [{
139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: BreadcrumbComponent, decorators: [{
140
140
  type: Component,
141
- args: [{ selector: 'shk-breadcrumb', standalone: true, imports: [RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: `
141
+ args: [{ selector: 'shk-breadcrumb', imports: [RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: `
142
142
  <nav class="shk-breadcrumb" aria-label="Breadcrumb">
143
143
  <ol class="shk-breadcrumb-list">
144
144
  @for (item of resolvedItems(); track $index; let last = $last) {