import type { AlignmentType, GlobalProps, InitializedState, OrientationProps, WidthType } from '../../shared/model.js'; import type { DBTabItemProps } from '../tab-item/model.js'; import type { DBTabPanelProps } from '../tab-panel/model.js'; export type TabItemAlignmentType = AlignmentType; export type TabItemAlignmentProps = { /** * Define the tab-item alignment in full width */ tabItemAlignment?: TabItemAlignmentType | string; }; export declare const TabsBehaviorList: readonly ["scrollbar", "arrows"]; export type TabsBehaviorType = (typeof TabsBehaviorList)[number]; export declare const TabsInitialSelectedModeList: readonly ["auto", "manually"]; export type TabsInitialSelectedModeType = (typeof TabsInitialSelectedModeList)[number]; export type DBSimpleTabProps = DBTabItemProps & DBTabPanelProps & { /** * Accessible label for icon-only tabs (rendered as aria-label on the tab button). */ ariaLabel?: string; }; export type DBTabsDefaultProps = { /** * Change amount of distance if you click on an arrow, only available with behavior="arrows" */ arrowScrollDistance?: number | string; /** * Show a scrollbar or buttons with arrows to navigate for horizontal tabs with overflow visible */ behavior?: TabsBehaviorType; /** * Default behavior is auto selecting the first tab, change selected tab by index */ initialSelectedIndex?: number | string; /** * Controlled active tab index. When set, the component becomes controlled: * the consumer is responsible for updating this value in the onIndexChange handler. * Takes precedence over initialSelectedIndex after mount. */ activeIndex?: number | string; /** * Default behavior is auto selecting the first tab, disable it with 'manually' */ initialSelectedMode?: TabsInitialSelectedModeType; /** * Accessible label for the tab bar (used as aria-label on the tablist). */ label?: string; /** * Provide simple tabs with label + text as content */ tabs?: DBSimpleTabProps[] | string; /** * Width of the tab-items. Auto width based on tab-item size, full width based on parent elements width. */ tabItemWidth?: WidthType | string; /** * Accessible label for the "scroll towards start" button (i18n). Only used with behavior="arrows". */ scrollStartLabel?: string; /** * Accessible label for the "scroll towards end" button (i18n). Only used with behavior="arrows". */ scrollEndLabel?: string; }; export type DBTabsEventProps = { /** * Informs the user if the current tab index has changed. */ indexChange?: (index: number) => void; /** * Informs the user if the current tab index has changed. */ onIndexChange?: (index: number) => void; /** * Fires when the active tab changes and a `value` prop is set on the tab items. * Payload is the `value` string of the newly active tab item, or undefined * if the tab item has no `value` prop set. * Use this for form binding (e.g. Angular FormControl, React controlled state). */ valueChange?: (value?: string) => void; /** * Fires when the active tab changes and a `value` prop is set on the tab items. * Payload is the `value` string of the newly active tab item, or undefined * if the tab item has no `value` prop set. * Use this for form binding (e.g. Angular FormControl, React controlled state). */ onValueChange?: (value?: string) => void; }; export type DBTabsProps = DBTabsDefaultProps & GlobalProps & OrientationProps & TabItemAlignmentProps & DBTabsEventProps; export type DBTabsDefaultState = { _id?: string; _appliedLabel?: string; resetIds: () => void; _getScrollContainer: () => Element | null; scroll: (toStart?: boolean) => void; showScrollStart?: boolean; showScrollEnd?: boolean; _isRtl: () => boolean; evaluateScrollButtons: (tabList: Element) => void; getTabs: () => DBSimpleTabProps[]; getInitialIndex: () => number; getRenderIndex: () => number; getRenderFocusIndex: () => number; getActiveChildIndex: () => number; shouldUseActiveChild: (hashApplied: boolean) => boolean; moveRovingTabindex: (focusIndex: number) => void; _isOwnedPanel: (panel: HTMLElement) => boolean; initTabList: () => void; _teardownScrollHandlers: () => void; _resolveHashIndex: () => { startIndex: number; hashApplied: boolean; }; _setupObserver: () => void; initTabs: () => void; syncSelection: (activeIndex?: number) => void; _tabButtons: HTMLElement[]; _tabPanels: HTMLElement[]; _resizeObserver?: ResizeObserver | null; _observer?: MutationObserver | null; _pendingRafId: number | null; _scrollListener: { fn: () => void; } | null; _focusgroupSupported: boolean; _activeIndex: number; activateTab: (index: number) => void; getTabId: (index: number | string) => string | undefined; getPanelId: (index: number | string) => string | undefined; getBaseId: () => string | undefined; handleClick: (event: any) => void; handleKeyDown: (event: any) => void; }; export type DBTabsState = DBTabsDefaultState & InitializedState;