@nexara/nativeflow
Version:
Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.
73 lines (72 loc) • 1.22 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getChipColors = void 0;
const getBorderColor = ({
theme,
strokeColor,
disabled
}) => {
if (disabled) {
return theme.colors.disable;
}
if (strokeColor) {
return strokeColor;
}
return theme.colors.outline;
};
const getTextColor = ({
theme,
titleColor,
disabled
}) => {
if (disabled) {
return theme.colors.textDisable;
} else if (titleColor) {
return titleColor;
}
return theme.colors.textTertiary;
};
const getBgColor = ({
theme,
bg,
disabled
}) => {
if (disabled) {
return theme.colors.disable;
} else if (bg) {
return bg;
}
return theme.colors.chipBgColor;
};
const getChipColors = ({
theme,
bg,
titleColor,
strokeColor,
disabled
}) => {
const backgroundColor = getBgColor({
theme,
bg,
disabled
});
const buttonTextColor = getTextColor({
theme,
titleColor,
disabled
});
const buttonBorderColor = getBorderColor({
theme,
strokeColor,
disabled
});
return {
backgroundColor,
buttonTextColor,
buttonBorderColor
};
};
exports.getChipColors = getChipColors;
//# sourceMappingURL=utils.js.map
;