-
Notifications
You must be signed in to change notification settings - Fork 215
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
[ISSUE-771] Add Box, Flex, and Stack #1027
[ISSUE-771] Add Box, Flex, and Stack #1027
Conversation
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
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.
@alanbsmith I did a preliminary review of the docs, I think they look pretty good overall 👍. Just a few minor thoughts below.
c8c8d43
to
a01f29c
Compare
1810bc4
to
dce161c
Compare
9156276
to
709d182
Compare
bf2f508
to
7e96622
Compare
The Typescript error is strange:
That looks like something that is confusing React Docgen |
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.
Still need to delete the space
function in labs-tokens.
|
||
#### Using `shouldWrapChildren` | ||
|
||
Because of the increased specificity of `Stack`'s pseduo-classes, it may override the child element |
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.
IMO this description isn't clear enough to indicate exactly when you should or shouldn't use this prop.
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.
Yep. I need to rethink this content a bit. I feel like there should be some general information below Managing Child Elements
and then explain how each option works in these subsections.
18ed213
to
3bf81f7
Compare
34574b4
to
52590a6
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.
@alanbsmith Awesome work on the Box docs! What a beast -- I think you've done about as well as you could have to organize it. This had to have been an incredible amount of work to put together. 👏
I left a few suggestions below. Didn't notice any major issues with the content, mostly just nits and spelling errors.
Co-authored-by: James Fan <james@somewhatstrange.com>
Co-authored-by: James Fan <james@somewhatstrange.com>
Co-authored-by: James Fan <james@somewhatstrange.com>
Co-authored-by: James Fan <james@somewhatstrange.com>
Co-authored-by: James Fan <james@somewhatstrange.com>
Co-authored-by: James Fan <james@somewhatstrange.com>
Co-authored-by: James Fan <james@somewhatstrange.com>
Co-authored-by: James Fan <james@somewhatstrange.com>
…as-kit into create-layout-components
Issue
Resolves #771
Overview
This PR primarily adds
Box
,Flex
, andStack
components to canvas-kit. Below is a list of more detailed changes:Box
component inlabs/common
Box
docs, unit tests for style props, and visual regression testsFlex
component inlabs/layout
Flex
docs, unit tests for style props, and visual regression testsStack
,HStack
, andVStack
components inlabs/layout
Stack
docs, unit tests for style props, and visual regression testsspace
style function fromlabs/tokens
zero
token to be"0px"
from0
.Where Should the Reviewer Start?
I would probably start with
Box
:modules/labs-react/common/lib/Box.tsx
. And because most of the component's logic lives in the style props, I would look at:modules/labs-react/common/lib/utils
. From there, I would hop over toFlex
:modules/labs-react/layout/lib/Flex.tsx
and then toStack
:modules/labs-react/layout/lib/Stack.tsx
.Testing Manually
Box
testsyarn test modules/labs-react/common/spec
http://localhost:9001/?path=/story/testing-react-labs-common--box-states
Flex
andStack
tests:yarn test modules/labs-react/layout/spec
http://localhost:9001/?path=/story/testing-react-labs-layout-flex
http://localhost:9001/?path=/story/testing-react-labs-layout-stack
Screenshots
Box
Flex
Stack
Thank You Gif
These components are small and simple, but I'm excited to see what you'll build with them. 😄
Checklist
yarn test
passespackage.json
canvas-kit-react
and/orcanvas-kit-css
universal modules, ifapplicable
Additional References