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

StepFlow - change title prop type #6732

Closed
1 task done
gusch opened this issue May 13, 2024 · 6 comments · Fixed by #6795
Closed
1 task done

StepFlow - change title prop type #6732

gusch opened this issue May 13, 2024 · 6 comments · Fixed by #6795

Comments

@gusch
Copy link
Contributor

gusch commented May 13, 2024

Description

Dialog’s title prop can be an Element and we use it to display an icon next to the title when the action is destructive.
We are now introducing StepFlow in Dialogs but StepFlow’s title is only a string.

Suggested solution

Make StepFlow's title prop accept an Element

Demo URL

No response

Alternatives

No response

Additional context

No response

Confidentiality

  • I confirm there is no confidential or commercially sensitive information included.
@gusch gusch added Enhancement triage Triage Required labels May 13, 2024
@edleeks87
Copy link
Contributor

edleeks87 commented May 13, 2024

@tempertemper would this be an acceptable enhancement for us to make, I believe you previously steered to limit it to just a subset of heading elements but there may be use cases that call for loosening that?

@edleeks87 edleeks87 added Design System Review Required DS team to review changes Pending a11y Review and removed Design System Review Required DS team to review changes labels May 14, 2024
@tempertemper
Copy link
Contributor

Is this to add an icon into the <h1> (or whatever other heading has been used)? If so, it wouldn't be a big deal. But replacing a heading with another element wouldn't be great. But I may be getting the wrong end of the stick. What's the use-case here, @gusch?

@gusch
Copy link
Contributor Author

gusch commented May 24, 2024

@tempertemper Yes. Our use case is to use an icon in the header.
Something like that but in the StepFlow
image

@franip-sage
Copy link

franip-sage commented May 24, 2024

I would like to raise another use case where we are not using an icon but an image:

image

As allowing to replace the heading element with another could be an issue, could you consider making the title being optional or making the info and visual elements usable without the title? I mean, export and consume only this:

image

@edleeks87
Copy link
Contributor

FE-6644

tomdavies73 added a commit that referenced this issue Jun 24, 2024
adds the 'titleNodeLeft' and 'titleNodeRight' props to provide consumers with the means to render a
node before or after the `SepFlow` title. To be used to provide users with additional title context
and information

fix #6732
tomdavies73 added a commit that referenced this issue Jun 28, 2024
the sub component `StepFlowTitle` has been created to enable consumers to use a compositional
approach, and render custom title content. Consumers can now pass a node to the `title` prop
and pass any relevant elements to achieve designs and meet requirements - as well as the
`StepFlowTitle` within that node, to ensure the component still functions correctly.

Within the `StepFlowTitle` sub component, consumers can pass the `titleString` prop to override
the text children, `titleVariant` to change the heading level between h1 and h2 and the
`screenReaderOnlyTitle` to provide an alternative screen reader only title. This is useful
if added information or context needs to be added to the title, especially if other elements
have now been rendered in the node passed to the `title` prop.

fix #6732
tomdavies73 added a commit that referenced this issue Jul 3, 2024
the sub component `StepFlowTitle` has been created to enable consumers to use a compositional
approach, and render custom title content. Consumers can now pass a node to the `title` prop
and pass any relevant elements to achieve designs and meet requirements - as well as the
`StepFlowTitle` within that node, to ensure the component still functions correctly.

Within the `StepFlowTitle` sub component, consumers can pass the `titleString` prop to override
the text children, `titleVariant` to change the heading level between h1 and h2 and the
`screenReaderOnlyTitle` to provide an alternative screen reader only title. This is useful
if added information or context needs to be added to the title, especially if other elements
have now been rendered in the node passed to the `title` prop.

fix #6732
carbonci pushed a commit that referenced this issue Jul 29, 2024
## [141.2.0](v141.1.1...v141.2.0) (2024-07-29)

### Features

* **step-flow:** allow component title to be compositional ([4d5d808](4d5d808)), closes [#6732](#6732)
@carbonci
Copy link
Collaborator

🎉 This issue has been resolved in version 141.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

5 participants