UNPKG

@audira/carbon-react-native

Version:

Build React Native apps with component and shared patterns using Carbon

41 lines (40 loc) 1.15 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 { Tertiary } from "../../button/tertiary/index.js"; import { VariantContext } from "../_variant-context.js"; import { jsx as _jsx } from "react/jsx-runtime"; export function ButtonTertiary({ 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(Tertiary, { ...props, size: size, style: [baseStyle.buttonTertiary, style] }) }) ); } const baseStyle = StyleSheet.create({ buttonTertiary: { marginTop: Spacing.spacing_06, paddingRight: Spacing.spacing_05 } }), mapColorScheme = { low_contrast: 'gray_10', high_contrast: 'gray_100' }; //# sourceMappingURL=_ButtonTertiary.js.map