ic-ui-kit icon indicating copy to clipboard operation
ic-ui-kit copied to clipboard

[ic-step]: Make `current` a separate boolean prop and consider renaming `stepType` prop to `state`

Open GCHQ-Developer-112 opened this issue 1 year ago โ€ข 3 comments

๐Ÿ’ฌ Description

At the moment, the stepTypes for stepper are: "active" | "completed" | "current" | "disabled". It's possible for a step to be both of these types, for example a step can be both current and active. Currently, it's on the user to control what type a step should be before and after it's been the current step. This includes logic that I assume a lot of users will be writing. We can improve ic-stepper by removing the need for this logic and introducing a separate current prop that works as a boolean.

In addition to this, we should consider changing the prop stepType to state. This likely requires further research but my opinion is that state is more reflective of what is changing on ic-step.

๐Ÿ’ฐ Use value

Both of these changes will hopefully make ic-stepper more intuitive and better in terms of user experience.

๐Ÿ“ Acceptance Criteria

  • [ ] "current" should be removed from the existing stepType prop
  • [ ] There should be a new boolean prop called current which should take on the behaviour of the old "current" stepType prop
  • [ ] Rename stepType prop to state

๐Ÿงพ Guidance

Guidance may need to be written explaining the new current prop

GCHQ-Developer-112 avatar Sep 03 '24 07:09 GCHQ-Developer-112

Moved to top of PI 11 on assumption it might be a breaking change for v3

MI6-255 avatar Feb 24 '25 15:02 MI6-255

Not convinced we need to introduce a new property.

Active = a step in the process that has not been completed and is not current Current = a step that was active, is now current (because the proceeding step is now marked as completed) and is the main focus of activity in the process.

Atoms/Step number, Atoms/Step title, Atoms/Step connector, Atoms/Indicator all use State property. Atoms/Step uses Step Type

Design to rename Atoms/Step property to State for consistency - this will enable us to implement #3296

mi6-577 avatar Mar 20 '25 08:03 mi6-577

State property renamed in #3296 - introducing warning and error states for stepper and compact stepper

mi6-577 avatar Mar 24 '25 09:03 mi6-577