UNPKG

@audira/carbon-react-native

Version:

Build React Native apps with component and shared patterns using Carbon

41 lines (40 loc) 1.13 kB
"use strict"; import { useContext } from 'react'; import { StyleSheet } from 'react-native'; import { Spacing } from '@audira/carbon-react-native-elements'; import { ThemeProvider } from "../../../_internal/providers/theme/index.js"; import { Ghost } from "../../button/ghost/index.js"; import { VariantContext } from "../_variant-context.js"; import { jsx as _jsx } from "react/jsx-runtime"; export function ButtonGhost({ size = 'small', style, ...props }) { const variantContext = useContext(VariantContext); return ( /*#__PURE__*/ /** * I don't know, is this a bad idea to nest the provider? */ _jsx(ThemeProvider, { colorScheme: mapColorScheme[variantContext.color], children: /*#__PURE__*/_jsx(Ghost, { ...props, size: size, style: [baseStyle.buttonGhost, style] }) }) ); } const baseStyle = StyleSheet.create({ buttonGhost: { marginTop: Spacing.spacing_03, paddingRight: Spacing.spacing_05 } }), mapColorScheme = { low_contrast: 'gray_10', high_contrast: 'gray_100' }; //# sourceMappingURL=_ButtonGhost.js.map