-
Notifications
You must be signed in to change notification settings - Fork 327
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
feat(elements): Adjust FieldState and Field #3017
feat(elements): Adjust FieldState and Field #3017
Conversation
🦋 Changeset detectedLatest commit: bd2c9f0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
<Label className='sr-only'>Email</Label> | ||
<Input | ||
className={`bg-[rgb(12,12,12)] border-[rgb(37,37,37)] border rounded w-full placeholder-[rgb(100,100,100)] px-4 py-2 ${ | ||
fieldState === 'invalid' && 'border-red-500' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Just an observation, I would actually consider this not the proper usage of accessing field state. Given that we have the data attribute for styling purposes, that's probably how we would want to educate folks for basic styling.
For more advanced use cases, like animation, then we have the render prop for programmatic access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, agree. One should use the data attribute - but since this is our Playground and I needed a way to test it + have it used somewhere to see possible future regressions I opted to do that 👍
* fix(elements): Update FieldState function prop signature * feat(elements): Add state children function to Field * chore(elements): Bump version
Description
<FieldState>
to return its state directly in the function param, not nested inside an object<Field>
to allow for a function prop that gives back the field stateFixes SDK-1524
Fixes SDK-1525
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change