Capgemini / dcx-react-library

React Library UI/UX agnostic
https://main--6069a6f47f4b9f002171f8e1.chromatic.com
MIT License
107 stars 7 forks source link

feat: adding visually hidden text to button for screen readers #653

Closed Ibabalola closed 1 month ago

Ibabalola commented 1 month ago

As per a GDS accessbility requirement

    <button
      onClick={handleClick}
      disabled={disable}
      type={type}
      aria-label={ariaLabel}
      formAction={formAction}
      name={name}
      className={btnClassName}
      value={value}
      {...props}
    >
      {prefix}
      {isLoading && loadingLabel ? loadingLabel : label}
      {visuallyHiddenText && (
        <span className={visuallyHiddenText.className}>
          {visuallyHiddenText.text}
        </span>
      )}
      {!isLoading && children}
      {postfix}
    </button>
codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (b90acfd) to head (8d4de4b).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/1.0.0 #653 +/- ## =============================================== Coverage 100.00% 100.00% =============================================== Files 85 85 Lines 1543 1545 +2 Branches 535 537 +2 =============================================== + Hits 1543 1545 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.