Skip to content

feat(pie-switch): DSW-4019 bind the checked prop correctly and add missing form behaviours#2963

Open
raoufswe wants to merge 12 commits into
mainfrom
dsw-4019-switch-default-checked
Open

feat(pie-switch): DSW-4019 bind the checked prop correctly and add missing form behaviours#2963
raoufswe wants to merge 12 commits into
mainfrom
dsw-4019-switch-default-checked

Conversation

@raoufswe

@raoufswe raoufswe commented Jun 23, 2026

Copy link
Copy Markdown
Member

Describe your changes (can list changeset entries if preferable)

  • [Added] - Wrapped the checked value with the lit live directive to ensure the DOM and component state stay in sync.
  • [Added] - Missing defaultChecked prop and form rest logic
  • [Changed] - Refactored the toggle between leading and trailing labels to be handled via CSS.
  • [Changed] - Updated the component to use a <div> as the parent wrapper when the label prop isn’t provided. This avoids nested <label> elements when consumers wrap the component with an external label, which is an invalid HTML pattern

Author Checklist (complete before requesting a review, do not delete any)

  • I have performed a self-review of my code.
  • I have added thorough tests where applicable (unit / component / visual).
  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • [-] I have reviewed visual test updates properly before approving.
  • If changes will affect consumers of the package, I have created a changeset entry.
  • If a changeset file has been created, I have tested these changes in PIE Aperture using the /test-aperture command.

Not-applicable Checklist items

Please move any Author checklist items that do not apply to this pull request here.


Reviewer checklists (complete before approving)

Mark items as [-] N/A if not applicable.

Reviewer 1

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

Reviewer 2

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

@raoufswe raoufswe requested a review from a team as a code owner June 23, 2026 15:44
@raoufswe

This comment was marked as outdated.

@changeset-bot

This comment was marked as outdated.

@pie-design-system-app

This comment was marked as outdated.

@pie-design-system-app

This comment was marked as outdated.

@pie-design-system-app pie-design-system-app Bot temporarily deployed to storybook-testing-pr-2963 June 23, 2026 15:49 Inactive
@pie-design-system-app pie-design-system-app Bot temporarily deployed to storybook-testing-pr-2963 June 24, 2026 10:12 Inactive
@pie-design-system-app pie-design-system-app Bot temporarily deployed to storybook-testing-pr-2963 June 24, 2026 15:05 Inactive
@pie-design-system-app pie-design-system-app Bot temporarily deployed to storybook-testing-pr-2963 June 24, 2026 16:07 Inactive
@pie-design-system-app pie-design-system-app Bot temporarily deployed to storybook-testing-pr-2963 June 24, 2026 16:29 Inactive
@raoufswe

This comment was marked as outdated.

@pie-design-system-app

This comment was marked as outdated.

@pie-design-system-app

This comment was marked as outdated.

@pie-design-system-app pie-design-system-app Bot temporarily deployed to storybook-testing-pr-2963 June 24, 2026 17:08 Inactive
@raoufswe

This comment was marked as outdated.

@pie-design-system-app

This comment was marked as outdated.

@pie-design-system-app

This comment was marked as outdated.

Comment thread .changeset/small-mugs-mix.md Outdated
@raoufswe raoufswe changed the title feat(pie-switch): DSW-4019 remove unnessary prop and bind checked correctly feat(pie-switch): DSW-4019 bind the checked prop correctly and add missing form behaviours Jun 26, 2026
@pie-design-system-app pie-design-system-app Bot temporarily deployed to storybook-testing-pr-2963 June 26, 2026 15:19 Inactive
@raoufswe

This comment was marked as off-topic.

@pie-design-system-app

This comment was marked as outdated.

@pie-design-system-app

This comment was marked as outdated.

@pie-design-system-app

Copy link
Copy Markdown
Contributor



Fails
🚫 You have unchecked checklist items outside the "Not-applicable Checklist items" section.

Please ensure all unchecked checkboxes are moved to the appropriate section.

🚫 You have unchecked checklist items in Reviewer 1's section.

Please ensure all items are addressed before approval.

🚫 You have unchecked checklist items in Reviewer 2's section.

Please ensure all items are addressed before approval.

Generated by 🚫 dangerJS against 8b49a03

@raoufswe

Copy link
Copy Markdown
Member Author

/snapit

@pie-design-system-app

Copy link
Copy Markdown
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-app

Copy link
Copy Markdown
Contributor

@raoufswe Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/pie-cookie-banner@0.0.0-snapshot-release-20260626172928 --mode=update-lockfile
yarn up @justeattakeaway/pie-switch@0.0.0-snapshot-release-20260626172928 --mode=update-lockfile
yarn up @justeattakeaway/pie-webc@0.0.0-snapshot-release-20260626172928 --mode=update-lockfile

Then finally:

yarn install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant