-
Notifications
You must be signed in to change notification settings - Fork 114
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
feat(sidebar): add a Sidebar component with several variant styles #3154
Conversation
🦋 Changeset detectedLatest commit: 16472da The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
49318e2
to
c7e010c
Compare
✅ Deploy Preview for paste-theme-designer ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for paste-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 16472da. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 3 targetsSent with 💌 from NxCloud. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 16472da:
|
Passing run #5813 ↗︎Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
Size Change: +468 B (0%) Total Size: 979 kB
ℹ️ View Unchanged
|
2bd92b5
to
bfe0b38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple small things but looks great!
packages/paste-core/components/sidebar/__tests__/index.spec.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Praise: I really like the API and the way it's turned out 🎉
This PR adds a new Paste package:
@twilio-paste/sidebar
. This package exports three components:The Sidebar comes prebuilt with two variants:
default
orcompact
.compact
keeps a sliver of the sidebar visible when collapsed, but otherwise is the same.The
Sidebar
component is position fixed, locked to the left side of the screen and taking the full vertical height. By default, Sidebar is an overlay element. In order for the Sidebar to push the page contents, we wrap the page content with the correspondingPush-
orOverlaySidebarContentWrapper
. These wrappers handle animating the content position when the sidebar opens or closes. They accept the same props as Sidebar.All the components are stateless. State is managed by the consuming application.
The Sidebar is responsive. It occupies the full 100% width, behaves as overlay, and is default variant always on the smallest breakpoint (mobile). This allows nested components to respond accordingly by also using responsive props and expecting the behavior on the smallest breakpoint too.
This PR also changes the
theme
'sbreakpoints
fromrem
topx
values. MediaQueries are more easily grokked as PX, and it simplifies development. Some tests, like snapshot tests, may need to be updated.