/* eslint-disable react/jsx-sort-props */ /** * @flow */ import PropChildren from './examples/PropChildren'; import PropNumberOfLines from './examples/PropNumberOfLines'; import PropOnPress from './examples/PropOnPress'; import React from 'react'; import UIExplorer, { AppText, Code, Description, DocItem, Section, storiesOf, StyleList } from '../../ui-explorer'; const TextScreen = () => ( Text is component for displaying text. It supports style, basic touch handling, and inherits typographic styles from ancestor elements. Text is unique relative to layout: child elements use text layout ("inline") rather than flexbox layout. This means that elements inside of a Text are not rectangles, as they wrap when reaching the edge of their container. NOTE: Text will transfer all other props to the rendered HTML element.
Overrides the text that is read by a screen reader when the user interacts with the element. (This is implemented using aria-label.) } /> Indicates to assistive technologies whether to notify the user when the view changes. The values of this attribute are expressed in degrees of importance. When regions are specified as polite (recommended), updates take low priority. When regions are specified as assertive, assistive technologies will interrupt and immediately notify the user. (This is implemented using aria-live.) } /> Allows assistive technologies to present and support interaction with the view in a manner that is consistent with user expectations for similar views of that type. For example, marking a touchable view with an accessibilityRole of{' '} button. For compatibility with React Native{' '} accessibilityTraits and accessibilityComponentType are mapped to accessibilityRole. (This is implemented using ARIA roles.) } /> When true, indicates that the view is an accessibility element (i.e., focusable) and groups its child content. By default, all the touchable elements and elements with accessibilityRole of button and{' '} link are accessible. (This is implemented using tabindex.) } /> Child content. Nested text components will inherit the styles of their parents (only backgroundColor is inherited from non-Text parents). } example={{ render: () => }} /> A value of no will remove the element from the tab flow. , A value of no-hide-descendants will hide the element and its children from assistive technologies. (This is implemented using aria-hidden.) ]} /> }} /> Invoked on mount and layout changes with{' '} {'{ nativeEvent: { layout: { x, y, width, height } } }'}, where{' '} x and y are the offsets from the parent node. ]} /> }} /> } />
); const stylePropTypes = [ { name: '...View#style' }, { name: 'color', typeInfo: 'color' }, { name: 'fontFamily', typeInfo: 'string' }, { label: 'web', name: 'fontFeatureSettings', typeInfo: 'string' }, { name: 'fontSize', typeInfo: 'number | string' }, { name: 'fontStyle', typeInfo: 'string' }, { name: 'fontVariant', typeInfo: 'Array' }, { name: 'fontWeight', typeInfo: 'string' }, { name: 'letterSpacing', typeInfo: 'string' }, { name: 'lineHeight', typeInfo: 'string' }, { name: 'textAlign', typeInfo: 'enum("center", "end", "inherit", "justify", "justify-all", "left", "right", "start")' }, { name: 'textAlignVertical', typeInfo: 'string' }, { name: 'textDecorationLine', typeInfo: 'string' }, { label: 'web', name: 'textIndent', typeInfo: 'string' }, { label: 'web', name: 'textOverflow', typeInfo: 'string' }, { label: 'web', name: 'textRendering', typeInfo: 'string' }, { name: 'textShadowColor', typeInfo: 'color' }, { name: 'textShadowOffset', typeInfo: '{ height: number, width: number }' }, { name: 'textShadowRadius', typeInfo: 'number | string' }, { label: 'web', name: 'textTransform', typeInfo: 'string' }, { label: 'web', name: 'unicodeBidi', typeInfo: 'string' }, { name: 'whiteSpace', typeInfo: 'string' }, { label: 'web', name: 'wordWrap', typeInfo: 'string' }, { name: 'writingDirection', typeInfo: 'string' } ]; storiesOf('Components', module).add('Text', TextScreen);