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

ui v2: add stepper component #691

Merged
merged 14 commits into from
Dec 7, 2020
Merged

ui v2: add stepper component #691

merged 14 commits into from
Dec 7, 2020

Conversation

dschaller
Copy link
Contributor

@dschaller dschaller commented Nov 19, 2020

Description

Add a stepper component. I've improvised with an error icon for now. We can update once we get finalized designs.

Once we settle on colors we can hoist these up into the palette

stepper

Testing Performed

manual via story

@dschaller dschaller marked this pull request as ready for review November 19, 2020 05:42
@dschaller dschaller requested a review from a team as a code owner November 19, 2020 05:42
Copy link
Contributor

@scarlettperry scarlettperry left a comment

Choose a reason for hiding this comment

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

nice!! 🎉

@danielhochman danielhochman changed the title frontend: add stepper component ui v2: add stepper component Nov 20, 2020

const StepConnector = styled(MuiStepConnector)((props: { completed?: boolean }) => ({
".MuiStepConnector-line": {
height: "5px",
Copy link
Contributor

Choose a reason for hiding this comment

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

i think the height on figma is 7px

Copy link
Contributor

@scarlettperry scarlettperry Dec 7, 2020

Choose a reason for hiding this comment

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

oh it depends on which bar you read the height from. the bar example in the last row specifies 5px.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i think it is supposed to be 7px, left a comment on figma for clarification though


const Stepper = ({ activeStep, children }: StepperProps) => (
<div>
<MuiStepper style={{ padding: "0" }} activeStep={activeStep + 1} connector={<StepConnector />}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we push the inline styles up to the parent div and use selectors?

</MuiStepper>
<Grid style={{ padding: "16px 0" }} container justify="space-between">
{React.Children.map(children, (step: any, idx: number) => (
<StepLabel item data-active={idx === activeStep}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

thinking about it more what about using a class name instead of data-.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kind of like using props here since it makes it clear what we are specifying compared to what Material is injecting

Copy link
Collaborator

Choose a reason for hiding this comment

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

though data won't cascade for nested selectors, i think in general we should standardize on classes. we can use a prefix to distinguish from Mui if needed.

note: (comment after merge, not a blocker)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 going to make a cleanup task and add some of the standardizing bits we have talked about to it

Copy link
Collaborator

@danielhochman danielhochman left a comment

Choose a reason for hiding this comment

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

lgtm, discretionary nits

@dschaller dschaller merged commit 71a4d2d into UIV2 Dec 7, 2020
@dschaller dschaller deleted the stepper branch December 7, 2020 22:16
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