Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple new components #220

Merged
merged 47 commits into from
Feb 18, 2021
Merged

Multiple new components #220

merged 47 commits into from
Feb 18, 2021

Commits on Feb 11, 2021

  1. add Disclosure component

    RobinMalfait committed Feb 11, 2021
    Configuration menu
    Copy the full SHA
    8494bd5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    07f9167 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8648052 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1d98d7d View commit details
    Browse the repository at this point in the history
  5. add useFocusTrap hook

    RobinMalfait committed Feb 11, 2021
    Configuration menu
    Copy the full SHA
    97011bb View commit details
    Browse the repository at this point in the history
  6. add FocusTrap component

    RobinMalfait committed Feb 11, 2021
    Configuration menu
    Copy the full SHA
    4943d02 View commit details
    Browse the repository at this point in the history
  7. expose FocusTrap

    RobinMalfait committed Feb 11, 2021
    Configuration menu
    Copy the full SHA
    5c293b8 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2021

  1. add Dialog component

    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    a52f2e3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a1ed110 View commit details
    Browse the repository at this point in the history
  3. expose Dialog

    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    dec4049 View commit details
    Browse the repository at this point in the history
  4. random cleanup

    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    370d3bc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    40f1bc6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    222f7d5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c4e953b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d1d332f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4a0becc View commit details
    Browse the repository at this point in the history
  10. add Portal component

    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    108c2f0 View commit details
    Browse the repository at this point in the history
  11. expose Portal

    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    2bc6a6d View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    bb2148c View commit details
    Browse the repository at this point in the history
  13. add useInertOthers hook

    This will allow us to mark everything but the current ref as "inert".
    This is important for screenreaders, to ensure that screenreaders and
    assistive technology can't interact with other content but the current
    ref.
    
    This implementation is not ideal yet. It doesn't take into account that
    you can use the hook in 2 different components. For now this is fine,
    since we only use it in a Dialog and you should also probably only have
    a single Dialog open at a time.
    
    Will improve this in the future!
    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    b912bf6 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    301be38 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    61193d8 View commit details
    Browse the repository at this point in the history
  16. ensure we respect autoFocus on form elements within the Dialog

    If we have an autoFocus on an input, that input will receive focus. Once
    we try to focus the first focusable element in the Dialog this could be
    lead to unwanted behaviour. Therefore we check if the focus already is
    within the Dialog, if it is, keep it like that.
    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    c2f723b View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6f665d9 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    6b2b8d1 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    66e0dfd View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    575de8f View commit details
    Browse the repository at this point in the history
  21. close Dialog when it becomes hidden

    Could happen when this is in md:hidden for example
    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    1459bac View commit details
    Browse the repository at this point in the history
  22. prevent infinite loop

    When we `Tab` in a FocusTrap it will try and focus the Next element. If
    we are in a state where none of the elements inside the FocusTrap can be
    focused, then we keep trying to focus the next one in line. This results
    in an infinite loop...
    
    To mitigate this issue, we check if we looped around, if we did, it
    means that we tried all the other focusable elements, therefore we can
    stop.
    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    7ff4dc3 View commit details
    Browse the repository at this point in the history
  23. isIntersecting doesn't work in every scenario

    When page is scrollable, when dialog is translated of the page. Now just checking for sizes, which should be enough for md:hiden cases
    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    8628328 View commit details
    Browse the repository at this point in the history
  24. render Portal contents in a div

    Otherwise you can't use multiple Portal components if you render multiple children inside each Portal
    RobinMalfait committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    64fed3f View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    75d05e5 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    ccd2e4a View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2021

  1. add Popover component

    RobinMalfait committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    42dd9f7 View commit details
    Browse the repository at this point in the history
  2. expose Popover

    RobinMalfait committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    8046055 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8ab53e4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    983061d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    247ab32 View commit details
    Browse the repository at this point in the history
  6. update Changelog

    RobinMalfait committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    a5e197e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8fce1f6 View commit details
    Browse the repository at this point in the history
  8. actually call .focus() on the element

    This ensures that the document.activeElement becomes the focused element.
    RobinMalfait committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    bc4f7e9 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b9db527 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5873f12 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    05475f3 View commit details
    Browse the repository at this point in the history
  12. fix regression while using outside click

    There might be a chance that you didn't even notice this *bug*. The idea
    is that when you click outside, that the Menu or Listbox closes. However
    there is another step that happens:
    
    1. When you click on a focusable item, keep the focus on that item.
    2. When you click on a non-focusable item, move focus back to the
       Menu.Button or Listbox.Button
    
    We broke part 2, we never returned to the Menu.Button or Listbox.Button.
    This is (might) be important for screenreaders so that they don't "get lost",
    because if you click on a non-focusable item, the document.body becomes
    the active element. Confusing.
    RobinMalfait committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    2785733 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    8296ead View commit details
    Browse the repository at this point in the history
  14. update docs

    RobinMalfait committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    2aeaf1a View commit details
    Browse the repository at this point in the history