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

Stepper::Navigation and Stepper::List: Create components #2714

Open
wants to merge 49 commits into
base: main
Choose a base branch
from

Conversation

dchyun
Copy link
Contributor

@dchyun dchyun commented Feb 19, 2025

📌 Summary

This PR adds the following new components to the HDS components library.

  • Hds::Stepper::Nav
    • Subcomponents: Hds::Stepper::Nav::Step and Hds::Stepper::Nav::Panel
  • Hds::Stepper::List
    • Subcomponent: Hds::Stepper::List::Step

Preview pages

Requirements Doc

🛠️ Detailed description

Hds::Stepper::Nav Component

This component is a visual indicator of an on-page linear progress, where users can see where they are in a given flow.

The component can be used in two ways. Either using the contextual <S.Step> and <S.Panel> components, or using the @steps argument and passing in an array.

Using Contextual Components

// Example
<Hds::Stepper::Nav
  @currentStep={{this.currentStep}}
  @onStepClick={{this.updateCurrentStep}}
  as |S|
>
  <S.Step>
    <:title>Step 1 Title</:title>
    <:description>Description</:description>
  </S.Step>
  <S.Step>
    <:title>Step 2 Title</:title>
  </S.Step>
  <S.Panel>
    Step 1 content
  </S.Panel>
  <S.Panel>
    Step 2 content
  </S.Panel>
</Hds::Stepper::Nav>

Using @steps argument

// Example
{{#let
  (array
    (hash title='Step 1 Title' description='Description')
    (hash title='Step 2 Title')
  )
  as |steps|
}}

<Hds::Stepper::Nav
  @steps={{steps}}
  @currentStep={{this.currentStep}}
  @onStepChange={{this.updateCurrentStep}}
>
  <:body>
    {{#if (eq this.currentStep 0)}}
      Step 1 content
    {{else}}
      Step 2 content
    {{/if}}
  </:body>
</Hds::Stepper::Nav>

Stepper::Nav

  • <[S.Step]>: Stepper::Nav::Step as yielded component
  • <[S.Panel]>: Stepper::Nav::Panel as yielded component
  • <:body>: Named block used for step content when using steps argument
  • steps: Array of data for steps to be created
  • currentStep: Base indexed value for step that is currently active
  • isInteractive: If true, the user may use the stepper to navigation to previous steps
  • titleTag: Sets the DOM tag used for step title text
  • onStepChange: Event triggered when the active step is changed through a click on a step

[S].Step

  • <:title>: Contextual block for title text
  • <:description>: Contextual block for description text

[S].Panel

  • yield: Elements passed as children are yielded as inner content of a
    HTML element

Hds::Stepper::List Component

This component is a visual indicator of a linear progress, where users can see where they are in a given flow.

// Example
<Hds::Stepper::List as |S|>
  <S.Step @status="complete">
    <:title>Title</:title>
    <:description>Description</:description>
    <:content>
      Step 1 content
    </:content>
  </S.Step>
  <S.Step @status="progress">
    <:title>Title</:title>
    <:description>Description</:description>
    <:content>
      Step 2 content
    </:content>
  </S.Step>
  <S.Step @status="incomplete">
    <:title>Title</:title>
  </S.Step>
</Hds::Stepper::List>

Stepper::List

  • <[S].Step>: Stepper::List::Step as yielded component
  • titleTag: Sets the DOM tag used for step title text

[S].Step

  • <:title>: Contextual block for title text
  • <:description>: Contextual block for description text
  • <:content>: Contextual block for any additional content
  • status: Status of the step based on current indicator statuses

📸 Screenshots

Hds::Stepper::Nav

Interactive
Screenshot 2025-03-13 at 3 19 13 PM

Non-interactive
Screenshot 2025-03-13 at 3 19 40 PM

Hds::Stepper::List

Screenshot 2025-03-13 at 3 18 49 PM

🔗 External links

Jira ticket: HDS-4411
Requirements Doc: Link
Figma file: Link


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

Copy link

vercel bot commented Feb 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Mar 17, 2025 3:07pm
hds-website ✅ Ready (Inspect) Visit Preview Mar 17, 2025 3:07pm

@dchyun dchyun force-pushed the dchyun/stepper-component branch from 48d7682 to e5a3399 Compare February 21, 2025 16:09
@dchyun dchyun force-pushed the dchyun/stepper-component branch from 0a8d3e2 to da2209c Compare February 27, 2025 13:14
@dchyun dchyun marked this pull request as ready for review February 27, 2025 16:04
Copy link
Contributor

📦 RC Packages Published

Latest commit: 6de254f

Published 1 packages

@hashicorp/design-system-components@4.18.0-rc-20250317151151

yarn up -C @hashicorp/design-system-components@rc

Copy link
Contributor

@shleewhite shleewhite left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for making all the fixes.

@dchyun dchyun requested review from zamoore and majedelass March 18, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/components release-candidate Publishes release candidates to npm showcase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants