-
Notifications
You must be signed in to change notification settings - Fork 66
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: add accessible react-bootstrap components #550
Conversation
Skip conflicting components that will be shimmed. Add TODOs for components with a11y defects to be addressed in the future
8b86f77
to
7b88a66
Compare
export { default as BreadcrumbItem } from 'react-bootstrap/BreadcrumbItem'; | ||
*/ | ||
// TODO: create shim – export { default as Button } from 'react-bootstrap/Button'; | ||
export { default as ButtonGroup } from 'react-bootstrap/ButtonGroup'; |
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.
Are these Button* components compatible with our Button above, that we have yet to shim?
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.
They are! I tested them in the doc page just added.
Two thoughts - One, I'm curious how a lot of these interact with our existing Paragon components when they're used in sensible ways that folks might expect (our input classes inside their Two, documenting all this will be interesting. In the past we chose to duplicate/wrap all the Bootstrap documentation... are we going to reproduce react-bootstrap's? Or just reference it from the paragon documentation? Seems like we're going to need to have a big shift in the doc around which components are deprecated... are we doing a major version change and just removing stuff? And in reference to the first thought above, documenting any subtlety to those interactions will be fun. |
And also, just a reminder to check on tree-shaking to make sure they've packaged react-bootstrap in such a way that it can still be slimmed down when used through Paragon. |
Also - after having investigated react-bootstrap quite a bit now, how many cases do we see where we want to 'wrap' things? Have we seen any specific benefits to exposing them through paragon? Just thinking about whether or not it'd be a reasonable choice to make react-bootstrap a recommended library and call it a day. 🤔 (not sure I think this is a good idea) |
Great points David.
Why pull it in? Incorporating react-bootstrap inside paragon will help us:
In general I expect the future of Paragon to aim to create more "molecule-level" components that are composed of these react-bootstrap elements and in the further future we can swap the underlying technology with CSS-in-JS iteratively. |
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.
Just a question and a typo (?) in my drive-by review.
Just want to say, I'm really glad to see paragon coming together; a unified style/component guide/manual is huuuge and long-awaited!
Thanks for indulging the second-guessing questions, @abutterworth. Explanations totally make sense/I'm behind this! |
@@ -1,10 +1,10 @@ | |||
export { default as asInput } from './asInput'; | |||
export { default as Breadcrumb } from './Breadcrumb'; | |||
export { default as Button } from './Button'; | |||
export { default as Button } from './Button'; // TODO: shim from react-bootstrap |
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.
Are these TODOs something that should be completed in this PR? Or for later?
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.
For follow up PRs
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.
Adding the shims is more risky in terms of inadvertently making breaking changes so I'll keep them separate.
@@ -1,13 +1,11 @@ | |||
--- | |||
title: 'StatusAlert' | |||
type: 'component' | |||
status: 'Needs Work' | |||
status: 'Deprecate Soon' |
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.
Feel like we have so many variations on this alert floating around in the MFEs. :)
export { default as Overlay } from 'react-bootstrap/Overlay'; | ||
export { default as OverlayTrigger } from 'react-bootstrap/OverlayTrigger'; | ||
export { default as PageItem } from 'react-bootstrap/PageItem'; | ||
// TODO: create shim – export { default as Pagination } from 'react-bootstrap/Pagination'; |
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.
We won't be able to simply shim react-bootstrap's Pagination
component here, since the component just provides the visual UI, without the underlying logic to actually make it function, where it sends callbacks and accepts props such as current page, onPageSelect
, etc.
By shimming it directly, the consumers on the Pagination
component would need to implement that logic themselves.
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.
Good call out, with Pagination in particular. What do you think about a future breaking change that pulls in react-bootstrap's pagination and moving the purpose of the current Pagination to a PaginationGroup or something?
www/src/pages/components/image.mdx
Outdated
<Image src={generateCustomPlaceholderURL(180, 180)} roundedCircle /> | ||
</Col> | ||
<Col xs={6} md={4}> | ||
<Image src={generateCustomPlaceholderURL(180, 180)} thumbnail /> |
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.
nit: might be good to include the fluid
prop on one of these examples, as I imagine that will be a commonly used prop for Image
.
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.
I was trying to figure out what fluid actually does and couldn't see any change there. What's it for?
🎉 This PR is included in version 9.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds the following react-bootstrap components with jump off documentation pages:
Sample Doc: