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: enhanced step customization #1331

Merged
merged 24 commits into from
Jul 15, 2024

Conversation

akashyeole
Copy link
Member

@akashyeole akashyeole commented Jun 26, 2024

By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---

CONTRIBUTING.md also tells you what to expect in the PR process.

Description

Complete state of the step can now be set by new complete prop on every step.
And every complete step's label can be clicked to navigate to that step.
Enhanced accessibility of the component.

Related Issue
#1307

📦 Published PR as canary version: 23.4.0--canary.1331.8e7a4869076662c8bb756c563db5831fea87a23c.0

✨ Test out this PR locally via:

npm install @infineon/infineon-design-system-stencil@23.4.0--canary.1331.8e7a4869076662c8bb756c563db5831fea87a23c.0
# or 
yarn add @infineon/infineon-design-system-stencil@23.4.0--canary.1331.8e7a4869076662c8bb756c563db5831fea87a23c.0

@akashyeole akashyeole added the minor minor version bump label Jun 26, 2024
@akashyeole akashyeole self-assigned this Jun 26, 2024
@akashyeole akashyeole linked an issue Jun 26, 2024 that may be closed by this pull request
@akashyeole akashyeole marked this pull request as draft June 26, 2024 12:52
Copy link
Contributor

github-actions bot commented Jun 26, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-07-15 13:54 UTC

Copy link
Contributor

--STORYBOOK-PREVIEW--

@akashyeole akashyeole marked this pull request as ready for review June 27, 2024 09:13
@akashyeole akashyeole requested a review from tishoyanchev June 27, 2024 09:13
@tishoyanchev
Copy link
Contributor

tishoyanchev commented Jun 28, 2024

@akashyeole
In addition to what we already discussed:

  • add the emitted events in storybook + event description. Look at the example of how it's done with other components
  • complete prop is not listed in the storybook page as an option
  • create an internal state for activeStep prop. Props should not be mutated.
  • active step cannot be error. When you set error to true on active step, the label becomes red, but indicator remains active. This should not be the case. Error should have no effect on an active step.
  • rename event name from ifxActiveStepChange to just ifxChange.

@akashyeole akashyeole marked this pull request as draft July 1, 2024 12:39
@akashyeole akashyeole marked this pull request as ready for review July 2, 2024 10:14
@tishoyanchev
Copy link
Contributor

  • the 'activeStep' and 'previousStep' properties of the event object are not numbers showing the active step, but instead
    the stepper component itself.

  • when I increment the active step, the previous one becomes 'error' by default. It should be completed by default. All the
    steps prior to the current active one are by default 'completed'.

  • too many unnecessary comments for every prop/state/statement

  • use ifx-link for the labels

@akashyeole
Copy link
Member Author

@tishoyanchev

  • the 'activeStep' and 'previousStep' properties of the event object are not numbers showing the active step, but instead the stepper component itself.
  1. Fixed - now the activeStep and previousStep properties of the event object are numbers.
  • when I increment the active step, the previous one becomes 'error' by default. It should be completed by default. All the steps prior to the current active one are by default 'completed'.
  1. Whenever the step is changed, if the previous step is incomplete it will become error by default - this is the current logic because of which the previous step becomes error. So, user has to mark the step complete explicitly using step.complete = true.

    Note - On load time all the steps before active step will be complete by default.

  • too many unnecessary comments for every prop/state/statement
  1. The comments above every prop will assist the developer to understand its use in a code editor itself. Please see the image
    image
    image

    I will remove them if you want.

  • use ifx-link for the labels
  1. Fixed - used ifx-links (underlined variant) in default stepper variant.

@tishoyanchev
Copy link
Contributor

1 - when showNumber is true, the number appears on every step, even on the currently active one, thus overriding the activeStep state. This should not be the case. The currently active Step state should not be overridden by the number.
2 - variant by default should be 'default'. If no variant is specified, it should be the 'default' one. Currently, if no variant is specified, the component does not render.

@tishoyanchev tishoyanchev merged commit 8f4b3ae into master Jul 15, 2024
8 checks passed
Copy link
Contributor

🚀 PR was released in v23.4.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor minor version bump released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stepper: enhance step customization
2 participants