Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b171bbe816 | ||
|
|
208d03b7be | ||
|
|
39dc123a93 | ||
|
|
dc74b1b97b |
@@ -80,6 +80,154 @@ 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 (diagnostic corrigé en v0.1.5)** : le vrai mécanisme
|
||||||
|
n'est pas une histoire de spécificité `:where()` sur `space-y-*`/`space-x-*` spécifiquement —
|
||||||
|
c'est plus large. Tailwind range tous ses utilitaires dans des `@layer` CSS (cascade layers) ;
|
||||||
|
`tokens.css` n'utilise aucun layer. Par la spécification CSS, **du CSS non calqué (`tokens.css`)
|
||||||
|
bat toujours du CSS calqué (les utilitaires Tailwind), quelle que soit la spécificité ou l'ordre
|
||||||
|
des règles.** Ce n'est donc pas limité à l'espacement : `mb-*`, `mt-*`, `pt-*`, `font-semibold`,
|
||||||
|
ou n'importe quel autre utilitaire Tailwind appliqué directement sur un élément qui porte déjà
|
||||||
|
une classe du design system (`.text-*` ou autre) fixant la même propriété perdra systématiquement.
|
||||||
|
Aucun bug d'un côté ni de l'autre — deux mécanismes de cascade valides qui entrent en collision.
|
||||||
|
|
||||||
|
Pour tout espacement ou style autour d'un composant du design system, utiliser `gap` (flex/grid)
|
||||||
|
ou un style inline plutôt qu'un utilitaire Tailwind de marge/padding/graisse — les deux échappent
|
||||||
|
au problème (`gap` n'est pas une marge ; un style inline bat n'importe quelle classe, calquée ou
|
||||||
|
non, quoi qu'il arrive).
|
||||||
|
|
||||||
|
## 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 à
|
||||||
|
toutes les apps qui le consomment.
|
||||||
|
|
||||||
|
**États d'interaction** : `Button`, `Select`, `Checkbox`, `Radio`, `Toggle`, `TabBar` (item),
|
||||||
|
et `ListRow` (rendue interactive dès qu'un `onClick` est fourni) ont maintenant un hover
|
||||||
|
(pointeur uniquement), un état pressé discret (opacité + micro scale-down, sans animation
|
||||||
|
voyante) et un anneau de focus clavier visible (`:focus-visible` uniquement, jamais au clic
|
||||||
|
souris). Rien à changer côté usage — c'est automatique.
|
||||||
|
|
||||||
|
**Taille compacte** : `Button`, `Select` et `TextField` acceptent désormais `size="compact"`
|
||||||
|
(~34px, échelle pilule pleine — même recette que le Search Field du kit audité) en plus de
|
||||||
|
`size="regular"` (défaut, comportement historique inchangé) :
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
<Button size="compact">Filtrer</Button>
|
||||||
|
<TextField size="compact" placeholder="Rechercher…" />
|
||||||
|
```
|
||||||
|
|
||||||
|
**Tokens d'espacement** : `--space-1` (2px) à `--space-8` (48px), dérivés des valeurs
|
||||||
|
réellement observées dans le kit audité (`--space-4` = 14px, padding exact de l'Action
|
||||||
|
Sheet ; `--space-6` = 20px, padding exact du bouton Bordered-Prominent). Tous les composants
|
||||||
|
existants ont été migrés dessus — à référencer plutôt que d'inventer un `px` dans une app.
|
||||||
|
|
||||||
|
**ColorPicker** (18ᵉ composant) — déclencheur rond pour choisir une couleur (catégorie,
|
||||||
|
étiquette, tag). Sans `options` : ouvre le sélecteur natif du système. Avec `options` :
|
||||||
|
palette fermée de pastilles cliquables.
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
<ColorPicker
|
||||||
|
value={color}
|
||||||
|
onChange={setColor}
|
||||||
|
options={['#0B6CFF', '#1FA968', '#D68C1B', '#E6483D']}
|
||||||
|
aria-label="Couleur de la catégorie"
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 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.
|
||||||
|
|
||||||
|
## v0.1.5 — troisième matière (popover), troncature, correction du diagnostic Tailwind
|
||||||
|
|
||||||
|
Trois retours d'usage réel (app Cars), applicables à toutes les apps qui consomment le
|
||||||
|
design system :
|
||||||
|
|
||||||
|
- **Diagnostic Tailwind corrigé** — voir la note ci-dessus, section usage : le vrai
|
||||||
|
mécanisme est les cascade layers, pas une histoire de spécificité limitée à `space-y-*`.
|
||||||
|
- **`Surface material="popover"`** (nouvelle valeur, en plus de `"control"` et `"panel"`) —
|
||||||
|
pour un menu ou un popover flottant directement sur du contenu de page, sans scrim
|
||||||
|
assombri derrière. `.material-panel` reste réservé aux dialogues avec scrim (illisible
|
||||||
|
sans) ; `.material-control` aux éléments flottants isolés sur du contenu qui défile.
|
||||||
|
Calibré sur la 3ᵉ nuance de verre réellement observée dans l'audit (Popovers, blur 65px,
|
||||||
|
ombre `0 10px 50px`) — voir `figma-kit-audit.md`. Sa valeur dark réutilise telle quelle
|
||||||
|
celle de `.material-control` (aucune nuance popover dark n'a été auditée indépendamment ;
|
||||||
|
asymétrie assumée et documentée dans `tokens.css`, à corriger si une extraction dark
|
||||||
|
devient disponible).
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
<Surface material="popover">Menu de navigation flottant</Surface>
|
||||||
|
```
|
||||||
|
|
||||||
|
- **`TextField` et `Select`** tronquent maintenant proprement (`text-overflow: ellipsis`) au
|
||||||
|
lieu de couper net une valeur trop longue dans un contrôle étroit (`size="compact"`, barre
|
||||||
|
de filtres, action de ligne).
|
||||||
|
|
||||||
|
Si votre app contournait l'un de ces bugs localement (`.surface-grouped` à la place d'un
|
||||||
|
matériau translucide, règle CSS applicative pour la troncature), ce contournement peut être
|
||||||
|
retiré après la mise à jour vers v0.1.5.
|
||||||
|
|
||||||
|
## v0.1.6 — matières : repli opaque ; champs en 15px
|
||||||
|
|
||||||
|
Deux retours d'usage réel (app Cars), applicables à toutes les apps qui consomment le design
|
||||||
|
system.
|
||||||
|
|
||||||
|
### 1. La lisibilité d'une matière ne doit jamais dépendre du flou
|
||||||
|
|
||||||
|
Sans flou réel, une teinte translucide seule laisse le contenu dessous visible et net : le
|
||||||
|
texte du menu entre en collision avec celui de la page — illisible, pas juste « moins joli ».
|
||||||
|
Même à 85 % d'opacité un fantôme reste visible ; seul 100 % garantit la lisibilité.
|
||||||
|
|
||||||
|
`.material-control` et `.material-popover` (donc `TabBar`, `Toolbar`, `Surface material=
|
||||||
|
"control"|"popover"`) ont désormais un **fond opaque par défaut** (`var(--bg-grouped)`, token de
|
||||||
|
surface déjà vérifié en light et en dark). La translucidité et le flou ne s'activent qu'en
|
||||||
|
amélioration progressive : quand le moteur reconnaît `backdrop-filter` (`@supports`) **et** que
|
||||||
|
l'utilisateur n'a pas demandé de réduire la transparence (`prefers-reduced-transparency:
|
||||||
|
reduce`, là où le navigateur l'implémente). Rendu inchangé dans un navigateur standard.
|
||||||
|
`.material-panel` n'est pas concerné (toujours utilisé avec un scrim, cf. `Dialog`).
|
||||||
|
|
||||||
|
**Limite à connaître** : `@supports` ne teste que la *reconnaissance de la syntaxe*, jamais le
|
||||||
|
compositing GPU réel — et rien ne permet de le détecter, ni en CSS ni en JS (aucune API ne
|
||||||
|
donne accès au résultat d'un `backdrop-filter` : un canvas ne le capture pas). Une matière
|
||||||
|
translucide reste donc un **enrichissement pour du chrome** (barre d'onglets, toolbar) ; **tout
|
||||||
|
contenu dont la lisibilité est critique (un menu de navigation, par exemple) doit utiliser une
|
||||||
|
surface opaque** : `Surface level="grouped"`.
|
||||||
|
|
||||||
|
Si `getComputedStyle(el).backdropFilter` renvoie `"none"` sur un élément portant une classe
|
||||||
|
`.material-*`, ce n'est **pas** un échec du GPU : le computed style est le résultat de la
|
||||||
|
cascade, pas du rendu. Cela signifie que la déclaration n'est pas appliquée sur cet élément
|
||||||
|
précis (surcharge applicative, ex. un utilitaire Tailwind `backdrop-filter`/`backdrop-blur-none`,
|
||||||
|
ou classe absente). Dans un Chromium de test, le package renvoie bien `blur(46px) saturate(1.6)`
|
||||||
|
(control) et `blur(65px) saturate(1.6)` (popover) en light, `saturate(1.4)` en dark.
|
||||||
|
|
||||||
|
### 2. TextField et Select : 15px au lieu de 17px
|
||||||
|
|
||||||
|
Le texte de champ passe de `--text-body-size` (17px) à `--text-subheadline-size` (15px), avec
|
||||||
|
son interlignage (20px) et son tracking (`--text-subheadline-tracking`, `-0.23px`, valeur
|
||||||
|
observée dans le kit). Valable pour `size="regular"` et `"compact"`. Écart assumé par rapport à
|
||||||
|
la valeur auditée : le kit utilise 17pt dans des listes dont les libellés sont eux aussi en 17pt ;
|
||||||
|
les apps nApps ont des libellés plus petits (`caption1`, `subheadline`), et 17px ressortait
|
||||||
|
trop imposant.
|
||||||
|
|
||||||
|
**Audit de cohérence des tailles de police** (toutes les déclarations de `tokens.css`) :
|
||||||
|
tout vient de l'échelle de tokens, sauf `.segmented-control__item` qui utilisait un littéral
|
||||||
|
`13.3px` hors échelle — désormais `--text-footnote-size` (13px, écart de 0,3px). Restent à 17px,
|
||||||
|
valeur auditée : `Button` regular, `ListRow` (titre), `Dialog`, `Toolbar` (titre). **Point à
|
||||||
|
arbitrer** : un champ (15px) placé sous un titre de `ListRow` (17px) crée un léger décalage
|
||||||
|
d'échelle dans une même liste groupée — non modifié ici pour ne pas changer le rendu des apps en
|
||||||
|
prod ; à trancher si vous voulez harmoniser tout le chrome autour de 15px.
|
||||||
|
|
||||||
## 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.2",
|
"version": "0.1.6",
|
||||||
"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.2",
|
"version": "0.1.6",
|
||||||
"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,18 +1,22 @@
|
|||||||
import { ButtonHTMLAttributes, forwardRef } from 'react';
|
import { ButtonHTMLAttributes, forwardRef } from 'react';
|
||||||
|
|
||||||
export type ButtonVariant = 'primary' | 'secondary';
|
export type ButtonVariant = 'primary' | 'secondary';
|
||||||
|
export type ButtonSize = 'regular' | 'compact';
|
||||||
|
|
||||||
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||||
variant?: ButtonVariant;
|
variant?: ButtonVariant;
|
||||||
|
/** "regular" (défaut, inchangé) ou "compact" (~34px, usages denses). */
|
||||||
|
size?: ButtonSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||||
({ variant = 'primary', className, ...props }, ref) => {
|
({ variant = 'primary', size = 'regular', className, ...props }, ref) => {
|
||||||
const variantClass = variant === 'primary' ? 'btn-primary' : 'btn-secondary';
|
const variantClass = variant === 'primary' ? 'btn-primary' : 'btn-secondary';
|
||||||
|
const sizeClass = size === 'compact' ? `${variantClass}--compact` : undefined;
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={[variantClass, className].filter(Boolean).join(' ')}
|
className={[variantClass, sizeClass, className].filter(Boolean).join(' ')}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import { ButtonHTMLAttributes } from 'react';
|
||||||
|
|
||||||
|
export interface ColorPickerProps {
|
||||||
|
/** Couleur courante (hex). */
|
||||||
|
value: string;
|
||||||
|
onChange: (color: string) => void;
|
||||||
|
/**
|
||||||
|
* Palette fermée nApps — si fournie, affiche des pastilles cliquables.
|
||||||
|
* Sinon, ouvre le sélecteur de couleur natif du système via un input
|
||||||
|
* caché superposé au déclencheur rond.
|
||||||
|
*/
|
||||||
|
options?: string[];
|
||||||
|
disabled?: boolean;
|
||||||
|
'aria-label': string;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Swatch({
|
||||||
|
color,
|
||||||
|
selected,
|
||||||
|
...props
|
||||||
|
}: { color: string; selected?: boolean } & ButtonHTMLAttributes<HTMLButtonElement>) {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className={['color-swatch', selected && 'color-swatch--selected'].filter(Boolean).join(' ')}
|
||||||
|
style={{ background: color }}
|
||||||
|
aria-pressed={selected}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{selected && (
|
||||||
|
<svg className="color-swatch__check" width="12" height="12" viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
||||||
|
<path d="M4 12.5L9.5 18L20 6" stroke="currentColor" strokeWidth="3.5" strokeLinecap="round" strokeLinejoin="round" />
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ColorPicker({ value, onChange, options, disabled, ...props }: ColorPickerProps) {
|
||||||
|
const label = props['aria-label'];
|
||||||
|
|
||||||
|
if (options && options.length > 0) {
|
||||||
|
return (
|
||||||
|
<div className="color-picker" role="radiogroup" aria-label={label}>
|
||||||
|
{options.map((color) => (
|
||||||
|
<Swatch
|
||||||
|
key={color}
|
||||||
|
color={color}
|
||||||
|
selected={color.toLowerCase() === value.toLowerCase()}
|
||||||
|
disabled={disabled}
|
||||||
|
aria-label={color}
|
||||||
|
onClick={() => onChange(color)}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span className="color-swatch" style={{ background: value }}>
|
||||||
|
<input
|
||||||
|
type="color"
|
||||||
|
className="color-picker__input"
|
||||||
|
value={value}
|
||||||
|
disabled={disabled}
|
||||||
|
aria-label={label}
|
||||||
|
onChange={(e) => onChange(e.target.value)}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,19 +1,31 @@
|
|||||||
import { HTMLAttributes, ReactNode } from 'react';
|
import { HTMLAttributes, ReactNode } from 'react';
|
||||||
|
|
||||||
export interface ListRowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
export interface ListRowProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
||||||
title: ReactNode;
|
title: ReactNode;
|
||||||
subtitle?: ReactNode;
|
subtitle?: ReactNode;
|
||||||
trailing?: ReactNode;
|
trailing?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ListRow({ title, subtitle, trailing, className, ...props }: ListRowProps) {
|
/**
|
||||||
|
* Rendue en <button> (focus clavier, hover/pressé via .list-row--interactive)
|
||||||
|
* dès qu'un onClick est fourni ; sinon en <div> statique, comportement
|
||||||
|
* inchangé pour tout usage existant.
|
||||||
|
*/
|
||||||
|
export function ListRow({ title, subtitle, trailing, className, onClick, ...props }: ListRowProps) {
|
||||||
|
const interactive = Boolean(onClick);
|
||||||
|
const Tag = interactive ? 'button' : 'div';
|
||||||
return (
|
return (
|
||||||
<div className={['list-row', className].filter(Boolean).join(' ')} {...props}>
|
<Tag
|
||||||
|
type={interactive ? 'button' : undefined}
|
||||||
|
className={['list-row', interactive && 'list-row--interactive', className].filter(Boolean).join(' ')}
|
||||||
|
onClick={onClick}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
<div style={{ flex: 1, minWidth: 0 }}>
|
<div style={{ flex: 1, minWidth: 0 }}>
|
||||||
<div className="list-row__title">{title}</div>
|
<div className="list-row__title">{title}</div>
|
||||||
{subtitle && <div className="list-row__subtitle">{subtitle}</div>}
|
{subtitle && <div className="list-row__subtitle">{subtitle}</div>}
|
||||||
</div>
|
</div>
|
||||||
{trailing && <div>{trailing}</div>}
|
{trailing && <div>{trailing}</div>}
|
||||||
</div>
|
</Tag>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,22 @@
|
|||||||
import { SelectHTMLAttributes, forwardRef } from 'react';
|
import { SelectHTMLAttributes, forwardRef } from 'react';
|
||||||
|
|
||||||
export type SelectProps = SelectHTMLAttributes<HTMLSelectElement>;
|
export type SelectSize = 'regular' | 'compact';
|
||||||
|
|
||||||
|
export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
||||||
|
/** "regular" (défaut, ligne à hairline inchangée) ou "compact" (pilule pleine, ~34px). */
|
||||||
|
size?: SelectSize;
|
||||||
|
}
|
||||||
|
|
||||||
export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
||||||
({ className, ...props }, ref) => {
|
({ size = 'regular', className, ...props }, ref) => {
|
||||||
|
const compact = size === 'compact';
|
||||||
return (
|
return (
|
||||||
<div className="select-wrapper">
|
<div className={['select-wrapper', compact && 'select-wrapper--compact'].filter(Boolean).join(' ')}>
|
||||||
<select ref={ref} className={['select', className].filter(Boolean).join(' ')} {...props} />
|
<select
|
||||||
|
ref={ref}
|
||||||
|
className={['select', compact && 'select--compact', className].filter(Boolean).join(' ')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
<span className="select-chevron" aria-hidden="true">
|
<span className="select-chevron" aria-hidden="true">
|
||||||
<svg width="10" height="10" viewBox="0 0 10 10" fill="none">
|
<svg width="10" height="10" viewBox="0 0 10 10" fill="none">
|
||||||
<path d="M1 3.5L5 7.5L9 3.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
|
<path d="M1 3.5L5 7.5L9 3.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
||||||
|
|
||||||
export type SurfaceLevel = 'page' | 'grouped' | 'nested';
|
export type SurfaceLevel = 'page' | 'grouped' | 'nested';
|
||||||
export type MaterialVariant = 'control' | 'panel';
|
export type MaterialVariant = 'control' | 'panel' | 'popover';
|
||||||
|
|
||||||
export interface SurfaceProps extends HTMLAttributes<HTMLElement> {
|
export interface SurfaceProps extends HTMLAttributes<HTMLElement> {
|
||||||
level?: SurfaceLevel;
|
level?: SurfaceLevel;
|
||||||
@@ -12,9 +12,12 @@ export interface SurfaceProps extends HTMLAttributes<HTMLElement> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Couche de fond. `level` suit la hiérarchie page → grouped → nested (couleur,
|
* Couche de fond. `level` suit la hiérarchie page → grouped → nested (couleur,
|
||||||
* jamais d'ombre). `material` superpose une des deux recettes de verre —
|
* jamais d'ombre). `material` superpose une des trois recettes de verre —
|
||||||
* "control" pour un élément flottant isolé, "panel" pour une grande surface
|
* "control" pour un élément flottant isolé sur du contenu qui défile,
|
||||||
* de dialogue — au lieu du niveau de couleur.
|
* "panel" pour une grande surface de dialogue (toujours avec un scrim
|
||||||
|
* assombri derrière, sinon illisible), "popover" pour un menu/popover
|
||||||
|
* flottant directement sur du contenu de page sans scrim — au lieu du
|
||||||
|
* niveau de couleur.
|
||||||
*/
|
*/
|
||||||
export function Surface({ level = 'grouped', material, as: Component = 'div', className, children, ...props }: SurfaceProps) {
|
export function Surface({ level = 'grouped', material, as: Component = 'div', className, children, ...props }: SurfaceProps) {
|
||||||
const classes = material
|
const classes = material
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
import { InputHTMLAttributes, forwardRef } from 'react';
|
import { InputHTMLAttributes, forwardRef } from 'react';
|
||||||
|
|
||||||
export type TextFieldProps = InputHTMLAttributes<HTMLInputElement>;
|
export type TextFieldSize = 'regular' | 'compact';
|
||||||
|
|
||||||
|
export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
||||||
|
/** "regular" (défaut, ligne à hairline inchangée) ou "compact" (pilule pleine, ~34px). */
|
||||||
|
size?: TextFieldSize;
|
||||||
|
}
|
||||||
|
|
||||||
export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
||||||
({ className, style, ...props }, ref) => {
|
({ size = 'regular', className, ...props }, ref) => {
|
||||||
|
const compact = size === 'compact';
|
||||||
return (
|
return (
|
||||||
<input
|
<input
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={['text-field', 'text-body', className].filter(Boolean).join(' ')}
|
className={['text-field', 'text-body', compact && 'text-field--compact', className]
|
||||||
style={{
|
.filter(Boolean)
|
||||||
border: 'none',
|
.join(' ')}
|
||||||
outline: 'none',
|
|
||||||
width: '100%',
|
|
||||||
background: 'transparent',
|
|
||||||
color: 'var(--label-primary)',
|
|
||||||
...style,
|
|
||||||
}}
|
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import './tokens.css';
|
import './tokens.css';
|
||||||
|
|
||||||
export { Button } from './components/Button';
|
export { Button } from './components/Button';
|
||||||
export type { ButtonProps, ButtonVariant } from './components/Button';
|
export type { ButtonProps, ButtonVariant, ButtonSize } from './components/Button';
|
||||||
|
|
||||||
export { SegmentedControl } from './components/SegmentedControl';
|
export { SegmentedControl } from './components/SegmentedControl';
|
||||||
export type { SegmentedControlProps, SegmentedControlOption } from './components/SegmentedControl';
|
export type { SegmentedControlProps, SegmentedControlOption } from './components/SegmentedControl';
|
||||||
@@ -10,7 +10,7 @@ export { Toggle } from './components/Toggle';
|
|||||||
export type { ToggleProps } from './components/Toggle';
|
export type { ToggleProps } from './components/Toggle';
|
||||||
|
|
||||||
export { TextField } from './components/TextField';
|
export { TextField } from './components/TextField';
|
||||||
export type { TextFieldProps } from './components/TextField';
|
export type { TextFieldProps, TextFieldSize } from './components/TextField';
|
||||||
|
|
||||||
export { ListRow } from './components/ListRow';
|
export { ListRow } from './components/ListRow';
|
||||||
export type { ListRowProps } from './components/ListRow';
|
export type { ListRowProps } from './components/ListRow';
|
||||||
@@ -37,7 +37,7 @@ export { Radio } from './components/Radio';
|
|||||||
export type { RadioProps } from './components/Radio';
|
export type { RadioProps } from './components/Radio';
|
||||||
|
|
||||||
export { Select } from './components/Select';
|
export { Select } from './components/Select';
|
||||||
export type { SelectProps } from './components/Select';
|
export type { SelectProps, SelectSize } from './components/Select';
|
||||||
|
|
||||||
export { Spinner } from './components/Spinner';
|
export { Spinner } from './components/Spinner';
|
||||||
export type { SpinnerProps, SpinnerSize } from './components/Spinner';
|
export type { SpinnerProps, SpinnerSize } from './components/Spinner';
|
||||||
@@ -53,3 +53,6 @@ export type { TabBarProps, TabBarItem } from './components/TabBar';
|
|||||||
|
|
||||||
export { Toolbar } from './components/Toolbar';
|
export { Toolbar } from './components/Toolbar';
|
||||||
export type { ToolbarProps } from './components/Toolbar';
|
export type { ToolbarProps } from './components/Toolbar';
|
||||||
|
|
||||||
|
export { ColorPicker } from './components/ColorPicker';
|
||||||
|
export type { ColorPickerProps } from './components/ColorPicker';
|
||||||
|
|||||||
@@ -47,6 +47,24 @@
|
|||||||
|
|
||||||
/* ===== Cible tactile minimale ===== */
|
/* ===== Cible tactile minimale ===== */
|
||||||
--tap-target-min: 44px;
|
--tap-target-min: 44px;
|
||||||
|
--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;
|
||||||
|
|
||||||
/* ===== Typographie — échelle réelle (points Apple), police nApps (Manrope) =====
|
/* ===== Typographie — échelle réelle (points Apple), police nApps (Manrope) =====
|
||||||
Taille/graisse/interligne/tracking vérifiés sur le kit — la hiérarchie se fait
|
Taille/graisse/interligne/tracking vérifiés sur le kit — la hiérarchie se fait
|
||||||
@@ -60,7 +78,7 @@
|
|||||||
--text-headline-size: 17px; --text-headline-line: 22px; --text-headline-weight: 700; --text-headline-tracking: -0.43px;
|
--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-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-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-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-footnote-size: 13px; --text-footnote-line: 18px; --text-footnote-weight: 400;
|
||||||
--text-caption1-size: 12px; --text-caption1-line: 16px; --text-caption1-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;
|
--text-caption2-size: 11px; --text-caption2-line: 13px; --text-caption2-weight: 400;
|
||||||
@@ -96,28 +114,62 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
MATÉRIAUX — DEUX familles seulement (pas une par composant) :
|
MATÉRIAUX — TROIS familles (pas une par composant) :
|
||||||
1. "control" — bouton flottant, barre d'outils, capsule isolée
|
1. "control" — bouton flottant, barre d'outils, capsule isolée,
|
||||||
2. "panel" — grande surface de dialogue (feuille, menu contextuel)
|
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 {
|
.material-control {
|
||||||
background: rgba(255, 255, 255, 0.55);
|
background: var(--bg-grouped);
|
||||||
backdrop-filter: blur(46px) saturate(1.6);
|
|
||||||
-webkit-backdrop-filter: blur(46px) saturate(1.6);
|
|
||||||
box-shadow:
|
box-shadow:
|
||||||
inset 0 1px 0 rgba(255, 255, 255, 0.6),
|
inset 0 1px 0 rgba(255, 255, 255, 0.6),
|
||||||
inset 0 -1px 0 rgba(0, 0, 0, 0.04),
|
inset 0 -1px 0 rgba(0, 0, 0, 0.04),
|
||||||
0 8px 15px rgba(0, 0, 0, 0.02);
|
0 8px 15px rgba(0, 0, 0, 0.02);
|
||||||
}
|
}
|
||||||
:root[data-theme="dark"] .material-control {
|
:root[data-theme="dark"] .material-control {
|
||||||
background: rgba(38, 41, 48, 0.5);
|
|
||||||
backdrop-filter: blur(46px) saturate(1.4);
|
|
||||||
-webkit-backdrop-filter: blur(46px) saturate(1.4);
|
|
||||||
box-shadow:
|
box-shadow:
|
||||||
inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
||||||
inset 0 -1px 0 rgba(0, 0, 0, 0.3),
|
inset 0 -1px 0 rgba(0, 0, 0, 0.3),
|
||||||
0 8px 15px rgba(0, 0, 0, 0.35);
|
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);
|
||||||
|
backdrop-filter: blur(46px) saturate(1.6);
|
||||||
|
-webkit-backdrop-filter: blur(46px) saturate(1.6);
|
||||||
|
}
|
||||||
|
:root[data-theme="dark"] .material-control {
|
||||||
|
background: rgba(38, 41, 48, 0.5);
|
||||||
|
backdrop-filter: blur(46px) saturate(1.4);
|
||||||
|
-webkit-backdrop-filter: blur(46px) saturate(1.4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.material-panel {
|
.material-panel {
|
||||||
background: rgba(255, 255, 255, 0.85);
|
background: rgba(255, 255, 255, 0.85);
|
||||||
@@ -132,6 +184,56 @@
|
|||||||
box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
|
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);
|
||||||
|
backdrop-filter: blur(65px) saturate(1.6);
|
||||||
|
-webkit-backdrop-filter: blur(65px) saturate(1.6);
|
||||||
|
}
|
||||||
|
:root[data-theme="dark"] .material-popover {
|
||||||
|
background: rgba(38, 41, 48, 0.5);
|
||||||
|
backdrop-filter: blur(65px) saturate(1.4);
|
||||||
|
-webkit-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);
|
||||||
|
backdrop-filter: none;
|
||||||
|
-webkit-backdrop-filter: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
COMPOSANTS de référence — construits uniquement à partir des
|
COMPOSANTS de référence — construits uniquement à partir des
|
||||||
tokens ci-dessus. Aucune valeur ad hoc.
|
tokens ci-dessus. Aucune valeur ad hoc.
|
||||||
@@ -144,10 +246,15 @@
|
|||||||
border: none;
|
border: none;
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
min-height: var(--tap-target-min);
|
min-height: var(--tap-target-min);
|
||||||
padding: 0 22px;
|
padding: 0 var(--space-6);
|
||||||
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);
|
||||||
letter-spacing: var(--text-body-tracking);
|
letter-spacing: var(--text-body-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) */
|
/* Bouton secondaire discret (= Bordered d'Apple — PAS un contour) */
|
||||||
.btn-secondary {
|
.btn-secondary {
|
||||||
@@ -156,23 +263,28 @@
|
|||||||
border: none;
|
border: none;
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
min-height: var(--tap-target-min);
|
min-height: var(--tap-target-min);
|
||||||
padding: 0 22px;
|
padding: 0 var(--space-6);
|
||||||
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);
|
||||||
letter-spacing: var(--text-body-tracking);
|
letter-spacing: var(--text-body-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 */
|
||||||
.segmented-control {
|
.segmented-control {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
background: var(--fill-tertiary);
|
background: var(--fill-tertiary);
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
padding: 2px;
|
padding: var(--space-1);
|
||||||
gap: 2px;
|
gap: var(--space-1);
|
||||||
}
|
}
|
||||||
.segmented-control__item {
|
.segmented-control__item {
|
||||||
padding: 3px 12px;
|
padding: 3px var(--space-4);
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
font-size: 13.3px;
|
font-size: var(--text-footnote-size);
|
||||||
font-weight: 510;
|
font-weight: 510;
|
||||||
color: var(--label-primary);
|
color: var(--label-primary);
|
||||||
min-height: 28px;
|
min-height: 28px;
|
||||||
@@ -198,28 +310,63 @@
|
|||||||
width: 24px; height: 24px;
|
width: 24px; height: 24px;
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
position: absolute; top: 2px; left: 2px;
|
position: absolute; top: var(--space-1); left: var(--space-1);
|
||||||
}
|
}
|
||||||
.toggle--on .toggle__knob { left: auto; right: 2px; }
|
.toggle--on .toggle__knob { left: auto; right: var(--space-1); }
|
||||||
|
|
||||||
/* List row */
|
/* List row */
|
||||||
.list-row {
|
.list-row {
|
||||||
border-top: 1px solid var(--separator);
|
border-top: 1px solid var(--separator);
|
||||||
padding: 0 16px;
|
padding: 0 var(--space-5);
|
||||||
min-height: 52px;
|
min-height: 52px;
|
||||||
display: flex; align-items: center;
|
display: flex; align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
background: none;
|
||||||
|
font-family: inherit;
|
||||||
}
|
}
|
||||||
.list-row__title { font-size: var(--text-body-size); color: var(--label-primary); }
|
.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); }
|
.list-row__subtitle { font-size: var(--text-subheadline-size); color: var(--label-secondary); }
|
||||||
|
.list-row--interactive { cursor: pointer; }
|
||||||
|
|
||||||
/* Text field */
|
/* Text field */
|
||||||
.text-field {
|
.text-field {
|
||||||
|
border: none;
|
||||||
border-top: 1px solid var(--separator);
|
border-top: 1px solid var(--separator);
|
||||||
padding: 16px;
|
outline: none;
|
||||||
|
width: 100%;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--label-primary);
|
||||||
|
padding: var(--space-5);
|
||||||
min-height: 52px;
|
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--placeholder { color: var(--label-tertiary); }
|
||||||
.text-field__cursor { width: 2px; height: 22px; border-radius: 10px; background: var(--napps-accent); }
|
.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) */
|
/* Empty state — badge circulaire réutilisable (Activity View + Empty State du kit) */
|
||||||
.icon-badge {
|
.icon-badge {
|
||||||
@@ -266,7 +413,7 @@
|
|||||||
.card {
|
.card {
|
||||||
background: var(--bg-grouped);
|
background: var(--bg-grouped);
|
||||||
border-radius: var(--radius-card-lg);
|
border-radius: var(--radius-card-lg);
|
||||||
padding: 18px;
|
padding: var(--space-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
@@ -275,8 +422,8 @@
|
|||||||
.badge {
|
.badge {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: var(--space-2);
|
||||||
padding: 3px 9px;
|
padding: 3px var(--space-3);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
font-size: var(--text-caption1-size);
|
font-size: var(--text-caption1-size);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -312,17 +459,32 @@
|
|||||||
border: none;
|
border: none;
|
||||||
border-top: 1px solid var(--separator);
|
border-top: 1px solid var(--separator);
|
||||||
background: transparent;
|
background: transparent;
|
||||||
padding: 16px 32px 16px 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-subheadline-weight) var(--text-subheadline-size)/var(--text-subheadline-line) var(--font-family);
|
||||||
|
letter-spacing: var(--text-subheadline-tracking);
|
||||||
color: var(--label-primary);
|
color: var(--label-primary);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.select-chevron {
|
.select-chevron {
|
||||||
position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
|
position: absolute; right: var(--space-2); top: 50%; transform: translateY(-50%);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
color: var(--label-tertiary);
|
color: var(--label-tertiary);
|
||||||
font-size: 12px;
|
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).
|
FEEDBACK — spinner, empty state, dialog (verre de panneau).
|
||||||
@@ -344,27 +506,27 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
gap: 12px;
|
gap: var(--space-4);
|
||||||
padding: 48px 24px;
|
padding: var(--space-8) var(--space-7);
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-overlay {
|
.dialog-overlay {
|
||||||
position: fixed; inset: 0;
|
position: fixed; inset: 0;
|
||||||
background: rgba(0, 0, 0, 0.4);
|
background: rgba(0, 0, 0, 0.4);
|
||||||
display: flex; align-items: center; justify-content: center;
|
display: flex; align-items: center; justify-content: center;
|
||||||
padding: 20px;
|
padding: var(--space-6);
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
.dialog {
|
.dialog {
|
||||||
width: 100%; max-width: 270px;
|
width: 100%; max-width: 270px;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
padding: 14px;
|
padding: var(--space-4);
|
||||||
display: flex; flex-direction: column; gap: 12px;
|
display: flex; flex-direction: column; gap: var(--space-4);
|
||||||
text-align: center;
|
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__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__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: 8px; }
|
.dialog__actions { display: flex; flex-direction: column; gap: var(--space-3); }
|
||||||
.dialog__action {
|
.dialog__action {
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
@@ -380,7 +542,7 @@
|
|||||||
NAVIGATION — tab bar flottante et toolbar, toutes deux en
|
NAVIGATION — tab bar flottante et toolbar, toutes deux en
|
||||||
"verre de contrôle" (.material-control), jamais en aplat.
|
"verre de contrôle" (.material-control), jamais en aplat.
|
||||||
============================================================ */
|
============================================================ */
|
||||||
.tab-bar { display: inline-flex; gap: 4px; padding: 6px; }
|
.tab-bar { display: inline-flex; gap: var(--space-2); padding: 6px; }
|
||||||
.tab-bar__item {
|
.tab-bar__item {
|
||||||
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
|
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
|
||||||
min-width: 56px; min-height: var(--tap-target-min);
|
min-width: 56px; min-height: var(--tap-target-min);
|
||||||
@@ -393,10 +555,101 @@
|
|||||||
.tab-bar__item--active { color: var(--napps-accent); }
|
.tab-bar__item--active { color: var(--napps-accent); }
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
display: flex; align-items: center; justify-content: space-between; gap: 12px;
|
display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
|
||||||
padding: 0 6px 0 16px;
|
padding: 0 6px 0 var(--space-5);
|
||||||
min-height: 52px;
|
min-height: 52px;
|
||||||
border-radius: var(--radius-pill);
|
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__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: 4px; }
|
.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%;
|
||||||
|
}
|
||||||
|
|||||||
+289
-36
@@ -47,6 +47,24 @@
|
|||||||
|
|
||||||
/* ===== Cible tactile minimale ===== */
|
/* ===== Cible tactile minimale ===== */
|
||||||
--tap-target-min: 44px;
|
--tap-target-min: 44px;
|
||||||
|
--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;
|
||||||
|
|
||||||
/* ===== Typographie — échelle réelle (points Apple), police nApps (Manrope) =====
|
/* ===== Typographie — échelle réelle (points Apple), police nApps (Manrope) =====
|
||||||
Taille/graisse/interligne/tracking vérifiés sur le kit — la hiérarchie se fait
|
Taille/graisse/interligne/tracking vérifiés sur le kit — la hiérarchie se fait
|
||||||
@@ -60,7 +78,7 @@
|
|||||||
--text-headline-size: 17px; --text-headline-line: 22px; --text-headline-weight: 700; --text-headline-tracking: -0.43px;
|
--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-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-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-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-footnote-size: 13px; --text-footnote-line: 18px; --text-footnote-weight: 400;
|
||||||
--text-caption1-size: 12px; --text-caption1-line: 16px; --text-caption1-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;
|
--text-caption2-size: 11px; --text-caption2-line: 13px; --text-caption2-weight: 400;
|
||||||
@@ -96,28 +114,62 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
MATÉRIAUX — DEUX familles seulement (pas une par composant) :
|
MATÉRIAUX — TROIS familles (pas une par composant) :
|
||||||
1. "control" — bouton flottant, barre d'outils, capsule isolée
|
1. "control" — bouton flottant, barre d'outils, capsule isolée,
|
||||||
2. "panel" — grande surface de dialogue (feuille, menu contextuel)
|
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 {
|
.material-control {
|
||||||
background: rgba(255, 255, 255, 0.55);
|
background: var(--bg-grouped);
|
||||||
backdrop-filter: blur(46px) saturate(1.6);
|
|
||||||
-webkit-backdrop-filter: blur(46px) saturate(1.6);
|
|
||||||
box-shadow:
|
box-shadow:
|
||||||
inset 0 1px 0 rgba(255, 255, 255, 0.6),
|
inset 0 1px 0 rgba(255, 255, 255, 0.6),
|
||||||
inset 0 -1px 0 rgba(0, 0, 0, 0.04),
|
inset 0 -1px 0 rgba(0, 0, 0, 0.04),
|
||||||
0 8px 15px rgba(0, 0, 0, 0.02);
|
0 8px 15px rgba(0, 0, 0, 0.02);
|
||||||
}
|
}
|
||||||
:root[data-theme="dark"] .material-control {
|
:root[data-theme="dark"] .material-control {
|
||||||
background: rgba(38, 41, 48, 0.5);
|
|
||||||
backdrop-filter: blur(46px) saturate(1.4);
|
|
||||||
-webkit-backdrop-filter: blur(46px) saturate(1.4);
|
|
||||||
box-shadow:
|
box-shadow:
|
||||||
inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
||||||
inset 0 -1px 0 rgba(0, 0, 0, 0.3),
|
inset 0 -1px 0 rgba(0, 0, 0, 0.3),
|
||||||
0 8px 15px rgba(0, 0, 0, 0.35);
|
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);
|
||||||
|
backdrop-filter: blur(46px) saturate(1.6);
|
||||||
|
-webkit-backdrop-filter: blur(46px) saturate(1.6);
|
||||||
|
}
|
||||||
|
:root[data-theme="dark"] .material-control {
|
||||||
|
background: rgba(38, 41, 48, 0.5);
|
||||||
|
backdrop-filter: blur(46px) saturate(1.4);
|
||||||
|
-webkit-backdrop-filter: blur(46px) saturate(1.4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.material-panel {
|
.material-panel {
|
||||||
background: rgba(255, 255, 255, 0.85);
|
background: rgba(255, 255, 255, 0.85);
|
||||||
@@ -132,6 +184,56 @@
|
|||||||
box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
|
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);
|
||||||
|
backdrop-filter: blur(65px) saturate(1.6);
|
||||||
|
-webkit-backdrop-filter: blur(65px) saturate(1.6);
|
||||||
|
}
|
||||||
|
:root[data-theme="dark"] .material-popover {
|
||||||
|
background: rgba(38, 41, 48, 0.5);
|
||||||
|
backdrop-filter: blur(65px) saturate(1.4);
|
||||||
|
-webkit-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);
|
||||||
|
backdrop-filter: none;
|
||||||
|
-webkit-backdrop-filter: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
COMPOSANTS de référence — construits uniquement à partir des
|
COMPOSANTS de référence — construits uniquement à partir des
|
||||||
tokens ci-dessus. Aucune valeur ad hoc.
|
tokens ci-dessus. Aucune valeur ad hoc.
|
||||||
@@ -144,10 +246,15 @@
|
|||||||
border: none;
|
border: none;
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
min-height: var(--tap-target-min);
|
min-height: var(--tap-target-min);
|
||||||
padding: 0 22px;
|
padding: 0 var(--space-6);
|
||||||
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);
|
||||||
letter-spacing: var(--text-body-tracking);
|
letter-spacing: var(--text-body-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) */
|
/* Bouton secondaire discret (= Bordered d'Apple — PAS un contour) */
|
||||||
.btn-secondary {
|
.btn-secondary {
|
||||||
@@ -156,23 +263,28 @@
|
|||||||
border: none;
|
border: none;
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
min-height: var(--tap-target-min);
|
min-height: var(--tap-target-min);
|
||||||
padding: 0 22px;
|
padding: 0 var(--space-6);
|
||||||
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);
|
||||||
letter-spacing: var(--text-body-tracking);
|
letter-spacing: var(--text-body-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 */
|
||||||
.segmented-control {
|
.segmented-control {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
background: var(--fill-tertiary);
|
background: var(--fill-tertiary);
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
padding: 2px;
|
padding: var(--space-1);
|
||||||
gap: 2px;
|
gap: var(--space-1);
|
||||||
}
|
}
|
||||||
.segmented-control__item {
|
.segmented-control__item {
|
||||||
padding: 3px 12px;
|
padding: 3px var(--space-4);
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
font-size: 13.3px;
|
font-size: var(--text-footnote-size);
|
||||||
font-weight: 510;
|
font-weight: 510;
|
||||||
color: var(--label-primary);
|
color: var(--label-primary);
|
||||||
min-height: 28px;
|
min-height: 28px;
|
||||||
@@ -198,28 +310,63 @@
|
|||||||
width: 24px; height: 24px;
|
width: 24px; height: 24px;
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
position: absolute; top: 2px; left: 2px;
|
position: absolute; top: var(--space-1); left: var(--space-1);
|
||||||
}
|
}
|
||||||
.toggle--on .toggle__knob { left: auto; right: 2px; }
|
.toggle--on .toggle__knob { left: auto; right: var(--space-1); }
|
||||||
|
|
||||||
/* List row */
|
/* List row */
|
||||||
.list-row {
|
.list-row {
|
||||||
border-top: 1px solid var(--separator);
|
border-top: 1px solid var(--separator);
|
||||||
padding: 0 16px;
|
padding: 0 var(--space-5);
|
||||||
min-height: 52px;
|
min-height: 52px;
|
||||||
display: flex; align-items: center;
|
display: flex; align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
background: none;
|
||||||
|
font-family: inherit;
|
||||||
}
|
}
|
||||||
.list-row__title { font-size: var(--text-body-size); color: var(--label-primary); }
|
.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); }
|
.list-row__subtitle { font-size: var(--text-subheadline-size); color: var(--label-secondary); }
|
||||||
|
.list-row--interactive { cursor: pointer; }
|
||||||
|
|
||||||
/* Text field */
|
/* Text field */
|
||||||
.text-field {
|
.text-field {
|
||||||
|
border: none;
|
||||||
border-top: 1px solid var(--separator);
|
border-top: 1px solid var(--separator);
|
||||||
padding: 16px;
|
outline: none;
|
||||||
|
width: 100%;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--label-primary);
|
||||||
|
padding: var(--space-5);
|
||||||
min-height: 52px;
|
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--placeholder { color: var(--label-tertiary); }
|
||||||
.text-field__cursor { width: 2px; height: 22px; border-radius: 10px; background: var(--napps-accent); }
|
.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) */
|
/* Empty state — badge circulaire réutilisable (Activity View + Empty State du kit) */
|
||||||
.icon-badge {
|
.icon-badge {
|
||||||
@@ -266,7 +413,7 @@
|
|||||||
.card {
|
.card {
|
||||||
background: var(--bg-grouped);
|
background: var(--bg-grouped);
|
||||||
border-radius: var(--radius-card-lg);
|
border-radius: var(--radius-card-lg);
|
||||||
padding: 18px;
|
padding: var(--space-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
@@ -275,8 +422,8 @@
|
|||||||
.badge {
|
.badge {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: var(--space-2);
|
||||||
padding: 3px 9px;
|
padding: 3px var(--space-3);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
font-size: var(--text-caption1-size);
|
font-size: var(--text-caption1-size);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -312,17 +459,32 @@
|
|||||||
border: none;
|
border: none;
|
||||||
border-top: 1px solid var(--separator);
|
border-top: 1px solid var(--separator);
|
||||||
background: transparent;
|
background: transparent;
|
||||||
padding: 16px 32px 16px 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-subheadline-weight) var(--text-subheadline-size)/var(--text-subheadline-line) var(--font-family);
|
||||||
|
letter-spacing: var(--text-subheadline-tracking);
|
||||||
color: var(--label-primary);
|
color: var(--label-primary);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.select-chevron {
|
.select-chevron {
|
||||||
position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
|
position: absolute; right: var(--space-2); top: 50%; transform: translateY(-50%);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
color: var(--label-tertiary);
|
color: var(--label-tertiary);
|
||||||
font-size: 12px;
|
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).
|
FEEDBACK — spinner, empty state, dialog (verre de panneau).
|
||||||
@@ -344,27 +506,27 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
gap: 12px;
|
gap: var(--space-4);
|
||||||
padding: 48px 24px;
|
padding: var(--space-8) var(--space-7);
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-overlay {
|
.dialog-overlay {
|
||||||
position: fixed; inset: 0;
|
position: fixed; inset: 0;
|
||||||
background: rgba(0, 0, 0, 0.4);
|
background: rgba(0, 0, 0, 0.4);
|
||||||
display: flex; align-items: center; justify-content: center;
|
display: flex; align-items: center; justify-content: center;
|
||||||
padding: 20px;
|
padding: var(--space-6);
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
.dialog {
|
.dialog {
|
||||||
width: 100%; max-width: 270px;
|
width: 100%; max-width: 270px;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
padding: 14px;
|
padding: var(--space-4);
|
||||||
display: flex; flex-direction: column; gap: 12px;
|
display: flex; flex-direction: column; gap: var(--space-4);
|
||||||
text-align: center;
|
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__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__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: 8px; }
|
.dialog__actions { display: flex; flex-direction: column; gap: var(--space-3); }
|
||||||
.dialog__action {
|
.dialog__action {
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
@@ -380,7 +542,7 @@
|
|||||||
NAVIGATION — tab bar flottante et toolbar, toutes deux en
|
NAVIGATION — tab bar flottante et toolbar, toutes deux en
|
||||||
"verre de contrôle" (.material-control), jamais en aplat.
|
"verre de contrôle" (.material-control), jamais en aplat.
|
||||||
============================================================ */
|
============================================================ */
|
||||||
.tab-bar { display: inline-flex; gap: 4px; padding: 6px; }
|
.tab-bar { display: inline-flex; gap: var(--space-2); padding: 6px; }
|
||||||
.tab-bar__item {
|
.tab-bar__item {
|
||||||
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
|
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
|
||||||
min-width: 56px; min-height: var(--tap-target-min);
|
min-width: 56px; min-height: var(--tap-target-min);
|
||||||
@@ -393,10 +555,101 @@
|
|||||||
.tab-bar__item--active { color: var(--napps-accent); }
|
.tab-bar__item--active { color: var(--napps-accent); }
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
display: flex; align-items: center; justify-content: space-between; gap: 12px;
|
display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
|
||||||
padding: 0 6px 0 16px;
|
padding: 0 6px 0 var(--space-5);
|
||||||
min-height: 52px;
|
min-height: 52px;
|
||||||
border-radius: var(--radius-pill);
|
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__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: 4px; }
|
.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%;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user