From b51814bf02eecd37131ced8d2a0b93eb88870108 Mon Sep 17 00:00:00 2001 From: Timothy Esau Date: Mon, 30 Oct 2023 10:29:08 -0400 Subject: [PATCH] feat: add types to TableBatchAction --- ...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',