@@ -1,180 +0,0 @@
1−// Helpers
2−import {
3− simpleValidatorWrapper,
4− validateMnemonic,
5− validateNotEmpty,
6− validateEthereumAddress,
7− validateGalaxy,
8− validatePoint,
9− validateTicket,
10− validateNetworkKey,
11− validateNetworkSeed,
12− validateShard,
13−} from '../../lib/validators';
14−
15−import { prependSig } from '../../lib/transformers';
16−
17−// Buttons
18−import Button from './Button';
19−import UploadButton from './UploadButton';
20−// import Checkbox from './Checkbox';
21−import CheckboxButton from './CheckboxButton';
22−import Anchor from './Anchor';
23−// import ToggleButton from './ToggleButton';
24−
25−// Input
26−import Form from './Form';
27−import Label from './Label';
28−import InnerLabel from './InnerLabel';
29−import InputCaption from './InputCaption';
30−import Input from './Input';
31−import Textarea from './Textarea';
32−import advancedInput from './advancedInput';
33−
34−// Dropdowns
35−import DropdownItem from './DropdownItem';
36−import DropdownDivider from './DropdownDivider';
37−import InnerLabelDropdown from './InnerLabelDropdown';
38−
39−// Option selectors
40−import HorizontalSelector from './HorizontalSelector';
41−
42−// Path Control
43−import Breadcrumb from './Breadcrumb';
44−import BreadcrumbItem from './BreadcrumbItem';
45−
46−// Layout
47−import Col from './Col';
48−import Row from './Row';
49−// import FlexRow from './FlexRow';
50−// import FlexCol from './FlexCol';
51−import Spacing from './Spacing';
52−
53−// Type
54−import H1 from './H1';
55−import H2 from './H2';
56−import H3 from './H3';
57−import H4 from './H4';
58−import P from './P';
59−import Code from './Code';
60−import Warning from './Warning';
61−
62−// Misc
63−import ValidatedSigil from './ValidatedSigil';
64−import ValidatedBlockie from './ValidatedBlockie';
65−import ShowBlockie from './ShowBlockie';
66−
67−// HOC validated form components
68−
69−const RequiredInput = advancedInput({
70− WrappedComponent: Input,
71− validators: [validateNotEmpty],
72−});
73−
74−const NetworkKeyInput = advancedInput({
75− WrappedComponent: Input,
76− validators: [validateNotEmpty, validateNetworkKey],
77−});
78−
79−const NetworkSeedInput = advancedInput({
80− WrappedComponent: Input,
81− validators: [validateNotEmpty, validateNetworkSeed],
82−});
83−
84−const AddressInput = advancedInput({
85− WrappedComponent: Input,
86− validators: [validateEthereumAddress, validateNotEmpty],
87−});
88−
89−const MnemonicInput = advancedInput({
90− WrappedComponent: Textarea,
91− validators: [validateMnemonic, validateNotEmpty],
92−});
93−
94−const GalaxyInput = advancedInput({
95− WrappedComponent: Input,
96− validators: [validateGalaxy, validateNotEmpty],
97− transformers: [prependSig],
98−});
99−
100−const PointInput = advancedInput({
101− WrappedComponent: Input,
102− validators: [validatePoint, validateNotEmpty],
103− transformers: [prependSig],
104−});
105−
106−const TicketInput = advancedInput({
107− WrappedComponent: Input,
108− validators: [validateTicket, validateNotEmpty],
109− transformers: [prependSig],
110−});
111−
112−const VerifyTicketInput = matchingTicket =>
113− advancedInput({
114− WrappedComponent: Input,
115− validators: [
116− validateTicket,
117− validateNotEmpty,
118−
119− // TODO: This should be in /lib/validators, but we'd need a way for
120− // validators to compare against dynamic values
121− m =>
122− simpleValidatorWrapper({
123− prevMessage: m,
124− validator: d => d === matchingTicket,
125− errorMessage: 'This does not match the provided master ticket',
126− }),
127− ],
128− transformers: [prependSig],
129− });
130−
131−const ShardInput = advancedInput({
132− WrappedComponent: Input,
133− validators: [validateShard],
134− transformers: [],
135−});
136−
137−export {
138− Button,
139− CheckboxButton,
140− UploadButton,
141− Anchor,
142− InputCaption,
143− Form,
144− Label,
145− Input,
146− InnerLabel,
147− Textarea,
148− AddressInput,
149− MnemonicInput,
150− GalaxyInput,
151− PointInput,
152− TicketInput,
153− VerifyTicketInput,
154− ShardInput,
155− RequiredInput,
156− NetworkKeyInput,
157− NetworkSeedInput,
158− advancedInput,
159− ValidatedSigil,
160− ValidatedBlockie,
161− ShowBlockie,
162− DropdownItem,
163− DropdownDivider,
164− InnerLabelDropdown,
165− HorizontalSelector,
166− Breadcrumb,
167− BreadcrumbItem,
168− Col,
169− Row,
170− // FlexRow,
171− // FlexCol,
172− Spacing,
173− H1,
174− H2,
175− H3,
176− H4,
177− P,
178− Code,
179− Warning,
180−};