UNPKG

@stratakit/react

Version:

A React component library for StrataKit

67 lines (66 loc) 3.48 kB
import * as React from "react"; import { Icon } from "./Icon.js"; import type { Tab as IuiTab, Tabs as IuiTabs } from "@itwin/itwinui-react"; import type { PolymorphicForwardRefComponent } from "./~utils.js"; type IuiTabsLegacyProps = React.ComponentProps<typeof IuiTabs>; interface LegacyTabsProps extends Pick<IuiTabsLegacyProps, "actions" | "labels" | "onTabSelected" | "activeIndex" | "focusActivationMode" | "color" | "tabsClassName" | "contentClassName" | "wrapperClassName" | "children" | "overflowOptions" | "defaultValue" | "defaultChecked" | "orientation" | "type"> { /** NOT IMPLEMENTED. */ actions?: IuiTabsLegacyProps["actions"]; /** NOT IMPLEMENTED. */ orientation?: IuiTabsLegacyProps["orientation"]; /** NOT IMPLEMENTED. */ type?: IuiTabsLegacyProps["type"]; } type IuiTabLegacyProps = React.ComponentProps<typeof IuiTab>; interface LegacyTabProps extends Pick<IuiTabLegacyProps, "label" | "sublabel" | "startIcon" | "disabled" | "children" | "value"> { /** NOT IMPLEMENTED. */ sublabel?: IuiTabLegacyProps["sublabel"]; /** NOT IMPLEMENTED. */ children?: IuiTabLegacyProps["children"]; /** NOT IMPLEMENTED. */ value?: IuiTabLegacyProps["value"]; } /** @see https://itwinui.bentley.com/docs/tabs#legacy-api */ declare const LegacyTab: PolymorphicForwardRefComponent<"button", LegacyTabProps>; type IuiWrapperProps = React.ComponentProps<typeof IuiTabs.Wrapper>; interface WrapperProps extends Pick<IuiWrapperProps, "color" | "focusActivationMode" | "defaultValue" | "value" | "onValueChange" | "defaultChecked" | "orientation" | "type"> { /** NOT IMPLEMENTED. */ orientation?: IuiWrapperProps["orientation"]; /** NOT IMPLEMENTED. */ type?: IuiWrapperProps["type"]; } type IuiTabListProps = React.ComponentProps<typeof IuiTabs.TabList>; interface TabListProps extends Pick<IuiTabListProps, "children"> { } type IuiTabProps = React.ComponentProps<typeof IuiTabs.Tab>; interface TabProps extends Pick<IuiTabProps, "value" | "label" | "id"> { } type IuiPanelProps = React.ComponentProps<typeof IuiTabs.Panel>; interface PanelProps extends Pick<IuiPanelProps, "value" | "id"> { } type IconProps = React.ComponentProps<typeof Icon>; interface TabIconProps extends IconProps { } /** @see https://itwinui.bentley.com/docs/tabs */ declare const Tabs: PolymorphicForwardRefComponent<"div", LegacyTabsProps> & { Wrapper: PolymorphicForwardRefComponent<"div", WrapperProps>; TabList: PolymorphicForwardRefComponent<"div", TabListProps>; Tab: PolymorphicForwardRefComponent<"button", TabProps>; TabIcon: PolymorphicForwardRefComponent<"svg", TabIconProps>; /** NOT IMPLEMENTED. */ TabLabel: PolymorphicForwardRefComponent<"span", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "as"> & { as?: "span" | undefined; }>; /** NOT IMPLEMENTED. */ TabDescription: PolymorphicForwardRefComponent<"span", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "as"> & { as?: "span" | undefined; }>; /** NOT IMPLEMENTED. */ Actions: PolymorphicForwardRefComponent<"div", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "as" | "wrapperProps"> & { wrapperProps?: React.ComponentPropsWithRef<"div">; } & { as?: "div" | undefined; }>; Panel: PolymorphicForwardRefComponent<"div", PanelProps>; }; export { LegacyTab as Tab, Tabs };