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

Drawer #190

Merged
merged 8 commits into from
Sep 1, 2022
Merged

Drawer #190

merged 8 commits into from
Sep 1, 2022

Conversation

wp-aberg
Copy link
Contributor

@wp-aberg wp-aberg commented Aug 26, 2022

What I did

This PR adds a Drawer component, based on the initial v0 implementation

API Changes

DrawerRoot

  • removed customScrimBackgroundClass, any styles may be added to the Scrim directly
  • zIndex now takes either a theme token or number

DrawerTrigger

  • remove dataQa prop can be replaced with a data-qa prop directly

DrawerContent

  • replaced inPlaceSelector with inPlaceRef to favor React DOM element selection over querying DOM directly

Component Structure

Drawer favors splitting sub-components into individual files and the inclusion of unit tests for these files

@vercel
Copy link

vercel bot commented Aug 26, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
wpds-ui-kit ✅ Ready (Inspect) Visit Preview Sep 1, 2022 at 9:02PM (UTC)
wpds-ui-kit-storybook ✅ Ready (Inspect) Visit Preview Sep 1, 2022 at 9:02PM (UTC)

{
"name": "@washingtonpost/wpds-drawer",
"version": "0.13.0",
"description": "> TODO: description",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we update this field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated in e6cf4e6

type DrawerCloseProps = React.ComponentPropsWithRef<typeof CloseButton> & {
sticky?: boolean;
/** @default compact */
density?: "default" | "compact";
Copy link
Contributor

Choose a reason for hiding this comment

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

not a blocker, but how do you feel about using enums for these? That way we can avoid user spelling mistakes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For a simple case like this an enum doesn't feel necessary. The union of string literals will provide completions and throw errors for typos.

Maybe for creating more understandable values or something that needs to be iterated, otherwise enums feel cumbersome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants