Foundation: update templates for structure and consistency
Pull Request
📖 Description
As part of the next major release of fast-foundation, we wanted to do a complete review of the component templates and align the structure and naming as much as possible.
This PR unifies the naming and cleans up some test styles, especially around the recent update to the start and end slots.
Before on the left, update on the right. "C" = class, "P" = part, "R" = role, "S" = slot. 💔 = potentially style-breaking.
Simple containers
Accordion (migrated to #6796)
- Remove unused
<template>wrapper

Complex containers
Breadcrumb (migrated to #6797)
- Add "start" and "end" slots

Dialog
- 💔 Flatten "positioning-region" element to host

Disclosure
- Update to use "start" and "end" helpers
- 💔 Rename “disclosure” to “details”
- 💔 Rename “invoker” to “summary”
- 💔 Rename “disclosure-content” to “content”
- Add
partto "details", "summary", and "content"

Radio group
- 💔 Rename “positioning-region” to “control”
- 💔 Remove “horizontal” or “vertical” class, use attribute on host instead

Toolbar
- 💔 Rename “positioning-region” to “control”

Inputs
Number field (migrated to #6798)
- 💔 Rename “control” to “field”
- 💔 Rename “root” to “control”
- 💔 Rename “controls” to “step-buttons”
- 💔 Rename “step-up-glyph” to “step-up-icon”
- 💔 Rename “step-down-glyph” to “step-down-icon”

Search (migrated to #6798)
- 💔 Rename “control” to “field”
- 💔 Rename “root” to “control”
- 💔 Remove “input-wrapper”
- 💔 Rename “clear-glyph” to “clear-icon”

Switch (migrated to #6798)
- 💔 Rename “switch” to “control”
- 💔 Rename "switch" slot to "thumb"
- Add default "thumb" with class and part

Text area (migrated to #6798)
- 💔 Rename “control” to “field”
- Add wrapper element “control”
- Add "start" and "end" slots

Text field (migrated to #6798)
- 💔 Rename “control” to “field”
- 💔 Rename “root” to “control”

Start, content, end pattern
Badge (migrated to #6797)
- Add "start" and "end" slots
- 💔 Rename “control” to “content”

Breadcrumb item (migrated to #6797)
- 💔 Flatten “listitem”
divtotemplate

Tab
- Wrap default slot in “content”

Items with children
Accordion item (migrated to #6796)
- 💔 Rename “icon” to “expand-collapse-icon”
- 💔 Move “start”, "end", and "expand-collapse-icon" inside “button”
- 💔 Rename "region" class and part to "panel"

Combobox
- 💔 Rename “indicator” to “open-close-icon” (slot and wrapper)
- 💔 Move “open-close-icon” outside of “control” slot
- 💔 Move “end” slot before “open-close-icon”
- 💔 Rename "selected-value" to "field"
- 💔 Rename "control" slot to "field"

Horizontal scroll (migrated to #6921)
- 💔 Rename "content-container" to "content"
- 💔 Rename "scroll-prev" to "scroll-previous"
- 💔 Remove "scroll-action" containers
- Add default flipper content with parts

Menu item
- 💔 Remove “input-container”
- 💔 Rename “checkbox” to “checkbox-indicator”
- 💔 Rename “radio” to “radio-indicator”
- 💔 Remove “expand-collapse-glyph-container”
- 💔 Rename “expand-collapse” to “submenu-icon”
- 💔 Rename “expand-collapse-indicator” to “submenu-icon”

Select
- 💔 Align to ARIA spec
- 💔 Rename “indicator” to “open-close-icon” (slot and wrapper)
- 💔 Remove “control” container
- 💔 Move “open-close-icon” outside of “control” container
- 💔 Add "button" element inside "button-container"
- 💔 Move "start" and “end” slots into "button"
- Add "listbox-container" slot

Tree item
- 💔 Remove “positioning-region” element
- 💔 Rename “content-region” to “control”
- 💔 Rename “expand-collapse-glyph” to “expand-collapse-icon”
- Add “content” wrapper around default slot

Everything else
Avatar
- 💔 Remove "backplate" container
- Add "content" wrapper around default slot

Progress (migrated to #6799)
- 💔 Rename "progress" container to "determinate" and "indeterminate"
- 💔 Change “determinate”
divtoslot - 💔 Remove “indeterminateIndicator2” option

Progress ring (migrated to #6799)
- 💔 Follow
Progressstructure

Slider (migrated to #6800)
- 💔 Rename “track-container” part to “track”
- Add default "thumb" with class and part
- 💔 Remove duplicate class (orientation) on root template element

Slider label (migrated to #6800)
- 💔 Flatten “container” and “root”
- 💔 Rename “label” to “content”
- Add part to "mark" and "content"

👩💻 Reviewer Notes
Review the Storybook site, or the illustrations of the components before and after, compared to the changes in code.
📑 Test Plan
Tested via comparison against proposal and in Storybook.
✅ Checklist
General
- [x] I have included a change request file using
$ yarn change - [ ] I have added tests for my changes.
- [x] I have tested my changes.
- [x] I have updated the project documentation to reflect my changes.
- [x] I have read the CONTRIBUTING documentation and followed the standards for this project.
Component-specific
- [ ] I have added a new component
- [x] I have modified an existing component
I don't have strong opinions on how these should be structured. That's more the area of @chrisdholt. I'll just review the code itself independent of those decisions.
Related to #5806
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Hey @bheston , thanks for all the updates. When is this planned to be merged?
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
@radium-v please take a look at the test file changes. I'm getting one failure currently that I'm not sure how to fix
src\tree-item\tree-item.pw.spec.ts:253:9 › TreeItem › events › should emit a "change" event when the
expandedproperty changes
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
@microsoft-github-policy-service agree
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Azure Static Web Apps: Your stage site is ready! Visit it here: https://purple-ocean-0b7ce3410-6286.centralus.azurestaticapps.net
Closing this due to the sheer number of conflicts and this also seems like it might break downstream CSS for consumers.