@audira/carbon-react-native
Version:
Build React Native apps with component and shared patterns using Carbon
45 lines (44 loc) • 1.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ButtonTertiary = ButtonTertiary;
var _react = require("react");
var _reactNative = require("react-native");
var _carbonReactNativeElements = require("@audira/carbon-react-native-elements");
var _index = require("../../../_internal/providers/theme/index.js");
var _index2 = require("../../button/tertiary/index.js");
var _variantContext = require("../_variant-context.js");
var _jsxRuntime = require("react/jsx-runtime");
function ButtonTertiary({
size = 'small',
style,
...props
}) {
const variantContext = (0, _react.useContext)(_variantContext.VariantContext);
return (
/*#__PURE__*/
/**
* I don't know, is this a bad idea to nest the provider?
*/
(0, _jsxRuntime.jsx)(_index.ThemeProvider, {
colorScheme: mapColorScheme[variantContext.color],
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Tertiary, {
...props,
size: size,
style: [baseStyle.buttonTertiary, style]
})
})
);
}
const baseStyle = _reactNative.StyleSheet.create({
buttonTertiary: {
marginTop: _carbonReactNativeElements.Spacing.spacing_06,
paddingRight: _carbonReactNativeElements.Spacing.spacing_05
}
}),
mapColorScheme = {
low_contrast: 'gray_10',
high_contrast: 'gray_100'
};
//# sourceMappingURL=_ButtonTertiary.js.map