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

Update various components to be callable #2734

Merged
merged 6 commits into from
Aug 1, 2022
Merged

Update various components to be callable #2734

merged 6 commits into from
Aug 1, 2022

Conversation

querkmachine
Copy link
Member

@querkmachine querkmachine commented Jul 26, 2022

Updates various components to be callable.

Callers make it easier for users of the Design System to pass large amounts of HTML directly into a component, without having to first assign it to a variable and then pass it to the html parameter.

Suggested in #941, and based on the list of components I commented there, with some changes.


I intend to make these components callable. In all situations, the called content will replace and take priority over the html and text parameters.

  • Details
  • Error summary (replacing the descriptionHtml and descriptionText parameters)
  • Inset text
  • Notification banner
  • Panel

I'm no longer considering the following components:

  • Cookie banner: This component accepts looping content to allow for segregating consent into multiple groups. This is incompatible with using a caller, which only supports one slot of called content per component.
  • Warning text: The main text of this component is presented inside of a <strong> element, negating the usefulness of using a caller, as it's unlikely to ever be more than one line of text.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2734 July 26, 2022 16:33 Inactive
@querkmachine querkmachine linked an issue Jul 26, 2022 that may be closed by this pull request
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2734 July 27, 2022 15:32 Inactive
@querkmachine querkmachine marked this pull request as ready for review July 27, 2022 15:37
@querkmachine querkmachine requested a review from a team July 27, 2022 15:37
Copy link
Contributor

@domoscargin domoscargin left a comment

Choose a reason for hiding this comment

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

This looks good to me - and anecdotally would've been useful in my previous work using govuk-frontend!

I've left two small notes on the Changelog, which aren't blocking.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2734 August 1, 2022 13:47 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2734 August 1, 2022 13:57 Inactive
Copy link
Contributor

@domoscargin domoscargin left a comment

Choose a reason for hiding this comment

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

Looks grand!

@querkmachine querkmachine merged commit e3ae742 into main Aug 1, 2022
@querkmachine querkmachine deleted the kg-callers branch August 1, 2022 16:09
@querkmachine querkmachine mentioned this pull request Aug 9, 2022
@paulmsmith
Copy link

I have been manually doing this in my projects for quite a while (with a wrapper macro). This is brill!

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

Successfully merging this pull request may close these issues.

Consider making more components callable
5 participants