diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a8d57b..7e89872 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,3 +65,5 @@ Liste des évolutions de la librairie Malio layer UI * InputAutocomplete : suppression de 4 sources de saut visuel au focus / ouverture (extra translate label, padding `grow-height:focus`, `focus:pl-[11px]`, `!border-b-0` remplacé par `!border-b-transparent`) * Select / SelectCheckbox : mêmes correctifs anti-saut (suppression du padding `grow-height:focus` et remplacement de `!border-b-0` / `!border-t-0` par leurs variantes `transparent`) * MalioButton : largeur par défaut alignée sur `w-[200px]` (au lieu de `w-[240px]`) pour correspondre au sizing des formulaires de l'app +* [#MUI-42] RadioButton : ajout d'un focus visible au clavier (`outline` 2px `m-primary`, offset 2px) — l'input en `appearance-none` n'avait aucun indicateur de focus, seul l'`outline: auto 1px` du navigateur restait, quasi invisible. La navigation native (Tab entre groupes, flèches dans le groupe) reste inchangée +* [#MUI-42] Checkbox : ajout d'un focus visible au clavier sur la case (`outline` 2px `m-primary`, offset 2px) — l'input réel est masqué (`clip-path`), aucun indicateur n'apparaissait à la tabulation diff --git a/COMPONENTS.md b/COMPONENTS.md index 8c3b5b1..c2df66a 100644 --- a/COMPONENTS.md +++ b/COMPONENTS.md @@ -455,6 +455,8 @@ Case à cocher. **Events :** `update:modelValue(value: boolean)` +**Clavier :** `Espace` coche/décoche. Focus clavier visible sur la case (`outline` 2px `m-primary`). + ```vue @@ -478,6 +480,8 @@ Bouton radio (à utiliser en groupe avec le même `name`). **Events :** `update:modelValue(value: string | number | boolean | null)` +**Clavier :** comportement natif d'un groupe radio (options partageant le même `name`) — `Tab` / `Maj+Tab` entre/sort du groupe (1 seul arrêt par groupe), `↑↓←→` déplacent la sélection entre les options d'un même groupe. Focus clavier visible (`outline` 2px `m-primary`). + ```vue diff --git a/app/components/malio/checkbox/Checkbox.vue b/app/components/malio/checkbox/Checkbox.vue index 73ba5eb..bd950a7 100644 --- a/app/components/malio/checkbox/Checkbox.vue +++ b/app/components/malio/checkbox/Checkbox.vue @@ -180,6 +180,11 @@ const onChange = (event: Event) => { border-color: rgb(0, 0, 0); } +.inp-cbx:focus-visible + .cbx span:first-child { + outline: 2px solid rgb(var(--m-primary) / 1); + outline-offset: 2px; +} + .cbx span:first-child svg { position: absolute; top: 2px; diff --git a/app/components/malio/radio/RadioButton.vue b/app/components/malio/radio/RadioButton.vue index 65f17fa..7c33e9d 100644 --- a/app/components/malio/radio/RadioButton.vue +++ b/app/components/malio/radio/RadioButton.vue @@ -179,6 +179,11 @@ const onChange = (event: Event) => { opacity: 1; } +.radio-control input[type='radio']:focus-visible { + outline: 2px solid rgb(var(--m-primary) / 1); + outline-offset: 2px; +} + .radio-control.is-error input[type='radio'] { border-color: rgb(var(--m-danger) / 1); }