import { ViewTemplate, html, when } from '@ni/fast-element';
import { iconAsteriskTag } from '../../icons/asterisk';
/**
 * Given the template for a control label, creates a new template that includes
 * an icon next to the label to indicate whether or not the control is required.
 *
 * This function is intended to be used with components leveraging `mixinRequiredVisiblePattern`.
 */
export function createRequiredVisibleLabelTemplate(labelTemplate) {
    return html `
        <div class="annotated-label">
            ${labelTemplate}
            ${when(x => x.requiredVisible, html `
                <${iconAsteriskTag} class="required-icon" severity="error"></${iconAsteriskTag}>
            `)}
        </div>
    `;
}
//# sourceMappingURL=template.js.map