Skip to content
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: switch default validationBehavior to aria and allow switching via props #2987

Merged
merged 15 commits into from
May 22, 2024

Conversation

ryo-manba
Copy link
Member

@ryo-manba ryo-manba commented May 12, 2024

Closes #2844

📝 Description

  • Switch validationBehavior from native to aria by default.
  • Made it possible to switch validationBehavior from props.

⛳️ Current behavior (updates)

validationBehavior cannot be switched from native.

🚀 New behavior

The default validationBehavior is now aria, and it can be switched to native be props.

💣 Is this a breaking change (Yes/No):

Yes.

📝 Additional Information

Summary by CodeRabbit

  • New Features

    • Introduced validationBehavior property to various components, allowing users to select between native and aria validation behaviors.
  • Bug Fixes

    • Updated validate function signatures in several components for improved validation accuracy and consistency.
  • Documentation

    • Added detailed documentation for the new validationBehavior property across multiple components.
  • Tests

    • Enhanced test cases to cover new validation behaviors (native and aria) for multiple components.
  • Chores

    • Refactored internal validation logic to support the new validationBehavior property.

Copy link

vercel bot commented May 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 3:04pm
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 3:04pm

Copy link

changeset-bot bot commented May 12, 2024

🦋 Changeset detected

Latest commit: c81d60e

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

This PR includes changesets to release 25 packages
Name Type
@nextui-org/autocomplete Minor
@nextui-org/checkbox Minor
@nextui-org/date-input Minor
@nextui-org/date-picker Minor
@nextui-org/input Minor
@nextui-org/radio Minor
@nextui-org/select Minor
@nextui-org/system Minor
@nextui-org/use-aria-multiselect Minor
@nextui-org/react Patch
@nextui-org/modal Patch
@nextui-org/table Patch
@nextui-org/accordion Patch
@nextui-org/navbar Patch
@nextui-org/popover Patch
@nextui-org/tabs Patch
@nextui-org/calendar Patch
@nextui-org/dropdown Patch
@nextui-org/listbox Patch
@nextui-org/menu Patch
@nextui-org/slider Patch
@nextui-org/snippet Patch
@nextui-org/tooltip Patch
@nextui-org/aria-utils Patch
@nextui-org/framer-utils 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

Copy link
Contributor

coderabbitai bot commented May 12, 2024

Walkthrough

The recent updates to Next UI components prioritize enhancing form validation by defaulting to ARIA validation behavior, with the option to switch to native validation using props. These changes aim to enhance accessibility and user experience across various components like Autocomplete, Calendar, Checkbox Group, Date Input, and more, without impacting the exported or public entities.

Changes

Files/Groups Change Summary
.changeset/smooth-laws-tap.md Introduced changes to validation behavior in Next UI components, defaulting to ARIA validation.
apps/docs/content/docs/components/autocomplete.mdx, calendar.mdx, checkbox-group.mdx, date-input.mdx, date-picker.mdx, date-range-picker.mdx, input.mdx, radio-group.mdx, textarea.mdx, time-input.mdx Added validationBehavior prop and updated validate function signatures.
packages/components/autocomplete/__tests__/autocomplete.test.tsx, checkbox/__tests__/checkbox-group.test.tsx, checkbox/__tests__/checkbox.test.tsx, date-input/__tests__/date-input.test.tsx, input/__tests__/input.test.tsx Added tests for validationBehavior prop and updated test cases for validation behaviors.
packages/components/autocomplete/src/use-autocomplete.ts, checkbox/src/use-checkbox-group.ts, checkbox/src/use-checkbox.ts, date-input/src/date-input-group.tsx, date-input/src/use-date-input.ts, date-input/src/use-time-input.ts, date-picker/src/date-range-picker-field.tsx, date-picker/src/use-date-picker-base.ts, date-picker/src/use-date-picker.ts, date-picker/src/use-date-range-picker.ts, input/src/use-input.ts Updated hooks and utility functions to support validationBehavior prop with default value set to ARIA.
packages/components/autocomplete/stories/autocomplete.stories.tsx, checkbox/stories/checkbox-group.stories.tsx, date-input/stories/date-input.stories.tsx, date-input/stories/time-input.stories.tsx, date-picker/stories/date-picker.stories.tsx, date-picker/stories/date-range-picker.stories.tsx Added validationBehavior property in story files and updated story examples to demonstrate new validation behaviors.

Assessment against linked issues

Objective (Issue #2844) Addressed Explanation
Input validation behavior should support ARIA
Input validation behavior should support native
Form resubmission should work when isValid is false The changes focus on validation behavior but do not explicitly address form resubmission issues.
Update documentation to reflect new props

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ryo-manba ryo-manba changed the title WIP: add support validationBehavior aria feat: switch default validationBehavior to aria and allow switching via props May 18, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Out of diff range and nitpick comments (2)
packages/components/checkbox/src/use-checkbox-group.ts (1)

68-68: Ensure validationBehavior is properly documented in the ContextType interface.

Consider adding a comment to explain the purpose and usage of validationBehavior within the ContextType interface for better code maintainability.

packages/components/date-input/src/use-time-input.ts (1)

96-96: The defaulting of validationBehavior to 'aria' aligns with the PR's goal to make 'aria' the default validation method. This change should be clearly documented in the component's API documentation.

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8988981 and 198a3a4.
Files selected for processing (43)
  • .changeset/smooth-laws-tap.md (1 hunks)
  • apps/docs/content/docs/components/autocomplete.mdx (1 hunks)
  • apps/docs/content/docs/components/calendar.mdx (1 hunks)
  • apps/docs/content/docs/components/checkbox-group.mdx (1 hunks)
  • apps/docs/content/docs/components/date-input.mdx (1 hunks)
  • apps/docs/content/docs/components/date-picker.mdx (1 hunks)
  • apps/docs/content/docs/components/date-range-picker.mdx (2 hunks)
  • apps/docs/content/docs/components/input.mdx (1 hunks)
  • apps/docs/content/docs/components/radio-group.mdx (1 hunks)
  • apps/docs/content/docs/components/textarea.mdx (1 hunks)
  • apps/docs/content/docs/components/time-input.mdx (1 hunks)
  • packages/components/autocomplete/tests/autocomplete.test.tsx (4 hunks)
  • packages/components/autocomplete/src/use-autocomplete.ts (5 hunks)
  • packages/components/autocomplete/stories/autocomplete.stories.tsx (2 hunks)
  • packages/components/checkbox/tests/checkbox-group.test.tsx (2 hunks)
  • packages/components/checkbox/tests/checkbox.test.tsx (2 hunks)
  • packages/components/checkbox/src/use-checkbox-group.ts (8 hunks)
  • packages/components/checkbox/src/use-checkbox.ts (6 hunks)
  • packages/components/checkbox/stories/checkbox-group.stories.tsx (1 hunks)
  • packages/components/checkbox/stories/checkbox.stories.tsx (2 hunks)
  • packages/components/date-input/tests/date-input.test.tsx (1 hunks)
  • packages/components/date-input/src/date-input-group.tsx (1 hunks)
  • packages/components/date-input/src/use-date-input.ts (1 hunks)
  • packages/components/date-input/src/use-time-input.ts (4 hunks)
  • packages/components/date-input/stories/date-input.stories.tsx (5 hunks)
  • packages/components/date-input/stories/time-input.stories.tsx (5 hunks)
  • packages/components/date-picker/src/date-range-picker-field.tsx (2 hunks)
  • packages/components/date-picker/src/use-date-picker-base.ts (5 hunks)
  • packages/components/date-picker/src/use-date-picker.ts (4 hunks)
  • packages/components/date-picker/src/use-date-range-picker.ts (5 hunks)
  • packages/components/date-picker/stories/date-picker.stories.tsx (5 hunks)
  • packages/components/date-picker/stories/date-range-picker.stories.tsx (5 hunks)
  • packages/components/input/tests/input.test.tsx (1 hunks)
  • packages/components/input/src/use-input.ts (4 hunks)
  • packages/components/input/stories/input.stories.tsx (1 hunks)
  • packages/components/input/stories/textarea.stories.tsx (1 hunks)
  • packages/components/radio/tests/radio.test.tsx (3 hunks)
  • packages/components/radio/src/use-radio-group.ts (6 hunks)
  • packages/components/radio/stories/radio.stories.tsx (1 hunks)
  • packages/components/select/src/use-select.ts (6 hunks)
  • packages/core/system/src/provider-context.ts (2 hunks)
  • packages/core/system/src/provider.tsx (2 hunks)
  • packages/hooks/use-aria-multiselect/src/use-multiselect-state.ts (1 hunks)
Files skipped from review due to trivial changes (4)
  • .changeset/smooth-laws-tap.md
  • packages/components/date-input/tests/date-input.test.tsx
  • packages/components/date-input/src/use-date-input.ts
  • packages/hooks/use-aria-multiselect/src/use-multiselect-state.ts
Additional comments not posted (56)
packages/core/system/src/provider.tsx (1)

43-43: Ensure the new validationBehavior property is well-documented and tested.

Also applies to: 68-68, 76-76

Verification successful

Ensure the new validationBehavior property is well-documented and tested.

The search results indicate that the validationBehavior property is indeed used and tested across various components and test files. Here are some key locations:

  • Tests:

    • packages/components/autocomplete/__tests__/autocomplete.test.tsx
    • packages/components/checkbox/__tests__/checkbox-group.test.tsx
    • packages/components/checkbox/__tests__/checkbox.test.tsx
    • packages/components/input/__tests__/input.test.tsx
    • packages/components/radio/__tests__/radio.test.tsx
  • Documentation and Stories:

    • packages/components/autocomplete/stories/autocomplete.stories.tsx
    • packages/components/checkbox/stories/checkbox-group.stories.tsx
    • packages/components/checkbox/stories/checkbox.stories.tsx
    • packages/components/date-input/stories/date-input.stories.tsx
    • packages/components/date-input/stories/time-input.stories.tsx
    • packages/components/date-picker/stories/date-picker.stories.tsx
    • packages/components/date-picker/stories/date-range-picker.stories.tsx
    • packages/components/input/stories/input.stories.tsx
    • packages/components/input/stories/textarea.stories.tsx
    • packages/components/radio/stories/radio.stories.tsx

These findings confirm that the validationBehavior property is integrated into the codebase with appropriate tests and documentation.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify if the `validationBehavior` property is documented and tested.

# Test: Search for documentation and tests related to `validationBehavior`.
rg --type markdown --type typescript $'validationBehavior'

Length of output: 92



Script:

#!/bin/bash
# Description: Verify if the `validationBehavior` property is documented and tested.

# Test: Search for documentation and tests related to `validationBehavior`.
rg --type md --type ts --type tsx 'validationBehavior'

Length of output: 82



Script:

#!/bin/bash
# Description: Verify if the `validationBehavior` property is documented and tested.

# Test: Search for documentation and tests related to `validationBehavior`.
rg --type md --type ts --type tsx 'validationBehavior'

Length of output: 82



Script:

#!/bin/bash
# Description: Verify if the `validationBehavior` property is documented and tested.

# Find all relevant files and search for `validationBehavior`.
fd -e md -e ts -e tsx | xargs rg 'validationBehavior'

Length of output: 9358

packages/components/date-picker/src/date-range-picker-field.tsx (1)

76-76: Ensure the ref is properly managed and does not lead to memory leaks or unexpected behavior in React components.

Verification successful

The search results indicate that inputRef is used in the date-range-picker-field.tsx file as follows:

  • const inputRef = useRef(null);
  • } = useAriaDateField({...otherProps, inputRef}, state, domRef);
  • <input {...inputProps} ref={inputRef} />

These usages suggest that inputRef is initialized using useRef, passed to useAriaDateField, and then assigned to the ref attribute of an input element. This pattern is consistent with React best practices for managing refs.

Conclusion

The ref in the DateRangePickerField component is properly managed and does not lead to memory leaks or unexpected behavior.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify proper management of `ref` in `DateRangePickerField`.

# Test: Search for the usage of `inputRef` across the project to ensure it's managed correctly.
rg --type typescript $'inputRef'

Length of output: 66



Script:

#!/bin/bash
# Description: Verify proper management of `ref` in `DateRangePickerField`.

# Test: Search for the usage of `inputRef` across the project to ensure it's managed correctly.
rg --type tsx 'inputRef'

Length of output: 52



Script:

#!/bin/bash
# Description: Verify proper management of `ref` in `DateRangePickerField`.

# Test: Search for the usage of `inputRef` across the project to ensure it's managed correctly.
rg --type-add 'ts:*.ts' --type-add 'tsx:*.tsx' --type ts,tsx 'inputRef'

Length of output: 102



Script:

#!/bin/bash
# Description: Verify proper management of `ref` in `DateRangePickerField`.

# Test: Search for the usage of `inputRef` in TypeScript files.
rg --type-add 'ts:*.ts' --type ts 'inputRef'

Length of output: 4971


Script:

#!/bin/bash
# Description: Verify proper management of `ref` in `DateRangePickerField`.

# Test: Search for the usage of `inputRef` in TSX files.
rg --type-add 'tsx:*.tsx' --type tsx 'inputRef'

Length of output: 688

packages/core/system/src/provider-context.ts (1)

20-28: Ensure the new validationBehavior property is consistent with the existing properties in ProviderContextProps. Consider adding more detailed documentation or examples if necessary.

Verification successful

Verification of validationBehavior Property

The validationBehavior property is consistently defined and used across multiple components and hooks in the codebase. It is integrated into various parts of the system, ensuring that it aligns with the existing properties in ProviderContextProps.

  • Files with validationBehavior usage:
    • packages/hooks/use-aria-multiselect/src/use-multiselect-state.ts
    • packages/components/select/src/use-select.ts
    • packages/components/radio/src/use-radio-group.ts
    • packages/components/input/src/use-input.ts
    • packages/components/date-picker/src/use-date-range-picker.ts
    • packages/components/checkbox/src/use-checkbox.ts
    • packages/components/checkbox/src/use-checkbox-group.ts
    • packages/components/date-input/src/use-time-input.ts
    • packages/components/date-input/src/use-date-input.ts
    • packages/components/autocomplete/src/use-autocomplete.ts
    • packages/components/date-picker/src/use-date-picker.ts
    • apps/docs/content/components/date-range-picker/unavailable-dates.ts

The property is well-documented and its usage is consistent with the rest of the context properties.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify consistency of `validationBehavior` with other properties.

# Test: Search for usage and documentation of `validationBehavior` in context properties.
rg --type typescript --type markdown $'validationBehavior'

Length of output: 92



Script:

#!/bin/bash
# Description: Verify consistency of `validationBehavior` with other properties.

# Test: Search for usage and documentation of `validationBehavior` in context properties.
rg --glob '*.ts' --glob '*.md' 'validationBehavior'

Length of output: 4699

packages/components/date-input/src/date-input-group.tsx (1)

78-78: Ensure the conditional rendering based on isInvalid is correctly implemented and does not lead to unexpected UI behavior.

Verification successful

Ensure the conditional rendering based on isInvalid is correctly implemented and does not lead to unexpected UI behavior.

The search results indicate that isInvalid is used in various components across the project, including the date-input-group.tsx file. The specific line in question:

{isInvalid && errorMessage ? (

This line conditionally renders an error message if isInvalid is true and errorMessage is provided. This implementation appears to follow React best practices for conditional rendering.

Locations to Review:

  • packages/components/date-input/src/date-input-group.tsx:
    • Line 78: {isInvalid && errorMessage ? (

Recommendation:

  • Verify that isInvalid and errorMessage are correctly passed as props to the DateInputGroup component.
  • Ensure that the logic for setting isInvalid and errorMessage is correctly implemented in the parent component or context.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the correct implementation of conditional rendering based on `isInvalid`.

# Test: Search for the usage of `isInvalid` in conditional rendering across the project.
rg --type typescript $'isInvalid'

Length of output: 67



Script:

#!/bin/bash
# Description: Verify the correct implementation of conditional rendering based on `isInvalid`.

# Test: Search for the usage of `isInvalid` in conditional rendering across the project.
rg --type ts 'isInvalid'
rg --type tsx 'isInvalid'

Length of output: 17197



Script:

#!/bin/bash
# Description: Verify the correct implementation of conditional rendering based on `isInvalid`.

# Test: Search for the usage of `isInvalid` in `.tsx` files.
rg --type-add 'tsx:*.tsx' --type tsx 'isInvalid'

Length of output: 5164

packages/components/checkbox/stories/checkbox.stories.tsx (1)

42-47: Ensure the new validationBehavior property in Storybook stories is correctly implemented and provides sufficient options for testing different behaviors.

packages/components/checkbox/stories/checkbox-group.stories.tsx (1)

42-47: Ensure the new validationBehavior property in CheckboxGroup stories is correctly implemented and provides sufficient options for testing different behaviors.

packages/components/date-picker/src/use-date-picker.ts (1)

60-62: Ensure the new validationBehavior property in the useDatePicker hook is correctly implemented and follows best practices for default values and conditional logic.

Also applies to: 87-87

packages/components/radio/src/use-radio-group.ts (1)

77-77: Ensure the new validationBehavior property in the useRadioGroup hook is correctly implemented and follows best practices for default values and conditional logic.

Also applies to: 108-108

Verification successful

Verification of validationBehavior Implementation in useRadioGroup Hook

The search results indicate that the validationBehavior property is used consistently across multiple components and hooks, including the useRadioGroup hook. The implementation follows the pattern of setting a default value of "aria" if globalContext?.validationBehavior is not defined.

Key Locations:

  • packages/components/radio/src/use-radio-group.ts
    • Line 77: validationBehavior = globalContext?.validationBehavior ?? "aria",
    • Line 108: validationBehavior

Conclusion:

The validationBehavior property is correctly implemented in the useRadioGroup hook, adhering to best practices for default values and conditional logic.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the correct implementation of `validationBehavior` in the `useRadioGroup` hook.

# Test: Search for the usage of `validationBehavior` in hooks across the project.
rg --type typescript $'validationBehavior'

Length of output: 76



Script:

#!/bin/bash
# Description: Verify the correct implementation of `validationBehavior` in the `useRadioGroup` hook.

# Test: Search for the usage of `validationBehavior` in hooks across the project.
rg --type ts 'validationBehavior'

Length of output: 9338

packages/components/checkbox/src/use-checkbox-group.ts (3)

91-91: Good use of context fallback for validationBehavior.

This ensures that the validationBehavior defaults to "aria" unless specified otherwise, aligning with the new default behavior described in the PR.


117-117: Correct inclusion of validationBehavior in checkboxGroupProps.

This ensures that the validationBehavior is passed down to the checkbox group props, allowing it to be used effectively in the component.


157-157: Proper propagation of validationBehavior in the context.

This ensures that the validationBehavior is available in the context for any child components or hooks that might depend on it.

packages/components/date-input/stories/time-input.stories.tsx (2)

54-59: Proper addition of validationBehavior control in story configuration.

This allows users to interactively switch between aria and native validation behaviors in the Storybook UI, enhancing testing and demonstration capabilities.


70-83: Ensure form submission handling is robust.

This script checks if the form submission handling correctly captures the time value from the TimeInput component. It's crucial to ensure that the component integrates well with form handling, especially with the new validation behaviors.

packages/components/input/stories/textarea.stories.tsx (1)

55-60: Proper addition of validationBehavior control in story configuration.

This allows users to interactively switch between aria and native validation behaviors in the Storybook UI, enhancing testing and demonstration capabilities.

packages/components/input/__tests__/input.test.tsx (2)

40-45: Comprehensive test for isRequired with native validationBehavior.

This test correctly checks for the presence of the required attribute and the absence of the aria-required attribute when validationBehavior is set to native, ensuring compliance with expected HTML5 validation behavior.


47-50: Comprehensive test for isRequired with aria validationBehavior.

This test correctly checks for the absence of the required attribute and the presence of the aria-required attribute when validationBehavior is set to aria, ensuring compliance with expected ARIA validation behavior.

packages/components/checkbox/__tests__/checkbox.test.tsx (2)

93-102: Comprehensive test for isRequired with native validationBehavior.

This test correctly checks for the presence of the required attribute and the absence of the aria-required attribute when validationBehavior is set to native, ensuring compliance with expected HTML5 validation behavior.


104-112: Comprehensive test for isRequired with aria validationBehavior.

This test correctly checks for the absence of the required attribute and the presence of the aria-required attribute when validationBehavior is set to aria, ensuring compliance with expected ARIA validation behavior.

packages/components/date-picker/src/use-date-picker-base.ts (2)

216-216: Correct inclusion of validationBehavior in dateInputProps.

This ensures that the validationBehavior is passed down to the date input props, allowing it to be used effectively in the component.


228-228: Correct inclusion of validationBehavior in timeInputProps.

This ensures that the validationBehavior is passed down to the time input props, allowing it to be used effectively in the component.

packages/components/radio/__tests__/radio.test.tsx (2)

149-149: Ensure the validationBehavior prop is tested for both 'native' and 'aria' settings.

Verification successful

Validation behavior prop is tested for both 'native' and 'aria'

The validationBehavior prop is indeed tested for both 'native' and 'aria' settings in the test file.

  • validationBehavior="native" is tested in:

    • <RadioGroup isRequired label="Options" validationBehavior="native">
    • describe("validationBehavior=native", () => {
    • <RadioGroup isRequired aria-label="favorite pet" validationBehavior="native">
  • validationBehavior="aria" is tested in:

    • describe("validationBehavior=aria", () => {
    • validationBehavior="aria"
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that both 'native' and 'aria' validation behaviors are tested.

# Test: Search for the usage of `validationBehavior` in tests. Expect: Occurrences of both 'native' and 'aria'.
rg --type typescript $'validationBehavior' packages/components/radio/__tests__/radio.test.tsx

Length of output: 127



Script:

#!/bin/bash
# Description: Verify that both 'native' and 'aria' validation behaviors are tested.

# Test: Search for the usage of `validationBehavior` in tests. Expect: Occurrences of both 'native' and 'aria'.
rg --type ts 'validationBehavior' packages/components/radio/__tests__/radio.test.tsx

Length of output: 376


Line range hint 207-282: The new tests for validationBehavior are comprehensive and cover both 'native' and 'aria' behaviors effectively.

packages/components/date-input/src/use-time-input.ts (3)

73-73: The addition of validationBehavior to the hook's props is consistent with the PR's objectives to allow dynamic switching of validation methods.


117-117: The integration of validationBehavior into the state management of the time input is well-implemented, ensuring that the component's behavior can be dynamically adjusted based on the prop.


131-131: The use of validationBehavior in the useAriaTimeField hook call is a good practice, ensuring that the behavior is consistent throughout the component.

packages/components/date-input/stories/date-input.stories.tsx (3)

58-63: Addition of validationBehavior prop to storybook controls.

This addition aligns with the PR's objective to allow switching validationBehavior via props, enhancing flexibility in validation methods.


76-89: Addition of a form template with a submit button.

This template is useful for demonstrating the DateInput component within a form context, particularly useful for testing form submissions.


176-176: Addition of new story configurations for Required, UnavailableDates, and WithValidation.

These additions enhance the storybook by demonstrating how the DateInput behaves under different validation scenarios, which is crucial for understanding component behavior in real-world applications.

Also applies to: 363-375, 378-392

packages/components/radio/stories/radio.stories.tsx (1)

40-45: Addition of validationBehavior prop to storybook controls.

This addition aligns with the PR's objective to allow switching validationBehavior via props, enhancing flexibility in validation methods for the RadioGroup component.

apps/docs/content/docs/components/checkbox-group.mdx (1)

96-118: Update to the Checkbox Group Props table in the documentation.

The updates include new properties such as validationBehavior, isInvalid, and modifications to existing properties to align with the latest component API changes. This ensures the documentation is up-to-date with the component's capabilities.

packages/components/checkbox/src/use-checkbox.ts (1)

71-71: Addition of validationBehavior handling in the useCheckbox hook.

The addition of validationBehavior handling allows the checkbox to adapt its behavior based on the validation method specified, which is crucial for meeting the new requirements of allowing validationBehavior switching via props.

Also applies to: 96-99, 149-172, 188-190

packages/components/checkbox/__tests__/checkbox-group.test.tsx (1)

Line range hint 142-287: Addition of tests for validationBehavior handling in CheckboxGroup.

These tests are crucial for ensuring that the CheckboxGroup component behaves as expected under different validation scenarios, particularly with the new validationBehavior prop. The tests cover both native and aria validation behaviors, aligning with the PR's objectives.

packages/components/date-picker/src/use-date-range-picker.ts (2)

61-61: Ensure proper handling of isInvalidProp to maintain consistency across different validation states.

Verification successful

Consistent Usage of isInvalidProp Verified

The usage of isInvalidProp is consistent across various components, including use-date-range-picker.ts, use-radio-group.ts, use-time-input.ts, use-date-input.ts, and use-checkbox-group.ts.

  • packages/components/radio/src/use-radio-group.ts
  • packages/components/date-picker/src/use-date-range-picker.ts
  • packages/components/date-input/src/use-time-input.ts
  • packages/components/date-input/src/use-date-input.ts
  • packages/components/checkbox/src/use-checkbox-group.ts

No inconsistencies were found in the handling of isInvalidProp.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that `isInvalidProp` is consistently used across all components.

# Test: Search for `isInvalidProp` usage in other components. Expect: Consistent usage pattern.
rg --type typescript $'isInvalidProp'

Length of output: 71



Script:

#!/bin/bash
# Description: Verify that `isInvalidProp` is consistently used across all components.

# Test: Search for `isInvalidProp` usage in other components. Expect: Consistent usage pattern.
rg --type ts 'isInvalidProp'

Length of output: 1428


117-120: Clarify the logic for determining isInvalid to ensure it aligns with the intended validation behavior.

Verification successful

Clarify the logic for determining isInvalid

The logic for determining isInvalid in the use-date-range-picker.ts file is consistent with other components in the codebase. The pattern of combining multiple validation states to determine the final isInvalid state is a common approach.

Locations in the codebase with similar logic:

  • packages/components/select/src/use-select.ts
  • packages/components/radio/src/use-radio-group.ts
  • packages/components/input/src/use-input.ts
  • packages/components/date-input/src/use-date-input.ts

These instances show a consistent pattern of combining different validation states to determine the isInvalid state, ensuring that the logic aligns with the intended validation behavior.

Example from use-select.ts:

const isInvalid = originalProps.isInvalid || validationState === "invalid" || isAriaInvalid;

Example from use-radio-group.ts:

const isInvalid = otherPropsWithOrientation.isInvalid || isAriaInvalid || groupState.isInvalid;

Example from use-input.ts:

const isInvalid = validationState === "invalid" || originalProps.isInvalid || isAriaInvalid;

Example from use-date-input.ts:

const isInvalid = isInvalidProp || ariaIsInvalid;

These examples confirm that the logic in use-date-range-picker.ts is consistent with the rest of the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the logic for `isInvalid` across similar components.

# Test: Search for similar logic in other components. Expect: Consistent and clear logic.
rg --type typescript $'isInvalid'

Length of output: 67



Script:

#!/bin/bash
# Description: Verify the logic for `isInvalid` across similar components.

# Test: Search for similar logic in other components. Expect: Consistent and clear logic.
rg --type ts $'isInvalid'

Length of output: 17143

packages/components/date-picker/stories/date-picker.stories.tsx (3)

62-67: Ensure that the validationBehavior control is properly documented and tested to reflect the new behavior.


355-355: Validate the form submission logic in FormTemplate to ensure it handles the isRequired prop correctly.


525-538: Review the custom validation logic to ensure it aligns with the expected behavior for date validation.

Verification successful

Review the custom validation logic to ensure it aligns with the expected behavior for date validation

The search results indicate that custom validation logic is used in various components across the codebase. Here are some relevant findings:

  • Date Picker:

    • packages/components/date-picker/stories/date-picker.stories.tsx:
      validate: (value) => {
        if (!value) {
          return "Please enter a date";
        }
        if (value.year < 2024) {
          return "Please select a date in the year 2024 or later";
        }
      }
  • Date Range Picker:

    • packages/components/date-picker/stories/date-range-picker.stories.tsx:
      validate: (value) => {
        if (!value) {
          return "Please enter a date";
        }
        if (value.year < 2024) {
          return "Please select a date in the year 2024 or later";
        }
      }
  • Checkbox Group:

    • packages/components/checkbox/stories/checkbox-group.stories.tsx:
      validate: (value: string[]) => {
        if (value.length < 3) {
          return "You must accept all terms";
        }
      }
  • Input:

    • packages/components/input/stories/input.stories.tsx:
      const validateEmail = (value) => value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$/i);
      validate: (value) => {
        return validateEmail(value) ? "valid" : "invalid";
      }

The custom validation logic for the Date Picker component aligns with the expected behavior of ensuring the date is not empty and is in the year 2024 or later. This pattern is consistent with other components that have specific validation requirements.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify custom validation logic in other components.

# Test: Search for similar custom validation logic. Expect: Consistent validation behavior.
rg --type typescript $'validate'

Length of output: 66



Script:

#!/bin/bash
# Description: Verify custom validation logic in other components.

# Test: Search for similar custom validation logic. Expect: Consistent validation behavior.
rg --type ts 'validate'

Length of output: 3706

packages/components/autocomplete/__tests__/autocomplete.test.tsx (2)

51-62: Ensure that the AutocompleteExample component handles all necessary props and that it is used consistently across tests.

Verification successful

The AutocompleteExample component is defined and used multiple times in autocomplete.test.tsx. Here are the specific lines:

  • Definition: const AutocompleteExample = (props: Partial<AutocompleteProps> = {}) => (
  • Usage: const wrapper = render(<AutocompleteExample />);
  • Usage: <AutocompleteExample isRequired validationBehavior="native" />
  • Usage: <AutocompleteExample

These usages indicate that AutocompleteExample is being used consistently across the tests. The component is designed to accept partial AutocompleteProps, ensuring flexibility in the tests.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of `AutocompleteExample` across all tests.

# Test: Search for `AutocompleteExample` usage in tests. Expect: Consistent and correct usage.
rg --type typescript $'AutocompleteExample'

Length of output: 77



Script:

#!/bin/bash
# Description: Verify the usage of `AutocompleteExample` across all tests.

# Test: Search for `AutocompleteExample` usage in tests. Expect: Consistent and correct usage.
rg --type ts 'AutocompleteExample'

Length of output: 529


227-304: Review the new validation tests to ensure they cover all scenarios and the logic aligns with the component's requirements.

packages/components/autocomplete/src/use-autocomplete.ts (2)

160-160: Ensure the default validationBehavior aligns with global settings or defaults to "aria".

This approach allows for a consistent validation behavior across components, adhering to the PR's objective of making "aria" the default validation method.


213-213: Verify the propagation of validationBehavior through the useComboBox hook.

apps/docs/content/docs/components/textarea.mdx (1)

161-161: Document the default behavior for validationBehavior as "aria".

This documentation aligns with the PR's objective to make "aria" the default validation method, enhancing accessibility.

packages/components/date-picker/stories/date-range-picker.stories.tsx (2)

64-69: Add validationBehavior to story controls to allow interactive testing of validation methods.

This addition is crucial for testing the component's behavior with different validation settings directly in the storybook, aligning with the PR's objectives.


607-622: Ensure the custom validation logic in the story reflects the new validation behavior settings.

The custom validation logic provided in the story checks for valid date ranges and ensures the dates are within the year 2024 or later, which is a good practice for demonstrating the component's capabilities in handling custom validation logic.

packages/components/input/src/use-input.ts (1)

114-114: The default setting for validationBehavior aligns with the PR's objective to make "aria" the default. This implementation also gracefully handles the absence of a global setting by providing a sensible default.

apps/docs/content/docs/components/radio-group.mdx (1)

163-163: The documentation for validationBehavior correctly reflects the new functionality allowing users to choose between "native" and "aria" validation methods, with "aria" as the default.

apps/docs/content/docs/components/input.mdx (1)

211-211: The documentation for validationBehavior correctly reflects the new functionality allowing users to choose between "native" and "aria" validation methods, with "aria" as the default.

packages/components/input/stories/input.stories.tsx (1)

59-64: Added validationBehavior property to storybook controls as expected.

Verification successful

Verification of validationBehavior Property Integration

The validationBehavior property is correctly integrated in both input.stories.tsx and textarea.stories.tsx files. The property is configured with a select control and appropriate options, ensuring it aligns with the storybook's configuration for other properties.

  • input.stories.tsx:

      isDisabled: {
        control: {
          type: "boolean",
        },
      },
      validationBehavior: {
        control: {
          type: "select",
        },
        options: ["aria", "native"],
      },
  • textarea.stories.tsx:

      isDisabled: {
        control: {
          type: "boolean",
        },
      },
      validationBehavior: {
        control: {
          type: "select",
        },
        options: ["aria", "native"],
      },

Both files show consistent and correct usage of the validationBehavior property.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the `validationBehavior` property is correctly integrated with other properties in the storybook.

# Test: Search for the usage of `validationBehavior` in storybook files. Expect: Proper integration with other properties.
rg --type typescript $'validationBehavior' --files-with-matches packages/components/input/stories

Length of output: 131



Script:

#!/bin/bash
# Description: Verify that the `validationBehavior` property is correctly integrated with other properties in the storybook.

# Test: Search for the usage of `validationBehavior` in storybook files. Expect: Proper integration with other properties.
rg --type ts 'validationBehavior' packages/components/input/stories

Length of output: 226



Script:

#!/bin/bash
# Description: Extract the relevant sections where `validationBehavior` is used in the storybook files.

# Extract the relevant section from input.stories.tsx
rg --type ts --context 5 'validationBehavior' packages/components/input/stories/input.stories.tsx

# Extract the relevant section from textarea.stories.tsx
rg --type ts --context 5 'validationBehavior' packages/components/input/stories/textarea.stories.tsx

Length of output: 586

packages/components/select/src/use-select.ts (1)

179-179: Successfully integrated validationBehavior with default set to "aria" in useSelect hook.

Also applies to: 236-236, 629-629

Verification successful

Verification of validationBehavior Integration

The validationBehavior property is correctly integrated within the useSelect hook and related components.

  • use-select.ts:

    • Declared as an optional property with possible values "aria" or "native".
    • Initialized with a default value of "aria" if not provided.
    • Passed as a prop to other components and functions.
  • hidden-select.tsx:

    • Retrieved from the data object.
    • Used in conditional logic (commented out line suggests future or conditional use).
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the `validationBehavior` property is correctly integrated with other properties in the select component.

# Test: Search for the usage of `validationBehavior` in select component files. Expect: Proper integration with other properties.
rg --type typescript $'validationBehavior' --files-with-matches packages/components/select/src

Length of output: 128



Script:

#!/bin/bash
# Description: Verify that the `validationBehavior` property is correctly integrated with other properties in the select component.

# Test: Search for the usage of `validationBehavior` in select component files. Expect: Proper integration with other properties.
rg --type ts 'validationBehavior' packages/components/select/src

Length of output: 833

apps/docs/content/docs/components/time-input.mdx (1)

226-227: The addition of validate and validationBehavior properties enhances the flexibility and configurability of the TimeInput component, aligning with the PR's objectives to switch default validation behavior to aria and allow switching via props.

apps/docs/content/docs/components/date-input.mdx (1)

302-303: The addition of validate and validationBehavior properties enhances the flexibility and configurability of the DateInput component, aligning with the PR's objectives to switch default validation behavior to aria and allow switching via props.

packages/components/autocomplete/stories/autocomplete.stories.tsx (1)

67-72: The addition of the validationBehavior property with options 'aria' and 'native' aligns well with the PR objectives to enhance form validation flexibility.

apps/docs/content/docs/components/date-picker.mdx (1)

304-344: The updated API section comprehensively lists the new validationBehavior property with a default of 'aria', aligning with the PR's goal to enhance validation flexibility. Ensure all descriptions are clear and provide sufficient detail for developers.

apps/docs/content/docs/components/calendar.mdx (1)

231-231: The addition of the validationBehavior property is well-documented and aligns with the PR objectives to allow switching validation methods.

apps/docs/content/docs/components/date-range-picker.mdx (2)

358-358: The addition of the validationBehavior property is well-documented and aligns with the PR objectives to allow switching validation methods.


357-357: The update to the validate function signature is necessary to accommodate the new validation logic introduced with the validationBehavior property.

@@ -428,6 +428,7 @@ properties to customize the popover, listbox and input components.
| disabledKeys | `all` \| `React.Key[]` | The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with. | - |
| errorMessage | `ReactNode` \| `((v: ValidationResult) => ReactNode)` | An error message to display below the field. | - |
| validate | `(value: { inputValue: string, selectedKey: React.Key }) => ValidationError | true | null | undefined` | Validate input values when committing (e.g. on blur), and return error messages for invalid values. | - |
| validationBehavior | `native` \| `aria` | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.| `aria` |
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a brief explanation of the differences between native and aria validation behaviors.

+ | validationBehavior          | `native` \| `aria`                                                                                                                    | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA. A `native` behavior uses browser-based validation, while `aria` relies on accessibility standards to manage validation states.| `aria`                   |

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
| validationBehavior | `native` \| `aria` | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.| `aria` |
| validationBehavior | `native` \| `aria` | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA. A `native` behavior uses browser-based validation, while `aria` relies on accessibility standards to manage validation states.| `aria` |

Comment on lines +73 to +74
const validationBehavior =
originalProps.validationBehavior ?? globalContext?.validationBehavior ?? "aria";
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider caching the default validationBehavior to avoid recalculating it on every render.

- const validationBehavior = originalProps.validationBehavior ?? globalContext?.validationBehavior ?? "aria";
+ const defaultValidationBehavior = useMemo(() => originalProps.validationBehavior ?? globalContext?.validationBehavior ?? "aria", [originalProps.validationBehavior, globalContext?.validationBehavior]);

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
const validationBehavior =
originalProps.validationBehavior ?? globalContext?.validationBehavior ?? "aria";
const defaultValidationBehavior = useMemo(() => originalProps.validationBehavior ?? globalContext?.validationBehavior ?? "aria", [originalProps.validationBehavior, globalContext?.validationBehavior]);

@@ -86,10 +92,11 @@
hasMultipleMonths,
selectorButtonProps,
selectorIconProps,
} = useDatePickerBase(originalProps);
} = useDatePickerBase({...originalProps, validationBehavior});
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

originalProps contains validationBehavior

The search results indicate that originalProps does contain validationBehavior, which could potentially override the validationBehavior set in the previous line.

  • Location in Codebase:
    • packages/components/date-picker/src/use-date-range-picker.ts
    • packages/components/date-picker/src/use-date-picker.ts

Please ensure that the spread of originalProps does not unintentionally override the validationBehavior set in the previous line.

Analysis chain

Ensure that the spread of originalProps does not unintentionally override the validationBehavior set in the previous line.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that `originalProps` does not contain `validationBehavior` that could override the set value.

# Test: Check for `validationBehavior` in `originalProps`. Expect: No `validationBehavior` key.
rg --type typescript $'originalProps.validationBehavior'

Length of output: 90



Script:

#!/bin/bash
# Description: Verify that `originalProps` does not contain `validationBehavior` that could override the set value.

# Test: Check for `validationBehavior` in `originalProps`. Expect: No `validationBehavior` key.
rg --type ts 'originalProps.validationBehavior'

Length of output: 333

groupState?.isReadOnly,
groupState?.isInvalid,
groupState?.isSelected,
validationBehavior,
Copy link
Contributor

Choose a reason for hiding this comment

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

Include validationBehavior in memoization dependencies.

-    [size, color, radius, lineThrough, isDisabled, disableAnimation, groupState.value, groupState.isDisabled, groupState.isReadOnly, groupState.isInvalid, groupState.isSelected],
+    [size, color, radius, lineThrough, isDisabled, disableAnimation, validationBehavior, groupState.value, groupState.isDisabled, groupState.isReadOnly, groupState.isInvalid, groupState.isSelected],

This change ensures that the context is correctly updated whenever validationBehavior changes, maintaining the component's reactivity.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
validationBehavior,
[size, color, radius, lineThrough, isDisabled, disableAnimation, validationBehavior, groupState.value, groupState.isDisabled, groupState.isReadOnly, groupState.isInvalid, groupState.isSelected],

@@ -224,6 +225,7 @@ export function useDatePickerBase<T extends DateValue>(originalProps: UseDatePic
placeholderValue: timePlaceholder,
hourCycle: props.hourCycle,
hideTimeZone: props.hideTimeZone,
validationBehavior,
Copy link
Contributor

Choose a reason for hiding this comment

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

Include validationBehavior in memoization dependencies.

-    [userTimeInputProps, stringFormatter, props.hourCycle, props.hideTimeZone],
+    [userTimeInputProps, stringFormatter, props.hourCycle, props.hideTimeZone, validationBehavior],

This change ensures that the timeInputProps are correctly updated whenever validationBehavior changes, maintaining the component's reactivity.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
validationBehavior,
[userTimeInputProps, stringFormatter, props.hourCycle, props.hideTimeZone, validationBehavior],

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 198a3a4 and c337b95.
Files selected for processing (2)
  • packages/components/select/src/use-select.ts (5 hunks)
  • packages/hooks/use-aria-multiselect/src/use-multiselect-state.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • packages/components/select/src/use-select.ts
  • packages/hooks/use-aria-multiselect/src/use-multiselect-state.ts

@ryo-manba ryo-manba assigned jrgarciadev and unassigned ryo-manba May 18, 2024
@ryo-manba ryo-manba added this to the v2.3.7 milestone May 18, 2024
@@ -76,6 +76,7 @@ export function useMultiSelectState<T extends {}>(props: MultiSelectProps<T>): M

const validationState = useFormValidationState({
...props,
// TODO: Future enhancement to support "aria" validation behavior.
Copy link
Member Author

Choose a reason for hiding this comment

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

Select uses a custom implementation to support multiple selections, so adding support for validationBehavior might take some time.

Copy link
Member

@jrgarciadev jrgarciadev left a comment

Choose a reason for hiding this comment

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

Well done! @ryo-manba

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between c337b95 and c81d60e.
Files selected for processing (1)
  • apps/docs/content/docs/api-references/nextui-provider.mdx (1 hunks)
Additional Context Used
LanguageTool (1)
apps/docs/content/docs/api-references/nextui-provider.mdx (1)

Near line 42: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...avigate` - Description: Provides a client side router to all nested components such as...

Additional comments not posted (1)
apps/docs/content/docs/api-references/nextui-provider.mdx (1)

163-168: The documentation for the validationBehavior prop is clear and aligns with the PR's objectives to switch the default validation method to aria.

@jrgarciadev jrgarciadev merged commit 540aa21 into canary May 22, 2024
8 checks passed
@jrgarciadev jrgarciadev deleted the chore/validation-behavior-external branch May 22, 2024 20:50
jrgarciadev added a commit that referenced this pull request May 27, 2024
* chore(root): reat-aria packages updated (#2889)

* chore(storybook): common colors enabled (#2902)

* fix(range-calendar): hide only dates outside the month (#2906)

* fix(range-calendar): hide only dates outside the month #2890

* fix(range-calendar): corrected spelling mistake in changeset description

* fix(range-calendar): corrected capitalization in changeset description

* chore(changeset): patch @nextui-org/theme

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>

* fix(date-picker): keep date picker style consistent for different variants (#2908)

* fix: add missing TableRowProps export (#2866)

* fix: add missing TableRowProps export

* feat(changeset): add changeset for PR2866

* chore(changeset): revise changeset message

---------

Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>

* fix(input): correct label margin for RTL required inputs (#2781)

* fix(input): correct label margin for RTL required inputs

* fix(theme): add changeset fr theme

* docs(core): add storybook and canary release info (#2914)

* Cn utility refactor (#2915)

* refactor(core): cn utility adjusted and moved to the theme package

* chore(root): changeset

* fix(storybook): stories that used cn

* docs(date-picker): change to jsx instead (#2919)

* fix(switch): support uncontrolled switch in react-hook-form (#2924)

* feat(switch): add @nextui-org/use-safe-layout-effect

* chore(deps): add @nextui-org/use-safe-layout-effect

* fix(switch): react-hook-form uncontrolled switch component

* fix(switch): react-hook-form uncontrolled switch component

* feat(switch): add rect-hook-form in dev dep

* feat(switch): add WithReactHookFormTemplate

* refactor(root): react aria packages fixed (#2944)

* feat(docs): docs changes (#2868)

* feat(docs): add example how to set locale (#2867)

* docs(guide): add an explanation for the installation guide (#2769)

* docs(guide): add an explanation for the installation guide

* docs(guide): add an explanation for the cli guide

* docs(guide): add support for cli output

* fix: change sort priority - cmdk (#2873)

* docs: remove unsupported props in range calendar and date range picker (#2881)

* chore(calendar): remove showMonthAndYearPickers from range calendar story

* docs(date-range-picker): remove showMonthAndYearPickers info

* docs(range-calendar): remove unsupported props

* docs: refactor typing in form.ts (#2882)

* chore(docs): supplement errorMessage behaviour in input (#2892)

* refactor(docs): revise NextUI Provider structure

* chore(docs): add updated tag

---------

Co-authored-by: Nozomi-Hijikata <116155762+Nozomi-Hijikata@users.noreply.github.com>
Co-authored-by: HaRuki <soccer_haruki15@me.com>
Co-authored-by: Kaben <carnoxen@gmail.com>

* fix(slider): missing marks when hideThumb is true & revise slider styles (#2883)

* chore(slider): include marks in hideThumb

* fix(slider): revise slider styles

* feat(changeset): add changeset

* feat(slider): add tests with marks and hideThumb

* feat(test): react hook form tests & stories (#2931)

* feat(input): add Input with React Hook Form tests

* refactor(input): add missing types

* feat(checkbox): add checkbox with React Hook Form tests

* feat(select): add react-hook-form to dev dep

* feat(select): add react hook form story

* feat(select): react hook form tests

* fix(select): incorrect button reference

* feat(deps): add react-hook-form to dev dep in autocomplete

* feat(autocomplete): react hook form story

* feat(autocomplete): react hook form tests

* fix(autocomplete): rollback wrapper type

* feat(switch): add react hook form tests

* refactor(stories): reorder stories items

* fix: update accordion item heading tag to be customizable (#2265)

* fix: update accordion item heading tag to be customizable

* Update .changeset/heavy-hairs-join.md

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* Update .changeset/heavy-hairs-join.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore(accordion): lint

* chore(changeset): add issue number

* feat(docs): add HeadingComponent prop

---------

Co-authored-by: Shawn Dong <shawn.dong@flybuys.com.au>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>

* fix(theme): add pointer-events-none to skeleton base (#2972)

* feat(tabs): add `destroyInactiveTabPanel` prop for Tabs component (#2973)

* feat(tabs): add destroyInactiveTabPanel and set default to false

* feat(tabs): integrate with destroyInactiveTabPanel

* feat(theme): hidden inert tab panel

* feat(changeset): add changeset

* chore(changeset): add issue number

* feat(docs): add `destroyInactiveTabPanel` prop to tabs page

* chore(docs): set destroyInactiveTabPanel to true by default

* chore(tabs): set destroyInactiveTabPanel to true by default

* chore(tabs): revise destroyInactiveTabPanel logic

* feat(tabs): add tests for destroyInactiveTabPanel

* chore(tabs): change the default value of destroyInactiveTabPanel to true

* refactor: add support for disabling the animation globally (#2929)

* refactor: add support for disabling the animation globally

* chore(docs): disableAnimation removed from global provider

* feat(docs): nextui provider api updated, storybook preview adjusted

* chore(theme): button is scalable when disabled, tooltip animation improved

* fix(theme): remove origin-bottom from button (#2990)

* fix(skeleton): overflow issue in skeleton (#2986)

* fix(theme): set overflow visible after skeleton loaded

* feat(changeset): add changeset

* fix(table): v2 input/textarea don't allow spaces inside a table (#3020)

* fix(table): set onKeyDownCapture to undefined

* feat(changeset): add changeset

* fix(slider): calculate the correct value on mark click (#3017)

* fix(slider): calculate the correct value on mark click

* refactor(slider): remove the tests inside describe block

* feat(slider): add tests for thumb move on mark click

* refactor(slider): use val instead of pos

* fix(theme): revise input isInvalid styles (#3010)

* fix(theme): revise isInvalid input styles

* feat(changeset): add changeset

* feat(date-picker): add missing ref to input wrapper (#3011)

* fix(date-picker): add missing ref to input wrapper

* feat(changeset): add changeset

* fix(core): incorrect tailwind classnames (#3018)

* fix(dropdown): focus behaviour on press / enter keydown (#2970)

* fix(dropdown): set focus on the first item

* feat(dropdown): add keyboard interactions tests

* feat(changeset): add changeset

* fix(dropdown): use fireEvent.keyDown instead

* chore(deps): add @nextui-org/test-utils to dropdown

* refactor(dropdown): pass onKeyDown to menu trigger and don't hardcode autoFocus

* chore(dropdown): remove autoFocus

* fix(menu): pass userMenuProps to useTreeState and useAriaMenu and remove from getListProps

* chore(changeset): add menu package

* fix(component): update type definition to prevent primitive values as items (#2953)

* fix: update type definition to prevent primitive values as items

* fix: typecheck

* fix(select): onSelectionChange can handle number (#2937)

* fix: onSelectionChange type for dynamic items in Select component

* docs: remove unnecessary properties

* docs: update highlightedLines

* chore: add changeset

* fix(calendar): scrolling is hidden when changing the month (#2949)

* fix(calendar): scrolling is hidden when changing the month

* chore(changeset): correct package name

---------

Co-authored-by: Poli Sour <polisour.work@gmail.com>
Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* fix: make VisuallyHidden's element type as span when it's inside phrasing element (#3013)

* fix(checkbox): make VisuallyHidden's element type as span

* feat(changeset): add changeset

* fix(radio): make the VisuallyHidden element type as span

* fix(switch): make the VisuallyHidden element type as span

* fix(select): make the VisuallyHidden element type as span

* feat(changeset): replace changeset

* chore: fix formatting

* docs: sync nextui-cli  api (#3035)

* docs: sync nextui-cli  api

* docs: update

* chore: update routes.json with new path and set updated flag

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* feat: switch default validationBehavior to aria and allow switching via props (#2987)

* chore: add support validationBehavior aria

* chore: add validationBehavior to Provider

* chore: add autocomplete validation test

* chore: add checkbox validation test

* fix(input): require condition

* docs: add description of validationBehavior props

* chore: add support validationBehavior props for date components

* docs(dates): add description of validationBehavior props

* chore: add changeset

* chore: format

* chore: fix test

* fix: select validationBehavior is not support yet

* fix: select validationBehavior not supported yet

* chore(docs): validation behavior prop added to nextui-provider

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix: popover-based focus behaviour (#2854)

* fix(autocomplete): autocomplete focus behaviour

* feat(autocomplete): add test case for catching blur cases

* refactor(autocomplete): use isOpen instead

* feat(autocomplete): add "should focus when clicking autocomplete" test case

* feat(autocomplete): add should set the input after selection

* fix(autocomplete): remove shouldUseVirtualFocus

* fix(autocomplete): uncomment blur logic

* refactor(autocomplete): remove state as it is in getPopoverProps

* refactor(autocomplete): remove unnecessary blur

* refactor(select): remove unncessary props

* fix(popover): use domRef instead

* fix(popover): revise isNonModal and isDismissable

* fix(popover): use dialogRef back

* fix(popover): rollback

* fix(autocomplete): onFocus logic

* feat(popover): set disableFocusManagement to overlay

* feat(modal): set disableFocusManagement to overlay

* fix(autocomplete): set disableFocusManagement for autocomplete

* feat(popover): include disableFocusManagement prop

* refactor(autocomplete): revise type in selectorButton

* fix(autocomplete): revise focus logic

* feat(autocomplete): add internal focus state and add shouldCloseOnInteractOutside

* feat(autocomplete): handle selectedItem change

* feat(autocomplete): add clear button test

* feat(changeset): add changeset

* refactor(components): use the original order

* refactor(autocomplete): add more comments

* fix(autocomplete): revise focus behaviours

* refactor(autocomplete): rename to listbox

* chore(popover): remove disableFocusManagement from popover

* chore(autocomplete): remove disableFocusManagement from autocomplete

* chore(changeset): add issue number

* fix(popover): don't set default value to transformOrigin

* fix(autocomplete): revise shouldCloseOnInteractOutside logic

* feat(autocomplete): should close listbox by clicking another autocomplete

* fix(popover): add disableFocusManagement to overlay

* refactor(autocomplete): revise comments and refactor shouldCloseOnInteractOutside

* feat(changeset): add issue number

* fix(autocomplete): merge with selectorButtonProps.onClick

* refactor(autocomplete): remove extra line

* refactor(autocomplete): revise comment

* feat(select): add shouldCloseOnInteractOutside

* feat(dropdown): add shouldCloseOnInteractOutside

* feat(date-picker): add shouldCloseOnInteractOutside

* feat(changeset): add dropdown and date-picker

* fix(popover): revise shouldCloseOnInteractOutside

* feat(date-picker): integrate with ariaShouldCloseOnInteractOutside

* feat(select): integrate with ariaShouldCloseOnInteractOutside

* feat(dropdown): integrate with ariaShouldCloseOnInteractOutside

* feat(popover): integrate with ariaShouldCloseOnInteractOutside

* feat(aria-utils): ariaShouldCloseOnInteractOutside

* chore(deps): update pnpm-lock.yaml

* feat(autocomplete): integrate with ariaShouldCloseOnInteractOutside

* feat(aria-utils): handle setShouldFocus logic

* feat(changeset): add @nextui-org/aria-utils

* chore(autocomplete): put the test into correct group

* feat(select): should close listbox by clicking another select

* feat(dropdown): should close listbox by clicking another dropdown

* feat(popover): should close listbox by clicking another popover

* feat(date-picker): should close listbox by clicking another datepicker

* chore(changeset): add issue numbers and revise changeset message

* refactor(autocomplete): change to useRef instead

* refactor(autocomplete): change to useRef instead

* refactor(aria-utils): revise comments and format code

* chore(changeset): add issue number

* chore: take popoverProps.shouldCloseOnInteractOutside first

* refactor(autocomplete): remove unnecessary logic

* refactor(autocomplete): focus management logic

* fix(components): Fix 'Tap to click' behavior on macOS with Edge/Chrome for Accordion and Tab (#2725)

* fix(components): fix 'Tap to click' behavior on macOS

* Add change file for accordion, menu, and tabs

* Remove 'fix(components)' from the .changeset file

* fix(components): undo dropdown change now that it's no longer applicable

* fix(components): update changeset file now that we are no longer modifying the dropdown component

* fix(date-picker): corrected inert value for true condition (#3054)

* fix(date-picker): corrected inert value for true condition #3044

* refactor(calendar): add todo comment

* feat(changeset): add changeset

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* fix(hooks): resolve type error in onKeyDown event handler (#3064)

* fix(hooks): resolve type error in onKeyDown event handler

* chore(changeset): revise changeset

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* Update dependency array on setPage useCallback hook (#3029)

Changes:
Add the onChangeActivePage function to the dependency array of the setPage useCallback hook to ensure it always reflects the latest state.

Impact:
This fix ensures that the pagination component accurately reflects the current state when triggering onChangeActivePage.

* fix: error peerDep in pkg (#3014)

* fix: error peerDep in pkg

* docs: changeset

* Fix DatePicker Time Input (#2845)

* fix(date-picker): set `isCalendarHeaderExpanded` to `false` when DatePicker is closed

* fix(date-picker): calendar header controlled state on DatePicker

* chore(date-picker): update test

* chore(date-picker): remove unnecessary `async` in test

* Update packages/components/date-picker/__tests__/date-picker.test.tsx

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix(date-picker): test

* fix(hooks): optimize useScrollPosition with useCallback and useRef (#3049)

* fix(hooks): optimize useScrollPosition with useCallback and useRef

* Update .changeset/lucky-cobras-jog.md

* Update packages/hooks/use-scroll-position/src/index.ts

* Update packages/hooks/use-scroll-position/src/index.ts

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix(select): placeholder text display for controlled component (#3081)

* fix: return placeholder when selectedItems is empty

* chore: add test and changeset

* chore(docs): v2.4.0 (#3084)

* chore(docs): v2.4.0

* chore(docs): v2.4.0 blog

* chore(docs): revise typos based on coderabbitai

* chore(docs): adjust navbar

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* chore(changese): update @nextui-org/react dependency to minor version

* docs: update cli docs (#3096)

* ci(changesets): version packages (#2903)

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

---------

Co-authored-by: Shrinidhi Upadhyaya <shrinidhiupadhyaya1195@gmail.com>
Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
Co-authored-by: Paul Tiedtke <PaulTiedtke@web.de>
Co-authored-by: Mohammad Reza Badri <85818966+mrbadri@users.noreply.github.com>
Co-authored-by: Nozomi-Hijikata <116155762+Nozomi-Hijikata@users.noreply.github.com>
Co-authored-by: HaRuki <soccer_haruki15@me.com>
Co-authored-by: Kaben <carnoxen@gmail.com>
Co-authored-by: Shawn Dong <dsknight@live.com.au>
Co-authored-by: Shawn Dong <shawn.dong@flybuys.com.au>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Ryo Matsukawa <76232929+ryo-manba@users.noreply.github.com>
Co-authored-by: Poli Sour <57824881+novsource@users.noreply.github.com>
Co-authored-by: Poli Sour <polisour.work@gmail.com>
Co-authored-by: Artem Pitikin <git@kosmotema.dev>
Co-authored-by: winches <329487092@qq.com>
Co-authored-by: Eric Abreu <ericfabreu@gmail.com>
Co-authored-by: Minsu <52266597+Gaic4o@users.noreply.github.com>
Co-authored-by: Jesus Perdomo Lampignano <38929969+jesuzon@users.noreply.github.com>
Co-authored-by: chirokas <157580465+chirokas@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
jrgarciadev added a commit that referenced this pull request Jun 1, 2024
* chore(root): reat-aria packages updated (#2889)

* chore(storybook): common colors enabled (#2902)

* fix(range-calendar): hide only dates outside the month (#2906)

* fix(range-calendar): hide only dates outside the month #2890

* fix(range-calendar): corrected spelling mistake in changeset description

* fix(range-calendar): corrected capitalization in changeset description

* chore(changeset): patch @nextui-org/theme

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>

* fix(date-picker): keep date picker style consistent for different variants (#2908)

* fix: add missing TableRowProps export (#2866)

* fix: add missing TableRowProps export

* feat(changeset): add changeset for PR2866

* chore(changeset): revise changeset message

---------

Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>

* fix(input): correct label margin for RTL required inputs (#2781)

* fix(input): correct label margin for RTL required inputs

* fix(theme): add changeset fr theme

* docs(core): add storybook and canary release info (#2914)

* Cn utility refactor (#2915)

* refactor(core): cn utility adjusted and moved to the theme package

* chore(root): changeset

* fix(storybook): stories that used cn

* docs(date-picker): change to jsx instead (#2919)

* fix(switch): support uncontrolled switch in react-hook-form (#2924)

* feat(switch): add @nextui-org/use-safe-layout-effect

* chore(deps): add @nextui-org/use-safe-layout-effect

* fix(switch): react-hook-form uncontrolled switch component

* fix(switch): react-hook-form uncontrolled switch component

* feat(switch): add rect-hook-form in dev dep

* feat(switch): add WithReactHookFormTemplate

* refactor(root): react aria packages fixed (#2944)

* feat(docs): docs changes (#2868)

* feat(docs): add example how to set locale (#2867)

* docs(guide): add an explanation for the installation guide (#2769)

* docs(guide): add an explanation for the installation guide

* docs(guide): add an explanation for the cli guide

* docs(guide): add support for cli output

* fix: change sort priority - cmdk (#2873)

* docs: remove unsupported props in range calendar and date range picker (#2881)

* chore(calendar): remove showMonthAndYearPickers from range calendar story

* docs(date-range-picker): remove showMonthAndYearPickers info

* docs(range-calendar): remove unsupported props

* docs: refactor typing in form.ts (#2882)

* chore(docs): supplement errorMessage behaviour in input (#2892)

* refactor(docs): revise NextUI Provider structure

* chore(docs): add updated tag

---------

Co-authored-by: Nozomi-Hijikata <116155762+Nozomi-Hijikata@users.noreply.github.com>
Co-authored-by: HaRuki <soccer_haruki15@me.com>
Co-authored-by: Kaben <carnoxen@gmail.com>

* fix(slider): missing marks when hideThumb is true & revise slider styles (#2883)

* chore(slider): include marks in hideThumb

* fix(slider): revise slider styles

* feat(changeset): add changeset

* feat(slider): add tests with marks and hideThumb

* feat(test): react hook form tests & stories (#2931)

* feat(input): add Input with React Hook Form tests

* refactor(input): add missing types

* feat(checkbox): add checkbox with React Hook Form tests

* feat(select): add react-hook-form to dev dep

* feat(select): add react hook form story

* feat(select): react hook form tests

* fix(select): incorrect button reference

* feat(deps): add react-hook-form to dev dep in autocomplete

* feat(autocomplete): react hook form story

* feat(autocomplete): react hook form tests

* fix(autocomplete): rollback wrapper type

* feat(switch): add react hook form tests

* refactor(stories): reorder stories items

* fix: update accordion item heading tag to be customizable (#2265)

* fix: update accordion item heading tag to be customizable

* Update .changeset/heavy-hairs-join.md

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* Update .changeset/heavy-hairs-join.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore(accordion): lint

* chore(changeset): add issue number

* feat(docs): add HeadingComponent prop

---------

Co-authored-by: Shawn Dong <shawn.dong@flybuys.com.au>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>

* fix(theme): add pointer-events-none to skeleton base (#2972)

* feat(tabs): add `destroyInactiveTabPanel` prop for Tabs component (#2973)

* feat(tabs): add destroyInactiveTabPanel and set default to false

* feat(tabs): integrate with destroyInactiveTabPanel

* feat(theme): hidden inert tab panel

* feat(changeset): add changeset

* chore(changeset): add issue number

* feat(docs): add `destroyInactiveTabPanel` prop to tabs page

* chore(docs): set destroyInactiveTabPanel to true by default

* chore(tabs): set destroyInactiveTabPanel to true by default

* chore(tabs): revise destroyInactiveTabPanel logic

* feat(tabs): add tests for destroyInactiveTabPanel

* chore(tabs): change the default value of destroyInactiveTabPanel to true

* refactor: add support for disabling the animation globally (#2929)

* refactor: add support for disabling the animation globally

* chore(docs): disableAnimation removed from global provider

* feat(docs): nextui provider api updated, storybook preview adjusted

* chore(theme): button is scalable when disabled, tooltip animation improved

* fix(theme): remove origin-bottom from button (#2990)

* fix(skeleton): overflow issue in skeleton (#2986)

* fix(theme): set overflow visible after skeleton loaded

* feat(changeset): add changeset

* fix(table): v2 input/textarea don't allow spaces inside a table (#3020)

* fix(table): set onKeyDownCapture to undefined

* feat(changeset): add changeset

* fix(slider): calculate the correct value on mark click (#3017)

* fix(slider): calculate the correct value on mark click

* refactor(slider): remove the tests inside describe block

* feat(slider): add tests for thumb move on mark click

* refactor(slider): use val instead of pos

* fix(theme): revise input isInvalid styles (#3010)

* fix(theme): revise isInvalid input styles

* feat(changeset): add changeset

* feat(date-picker): add missing ref to input wrapper (#3011)

* fix(date-picker): add missing ref to input wrapper

* feat(changeset): add changeset

* fix(core): incorrect tailwind classnames (#3018)

* fix(dropdown): focus behaviour on press / enter keydown (#2970)

* fix(dropdown): set focus on the first item

* feat(dropdown): add keyboard interactions tests

* feat(changeset): add changeset

* fix(dropdown): use fireEvent.keyDown instead

* chore(deps): add @nextui-org/test-utils to dropdown

* refactor(dropdown): pass onKeyDown to menu trigger and don't hardcode autoFocus

* chore(dropdown): remove autoFocus

* fix(menu): pass userMenuProps to useTreeState and useAriaMenu and remove from getListProps

* chore(changeset): add menu package

* fix(component): update type definition to prevent primitive values as items (#2953)

* fix: update type definition to prevent primitive values as items

* fix: typecheck

* fix(select): onSelectionChange can handle number (#2937)

* fix: onSelectionChange type for dynamic items in Select component

* docs: remove unnecessary properties

* docs: update highlightedLines

* chore: add changeset

* fix(calendar): scrolling is hidden when changing the month (#2949)

* fix(calendar): scrolling is hidden when changing the month

* chore(changeset): correct package name

---------

Co-authored-by: Poli Sour <polisour.work@gmail.com>
Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* fix: make VisuallyHidden's element type as span when it's inside phrasing element (#3013)

* fix(checkbox): make VisuallyHidden's element type as span

* feat(changeset): add changeset

* fix(radio): make the VisuallyHidden element type as span

* fix(switch): make the VisuallyHidden element type as span

* fix(select): make the VisuallyHidden element type as span

* feat(changeset): replace changeset

* chore: fix formatting

* docs: sync nextui-cli  api (#3035)

* docs: sync nextui-cli  api

* docs: update

* chore: update routes.json with new path and set updated flag

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* feat: switch default validationBehavior to aria and allow switching via props (#2987)

* chore: add support validationBehavior aria

* chore: add validationBehavior to Provider

* chore: add autocomplete validation test

* chore: add checkbox validation test

* fix(input): require condition

* docs: add description of validationBehavior props

* chore: add support validationBehavior props for date components

* docs(dates): add description of validationBehavior props

* chore: add changeset

* chore: format

* chore: fix test

* fix: select validationBehavior is not support yet

* fix: select validationBehavior not supported yet

* chore(docs): validation behavior prop added to nextui-provider

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix: popover-based focus behaviour (#2854)

* fix(autocomplete): autocomplete focus behaviour

* feat(autocomplete): add test case for catching blur cases

* refactor(autocomplete): use isOpen instead

* feat(autocomplete): add "should focus when clicking autocomplete" test case

* feat(autocomplete): add should set the input after selection

* fix(autocomplete): remove shouldUseVirtualFocus

* fix(autocomplete): uncomment blur logic

* refactor(autocomplete): remove state as it is in getPopoverProps

* refactor(autocomplete): remove unnecessary blur

* refactor(select): remove unncessary props

* fix(popover): use domRef instead

* fix(popover): revise isNonModal and isDismissable

* fix(popover): use dialogRef back

* fix(popover): rollback

* fix(autocomplete): onFocus logic

* feat(popover): set disableFocusManagement to overlay

* feat(modal): set disableFocusManagement to overlay

* fix(autocomplete): set disableFocusManagement for autocomplete

* feat(popover): include disableFocusManagement prop

* refactor(autocomplete): revise type in selectorButton

* fix(autocomplete): revise focus logic

* feat(autocomplete): add internal focus state and add shouldCloseOnInteractOutside

* feat(autocomplete): handle selectedItem change

* feat(autocomplete): add clear button test

* feat(changeset): add changeset

* refactor(components): use the original order

* refactor(autocomplete): add more comments

* fix(autocomplete): revise focus behaviours

* refactor(autocomplete): rename to listbox

* chore(popover): remove disableFocusManagement from popover

* chore(autocomplete): remove disableFocusManagement from autocomplete

* chore(changeset): add issue number

* fix(popover): don't set default value to transformOrigin

* fix(autocomplete): revise shouldCloseOnInteractOutside logic

* feat(autocomplete): should close listbox by clicking another autocomplete

* fix(popover): add disableFocusManagement to overlay

* refactor(autocomplete): revise comments and refactor shouldCloseOnInteractOutside

* feat(changeset): add issue number

* fix(autocomplete): merge with selectorButtonProps.onClick

* refactor(autocomplete): remove extra line

* refactor(autocomplete): revise comment

* feat(select): add shouldCloseOnInteractOutside

* feat(dropdown): add shouldCloseOnInteractOutside

* feat(date-picker): add shouldCloseOnInteractOutside

* feat(changeset): add dropdown and date-picker

* fix(popover): revise shouldCloseOnInteractOutside

* feat(date-picker): integrate with ariaShouldCloseOnInteractOutside

* feat(select): integrate with ariaShouldCloseOnInteractOutside

* feat(dropdown): integrate with ariaShouldCloseOnInteractOutside

* feat(popover): integrate with ariaShouldCloseOnInteractOutside

* feat(aria-utils): ariaShouldCloseOnInteractOutside

* chore(deps): update pnpm-lock.yaml

* feat(autocomplete): integrate with ariaShouldCloseOnInteractOutside

* feat(aria-utils): handle setShouldFocus logic

* feat(changeset): add @nextui-org/aria-utils

* chore(autocomplete): put the test into correct group

* feat(select): should close listbox by clicking another select

* feat(dropdown): should close listbox by clicking another dropdown

* feat(popover): should close listbox by clicking another popover

* feat(date-picker): should close listbox by clicking another datepicker

* chore(changeset): add issue numbers and revise changeset message

* refactor(autocomplete): change to useRef instead

* refactor(autocomplete): change to useRef instead

* refactor(aria-utils): revise comments and format code

* chore(changeset): add issue number

* chore: take popoverProps.shouldCloseOnInteractOutside first

* refactor(autocomplete): remove unnecessary logic

* refactor(autocomplete): focus management logic

* fix(components): Fix 'Tap to click' behavior on macOS with Edge/Chrome for Accordion and Tab (#2725)

* fix(components): fix 'Tap to click' behavior on macOS

* Add change file for accordion, menu, and tabs

* Remove 'fix(components)' from the .changeset file

* fix(components): undo dropdown change now that it's no longer applicable

* fix(components): update changeset file now that we are no longer modifying the dropdown component

* fix(date-picker): corrected inert value for true condition (#3054)

* fix(date-picker): corrected inert value for true condition #3044

* refactor(calendar): add todo comment

* feat(changeset): add changeset

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* fix(hooks): resolve type error in onKeyDown event handler (#3064)

* fix(hooks): resolve type error in onKeyDown event handler

* chore(changeset): revise changeset

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* Update dependency array on setPage useCallback hook (#3029)

Changes:
Add the onChangeActivePage function to the dependency array of the setPage useCallback hook to ensure it always reflects the latest state.

Impact:
This fix ensures that the pagination component accurately reflects the current state when triggering onChangeActivePage.

* fix: error peerDep in pkg (#3014)

* fix: error peerDep in pkg

* docs: changeset

* Fix DatePicker Time Input (#2845)

* fix(date-picker): set `isCalendarHeaderExpanded` to `false` when DatePicker is closed

* fix(date-picker): calendar header controlled state on DatePicker

* chore(date-picker): update test

* chore(date-picker): remove unnecessary `async` in test

* Update packages/components/date-picker/__tests__/date-picker.test.tsx

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix(date-picker): test

* fix(hooks): optimize useScrollPosition with useCallback and useRef (#3049)

* fix(hooks): optimize useScrollPosition with useCallback and useRef

* Update .changeset/lucky-cobras-jog.md

* Update packages/hooks/use-scroll-position/src/index.ts

* Update packages/hooks/use-scroll-position/src/index.ts

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix(select): placeholder text display for controlled component (#3081)

* fix: return placeholder when selectedItems is empty

* chore: add test and changeset

* chore(docs): v2.4.0 (#3084)

* chore(docs): v2.4.0

* chore(docs): v2.4.0 blog

* chore(docs): revise typos based on coderabbitai

* chore(docs): adjust navbar

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* chore(changese): update @nextui-org/react dependency to minor version

* docs: update cli docs (#3096)

* ci(changesets): version packages (#2903)

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix(radio): remove required attribute for Radio with validationBehavior="aria" (#3110)

* fix(theme): add missing pointer event after data loaded (#3126)

* fix(system): listbox href issue (experimental) (#3119)

* fix(system): @react-aria/utils

* feat(hooks): include routerLinkProps

* feat(changeset): add changeset

* chore(deps): bump @react-aria/utils to 3.24.1

* fix(hooks): missing arguments

* chore(deps): bump @react-types/link

* chore(link): bump @react-aria/link to 3.7.1

* chore(link): use @react-aria/link instead

* chore(changeset): revise changeset

* chore(hooks): undo use-aria-link changes

* chore(deps): undo use-aria-link changes

* chore(deps): bump `@react-aria/utils` to `3.24.1`

* chore(deps): bump `@react-types/shared`

* feat: add missing router.open parameters due to router change

* chore(changeset): add new line

* chore(deps): bump `@react-types/shared` to `3.23.1`

* fix(avatar): avoid passing `disableAnimation` prop to a DOM element (#3111)

* fix(avatar): avoid passing `disableAnimation` prop to a DOM element

* refactor(avatar): use filterDOMProps approach

* chore(avatar): remove to type import

* chore(avatar): change to shouldFilterDOMProps

* fix(docs): removed unused import & corrected prop for disabled DatePicker (#3136)

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>

* ci(changesets): version packages (#3115)

* fix(pagination): missing animation (#3144)

* fix tsup domain (#3158)

* chore(docs): remove destroyInactiveTabPanel from Tab due to merge conflict (#3155)

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
Co-authored-by: Shrinidhi Upadhyaya <shrinidhiupadhyaya1195@gmail.com>
Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: Paul Tiedtke <PaulTiedtke@web.de>
Co-authored-by: Mohammad Reza Badri <85818966+mrbadri@users.noreply.github.com>
Co-authored-by: Nozomi-Hijikata <116155762+Nozomi-Hijikata@users.noreply.github.com>
Co-authored-by: HaRuki <soccer_haruki15@me.com>
Co-authored-by: Kaben <carnoxen@gmail.com>
Co-authored-by: Shawn Dong <dsknight@live.com.au>
Co-authored-by: Shawn Dong <shawn.dong@flybuys.com.au>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Ryo Matsukawa <76232929+ryo-manba@users.noreply.github.com>
Co-authored-by: Poli Sour <57824881+novsource@users.noreply.github.com>
Co-authored-by: Poli Sour <polisour.work@gmail.com>
Co-authored-by: Artem Pitikin <git@kosmotema.dev>
Co-authored-by: winches <329487092@qq.com>
Co-authored-by: Eric Abreu <ericfabreu@gmail.com>
Co-authored-by: Minsu <52266597+Gaic4o@users.noreply.github.com>
Co-authored-by: Jesus Perdomo Lampignano <38929969+jesuzon@users.noreply.github.com>
Co-authored-by: chirokas <157580465+chirokas@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: EGOIST <0x142857@gmail.com>
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.

[BUG] - INPUT WHEN ISVALID
2 participants