/* @oracle/oraclejet-preact: undefined */
import { jsx, Fragment, jsxs } from 'preact/jsx-runtime';
import 'preact/hooks';
import './LayerHost-e6402730.js';
import { forwardRef } from 'preact/compat';
import './UNSAFE_Text/themes/TextStyles.css.js';
import './Flex-ce31b351.js';
import { T as TabBarContext } from './useTabBarContext-0071d2a7.js';
import './flexitem-7b7f7920.js';
import './dimensions-d4159ace.js';
import './boxalignment-a90bc50d.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 './ConveyorBeltContext-76a29c59.js';
import './VisBusyStateContext-9ae84b1d.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-768450a7.js';
import './IconStyle.styles.css';
import './NavigationList-fb05e081.js';
import './useNavigationListItem-a28f2c34.js';
import './UNSAFE_NavigationList/themes/NavigationListItemStyles.css.js';
import './UNSAFE_NavigationList/themes/redwood/NavigationListItemBaseTheme.styles.css';
import './UNSAFE_NavigationList/themes/redwood/NavigationListItemVariants.css.js';
import './Floating-f02677ba.js';
import './LayerStyles.styles.css';
import './keyboardUtils-38854729.js';
import './tabbableUtils-6ceb767f.js';
import './CollectionInteractionContext-7cf19abc.js';
import './dropdownStyles.styles.css';
import './Sheet-da412baf.js';
import './OverflowTabBarItemStyles.styles.css';
import { T as TabBarLayout } from './TabBarLayout-bb3f9f69.js';
import { styles } from './UNSAFE_TabBar/themes/TabBarStyles.css.js';
import { u as useTabBar } from './useTabBar-cbac0c2e.js';
import { M as Menu } from './Menu-a5bf756f.js';
import './MenuItem-54015ca3.js';
import './SelectMenuGroupContext-b56cf5d4.js';
import './UNSAFE_Separator/themes/SeparatorStyles.css.js';
import './MenuSeparatorStyles.styles.css';
import './UNSAFE_Menu/themes/redwood/MenuSeparatorBaseTheme.styles.css';
import './UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css.js';

/**
 * The internal component used to render a custom context menu
 */
function TabBarContextMenu({ contextMenuConfig, contextMenuContext, ...menuProps }) {
    const accessibleLabel = contextMenuConfig.accessibleLabel;
    const menuItems = contextMenuConfig.itemsRenderer(contextMenuContext);
    if (menuItems == null) {
        return null;
    }
    return (jsx(Fragment, { children: jsx(Menu, { ...menuProps, ...(accessibleLabel && {
                'aria-label': accessibleLabel
            }), children: menuProps.isOpen && contextMenuConfig.itemsRenderer(contextMenuContext) }) }));
}

/**
 * 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 } = useTabBar({
        class: styles.tabBarBase,
        edge: edge,
        onRemove,
        onSelect,
        ref: rootRef,
        selection,
        size,
        children,
        contextMenuConfig
    });
    return (jsxs(Fragment, { children: [jsx(TabBarContext.Provider, { value: tabBarContext, children: jsx("div", { ...rootProps, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedBy, children: jsx(TabBarLayout, { layout: layout, display: display, children: children }) }) }), contextMenuConfig && (jsx(TabBarContextMenu, { ...menuProps, contextMenuConfig: contextMenuConfig, contextMenuContext: contextMenuContext }))] }));
});

export { TabBar as T };
//# sourceMappingURL=TabBar-4d7054f7.js.map
