@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
15 lines • 451 B
JavaScript
// build descriptive id for aria-describedby or aria-labelledby
export const getAriaDescriptorsBy = ({ title, content, titleId, contentId, }) => {
const descriptorsId = [];
if (title) {
descriptorsId.push(titleId);
}
if (content) {
descriptorsId.push(contentId);
}
if (descriptorsId.length === 0) {
return undefined;
}
return descriptorsId.join(' ');
};
//# sourceMappingURL=tooltip.utils.js.map