-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathinput.playground.jsx
More file actions
124 lines (120 loc) · 3.11 KB
/
input.playground.jsx
File metadata and controls
124 lines (120 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import * as React from "react";
import { useState } from "react";
import { View } from "react-native";
import { Input } from "react-native-elements";
import Icon from "react-native-vector-icons/dist/MaterialCommunityIcons";
import Playground from "../../components/playground";
import { useView, PropTypes } from "react-view";
const InputPlayground = () => {
const params = useView({
componentName: "Input",
props: {
containerStyle: {
type: PropTypes.Object,
value: `{}`,
},
disabled: {
type: PropTypes.Boolean,
value: false,
},
disabledInputStyle: {
type: PropTypes.Object,
value: `{background:"#ddd"}`,
},
inputContainerStyle: {
type: PropTypes.Object,
value: `{}`,
},
errorMessage: {
type: PropTypes.String,
value: "Oops! that's not correct.",
},
errorStyle: {
type: PropTypes.Object,
value: `{}`,
},
errorProps: {
type: PropTypes.Object,
description:
"props to be passed to the React Native Text component used to display the error message (optional)",
value: `{}`,
},
inputStyle: {
type: PropTypes.Object,
value: `{}`,
},
label: {
type: PropTypes.ReactNode,
value: `"User Form"`,
description: "string OR React element or component ",
},
labelStyle: {
type: PropTypes.Object,
value: `{}`,
},
labelProps: {
type: PropTypes.Object,
value: `{}`,
description: "{...Text props} OR passed component props ",
},
leftIcon: {
type: PropTypes.ReactNode,
value: `<Icon name="account-outline" size={20}/>`,
},
leftIconContainerStyle: {
type: PropTypes.Object,
value: `{}`,
},
rightIcon: {
type: PropTypes.ReactNode,
value: `<Icon name="close" size={20} onPress={()=>{setValue("")}}/>`,
},
rightIconContainerStyle: {
type: PropTypes.Object,
value: `{}`,
},
renderErrorMessage: {
type: PropTypes.Boolean,
value: false,
description:
"If the error message container should be rendered (take up vertical space). If false, when showing errorMessage, the layout will shift to add it at that time.",
},
InputComponent: {
type: PropTypes.ReactNode,
},
placeholder: {
type: PropTypes.String,
value: "Enter Name",
},
value: {
type: PropTypes.String,
value: "",
stateful: true,
hidden: true,
},
onChange: {
type: PropTypes.Function,
value: `(e)=>{setValue(e.target.value)}`,
hidden: true,
},
},
scope: {
Input,
Icon,
},
imports: {
"react-native-elements": {
named: ["Input"],
},
"react-native-vector-icons/MaterialCommunityIcons": {
default: "Icon",
},
},
});
return (
<React.Fragment>
<Playground params={params} />
</React.Fragment>
);
};
export default InputPlayground;