@poadio/ui-angular 0.11.0 → 0.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poadio/ui-angular",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.2.0",
6
6
  "@angular/core": "^21.2.0",
@@ -20,6 +20,7 @@
20
20
  "rxjs": "^7.8.0"
21
21
  },
22
22
  "dependencies": {
23
+ "@poadio/ui-core": "^0.1.0",
23
24
  "tslib": "^2.3.0"
24
25
  },
25
26
  "sideEffects": false,
package/styles/base.scss CHANGED
@@ -1,32 +1,5 @@
1
1
  /* ui-angular — base : reset ciblé + focus + motion. Importé UNE fois (styles.scss du studio). */
2
2
  @import '@angular/cdk/overlay-prebuilt.css';
3
3
  @import './tokens';
4
-
5
- .poad-focus-ring, [class^='poad-'] :where(button, a, [tabindex]):not(.poad-input):focus-visible {
6
- outline: 2px solid var(--poad-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^='poad-'] :where(input, textarea, select):focus-visible, .poad-input:focus-visible { outline: none; }
11
-
12
- @media (prefers-reduced-motion: reduce) {
13
- [class^='poad-'], [class*=' poad-'] { transition: none !important; animation: none !important; }
14
- }
15
-
16
- /* Contrôle natif stylé (directive poadInput), utilisable hors poad-field */
17
- .poad-input {
18
- box-sizing: border-box; width: 100%; height: var(--poad-control-h); padding: 0 var(--poad-control-px);
19
- font: var(--poad-font-size)/1.3 var(--poad-font); color: var(--poad-fg);
20
- background: var(--poad-input-bg); border: 1px solid var(--poad-input-border); border-radius: var(--poad-radius);
21
- outline: none; transition: border-color var(--poad-dur) var(--poad-ease), box-shadow var(--poad-dur) var(--poad-ease);
22
- &::placeholder { color: var(--poad-fg-muted); }
23
- &:focus { border-color: var(--poad-accent); box-shadow: 0 0 0 3px var(--poad-ring); }
24
- &.is-invalid { border-color: var(--poad-danger); }
25
- &.is-invalid:focus { box-shadow: 0 0 0 3px var(--poad-danger-soft); }
26
- &:disabled, &[readonly].is-readonly { background: var(--poad-bg-subtle); color: var(--poad-fg-muted); cursor: not-allowed; }
27
- &.size-sm { height: var(--poad-control-h-sm); font-size: var(--poad-font-size-sm); border-radius: var(--poad-radius-sm); }
28
- &.size-lg { height: var(--poad-control-h-lg); font-size: var(--poad-font-size-lg); }
29
- &.is-mono { font-family: var(--poad-font-mono); font-size: var(--poad-font-size-sm); }
30
- }
31
- textarea.poad-input { height: auto; min-height: calc(var(--poad-control-h) * 2); padding: 8px var(--poad-control-px); resize: vertical; line-height: 1.45; }
32
- select.poad-input { appearance: none; padding-inline-end: 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; }
4
+ /* Focus, mouvement réduit et `.poad-input` : source unique dans @poadio/ui-core (`base.css`, CSS pur, inclus par Sass). */
5
+ @import '@poadio/ui-core/base';
@@ -1,116 +1,7 @@
1
1
  /*
2
- * ui-angular — tokens (3 couches : primitif → sémantique → composant).
3
- * Les tokens sémantiques `--poad-*` 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 --poad-*.
7
- *
8
- * ⚠️ THÈME PAR ZONE (24/08) — le sélecteur ci-dessous est une LISTE, et ce n'est pas
9
- * décoratif : un alias `--poad-x: var(--surface-y)` déclaré SEULEMENT sur :root est
10
- * résolu À LA RACINE ; une classe de thème posée sur un sous-arbre (le canevas de
11
- * l'atelier) redéfinit --surface-y localement mais l'alias, lui, garde la valeur
12
- * calculée en haut — le sous-arbre reste dans l'ancien thème SANS erreur. Redéclarer
13
- * les alias sur `.theme-dark`/`.theme-light` les fait re-résoudre AU PORTEUR de la
14
- * classe : le thème devient scopable à n'importe quelle zone.
2
+ * ui-angular — tokens `--poad-*` et thèmes clair / sombre.
3
+ * La source unique est @poadio/ui-core (`tokens.css`, CSS pur) : ce fichier ne fait que l'inclure, pour que
4
+ * `@use '@poadio/ui-angular/styles/tokens'` continue de fonctionner. Sans extension, Sass INCLUT le CSS
5
+ * (avec `.css`, il laisserait un `@import` à résoudre par le navigateur).
15
6
  */
16
- :root,
17
- .theme-dark,
18
- .theme-light {
19
- /* ---- primitifs (seulement ce que le studio ne définit pas déjà) ---- */
20
- --poad-hue: 217;
21
- --poad-radius-sm: 6px;
22
- --poad-radius: 8px;
23
- --poad-radius-lg: 12px;
24
- --poad-radius-pill: 999px;
25
- --poad-font-size: 0.8125rem; /* taille de base du studio */
26
- --poad-font-size-sm: 0.75rem;
27
- --poad-font-size-lg: 0.9375rem;
28
- --poad-line: 1.35;
29
- --poad-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
30
- --poad-font-mono: 'Fira Code', 'Cascadia Code', 'Source Code Pro', ui-monospace, monospace;
31
- --poad-dur: 140ms;
32
- --poad-ease: cubic-bezier(.2, .7, .2, 1);
33
- --poad-z-overlay: 100002; /* au-dessus des backdrops PrimeNG (100000) tant qu'ils coexistent */
34
- --poad-backdrop: rgba(2, 6, 23, .45);
35
-
36
- /* ---- sémantiques : surfaces ---- */
37
- --poad-bg: var(--surface-ground, #ffffff);
38
- --poad-bg-subtle: var(--surface-section, #f8fafc);
39
- --poad-surface: var(--surface-card, #ffffff);
40
- --poad-overlay: var(--surface-overlay, #ffffff);
41
- --poad-hover: var(--surface-hover, #f1f5f9);
42
- /* Survol SUR UNE SURFACE FLOTTANTE (menu, liste d'options, calendrier, feuille…).
43
- Il ne peut pas être `--poad-hover` : celui-ci est un écart depuis la surface de CARTE, et
44
- rien n'oblige un thème à le distinguer de la surface d'overlay. Le thème sombre du studio
45
- donne justement la MÊME couleur aux deux (#21262d) — donc aucun survol n'était visible
46
- dans le moindre menu ou select, sauf les entrées `danger` qui ont leur propre teinte.
47
- Signalé par SZU le 21/08/2026 sur poad-menu. On le DÉRIVE de la surface plutôt que de le
48
- déclarer à côté : deux tokens indépendants peuvent coïncider, un écart calculé, jamais. */
49
- --poad-overlay-hover: var(--surface-overlay-hover, color-mix(in srgb, var(--poad-fg) 9%, var(--poad-overlay)));
50
- --poad-elevated: var(--bg-elevated, #e2e8f0);
51
- --poad-border: var(--surface-border, #e2e8f0);
52
- --poad-border-strong: var(--border-light, #cbd5e1);
53
-
54
- /* ---- sémantiques : texte ---- */
55
- --poad-fg: var(--text-primary, #1e293b);
56
- --poad-fg-secondary: var(--text-secondary, #475569);
57
- --poad-fg-muted: var(--text-muted, #94a3b8);
58
- --poad-fg-on-accent: #ffffff;
59
-
60
- /* ---- sémantiques : accent + sévérités ---- */
61
- /* accent clair recalé pour AA sur blanc (décision à valider SZU) ; le sombre garde #58a6ff */
62
- --poad-accent: #2f6feb;
63
- --poad-accent-hover: #245fd0;
64
- --poad-accent-soft: rgba(47, 111, 235, .12);
65
- --poad-ring: rgba(47, 111, 235, .35);
66
- --poad-success: var(--accent-success, #3fb950);
67
- --poad-warning: var(--accent-warning, #d29922);
68
- --poad-danger: var(--accent-danger, #f85149);
69
- --poad-info: var(--accent-secondary, #79c0ff);
70
- --poad-success-soft: rgba(63, 185, 80, .14);
71
- --poad-warning-soft: rgba(210, 153, 34, .16);
72
- --poad-danger-soft: rgba(248, 81, 73, .14);
73
- --poad-info-soft: rgba(121, 192, 255, .16);
74
-
75
- /* ---- sémantiques : ombres ---- */
76
- --poad-shadow-sm: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));
77
- --poad-shadow-md: var(--shadow-md, 0 4px 6px rgba(0,0,0,.07));
78
- --poad-shadow-lg: var(--shadow-lg, 0 12px 24px rgba(15,23,42,.08));
79
-
80
- /* ---- composants ---- */
81
- --poad-control-h-sm: 26px;
82
- --poad-control-h: 32px;
83
- --poad-control-h-lg: 40px;
84
- --poad-control-px: 10px;
85
- --poad-input-bg: var(--input-bg, var(--poad-bg));
86
- --poad-input-border: var(--input-border, var(--poad-border-strong));
87
- --poad-table-stripe: var(--table-even-row-color, var(--poad-bg-subtle));
88
- --poad-tooltip-bg: #1e293b; /* contraste inversé (maquette .tip) */
89
- --poad-tooltip-fg: #f8fafc;
90
- }
91
-
92
- .theme-dark {
93
- --poad-backdrop: rgba(0, 0, 0, .6);
94
- --poad-accent: var(--accent-primary, #58a6ff);
95
- --poad-accent-hover: #79c0ff;
96
- --poad-accent-soft: rgba(88, 166, 255, .16);
97
- --poad-ring: rgba(88, 166, 255, .40);
98
- --poad-fg-on-accent: #0d1117;
99
- --poad-tooltip-bg: #f0f6fc;
100
- --poad-tooltip-fg: #0d1117;
101
- }
102
-
103
- /* ---- breakpoints (nommage Tailwind) — utilisés par PoadBreakpointService et les primitives layout ---- */
104
- :root {
105
- --poad-bp-sm: 640px; --poad-bp-md: 768px; --poad-bp-lg: 1024px; --poad-bp-xl: 1280px; --poad-bp-2xl: 1536px;
106
- --poad-container-max: 1440px;
107
- --poad-gap-xs: 4px; --poad-gap-sm: 8px; --poad-gap-md: 14px; --poad-gap-lg: 22px; --poad-gap-xl: 32px;
108
- }
109
-
110
- /* ---- densité tactile : classe `poad-touch` posée sur <html> par PoadBreakpointService (pointer: coarse, ou POAD_TOUCH_DENSITY='on') ---- */
111
- :root { --poad-table-row-h: 42px; }
112
- .poad-touch {
113
- --poad-control-h: 40px; --poad-control-h-sm: 32px; --poad-control-h-lg: 48px;
114
- --poad-font-size: 0.9375rem; --poad-control-px: 12px;
115
- --poad-table-row-h: 48px;
116
- }
7
+ @import '@poadio/ui-core/tokens';