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

[joy-ui][Stepper] Add new Stepper components #39688

Merged
merged 41 commits into from
Nov 10, 2023
Merged

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Oct 31, 2023

closes #38641

🖥️ Preview: https://deploy-preview-39688--material-ui.netlify.app/joy-ui/react-stepper/

Refs

Composition structure

Joy Steppers aims for 1-to-1 DOM mapping with an ordered list as explained in this article. So far, just 4 components that make sense to me (Material UI and Chakra UI have too much components):

  • Stepper (the ol)
    • Step (the li)
      • StepIndicator
      • StepButton

*For connector, Joy UI uses ::after of each step and Typography for labels and texts which reduces a lot of components to maintain.

Technical decisions

  • Joy Stepper active, completed, and active are just classes without extra styles like Material UI to let developers own the customization.
    • StepIndicator which supports global variant
    • CSS variables for controlling the connectors between steps

Customization improvements

Since Joy UI relies on global variant and CSS variables for customization of the active and completed states, it is more flexible and easier to customize.

By providing low-level customization, we can create various stepper designs and let developers copy the one closest to their use case.

Benchmark

Lines of code between Material UI and Joy UI

Material Joy % change
Stepper 160 203 +26.88
Step 185 292 +57.84
StepButton 127 151 +18.90
StepConnector 129
StepContent 155
StepIcon 159
StepLabel 258
total 1173 646 -44.93

@siriwatknp siriwatknp added component: stepper This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy design: joy This is about Joy Design, please involve a visual or UX designer in the process labels Oct 31, 2023
@mui-bot
Copy link

mui-bot commented Oct 31, 2023

Netlify deploy preview

@mui/joy: parsed: +1.94% , gzip: +1.46%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against e961834

@siriwatknp siriwatknp requested review from mnajdova and zanivan and removed request for mnajdova and zanivan November 1, 2023 09:55
@siriwatknp siriwatknp marked this pull request as ready for review November 3, 2023 04:25
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 6, 2023
Copy link
Contributor

@zanivan zanivan left a comment

Choose a reason for hiding this comment

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

Hey @siriwatknp this looks fantastic! A great addition to our catalog indeed.

I took the liberty to add a few adjustments to the component, to make it a bit lighter and denser to be more consistent with our current approach to sizes—I also added a few visual tweaks to the demos afterward.

Design-wise, it looks great! 🚀 🚀

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Few things I noticed:

  1. Using <Step oriention="vertical" /> in vertical stepper does not have any effect. Is this expected?
  2. On the playground, setting the stepper's orientation prop does not show any change in the code snippet
Screenshot 2023-11-07 at 12 10 14 3. When first seeing the demos, the text for the medium size felt too big, but it could be just my perception

The customization demos look awesome!

packages/mui-joy/src/Stepper/Stepper.tsx Outdated Show resolved Hide resolved
packages/mui-lab/src/TreeView/TreeView.tsx Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 10, 2023
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Looks good to me, I pushed few improvements. We can resolve the design comment in a follow up.

@mnajdova mnajdova merged commit 0375d7e into mui:master Nov 10, 2023
23 checks passed
@@ -0,0 +1,107 @@
---
productId: material-ui
Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: stepper This is the name of the generic UI component, not the React module! design: joy This is about Joy Design, please involve a visual or UX designer in the process package: joy-ui Specific to @mui/joy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[joy-ui] Add Stepper component
5 participants