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

chore(drawer): export drawer children props #4310

Open
wants to merge 5 commits into
base: canary
Choose a base branch
from

Conversation

omarshehab221
Copy link

@omarshehab221 omarshehab221 commented Dec 10, 2024

Closes #

📝 Description

Export DrawerContentProps, DrawerHeaderProps, DrawerBodyProps, DrawerFooterProps and UseDisclosureProps from @nextui-org/drawer

⛳️ Current behavior (updates)

The drawer children props aren't exported

🚀 New behavior

the drawer children props are exported

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

📝 Additional Information

Summary by CodeRabbit

  • New Features
    • Enhanced type definitions for the Drawer component, including new props for content, header, body, and footer.
    • Introduced a new useDisclosure hook to improve modal functionalities.
  • Improvements
    • Clearer usage of types with updated aliases for better integration with the Drawer component.
    • Enhanced accessibility of children properties for the Drawer component.

Copy link

vercel bot commented Dec 10, 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 Dec 12, 2024 5:55pm
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 5:55pm

Copy link

changeset-bot bot commented Dec 10, 2024

🦋 Changeset detected

Latest commit: e7b3d52

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

This PR includes changesets to release 2 packages
Name Type
@nextui-org/drawer Patch
@nextui-org/react 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

vercel bot commented Dec 10, 2024

@omarshehab221 is attempting to deploy a commit to the NextUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Dec 10, 2024

Walkthrough

The changes involve modifications to the index.ts file in the packages/components/drawer/src directory. These modifications include the addition of several type imports from the @nextui-org/modal package and the export of these types with new aliases related to the Drawer component. Additionally, the useDrawer hook is now exported from the ./use-drawer module, enhancing the module's functionality and type definitions.

Changes

File Path Change Summary
packages/components/drawer/src/index.ts - Added imports for ModalContentProps, ModalHeaderProps, ModalBodyProps, ModalFooterProps.
- Exported types with aliases: ModalContentProps as DrawerContentProps, ModalHeaderProps as DrawerHeaderProps, ModalBodyProps as DrawerBodyProps, ModalFooterProps as DrawerFooterProps.
- Exported useDrawer hook from ./use-drawer module.
.changeset/forty-ducks-brake.md - Exported the useDisclosure hook and the children properties of the Drawer component.

Possibly related PRs

Suggested reviewers

  • jrgarciadev

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e806a5 and e7b3d52.

📒 Files selected for processing (1)
  • packages/components/drawer/src/index.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/components/drawer/src/index.ts

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@jrgarciadev
Copy link
Member

Hey @omarshehab221 please fix the eslint and add a changeset

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

🧹 Outside diff range and nitpick comments (3)
packages/components/drawer/src/index.ts (3)

1-11: Consider documenting the architectural decision to reuse Modal props

While reusing Modal props for Drawer components promotes consistency and reduces duplication, it creates a coupling between these components. Consider adding a comment explaining this design decision and its implications for maintainers.

Add a comment like:

+// Note: Drawer components intentionally reuse Modal props to maintain consistency
+// and reduce duplication. Changes to Modal props will affect Drawer components.
import {
  ModalHeader,
  ModalBody,

17-23: Consider reorganizing type exports

The UseDisclosureProps type seems out of place among Drawer-specific types. Consider moving it to be grouped with other hook-related exports for better organization.

export type {
  ModalContentProps as DrawerContentProps,
  ModalHeaderProps as DrawerHeaderProps,
  ModalBodyProps as DrawerBodyProps,
  ModalFooterProps as DrawerFooterProps,
-  UseDisclosureProps,
};

// export hooks
+export type {UseDisclosureProps};
export {useDrawer} from "./use-drawer";

A changeset is needed for the new Drawer exports

The existing changesets are for different components (pagination, listbox, menu, and input-otp) and don't document the new exports in the Drawer component. Please add a new changeset to document these changes.

  • Use pnpm changeset to create a new changeset
  • Document the new exports being added to the Drawer component
  • Include @nextui-org/drawer in the changeset
🔗 Analysis chain

Line range hint 1-38: Add a changeset to document these exports

As mentioned in the PR comments, please add a changeset to document these new exports. This will help with versioning and release notes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if a changeset exists for this PR
fd -e md . .changeset

Length of output: 116


Script:

#!/bin/bash
# Let's check the content of the changesets to see if they document these exports
cat .changeset/breezy-bobcats-destroy.md .changeset/smooth-trainers-walk.md

Length of output: 320

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1485eca and 70f2541.

📒 Files selected for processing (1)
  • packages/components/drawer/src/index.ts (1 hunks)
🔇 Additional comments (1)
packages/components/drawer/src/index.ts (1)

26-27: Verify useDisclosure hook usage

Let's verify that the useDisclosure hook is actually used by the Drawer component to ensure we're not exposing unnecessary APIs.

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

🧹 Outside diff range and nitpick comments (1)
.changeset/forty-ducks-brake.md (1)

1-5: Enhance the changeset description for better clarity.

While the patch version bump is appropriate, the description could be more informative for changelog readers.

Consider applying this diff to provide more details:

 ---
 "@nextui-org/drawer": patch
 ---
 
-Export useDisclosure and Drawer children props from `@nextui-org/drawer`
+Export useDisclosure hook and Drawer component props from `@nextui-org/drawer`:
+- Export DrawerContentProps, DrawerHeaderProps, DrawerBodyProps, and DrawerFooterProps
+- Export UseDisclosureProps for better TypeScript support
+- Re-export useDisclosure hook from @nextui-org/use-disclosure
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 70f2541 and dc68f35.

📒 Files selected for processing (1)
  • .changeset/forty-ducks-brake.md (1 hunks)

@wingkwong wingkwong changed the title Export Drawer children props chore(drawer): export drawer children props Dec 10, 2024
packages/components/drawer/src/index.ts Outdated Show resolved Hide resolved
packages/components/drawer/src/index.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants