From 2c5f6ef9c0713f28768c89bc5da26788e0e1130b Mon Sep 17 00:00:00 2001 From: Tresau-IBM <148357638+Tresau-IBM@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:13:23 -0400 Subject: [PATCH] feat: add types to TableBatchAction (#15065) Co-authored-by: Taylor Jones --- ...bleBatchAction.js => TableBatchAction.tsx} | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) rename packages/react/src/components/DataTable/{TableBatchAction.js => TableBatchAction.tsx} (72%) diff --git a/packages/react/src/components/DataTable/TableBatchAction.js b/packages/react/src/components/DataTable/TableBatchAction.tsx similarity index 72% rename from packages/react/src/components/DataTable/TableBatchAction.js rename to packages/react/src/components/DataTable/TableBatchAction.tsx index fcaa9e052605..06449cda87b6 100644 --- a/packages/react/src/components/DataTable/TableBatchAction.js +++ b/packages/react/src/components/DataTable/TableBatchAction.tsx @@ -10,6 +10,25 @@ import React from 'react'; import { AddFilled as iconAddSolid } from '@carbon/icons-react'; import Button from '../Button'; +export interface TableBatchActionProps + extends React.ButtonHTMLAttributes { + /** + * Specify if the button is an icon-only button + */ + hasIconOnly?: boolean; + + /** + * If specifying the `renderIcon` prop, provide a description for that icon that can + * be read by screen readers + */ + iconDescription?: string; + + /** + * Optional function to render your own icon in the underlying button + */ + renderIcon?: React.ElementType; +} + const TableBatchAction = ({ renderIcon = iconAddSolid, iconDescription = 'Add',