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

[Playground] Add identifier component #11

Draft
wants to merge 41 commits into
base: develop
Choose a base branch
from

Conversation

amyleadem
Copy link
Contributor

@amyleadem amyleadem commented May 28, 2024

Summary

Created a playground for potential options for the a usa-identifier web component.

Important

This is no longer the most current work on the identifier component.

The current identifier web component work now lives in PR #21. PR #21 will focus on developing and evolving the declarative markup version of the identifier found here. At this time it will not include the attribute-based implementations found in this PR. I am leaving this playground PR open for reference in case anyone wants to look at the attribute-based options.

Please add any comments about the identifier web component to PR #21, not this PR.

Related issues

Closes #10

@amyleadem amyleadem changed the title Add identifier component [Playground] Add identifier component May 28, 2024
@amyleadem amyleadem linked an issue May 29, 2024 that may be closed by this pull request
8 tasks
@amyleadem amyleadem changed the base branch from mh/lit-banner to jm/add-storybook June 12, 2024 23:24
Base automatically changed from jm/add-storybook to develop June 14, 2024 14:58
${masthead.disclaimer} <a href="${primary_agency.url}">${primary_agency.name}</a>
${secondary_agency ? html`${masthead.conjunction} <a href="${secondary_agency.url}">${secondary_agency.name}</a>`: null}${taxpayer ? html`. ${taxpayer}`: null}
</p>
<nav slot="links">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Question:
Do we want to keep the slot on the wrapper here or should we have named slots for each individual link (e.g., <a slot="about-link")?

I opted for adding the slot name to the wrapper here so that the user can have the flexibility to control the order of their own list and also the ability to add links to the list if they ever need to (Right now the code just loops through each child of "links", wraps it, and puts it on the page). If we want to remove that flexibility and better control the link order and link types, I can add the slot names to the links instead. Curious what you all think is better here!

Comment on lines +63 to +68
if (this.disclaimer.innerHTML.includes("An official")) {
this.disclaimer.innerHTML = this.disclaimer.innerHTML.replace(
"An official",
'<span aria-hidden="true">An</span> official'
);
}
Copy link
Contributor Author

@amyleadem amyleadem Jun 14, 2024

Choose a reason for hiding this comment

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

Todo

Manipulating the innerHTML here causes an error any time you try to manipulate the story controls. Need to find an alternate method.

Error message:

This ChildPart has no parentNode and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's innerHTML or textContent can do this.

@mejiaj
Copy link
Collaborator

mejiaj commented Jul 10, 2024

@amyleadem is this safe to close because new work is captured in #21?

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.

Web Component Identifier: Develop Alpha 1
3 participants