/* @oracle/oraclejet-preact: undefined */
import { jsxs, Fragment, jsx } from 'preact/jsx-runtime';
import { H as HiddenAccessible } from './HiddenAccessible-61197e7c.js';
import { L as LiveRegion } from './LiveRegion-cebac18d.js';
import 'preact/hooks';
import './LayerHost-7931b424.js';
import { forwardRef } from 'preact/compat';
import './UNSAFE_Text/themes/TextStyles.css.js';
import './Flex-03129963.js';
import { T as TabBarContext, a as TabBarLayout } from './TabBarLayout-9b67d1b6.js';
import './flexitem-7b7f7920.js';
import './dimensions-e4fbc23d.js';
import './boxalignment-8980856d.js';
import './logger-c92f309c.js';
import './TabBarItemStyles.styles.css';
import './UNSAFE_TabBarCommon/themes/redwood/TabBarItemBaseTheme.styles.css';
import './UNSAFE_TabBarCommon/themes/redwood/TabBarItemVariants.css.js';
import './BadgeStyles.styles.css';
import './UNSAFE_Badge/themes/redwood/BadgeThemeBaseTheme.styles.css';
import './UNSAFE_Badge/themes/redwood/BadgeVariants.css.js';
import './ConveyorBeltContext-76a29c59.js';
import './BusyStateContext-9ee9751d.js';
import './TabbableModeContext-7d8ad946.js';
import 'preact';
import './TooltipContentStyles.styles.css';
import './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentBaseTheme.styles.css';
import './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css.js';
import './tooltipUtils-af0abd38.js';
import './IconStyle.styles.css';
import './BaseButton-41068c85.js';
import './ButtonLabelLayout-1631c997.js';
import './Floating-4a82db94.js';
import './LayerStyles.styles.css';
import './keyboardUtils-986fe923.js';
import './tabbableUtils-c8311ec6.js';
import './CollectionInteractionContext-7cf19abc.js';
import './dropdownStyles.styles.css';
import './Sheet-f9f8a4a4.js';
import './OverflowTabBarItemStyles.styles.css';
import './StyledCheckbox-d6c8f557.js';
import './SelectorStyles.styles.css';
import { styles } from './UNSAFE_TabBar/themes/TabBarStyles.css.js';
import { u as useTabBar } from './useTabBar-c5558e77.js';
import { T as TabBarContextMenu } from './TabBarContextMenu-c3326d67.js';

/**
 * A tab bar allows navigation between different content sections.
 */
const TabBar = forwardRef(({ children, layout = 'stretch', display = 'standard', size = 'md', edge = 'top', selection, onSelect, onRemove, 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, contextMenuConfig }, ref) => {
    const rootRef = ref;
    const { rootProps, tabBarContext, menuProps, contextMenuContext, contextMenuDescription, contextMenuDescriptionId, accStatusInfo } = useTabBar({
        class: styles.tabBarBase,
        edge: edge,
        onRemove,
        onSelect,
        ref: rootRef,
        selection,
        size,
        children,
        contextMenuConfig
    });
    const isContextMenuAvailable = contextMenuConfig != null;
    return (jsxs(Fragment, { children: [jsx(TabBarContext.Provider, { value: tabBarContext, children: jsx("div", { ...rootProps, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-haspopup": contextMenuConfig != null ? true : false, "aria-describedby": isContextMenuAvailable && contextMenuDescriptionId
                        ? ariaDescribedBy
                            ? `${ariaDescribedBy} ${contextMenuDescriptionId}`
                            : contextMenuDescriptionId
                        : ariaDescribedBy, children: jsx(TabBarLayout, { layout: layout, display: display, children: children }) }) }), isContextMenuAvailable && contextMenuDescriptionId && (jsx("span", { id: contextMenuDescriptionId, children: jsx(HiddenAccessible, { children: contextMenuDescription }) })), isContextMenuAvailable && accStatusInfo && jsx(LiveRegion, { children: accStatusInfo }), isContextMenuAvailable && (jsx(TabBarContextMenu, { ...menuProps, contextMenuConfig: contextMenuConfig, contextMenuContext: contextMenuContext }))] }));
});

export { TabBar as T };
//# sourceMappingURL=TabBar-67ca442c.js.map
