/* @oracle/oraclejet-preact: undefined */
import { jsxs, jsx, Fragment } from 'preact/jsx-runtime';
import { u as useTooltip } from './useTooltip-89ca3f3e.js';
import 'preact/hooks';
import './logger-c92f309c.js';
import './LayerHost-e6402730.js';
import 'preact/compat';
import { c as classNames } from './classNames-4e12b00d.js';
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 { u as useTranslationBundle } from './useTranslationBundle-09302c20.js';
import { C as CompactHelpSource } from './CompactHelpSource-c3044924.js';
import { requiredIconBase, requiredIconLabelEdgeStart } from './UNSAFE_UserAssistance/themes/UserAssistanceStyles.css.js';

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

export { CompactLabelAssistance as C };
//# sourceMappingURL=CompactLabelAssistance-fd3fb481.js.map
