UNPKG

react-native-ios-utilities

Version:

Utilities for react-native + iOS and wrappers for using swift together with fabric/paper + JSI

89 lines (88 loc) 2.54 kB
"use strict"; import * as React from 'react'; import { StyleSheet, View, Text, TouchableOpacity } from 'react-native'; import { Colors } from "../misc/Colors.js"; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export function CardRowStepper(props) { return /*#__PURE__*/_jsxs(View, { style: styles.cardRowStepperContainer, children: [/*#__PURE__*/_jsxs(View, { style: styles.cardRowStepperLabelContainer, children: [/*#__PURE__*/_jsx(Text, { style: styles.cardRowStepperLabelText, children: props.title ?? 'Title' }), /*#__PURE__*/_jsx(Text, { style: styles.cardRowStepperSubtitleText, children: props.subtitle ?? `Current value: ${props.value ?? 0}` })] }), /*#__PURE__*/_jsxs(View, { style: styles.cardRowStepperButtonsContainer, children: [/*#__PURE__*/_jsx(TouchableOpacity, { style: [styles.cardRowStepperButton, styles.cardRowStepperButtonLeft], onPress: () => { props.onValueChange(props.value - props.stepperAmount); }, children: /*#__PURE__*/_jsx(Text, { style: styles.cardRowStepperButtonLabel, children: '–' }) }), /*#__PURE__*/_jsx(TouchableOpacity, { style: [styles.cardRowStepperButton, styles.cardRowStepperButtonRight], onPress: () => { props.onValueChange(props.value + props.stepperAmount); }, children: /*#__PURE__*/_jsx(Text, { style: styles.cardRowStepperButtonLabel, children: '+' }) })] })] }); } ; const styles = StyleSheet.create({ cardRowStepperContainer: { flexDirection: 'row', alignItems: 'center', marginTop: 12 }, cardRowStepperLabelContainer: { flex: 1 }, cardRowStepperLabelText: { fontSize: 12, fontWeight: '500', color: Colors.PURPLE[1200] }, cardRowStepperSubtitleText: { flex: 1, fontSize: 12, opacity: 0.5, color: Colors.PURPLE[1100] }, cardRowStepperButtonsContainer: { flexDirection: 'row', overflow: 'hidden', borderRadius: 10 }, cardRowStepperButton: { padding: 10, backgroundColor: Colors.PURPLE.A200, width: 45, alignItems: 'center', justifyContent: 'center' }, cardRowStepperButtonLeft: { marginRight: 0.5 }, cardRowStepperButtonRight: { marginLeft: 0.5 }, cardRowStepperButtonLabel: { fontWeight: '500', color: 'white', opacity: 0.9, fontSize: 16 } }); //# sourceMappingURL=CardRowStepper.js.map