-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support
as
prop in uploader component (#236)
follow the pattern set by HeadlessUI and others of supporting the very useful "as" property in the uploader component. this: 1. lets users override default tag types (eg, changing a `button` to an `a` tag) 2. lets users provide custom components to be used as the root element of our headless components 3. lets users elide a root tag entirely by passing `Fragment` to `as` See https://headlessui.com/react/menu#rendering-a-different-element-for-a-component for more documentation on how this is commonly used This introduces a new dependency on ariakit-react-utils (https://ariakit.org/) to avoid reproducing the intricate puzzle of types in the `createComponent` and `createElement` functions from that library. I suspect other utilities will be useful as we improve the accessibility defaults of this library so I think this dependency is worth adding, but we could copy/paste the specific code we need with proper attribution if we want to avoid pulling in the whole library. resolves #235 Co-authored-by: Alan Shaw <[email protected]> Co-authored-by: Yusef Napora <[email protected]> Co-authored-by: Nathan Vander Wilt <[email protected]>
- Loading branch information
1 parent
46583e0
commit c802e99
Showing
7 changed files
with
270 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.