Skip to content

Commit

Permalink
fix(types): resolve commented issues
Browse files Browse the repository at this point in the history
  • Loading branch information
makafsal committed Sep 25, 2024
1 parent d644788 commit 0702d1f
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ const defaults = {
taskLists: [],
theme: Themes.light,
toggleLabel: 'Toggle',
toggleLabelAlign: 'top',
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export interface CreateTearsheetProps extends PropsWithChildren {
/**
* The main title of the tearsheet, displayed in the header area.
*/
title?: string;
title?: ReactNode;

/**
* The position of the top of tearsheet in the viewport. The 'normal'
Expand Down Expand Up @@ -438,7 +438,7 @@ CreateTearsheet.propTypes = {
/**
* The main title of the tearsheet, displayed in the header area.
*/
title: PropTypes.string,
title: PropTypes.node,

/**
* The position of the top of tearsheet in the viewport. The 'normal'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export interface DataGridState<T extends object = any>
emptyStateAction: {
kind?: 'primary' | 'secondary' | 'tertiary';
renderIcon?: CarbonIconType;
onClick?: ButtonProps<'button'>['onClick'];
onClick?: ButtonProps<React.ElementType>['onClick'];
text?: string;
};
emptyStateLink?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ interface EmptyStateProps {
action?: {
kind?: 'primary' | 'secondary' | 'tertiary';
renderIcon?: CarbonIconType;
onClick?: ButtonProps<'button'>['onClick'];
onClick?: ButtonProps<React.ElementType>['onClick'];
text?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface ErrorEmptyStateProps {
action?: {
kind?: 'primary' | 'secondary' | 'tertiary';
renderIcon?: CarbonIconType;
onClick?: ButtonProps<'button'>['onClick'];
onClick?: ButtonProps<React.ElementType>['onClick'];
text?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface NoDataEmptyStateProps {
action?: {
kind?: 'primary' | 'secondary' | 'tertiary';
renderIcon?: CarbonIconType;
onClick?: ButtonProps<'button'>['onClick'];
onClick?: ButtonProps<React.ElementType>['onClick'];
text?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface NoTagsEmptyStateProps {
action?: {
kind?: 'primary' | 'secondary' | 'tertiary';
renderIcon?: CarbonIconType;
onClick?: ButtonProps<'button'>['onClick'];
onClick?: ButtonProps<React.ElementType>['onClick'];
text?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface NotFoundEmptyStateProps {
action?: {
kind?: 'primary' | 'secondary' | 'tertiary';
renderIcon?: CarbonIconType;
onClick?: ButtonProps<'button'>['onClick'];
onClick?: ButtonProps<React.ElementType>['onClick'];
text?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface NotificationsEmptyStateProps {
action?: {
kind?: 'primary' | 'secondary' | 'tertiary';
renderIcon?: CarbonIconType;
onClick?: ButtonProps<'button'>['onClick'];
onClick?: ButtonProps<React.ElementType>['onClick'];
text?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface UnauthorizedEmptyStateProps {
action?: {
kind?: 'primary' | 'secondary' | 'tertiary';
renderIcon?: CarbonIconType;
onClick?: ButtonProps<'button'>['onClick'];
onClick?: ButtonProps<React.ElementType>['onClick'];
text?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ type PageActionProps =
* - maxWidth: maximum number of pixels the content will grow to
* Carbon Button API https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
*/
pageActions: ButtonProps<'button'>[] | PageAction;
pageActions: ButtonProps<React.ElementType>[] | PageAction;
/**
* When there is insufficient space to display all of hte page actions inline a dropdown button menu is shown,
* containing the page actions. This label is used as the display content of the dropdown button menu.
Expand Down Expand Up @@ -1174,7 +1174,7 @@ export let PageHeader = React.forwardRef(
`${blockClass}__button-set-menu-options`
)}
onWidthChange={handleWidthChange}
buttons={pageActions as ButtonProps<'button'>[]}
buttons={pageActions as ButtonProps<React.ElementType>[]}
buttonSetOverflowLabel={
pageActionsOverflowLabel as NonNullable<ReactNode>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface TearsheetNarrowBaseProps extends PropsWithChildren {
*
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
*/
actions?: ButtonProps<'button'>[];
actions?: ButtonProps<React.ElementType>[];

/**
* The aria-label for the tearsheet, which is optional.
Expand Down
2 changes: 1 addition & 1 deletion packages/ibm-products/src/custom-typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
// @ts-nocheck

declare module '@carbon/react' {
export {
Accordion,
Expand Down

0 comments on commit 0702d1f

Please sign in to comment.