-
Notifications
You must be signed in to change notification settings - Fork 293
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
Introduce Stepper
component
#6965
Comments
IB ✅ I like the API here 👍🏻 |
QA Update ❌
|
Hi @mohitwp, thanks for raising this. In hindsight it should have been made more clear, but this issue is only about creating the generic component, with the titles, and the left-hand progress indicator to be styled as per Figma, and the content to be displayed for the active step. However the actual content itself will be supplied by whatever component is making use of the |
QA Update ✅Thank you @techanvil !
|
Feature Description
A new
Stepper
component should be introduced to the codebase as part of the work for Ad Blocker Detection, based on the design.While there's no official mention of the component in V2/V3 of Material design, there is a V1 doc available and prior arts available in MUI or elsewhere.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Stepper
, as a generic/UI component that can be given "steps".Implementation Brief
Stepper
component. This should accept one or moreStep
components as its children.activeStep
prop, which is the zero-based index of theStep
component to display.Stepper
container component should render the following:Step
child components, passing theisActiveStep
prop to them with the appropriate value. In order to pass this prop, it will likely be be necessary to clone the child element(s) usingcloneElement()
, iterating over them withChildren
viaChildren.map()
.Step
components. This will keep things more flexible, although we could always create an additional wrapper aroundStepper
which provides CTAs as well. We can make that determination when it comes to usingStepper
in a subsequent issue.Step
component which takes the individual step content as its children.title
andisActiveStep
.title
: Title of the step.isActiveStep
: When true,Step
should render both the title and children. When false, only the title should be rendered. This prop will not usually be specified by the calling code, but rather provided byStepper
.Stepper
andStep
components should be styled as per the design. Additionally, the current step should fade in/out when it changes (see the AdSense Connect CTA for an example of content fading in/out, although a simpler transition may be suitable here). It should be ensured that it displays correctly at all viewports.File locations:
Stepper
:assets/js/components/Stepper/index.js
Step
:assets/js/components/Stepper/Step.js
assets/sass/components/global/_googlesitekit-stepper.scss
Test Coverage
Stepper
andStep
using React Testing Library.QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: