diff --git a/packages/components/src/font-size-picker/index.native.js b/packages/components/src/font-size-picker/index.native.js index 2be833c450a82a..1da82363c47896 100644 --- a/packages/components/src/font-size-picker/index.native.js +++ b/packages/components/src/font-size-picker/index.native.js @@ -84,10 +84,12 @@ function FontSizePicker( { showSheet={ showSubSheet } > <> - + + + + { label } + + <> - + + + + { label } + + { items.map( ( item, index ) => ( <> - + + + + { label } + + ( + + + {} } /> + A Sheet Title + {} } /> + + +); +``` + +## BottomSheet.NavBar + +Provides structural styles for left-center-right layout for header UI. + +## BottomSheet.NavBar.Title + +Displays a styled title for a bottom sheet. + +## BottomSheet.NavBar.ApplyButton + +Displays a styled button to apply settings of bottom sheet controls. + +### Props + +#### onPress + +Callback invoked once the button is pressed. + +## BottomSheet.NavBar.BackButton + +Displays a styled button to navigate backwards from a bottom sheet. + +### Props + +#### onPress + +Callback invoked once the button is pressed. + +## BottomSheet.NavBar.DismissButton + +Displays a styled button to dismiss a full screen bottom sheet. + +### Props + +#### onPress + +Callback invoked once the button is pressed. + +#### iosText + +Used to display iOS text if different from "Cancel". \ No newline at end of file diff --git a/packages/components/src/mobile/bottom-sheet/nav-bar/action-button.native.js b/packages/components/src/mobile/bottom-sheet/nav-bar/action-button.native.js new file mode 100644 index 00000000000000..6b11f30959fe5d --- /dev/null +++ b/packages/components/src/mobile/bottom-sheet/nav-bar/action-button.native.js @@ -0,0 +1,30 @@ +/** + * External dependencies + */ +import { View, TouchableWithoutFeedback } from 'react-native'; + +/** + * Internal dependencies + */ +import styles from './styles.scss'; + +// Action button component is used by both Back and Apply Button componenets. +function ActionButton( { + onPress, + accessibilityLabel, + accessibilityHint, + children, +} ) { + return ( + + { children } + + ); +} + +export default ActionButton; diff --git a/packages/components/src/mobile/bottom-sheet/nav-bar/apply-button.native.js b/packages/components/src/mobile/bottom-sheet/nav-bar/apply-button.native.js new file mode 100644 index 00000000000000..a5362f1a67a098 --- /dev/null +++ b/packages/components/src/mobile/bottom-sheet/nav-bar/apply-button.native.js @@ -0,0 +1,53 @@ +/** + * External dependencies + */ +import { View, Text, Platform } from 'react-native'; + +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; +import { Icon, check } from '@wordpress/icons'; +import { usePreferredColorSchemeStyle } from '@wordpress/compose'; + +/** + * Internal dependencies + */ +import styles from './styles.scss'; +import ActionButton from './action-button'; + +function ApplyButton( { onPress } ) { + const buttonTextStyle = usePreferredColorSchemeStyle( + styles[ 'button-text' ], + styles[ 'button-text-dark' ] + ); + + const applyButtonStyle = usePreferredColorSchemeStyle( + styles[ 'apply-button-icon' ], + styles[ 'apply-button-icon-dark' ] + ); + + return ( + + + { Platform.OS === 'ios' ? ( + + { __( 'Apply' ) } + + ) : ( + + ) } + + + ); +} + +export default ApplyButton; diff --git a/packages/components/src/mobile/bottom-sheet/nav-bar/back-button.native.js b/packages/components/src/mobile/bottom-sheet/nav-bar/back-button.native.js new file mode 100644 index 00000000000000..859eba98b9604a --- /dev/null +++ b/packages/components/src/mobile/bottom-sheet/nav-bar/back-button.native.js @@ -0,0 +1,94 @@ +/** + * External dependencies + */ +import { View, Platform, Text } from 'react-native'; + +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; +import { Icon, arrowLeft, close } from '@wordpress/icons'; +import { usePreferredColorSchemeStyle } from '@wordpress/compose'; + +/** + * Internal dependencies + */ +import styles from './styles.scss'; +import ActionButton from './action-button'; +import chevronBack from './../chevron-back'; + +function Button( { onPress, icon, text } ) { + const buttonTextStyle = usePreferredColorSchemeStyle( + styles[ 'button-text' ], + styles[ 'button-text-dark' ] + ); + + return ( + + + { icon } + { text && ( + + { text } + + ) } + + + ); +} + +function BackButton( { onPress } ) { + const chevronLeftStyle = usePreferredColorSchemeStyle( + styles[ 'chevron-left-icon' ], + styles[ 'chevron-left-icon-dark' ] + ); + const arrowLeftStyle = usePreferredColorSchemeStyle( + styles[ 'arrow-left-icon' ], + styles[ 'arrow-right-icon-dark' ] + ); + + let backIcon; + let backText; + + if ( Platform.OS === 'ios' ) { + backIcon = ( + + ); + backText = __( 'Back' ); + } else { + backIcon = ( + + ); + } + + return