-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(form): use native as default validation behavior #4425
Conversation
🦋 Changeset detectedLatest commit: 521e33b The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request introduces significant changes to the validation behavior across NextUI form-related components. The primary modification is changing the default validation behavior from "aria" to "native" for form components. This change affects documentation, example code, and test suites across multiple files, standardizing how form validation is handled by default. The updates simplify form validation by leveraging native browser validation mechanisms while maintaining flexibility for custom validation approaches. Changes
Suggested labels
Suggested reviewers
Possibly related PRs
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🔭 Outside diff range comments (4)
apps/docs/content/components/form/form-usage.raw.jsx (1)
Add
validationBehavior="aria"
to ensure consistent accessibility validationThe form example is missing the
validationBehavior="aria"
prop that is present in other form examples in the codebase (demo.raw.jsx
andcustom-validation-aria.raw.jsx
). While the form has basic validation attributes:
isRequired
type="email"
errorMessage
Adding
validationBehavior="aria"
to the Form component would ensure consistent accessibility validation behavior across all form examples.🔗 Analysis chain
Line range hint
17-24
: Verify accessibility with native validation.The Input component correctly implements native validation with:
- Required field indicator (
isRequired
)- Proper error message
- Semantic email type
- Accessible label
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for consistent validation behavior across form examples rg -l 'validationBehavior="aria"' apps/docs/content/components/form/Length of output: 182
Script:
#!/bin/bash # Check the implementation details of the form examples rg -A 5 'validationBehavior="aria"' apps/docs/content/components/form/Length of output: 1164
Script:
#!/bin/bash # Check if there are other validation behaviors used rg 'validationBehavior=' apps/docs/content/components/form/Length of output: 292
Script:
#!/bin/bash # Check for other accessibility attributes in the form rg -A 2 'aria-|role=' apps/docs/content/components/form/form-usage.raw.jsxLength of output: 76
Script:
#!/bin/bash # Check the form-usage.raw.jsx file content to understand the validation context cat apps/docs/content/components/form/form-usage.raw.jsxLength of output: 918
Script:
#!/bin/bash # Check if there are any validation-related props or behaviors in the Form component rg -A 3 '<Form' apps/docs/content/components/form/form-usage.raw.jsxLength of output: 211
apps/docs/content/components/form/controlled.raw.jsx (1)
Add
validationBehavior
prop to Form component for explicit validation controlThe current implementation might lead to inconsistent validation behavior since
validationBehavior
is not specified. According to the documentation:
- Form validation uses ARIA validation by default (
validationBehavior="aria"
)- The current implementation combines controlled input with native validation attributes (
isRequired
,errorMessage
)- For proper native HTML form validation that prevents form submission on invalid input,
validationBehavior="native"
should be explicitly set• Add
validationBehavior="native"
to the Form component to ensure proper validation behavior with the controlled input:<Form className="w-full max-w-xs" onSubmit={onSubmit} validationBehavior="native">🔗 Analysis chain
Line range hint
16-27
: Verify controlled input behavior with native validation.The implementation correctly combines controlled input behavior with native form validation. However, we should ensure that the native validation doesn't conflict with the controlled state updates.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for potential validation conflicts in controlled components rg -A 5 'onValueChange.*isRequired.*errorMessage' apps/docs/content/components/form/Length of output: 86
Script:
#!/bin/bash # Let's search for the controlled form component implementation rg -l "Form.*onSubmit.*Input.*isRequired.*errorMessage" apps/docs/content/components/form/ # Check the complete implementation of controlled form cat apps/docs/content/components/form/controlled.raw.jsx # Search for any validation behavior documentation or examples rg -i "validationBehavior.*form" apps/docs/content/Length of output: 2132
apps/docs/content/components/form/demo.raw.jsx (1)
Line range hint
134-143
: Remove explicit validationBehavior from CheckboxThe Checkbox component still uses explicit
validationBehavior="aria"
which contradicts the PR objective to use "native" as default.<Checkbox isRequired classNames={{ label: "text-small", }} isInvalid={!!errors.terms} name="terms" - validationBehavior="aria" value="true" onValueChange={() => setErrors((prev) => ({...prev, terms: undefined}))} >
apps/docs/content/docs/components/form.mdx (1)
Line range hint
80-96
: Update example code to reflect new defaultsThe example code explicitly sets
validationBehavior="aria"
which might confuse users since it contradicts the new default behavior explanation.-<Form validationBehavior="aria"> +<Form> <Input isRequired name="username"
🧹 Nitpick comments (11)
packages/components/autocomplete/__tests__/autocomplete.test.tsx (1)
781-781
: Consider adding test coverage for transition from aria to native validation.While the test case correctly validates the aria behavior, consider adding test cases that verify the transition from aria to native validation to ensure backward compatibility.
it("should support transition from aria to native validation", async () => { const { rerender, getByRole } = render( <Form validationBehavior="aria"> <AutocompleteExample isRequired /> </Form> ); const input = getByRole("combobox"); expect(input).toHaveAttribute("aria-required"); // Rerender with native validation rerender( <Form validationBehavior="native"> <AutocompleteExample isRequired /> </Form> ); expect(input).toHaveAttribute("required"); expect(input).not.toHaveAttribute("aria-required"); });packages/components/date-picker/__tests__/date-picker.test.tsx (2)
786-786
: Consider removing the explicit "native" setting if it is now the default behavior.
If “native” is already the default, specifying “validationBehavior='native'” here might be redundant. Keeping it is harmless but removing it can help reduce clutter.Proposed change (only if you wish to rely exclusively on the new default):
- <Form data-testid="form" validationBehavior="native"> + <Form data-testid="form">
833-834
: Double-check necessity of explicit "native" validation in this controlled scenario.
With “native” now the default, explicitly setting “validationBehavior='native'” may not be necessary. Consider removing it for brevity unless you want to emphasize that the form uses native validation explicitly.Proposed change:
- <Form validationBehavior="native" validationErrors={serverErrors} onSubmit={onSubmit}> + <Form validationErrors={serverErrors} onSubmit={onSubmit}>apps/docs/content/components/form/custom-validation-aria.ts (1)
3-6
: Optional naming clarification.
While using a constant named “react” is valid, consider renaming it to avoid confusion with the React library.apps/docs/content/components/form/native-validation.raw.jsx (1)
9-9
: Consider adding a code comment about native validationSince this example specifically demonstrates native validation behavior (which is now the default), consider adding a comment to explicitly highlight this for users.
+ // This form uses the default native validation behavior <Form className="w-full max-w-xs" onSubmit={onSubmit}>
apps/docs/content/components/form/custom-error-messages.raw.jsx (1)
9-9
: Consider documenting validation behavior interactionSince this example combines native validation with custom error messages, it would be helpful to document how these interact.
+ // Native validation triggers the custom error message callback <Form className="w-full max-w-xs" onSubmit={onSubmit}>
apps/docs/content/components/form/custom-validation-aria.raw.jsx (1)
25-27
: Consider adding aria-label to the submit buttonFor better accessibility, consider adding an aria-label to the submit button.
- <Button type="submit" variant="bordered"> + <Button type="submit" variant="bordered" aria-label="Submit form"> Submit </Button>apps/docs/content/components/input/custom-validation.raw.jsx (1)
14-14
: LGTM! Consider adding a documentation note about validation behavior.The removal of explicit
validationBehavior="native"
aligns with the new default behavior. However, since this is a breaking change, it would be helpful to add a comment explaining that native validation is now the default behavior.Add a comment above the Form component:
+// The Form component uses native validation behavior by default <Form className="w-full max-w-xs" onSubmit={onSubmit}>
apps/docs/content/components/input/server-validation.raw.jsx (1)
19-19
: Consider documenting validation state precedence.The example correctly demonstrates server validation with the new native validation behavior. However, it would be helpful to document how native client-side validation interacts with server validation errors.
Add a comment explaining the validation flow:
+// Native validation runs first, then server validation errors are displayed +// if the form passes client-side validation <Form className="w-full max-w-xs" validationErrors={errors} onSubmit={onSubmit}>apps/docs/content/components/input/real-time-validation.raw.jsx (1)
Line range hint
26-45
: Consider enhancing password validation feedbackThe current implementation shows all errors at once. Consider showing errors progressively as the user types, improving the user experience.
- <Input + <Input + description="Password must contain at least 4 characters, 1 uppercase letter, and 1 symbol" errorMessage={() => ( - <ul> - {errors.map((error, i) => ( - <li key={i}>{error}</li> - ))} - </ul> + errors.length > 0 && errors[0] )} isInvalid={errors.length > 0}packages/components/input/__tests__/input.test.tsx (1)
449-449
: Consider adding more ARIA validation test cases.While the ARIA validation tests are good, consider adding test cases for:
- Field focus handling
- Screen reader announcements
- Validation state transitions
Also applies to: 477-477
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (31)
.changeset/flat-ducks-attack.md
(1 hunks)apps/docs/content/components/form/controlled.raw.jsx
(1 hunks)apps/docs/content/components/form/custom-error-messages.raw.jsx
(1 hunks)apps/docs/content/components/form/custom-validation-aria.raw.jsx
(1 hunks)apps/docs/content/components/form/custom-validation-aria.ts
(1 hunks)apps/docs/content/components/form/custom-validation.raw.jsx
(1 hunks)apps/docs/content/components/form/demo.raw.jsx
(1 hunks)apps/docs/content/components/form/events.raw.jsx
(0 hunks)apps/docs/content/components/form/form-usage.raw.jsx
(1 hunks)apps/docs/content/components/form/index.ts
(2 hunks)apps/docs/content/components/form/native-validation.raw.jsx
(1 hunks)apps/docs/content/components/form/usage.raw.jsx
(1 hunks)apps/docs/content/components/input-otp/input-otp-required.raw.jsx
(0 hunks)apps/docs/content/components/input-otp/required.raw.jsx
(0 hunks)apps/docs/content/components/input/built-in-validation.raw.jsx
(1 hunks)apps/docs/content/components/input/custom-validation.raw.jsx
(1 hunks)apps/docs/content/components/input/real-time-validation.raw.jsx
(1 hunks)apps/docs/content/components/input/server-validation.raw.jsx
(1 hunks)apps/docs/content/docs/api-references/nextui-provider.mdx
(4 hunks)apps/docs/content/docs/components/form.mdx
(3 hunks)apps/docs/content/docs/components/input.mdx
(1 hunks)apps/docs/content/docs/guide/forms.mdx
(6 hunks)packages/components/autocomplete/__tests__/autocomplete.test.tsx
(3 hunks)packages/components/checkbox/__tests__/checkbox-group.test.tsx
(1 hunks)packages/components/checkbox/stories/checkbox-group.stories.tsx
(1 hunks)packages/components/checkbox/stories/checkbox.stories.tsx
(1 hunks)packages/components/date-picker/__tests__/date-picker.test.tsx
(5 hunks)packages/components/form/src/form.tsx
(1 hunks)packages/components/input-otp/stories/input-otp.stories.tsx
(0 hunks)packages/components/input/__tests__/input.test.tsx
(5 hunks)packages/components/select/__tests__/select.test.tsx
(2 hunks)
💤 Files with no reviewable changes (4)
- apps/docs/content/components/input-otp/input-otp-required.raw.jsx
- apps/docs/content/components/input-otp/required.raw.jsx
- apps/docs/content/components/form/events.raw.jsx
- packages/components/input-otp/stories/input-otp.stories.tsx
🧰 Additional context used
🪛 LanguageTool
apps/docs/content/docs/components/input.mdx
[style] ~130-~130: To form a complete sentence, be sure to include a subject.
Context: ...ook-form.com/). ### With Form Input
can be used with a Form
component to leve...
(MISSING_IT_THERE)
🔇 Additional comments (34)
packages/components/autocomplete/__tests__/autocomplete.test.tsx (2)
656-657
: LGTM! Test case aligns with the new default validation behavior.
The test case correctly validates the native validation behavior with the isRequired
prop, which is consistent with the PR's objective to use native validation as the default.
698-699
: LGTM! Comprehensive server validation test with native behavior.
The test case properly validates server-side errors with native validation behavior, ensuring proper error handling and accessibility attributes.
packages/components/date-picker/__tests__/date-picker.test.tsx (3)
873-873
: ARIA-based validation test confirmed.
This scenario accurately tests “aria” validation, demonstrating a clear contrast with “native” validation. Looks good.
906-906
: ARIA validation used correctly.
Continuing to test ARIA-based workflows is consistent and ensures coverage alongside the new default.
933-933
: Consistent use of “aria” for server validation scenario.
This case ensures that ARIA-based server validation flow remains functional when “aria” is explicitly specified.
packages/components/checkbox/__tests__/checkbox-group.test.tsx (2)
297-298
: Switching to native validation looks consistent.
This aligns with the new default validation behavior. Please ensure that integration points using this test have been updated accordingly.
Line range hint 1202-1207
: Retaining ARIA-based test coverage is valuable.
Having a test scenario that exercises ARIA validation ensures comprehensive validation coverage, demonstrating correct fallback or alternate usage.
packages/components/select/__tests__/select.test.tsx (2)
1202-1207
: Good demonstration of ARIA validation usage in the test.
Continuing to test ARIA-specific behavior ensures we have a robust suite for different validation modes.
1257-1257
: Validate that default selection doesn't conflict with custom validation behavior.
The inline validate function flags "penguin" as invalid, which might initially cause confusion if someone is expecting "native" validation to handle it. This is likely intentional for demonstration, but please confirm clarity in documentation or inline comments.
apps/docs/content/components/form/custom-validation-aria.ts (2)
1-2
: Import usage checks out.
Successfully importing the raw JSX content will help highlight ARIA-based validation in docs or demos.
7-9
: Good practice for modular exports.
Spreading the object keeps the file flexible and easy to maintain moving forward.
.changeset/flat-ducks-attack.md (2)
1-9
: Ensure all version increments are correct.
Check that these minor and patch bumps align with each component’s release plan and that dependent packages won’t break on these version increments.
11-11
: Accurate reflection of the PR.
Changing the default validation from ARIA to native is consistent with the objectives of this release.
packages/components/form/src/form.tsx (1)
11-11
: LGTM! Default validation behavior correctly updated to "native"
The implementation maintains proper precedence (props -> globalContext -> default) while changing the default behavior as intended.
Let's verify this is the only instance setting the default validation behavior:
✅ Verification successful
Default validation behavior is consistently set across components
The verification shows that the default validation behavior is correctly set to "native" across all form-related components:
form/src/form.tsx
: Default is "native"radio/src/use-radio-group.ts
: Default is "native"select/src/use-select.ts
: Default is "native"date-input/src/use-date-input.ts
: Default is "native"input/src/use-input.ts
: Default is "native"checkbox/src/use-checkbox-group.ts
: Default is "native"autocomplete/src/use-autocomplete.ts
: Default is "native"
All components follow the same precedence pattern: props -> formValidationBehavior -> globalContext -> "native"
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any other instances setting validation behavior defaults
rg -g '!*.test.*' -g '!*.spec.*' "validationBehavior.*=.*[\"'](?:native|aria)[\"']"
Length of output: 4524
apps/docs/content/components/form/index.ts (1)
7-7
: LGTM! Addition of ARIA validation example
The addition of customValidationAria
example is appropriate as it provides guidance for users who need to explicitly opt into ARIA validation behavior after this breaking change.
Also applies to: 19-19
apps/docs/content/components/form/custom-validation.raw.jsx (1)
9-9
: LGTM! Removal of explicit native validation
The removal of validationBehavior="native"
is appropriate as it will become the default behavior. The code is now more concise while maintaining the same functionality.
apps/docs/content/components/form/custom-validation-aria.raw.jsx (1)
9-28
: LGTM! Well-structured ARIA validation example
This example clearly demonstrates how to opt into ARIA validation behavior after the breaking change, with proper form setup and custom validation logic.
apps/docs/content/components/form/form-usage.raw.jsx (1)
15-15
: LGTM! Form implementation aligns with new native validation behavior.
The removal of explicit validationBehavior
prop correctly implements the new default native validation behavior.
apps/docs/content/components/form/usage.raw.jsx (1)
15-15
: LGTM! Consistent implementation across examples.
The form implementation maintains consistency with other examples in adopting the new native validation behavior.
apps/docs/content/components/input/built-in-validation.raw.jsx (1)
14-14
: Verify email validation behavior with native validation.
The removal of explicit validationBehavior
prop is correct as it now defaults to native. However, we should verify that the email validation and error messages work as expected with native validation.
✅ Verification successful
Email validation implementation is correctly configured
The implementation shows proper email validation setup:
- Uses HTML5 native validation through
type="email"
- Has required field validation with
isRequired
- Implements custom error handling for type mismatch
- Correctly omits explicit
validationBehavior
prop to use the new default
The code demonstrates the intended behavior for email validation with appropriate error messaging and required field validation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any test files that verify email validation behavior
fd -e test.tsx -e test.jsx -e spec.tsx -e spec.jsx | xargs rg -l "email.*validation|validation.*email"
# Search for related validation behavior tests
ast-grep --pattern 'test($_, $_) {
$$$
email
$$$
}'
Length of output: 164
Script:
#!/bin/bash
# Let's check the actual implementation of the form validation
rg -A 10 "onSubmit.*=.*{.*onSubmit" apps/docs/content/components/input/built-in-validation.raw.jsx
# Search for email input field configuration
rg "type.*=.*[\"']email[\"']" apps/docs/content/components/input/built-in-validation.raw.jsx
# Check for any validation-related props or configurations
rg "validation|required|pattern" apps/docs/content/components/input/built-in-validation.raw.jsx
Length of output: 589
Script:
#!/bin/bash
# Let's check the complete implementation of the form
rg -B 5 -A 15 "<Form" apps/docs/content/components/input/built-in-validation.raw.jsx
# Check if there are any other validation behavior configurations in the file
rg -l "validationBehavior" apps/docs/content/components/input/built-in-validation.raw.jsx
# Look for any comments or documentation about validation
rg -B 2 -A 2 "validation" apps/docs/content/components/input/built-in-validation.raw.jsx
Length of output: 1059
apps/docs/content/components/input/real-time-validation.raw.jsx (1)
26-26
: LGTM: Form component changes align with new default behavior
The removal of explicit validationBehavior
prop aligns with the PR objective to use "native" as default.
apps/docs/content/components/form/demo.raw.jsx (1)
61-64
: LGTM: Form validation error handling is well-implemented
The use of validationErrors
prop for server-side validation is correct and follows best practices.
apps/docs/content/docs/components/form.mdx (2)
75-76
: LGTM: Documentation clearly explains the new default behavior
The documentation accurately reflects that native validation is now the default behavior and explains how to opt into ARIA validation.
127-127
: LGTM: API documentation correctly shows new default value
The API documentation accurately reflects that "native" is now the default value for validationBehavior
.
apps/docs/content/docs/api-references/nextui-provider.mdx (3)
70-74
: LGTM! Improved locale list formatting
The reformatting of the locale list enhances readability while maintaining all supported locales.
Line range hint 183-189
: LGTM! Enhanced reducedMotion prop documentation
The documentation now clearly explains all available options and their implications for motion preferences.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~186-~186: Loose punctuation mark.
Context: ...tings for reduced motion. - "always"
: Disables all animations. - "never"
:...
(UNLIKELY_OPENING_PUNCTUATION)
176-179
: Breaking Change: Default validation behavior updated
The default validation behavior has been changed from "aria" to "native". This is a breaking change that might affect existing implementations.
Let's verify the impact:
packages/components/checkbox/stories/checkbox.stories.tsx (1)
183-183
: LGTM! Removed redundant validationBehavior prop
The removal of explicit validationBehavior="native"
aligns with the new default behavior.
packages/components/checkbox/stories/checkbox-group.stories.tsx (1)
Line range hint 156-160
: LGTM! Simplified CheckboxGroup validation
The removal of explicit validation behavior prop aligns with the new default behavior while maintaining server-side validation functionality.
apps/docs/content/docs/components/input.mdx (1)
130-130
: LGTM! Documentation update aligns with the new validation behavior.
The documentation now correctly describes Form component integration without tying it to a specific validation behavior, making it more maintainable.
🧰 Tools
🪛 LanguageTool
[style] ~130-~130: To form a complete sentence, be sure to include a subject.
Context: ...ook-form.com/). ### With Form Input
can be used with a Form
component to leve...
(MISSING_IT_THERE)
packages/components/input/__tests__/input.test.tsx (3)
313-314
: LGTM! Comprehensive test coverage for native validation.
The test correctly verifies the native validation behavior with the Form component.
347-348
: LGTM! Proper test coverage for custom validation function.
The test effectively verifies the validate function behavior with native validation.
393-399
: LGTM! Well-structured server validation test.
The test comprehensively covers server validation scenarios with the native validation behavior.
apps/docs/content/docs/guide/forms.mdx (1)
228-229
: LGTM! Clear explanation of ARIA validation behavior.
The documentation clearly explains when and why to use ARIA validation, helping developers make informed decisions.
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, thanks!
* chore: org name change (#4596) * chore: update brand name (#4600) * fix(calendar): function components cannot be given refs (#4614) * docs(modal): fix small typos and add clarifying language (#4629) * chore(deps): bump RA versions (#4611) * chore(deps): bump RA versions * chore(deps): bump @internationalized/date * chore(docs): update RA versions * chore(docs): update versions * chore(docs): use string type * chore(deps): update @react-types versions * refactor(docs): undo version change since they will be removed in another PR * feat: tailwind variants upgrade (#4386) * feat: tailwind variants upgrade * chore: restore npmrc * chore: adjust pkgs * fix: versions * fix: lock file * chore(changeset): update package name * chore(deps): use fixed version * fix(test): incorrect package name --------- Co-authored-by: աӄա <[email protected]> * feat: add fn win alt keys (#4638) * feat: add new keys * feat: add new keys * chore: update docs & storybook as well --------- Co-authored-by: WK Wong <[email protected]> * fix(use-image): load images after props change (#4523) * fix(use-image): load image after props change * chore(changeset): add changeset * refactor(use-image): remove unused props * feat(use-image): add test case * fix(use-image): apply useCallback to load & remove status check * chore(changeset): update package name * feat: global labelPlacement prop (#4346) * feat: adding the support for labelPlacement globally * chore: reafctoring * chore: updating the dependency * chore(changeset): update package name * chore: adding Marcus's suggestions --------- Co-authored-by: աӄա <[email protected]> * fix(form): use native as default validation behavior (#4425) * fix(form): use native as default validation behavior * docs(form): delete explicit validationBehavior=native * test(form): adjusted form test validation behaviors * chore(form): adjusted stories with forms * chore(changeset): changed form default validation behavior to native * chore(changeset): removed packages with only test changes * chore(changeset): change to patch * chore(changeset): update package name * refactor(docs): update package name * refactor(docs): update to heroui --------- Co-authored-by: աӄա <[email protected]> * feat(spinner): new spinner variants (#4555) * refactor(spinner): add default variant * feature(spinner): add gradient variant * feature(spinner): add dots variant * feature(spinner): add dots-blink variant * feature(spinner): add spinner-bars * chore(spinner): add variants storybook * chore: adding variants to docs * chore: simplyfying the styles and modifying docs * chore: nits * chore: updating the dots and dots-blink animation * chore: nits * chore: adding Marcus' suggestions * chore: adding Marcus's suggestions * chore: adding junior's suggestions --------- Co-authored-by: Maharshi Alpesh <[email protected]> * fix: rename wrapper to tab wrapper (#4636) * fix: rename wrapper to tab wrapper * docs: update * docs: update * docs: update * fix: rename wrapper to tab wrapper * refactor: remove feature request from issue template (#4661) * refactor(.github): remove feature request template * refactor(.github): add a link to redirect to discussion (feature request category) * docs(table): include TS examples to show Selection type usage (#4793) * fix(listbox): unexpected scrollShadow on virtualized listbox (#4784) * fix(listbox): add scroll height & scroll top to listbox * fix(use-data-scroll-overflow): handle scrollHeight & scrollTop in virtualization * chore(changeset): add changeset * refactor(theme): replace left & right by start & end to support RTL (#4782) * fix(date-picker): deprecate dateInputClassNames (#4780) * chore(date-picker): add missing slots comments * fix(date-picker): remove dateInputClassNames * fix(date-picker): use classNames instead of dateInputClassNames * chore(docs): add missing attributes * fix(date-picker): use classNames instead of dateInputClassNames * feat(changeset): add changeset * fix(docs): broken type * refactor(navbar): remove dropdown menu width (#4757) * refactor: remove dropdown menu width * refactor: shorter description * refactor: rename instances of NextUI to Hero UI (#4645) * docs: use the correct org for `img.shields.io` license in README * docs: update opencollective org name * docs: use correct org name in site footer * docs: update image urls for heroui pro sections * docs: update laravel installation keywords in route config * docs: add `heroui` tag to `Introducing HeroUI` blog post * fix: use correct names in `plop/components/src` templates * chore: add empty changeset * fix: revert image urls back to `nextuipro.nyc3.cdn.digitaloceanspaces...` * chore: undo footer change * chore: update incorrect brand name * chore(docs): nextui -> heroui --------- Co-authored-by: աӄա <[email protected]> * fix(input): missing clear button with file input type (#4599) * fix(theme): sync with input theme on labelPlacement (#4597) * fix(theme): sync with input theme on labelPlacement * chore(select): revise width for labelPlacement * chore(changeset): add changeset * test(input): input interaction tests (#4579) * test(input): user interaction tests * test(input): missing act wrappers --------- Co-authored-by: WK Wong <[email protected]> * fix(calendar): rtl navigation (#4565) * fix(calendar): rtl navigation * chore(changeset): fixed reverse behavior of NextButton and PrevButton in the RTL calendar * chore(changeset): update package name * refactor(calendar): prefer isRTL and use className in theme package instead * chore(changeset): add theme package as well * chore(calendar): add min theme package to 2.4.7 --------- Co-authored-by: աӄա <[email protected]> * refactor: remove unnecessary className passing to tv and make naming consistent (#4558) * refactor: remove unnecessary className passing to tv * refactor(button): move styles to getButtonProps * refactor: rename classNames to styles to keep the naming consistent * fix: deprecation warning triggered by internal onClick (#4557) * fix(use-aria-link): onClick deprecation warning * fix(use-aria-button): onClick deprecation warning * feat(changeset): add changeset * fix(use-aria-button): incorrect prop name * chore(changeset): update package name * ci: add pkg pr new (#4540) * ci: add pkg pr new * ci: add pkg pr new * chore(workflow): update repo name --------- Co-authored-by: աӄա <[email protected]> * chore(docs): remove shouldBlockScroll prop in Tooltip page (#4539) * fix(use-pagination): controlled page after delay (#4536) * fix(use-pagination): add page to dependency for scrollTo * feat(changeset): add changeset * chore(changeset): update package name * fix(tooltip): accessing element.ref was removed in React 19 issue (#4531) * fix(tooltip): accessing element.ref was removed in React 19 issue * chore(changeset): update package name * fix: correctly dismissable default value (#4524) * fix: correctly dismissable default value * fix: correctly dismissable default value * chore(changeset): update package name --------- Co-authored-by: աӄա <[email protected]> * fix(theme): input height in innerWrapper in Select (#4512) * fix(select): fix input height #4321 * chore(select): changed package name in changeset to theme * chore(select): updated changeset message * chore(changeset): update package name --------- Co-authored-by: աӄա <[email protected]> * fix: inert value in next15 (#4491) * feat: add post install * feat: add postinstall * feat: add postinstall * fix: type * fix: type * fix: next version * chore(changeset): update package name --------- Co-authored-by: աӄա <[email protected]> * refactor: remove cursor-hit in hiddenInputClasses (#4474) * refactor: remove cursor-hit in hiddenInputClasses * Create lazy-ants-exercise.md * chore(changeset): update package name --------- Co-authored-by: աӄա <[email protected]> * feat(table): virtualization (#4285) * feat: baseline virtualization for table * merge branch canary * fix: table layout * fix: calc header height w layouteffect to offset padding * Merge branch 'canary' into feat/eng-1633-virtualization-for-table * chore: remove unused files and comments * chore: add missing package * feat: add shouldVirtualize conditional to render virtualized-table * feat: update docs for table * feat: use wrapper to support theme styles * chore: add changeset * chore(changeset): update package name * chore(deps): pnpm-lock.yaml * fix(table): outdated package name * chore(changeset): add issue number * fix(deps): keep the version consistent with other components * fix(table): incorrect displayName * refactor(table): use VirtualizedTemplate * chore(deps): bump `@tanstack/react-virtua` * chore(deps): typecheck issue * fix(table): do not use any type * chore: remove auto virtualization --------- Co-authored-by: աӄա <[email protected]> Co-authored-by: Junior Garcia <[email protected]> * feat(toast): introduce Toast component (#4437) * feat: initial commit * chore: adding the animation * chore: nits * chore: fixes and adding draft1 of stories * chore: adding the docs draft * chore: adding the swiping interaction for toast removal * chore: adding the tests * fix: improving the progress bar logix * chore: refactoring and refining the animations * fix: making the animations compatible with the positons * chore: fixing the styles * chore: modifying the animations * chore: improving the animations * chore: adding the decorator to the story-book * chore: fixing the animations and positions * fix: handle expand region on touch * feat: adding the promises support * chore: updating the styles * chore: improving styles * chore: styles correction * fix: adding junior's suggestions * chore: correcting styles * fix: fixing the timer behavior * chore: adding the spinner to the toast * chore: full width for mobile * chore: modifying styles * chore: fixing the positions on smaller devices * chore: adding story with description * chore: adding credits for sonner * fix: adding junior's suggestions * chore: adding the exit animation * fix: adding junior's suggestions * chore: improving the swipe animations * fix: fixing the swipe animations on touch * chore: adding tests * chore: adding swipe threshild and initial position variable * fix: fixing autoclose in timeout * chore: modifying the docs * chore: fixing the conflict * chore: adding marcus' suggestions * chore: adding the bottom animations * chore: modying docs * chore: removing nextui references * chore: adding info about the provider * chore: updating the docs * chore: versions in package.json * chore: nits * chore: adding junior's suggestions * chore: nits * fix: applying junior's suggestions * chore: adding junior's suggestions * chore: using domMax * fix: adding Marcus's suggestions * chore: add global toast props and custom close icon * chore: adding the defaultTimout provider prop * chore: modifying defaultTimeout * chore: nits * fix: adding Marcus' suggestions * chore: fixing bg * chore(deps): bump RA deps * fix: fixing the color discrepancy due to the timer * chore: moving the kapan ai to the left side * refactor(toast): update author * chore: nit * chore: improvements * chore: updating the solid variant --------- Co-authored-by: Junior Garcia <[email protected]> Co-authored-by: WK Wong <[email protected]> * fix(docs): correct Tab usage example (#4821) * chore(docs): add note itemHeight for virtualization (#4822) * chore(docs): add note itemHeight for virtualization * fix: format * fix(docs): fix horizontal scrolling example in scroll-shadow (#4820) * refactor: update author in package.json (#4800) * feat(button): export PressEvent for onPress event typing (#4819) * fix(docs): failed to install dependencies in StackBlitz (#4639) * chore(Docs): remove step 2 from "Using use-theme-hook" (#4797) * fix(docs): incorrect code Modal placement (#4652) * docs: update DatePicker example to remove "time" label as time selection is not supported in this example (#4443) * feat(button): export PressEvent for onPress event typing * revert unnecessary changes * chore: format --------- Co-authored-by: աӄա <[email protected]> Co-authored-by: Praharsh Bhatt <[email protected]> * fix(listbox): pass missing press events to usePress (#4812) * fix(listbox): pass missing press events to usePress * feat(listbox): add test case for press event * chore(changeset): add changeset * fix(checkbox): inherit stroke in CheckboxIcon (#4811) * fix: `SelectItem`, `ListboxItem`, and `AutocompleteItem` not to accept `value` props (#4653) * fix(select): `SelectItem` does not accept value props * refactor: do not use the index as `key` * Update .changeset/light-hairs-draw.md * chore: remove unnecessary `value` props * chore: update changeset * refactor: remove unnecessary value prop --------- Co-authored-by: WK Wong <[email protected]> * fix: pkg package scope (#4823) * fix: pkg package scope * fix: pkg package scope * fix: pkg package scope * fix(theme): border radius in Table when isMultiSelectable (#4808) * fix(theme): border radius in Table when isMultiSelectable * chore(theme): added changeset (#4807) * chore: removing the kapa ai for toast doc page (#4833) * fix(accordion): add data-slot attributes to accordion (#4832) * fix(accordion): add data-slot attributes to accordion * chore --------- Co-authored-by: Hovannes Markarian <[email protected]> Co-authored-by: աӄա <[email protected]> * chore(docs): update versions (#4836) * docs(themes): adding theme generator (#4626) * chore: adding xylish's contributions + modifying styles * chore: nextui to heroui * chore: colors in theme generator * chore: radiuses, disable-opacity * chore: fixing the configuration box styles * chore: adding the showcase elemtents * chore: modifying styles * chore: adding the fonts * chore: adding the scaling * chore: removing the calendar * feat: adding the border-width * chore: modifying style for mobile * chore: modifying the styles * chore: removing the NextUI references + small bug fix * chore: adding coderabits reviews * fix: borderWidth not getting applied on breadcrumbs and input * chore: rebasing * chore: modifying the styles * chore: updating the styles for the smaller devices * chore: refactoring * chore: improvements * chore: making the fonts workable * chore: making the fonts workable * chore: modifying the swatch according to the theme * chore: adding the default selected template * chore: modifying mobile styles * chore: fixing the popover * chore: nit * fix: fixing the select styles * chore: modifying the mobile styles * chore: modifying the styles * fix: adding junior's suggestions * fix: fixing the breadcrumb * fix: adding junior's suggestions * feat: introduce NumberInput (#4475) * feat(number-field): init structure * feat(deps): add `@nextui-org/button` & `@react-types/button` * feat(theme): export number-field * feat(number-field): storybook init structure * feat(number-field): add NumberFieldHorizontalStepper * feat(number-field): add NumberFieldHorizontalStepper * feat(theme): init number field theme * feat(number-field): number-field draft * refactor(number-field): revise stepper icons * feat(shared-icons): add ChevronLeftIcon * feat(theme): stepperButton styles * feat(theme): number-field styles * fix(number-field): label layout * feat(number-field): vertical stepper wrapper * feat(number-field): use-number-field (wip) * feat(number-field): add data-direction * feat(theme): center the text if it is horizontal stepper * feat(number-field): add HorizontalStepper * feat(number-field): add HideStepper * chore(number-field): revise minValue & defaultValue * feat(docs): init number field structure * fix(theme): outside-left styles * refactor(theme): remove labelPlacement styles * refactor(number-field): remove labelContent logic * refactor(number-field): remove labelPlacement args * feat(number-field): helper text * feat(number-field): revise number field stories * feat(number-field): description * refactor(number-field): revise number field stories * feat(theme): numberFieldLabelClasses * fix(number-field): incorrect button props * fix(number-field): typing issue on stepper buttons * chore(number-field): add aria-label * refactor(number-field): merge props * fix(number-field): pass originalProps instead * chore(number-field): revise Required story args * feat(number-field): add WithStepValue & WithWheelDisabled & revise stories * chore(number-field): add label to Required * feat(docs): number-field doc page * fix(number-field): typing issue * fix(number-field): test cases * fix(number-field): user.keyboard & defaultValue * fix(number-field): should work with defaultValues * chore(number-field): add type: number * chore(number-field): remove hidden related code * fix(number-field): numeric value * chore(changeset): add changeset * feat(deps): add "@nextui-org/number-field" to docs * feat(react): export `@nextui-org/number-field` * feat(changeset): add @nextui-org/react * feat(docs): number-field examples * chore(number-field): use text instead * refactor(number-field): remove unnecessary filled-within * fix(number-field): test case * chore(number-field): remove aria-label for stepper buttons * feat(docs): add incrementAriaLabel & decrementAriaLabel to NumberField * chore(number-field): reorder WithFormatOptions * fix(deps): update number-field's peerDependencies & dependencies * feat(number-field): hidden input for holding numeric vaule * fix(docs): number field title * feat(docs): add format options to number field * chore(docs): revise number field content * chore(number-field): add type to useDOMRef * fix(number-field): clear button * fix(theme): clear button styles * refactor(theme): stepper button styles * chore(number-field): accept stepperButton class * fix(theme): helper wrapper padding * feat(deps): add `@react-aria/i18n` * fix(number-field): use locale from `@react-aria/i18n` * fix(deps): dependency order * fix(docs): incorrect command * chore(docs): remove type=number * chore(theme): add padding to stepper wrapper * fix(number-field): avoid resetting value * fix(number-field): storybook * chore(docs): remove custom impl * chore(docs): update docs code & content * chore(number-field): migrate to heroui * chore(number-field): migrate to heroui * chore(number-field): migrate to heroui * chore: rename to number input * fix(number-input): incorrect import * chore(docs): rename to number input * chore: change to number input * refactor(number-input): change label to amount * fix(docs): use heroui commands * chore(changeset): update package name * refactor(number-input): remove steps * refactor: remove helper text * feat(number-input): label placement * refactor(number-input): rename stepper * fix(theme): isClearable * feat(docs): add label placements * refactor(docs): update number-input content * fix(docs): incorrect file * feat(docs): add lablePlacement * refactor(docs): remove labelPlacement & startContent * refactor(docs): remove helperText * refactor(docs): remove helperText * refactor(docs): revise description * feat(number-input): add data-slot for stepper-wrapper * fix(number-input): test cases * fix(docs): unexpected change * refactor(number-input): update outdated info * fix(docs): coderabbitai comments * refactor: remove validationState * fix(docs): typo * chore(deps): remove unnecessary dep * chore(deps): bump RA versions * chore(number-input): apply latest labelPlacement change * refactor(number-input): update author * refactor(number-input): revise stepper wrapper alignment * refactor(number-input): stepper button styles * chore(number-input): add disableRipple * fix(theme): increase stepper button click area * fix(number-input): sync latest validationBehavior changes * fix(number-input): pass validationBehavior to useAriaNumberInput * chore(docs): add import react * chore(number-input): remove HorizontalStepper story * chore(number-input): enable ripple * fix(number-input): remove number type * refactor(theme): follow input clear button styles * feat(theme): add color for stepperButton * fix(theme): revise stepperButton size for outside & outside-left cases * fix(number-input): typo * chore(docs): update description for wheel * chore(theme): change opacity when pressed * chore(number-input): add disableRipple * Update .changeset/witty-flies-reflect.md * fix(theme): add hover opacity effect --------- Co-authored-by: Junior Garcia <[email protected]> * chore(docs): revised tags in doc routes for 2.7.0 (#4777) * chore(docs): remove last version update tags * chore(docs): add updated tag for 2.7.0 * chore(docs): updated table * chore(docs): update search meta * chore(docs): update github info * Merge branch 'canary' into docs/eng-2003 * chore(docs): update routes.json * chore(docs): update meta info * chore: improve theme builder * v2.7.0 * chore: v2.7.0 combined changeset * fix: changeset * fix: peer deps * feat: toast api improved * chore: toast styles improved * fix: toast styles * chore: toast width style changed * fix: changeset release * fix: changeset peerdeps * chore: toast styles improved * refactor(pagination): rtl (#4843) * refactor(pagination): rtl * chore(changeset): add changeset * feat: new spinner variant * fix(docs): popover shouldBlockScroll default value (#4851) * fix(select): select scroll content will close immediately when popover on click (#4849) * chore(select): update select deps * fix(select): select scroll content will close immediately when popover on click * chore(select): add .changeset file * chore(changeset): add issue number --------- Co-authored-by: աӄա <[email protected]> * feat(calendar): add firstDayOfWeek (#4852) * feat(calendar): add firstDayOfWeek * feat(docs): add firstDayOfWeek in Calendar docs * feat(calendar): add firstDayOfWeek to range calendar * feat(docs): add firstDayOfWeek to API table * feat: add firstDayOfWeek to date picker & date range picker * feat(docs): add firstDayOfWeek * feat(changeset): add changeset * feat: add firstDayOfWeek option in storybook * feat(docs): export firstDayOfWeek * chore(docs): update title * chore: spinner variants updated * feat: v2.7.0 blog * ci(changesets): version packages (#4601) Co-authored-by: Junior Garcia <[email protected]> * chore: manual release --------- Co-authored-by: աӄա <[email protected]> Co-authored-by: millmason <[email protected]> Co-authored-by: winches <[email protected]> Co-authored-by: Maharshi Alpesh <[email protected]> Co-authored-by: Peterl561 <[email protected]> Co-authored-by: Paul Ebose <[email protected]> Co-authored-by: Zarin <[email protected]> Co-authored-by: Shrinidhi Upadhyaya <[email protected]> Co-authored-by: Avan <[email protected]> Co-authored-by: Vincentius Roger Kuswara <[email protected]> Co-authored-by: Ryo Matsukawa <[email protected]> Co-authored-by: Praharsh Bhatt <[email protected]> Co-authored-by: Adrian Szarapow <[email protected]> Co-authored-by: Hova25 <[email protected]> Co-authored-by: Hovannes Markarian <[email protected]> Co-authored-by: Tsuki <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Closes eng-1742
📝 Description
validationBehavior="aria"
as default behaviorvalidationBehavior="native"
to be consistent with RACvalidationBehavior="native"
from docs⛳️ Current behavior (updates)
validationBehavior="aria"
as default behavior🚀 New behavior
validationBehavior="native"
as default behavior💣 Is this a breaking change (Yes/No):
Yes
validationBehavior="aria"
will need to update their usagevalidationBehavior="native"
📝 Additional Information
Summary by CodeRabbit
Release Notes
New Features
Changes
validationBehavior
from most form and input components.Documentation
This release focuses on enhancing the form validation experience across NextUI components, ensuring consistency and simplicity.