@4sh/ui-kit 0.2.0 → 0.3.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 (120) hide show
  1. package/README.fr.md +162 -55
  2. package/README.md +157 -54
  3. package/collection.json +2 -13
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +2 -2
  5. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +2 -2
  7. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +2 -2
  9. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  10. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +48 -8
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  12. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +2 -2
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  14. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +2 -2
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  16. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +2 -2
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  18. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +9 -3
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  20. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +2 -2
  21. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  22. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +4 -5
  23. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  24. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +7 -7
  25. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  26. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +2 -2
  27. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  28. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +2 -2
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +2 -2
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +2 -2
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  34. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +43 -5
  35. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  36. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +2 -2
  37. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  38. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +2 -2
  39. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  40. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +2 -2
  41. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  42. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +2 -2
  43. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  44. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +2 -2
  45. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  46. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +2 -2
  47. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  48. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +2 -2
  49. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  50. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +2 -2
  51. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  52. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +2 -2
  53. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  54. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +2 -2
  55. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  56. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +2 -2
  57. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  58. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +2 -2
  59. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  60. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +2 -2
  61. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  62. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +2 -2
  63. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  64. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +2 -2
  65. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  66. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +2 -2
  67. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  68. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +2 -2
  69. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  70. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +2 -2
  71. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  72. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +2 -2
  73. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  74. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +2 -2
  75. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  76. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +2 -2
  77. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  78. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +2 -2
  79. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  80. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +2 -2
  81. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  82. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +4 -4
  83. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  84. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +2 -2
  85. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  86. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +3 -3
  87. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  88. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +2 -2
  89. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  90. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +2 -2
  91. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  92. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +2 -2
  93. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  94. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +2 -2
  95. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  96. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +2 -2
  97. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  98. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +4 -4
  99. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  100. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +6 -6
  101. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  102. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +4 -4
  103. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  104. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +2 -2
  105. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  106. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2 -2
  107. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  108. package/package.json +1 -4
  109. package/schematics/index.cjs +34 -59
  110. package/styles/component-vars.scss +953 -0
  111. package/styles/generated/_tokens-semantics.scss +36 -0
  112. package/styles/settings/_ui-config.scss +54 -44
  113. package/styles.css +1 -1
  114. package/types/4sh-ui-kit-base-ui-icon.d.ts +35 -4
  115. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +6 -1
  116. package/types/4sh-ui-kit-forms-ui-input.d.ts +33 -2
  117. package/types/4sh-ui-kit-layout-ui-card.d.ts +1 -1
  118. package/schematics/schema-add.json +0 -19
  119. package/schematics/schema-ng-add.json +0 -13
  120. package/schematics/schema-update.json +0 -13
package/README.fr.md CHANGED
@@ -10,6 +10,32 @@ natif (signals + Angular CDK), style piloté par les design tokens.
10
10
 
11
11
  ---
12
12
 
13
+ ## Deux modes de consommation
14
+
15
+ À choisir **avant** d'installer : la décision conditionne toute la suite.
16
+
17
+ | | **dépendance** | **starter** |
18
+ |---|---|---|
19
+ | Installation | `npm install @4sh/ui-kit` | `ng add @4sh/ui-kit-schematics` |
20
+ | Ce qui arrive dans votre dépôt | rien — les composants compilés restent dans `node_modules` | les *sources* des composants, dans `src/app/shared/` |
21
+ | Imports | `@4sh/ui-kit/actions/ui-button` | votre propre chemin (`./shared/components/ui/actions/ui-button`) |
22
+ | Styles | `node_modules/@4sh/ui-kit/styles.css`, chargée globalement | copiés dans `src/styles/`, avec la chaîne de génération des tokens (`npm run tokens:build`) |
23
+ | Documentation | le Storybook lié ci-dessus | la vôtre, sur vos copies (`--with-storybook`) |
24
+ | Personnalisation | inputs + variables CSS | modifier le code lui-même |
25
+ | Mise à jour | bump de version | `ng generate @4sh/ui-kit-schematics:update` — diff par composant, appliquer ou ignorer |
26
+
27
+ **dépendance** est le mode par défaut : rien à maintenir, une seule version à
28
+ suivre, et la garantie que tous les projets affichent le même kit. **starter** —
29
+ l'approche de shadcn/ui ou spartan-ng — échange cette garantie contre la
30
+ possession du code : à choisir quand le projet doit s'écarter du Design System,
31
+ en assumant que les mises à jour deviennent semi-manuelles.
32
+
33
+ Les deux modes décrivent les mêmes composants. **La suite de cette page décrit le
34
+ mode `dépendance`** ; la voie starter a son propre package et son propre README
35
+ (voir [plus bas](#ou-copier-les-sources-à-la-place)).
36
+
37
+ ---
38
+
13
39
  ## Installation
14
40
 
15
41
  ```bash
@@ -19,10 +45,75 @@ npm install @4sh/ui-kit
19
45
  Publié sur le **registre npm public**, organisation **`4sh`** :
20
46
  [npmjs.com/package/@4sh/ui-kit](https://www.npmjs.com/package/@4sh/ui-kit)
21
47
 
22
- Les dépendances sont déclarées en `peerDependencies` — c'est la version déjà
23
- présente dans votre application qui est utilisée (jamais un second exemplaire
24
- d'Angular) : `@angular/core`, `@angular/common`, `@angular/forms`,
25
- `@angular/router`, `@angular/cdk`, `@angular/platform-browser` et `rxjs`.
48
+ | Requiert | |
49
+ |---|---|
50
+ | Angular | `^22.0.0` — `core`, `common`, `forms`, `router`, `platform-browser`, `cdk` |
51
+ | RxJS | `^7.8.0` |
52
+
53
+ Déclarées en `peerDependencies` : c'est la version déjà présente dans votre
54
+ application qui est utilisée, jamais un second exemplaire d'Angular.
55
+
56
+ ### Ou copier les sources à la place
57
+
58
+ Ce package vous donne les composants **compilés** : vous les importez et vous
59
+ suivez les releases du kit. Si vous préférez avoir les sources *dans votre propre
60
+ dépôt*, pour les lire et les modifier — l'approche shadcn/spartan-ng — c'est
61
+ l'autre mode, et il passe par le package compagnon :
62
+
63
+ ```bash
64
+ ng add @4sh/ui-kit-schematics
65
+ ```
66
+
67
+ Il copie les composants que vous choisissez dans `src/app/shared/`, et n'installe
68
+ délibérément **pas** `@4sh/ui-kit` : absent de `node_modules`, plus rien ne peut
69
+ importer son code compilé au lieu de vos copies. Voir
70
+ **[`@4sh/ui-kit-schematics`](https://www.npmjs.com/package/@4sh/ui-kit-schematics)**.
71
+
72
+ Les deux modes ne se combinent pas — choisissez celui qui correspond au projet.
73
+
74
+ ---
75
+
76
+ ## Démarrer
77
+
78
+ Deux étapes, et c'est la seconde qu'on oublie.
79
+
80
+ **1. Chargez la feuille de style du kit, une fois, globalement.** Les composants sont
81
+ **headless** : aucune couleur, taille ni espacement n'est codé en dur — tout est lu
82
+ depuis des variables CSS, et le package les livre.
83
+
84
+ ```jsonc
85
+ // angular.json
86
+ "styles": [
87
+ "node_modules/@4sh/ui-kit/styles.css", // ← tokens + base + typo + motion
88
+ "src/styles/main.scss"
89
+ ]
90
+ ```
91
+
92
+ `styles.css` contient les design tokens (les 3 marques, clair/sombre, responsive), la
93
+ couche de base, les classes typographiques et les presets d'animation de la directive
94
+ `UiMotion`. **Sans elle, les composants s'affichent sans style** — rien ne plante, tout
95
+ est simplement faux visuellement.
96
+
97
+ Les `@font-face` ne sont **pas** inclus : les tokens se contentent de *nommer* les
98
+ familles (`--fontfamily-base`). Livrez vos propres polices et surchargez
99
+ `--fontfamily-*` si besoin.
100
+
101
+ **2. Importez le composant dont vous avez besoin** — et lui seul. Ici le date picker,
102
+ sans tirer le reste du kit dans votre bundle :
103
+
104
+ ```ts
105
+ import { UiDatepicker } from '@4sh/ui-kit/forms/ui-datepicker';
106
+
107
+ @Component({
108
+ selector: 'app-booking',
109
+ imports: [UiDatepicker],
110
+ template: `<ui-datepicker label="Date" valueType="date" [(ngModel)]="date" />`,
111
+ })
112
+ export class Booking { date = signal<Date | null>(null); }
113
+ ```
114
+
115
+ C'est toute l'installation. Deux composants demandent un provider chacun — voir
116
+ [plus bas](#configuration-requise-par-certains-composants) — le reste est optionnel.
26
117
 
27
118
  ---
28
119
 
@@ -96,43 +187,7 @@ n'affiche que ses images distantes (`src`), `name` retombant sur le placeholder.
96
187
 
97
188
  ---
98
189
 
99
- Exemple — n'utiliser que le date picker, sans tirer le reste du kit dans votre bundle :
100
-
101
- ```ts
102
- import { UiDatepicker } from '@4sh/ui-kit/forms/ui-datepicker';
103
-
104
- @Component({
105
- selector: 'app-booking',
106
- imports: [UiDatepicker],
107
- template: `<ui-datepicker label="Date" valueType="date" [(ngModel)]="date" />`,
108
- })
109
- export class Booking { date = signal<Date | null>(null); }
110
- ```
111
-
112
- ---
113
-
114
- ## Styles : charger la feuille du kit
115
-
116
- Les composants sont **headless** : aucune couleur, taille ni espacement n'est
117
- codé en dur — tout est lu depuis des variables CSS. Le package **livre** cette
118
- feuille, à charger **une fois**, globalement :
119
-
120
- ```jsonc
121
- // angular.json
122
- "styles": [
123
- "node_modules/@4sh/ui-kit/styles.css", // ← tokens + base + typo + motion
124
- "src/styles/main.scss"
125
- ]
126
- ```
127
-
128
- `styles.css` contient les design tokens (les 3 marques, clair/sombre,
129
- responsive), la couche de base, les classes typographiques et les presets
130
- d'animation de la directive `UiMotion`. **Sans elle, les composants s'affichent
131
- sans style.**
132
-
133
- Les `@font-face` ne sont **pas** inclus : les tokens se contentent de *nommer*
134
- les familles (`--fontfamily-base`). Livrez vos propres polices et surchargez
135
- `--fontfamily-*` si besoin.
190
+ ## Styles : aller plus loin
136
191
 
137
192
  ### Écrire ses propres styles avec le socle du kit
138
193
 
@@ -155,6 +210,50 @@ les mêmes fonctions, mixins et constantes partagées.
155
210
  > Sass distincte, tout CSS qui y serait exposé serait dupliqué dans chaque
156
211
  > composant. Les classes utilitaires globales sont dans `styles.css`.
157
212
 
213
+ ### Thème, marque et surcharges
214
+
215
+ Le clair/sombre et la marque sont des **attributs sur `<html>`** — rien à importer,
216
+ `styles.css` porte déjà tous les modes :
217
+
218
+ | Attribut | Valeurs | Absent signifie |
219
+ |---|---|---|
220
+ | `data-theme` | `dark` | clair |
221
+ | `data-brand` | `brand2`, `brand3` | marque 1 |
222
+
223
+ ```html
224
+ <html data-theme="dark" data-brand="brand2">
225
+ ```
226
+
227
+ À poser comme vous voulez (un service, du SSR, un flag de build) : le kit ne fait que
228
+ les lire.
229
+
230
+ Pour changer une valeur, trois niveaux, du plus large au plus étroit :
231
+
232
+ ```scss
233
+ // src/styles/main.scss — chargé après styles.css
234
+ @use 'presets/component-vars'; // 2. les valeurs d'un composant
235
+
236
+ :root { --units-lg: 20px; } // 1. un token : tout le kit suit
237
+ :root[data-theme='dark'] { --global-background-default: #101014; }
238
+
239
+ .toolbar ui-button { --ui-button-height-small: 24px; } // 3. une zone de l'écran
240
+ ```
241
+
242
+ 1. **Un token** (`--units-*`, `--radius-*`, `--actions-*`…) — doit venir **après**
243
+ `styles.css`, qui les déclare. Pour une valeur propre à un mode, viser le même
244
+ sélecteur (`:root[data-theme='dark']`).
245
+ 2. **Les valeurs d'un composant** — copier `@4sh/ui-kit/styles/component-vars.scss`
246
+ dans votre `styles/presets/` : toutes les variables `--ui-*` à leur valeur livrée,
247
+ prêtes à retoucher. L'ordre de chargement n'importe pas ici, le kit ne fait que
248
+ *lire* ces noms.
249
+ Les valeurs partagées par toute une famille sont dans le même fichier, en
250
+ `--ui-form-*` / `--ui-control-*` / `--ui-overlay-panel-*` : une seule déclaration
251
+ déplace tous les consommateurs, et une variable de composant reste prioritaire.
252
+ 3. **Une zone** — la même variable `--ui-*` sur n'importe quel sélecteur ou élément.
253
+
254
+ Référence complète (chaque variable, son rôle, sa valeur mesurée) : Storybook →
255
+ *Spécifications → Thème & Système de Tokens*.
256
+
158
257
  ---
159
258
 
160
259
  ## `@4sh/ui-kit/forms` — socle des champs
@@ -195,23 +294,31 @@ export class MyField extends BaseFormField<string> {
195
294
 
196
295
  ---
197
296
 
198
- ## Contribuer (développement dans ce repo)
297
+ ## Accessibilité
199
298
 
200
- ```bash
201
- npm run ui-kit:build # construit le package dans dist/ui-kit
202
- npm run ui-kit:pack # + produit un tarball installable ailleurs
203
- npm run storybook # catalogue des composants (port 6006)
204
- ```
299
+ Si les composants sont headless, c'est précisément parce que le comportement et
300
+ l'accessibilité sont la part que vous ne devriez pas avoir à réécrire :
301
+
302
+ - Éléments natifs (`<button>`, `<a>`, `<input>`) — jamais un `<div>` cliquable.
303
+ - `aria-label` obligatoire en mode icône seule ; les icônes décoratives portent
304
+ `aria-hidden`.
305
+ - `:focus-visible` toujours visible, et distinct de `hover`.
306
+ - `disabled` est l'attribut natif, pas seulement un état visuel.
307
+ - Les composants à overlay (select, menu, modal, drawer…) s'appuient sur le CDK Angular
308
+ pour le piège de focus et la navigation clavier.
309
+
310
+ Chaque story passe axe-core en CI (`@storybook/addon-a11y` + `test-storybook`).
311
+ **Ce contrôle est informatif aujourd'hui** : un reliquat de violations connues reste à
312
+ traiter, à lire donc comme un garde-fou en cours, pas comme une déclaration de conformité.
313
+ Le kit rend l'accessibilité bien plus facile à réussir ; il ne certifie pas vos écrans.
314
+
315
+ ---
205
316
 
206
- Publication : voir [`docs/PUBLISHING.md`](../../docs/PUBLISHING.md) (workflow
207
- GitHub Actions manuel, compte de service `4sh-package-admin`).
317
+ ## Contribuer
208
318
 
209
- ⚠️ **Règle impérative pour les imports internes au package** : toujours utiliser
210
- le nom réel du package (`@4sh/ui-kit/base/ui-icon`), jamais un chemin relatif vers un
211
- autre entry point ni un raccourci. `ng-packagr` ne détecte une dépendance entre
212
- entry points que si l'import commence littéralement par le nom du package ; à
213
- défaut, l'ordre de compilation devient indéterminé et le build échoue par
214
- intermittence.
319
+ Le kit est développé dans le dépôt
320
+ [starter-angular](https://github.com/4sh/starter-angular) — conventions, commandes et
321
+ processus de release y sont documentés.
215
322
 
216
323
  ---
217
324
 
package/README.md CHANGED
@@ -10,6 +10,32 @@ built in natively (signals + Angular CDK), styling driven by design tokens.
10
10
 
11
11
  ---
12
12
 
13
+ ## Two ways to consume the kit
14
+
15
+ Choose **before** installing: the decision shapes everything that follows.
16
+
17
+ | | **dependency** | **starter** |
18
+ |---|---|---|
19
+ | Install | `npm install @4sh/ui-kit` | `ng add @4sh/ui-kit-schematics` |
20
+ | What lands in your repo | nothing — compiled components stay in `node_modules` | the component *sources*, in `src/app/shared/` |
21
+ | Imports | `@4sh/ui-kit/actions/ui-button` | your own path (`./shared/components/ui/actions/ui-button`) |
22
+ | Styles | `node_modules/@4sh/ui-kit/styles.css`, loaded globally | copied into `src/styles/`, with the token generation chain (`npm run tokens:build`) |
23
+ | Documentation | the Storybook linked above | yours, on your own copies (`--with-storybook`) |
24
+ | Customization | inputs + CSS variables | edit the code itself |
25
+ | Updating | bump the version | `ng generate @4sh/ui-kit-schematics:update` — per-component diff, accept or skip |
26
+
27
+ **dependency** is the default: nothing to maintain, one version to follow, and a
28
+ guarantee that every project renders the same kit. **starter** — the shadcn/ui or
29
+ spartan-ng approach — trades that guarantee for ownership of the code: pick it
30
+ when the project needs to diverge from the Design System, and accept that
31
+ updates are then semi-manual.
32
+
33
+ Both modes describe the same components. **The rest of this page describes the
34
+ `dependency` mode**; the starter path has its own package and its own README (see
35
+ [below](#or-copy-the-sources-instead)).
36
+
37
+ ---
38
+
13
39
  ## Installation
14
40
 
15
41
  ```bash
@@ -19,10 +45,73 @@ npm install @4sh/ui-kit
19
45
  Published on the **public npm registry**, under the **`4sh`** organization:
20
46
  [npmjs.com/package/@4sh/ui-kit](https://www.npmjs.com/package/@4sh/ui-kit)
21
47
 
22
- Dependencies are declared as `peerDependencies` — the version already present in
23
- your application is the one used (never a second copy of Angular):
24
- `@angular/core`, `@angular/common`, `@angular/forms`, `@angular/router`,
25
- `@angular/cdk`, `@angular/platform-browser` and `rxjs`.
48
+ | Requires | |
49
+ |---|---|
50
+ | Angular | `^22.0.0` — `core`, `common`, `forms`, `router`, `platform-browser`, `cdk` |
51
+ | RxJS | `^7.8.0` |
52
+
53
+ These are declared as `peerDependencies`: the version already present in your
54
+ application is the one used, never a second copy of Angular.
55
+
56
+ ### Or copy the sources instead
57
+
58
+ This package gives you **compiled** components: you import them and follow the
59
+ kit's releases. If you would rather have the sources *in your own repository*, to
60
+ read and edit them — the shadcn/spartan-ng approach — that is the other mode, and
61
+ it goes through the companion package:
62
+
63
+ ```bash
64
+ ng add @4sh/ui-kit-schematics
65
+ ```
66
+
67
+ It copies the components you pick into `src/app/shared/`, and deliberately does
68
+ **not** install `@4sh/ui-kit`: absent from `node_modules`, nothing can import its
69
+ compiled code instead of your copies. See
70
+ **[`@4sh/ui-kit-schematics`](https://www.npmjs.com/package/@4sh/ui-kit-schematics)**.
71
+
72
+ The two modes do not combine — pick the one that fits the project.
73
+
74
+ ---
75
+
76
+ ## Getting started
77
+
78
+ Two steps, and the second one is the one people forget.
79
+
80
+ **1. Load the kit's stylesheet, once, globally.** The components are **headless**: no
81
+ color, size or spacing is hardcoded — everything is read from CSS variables, and the
82
+ package ships them.
83
+
84
+ ```jsonc
85
+ // angular.json
86
+ "styles": [
87
+ "node_modules/@4sh/ui-kit/styles.css", // ← tokens + base + typography + motion
88
+ "src/styles/main.scss"
89
+ ]
90
+ ```
91
+
92
+ `styles.css` contains the design tokens (all 3 brands, light/dark, responsive), the base
93
+ layer, the typography classes and the animation presets of the `UiMotion` directive.
94
+ **Without it, components render unstyled** — nothing errors, everything just looks wrong.
95
+
96
+ `@font-face` rules are **not** included: the tokens merely *name* the families
97
+ (`--fontfamily-base`). Ship your own fonts and override `--fontfamily-*` if needed.
98
+
99
+ **2. Import the component you need** — and only that one. Here, the date picker, without
100
+ pulling the rest of the kit into your bundle:
101
+
102
+ ```ts
103
+ import { UiDatepicker } from '@4sh/ui-kit/forms/ui-datepicker';
104
+
105
+ @Component({
106
+ selector: 'app-booking',
107
+ imports: [UiDatepicker],
108
+ template: `<ui-datepicker label="Date" valueType="date" [(ngModel)]="date" />`,
109
+ })
110
+ export class Booking { date = signal<Date | null>(null); }
111
+ ```
112
+
113
+ That is the whole setup. Two components need one provider each — see
114
+ [below](#configuration-required-by-some-components) — and everything else is opt-in.
26
115
 
27
116
  ---
28
117
 
@@ -97,43 +186,7 @@ placeholder.
97
186
 
98
187
  ---
99
188
 
100
- Example — using only the date picker, without pulling the rest of the kit into
101
- your bundle:
102
-
103
- ```ts
104
- import { UiDatepicker } from '@4sh/ui-kit/forms/ui-datepicker';
105
-
106
- @Component({
107
- selector: 'app-booking',
108
- imports: [UiDatepicker],
109
- template: `<ui-datepicker label="Date" valueType="date" [(ngModel)]="date" />`,
110
- })
111
- export class Booking { date = signal<Date | null>(null); }
112
- ```
113
-
114
- ---
115
-
116
- ## Styles: loading the kit's stylesheet
117
-
118
- The components are **headless**: no color, size or spacing is hardcoded —
119
- everything is read from CSS variables. The package **ships** that stylesheet,
120
- to be loaded **once**, globally:
121
-
122
- ```jsonc
123
- // angular.json
124
- "styles": [
125
- "node_modules/@4sh/ui-kit/styles.css", // ← tokens + base + typography + motion
126
- "src/styles/main.scss"
127
- ]
128
- ```
129
-
130
- `styles.css` contains the design tokens (all 3 brands, light/dark, responsive),
131
- the base layer, the typography classes and the animation presets of the
132
- `UiMotion` directive. **Without it, components render unstyled.**
133
-
134
- `@font-face` rules are **not** included: the tokens merely *name* the families
135
- (`--fontfamily-base`). Ship your own fonts and override `--fontfamily-*` if
136
- needed.
189
+ ## Styles: going further
137
190
 
138
191
  ### Writing your own styles on the kit's foundation
139
192
 
@@ -156,6 +209,48 @@ shared functions, mixins and constants.
156
209
  > CSS exposed there would be duplicated into every component. The global utility
157
210
  > classes live in `styles.css`.
158
211
 
212
+ ### Theme, brand and overrides
213
+
214
+ Light/dark and brand are **attributes on `<html>`** — nothing to import, `styles.css`
215
+ already carries every mode:
216
+
217
+ | Attribute | Values | Absent means |
218
+ |---|---|---|
219
+ | `data-theme` | `dark` | light |
220
+ | `data-brand` | `brand2`, `brand3` | brand 1 |
221
+
222
+ ```html
223
+ <html data-theme="dark" data-brand="brand2">
224
+ ```
225
+
226
+ Set them however suits you (a service, SSR, a build flag): the kit only reads them.
227
+
228
+ To change a value, three levels, from the broadest to the narrowest:
229
+
230
+ ```scss
231
+ // src/styles/main.scss — loaded after styles.css
232
+ @use 'presets/component-vars'; // 2. one component's values
233
+
234
+ :root { --units-lg: 20px; } // 1. a token: the whole kit follows
235
+ :root[data-theme='dark'] { --global-background-default: #101014; }
236
+
237
+ .toolbar ui-button { --ui-button-height-small: 24px; } // 3. one area of the screen
238
+ ```
239
+
240
+ 1. **A token** (`--units-*`, `--radius-*`, `--actions-*`…) — must come **after**
241
+ `styles.css`, which declares them. For a mode-specific value, match the same
242
+ selector (`:root[data-theme='dark']`).
243
+ 2. **A component's values** — copy `@4sh/ui-kit/styles/component-vars.scss` into your
244
+ `styles/presets/`: every `--ui-*` variable at its shipped value, ready to retune.
245
+ Load order is irrelevant here, the kit only *reads* these names.
246
+ Values shared by a whole family live in the same file under `--ui-form-*` /
247
+ `--ui-control-*` / `--ui-overlay-panel-*`: one declaration moves every consumer,
248
+ and a component-level variable still wins over it.
249
+ 3. **One area** — the same `--ui-*` on any selector or element.
250
+
251
+ Full reference (every variable, its role and its measured value): Storybook →
252
+ *Spécifications → Thème & Système de Tokens*.
253
+
159
254
  ---
160
255
 
161
256
  ## `@4sh/ui-kit/forms` — form field foundation
@@ -196,22 +291,30 @@ export class MyField extends BaseFormField<string> {
196
291
 
197
292
  ---
198
293
 
199
- ## Contributing (development inside this repo)
294
+ ## Accessibility
200
295
 
201
- ```bash
202
- npm run ui-kit:build # builds the package into dist/ui-kit
203
- npm run ui-kit:pack # + produces a tarball installable elsewhere
204
- npm run storybook # component catalogue (port 6006)
205
- ```
296
+ The reason the components are headless is that behaviour and accessibility are the part
297
+ you should not have to rewrite:
298
+
299
+ - Native elements (`<button>`, `<a>`, `<input>`) — never a clickable `<div>`.
300
+ - `aria-label` required in icon-only mode; decorative icons carry `aria-hidden`.
301
+ - `:focus-visible` always visible, and distinct from `hover`.
302
+ - `disabled` is the native attribute, not just a visual state.
303
+ - Overlay components (select, menu, modal, drawer…) use the Angular CDK for focus
304
+ trapping and keyboard navigation.
305
+
306
+ Every story runs through axe-core in CI (`@storybook/addon-a11y` + `test-storybook`).
307
+ **That check is informational today**: a backlog of known violations is still being worked
308
+ through, so read it as a guardrail in progress, not as a conformance claim. The kit makes
309
+ accessibility much easier to get right; it does not certify your screens.
310
+
311
+ ---
206
312
 
207
- Publishing: see [`docs/PUBLISHING.md`](../../docs/PUBLISHING.md) (manual GitHub
208
- Actions workflow, `4sh-package-admin` service account).
313
+ ## Contributing
209
314
 
210
- ⚠️ **Hard rule for imports internal to the package**: always use the real
211
- package name (`@4sh/ui-kit/base/ui-icon`), never a relative path to another entry
212
- point nor a shortcut. `ng-packagr` only detects a dependency between entry
213
- points if the import literally starts with the package name; otherwise the
214
- compilation order becomes undefined and the build fails intermittently.
315
+ The kit is developed in the
316
+ [starter-angular](https://github.com/4sh/starter-angular) repository — conventions,
317
+ commands and release flow are documented there.
215
318
 
216
319
  ---
217
320
 
package/collection.json CHANGED
@@ -2,19 +2,8 @@
2
2
  "$schema": "../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
3
  "schematics": {
4
4
  "ng-add": {
5
- "description": "Prépare le projet : installe @4sh/ui-kit-schematics puis lance sa fondation (styles, tokens, angular.json).",
6
- "factory": "./schematics/index.cjs#ngAdd",
7
- "schema": "./schematics/schema-ng-add.json"
8
- },
9
- "add": {
10
- "description": "Copie un ou plusieurs composants ui-* (et leurs dépendances) dans le projet.",
11
- "factory": "./schematics/index.cjs#add",
12
- "schema": "./schematics/schema-add.json"
13
- },
14
- "update": {
15
- "description": "Compare les composants déjà copiés à la version installée du kit et propose de les mettre à jour.",
16
- "factory": "./schematics/index.cjs#update",
17
- "schema": "./schematics/schema-update.json"
5
+ "description": "Installe le kit en mode librairie. Pour copier les sources : ng add @4sh/ui-kit-schematics.",
6
+ "factory": "./schematics/index.cjs#ngAdd"
18
7
  }
19
8
  }
20
9
  }
@@ -132,11 +132,11 @@ class UiButtonSplit {
132
132
  this.menu()?.toggle(event);
133
133
  }
134
134
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: UiButtonSplit, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
135
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.1", type: UiButtonSplit, isStandalone: true, selector: "ui-button-split", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconPos: { classPropertyName: "iconPos", publicName: "iconPos", isSignal: true, isRequired: false, transformFunction: null }, dropdownIcon: { classPropertyName: "dropdownIcon", publicName: "dropdownIcon", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, onColor: { classPropertyName: "onColor", publicName: "onColor", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "buttonDisabled", isSignal: true, isRequired: false, transformFunction: null }, menuButtonDisabled: { classPropertyName: "menuButtonDisabled", publicName: "menuButtonDisabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, menuButtonAriaLabel: { classPropertyName: "menuButtonAriaLabel", publicName: "menuButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, menuAriaLabel: { classPropertyName: "menuAriaLabel", publicName: "menuAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, menuLevel: { classPropertyName: "menuLevel", publicName: "menuLevel", isSignal: true, isRequired: false, transformFunction: null }, menuStyleClass: { classPropertyName: "menuStyleClass", publicName: "menuStyleClass", isSignal: true, isRequired: false, transformFunction: null }, autoFlip: { classPropertyName: "autoFlip", publicName: "autoFlip", isSignal: true, isRequired: false, transformFunction: null }, motion: { classPropertyName: "motion", publicName: "motion", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, buttonProps: { classPropertyName: "buttonProps", publicName: "buttonProps", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { buttonClick: "buttonClick", dropdownClick: "dropdownClick", menuShow: "menuShow", menuHide: "menuHide", itemClick: "itemClick" }, viewQueries: [{ propertyName: "actionButton", first: true, predicate: ["action"], descendants: true, isSignal: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"classes()\">\n <!-- Default action -->\n <ui-button\n #action\n class=\"ui-button-split-action\"\n [label]=\"label()\"\n [ariaLabel]=\"ariaLabel()\"\n [icon]=\"icon()\"\n [iconPos]=\"iconPos()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [disabled]=\"actionDisabled()\"\n [tabindex]=\"tabindex()\"\n [buttonProps]=\"buttonProps()\"\n (buttonClick)=\"onButtonClick($event)\"\n >\n <ng-content />\n </ui-button>\n\n <!-- Dropdown trigger -->\n <ui-button\n class=\"ui-button-split-trigger\"\n [icon]=\"dropdownIcon()\"\n [ariaLabel]=\"menuButtonAriaLabel()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [disabled]=\"triggerDisabled()\"\n iconOnly\n [buttonProps]=\"{ 'aria-haspopup': 'menu', 'aria-expanded': menuOpen() ? 'true' : 'false', 'aria-controls': menu.uid }\"\n (buttonClick)=\"onDropdownClick($event)\"\n />\n\n <!-- Options popup (anchored to the trigger) -->\n <ui-menu\n #menu\n popup\n [items]=\"model()\"\n [level]=\"menuLevel()\"\n [size]=\"menuSize()\"\n [motion]=\"motion()\"\n [autoFlip]=\"autoFlip()\"\n [ariaLabel]=\"menuAriaLabel()\"\n [styleClass]=\"menuStyleClass()\"\n (opened)=\"menuOpen.set(true); menuShow.emit()\"\n (closed)=\"menuOpen.set(false); menuHide.emit()\"\n (itemClick)=\"itemClick.emit($event)\"\n />\n</div>\n", styles: [".ui-button-split{display:inline-flex;align-items:stretch}.ui-button-split-action,.ui-button-split-trigger{position:relative}.ui-button-split-action:hover,.ui-button-split-action:focus-within,.ui-button-split-trigger:hover,.ui-button-split-trigger:focus-within{z-index:1}.ui-button-split-action{--ui-button-radius: var(--radius-sm) 0 0 var(--radius-sm)}.ui-button-split-trigger{--ui-button-radius: 0 var(--radius-sm) var(--radius-sm) 0;margin-left:calc(-1 * var(--stroke-default))}\n"], dependencies: [{ kind: "component", type: UiButton, selector: "ui-button", inputs: ["label", "ariaLabel", "type", "level", "variant", "onColor", "size", "icon", "iconPos", "iconOnly", "loading", "loadingIcon", "expanded", "rounded", "disabled", "tabindex", "buttonProps", "iconTemplate", "loadingIconTemplate", "href", "routerLink", "target", "rel"], outputs: ["buttonClick", "buttonFocus", "buttonBlur"] }, { kind: "component", type: UiMenu, selector: "ui-menu", inputs: ["items", "popup", "expandedKeys", "ariaLabel", "ariaLabelledBy", "styleClass", "level", "size", "submenus", "motion", "autoFlip", "tabindex", "itemTemplate", "submenuHeaderTemplate"], outputs: ["expandedKeysChange", "opened", "closed", "itemClick"] }] }); }
135
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.1", type: UiButtonSplit, isStandalone: true, selector: "ui-button-split", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconPos: { classPropertyName: "iconPos", publicName: "iconPos", isSignal: true, isRequired: false, transformFunction: null }, dropdownIcon: { classPropertyName: "dropdownIcon", publicName: "dropdownIcon", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, onColor: { classPropertyName: "onColor", publicName: "onColor", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "buttonDisabled", isSignal: true, isRequired: false, transformFunction: null }, menuButtonDisabled: { classPropertyName: "menuButtonDisabled", publicName: "menuButtonDisabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, menuButtonAriaLabel: { classPropertyName: "menuButtonAriaLabel", publicName: "menuButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, menuAriaLabel: { classPropertyName: "menuAriaLabel", publicName: "menuAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, menuLevel: { classPropertyName: "menuLevel", publicName: "menuLevel", isSignal: true, isRequired: false, transformFunction: null }, menuStyleClass: { classPropertyName: "menuStyleClass", publicName: "menuStyleClass", isSignal: true, isRequired: false, transformFunction: null }, autoFlip: { classPropertyName: "autoFlip", publicName: "autoFlip", isSignal: true, isRequired: false, transformFunction: null }, motion: { classPropertyName: "motion", publicName: "motion", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, buttonProps: { classPropertyName: "buttonProps", publicName: "buttonProps", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { buttonClick: "buttonClick", dropdownClick: "dropdownClick", menuShow: "menuShow", menuHide: "menuHide", itemClick: "itemClick" }, viewQueries: [{ propertyName: "actionButton", first: true, predicate: ["action"], descendants: true, isSignal: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"classes()\">\n <!-- Default action -->\n <ui-button\n #action\n class=\"ui-button-split-action\"\n [label]=\"label()\"\n [ariaLabel]=\"ariaLabel()\"\n [icon]=\"icon()\"\n [iconPos]=\"iconPos()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [disabled]=\"actionDisabled()\"\n [tabindex]=\"tabindex()\"\n [buttonProps]=\"buttonProps()\"\n (buttonClick)=\"onButtonClick($event)\"\n >\n <ng-content />\n </ui-button>\n\n <!-- Dropdown trigger -->\n <ui-button\n class=\"ui-button-split-trigger\"\n [icon]=\"dropdownIcon()\"\n [ariaLabel]=\"menuButtonAriaLabel()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [disabled]=\"triggerDisabled()\"\n iconOnly\n [buttonProps]=\"{ 'aria-haspopup': 'menu', 'aria-expanded': menuOpen() ? 'true' : 'false', 'aria-controls': menu.uid }\"\n (buttonClick)=\"onDropdownClick($event)\"\n />\n\n <!-- Options popup (anchored to the trigger) -->\n <ui-menu\n #menu\n popup\n [items]=\"model()\"\n [level]=\"menuLevel()\"\n [size]=\"menuSize()\"\n [motion]=\"motion()\"\n [autoFlip]=\"autoFlip()\"\n [ariaLabel]=\"menuAriaLabel()\"\n [styleClass]=\"menuStyleClass()\"\n (opened)=\"menuOpen.set(true); menuShow.emit()\"\n (closed)=\"menuOpen.set(false); menuHide.emit()\"\n (itemClick)=\"itemClick.emit($event)\"\n />\n</div>\n", styles: [".ui-button-split{display:inline-flex;align-items:stretch}.ui-button-split-action,.ui-button-split-trigger{position:relative}.ui-button-split-action:hover,.ui-button-split-action:focus-within,.ui-button-split-trigger:hover,.ui-button-split-trigger:focus-within{z-index:1}.ui-button-split-action{--ui-button-radius: var(--radius-sm) 0 0 var(--radius-sm)}.ui-button-split-trigger{--ui-button-radius: 0 var(--radius-sm) var(--radius-sm) 0;margin-left:calc(-1 * var(--ui-button-split-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))))}\n"], dependencies: [{ kind: "component", type: UiButton, selector: "ui-button", inputs: ["label", "ariaLabel", "type", "level", "variant", "onColor", "size", "icon", "iconPos", "iconOnly", "loading", "loadingIcon", "expanded", "rounded", "disabled", "tabindex", "buttonProps", "iconTemplate", "loadingIconTemplate", "href", "routerLink", "target", "rel"], outputs: ["buttonClick", "buttonFocus", "buttonBlur"] }, { kind: "component", type: UiMenu, selector: "ui-menu", inputs: ["items", "popup", "expandedKeys", "ariaLabel", "ariaLabelledBy", "styleClass", "level", "size", "submenus", "motion", "autoFlip", "tabindex", "itemTemplate", "submenuHeaderTemplate"], outputs: ["expandedKeysChange", "opened", "closed", "itemClick"] }] }); }
136
136
  }
137
137
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: UiButtonSplit, decorators: [{
138
138
  type: Component,
139
- args: [{ selector: 'ui-button-split', imports: [UiButton, UiMenu], template: "<div [class]=\"classes()\">\n <!-- Default action -->\n <ui-button\n #action\n class=\"ui-button-split-action\"\n [label]=\"label()\"\n [ariaLabel]=\"ariaLabel()\"\n [icon]=\"icon()\"\n [iconPos]=\"iconPos()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [disabled]=\"actionDisabled()\"\n [tabindex]=\"tabindex()\"\n [buttonProps]=\"buttonProps()\"\n (buttonClick)=\"onButtonClick($event)\"\n >\n <ng-content />\n </ui-button>\n\n <!-- Dropdown trigger -->\n <ui-button\n class=\"ui-button-split-trigger\"\n [icon]=\"dropdownIcon()\"\n [ariaLabel]=\"menuButtonAriaLabel()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [disabled]=\"triggerDisabled()\"\n iconOnly\n [buttonProps]=\"{ 'aria-haspopup': 'menu', 'aria-expanded': menuOpen() ? 'true' : 'false', 'aria-controls': menu.uid }\"\n (buttonClick)=\"onDropdownClick($event)\"\n />\n\n <!-- Options popup (anchored to the trigger) -->\n <ui-menu\n #menu\n popup\n [items]=\"model()\"\n [level]=\"menuLevel()\"\n [size]=\"menuSize()\"\n [motion]=\"motion()\"\n [autoFlip]=\"autoFlip()\"\n [ariaLabel]=\"menuAriaLabel()\"\n [styleClass]=\"menuStyleClass()\"\n (opened)=\"menuOpen.set(true); menuShow.emit()\"\n (closed)=\"menuOpen.set(false); menuHide.emit()\"\n (itemClick)=\"itemClick.emit($event)\"\n />\n</div>\n", styles: [".ui-button-split{display:inline-flex;align-items:stretch}.ui-button-split-action,.ui-button-split-trigger{position:relative}.ui-button-split-action:hover,.ui-button-split-action:focus-within,.ui-button-split-trigger:hover,.ui-button-split-trigger:focus-within{z-index:1}.ui-button-split-action{--ui-button-radius: var(--radius-sm) 0 0 var(--radius-sm)}.ui-button-split-trigger{--ui-button-radius: 0 var(--radius-sm) var(--radius-sm) 0;margin-left:calc(-1 * var(--stroke-default))}\n"] }]
139
+ args: [{ selector: 'ui-button-split', imports: [UiButton, UiMenu], template: "<div [class]=\"classes()\">\n <!-- Default action -->\n <ui-button\n #action\n class=\"ui-button-split-action\"\n [label]=\"label()\"\n [ariaLabel]=\"ariaLabel()\"\n [icon]=\"icon()\"\n [iconPos]=\"iconPos()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [disabled]=\"actionDisabled()\"\n [tabindex]=\"tabindex()\"\n [buttonProps]=\"buttonProps()\"\n (buttonClick)=\"onButtonClick($event)\"\n >\n <ng-content />\n </ui-button>\n\n <!-- Dropdown trigger -->\n <ui-button\n class=\"ui-button-split-trigger\"\n [icon]=\"dropdownIcon()\"\n [ariaLabel]=\"menuButtonAriaLabel()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [disabled]=\"triggerDisabled()\"\n iconOnly\n [buttonProps]=\"{ 'aria-haspopup': 'menu', 'aria-expanded': menuOpen() ? 'true' : 'false', 'aria-controls': menu.uid }\"\n (buttonClick)=\"onDropdownClick($event)\"\n />\n\n <!-- Options popup (anchored to the trigger) -->\n <ui-menu\n #menu\n popup\n [items]=\"model()\"\n [level]=\"menuLevel()\"\n [size]=\"menuSize()\"\n [motion]=\"motion()\"\n [autoFlip]=\"autoFlip()\"\n [ariaLabel]=\"menuAriaLabel()\"\n [styleClass]=\"menuStyleClass()\"\n (opened)=\"menuOpen.set(true); menuShow.emit()\"\n (closed)=\"menuOpen.set(false); menuHide.emit()\"\n (itemClick)=\"itemClick.emit($event)\"\n />\n</div>\n", styles: [".ui-button-split{display:inline-flex;align-items:stretch}.ui-button-split-action,.ui-button-split-trigger{position:relative}.ui-button-split-action:hover,.ui-button-split-action:focus-within,.ui-button-split-trigger:hover,.ui-button-split-trigger:focus-within{z-index:1}.ui-button-split-action{--ui-button-radius: var(--radius-sm) 0 0 var(--radius-sm)}.ui-button-split-trigger{--ui-button-radius: 0 var(--radius-sm) var(--radius-sm) 0;margin-left:calc(-1 * var(--ui-button-split-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))))}\n"] }]
140
140
  }], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconPos: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPos", required: false }] }], dropdownIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownIcon", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], onColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "onColor", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], buttonDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonDisabled", required: false }] }], menuButtonDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuButtonDisabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], menuButtonAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuButtonAriaLabel", required: false }] }], menuAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuAriaLabel", required: false }] }], menuLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuLevel", required: false }] }], menuStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuStyleClass", required: false }] }], autoFlip: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFlip", required: false }] }], motion: [{ type: i0.Input, args: [{ isSignal: true, alias: "motion", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }], buttonProps: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonProps", required: false }] }], buttonClick: [{ type: i0.Output, args: ["buttonClick"] }], dropdownClick: [{ type: i0.Output, args: ["dropdownClick"] }], menuShow: [{ type: i0.Output, args: ["menuShow"] }], menuHide: [{ type: i0.Output, args: ["menuHide"] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], actionButton: [{ type: i0.ViewChild, args: ['action', { isSignal: true }] }], menu: [{ type: i0.ViewChild, args: ['menu', { isSignal: true }] }] } });
141
141
 
142
142
  /*