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

Fork number-field and text-field templates #2495

Merged
merged 12 commits into from
Jan 3, 2025
Merged

Fork number-field and text-field templates #2495

merged 12 commits into from
Jan 3, 2025

Conversation

mollykreis
Copy link
Contributor

Pull Request

🀨 Rationale

Fork the FAST templates for the number-field and the text-field in preparation for adding a required-visible icon to the label (see #2100)

πŸ‘©β€πŸ’» Implementation

Forked the FAST templates for the number-field and the text-field with no functional changes.

πŸ§ͺ Testing

Verified tests still pass and no visual changes were introduced to those components.

βœ… Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@mollykreis mollykreis requested a review from msmithNI December 12, 2024 17:12
@mollykreis
Copy link
Contributor Author

@msmithNI, will you buddy this PR for me?

@mollykreis mollykreis changed the title Fork templates Fork number-field and text-field templates Dec 12, 2024
@mollykreis mollykreis marked this pull request as ready for review January 2, 2025 20:10
@rajsite rajsite merged commit 6a8328d into main Jan 3, 2025
12 checks passed
@rajsite rajsite deleted the fork-templates branch January 3, 2025 17:04
mollykreis added a commit that referenced this pull request Jan 6, 2025
…2496)

# Pull Request

## 🀨 Rationale

Add `required-visible` attributes to the radio-group, select, combobox,
and text-area components as part of #2100.

There is still a need to add this attribute to the text-field and
number-field. That will be done once the templates for those components
have been forked (#2495).

## πŸ‘©β€πŸ’» Implementation

Within the `patterns` directory, I created a mixin that can be used on
elements that should have a `requiredVisible` property and
`required-visible` attribute. Additionally, shared styling was added for
the `requiredVisible` state and a function was created to generate the
template for an element's label. This is a function rather than a
constant template because each element already had an existing label
structure that I didn't want to change as part of this PR.

The template of each element included in this PR was also updated to set
`aria-required` based on the value of `requiredVisible`.

I also updated the styling of icons to solve a problem I encountered
when shrinking the asterisk icon down to 5x5.

## πŸ§ͺ Testing

- Manually tested
- New matrix tests
- Unit tests for the new mixin
- New unit tests for the ARIA behavior of each element

## βœ… Checklist

<!--- Review the list and put an x in the boxes that apply or ~~strike
through~~ around items that don't (along with an explanation). -->

- [ ] I have updated the project documentation to reflect my changes or
determined no changes are needed.

---------

Co-authored-by: Fred Visser <1458528+fredvisser@users.noreply.github.com>
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.

3 participants