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