UNPKG

@audira/carbon-react-native

Version:

Build React Native apps with component and shared patterns using Carbon

45 lines (44 loc) 1.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ButtonGhost = ButtonGhost; 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/ghost/index.js"); var _variantContext = require("../_variant-context.js"); var _jsxRuntime = require("react/jsx-runtime"); function ButtonGhost({ 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.Ghost, { ...props, size: size, style: [baseStyle.buttonGhost, style] }) }) ); } const baseStyle = _reactNative.StyleSheet.create({ buttonGhost: { marginTop: _carbonReactNativeElements.Spacing.spacing_03, paddingRight: _carbonReactNativeElements.Spacing.spacing_05 } }), mapColorScheme = { low_contrast: 'gray_10', high_contrast: 'gray_100' }; //# sourceMappingURL=_ButtonGhost.js.map