Skip to content

Conversation

alexcarpenter
Copy link
Member

@alexcarpenter alexcarpenter commented Sep 3, 2024

Description

Up until this point each step has a wrapping div or form element that comes from the Elements step component. This caused some width issues with the max width on the card and adds an extra element in the dom that we could merge into the card root component.

This PR adds asChild props where missing on steps in elements and adds support for an as prop on the card root component to render as either a div or form element. This allows us to use asChild on the step onto the card root reducing the extra element. Reducing the amount of descriptors needed ultimately.

Example:

<SignIn.Step asChild name="start">
  <Card.Root as="form">...</Card.Root>
</SignIn.Step>
BEFORE AFTER
Screenshot 2024-09-04 at 12 47 32 PM Screenshot 2024-09-04 at 12 46 27 PM

Fixes SDKI-641

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Sep 3, 2024

🦋 Changeset detected

Latest commit: 958f897

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/elements Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…max-width-space' of github.com:clerk/javascript into alexcarpenter/sdki-641-ensure-card-component-fills-the-max-width-space
@alexcarpenter alexcarpenter marked this pull request as ready for review September 4, 2024 18:08
Copy link
Contributor

@joe-bell joe-bell left a comment

Choose a reason for hiding this comment

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

All working for me! Nice work @alexcarpenter

@alexcarpenter alexcarpenter enabled auto-merge (squash) September 5, 2024 12:48
@alexcarpenter alexcarpenter merged commit 75d575a into main Sep 5, 2024
20 checks passed
@alexcarpenter alexcarpenter deleted the alexcarpenter/sdki-641-ensure-card-component-fills-the-max-width-space branch September 5, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants