diff --git a/docs/components/Text.md b/docs/components/Text.md index 4ada8a1c..e542385c 100644 --- a/docs/components/Text.md +++ b/docs/components/Text.md @@ -55,7 +55,6 @@ This function is called on press. + `backgroundColor` + `color` -+ `direction` + `fontFamily` + `fontSize` + `fontStyle` @@ -69,6 +68,7 @@ This function is called on press. + `textTransform` + `whiteSpace` + `wordWrap` ++ `writingDirection` **testID**: string @@ -102,16 +102,16 @@ class PrettyText extends Component { ...other style={{ ...style, - ...localStyle.color[color], - ...localStyle.size[size], - ...localStyle.weight[weight] + ...styles.color[color], + ...styles.size[size], + ...styles.weight[weight] }} /> ); } } -const localStyle = StyleSheet.create({ +const styles = StyleSheet.create({ color: { white: { color: 'white' }, gray: { color: 'gray' }, diff --git a/src/components/Text/TextStylePropTypes.js b/src/components/Text/TextStylePropTypes.js index 671073cc..0cdd23b1 100644 --- a/src/components/Text/TextStylePropTypes.js +++ b/src/components/Text/TextStylePropTypes.js @@ -5,10 +5,9 @@ export default { ...pickProps(CoreComponent.stylePropTypes, [ 'backgroundColor', 'color', - 'direction', - 'font', 'fontFamily', 'fontSize', + 'fontStyle', 'fontWeight', 'letterSpacing', 'lineHeight', @@ -30,6 +29,7 @@ export default { 'textDecoration', 'textTransform', 'whiteSpace', - 'wordWrap' + 'wordWrap', + 'writingDirection' ]) } diff --git a/src/modules/StylePropTypes/index.js b/src/modules/StylePropTypes/index.js index 1c196bc7..3203d80e 100644 --- a/src/modules/StylePropTypes/index.js +++ b/src/modules/StylePropTypes/index.js @@ -3,6 +3,10 @@ import { PropTypes } from 'react' const { number, string } = PropTypes const numberOrString = PropTypes.oneOfType([ number, string ]) +/** + * Any properties marked @private are used internally in resets or property + * mappings. + */ export default { alignContent: string, alignItems: string, @@ -43,16 +47,16 @@ export default { clear: string, color: string, cursor: string, - direction: string, display: string, - flex: string, + direction: string, /* @private */ + flex: string, /* @private */ flexBasis: string, flexDirection: string, flexGrow: numberOrString, flexShrink: numberOrString, flexWrap: string, float: string, - font: string, + font: string, /* @private */ fontFamily: string, fontSize: numberOrString, fontStyle: string, @@ -99,5 +103,6 @@ export default { whiteSpace: string, width: numberOrString, wordWrap: string, + writingDirection: string, zIndex: numberOrString } diff --git a/src/modules/StyleSheet/expandStyle.js b/src/modules/StyleSheet/expandStyle.js index 5244bb62..dcc2481f 100644 --- a/src/modules/StyleSheet/expandStyle.js +++ b/src/modules/StyleSheet/expandStyle.js @@ -8,7 +8,8 @@ const styleShortHands = { marginVertical: [ 'marginTop', 'marginBottom' ], padding: [ 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft' ], paddingHorizontal: [ 'paddingRight', 'paddingLeft' ], - paddingVertical: [ 'paddingTop', 'paddingBottom' ] + paddingVertical: [ 'paddingTop', 'paddingBottom' ], + writingDirection: [ 'direction' ] } /**