stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
93 lines • 3.61 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useButtonStyles = void 0;
var _react = require("react");
var _ThemeContext = require("../../../../contexts/themeContext/ThemeContext");
var useButtonStyles = ({
variant,
type
}) => {
var _useTheme = (0, _ThemeContext.useTheme)(),
semantics = _useTheme.theme.semantics;
var category = variant.concat(type[0].toUpperCase() + type.slice(1));
var defaultButtonStyles = (0, _react.useMemo)(() => {
return {
primarySolid: {
foregroundColor: semantics.buttonPrimaryTextOnAccent,
backgroundColor: semantics.buttonPrimaryBg,
borderColor: undefined,
disabledForegroundColor: semantics.textDisabled,
disabledBackgroundColor: semantics.backgroundUtilityDisabled,
disabledBorderColor: undefined
},
primaryOutline: {
foregroundColor: semantics.buttonPrimaryText,
backgroundColor: undefined,
borderColor: semantics.buttonPrimaryBorder,
disabledForegroundColor: semantics.textDisabled,
disabledBackgroundColor: undefined,
disabledBorderColor: semantics.borderUtilityDisabled
},
primaryGhost: {
foregroundColor: semantics.buttonPrimaryText,
backgroundColor: undefined,
borderColor: undefined,
disabledForegroundColor: semantics.textDisabled,
disabledBackgroundColor: undefined,
disabledBorderColor: undefined
},
secondarySolid: {
foregroundColor: semantics.buttonSecondaryTextOnAccent,
backgroundColor: semantics.buttonSecondaryBg,
borderColor: undefined,
disabledForegroundColor: semantics.textDisabled,
disabledBackgroundColor: semantics.backgroundUtilityDisabled,
disabledBorderColor: undefined
},
secondaryOutline: {
foregroundColor: semantics.buttonSecondaryText,
backgroundColor: undefined,
borderColor: semantics.buttonSecondaryBorder,
disabledForegroundColor: semantics.textDisabled,
disabledBackgroundColor: undefined,
disabledBorderColor: semantics.borderUtilityDisabled
},
secondaryGhost: {
foregroundColor: semantics.buttonSecondaryText,
backgroundColor: undefined,
borderColor: undefined,
disabledForegroundColor: semantics.textDisabled,
disabledBackgroundColor: undefined,
disabledBorderColor: undefined
},
destructiveSolid: {
foregroundColor: semantics.buttonDestructiveTextOnAccent,
backgroundColor: semantics.buttonDestructiveBg,
borderColor: undefined,
disabledForegroundColor: semantics.textDisabled,
disabledBackgroundColor: semantics.backgroundUtilityDisabled,
disabledBorderColor: undefined
},
destructiveOutline: {
foregroundColor: semantics.buttonDestructiveText,
backgroundColor: undefined,
borderColor: semantics.buttonDestructiveBorder,
disabledForegroundColor: semantics.textDisabled,
disabledBackgroundColor: undefined,
disabledBorderColor: semantics.borderUtilityDisabled
},
destructiveGhost: {
foregroundColor: semantics.buttonDestructiveText,
backgroundColor: undefined,
borderColor: undefined,
disabledForegroundColor: semantics.textDisabled,
disabledBackgroundColor: undefined,
disabledBorderColor: undefined
}
};
}, [semantics]);
return defaultButtonStyles[category];
};
exports.useButtonStyles = useButtonStyles;
//# sourceMappingURL=useButtonStyles.js.map