import React from 'react'; import PropTypes from 'prop-types'; import { ComponentProps } from '../utils/types'; type TabClickHandler = (event: React.MouseEvent, data: { tabId: string; }) => void; type TabFocusHandler = (event: React.FocusEvent, data: { tabId: string; }) => void; interface TabPropsBase { /** * The ariaControls prop is the element `id` of the content displayed when the tab is selected. */ ariaControls?: string; /** Inserts number in tab label. */ count?: number; /** Prevents user from clicking the tab. */ disabled?: boolean; /** * A React ref which is set to the DOM element when the component mounts and null when it unmounts. */ elementRef?: React.Ref; /** See Icon documentation for more information. */ icon?: React.ReactNode; /** * Placed on the clickable element. For accessibility, the related content must * have an `aria-labelledby` attribute that matches this `id`. The `id` must be unique * within the document, unlike `tabId`, which must be unique within the `TabBar` instance. */ id?: string; /** The text shown in the button. */ label?: React.ReactNode; /** @private Maximum count number in tab label */ maxCount?: number; /** * A unique `id` for this tab and used by the `TabBar` to keep track of the open tab. * If not provided, one will be automatically generated for the tab. */ tabId?: string; /** Identifies the URL for a link. If set, Splunk UI applies an tag * instead of a