Skip to content

Conversation

@JLou
Copy link
Contributor

@JLou JLou commented Aug 14, 2025

In order to add the possibility to have both a helper text and an error message we need to break the API of our inputs.

Since this is required, this code is an experiment of an overhaul of our inputs components. Less reliant on the magic of the Field component, and based on sensible atoms to allow users to easily create their own inputs controls.

Copy link
Contributor

@pplancq pplancq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je pense que le core/HelpMessage.tsx ne devrait pas être dans cette PR si ?


const errorId = isInvalid ? `${inputId}-description` : undefined;
const helperId = props.helpMessage ? `${inputId}-helper` : undefined;
const describedBy = [errorId, helperId].filter(Boolean).join(" ").trim();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je pense que le errorId devrait être mis dans aria-errormessage (pris en charge par ANDI et NVDA)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lors de notre formation accessibilité, on nous avait mis en garde sur aria-errormessage et son manque de support :
https://cerovac.com/a11y/2024/06/support-for-aria-errormessage-is-getting-better-but-still-not-there-yet/

C'est une feature assez récente et les lecteurs d'ecran ne supportent pas tous cette propriété

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perso NVDA le supporte bien car coté client on utilise déjà aria-errormessage mais du coup s'il faudrait ne pas l'utilisé il faudrait comme ce synchro coté agent et client histoire d'être iso dans les 2 DS.

const inputUseId = useId();
const inputId = props.id ?? inputUseId;

const isInvalid = Boolean(props.errorMessage);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

il faudrait retourne undefined si Boolean(props.errorMessage) = false car je pense que c'est pas utile de mettre un aria si pas utile

idem pour describedBy

aria less is best.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tu voudrais que cette ligne retourne undefined si les 2 sont undefined, c'est ca ?

  const describedBy = [errorId, helperId].filter(Boolean).join(" ").trim();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en gros oui, car perso mettre un arria-describedBy='' je trouve cela inutile. tous comme un aria-invalid="false" etc ...
on peut en discuter pendant un point de synchro ou autre au besoin.

import "@axa-fr/design-system-slash-css/dist/Form/Experimental/HelpMessage.css";
import icon from "@material-symbols/svg-400/sharp/error-fill.svg";
import classNames from "classnames";
import { PropsWithChildren } from "react";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { PropsWithChildren } from "react";
import { type PropsWithChildren } from "react";

@@ -0,0 +1,7 @@
import "@axa-fr/design-system-slash-css/dist/Form/Experimental/InputUnit.css";

import { PropsWithChildren } from "react";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { PropsWithChildren } from "react";
import { type PropsWithChildren } from "react";

@@ -0,0 +1,21 @@
import "@axa-fr/design-system-slash-css/dist/Form/Experimental/InputContainer.css";
import classNames from "classnames";
import { PropsWithChildren } from "react";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { PropsWithChildren } from "react";
import { type PropsWithChildren } from "react";

@@ -0,0 +1,11 @@
.af-label {
margin-bottom: var(--label-margin-bottom, 0);
grid-area: label;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je me demande s'il ne serais pas plus logique de mettre le grid-are dans l'input-container

@pplancq pplancq added agent-slash Component for the agent theme draft labels Aug 14, 2025
@JLou JLou force-pushed the feat/experimentInputs branch 3 times, most recently from fb81e46 to 9e92801 Compare August 18, 2025 09:23
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@JLou JLou force-pushed the feat/experimentInputs branch from 9e92801 to 09565e4 Compare October 27, 2025 14:55
GuillaumeKESTEMAN and others added 12 commits October 27, 2025 15:56
…es (#1509)

* fix(look&feel,apollo): ensure overflow is hidden in progress bar styles

* fix(apollo,look&feel): import Stepper from apollo/lf in the story

* feat(look&feel,apollo): set to ProgressBar a progress value border radius
* feat(apollo,look&feel): tabbar migration

* docs(apollo,look&feel): update documentation

* test(apollo,look&feel): add test with Reactnode content for TabBar
* chore(design-system): update package-lock.json

* refactor(design-system): fix styles lint in InputTextAtomCommon.css and Accordion.scss

* chore(design-system): update action.yaml for node setup

* chore(design-system): update package-lock.json

* chore(design-system): update node version in volta configuration

* fix(slash): update label and select element IDs in snapshot
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@JLou JLou force-pushed the feat/experimentInputs branch from 09565e4 to a32d93c Compare October 28, 2025 08:25
@JLou JLou force-pushed the feat/experimentInputs branch from a32d93c to 052f202 Compare October 28, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-slash Component for the agent theme draft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants