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

fix(Tearsheet): add missing declaration for headerActions prop #6114

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/ibm-products/src/components/Tearsheet/Tearsheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ export interface TearsheetProps extends PropsWithChildren {
*/
hasCloseIcon?: boolean;

/**
* The content for the header actions area, displayed alongside the title in
* the header area of the tearsheet. This is typically a drop-down, or a set
* of small buttons, or similar. NB the headerActions is only applicable for
* wide tearsheets.
*/
headerActions?: ReactNode;

Copy link
Contributor

@amal-k-joy amal-k-joy Sep 26, 2024

Choose a reason for hiding this comment

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

Hey @wkeese ,
Thanks for the changes.
I was trying to see this prop type warning in the story Tearsheet with all header items and influencer which passes headerActions prop and couldn't find any. Could you please help me to reproduce this issue ?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amal-k-joy - I guess PropTypes doesn't warn about having extra parameters. I updated the ticket description to just say that we don't have proper PropTypes validation, i.e. something like headerActions={567} would not currently be flagged.

Note that this PR is mainly for fixing the Typescript declaration, or at least that's my main goal.

/**
* The content for the influencer section of the tearsheet, displayed
* alongside the main content. This is typically a menu, or filter, or
Expand Down Expand Up @@ -297,6 +305,14 @@ Tearsheet.propTypes = {
/**@ts-ignore */
hasCloseIcon: PropTypes.bool,

/**
* The content for the header actions area, displayed alongside the title in
* the header area of the tearsheet. This is typically a drop-down, or a set
* of small buttons, or similar. NB the headerActions is only applicable for
* wide tearsheets.
*/
headerActions: PropTypes.element,

/**
* The content for the influencer section of the tearsheet, displayed
* alongside the main content. This is typically a menu, or filter, or
Expand Down
Loading