@cadriciel/ui 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/README.md +50 -0
- package/fesm2022/cadriciel-ui.mjs +17451 -0
- package/fesm2022/cadriciel-ui.mjs.map +1 -0
- package/package.json +59 -0
- package/styles/base.scss +32 -0
- package/styles/tokens.scss +98 -0
- package/types/cadriciel-ui.d.ts +6327 -0
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cadriciel/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^21.2.0",
|
|
6
|
+
"@angular/core": "^21.2.0",
|
|
7
|
+
"@angular/cdk": "^21.2.0",
|
|
8
|
+
"@angular/forms": "^21.2.0",
|
|
9
|
+
"@angular/router": "^21.2.0",
|
|
10
|
+
"@angular/platform-browser": "^21.2.0",
|
|
11
|
+
"maplibre-gl": ">=4.0.0",
|
|
12
|
+
"chart.js": ">=4.0.0"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"tslib": "^2.3.0"
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"peerDependenciesMeta": {
|
|
19
|
+
"maplibre-gl": {
|
|
20
|
+
"optional": true
|
|
21
|
+
},
|
|
22
|
+
"chart.js": {
|
|
23
|
+
"optional": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"description": "Bibliothèque de composants Angular du Cadriciel (CEREMA) — remplacement de PrimeNG : formulaires, table niveau grille, layout responsive, overlays, carte MapLibre, icônes in-house.",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"author": "CEREMA — Stéphane Zuccatti",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://gitlab.cerema.fr/cadriciel/cadriciel-ui.git"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"angular",
|
|
35
|
+
"components",
|
|
36
|
+
"ui",
|
|
37
|
+
"cerema",
|
|
38
|
+
"cadriciel",
|
|
39
|
+
"maplibre",
|
|
40
|
+
"table"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"exports": {
|
|
46
|
+
"./styles/tokens.scss": "./styles/tokens.scss",
|
|
47
|
+
"./styles/base.scss": "./styles/base.scss",
|
|
48
|
+
"./package.json": {
|
|
49
|
+
"default": "./package.json"
|
|
50
|
+
},
|
|
51
|
+
".": {
|
|
52
|
+
"types": "./types/cadriciel-ui.d.ts",
|
|
53
|
+
"default": "./fesm2022/cadriciel-ui.mjs"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"module": "fesm2022/cadriciel-ui.mjs",
|
|
57
|
+
"typings": "types/cadriciel-ui.d.ts",
|
|
58
|
+
"type": "module"
|
|
59
|
+
}
|
package/styles/base.scss
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* cadriciel-ui — base : reset ciblé + focus + motion. Importé UNE fois (styles.scss du studio). */
|
|
2
|
+
@import '@angular/cdk/overlay-prebuilt.css';
|
|
3
|
+
@import './tokens';
|
|
4
|
+
|
|
5
|
+
.cad-focus-ring, [class^='cad-'] :where(button, a, [tabindex]):not(.cad-input):focus-visible {
|
|
6
|
+
outline: 2px solid var(--cad-ring);
|
|
7
|
+
outline-offset: 1px;
|
|
8
|
+
}
|
|
9
|
+
/* les champs (input/textarea/select) portent leur propre focus (bordure + ring sur la BOÎTE) — jamais d'outline interne */
|
|
10
|
+
[class^='cad-'] :where(input, textarea, select):focus-visible, .cad-input:focus-visible { outline: none; }
|
|
11
|
+
|
|
12
|
+
@media (prefers-reduced-motion: reduce) {
|
|
13
|
+
[class^='cad-'], [class*=' cad-'] { transition: none !important; animation: none !important; }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Contrôle natif stylé (directive cadInput), utilisable hors cad-field */
|
|
17
|
+
.cad-input {
|
|
18
|
+
box-sizing: border-box; width: 100%; height: var(--cad-control-h); padding: 0 var(--cad-control-px);
|
|
19
|
+
font: var(--cad-font-size)/1.3 var(--cad-font); color: var(--cad-fg);
|
|
20
|
+
background: var(--cad-input-bg); border: 1px solid var(--cad-input-border); border-radius: var(--cad-radius);
|
|
21
|
+
outline: none; transition: border-color var(--cad-dur) var(--cad-ease), box-shadow var(--cad-dur) var(--cad-ease);
|
|
22
|
+
&::placeholder { color: var(--cad-fg-muted); }
|
|
23
|
+
&:focus { border-color: var(--cad-accent); box-shadow: 0 0 0 3px var(--cad-ring); }
|
|
24
|
+
&.is-invalid { border-color: var(--cad-danger); }
|
|
25
|
+
&.is-invalid:focus { box-shadow: 0 0 0 3px var(--cad-danger-soft); }
|
|
26
|
+
&:disabled, &[readonly].is-readonly { background: var(--cad-bg-subtle); color: var(--cad-fg-muted); cursor: not-allowed; }
|
|
27
|
+
&.size-sm { height: var(--cad-control-h-sm); font-size: var(--cad-font-size-sm); border-radius: var(--cad-radius-sm); }
|
|
28
|
+
&.size-lg { height: var(--cad-control-h-lg); font-size: var(--cad-font-size-lg); }
|
|
29
|
+
&.is-mono { font-family: var(--cad-font-mono); font-size: var(--cad-font-size-sm); }
|
|
30
|
+
}
|
|
31
|
+
textarea.cad-input { height: auto; min-height: calc(var(--cad-control-h) * 2); padding: 8px var(--cad-control-px); resize: vertical; line-height: 1.45; }
|
|
32
|
+
select.cad-input { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* cadriciel-ui — tokens (3 couches : primitif → sémantique → composant).
|
|
3
|
+
* Les tokens sémantiques `--cad-*` sont des ALIAS des variables déjà définies par le studio
|
|
4
|
+
* (styles.scss : --surface-*, --text-*, --accent-*, --shadow-*), avec repli si absentes.
|
|
5
|
+
* Le thème est porté par `.theme-dark` sur <html> (mécanique existante) : les composants
|
|
6
|
+
* ne contiennent AUCUN sélecteur de thème, ils ne lisent que --cad-*.
|
|
7
|
+
*/
|
|
8
|
+
:root {
|
|
9
|
+
/* ---- primitifs (seulement ce que le studio ne définit pas déjà) ---- */
|
|
10
|
+
--cad-hue: 217;
|
|
11
|
+
--cad-radius-sm: 6px;
|
|
12
|
+
--cad-radius: 8px;
|
|
13
|
+
--cad-radius-lg: 12px;
|
|
14
|
+
--cad-radius-pill: 999px;
|
|
15
|
+
--cad-font-size: 0.8125rem; /* taille de base du studio */
|
|
16
|
+
--cad-font-size-sm: 0.75rem;
|
|
17
|
+
--cad-font-size-lg: 0.9375rem;
|
|
18
|
+
--cad-line: 1.35;
|
|
19
|
+
--cad-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
20
|
+
--cad-font-mono: 'Fira Code', 'Cascadia Code', 'Source Code Pro', ui-monospace, monospace;
|
|
21
|
+
--cad-dur: 140ms;
|
|
22
|
+
--cad-ease: cubic-bezier(.2, .7, .2, 1);
|
|
23
|
+
--cad-z-overlay: 100002; /* au-dessus des backdrops PrimeNG (100000) tant qu'ils coexistent */
|
|
24
|
+
--cad-backdrop: rgba(2, 6, 23, .45);
|
|
25
|
+
|
|
26
|
+
/* ---- sémantiques : surfaces ---- */
|
|
27
|
+
--cad-bg: var(--surface-ground, #ffffff);
|
|
28
|
+
--cad-bg-subtle: var(--surface-section, #f8fafc);
|
|
29
|
+
--cad-surface: var(--surface-card, #ffffff);
|
|
30
|
+
--cad-overlay: var(--surface-overlay, #ffffff);
|
|
31
|
+
--cad-hover: var(--surface-hover, #f1f5f9);
|
|
32
|
+
--cad-elevated: var(--bg-elevated, #e2e8f0);
|
|
33
|
+
--cad-border: var(--surface-border, #e2e8f0);
|
|
34
|
+
--cad-border-strong: var(--border-light, #cbd5e1);
|
|
35
|
+
|
|
36
|
+
/* ---- sémantiques : texte ---- */
|
|
37
|
+
--cad-fg: var(--text-primary, #1e293b);
|
|
38
|
+
--cad-fg-secondary: var(--text-secondary, #475569);
|
|
39
|
+
--cad-fg-muted: var(--text-muted, #94a3b8);
|
|
40
|
+
--cad-fg-on-accent: #ffffff;
|
|
41
|
+
|
|
42
|
+
/* ---- sémantiques : accent + sévérités ---- */
|
|
43
|
+
/* accent clair recalé pour AA sur blanc (décision à valider SZU) ; le sombre garde #58a6ff */
|
|
44
|
+
--cad-accent: #2f6feb;
|
|
45
|
+
--cad-accent-hover: #245fd0;
|
|
46
|
+
--cad-accent-soft: rgba(47, 111, 235, .12);
|
|
47
|
+
--cad-ring: rgba(47, 111, 235, .35);
|
|
48
|
+
--cad-success: var(--accent-success, #3fb950);
|
|
49
|
+
--cad-warning: var(--accent-warning, #d29922);
|
|
50
|
+
--cad-danger: var(--accent-danger, #f85149);
|
|
51
|
+
--cad-info: var(--accent-secondary, #79c0ff);
|
|
52
|
+
--cad-success-soft: rgba(63, 185, 80, .14);
|
|
53
|
+
--cad-warning-soft: rgba(210, 153, 34, .16);
|
|
54
|
+
--cad-danger-soft: rgba(248, 81, 73, .14);
|
|
55
|
+
--cad-info-soft: rgba(121, 192, 255, .16);
|
|
56
|
+
|
|
57
|
+
/* ---- sémantiques : ombres ---- */
|
|
58
|
+
--cad-shadow-sm: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));
|
|
59
|
+
--cad-shadow-md: var(--shadow-md, 0 4px 6px rgba(0,0,0,.07));
|
|
60
|
+
--cad-shadow-lg: var(--shadow-lg, 0 12px 24px rgba(15,23,42,.08));
|
|
61
|
+
|
|
62
|
+
/* ---- composants ---- */
|
|
63
|
+
--cad-control-h-sm: 26px;
|
|
64
|
+
--cad-control-h: 32px;
|
|
65
|
+
--cad-control-h-lg: 40px;
|
|
66
|
+
--cad-control-px: 10px;
|
|
67
|
+
--cad-input-bg: var(--input-bg, var(--cad-bg));
|
|
68
|
+
--cad-input-border: var(--input-border, var(--cad-border-strong));
|
|
69
|
+
--cad-table-stripe: var(--table-even-row-color, var(--cad-bg-subtle));
|
|
70
|
+
--cad-tooltip-bg: #1e293b; /* contraste inversé (maquette .tip) */
|
|
71
|
+
--cad-tooltip-fg: #f8fafc;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.theme-dark {
|
|
75
|
+
--cad-backdrop: rgba(0, 0, 0, .6);
|
|
76
|
+
--cad-accent: var(--accent-primary, #58a6ff);
|
|
77
|
+
--cad-accent-hover: #79c0ff;
|
|
78
|
+
--cad-accent-soft: rgba(88, 166, 255, .16);
|
|
79
|
+
--cad-ring: rgba(88, 166, 255, .40);
|
|
80
|
+
--cad-fg-on-accent: #0d1117;
|
|
81
|
+
--cad-tooltip-bg: #f0f6fc;
|
|
82
|
+
--cad-tooltip-fg: #0d1117;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* ---- breakpoints (nommage Tailwind) — utilisés par CadBreakpointService et les primitives layout ---- */
|
|
86
|
+
:root {
|
|
87
|
+
--cad-bp-sm: 640px; --cad-bp-md: 768px; --cad-bp-lg: 1024px; --cad-bp-xl: 1280px; --cad-bp-2xl: 1536px;
|
|
88
|
+
--cad-container-max: 1440px;
|
|
89
|
+
--cad-gap-xs: 4px; --cad-gap-sm: 8px; --cad-gap-md: 14px; --cad-gap-lg: 22px; --cad-gap-xl: 32px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ---- densité tactile : classe `cad-touch` posée sur <html> par CadBreakpointService (pointer: coarse, ou CAD_TOUCH_DENSITY='on') ---- */
|
|
93
|
+
:root { --cad-table-row-h: 42px; }
|
|
94
|
+
.cad-touch {
|
|
95
|
+
--cad-control-h: 40px; --cad-control-h-sm: 32px; --cad-control-h-lg: 48px;
|
|
96
|
+
--cad-font-size: 0.9375rem; --cad-control-px: 12px;
|
|
97
|
+
--cad-table-row-h: 48px;
|
|
98
|
+
}
|