UNPKG

@brijen/react-native-multistep

Version:

A lightweight multi-step view component for React Native with smooth transitions using Reanimated.

58 lines (56 loc) 1.47 kB
"use strict"; import { Text, StyleSheet, TouchableOpacity } from 'react-native'; import { jsx as _jsx } from "react/jsx-runtime"; /** * @internal * A reusable button component used internally within the library. * Supports `primary` (solid) and `secondary` (outline) variants. * * - `primary`: A solid button with a background color. * - `secondary`: An outline button with a border and transparent background. * * @example * ```tsx * <Button title="Next" varient="primary" tintColor="#007AFF" /> * <Button title="Back" varient="secondary" tintColor="#007AFF" /> * ``` */ const Button = props => { const { title, variant, tintColor, style, textStyle, ...rest } = props; return /*#__PURE__*/_jsx(TouchableOpacity, { testID: "button-container", style: [styles.container, { backgroundColor: variant === 'primary' ? tintColor : 'white', borderWidth: variant === 'secondary' ? 1 : 0, borderColor: tintColor }, style], ...rest, children: /*#__PURE__*/_jsx(Text, { style: [styles.buttonText, { color: variant === 'primary' ? 'white' : tintColor }, textStyle], children: title }) }); }; export default Button; const styles = StyleSheet.create({ container: { borderRadius: 20, paddingVertical: 10, width: 150, alignItems: 'center', justifyContent: 'center' }, buttonText: { fontWeight: '500' } }); //# sourceMappingURL=Button.js.map