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

var jsxRuntime = require('preact/jsx-runtime');
var useTooltip = require('./useTooltip-cf4a15f3.js');
require('preact/hooks');
require('./logger-2b636482.js');
require('./LayerHost-8ec73638.js');
require('preact/compat');
var classNames = require('./classNames-c14c6ef3.js');


require('./hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css.js');
require('./tooltipUtils-d461919d.js');
var useTranslationBundle = require('./useTranslationBundle-38c0edae.js');
var CompactHelpSource = require('./CompactHelpSource-e8f7d4ab.js');
var UNSAFE_UserAssistance_themes_UserAssistanceStyles_css = require('./UNSAFE_UserAssistance/themes/UserAssistanceStyles.css.js');

const CompactLabelAssistance = ({ helpIconId, helpSourceLink, helpSourceText, isRequiredShown, labelEdge }) => {
    const translations = useTranslationBundle.useTranslationBundle('@oracle/oraclejet-preact');
    const requiredStr = translations.userAssistance_required();
    const { tooltipContent, tooltipProps } = useTooltip.useTooltip({
        text: requiredStr,
        offset: { mainAxis: 8 }
    });
    const requiredStyles = classNames.classNames([
        UNSAFE_UserAssistance_themes_UserAssistanceStyles_css.requiredIconBase,
        labelEdge === 'start' && UNSAFE_UserAssistance_themes_UserAssistanceStyles_css.requiredIconLabelEdgeStart
    ]);
    const requiredIndicator = isRequiredShown && (jsxRuntime.jsxs("span", { children: [jsxRuntime.jsx("span", { class: requiredStyles, ...tooltipProps }), tooltipContent] }));
    const helpIndicator = (helpSourceLink || helpSourceText) && (jsxRuntime.jsx(CompactHelpSource.CompactHelpSource, { id: helpIconId, labelEdge: labelEdge, source: helpSourceLink, children: helpSourceText }));
    return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [labelEdge !== 'start' && requiredIndicator, helpIndicator, labelEdge === 'start' && requiredIndicator] }));
};

exports.CompactLabelAssistance = CompactLabelAssistance;
//# sourceMappingURL=CompactLabelAssistance-2d1e9b41.js.map
