-
Notifications
You must be signed in to change notification settings - Fork 51
Accessible Headings: Add tag arguments to components #2353
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
8707913 to
7e84176
Compare
alex-ju
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good! I left a couple of questions and recommendations.
More generally, it would be good to add tests for the newly introduced arguments. We'd also need to update the API in website and update some examples (or add new ones), but that can be done in a separate PR if you prefer.
packages/components/src/components/hds/dialog-primitive/types.ts
Outdated
Show resolved
Hide resolved
packages/components/src/components/hds/dialog-primitive/header.ts
Outdated
Show resolved
Hide resolved
3dc1def to
3318689
Compare
@alex-ju I was planning on updating the website in a separate PR! I wanted to take a bit of time to think about how to explain / demonstrate the correct usage. |
alex-ju
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work!
zamoore
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
packages/components/src/components/hds/dialog-primitive/header.ts
Outdated
Show resolved
Hide resolved
b63c3dd to
066ddfd
Compare
| SPDX-License-Identifier: MPL-2.0 | ||
| }} | ||
| <div class="hds-alert__title hds-font-weight-semibold" ...attributes>{{yield}}</div> | ||
| {{! IMPORTANT: we removed any extra newlines before/after the `let` to reduce the issues with unexpected whitespaces (see https://github.com/hashicorp/design-system/pull/1652) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine (and I see this is already merged) but just to let you know, another way to remove whitespace within Ember HBS files is to use tilde symbols "~" (sometimes referred to as "squishies" in Ember)
An example of using squishies in our code base: https://github.com/hashicorp/design-system/blob/main/packages/components/src/components/hds/rich-tooltip/index.hbs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! Cool! Danger of copy/pasting from older files haha, I have another branch to update the default tags for Modal/Flyout so maybe I can clean that up in that PR.
📌 Summary
If merged, this PR will add a
tagortitleTagargument to the following components:Note for reviewers: It is probably easiest to review this PR by commit because each component was done in a separate commit.
🛠️ Detailed description
The new argument accepts: "div" or "p", depending on which the component currently uses, and
"h1" | "h2" | "h3" | "h4" | "h5" | "h6"Accordion
Alert
ApplicationState
"div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6"CodeBlock
DialogPrimitive
Also updates the showcase so there are examples of customized tags.
📸 Screenshots
The rendered HTML for Accordion when you pass

titleTag🔗 External links
RFC: https://go.hashi.co/rfc/ds-087
Jira ticket: HDS-3772
👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.