Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39dc123a93 |
@@ -80,6 +80,15 @@ Pour le thème sombre, ajouter `data-theme="dark"` sur l'élément racine (`<htm
|
|||||||
conteneur) — tous les tokens ont leur propre valeur dark, ce n'est jamais une simple
|
conteneur) — tous les tokens ont leur propre valeur dark, ce n'est jamais une simple
|
||||||
inversion des tokens light (voir `figma-kit-audit.md`, section "Découverte majeure").
|
inversion des tokens light (voir `figma-kit-audit.md`, section "Découverte majeure").
|
||||||
|
|
||||||
|
**Piège si l'app utilise aussi Tailwind** : les classes `.text-*` du design system posent
|
||||||
|
`margin: 0` avec une spécificité de classe normale. Les utilitaires `space-y-*`/`space-x-*`
|
||||||
|
de Tailwind posent leur marge via un sélecteur `:where(...)`, dont la spécificité est nulle
|
||||||
|
— ils perdent donc systématiquement face à `.text-*`, quel que soit l'ordre d'import des
|
||||||
|
feuilles de style. Ce n'est un bug ni d'un côté ni de l'autre, juste une collision entre deux
|
||||||
|
mécanismes valides. Pour l'espacement autour d'un `Text` (ou de tout élément portant une
|
||||||
|
classe `.text-*`), utiliser `gap` (flex/grid) plutôt que `space-y-*`/`space-x-*` — `gap` n'est
|
||||||
|
pas affecté par le `margin: 0`.
|
||||||
|
|
||||||
## v0.1.3 — états d'interaction, tailles compactes, espacement, ColorPicker
|
## v0.1.3 — états d'interaction, tailles compactes, espacement, ColorPicker
|
||||||
|
|
||||||
Retour d'usage réel (app Cars) : quatre lacunes du design system corrigées, applicables à
|
Retour d'usage réel (app Cars) : quatre lacunes du design system corrigées, applicables à
|
||||||
@@ -118,6 +127,22 @@ palette fermée de pastilles cliquables.
|
|||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## v0.1.4 — corrections Select et Button:disabled
|
||||||
|
|
||||||
|
Deux bugs remontés par l'usage réel (app Cars), applicables à toutes les apps qui consomment
|
||||||
|
le design system :
|
||||||
|
|
||||||
|
- **`Select` (taille regular)** avait un padding gauche à `0` au lieu de `var(--space-5)` —
|
||||||
|
la valeur affichée se retrouvait collée au bord de sa carte, contrairement à `TextField`
|
||||||
|
qui a un padding symétrique. Corrigé. `size="compact"` n'était pas concerné.
|
||||||
|
- **`Button`** n'avait aucun style `:disabled` — un bouton désactivé était visuellement
|
||||||
|
identique à un bouton actif. Ajouté (`opacity: 0.5`, même valeur que `Checkbox`/`Radio`),
|
||||||
|
et les états hover/pressé de la v0.1.3 sont désormais exclus quand `disabled`.
|
||||||
|
|
||||||
|
Si votre app contournait l'un de ces deux bugs localement (règle CSS applicative pour le
|
||||||
|
padding du Select, style inline pour un Button désactivé), ce contournement peut être retiré
|
||||||
|
après la mise à jour vers v0.1.4.
|
||||||
|
|
||||||
## Développer le package
|
## Développer le package
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@napps/design-system",
|
"name": "@napps/design-system",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Identité visuelle et bibliothèque de composants nApps — direction A4 (Précision / Vibrance)",
|
"description": "Identité visuelle et bibliothèque de composants nApps — direction A4 (Précision / Vibrance)",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@napps/design-system",
|
"name": "@napps/design-system",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Identité visuelle et bibliothèque de composants nApps — direction A4 (Précision / Vibrance)",
|
"description": "Identité visuelle et bibliothèque de composants nApps — direction A4 (Précision / Vibrance)",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -247,7 +247,12 @@
|
|||||||
|
|
||||||
/* Text field */
|
/* Text field */
|
||||||
.text-field {
|
.text-field {
|
||||||
|
border: none;
|
||||||
border-top: 1px solid var(--separator);
|
border-top: 1px solid var(--separator);
|
||||||
|
outline: none;
|
||||||
|
width: 100%;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--label-primary);
|
||||||
padding: var(--space-5);
|
padding: var(--space-5);
|
||||||
min-height: 52px;
|
min-height: 52px;
|
||||||
}
|
}
|
||||||
@@ -352,7 +357,7 @@
|
|||||||
border: none;
|
border: none;
|
||||||
border-top: 1px solid var(--separator);
|
border-top: 1px solid var(--separator);
|
||||||
background: transparent;
|
background: transparent;
|
||||||
padding: var(--space-5) 32px var(--space-5) 0;
|
padding: var(--space-5) 32px var(--space-5) var(--space-5);
|
||||||
font: var(--text-body-weight) var(--text-body-size)/var(--text-body-line) var(--font-family);
|
font: var(--text-body-weight) var(--text-body-size)/var(--text-body-line) var(--font-family);
|
||||||
color: var(--label-primary);
|
color: var(--label-primary);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -461,14 +466,20 @@
|
|||||||
list-row (variante --interactive). Toutes les couleurs viennent de
|
list-row (variante --interactive). Toutes les couleurs viennent de
|
||||||
tokens déjà vérifiés indépendamment en dark — aucune nouvelle
|
tokens déjà vérifiés indépendamment en dark — aucune nouvelle
|
||||||
valeur de couleur brute n'est introduite ici.
|
valeur de couleur brute n'est introduite ici.
|
||||||
|
v0.1.4 : Button n'avait pas d'état :disabled (Checkbox/Radio si) —
|
||||||
|
ajouté avec la même opacité 0.5, et les hover/pressé de Button
|
||||||
|
sont désormais exclus quand disabled (focus-visible n'a pas besoin
|
||||||
|
du même garde-fou : un <button disabled> n'est jamais focusable).
|
||||||
============================================================ */
|
============================================================ */
|
||||||
:where(.btn-primary, .btn-secondary, .select, .checkbox, .radio, .toggle, .tab-bar__item, .list-row--interactive) {
|
:where(.btn-primary, .btn-secondary, .select, .checkbox, .radio, .toggle, .tab-bar__item, .list-row--interactive) {
|
||||||
transition: opacity 120ms ease, transform 120ms ease, background-color 120ms ease, filter 120ms ease;
|
transition: opacity 120ms ease, transform 120ms ease, background-color 120ms ease, filter 120ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.5; cursor: default; }
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
.btn-primary:hover { background: color-mix(in srgb, var(--napps-accent) 88%, black); }
|
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--napps-accent) 88%, black); }
|
||||||
.btn-secondary:hover { background: var(--fill-secondary); }
|
.btn-secondary:hover:not(:disabled) { background: var(--fill-secondary); }
|
||||||
.select:hover { background: var(--fill-tertiary); }
|
.select:hover { background: var(--fill-tertiary); }
|
||||||
.checkbox:not(.checkbox--checked):hover:not(:disabled),
|
.checkbox:not(.checkbox--checked):hover:not(:disabled),
|
||||||
.radio:not(.radio--checked):hover:not(:disabled) { background: var(--fill-secondary); }
|
.radio:not(.radio--checked):hover:not(:disabled) { background: var(--fill-secondary); }
|
||||||
@@ -479,8 +490,8 @@
|
|||||||
.list-row--interactive:hover { background: var(--fill-tertiary); }
|
.list-row--interactive:hover { background: var(--fill-tertiary); }
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary:active,
|
.btn-primary:active:not(:disabled),
|
||||||
.btn-secondary:active,
|
.btn-secondary:active:not(:disabled),
|
||||||
.select:active,
|
.select:active,
|
||||||
.checkbox:active:not(:disabled),
|
.checkbox:active:not(:disabled),
|
||||||
.radio:active:not(:disabled),
|
.radio:active:not(:disabled),
|
||||||
|
|||||||
+11
-5
@@ -357,7 +357,7 @@
|
|||||||
border: none;
|
border: none;
|
||||||
border-top: 1px solid var(--separator);
|
border-top: 1px solid var(--separator);
|
||||||
background: transparent;
|
background: transparent;
|
||||||
padding: var(--space-5) 32px var(--space-5) 0;
|
padding: var(--space-5) 32px var(--space-5) var(--space-5);
|
||||||
font: var(--text-body-weight) var(--text-body-size)/var(--text-body-line) var(--font-family);
|
font: var(--text-body-weight) var(--text-body-size)/var(--text-body-line) var(--font-family);
|
||||||
color: var(--label-primary);
|
color: var(--label-primary);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -466,14 +466,20 @@
|
|||||||
list-row (variante --interactive). Toutes les couleurs viennent de
|
list-row (variante --interactive). Toutes les couleurs viennent de
|
||||||
tokens déjà vérifiés indépendamment en dark — aucune nouvelle
|
tokens déjà vérifiés indépendamment en dark — aucune nouvelle
|
||||||
valeur de couleur brute n'est introduite ici.
|
valeur de couleur brute n'est introduite ici.
|
||||||
|
v0.1.4 : Button n'avait pas d'état :disabled (Checkbox/Radio si) —
|
||||||
|
ajouté avec la même opacité 0.5, et les hover/pressé de Button
|
||||||
|
sont désormais exclus quand disabled (focus-visible n'a pas besoin
|
||||||
|
du même garde-fou : un <button disabled> n'est jamais focusable).
|
||||||
============================================================ */
|
============================================================ */
|
||||||
:where(.btn-primary, .btn-secondary, .select, .checkbox, .radio, .toggle, .tab-bar__item, .list-row--interactive) {
|
:where(.btn-primary, .btn-secondary, .select, .checkbox, .radio, .toggle, .tab-bar__item, .list-row--interactive) {
|
||||||
transition: opacity 120ms ease, transform 120ms ease, background-color 120ms ease, filter 120ms ease;
|
transition: opacity 120ms ease, transform 120ms ease, background-color 120ms ease, filter 120ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.5; cursor: default; }
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
.btn-primary:hover { background: color-mix(in srgb, var(--napps-accent) 88%, black); }
|
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--napps-accent) 88%, black); }
|
||||||
.btn-secondary:hover { background: var(--fill-secondary); }
|
.btn-secondary:hover:not(:disabled) { background: var(--fill-secondary); }
|
||||||
.select:hover { background: var(--fill-tertiary); }
|
.select:hover { background: var(--fill-tertiary); }
|
||||||
.checkbox:not(.checkbox--checked):hover:not(:disabled),
|
.checkbox:not(.checkbox--checked):hover:not(:disabled),
|
||||||
.radio:not(.radio--checked):hover:not(:disabled) { background: var(--fill-secondary); }
|
.radio:not(.radio--checked):hover:not(:disabled) { background: var(--fill-secondary); }
|
||||||
@@ -484,8 +490,8 @@
|
|||||||
.list-row--interactive:hover { background: var(--fill-tertiary); }
|
.list-row--interactive:hover { background: var(--fill-tertiary); }
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary:active,
|
.btn-primary:active:not(:disabled),
|
||||||
.btn-secondary:active,
|
.btn-secondary:active:not(:disabled),
|
||||||
.select:active,
|
.select:active,
|
||||||
.checkbox:active:not(:disabled),
|
.checkbox:active:not(:disabled),
|
||||||
.radio:active:not(:disabled),
|
.radio:active:not(:disabled),
|
||||||
|
|||||||
Reference in New Issue
Block a user