ic-angular-uikit 0.0.0-stage → 0.1.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.
- package/CHANGELOG.md +24 -0
- package/LICENSE +21 -0
- package/README.md +191 -2
- package/fesm2022/ic-angular-uikit.mjs +14585 -0
- package/fesm2022/ic-angular-uikit.mjs.map +1 -0
- package/package.json +60 -3
- package/styles/ic-angular-uikit.css +22 -0
- package/styles/seasons.css +94 -0
- package/styles/themes/dark.css +63 -0
- package/styles/themes/light.css +64 -0
- package/styles/tokens.css +48 -0
- package/types/ic-angular-uikit.d.ts +4490 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Journal des versions
|
|
2
|
+
|
|
3
|
+
Format inspiré de [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/) ; numérotation [SemVer](https://semver.org/lang/fr/)
|
|
4
|
+
(en 0.x, une version mineure peut contenir des changements incompatibles).
|
|
5
|
+
|
|
6
|
+
## [0.1.0] — 2026-11-23
|
|
7
|
+
|
|
8
|
+
Première version publiée.
|
|
9
|
+
|
|
10
|
+
### Ajouté
|
|
11
|
+
|
|
12
|
+
- **Mise en page** : `ui-layout` + `ui-sidebar` (colonnes gauche / droite, rail d'icônes, redimensionnement, tiroir
|
|
13
|
+
mobile), `ui-app-bar` (navigation repliable), `ui-jumbotron`.
|
|
14
|
+
- **Actions** : `uiButton` (primary, secondary, outline, ghost, success, warning, danger ; icônes ; boutons bascule),
|
|
15
|
+
`ui-toolbar` (motif ARIA toolbar).
|
|
16
|
+
- **Formulaires** : `ui-text-field`, `ui-textarea`, `ui-select`, `ui-checkbox`, `ui-radio-group`, `ui-switch`,
|
|
17
|
+
`ui-file-upload`, avec validation graphique et messages personnalisables (`provideUiValidation`).
|
|
18
|
+
- **Navigation** : `ui-menu` + `ui-submenu` (vertical / horizontal, multi-niveaux), `ui-tabs` (horizontaux / verticaux).
|
|
19
|
+
- **Affichage** : `ui-badge`, `ui-card` (horizontale), `ui-carousel`, `ui-dashboard` (widgets déplaçables,
|
|
20
|
+
redimensionnables, à deux faces, catalogue par catégories), `ui-icon` (Font Awesome, Material, Bootstrap Icons,
|
|
21
|
+
Lucide, SVG), `ui-org-chart`, `ui-ribbon`, `ui-table` (tri, recherche, filtres, colonnes, pagination),
|
|
22
|
+
`ui-season-effects`.
|
|
23
|
+
- **Retours & superpositions** : `ui-alert`, `ui-dialog`.
|
|
24
|
+
- **Thèmes** : `light`, `dark`, `season-light`, `season-dark`, jetons CSS `--ui-*`, `ThemeService`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Imperium Clan Software
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,192 @@
|
|
|
1
|
-
#
|
|
1
|
+
# IC Angular UiKit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/ic-angular-uikit)
|
|
4
|
+
[](https://github.com/imperiumclansoftware/ic-angular-uikit/blob/main/LICENSE)
|
|
5
|
+
|
|
6
|
+
Bibliothèque de composants **Angular 22** accessibles et thémables : composants standalone à base de signaux,
|
|
7
|
+
`OnPush`, templatisables (slots et `ng-template`), thèmes **clair**, **sombre** et **saisonniers**, compatible avec une
|
|
8
|
+
CSP stricte et Trusted Types.
|
|
9
|
+
|
|
10
|
+
- Plus de 25 composants : formulaires avec validation, tableaux (recherche, filtres, pagination), menus multi-niveaux, barre
|
|
11
|
+
d'application, carrousel, tableau de bord personnalisable, organigramme…
|
|
12
|
+
- Accessibilité visée : **WCAG 2.1 AA** (contrastes vérifiés dans tous les thèmes, clavier complet, motifs ARIA).
|
|
13
|
+
- Thèmes par jetons CSS (`--ui-color-*`), applicables à toute la page ou à une seule zone.
|
|
14
|
+
- Icônes au choix : Font Awesome, Material Symbols, Bootstrap Icons, Lucide, SVG maison.
|
|
15
|
+
- Aucun `innerHTML`, aucune dépendance d'exécution hors Angular, RxJS et `tslib`.
|
|
16
|
+
|
|
17
|
+
## Prérequis
|
|
18
|
+
|
|
19
|
+
| Paquet | Version |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `@angular/core`, `@angular/common`, `@angular/forms` | `^22.2.0` |
|
|
22
|
+
| `rxjs` | `~7.8.0` |
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install ic-angular-uikit
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 1. Styles
|
|
31
|
+
|
|
32
|
+
Ajoutez la feuille de styles globale (jetons + thèmes) dans `angular.json`, avant vos propres styles :
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
"styles": [
|
|
36
|
+
"node_modules/ic-angular-uikit/styles/ic-angular-uikit.css",
|
|
37
|
+
"src/styles.css"
|
|
38
|
+
]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Configuration
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
// app.config.ts
|
|
45
|
+
import { ApplicationConfig } from '@angular/core';
|
|
46
|
+
import { provideUiKit } from 'ic-angular-uikit';
|
|
47
|
+
|
|
48
|
+
export const appConfig: ApplicationConfig = {
|
|
49
|
+
providers: [
|
|
50
|
+
provideUiKit({ defaultTheme: 'system' }), // 'light' | 'dark' | 'system' | 'season-light' | 'season-dark'
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 3. Utilisation
|
|
56
|
+
|
|
57
|
+
Chaque composant est standalone : importez-le là où vous l'utilisez.
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
import { Component, signal } from '@angular/core';
|
|
61
|
+
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
62
|
+
import { UiButton, UiCard, UiTextField } from 'ic-angular-uikit';
|
|
63
|
+
|
|
64
|
+
@Component({
|
|
65
|
+
selector: 'app-newsletter',
|
|
66
|
+
imports: [ReactiveFormsModule, UiCard, UiTextField, UiButton],
|
|
67
|
+
template: `
|
|
68
|
+
<ui-card>
|
|
69
|
+
<ui-text-field label="E-mail" type="email" [formControl]="email" hint="Une lettre par mois." />
|
|
70
|
+
<button uiButton icon="lucide:mail" [disabled]="email.invalid" (click)="sent.set(true)">S'inscrire</button>
|
|
71
|
+
</ui-card>
|
|
72
|
+
`,
|
|
73
|
+
})
|
|
74
|
+
export class Newsletter {
|
|
75
|
+
protected readonly email = new FormControl('', [Validators.required, Validators.email]);
|
|
76
|
+
protected readonly sent = signal(false);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Composants
|
|
81
|
+
|
|
82
|
+
| Catégorie | Composants |
|
|
83
|
+
| --- | --- |
|
|
84
|
+
| Mise en page | `ui-layout` + `ui-sidebar` (colonnes, rail, tiroir mobile), `ui-app-bar`, `ui-jumbotron` |
|
|
85
|
+
| Actions | `uiButton` (7 variantes, icônes, chargement), `ui-toolbar` |
|
|
86
|
+
| Formulaires | `ui-text-field`, `ui-textarea`, `ui-select`, `ui-checkbox`, `ui-radio-group`, `ui-switch`, `ui-file-upload` |
|
|
87
|
+
| Navigation | `ui-menu` + `ui-submenu` (vertical / horizontal, multi-niveaux), `ui-tabs` (horizontaux / verticaux) |
|
|
88
|
+
| Affichage | `ui-badge`, `ui-card`, `ui-carousel`, `ui-dashboard`, `ui-icon`, `ui-org-chart`, `ui-ribbon`, `ui-table`, `ui-season-effects` |
|
|
89
|
+
| Retours & superpositions | `ui-alert`, `ui-dialog` |
|
|
90
|
+
|
|
91
|
+
Chaque composant documente ses inputs, outputs, slots, variables CSS et exemples dans le site de documentation
|
|
92
|
+
(voir plus bas).
|
|
93
|
+
|
|
94
|
+
## Thèmes
|
|
95
|
+
|
|
96
|
+
Thèmes fournis : `light`, `dark`, `season-light`, `season-dark` (couleurs selon la saison, animations facultatives avec
|
|
97
|
+
`<ui-season-effects />`). Le thème est porté par l'attribut `data-ui-theme` : sur `<html>` via `ThemeService`, ou sur
|
|
98
|
+
n'importe quel élément pour une seule zone.
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { ThemeService } from 'ic-angular-uikit';
|
|
102
|
+
|
|
103
|
+
inject(ThemeService).setTheme('dark'); // préférence mémorisée (désactivable : provideUiKit({ storageKey: null }))
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Personnalisez les jetons (`--ui-color-primary`, `--ui-radius-md`…) dans vos styles, ou créez un thème en copiant
|
|
107
|
+
`styles/themes/dark.css` puis en le déclarant : `provideUiKit({ themes: ['light', 'dark', 'mon-theme'] })`.
|
|
108
|
+
Pour cibler tous les thèmes sombres : `[data-ui-theme$='dark']`.
|
|
109
|
+
|
|
110
|
+
## Icônes
|
|
111
|
+
|
|
112
|
+
Aucune librairie d'icônes n'est imposée. Installez celle de votre choix et déclarez-la :
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
import { provideUiIcons, fontAwesomeFont, lucideIcons } from 'ic-angular-uikit';
|
|
116
|
+
import { Mail, Search } from 'lucide';
|
|
117
|
+
|
|
118
|
+
provideUiIcons([fontAwesomeFont(), lucideIcons({ Mail, Search })], { defaultSet: 'lucide' });
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
```html
|
|
122
|
+
<ui-icon name="lucide:search" />
|
|
123
|
+
<button uiButton icon="fas:floppy-disk">Enregistrer</button>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Adaptateurs : `fontAwesomeFont`, `fontAwesomeSvg`, `materialSymbols`, `materialIcons`, `bootstrapIcons`, `lucideIcons`,
|
|
127
|
+
`svgIcons`, `fontIcons`. Installez les polices depuis npm plutôt qu'un CDN (compatible CSP `font-src 'self'`).
|
|
128
|
+
|
|
129
|
+
## Formulaires et validation
|
|
130
|
+
|
|
131
|
+
Les champs fonctionnent avec `[(value)]`, `formControl`, `formControlName` ou `ngModel`, et affichent eux-mêmes
|
|
132
|
+
erreurs, vérification asynchrone et succès. Messages personnalisables par champ (`[errorMessages]`), par validateur
|
|
133
|
+
(`{ clé: { message } }`) ou pour toute l'application :
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
provideUiValidation({ showErrorsWhen: 'touched', messages: { required: 'Ce champ est obligatoire.' } });
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Tableau de bord
|
|
140
|
+
|
|
141
|
+
`ui-dashboard` affiche des widgets déplaçables et redimensionnables (souris, tactile, clavier), à deux faces, avec une
|
|
142
|
+
colonne de personnalisation et un catalogue par catégories. Un widget est un composant Angular ordinaire :
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
@Component({
|
|
146
|
+
imports: [UiWidgetFront, UiWidgetSettings, UiTextField],
|
|
147
|
+
template: `
|
|
148
|
+
<ng-template uiWidgetFront>{{ ctx.config().message }}</ng-template>
|
|
149
|
+
<ng-template uiWidgetSettings>
|
|
150
|
+
<ui-text-field label="Message" [value]="ctx.config().message" (valueChange)="ctx.updateConfig({ message: $event })" />
|
|
151
|
+
</ng-template>
|
|
152
|
+
`,
|
|
153
|
+
})
|
|
154
|
+
export class MessageWidget {
|
|
155
|
+
protected readonly ctx = injectUiWidgetContext<{ message: string }>();
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
La disposition (`layoutChange`) est un JSON sérialisable à enregistrer côté serveur ; relisez-la avec
|
|
160
|
+
`sanitizeDashboardLayout()`. La documentation fournit des exemples serveur (Symfony, Node.js, PHP).
|
|
161
|
+
|
|
162
|
+
## Accessibilité
|
|
163
|
+
|
|
164
|
+
- Contrastes de texte ≥ 4,5:1 et contours de contrôles ≥ 3:1 dans chaque thème ; l'information n'est jamais portée
|
|
165
|
+
par la couleur seule.
|
|
166
|
+
- Navigation clavier complète, focus visible, motifs ARIA (onglets, menus, barre d'outils, carrousel…).
|
|
167
|
+
- Animations désactivées avec `prefers-reduced-motion`.
|
|
168
|
+
- En développement, avertissements dans la console pour les champs sans libellé et les images sans `alt`.
|
|
169
|
+
|
|
170
|
+
## Sécurité
|
|
171
|
+
|
|
172
|
+
- Aucun `innerHTML` ni `bypassSecurityTrust*` : les SVG sont construits avec `Renderer2` et une liste blanche.
|
|
173
|
+
- Compatible avec une CSP stricte (`script-src 'self'`, `require-trusted-types-for 'script'`).
|
|
174
|
+
- `localStorage` utilisé uniquement pour la préférence de thème (désactivable).
|
|
175
|
+
- Les contrôles côté client (taille de fichier, disposition du tableau de bord…) sont un confort : revalidez toujours
|
|
176
|
+
côté serveur.
|
|
177
|
+
|
|
178
|
+
## Documentation
|
|
179
|
+
|
|
180
|
+
Le site de documentation (exemples interactifs, API de chaque composant, guides thèmes, validation, accessibilité) est
|
|
181
|
+
dans le dépôt : <https://github.com/imperiumclansoftware/ic-angular-uikit>
|
|
182
|
+
|
|
183
|
+
```sh
|
|
184
|
+
git clone https://github.com/imperiumclansoftware/ic-angular-uikit.git
|
|
185
|
+
cd ic-angular-uikit && npm install && npm start # http://localhost:4220
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Questions et anomalies : <https://github.com/imperiumclansoftware/ic-angular-uikit/issues>
|
|
189
|
+
|
|
190
|
+
## Licence
|
|
191
|
+
|
|
192
|
+
[MIT](https://github.com/imperiumclansoftware/ic-angular-uikit/blob/main/LICENSE) © Imperium Clan Software
|