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

var useDetectTruncation = require('./useDetectTruncation-e6304b0a.js');
var useTooltip = require('./useTooltip-cf4a15f3.js');
require('preact/jsx-runtime');
require('preact/hooks');
var mergeProps = require('./mergeProps-e3da7237.js');
require('./logger-2b636482.js');
require('./LayerHost-8ec73638.js');
require('preact/compat');


require('./hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css.js');
require('./tooltipUtils-d461919d.js');

const useTooltipOnTruncation = (tooltipText, isDisabled = false) => {
    const { detectTruncationProps, isTextTruncated } = useDetectTruncation.useDetectTruncation(isDisabled);
    const { tooltipContent, tooltipProps } = useTooltip.useTooltip({
        text: tooltipText,
        isDisabled: !isTextTruncated || isDisabled
    });
    const { 'aria-describedby': notNeeded, ...validTooltipProps } = tooltipProps; //remove aria-describedby to prevent screen readers from reading the same text multiple times
    const tooltipOnTruncationProps = mergeProps.mergeProps(detectTruncationProps, validTooltipProps);
    return { tooltipOnTruncationProps, tooltipContent, isTextTruncated };
};

exports.useTooltipOnTruncation = useTooltipOnTruncation;
//# sourceMappingURL=useTooltipOnTruncation-cea31e18.js.map
