From 08300f624fa54e98a606f48bf0e87064abab0d9c Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Sun, 18 Oct 2015 14:51:17 -0700 Subject: [PATCH] [change] remove 'component' prop; accessibility docs - infer underlying HTML tag from 'accessibilityRole' - move accessibility props to 'CoreComponent' - remove the 'component' prop from exported Components Fix gh-23 --- README.md | 16 ++++- config/webpack.config.base.js | 2 + docs/components/Text.md | 21 ++++--- docs/components/View.md | 10 +-- .../CoreComponent/__tests__/index-test.js | 62 +++++++++++++++++++ src/components/CoreComponent/index.js | 36 ++++++++++- src/components/Image/__tests__/index-test.js | 24 ++++--- src/components/Image/index.js | 9 ++- src/components/Text/__tests__/index-test.js | 30 +++++---- src/components/Text/index.js | 18 ++---- .../TextInput/__tests__/index-test.js | 8 ++- src/components/TextInput/index.js | 4 +- .../Touchable/__tests__/index-test.js | 16 +++-- src/components/Touchable/index.js | 7 +-- src/components/View/__tests__/index-test.js | 32 ++++++---- src/components/View/index.js | 20 ++---- src/example.js | 26 ++++---- src/modules/specHelpers/index.js | 48 -------------- 18 files changed, 230 insertions(+), 159 deletions(-) create mode 100644 src/components/CoreComponent/__tests__/index-test.js diff --git a/README.md b/README.md index d2b6e2bb..6ba78f70 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [React Native][react-native-url] components and APIs for the Web. ~17.7 KB minified and gzipped. -* [Slack: reactiflux channel #react-native-web][slack-url] +* [Slack: #react-native-web on reactiflux][slack-url] * [Gitter: react-native-web][gitter-url] ## Table of contents @@ -16,6 +16,7 @@ * [APIs](#apis) * [Components](#components) * [Styling](#styling) +* [Accessibility](#accessibility) * [Contributing](#contributing) * [Thanks](#thanks) * [License](#license) @@ -171,6 +172,19 @@ flexbox][flexbox-guide-url]. Styling components can be achieved with inline styles or the use of [StyleSheet](docs/apis/StyleSheet.md). +## Accessibility + +Major accessibility features are available through the following props: +`accessible`, `accessibilityLabel`, `accessibilityLiveRegion`, and +`accessibilityRole`. The `accessibilityRole` prop is used to determine the +rendered DOM element. For example: + +* `` => `
`. +* `` => `