diff --git a/docs/docs/components/form_control.md b/docs/docs/components/form_control.md index 612c58c..4c0bb05 100644 --- a/docs/docs/components/form_control.md +++ b/docs/docs/components/form_control.md @@ -1,5 +1,4 @@ -import { FormControl, HStack } from '@amalgama/react-native-ui-kit'; -import TextInput from '@site/src/components/TextInput'; +import { FormControl, HStack, TextInput } from '@amalgama/react-native-ui-kit'; import CodePreview from '@site/src/components/CodePreview'; # FormControl @@ -13,7 +12,7 @@ The `FormControl` component is used to wrap form inputs (suchs as `TextInput`, ` isRequired hint="Remember to enter a valid email address" > - + @@ -24,7 +23,7 @@ The `FormControl` component is used to wrap form inputs (suchs as `TextInput`, ` isRequired hint="Remember to enter a valid email address" > - + ``` @@ -42,7 +41,7 @@ The label text to show above the input component. - + @@ -50,7 +49,7 @@ The label text to show above the input component. - + ``` @@ -67,7 +66,7 @@ Shows an indicator for required input. label="Email" isRequired > - + @@ -76,7 +75,7 @@ Shows an indicator for required input. label="Email" isRequired > - + ``` @@ -98,7 +97,7 @@ Shows a hint text below the input. isRequired hint="Remember to enter a valid email address" > - + @@ -108,7 +107,7 @@ Shows a hint text below the input. isRequired hint="Remember to enter a valid email address" > - + ``` @@ -130,7 +129,7 @@ Shows an error text below the input. isRequired error="The email address is not valid" > - + @@ -140,7 +139,7 @@ Shows an error text below the input. isRequired error="The email address is not valid" > - + ``` diff --git a/docs/src/components/TextInput/index.tsx b/docs/src/components/TextInput/index.tsx deleted file mode 100644 index 2444be1..0000000 --- a/docs/src/components/TextInput/index.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { TextInput as RNTextInput, TextInputProps } from 'react-native'; - -const style = { - borderBottomWidth: 1, borderBottomColor: '#AAA' -}; - -const TextInput = ( props: TextInputProps ) => ( - -); - -export default TextInput; diff --git a/example/src/components/FormControlExamples.tsx b/example/src/components/FormControlExamples.tsx index a743c7d..b33e74d 100644 --- a/example/src/components/FormControlExamples.tsx +++ b/example/src/components/FormControlExamples.tsx @@ -1,7 +1,9 @@ import * as React from 'react'; -import { StyleSheet, TextInput, View } from 'react-native'; -import { VStack, FormControl, Text } from '@amalgama/react-native-ui-kit'; +import { StyleSheet, View } from 'react-native'; +import { + VStack, FormControl, TextInput, Text +} from '@amalgama/react-native-ui-kit'; const styles = StyleSheet.create( { container: { @@ -17,12 +19,6 @@ const styles = StyleSheet.create( { marginTop: 2, marginBottom: 6, backgroundColor: 'black' - }, - textInput: { - height: 30, - width: '100%', - borderBottomWidth: 1, - borderBottomColor: '#888' } } ); @@ -37,9 +33,7 @@ const FormControlExamples = () => ( label="Email" isRequired > - @@ -51,10 +45,7 @@ const FormControlExamples = () => ( - + @@ -67,9 +58,7 @@ const FormControlExamples = () => ( hint="Remember to enter a valid email address" isRequired > - @@ -81,10 +70,7 @@ const FormControlExamples = () => ( - + @@ -97,10 +83,7 @@ const FormControlExamples = () => ( error="The email is not valid!" isRequired > - + diff --git a/web_example/src/components/FormControlExamples.tsx b/web_example/src/components/FormControlExamples.tsx index a743c7d..d9ca26e 100644 --- a/web_example/src/components/FormControlExamples.tsx +++ b/web_example/src/components/FormControlExamples.tsx @@ -1,7 +1,10 @@ import * as React from 'react'; -import { StyleSheet, TextInput, View } from 'react-native'; -import { VStack, FormControl, Text } from '@amalgama/react-native-ui-kit'; +import { StyleSheet, View } from 'react-native'; +import { + VStack, FormControl, TextInput, Text, + Checkbox, Radio +} from '@amalgama/react-native-ui-kit'; const styles = StyleSheet.create( { container: { @@ -17,12 +20,6 @@ const styles = StyleSheet.create( { marginTop: 2, marginBottom: 6, backgroundColor: 'black' - }, - textInput: { - height: 30, - width: '100%', - borderBottomWidth: 1, - borderBottomColor: '#888' } } ); @@ -37,10 +34,7 @@ const FormControlExamples = () => ( label="Email" isRequired > - + @@ -51,10 +45,7 @@ const FormControlExamples = () => ( - + @@ -67,10 +58,7 @@ const FormControlExamples = () => ( hint="Remember to enter a valid email address" isRequired > - + @@ -81,14 +69,10 @@ const FormControlExamples = () => ( - + - With error @@ -97,10 +81,41 @@ const FormControlExamples = () => ( error="The email is not valid!" isRequired > - + + + + + With Checkboxes + + + + + + + + + + + + + With Radios + + + + + + + + +