jxom / fannypack

[UNMAINTAINED] An accessible-focused, themeable, friendly React UI Kit.
https://fannypack.style
MIT License
235 stars 29 forks source link

Fix/a11y alert icon hidden #112

Closed danielagattoni closed 4 years ago

danielagattoni commented 4 years ago

Given the icon on the <Alert/> component is mainly used to visually represent a message status, I'd suggest to remove it as it doesn't enhance the readability when using assistive technologies. Also, props such as title and a description via children should be descriptive enough for the User to understand the kind of alert they are receiving.

Result with aria-hidden:

Screen Shot 2020-03-18 at 4 07 49 pm Screen Shot 2020-03-18 at 4 08 20 pm

How to test locally: Copy and Paste these snippets on the Alert code area at http://localhost:3000/components/alert?theme=default

<Component initialState={{ alert: false }}>
  {({ state, setState }) => (
  <div>
  <Button onClick={() => setState({ alert: !state.alert})}>send</Button>
    {state.alert && <Alert hasIcon type="danger">Something went wrong!
    </Alert>}
</div>
  )}
</Component>
<Component initialState={{ alert: false }}>
  {({ state, setState }) => (
  <div>
  <Button onClick={() => setState({ alert: !state.alert})}>send</Button>
    {state.alert && <Alert hasIcon type="success"> Data successfully saved!
    </Alert>}
</div>
  )}
</Component>
linc[bot] commented 4 years ago

Preview releases deployed with Linc logo Linc

✅ This PR (commit SHA 782300f) successfully built (bundle ID fa7191890)  VIEW LOGS

🌏 Permanent preview links of latest version on this branch:  EDIT

https://fannypack--develop--fixa11y-alert-icon-hidden.branch.linc-preview.sh/
https://fannypack--production--fixa11y-alert-icon-hidden.branch.linc-preview.sh/

See older previews from this branch