/* @oracle/oraclejet-preact: undefined */
'use strict';

var jsxRuntime = require('preact/jsx-runtime');
var useComponentTheme = require('./useComponentTheme-082fc8e4.js');
var UNSAFE_Badge_themes_redwood_BadgeTheme = require('./UNSAFE_Badge/themes/redwood/BadgeTheme.js');
var useTooltipOnTruncation = require('./useTooltipOnTruncation-cea31e18.js');
require('./TabbableModeContext-e99d527e.js');
var useTabbableMode = require('./useTabbableMode-5c8fd9e5.js');

function TruncatingBadge({ variant, size, edge, children }) {
    const { classes } = useComponentTheme.useComponentTheme(UNSAFE_Badge_themes_redwood_BadgeTheme.BadgeRedwoodTheme, {
        variant,
        size,
        edge
    });
    const { isTabbable } = useTabbableMode.useTabbableMode();
    const { tooltipOnTruncationProps, tooltipContent, isTextTruncated } = useTooltipOnTruncation.useTooltipOnTruncation(children);
    return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { ...tooltipOnTruncationProps, tabIndex: isTextTruncated && isTabbable ? 0 : -1, class: classes, children: children }), tooltipContent] }));
}

exports.TruncatingBadge = TruncatingBadge;
//# sourceMappingURL=TruncatingBadge-9c25bfc6.js.map
