Files
nathanduquetandClaude Sonnet 5 f6189d170e v0.1.9 — ListRow : le slot trailing peut rétrécir sans écraser le titre
- .list-row__trailing : flex-shrink:0 + max-width:50% + troncature
- .list-row__title/__subtitle : nowrap + ellipsis par défaut
- gap entre les deux colonnes

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-24 11:45:29 +02:00

734 lines
31 KiB
CSS
Executable File

/*
nApps — Design Tokens (v1)
Direction retenue : A4 — Précision / Vibrance
Source : audit du kit Figma "iOS and iPadOS 27 (Community)" — voir figma-kit-audit.md
Principe : les MÉCANIQUES (hiérarchie par opacité, échelle de fills, deux familles de
matière) sont reprises du vrai système Apple. Les VALEURS de marque (accent, typographie,
rayons) restent propres à nApps — jamais de copie de SF Pro / SF Symbols / bleu système.
*/
:root {
/* ===== Accent — propre à nApps, jamais le bleu système Apple (#0088FF) ===== */
--napps-accent: #0B6CFF;
--napps-success: #1FA968;
--napps-warning: #D68C1B;
--napps-error: #E6483D;
/* ===== Labels — hiérarchie par OPACITÉ du noir, pas par des gris séparés =====
Découverte de l'audit : Apple encode primary/secondary/tertiary en assombrissant
un seul noir, jamais avec une palette de gris. Un token qui s'adapte à n'importe
quel fond au lieu d'une variante par contexte. */
--label-primary: rgba(0, 0, 0, 1);
--label-secondary: rgba(0, 0, 0, 0.6);
--label-tertiary: rgba(0, 0, 0, 0.3);
--label-quaternary: rgba(0, 0, 0, 0.18);
/* ===== Fills — fonds de contrôle translucides, 3 paliers d'opacité =====
primary > secondary > tertiary : plus une surface est "au premier plan"
(un bouton qu'on presse), plus l'opacité est haute. */
--fill-primary: rgba(0, 0, 0, 0.2);
--fill-secondary: rgba(0, 0, 0, 0.16);
--fill-tertiary: rgba(0, 0, 0, 0.12);
--separator: rgba(0, 0, 0, 0.1);
/* ===== Surfaces — hiérarchie de fond par couleur, PAS par ombre =====
page → groupée → imbriquée. Jamais d'ombre pour distinguer les niveaux. */
--bg-page: #F5F6F9;
--bg-grouped: #FFFFFF;
--bg-nested: #EDEFF3;
/* ===== Rayons ===== */
--radius-pill: 999px;
--radius-card: 16px;
--radius-card-lg: 20px;
--radius-sheet-top: 24px;
--radius-sheet-bottom: 32px;
/* ===== Cible tactile minimale ===== */
--tap-target-min: 44px;
/* v0.1.7 — hauteur du Button "regular" : 39px, milieu entre 44px
(cible tactile HIG) et 34px (--control-height-compact, égal au
Medium audité). VALEUR DÉRIVÉE, pas auditée : le kit n'a pas de
bouton à 39px (tailles observées : 28 / 34 / 50). Retenue car un
bouton à 44px + 17px pesait à côté du texte de champ en 15px, validée
en usage réel (app Cars). NB : elle passe sous les 44px recommandés
par le HIG pour le tactile ; --tap-target-min reste la référence si
une app cible surtout le tactile. */
--control-height-regular: 39px;
--control-height-compact: 34px;
/* ===== Espacement — dérivé des valeurs réellement observées dans le kit
audité, pas d'une grille 4pt appliquée mécaniquement. --space-4 (14px)
vient exactement du padding de l'Action Sheet/Alert card ; --space-5
(16px) du padding des List Row/Text Field/Toolbar ; --space-6 (20px)
du padding horizontal du bouton Bordered-Prominent Large. --space-7/8
étendent la base à 6 crans demandée pour couvrir les grands espacements
déjà en usage (Empty State). Théorique et sans dépendance au thème —
aucune valeur dark distincte n'est nécessaire ici. */
--space-1: 2px;
--space-2: 4px;
--space-3: 8px;
--space-4: 14px;
--space-5: 16px;
--space-6: 20px;
--space-7: 24px;
--space-8: 48px;
/* ===== Couches — .dialog-overlay reste à 1000 (valeur historique, non
migrée) ; le toast s'affiche au-dessus, y compris d'un dialogue. ===== */
--z-toast: 1100;
/* ===== Typographie — échelle réelle (points Apple), police nApps (Manrope) =====
Taille/graisse/interligne/tracking vérifiés sur le kit — la hiérarchie se fait
autant par le POIDS que par la taille (Headline et Body partagent 17pt). */
--font-family: 'Manrope', sans-serif;
--text-large-title-size: 34px; --text-large-title-line: 41px; --text-large-title-weight: 800; --text-large-title-tracking: -0.02em;
--text-title1-size: 28px; --text-title1-line: 34px; --text-title1-weight: 700;
--text-title2-size: 22px; --text-title2-line: 28px; --text-title2-weight: 700;
--text-title3-size: 20px; --text-title3-line: 25px; --text-title3-weight: 600;
--text-headline-size: 17px; --text-headline-line: 22px; --text-headline-weight: 700; --text-headline-tracking: -0.43px;
--text-body-size: 17px; --text-body-line: 22px; --text-body-weight: 400; --text-body-tracking: -0.43px;
--text-callout-size: 16px; --text-callout-line: 21px; --text-callout-weight: 400;
--text-subheadline-size: 15px; --text-subheadline-line: 20px; --text-subheadline-weight: 400; --text-subheadline-tracking: -0.23px;
--text-footnote-size: 13px; --text-footnote-line: 18px; --text-footnote-weight: 400;
--text-caption1-size: 12px; --text-caption1-line: 16px; --text-caption1-weight: 400;
--text-caption2-size: 11px; --text-caption2-line: 13px; --text-caption2-weight: 400;
}
/* ============================================================
DARK MODE — les tokens ne sont jamais une simple inversion.
Découverte de l'audit : fills/secondary passe de 16% à 32% en
dark (pas juste "même valeur sur fond sombre") ; les surfaces
s'ÉCLAIRCISSENT en montant (page < groupée < imbriquée), à
l'inverse du light. Chaque token dark est vérifié, pas déduit.
============================================================ */
:root[data-theme="dark"] {
--napps-accent: #4C93FF;
--napps-success: #43C283;
--napps-warning: #E8AC52;
--napps-error: #F17B70;
--label-primary: rgba(255, 255, 255, 1);
--label-secondary: rgba(255, 255, 255, 0.6);
--label-tertiary: rgba(255, 255, 255, 0.3);
--label-quaternary: rgba(255, 255, 255, 0.18);
--fill-primary: rgba(255, 255, 255, 0.24);
--fill-secondary: rgba(255, 255, 255, 0.32);
--fill-tertiary: rgba(255, 255, 255, 0.16);
--separator: rgba(255, 255, 255, 0.12);
--bg-page: #15171C;
--bg-grouped: #1D1F26;
--bg-nested: #262930;
}
/* ============================================================
MATÉRIAUX — TROIS familles (pas une par composant) :
1. "control" — bouton flottant, barre d'outils, capsule isolée,
posé sur du contenu qui défile derrière lui.
2. "panel" — grande surface de dialogue, TOUJOURS avec un scrim
assombri derrière (voir .dialog-overlay) — jamais directement
sur du contenu de page, il y devient illisible.
3. "popover" — menu/popover flottant SANS scrim, posé directement
sur du contenu de page réel (ex. un menu de navigation). Plus
opaque que "control" pour rester lisible sans fond assombri.
Calibré sur la 3e nuance de verre observée dans l'audit du kit
(Popovers, blur 65px, ombre 0 10px 50px) — voir
figma-kit-audit.md.
============================================================ */
/* v0.1.6 — LA LISIBILITÉ NE DOIT JAMAIS DÉPENDRE DU FLOU. Sans flou
réel, une teinte translucide seule laisse le contenu dessous visible
et net — illisible, pas juste "moins joli" (constaté en usage réel :
même à 85 % d'opacité, un fantôme du texte dessous reste visible ;
seul 100 % garantit la lisibilité). Donc, pour control et popover :
fond OPAQUE par défaut (token de surface --bg-grouped, déjà vérifié
indépendamment en light ET dark — aucune valeur brute nouvelle), et
la translucidité + le flou ne s'activent qu'en amélioration
progressive, quand le moteur reconnaît backdrop-filter ET que
l'utilisateur n'a pas demandé de réduire la transparence (bloc
@media (prefers-reduced-transparency: reduce) en fin de section).
LIMITE ASSUMÉE : @supports ne teste que la reconnaissance de la
syntaxe, pas le compositing GPU réel — rien en CSS (ni en JS : aucune
API ne permet de lire le résultat d'un backdrop-filter) ne peut le
détecter. Une matière translucide reste donc un enrichissement pour du
chrome (tab bar, toolbar) ; tout contenu dont la lisibilité est
critique (ex. menu de navigation) doit utiliser une surface opaque
(.surface-grouped / Surface level="grouped"). */
.material-control {
background: var(--bg-grouped);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.6),
inset 0 -1px 0 rgba(0, 0, 0, 0.04),
0 8px 15px rgba(0, 0, 0, 0.02);
}
:root[data-theme="dark"] .material-control {
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.06),
inset 0 -1px 0 rgba(0, 0, 0, 0.3),
0 8px 15px rgba(0, 0, 0, 0.35);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
.material-control {
background: rgba(255, 255, 255, 0.55);
-webkit-backdrop-filter: blur(46px) saturate(1.6);
backdrop-filter: blur(46px) saturate(1.6);
}
:root[data-theme="dark"] .material-control {
background: rgba(38, 41, 48, 0.5);
-webkit-backdrop-filter: blur(46px) saturate(1.4);
backdrop-filter: blur(46px) saturate(1.4);
}
}
.material-panel {
background: rgba(255, 255, 255, 0.85);
-webkit-backdrop-filter: blur(30px);
backdrop-filter: blur(30px);
box-shadow: 0 8px 48px rgba(0, 0, 0, 0.25);
}
:root[data-theme="dark"] .material-panel {
background: rgba(20, 20, 20, 0.85);
-webkit-backdrop-filter: blur(30px);
backdrop-filter: blur(30px);
box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
}
/* Popover — background/box-shadow light directement audités (0.72
d'opacité, ombre 0 10px 50px rgba(0,0,0,.3) exacte). En dark,
aucune nuance popover indépendante n'a été auditée : on réutilise
tel quel le fond et l'ombre de .material-control dark (déjà
vérifiés) plutôt que d'extrapoler une valeur non vérifiée — seul
le flou (65px, un paramètre physique, pas une couleur) est repris
du popover light. Asymétrie assumée, à corriger si un jour une
vraie extraction dark du popover est disponible. */
.material-popover {
background: var(--bg-grouped);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.6),
inset 0 -1px 0 rgba(0, 0, 0, 0.04),
0 10px 50px rgba(0, 0, 0, 0.3);
}
:root[data-theme="dark"] .material-popover {
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.06),
inset 0 -1px 0 rgba(0, 0, 0, 0.3),
0 8px 15px rgba(0, 0, 0, 0.35);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
.material-popover {
background: rgba(255, 255, 255, 0.72);
-webkit-backdrop-filter: blur(65px) saturate(1.6);
backdrop-filter: blur(65px) saturate(1.6);
}
:root[data-theme="dark"] .material-popover {
background: rgba(38, 41, 48, 0.5);
-webkit-backdrop-filter: blur(65px) saturate(1.4);
backdrop-filter: blur(65px) saturate(1.4);
}
}
/* Réduire la transparence (réglage d'accessibilité, là où le moteur
implémente cette media query) : retour à la surface opaque. Placé
APRÈS les blocs @supports pour gagner à spécificité égale ; le
sélecteur dark est répété pour égaler la spécificité des règles
dark ci-dessus (une seule valeur, --bg-grouped s'adapte au thème). */
@media (prefers-reduced-transparency: reduce) {
.material-control,
:root[data-theme="dark"] .material-control,
.material-popover,
:root[data-theme="dark"] .material-popover {
background: var(--bg-grouped);
-webkit-backdrop-filter: none;
backdrop-filter: none;
}
}
/* ============================================================
COMPOSANTS de référence — construits uniquement à partir des
tokens ci-dessus. Aucune valeur ad hoc.
============================================================ */
/* Bouton primaire (= Bordered-Prominent d'Apple) */
.btn-primary {
background: var(--napps-accent);
color: #FFFFFF;
border: none;
border-radius: var(--radius-pill);
min-height: var(--control-height-regular);
padding: 0 var(--space-6);
font: var(--text-subheadline-weight) var(--text-subheadline-size)/var(--text-subheadline-line) var(--font-family);
letter-spacing: var(--text-subheadline-tracking);
}
.btn-primary--compact {
min-height: var(--control-height-compact);
padding: 0 var(--space-4);
font-size: var(--text-subheadline-size);
}
/* Bouton secondaire discret (= Bordered d'Apple — PAS un contour) */
.btn-secondary {
background: var(--fill-tertiary);
color: var(--napps-accent);
border: none;
border-radius: var(--radius-pill);
min-height: var(--control-height-regular);
padding: 0 var(--space-6);
font: var(--text-subheadline-weight) var(--text-subheadline-size)/var(--text-subheadline-line) var(--font-family);
letter-spacing: var(--text-subheadline-tracking);
}
.btn-secondary--compact {
min-height: var(--control-height-compact);
padding: 0 var(--space-4);
font-size: var(--text-subheadline-size);
}
/* Segmented control */
.segmented-control {
display: inline-flex;
background: var(--fill-tertiary);
border-radius: var(--radius-pill);
padding: var(--space-1);
gap: var(--space-1);
}
.segmented-control__item {
padding: 3px var(--space-4);
border-radius: var(--radius-pill);
font-size: var(--text-footnote-size);
font-weight: 510;
color: var(--label-primary);
min-height: 28px;
display: flex;
align-items: center;
}
.segmented-control__item--selected {
background: var(--bg-grouped);
font-weight: 600;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
/* Toggle */
.toggle {
width: 64px;
height: 28px;
border-radius: var(--radius-pill);
background: var(--label-tertiary);
position: relative;
}
.toggle--on { background: var(--napps-success); }
.toggle__knob {
width: 24px; height: 24px;
border-radius: var(--radius-pill);
background: #FFFFFF;
position: absolute; top: var(--space-1); left: var(--space-1);
}
.toggle--on .toggle__knob { left: auto; right: var(--space-1); }
/* List row */
.list-row {
border-top: 1px solid var(--separator);
padding: 0 var(--space-5);
min-height: 52px;
display: flex; align-items: center;
gap: var(--space-4);
width: 100%;
text-align: left;
background: none;
font-family: inherit;
}
/* Colonne titre : min-width:0 (posé en inline sur le composant) laisse déjà le flex-item se
réduire ; ellipsis pour qu'un titre/sous-titre long soit tronqué proprement au lieu de wrapper
indéfiniment quelle que soit la largeur laissée par trailing. */
.list-row__title,
.list-row__subtitle {
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row__title { font-size: var(--text-body-size); color: var(--label-primary); }
.list-row__subtitle { font-size: var(--text-subheadline-size); color: var(--label-secondary); }
/* trailing : sans garde-fou, un contenu non wrappable (Badge, Button — tous deux
white-space:nowrap / pilule) refuse de rétrécir sous flexbox (min-width:auto par défaut) et
prélève l'espace manquant sur la colonne titre au lieu du sien. flex-shrink:0 fixerait sa
largeur naturelle sans jamais la limiter ; max-width borne ce cas-là aussi. */
.list-row__trailing {
flex-shrink: 0;
max-width: 50%;
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row--interactive { cursor: pointer; }
/* Text field */
.text-field {
border: none;
border-top: 1px solid var(--separator);
outline: none;
width: 100%;
background: transparent;
color: var(--label-primary);
padding: var(--space-5);
min-height: 52px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* v0.1.6 — le texte de champ passe de Body (17px) à Subheadline (15px).
Le kit audité utilise 17pt dans une liste groupée où les libellés
voisins sont eux aussi en 17pt ; les apps nApps ont des libellés plus
petits (caption1 12px, subheadline 15px), et 17px ressortait trop
imposant à côté. Écart assumé par rapport à la valeur auditée, motivé
par la proportion avec le chrome nApps. Le sélecteur composé
(.text-field.text-body, spécificité 0,2,0) bat .text-body (0,1,0)
quel que soit l'ordre, que le champ vienne du composant React (qui
pose toujours .text-body) ou d'un usage direct des classes. */
.text-field,
.text-field.text-body {
font: var(--text-subheadline-weight) var(--text-subheadline-size)/var(--text-subheadline-line) var(--font-family);
letter-spacing: var(--text-subheadline-tracking);
margin: 0;
}
.text-field--placeholder { color: var(--label-tertiary); }
.text-field__cursor { width: 2px; height: 22px; border-radius: 10px; background: var(--napps-accent); }
.text-field--compact {
border-top: none;
background: var(--fill-secondary);
border-radius: var(--radius-pill);
min-height: var(--control-height-compact);
padding: 0 var(--space-4);
}
/* Empty state — badge circulaire réutilisable (Activity View + Empty State du kit) */
.icon-badge {
width: 50px; height: 50px;
border-radius: var(--radius-pill);
display: flex; align-items: center; justify-content: center;
}
.icon-badge--neutral { background: var(--fill-tertiary); color: var(--label-primary); }
.icon-badge--accent { background: color-mix(in srgb, var(--napps-accent) 15%, transparent); color: var(--napps-accent); }
/* ============================================================
SURFACES — hiérarchie de fond, jamais d'ombre pour distinguer
les niveaux (voir "Couches de couleur" dans les planches A4).
============================================================ */
.surface-page { background: var(--bg-page); }
.surface-grouped { background: var(--bg-grouped); border-radius: var(--radius-card); }
.surface-nested { background: var(--bg-nested); border-radius: calc(var(--radius-card) - 4px); }
/* ============================================================
TYPOGRAPHIE — une classe par échelon. La hiérarchie se lit
dans le POIDS autant que dans la taille (headline == body en
taille, 17px, seul le poids change).
============================================================ */
.text-large-title { font: var(--text-large-title-weight) var(--text-large-title-size)/var(--text-large-title-line) var(--font-family); letter-spacing: var(--text-large-title-tracking); margin: 0; }
.text-title1 { font: var(--text-title1-weight) var(--text-title1-size)/var(--text-title1-line) var(--font-family); margin: 0; }
.text-title2 { font: var(--text-title2-weight) var(--text-title2-size)/var(--text-title2-line) var(--font-family); margin: 0; }
.text-title3 { font: var(--text-title3-weight) var(--text-title3-size)/var(--text-title3-line) var(--font-family); margin: 0; }
.text-headline { font: var(--text-headline-weight) var(--text-headline-size)/var(--text-headline-line) var(--font-family); letter-spacing: var(--text-headline-tracking); margin: 0; }
.text-body { font: var(--text-body-weight) var(--text-body-size)/var(--text-body-line) var(--font-family); letter-spacing: var(--text-body-tracking); margin: 0; }
.text-callout { font: var(--text-callout-weight) var(--text-callout-size)/var(--text-callout-line) var(--font-family); margin: 0; }
.text-subheadline { font: var(--text-subheadline-weight) var(--text-subheadline-size)/var(--text-subheadline-line) var(--font-family); margin: 0; }
.text-footnote { font: var(--text-footnote-weight) var(--text-footnote-size)/var(--text-footnote-line) var(--font-family); margin: 0; }
.text-caption1 { font: var(--text-caption1-weight) var(--text-caption1-size)/var(--text-caption1-line) var(--font-family); margin: 0; }
.text-caption2 { font: var(--text-caption2-weight) var(--text-caption2-size)/var(--text-caption2-line) var(--font-family); margin: 0; }
.text-primary { color: var(--label-primary); }
.text-secondary { color: var(--label-secondary); }
.text-tertiary { color: var(--label-tertiary); }
.text-quaternary { color: var(--label-quaternary); }
/* ============================================================
CARD — surface groupée standard, contenu libre.
============================================================ */
.card {
background: var(--bg-grouped);
border-radius: var(--radius-card-lg);
padding: var(--space-5);
}
/* ============================================================
BADGE — pastille de statut, jamais seul signal (toujours du texte).
============================================================ */
.badge {
display: inline-flex;
align-items: center;
gap: var(--space-2);
padding: 3px var(--space-3);
border-radius: 8px;
font-size: var(--text-caption1-size);
font-weight: 600;
white-space: nowrap;
}
.badge--neutral { background: var(--fill-tertiary); color: var(--label-primary); }
.badge--accent { background: color-mix(in srgb, var(--napps-accent) 12%, transparent); color: var(--napps-accent); }
.badge--success { background: color-mix(in srgb, var(--napps-success) 15%, transparent); color: var(--napps-success); }
.badge--warning { background: color-mix(in srgb, var(--napps-warning) 15%, transparent); color: var(--napps-warning); }
.badge--error { background: color-mix(in srgb, var(--napps-error) 15%, transparent); color: var(--napps-error); }
/* ============================================================
FORMULAIRES AVANCÉS — checkbox, radio, select.
Même échelle de fill que le reste (fill-tertiary au repos).
============================================================ */
.checkbox, .radio {
width: 22px; height: 22px;
flex-shrink: 0;
display: inline-flex; align-items: center; justify-content: center;
border: none; cursor: pointer; padding: 0;
background: var(--fill-tertiary);
color: transparent;
}
.checkbox { border-radius: 6px; }
.radio { border-radius: var(--radius-pill); }
.checkbox--checked, .radio--checked { background: var(--napps-accent); color: #FFFFFF; }
.checkbox:disabled, .radio:disabled { opacity: 0.5; cursor: default; }
.select-wrapper { position: relative; }
.select {
appearance: none; -webkit-appearance: none;
width: 100%;
border: none;
border-top: 1px solid var(--separator);
background: transparent;
padding: var(--space-5) 32px var(--space-5) var(--space-5);
font: var(--text-subheadline-weight) var(--text-subheadline-size)/var(--text-subheadline-line) var(--font-family);
letter-spacing: var(--text-subheadline-tracking);
color: var(--label-primary);
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.select-chevron {
position: absolute; right: var(--space-2); top: 50%; transform: translateY(-50%);
pointer-events: none;
color: var(--label-tertiary);
font-size: 12px;
}
/* Compacte — reprend la recette du Search Field du kit audité (fond
fill-secondary en pilule) plutôt que la ligne à hairline du regular,
adaptée aux barres de filtres / actions inline de liste. */
.select--compact {
border-top: none;
background: var(--fill-secondary);
border-radius: var(--radius-pill);
min-height: var(--control-height-compact);
padding: 0 var(--space-6) 0 var(--space-4);
}
.select-wrapper--compact .select-chevron { right: var(--space-3); }
/* ============================================================
FEEDBACK — spinner, empty state, dialog (verre de panneau).
============================================================ */
.spinner {
border-radius: var(--radius-pill);
border: 2px solid var(--fill-tertiary);
border-top-color: var(--label-secondary);
animation: napps-spin 0.7s linear infinite;
display: inline-block;
}
.spinner--small { width: 14px; height: 14px; border-width: 2px; }
.spinner--regular { width: 20px; height: 20px; border-width: 2px; }
.spinner--large { width: 35px; height: 35px; border-width: 3px; }
@keyframes napps-spin { to { transform: rotate(360deg); } }
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
gap: var(--space-4);
padding: var(--space-8) var(--space-7);
}
.dialog-overlay {
position: fixed; inset: 0;
background: rgba(0, 0, 0, 0.4);
display: flex; align-items: center; justify-content: center;
padding: var(--space-6);
z-index: 1000;
}
.dialog {
width: 100%; max-width: 270px;
border-radius: 20px;
padding: var(--space-4);
display: flex; flex-direction: column; gap: var(--space-4);
text-align: center;
}
.dialog__title { font: var(--text-headline-weight) var(--text-headline-size)/var(--text-headline-line) var(--font-family); color: var(--label-primary); margin: 0; }
.dialog__message { font: var(--text-body-weight) var(--text-body-size)/var(--text-body-line) var(--font-family); color: var(--label-primary); margin: 0; }
.dialog__actions { display: flex; flex-direction: column; gap: var(--space-3); }
.dialog__action {
border: none;
border-radius: var(--radius-pill);
min-height: var(--tap-target-min);
font: 600 var(--text-body-size)/var(--text-body-line) var(--font-family);
cursor: pointer;
}
.dialog__action--default { background: var(--napps-accent); color: #FFFFFF; }
.dialog__action--cancel { background: var(--fill-secondary); color: var(--label-primary); }
.dialog__action--destructive { background: var(--fill-secondary); color: var(--napps-error); }
/* ============================================================
NAVIGATION — tab bar flottante et toolbar, toutes deux en
"verre de contrôle" (.material-control), jamais en aplat.
============================================================ */
.tab-bar { display: inline-flex; gap: var(--space-2); padding: 6px; }
.tab-bar__item {
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
min-width: 56px; min-height: var(--tap-target-min);
border-radius: var(--radius-pill);
font-size: var(--text-caption2-size);
font-weight: 600;
color: var(--label-secondary);
background: none; border: none; cursor: pointer;
}
.tab-bar__item--active { color: var(--napps-accent); }
.toolbar {
display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
padding: 0 6px 0 var(--space-5);
min-height: 52px;
border-radius: var(--radius-pill);
}
.toolbar__title { font: var(--text-headline-weight) var(--text-headline-size)/var(--text-headline-line) var(--font-family); color: var(--label-primary); }
.toolbar__actions { display: flex; align-items: center; gap: var(--space-2); }
/* ============================================================
ÉTATS D'INTERACTION — hover (pointeur uniquement, jamais collé
au tactile), pressé (discret, pas d'animation voyante), focus
clavier visible (focus-visible seulement, jamais au clic souris).
Limité strictement aux contrôles qui en manquaient : btn-primary,
btn-secondary, select, checkbox, radio, toggle, tab-bar__item,
list-row (variante --interactive). Toutes les couleurs viennent de
tokens déjà vérifiés indépendamment en dark — aucune nouvelle
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) {
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) {
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--napps-accent) 88%, black); }
.btn-secondary:hover:not(:disabled) { background: var(--fill-secondary); }
.select:hover { background: var(--fill-tertiary); }
.checkbox:not(.checkbox--checked):hover:not(:disabled),
.radio:not(.radio--checked):hover:not(:disabled) { background: var(--fill-secondary); }
.checkbox--checked:hover:not(:disabled),
.radio--checked:hover:not(:disabled) { background: color-mix(in srgb, var(--napps-accent) 88%, black); }
.toggle:hover { filter: brightness(0.96); }
.tab-bar__item:hover:not(.tab-bar__item--active) { color: var(--label-primary); }
.list-row--interactive:hover { background: var(--fill-tertiary); }
}
.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.select:active,
.checkbox:active:not(:disabled),
.radio:active:not(:disabled),
.toggle:active,
.tab-bar__item:active,
.list-row--interactive:active {
opacity: 0.7;
transform: scale(0.97);
}
:where(.btn-primary, .btn-secondary, .select, .checkbox, .radio, .toggle, .tab-bar__item, .list-row--interactive):focus-visible {
outline: 2px solid var(--napps-accent);
outline-offset: 2px;
}
/* ============================================================
COLOR PICKER — sélecteur rond, même logique que icon-badge mais
dédié à afficher/choisir une couleur arbitraire (catégorie,
étiquette, tag). L'anneau vient de tokens de surface déjà
vérifiés en dark (bg-grouped, separator), pas de nouvelle valeur.
============================================================ */
.color-picker { display: inline-flex; gap: var(--space-3); flex-wrap: wrap; }
.color-swatch {
position: relative;
width: 28px; height: 28px;
border-radius: var(--radius-pill);
border: 2px solid var(--bg-grouped);
box-shadow: 0 0 0 1px var(--separator);
padding: 0;
cursor: pointer;
flex-shrink: 0;
display: inline-flex;
align-items: center;
justify-content: center;
}
.color-swatch--selected {
box-shadow: 0 0 0 2px var(--bg-grouped), 0 0 0 4px var(--napps-accent);
}
.color-swatch:focus-visible {
outline: 2px solid var(--napps-accent);
outline-offset: 2px;
}
.color-swatch__check {
color: #FFFFFF;
filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
}
.color-picker__input {
position: absolute; inset: 0;
opacity: 0;
cursor: pointer;
border: none;
padding: 0;
width: 100%;
height: 100%;
}
/* ============================================================
TOAST — confirmation discrète après une action. Surface OPAQUE
(jamais une matière translucide : la lisibilité ne dépend jamais
du flou), pilule, centrée en bas. L'ombre est celle de
.material-panel/.dialog — 0 8px 48px à .25 en light et .5 en dark,
deux valeurs déjà vérifiées séparément — plus un liseré separator
(token dark vérifié) qui garde le contour lisible sur fond sombre
où l'ombre seule se voit à peine. Les couleurs d'icône viennent des
tokens success/error, qui ont chacun leur valeur dark.
============================================================ */
.toast-region {
position: fixed;
left: 0; right: 0;
bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
display: flex;
justify-content: center;
padding: 0 var(--space-5);
pointer-events: none;
z-index: var(--z-toast);
}
.toast {
box-sizing: border-box;
display: inline-flex;
align-items: center;
gap: var(--space-3);
min-height: var(--control-height-regular);
max-width: 100%;
padding: var(--space-3) var(--space-5);
border-radius: var(--radius-pill);
background: var(--bg-grouped);
color: var(--label-primary);
font: var(--text-subheadline-weight) var(--text-subheadline-size)/var(--text-subheadline-line) var(--font-family);
letter-spacing: var(--text-subheadline-tracking);
box-shadow: 0 0 0 1px var(--separator), 0 8px 48px rgba(0, 0, 0, 0.25);
animation: napps-toast-in 120ms ease-out;
}
:root[data-theme="dark"] .toast {
box-shadow: 0 0 0 1px var(--separator), 0 8px 48px rgba(0, 0, 0, 0.5);
}
.toast__icon { display: inline-flex; flex-shrink: 0; }
.toast--success .toast__icon { color: var(--napps-success); }
.toast--error .toast__icon { color: var(--napps-error); }
.toast__message { min-width: 0; overflow-wrap: anywhere; }
@keyframes napps-toast-in { from { opacity: 0; transform: translateY(var(--space-3)); } }
@media (prefers-reduced-motion: reduce) {
.toast { animation: none; }
}