@chakra-ui/react
Version:
Responsive and accessible React UI components built with React and Emotion
19 lines (17 loc) • 683 B
JavaScript
;
function getElementTypeDisplayName(Component) {
if (typeof Component === "string") return void 0;
return Component.displayName || Component.name;
}
function upperFirst(str) {
if (!str) return str;
return str.charAt(0).toUpperCase() + str.slice(1);
}
function inferSlotRecipeComponentDisplayName(contextName, slot) {
return contextName + upperFirst(slot);
}
function inferRootProviderDisplayName(contextName, innerDisplayNameOrName) {
if (!innerDisplayNameOrName) return void 0;
return contextName + upperFirst(innerDisplayNameOrName);
}
export { getElementTypeDisplayName, inferRootProviderDisplayName, inferSlotRecipeComponentDisplayName, upperFirst };