index.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. import React from 'react';
  2. import Types from '../../lib/Types';
  3. import Module from '../../lib/Module';
  4. import { Accordion as AccordionCtor } from 'native-base';
  5. import { Actionsheet as ActionsheetCtor } from 'native-base';
  6. import { Badge as BadgeCtor } from 'native-base';
  7. import { Body as BodyCtor } from 'native-base';
  8. import { Button as ButtonCtor } from 'native-base';
  9. import { Card as CardCtor } from 'native-base';
  10. import { CardItem as CardItemCtor } from 'native-base';
  11. import { Checkbox as CheckboxCtor } from 'native-base';
  12. import { Container as ContainerCtor } from 'native-base';
  13. import { Content as ContentCtor } from 'native-base';
  14. import { DatePicker as DatePickerCtor } from 'native-base';
  15. import { DeckSwiper as DeckSwiperCtor } from 'native-base';
  16. import { Fab as FabCtor } from 'native-base';
  17. import { Footer as FooterCtor } from 'native-base';
  18. import { FooterTab as FooterTabCtor } from 'native-base';
  19. import { Form as FormCtor } from 'native-base';
  20. import { Gravatar as GravatarCtor } from 'native-base';
  21. import { H1 as H1Ctor } from 'native-base';
  22. import { H2 as H2Ctor } from 'native-base';
  23. import { H3 as H3Ctor } from 'native-base';
  24. import { Header as HeaderCtor } from 'native-base';
  25. import { IconNB as IconNBCtor } from 'native-base';
  26. import { Input as InputCtor } from 'native-base';
  27. import { InputGroup as InputGroupCtor } from 'native-base';
  28. import { Item as ItemCtor } from 'native-base';
  29. import { Label as LabelCtor } from 'native-base';
  30. import { Left as LeftCtor } from 'native-base';
  31. import { List as ListCtor } from 'native-base';
  32. import { ListItem as ListItemCtor } from 'native-base';
  33. import { PickerItem as PickerItemCtor } from 'native-base';
  34. import { Radio as RadioCtor } from 'native-base';
  35. import { Right as RightCtor } from 'native-base';
  36. import { Root as RootCtor } from 'native-base';
  37. import { Segment as SegmentCtor } from 'native-base';
  38. import { Separator as SeparatorCtor } from 'native-base';
  39. import { Spinner as SpinnerCtor } from 'native-base';
  40. import { Subtitle as SubtitleCtor } from 'native-base';
  41. import { SwipeRow as SwipeRowCtor } from 'native-base';
  42. import { Switch as SwitchCtor } from 'native-base';
  43. import { Tab as TabCtor } from 'native-base';
  44. import { TabContainer as TabContainerCtor } from 'native-base';
  45. import { TabHeading as TabHeadingCtor } from 'native-base';
  46. import { Text as TextCtor } from 'native-base';
  47. import { Textarea as TextareaCtor } from 'native-base';
  48. import { Thumbnail as ThumbnailCtor } from 'native-base';
  49. import { Title as TitleCtor } from 'native-base';
  50. import { Toast as ToastCtor } from 'native-base';
  51. import { ToastContainer as ToastContainerCtor } from 'native-base';
  52. import { View as ViewCtor } from 'native-base';
  53. export class Accordion extends Module {
  54. constructor(props) {
  55. super(props);
  56. }
  57. display() {
  58. return <AccordionCtor {...this.props} />
  59. }
  60. }
  61. export class Actionsheet extends Module {
  62. constructor(props) {
  63. super(props);
  64. }
  65. display() {
  66. return <ActionsheetCtor {...this.props} />
  67. }
  68. }
  69. export class Badge extends Module {
  70. constructor(props) {
  71. super(props);
  72. }
  73. display() {
  74. return <BadgeCtor {...this.props} />
  75. }
  76. }
  77. export class Body extends Module {
  78. constructor(props) {
  79. super(props);
  80. }
  81. display() {
  82. return <BodyCtor {...this.props} />
  83. }
  84. }
  85. export class Button extends Module {
  86. constructor(props) {
  87. super(props);
  88. }
  89. display() {
  90. let {
  91. text,
  92. ...rest
  93. } = this.props;
  94. return <ButtonCtor {...rest}>
  95. {text ? <TextCtor>{text}</TextCtor> : null}
  96. </ButtonCtor>
  97. }
  98. }
  99. export class Card extends Module {
  100. constructor(props) {
  101. super(props);
  102. }
  103. display() {
  104. let {
  105. header,
  106. body,
  107. footer,
  108. ...rest
  109. } = this.props;
  110. return
  111. <CardCtor {...rest}>
  112. <CardItemCtor header>
  113. <TextCtor>{header}</TextCtor>
  114. </CardItemCtor>
  115. <CardItemCtor>
  116. <BodyCtor>
  117. <TextCtor>
  118. {body}
  119. </TextCtor>
  120. </BodyCtor>
  121. </CardItemCtor>
  122. <CardItemCtor footer>
  123. <TextCtor>{footer}</TextCtor>
  124. </CardItemCtor>
  125. </CardCtor>;
  126. }
  127. }
  128. export class CardItem extends Module {
  129. constructor(props) {
  130. super(props);
  131. }
  132. display() {
  133. return <CardItemCtor {...this.props} />
  134. }
  135. }
  136. export class Checkbox extends Module {
  137. constructor(props) {
  138. super(props);
  139. }
  140. display() {
  141. return <CheckboxCtor {...this.props} />
  142. }
  143. }
  144. export class Container extends Module {
  145. constructor(props) {
  146. super(props);
  147. }
  148. display() {
  149. return <ContainerCtor {...this.props} />
  150. }
  151. }
  152. export class Content extends Module {
  153. constructor(props) {
  154. super(props);
  155. }
  156. display() {
  157. return <ContentCtor {...this.props} />
  158. }
  159. }
  160. export class DatePicker extends Module {
  161. constructor(props) {
  162. super(props);
  163. }
  164. display() {
  165. return <DatePickerCtor {...this.props} />
  166. }
  167. }
  168. export class DeckSwiper extends Module {
  169. constructor(props) {
  170. super(props);
  171. }
  172. display() {
  173. return <DeckSwiperCtor {...this.props} />
  174. }
  175. }
  176. export class Fab extends Module {
  177. constructor(props) {
  178. super(props);
  179. }
  180. display() {
  181. return <FabCtor {...this.props} />
  182. }
  183. }
  184. export class Footer extends Module {
  185. constructor(props) {
  186. super(props);
  187. }
  188. display() {
  189. return <FooterCtor {...this.props} />
  190. }
  191. }
  192. export class FooterTab extends Module {
  193. constructor(props) {
  194. super(props);
  195. }
  196. display() {
  197. return <FooterTabCtor {...this.props} />
  198. }
  199. }
  200. export class Form extends Module {
  201. constructor(props) {
  202. super(props);
  203. }
  204. display() {
  205. return <FormCtor {...this.props} />
  206. }
  207. }
  208. export class Gravatar extends Module {
  209. constructor(props) {
  210. super(props);
  211. }
  212. display() {
  213. return <GravatarCtor {...this.props} />
  214. }
  215. }
  216. export class H1 extends Module {
  217. constructor(props) {
  218. super(props);
  219. }
  220. display() {
  221. let {
  222. content,
  223. ...rest
  224. } = this.props;
  225. return <H1Ctor {...rest}>
  226. {content}
  227. </H1Ctor>
  228. }
  229. }
  230. export class H2 extends Module {
  231. constructor(props) {
  232. super(props);
  233. }
  234. display() {
  235. let {
  236. content,
  237. ...rest
  238. } = this.props;
  239. return <H2Ctor {...rest}>
  240. {content}
  241. </H2Ctor>
  242. }
  243. }
  244. export class H3 extends Module {
  245. constructor(props) {
  246. super(props);
  247. }
  248. display() {
  249. let {
  250. content,
  251. ...rest
  252. } = this.props;
  253. return <H3Ctor {...rest}>
  254. {content}
  255. </H3Ctor>
  256. }
  257. }
  258. export class Header extends Module {
  259. constructor(props) {
  260. super(props);
  261. }
  262. display() {
  263. return <HeaderCtor {...this.props} />
  264. }
  265. }
  266. export class IconNB extends Module {
  267. constructor(props) {
  268. super(props);
  269. }
  270. display() {
  271. return <IconNBCtor {...this.props} />
  272. }
  273. }
  274. export class Input extends Module {
  275. constructor(props) {
  276. super(props);
  277. }
  278. display() {
  279. return <InputCtor {...this.props} />
  280. }
  281. }
  282. export class InputGroup extends Module {
  283. constructor(props) {
  284. super(props);
  285. }
  286. display() {
  287. return <InputGroupCtor {...this.props} />
  288. }
  289. }
  290. export class Item extends Module {
  291. constructor(props) {
  292. super(props);
  293. }
  294. display() {
  295. return <ItemCtor {...this.props} />
  296. }
  297. }
  298. export class Label extends Module {
  299. constructor(props) {
  300. super(props);
  301. }
  302. display() {
  303. return <LabelCtor {...this.props} />
  304. }
  305. }
  306. export class Left extends Module {
  307. constructor(props) {
  308. super(props);
  309. }
  310. display() {
  311. return <LeftCtor {...this.props} />
  312. }
  313. }
  314. export class List extends Module {
  315. constructor(props) {
  316. super(props);
  317. }
  318. display() {
  319. return <ListCtor {...this.props} />
  320. }
  321. }
  322. export class ListItem extends Module {
  323. constructor(props) {
  324. super(props);
  325. }
  326. display() {
  327. return <ListItemCtor {...this.props} />
  328. }
  329. }
  330. export class PickerItem extends Module {
  331. constructor(props) {
  332. super(props);
  333. }
  334. display() {
  335. return <PickerItemCtor {...this.props} />
  336. }
  337. }
  338. export class Radio extends Module {
  339. constructor(props) {
  340. super(props);
  341. }
  342. display() {
  343. return <RadioCtor {...this.props} />
  344. }
  345. }
  346. export class Right extends Module {
  347. constructor(props) {
  348. super(props);
  349. }
  350. display() {
  351. return <RightCtor {...this.props} />
  352. }
  353. }
  354. export class Root extends Module {
  355. constructor(props) {
  356. super(props);
  357. }
  358. display() {
  359. return <RootCtor {...this.props} />
  360. }
  361. }
  362. export class Segment extends Module {
  363. constructor(props) {
  364. super(props);
  365. }
  366. display() {
  367. return <SegmentCtor {...this.props} />
  368. }
  369. }
  370. export class Separator extends Module {
  371. constructor(props) {
  372. super(props);
  373. }
  374. display() {
  375. return <SeparatorCtor {...this.props} />
  376. }
  377. }
  378. export class Spinner extends Module {
  379. constructor(props) {
  380. super(props);
  381. }
  382. display() {
  383. return <SpinnerCtor {...this.props} />
  384. }
  385. }
  386. export class Subtitle extends Module {
  387. constructor(props) {
  388. super(props);
  389. }
  390. display() {
  391. return <SubtitleCtor {...this.props} />
  392. }
  393. }
  394. export class SwipeRow extends Module {
  395. constructor(props) {
  396. super(props);
  397. }
  398. display() {
  399. return <SwipeRowCtor {...this.props} />
  400. }
  401. }
  402. export class Switch extends Module {
  403. constructor(props) {
  404. super(props);
  405. }
  406. display() {
  407. return <SwitchCtor {...this.props} />
  408. }
  409. }
  410. export class Tab extends Module {
  411. constructor(props) {
  412. super(props);
  413. }
  414. display() {
  415. return <TabCtor {...this.props} />
  416. }
  417. }
  418. export class TabContainer extends Module {
  419. constructor(props) {
  420. super(props);
  421. }
  422. display() {
  423. return <TabContainerCtor {...this.props} />
  424. }
  425. }
  426. export class TabHeading extends Module {
  427. constructor(props) {
  428. super(props);
  429. }
  430. display() {
  431. return <TabHeadingCtor {...this.props} />
  432. }
  433. }
  434. export class Text extends Module {
  435. constructor(props) {
  436. super(props);
  437. }
  438. display() {
  439. let {
  440. content,
  441. ...rest
  442. } = this.props
  443. return <TextCtor {...rest} >
  444. {content}
  445. </TextCtor>
  446. }
  447. }
  448. export class Textarea extends Module {
  449. constructor(props) {
  450. super(props);
  451. }
  452. display() {
  453. let {
  454. ...rest
  455. } = this.props;
  456. return <TextareaCtor {...rest}>
  457. </TextareaCtor>
  458. }
  459. }
  460. export class Thumbnail extends Module {
  461. constructor(props) {
  462. super(props);
  463. }
  464. display() {
  465. return <ThumbnailCtor {...this.props} />
  466. }
  467. }
  468. export class Title extends Module {
  469. constructor(props) {
  470. super(props);
  471. }
  472. display() {
  473. return <TitleCtor {...this.props} />
  474. }
  475. }
  476. export class Toast extends Module {
  477. constructor(props) {
  478. super(props);
  479. }
  480. display() {
  481. return <ToastCtor {...this.props} />
  482. }
  483. }
  484. export class ToastContainer extends Module {
  485. constructor(props) {
  486. super(props);
  487. }
  488. display() {
  489. return <ToastContainerCtor {...this.props} />
  490. }
  491. }
  492. export class View extends Module {
  493. constructor(props) {
  494. super(props);
  495. }
  496. display() {
  497. return <ViewCtor {...this.props} />
  498. }
  499. }
  500. Text.Inputs = {
  501. uppercase: new Types.Bool().default(false),
  502. content: new Types.Text().default("Hello world!")
  503. }
  504. Accordion.Inputs = {
  505. }
  506. Actionsheet.Inputs = {
  507. }
  508. Badge.Inputs = {
  509. }
  510. Body.Inputs = {
  511. }
  512. Button.Inputs = {
  513. text: new Types.Text().default("Press me"),
  514. block: new Types.Bool(),
  515. primary: new Types.Bool(),
  516. transparent: new Types.Bool(),
  517. success: new Types.Bool(),
  518. danger: new Types.Bool(),
  519. warning: new Types.Bool(),
  520. info: new Types.Bool(),
  521. bordered: new Types.Bool(),
  522. disabled: new Types.Bool(),
  523. rounded: new Types.Bool(),
  524. large: new Types.Bool(),
  525. small: new Types.Bool(),
  526. active: new Types.Bool()
  527. }
  528. Card.Inputs = {
  529. header: new Types.Text().default("Header"),
  530. body: new Types.Text().default("Lorem ipsum body bla la trapala"),
  531. footer: new Types.Text().default("Add footer here"),
  532. }
  533. CardItem.Inputs = {
  534. header: new Types.Bool(),
  535. cardBody: new Types.Bool(),
  536. footer: new Types.Bool(),
  537. button: new Types.Bool()
  538. }
  539. Checkbox.Inputs = {
  540. checked: new Types.Bool()
  541. }
  542. Container.Inputs = {
  543. }
  544. Content.Inputs = {
  545. disableKBDismissScroll: new Types.Bool(),
  546. keyboardShouldPersistTaps: new Types.Text(),
  547. padder: new Types.Bool()
  548. }
  549. DatePicker.Inputs = {
  550. }
  551. DeckSwiper.Inputs = {
  552. }
  553. Fab.Inputs = {
  554. }
  555. Footer.Inputs = {
  556. }
  557. FooterTab.Inputs = {
  558. }
  559. Form.Inputs = {
  560. }
  561. Gravatar.Inputs = {
  562. email: new Types.Text().require(),
  563. size: new Types.Real(),
  564. circular: new Types.Bool(),
  565. square: new Types.Bool()
  566. }
  567. H1.Inputs = {
  568. ...Text.Inputs
  569. }
  570. H2.Inputs = {
  571. ...Text.Inputs
  572. }
  573. H3.Inputs = {
  574. ...Text.Inputs
  575. }
  576. Header.Inputs = {
  577. searchBar: new Types.Bool(),
  578. rounded: new Types.Bool()
  579. }
  580. IconNB.Inputs = {
  581. }
  582. Input.Inputs = {
  583. }
  584. InputGroup.Inputs = {
  585. regular: new Types.Bool(),
  586. underline: new Types.Bool(),
  587. rounded: new Types.Bool(),
  588. success: new Types.Bool(),
  589. error: new Types.Bool(),
  590. disabled: new Types.Bool()
  591. }
  592. Item.Inputs = {
  593. inlineLabel: new Types.Bool(),
  594. floatingLabel: new Types.Bool(),
  595. stackedLabel: new Types.Bool(),
  596. fixedLabel: new Types.Bool(),
  597. success: new Types.Bool(),
  598. error: new Types.Bool()
  599. }
  600. Label.Inputs = {
  601. floatBack: new Types.Real()
  602. }
  603. Left.Inputs = {
  604. }
  605. List.Inputs = {
  606. }
  607. ListItem.Inputs = {
  608. itemDivider: new Types.Bool(),
  609. button: new Types.Bool()
  610. }
  611. PickerItem.Inputs = {
  612. }
  613. Radio.Inputs = {
  614. selected: new Types.Bool(),
  615. standardStyle: new Types.Bool()
  616. }
  617. Right.Inputs = {
  618. }
  619. Root.Inputs = {
  620. }
  621. Segment.Inputs = {
  622. }
  623. Separator.Inputs = {
  624. }
  625. Spinner.Inputs = {
  626. color: new Types.Text(),
  627. inverse: new Types.Bool()
  628. }
  629. Subtitle.Inputs = {
  630. }
  631. SwipeRow.Inputs = {
  632. }
  633. Switch.Inputs = {
  634. }
  635. Tab.Inputs = {
  636. }
  637. TabContainer.Inputs = {
  638. }
  639. TabHeading.Inputs = {
  640. }
  641. Textarea.Inputs = {
  642. placeholder: new Types.Text(),
  643. rowSpan: new Types.Real(),
  644. bordered: new Types.Bool(),
  645. underline: new Types.Bool()
  646. }
  647. Thumbnail.Inputs = {
  648. square: new Types.Bool(),
  649. circular: new Types.Bool(),
  650. size: new Types.Real()
  651. }
  652. Title.Inputs = {
  653. }
  654. Toast.Inputs = {
  655. }
  656. ToastContainer.Inputs = {
  657. }
  658. View.Inputs = {
  659. }
  660. export default {
  661. Accordion,
  662. Actionsheet,
  663. Badge,
  664. Body,
  665. Button,
  666. Card,
  667. CardItem,
  668. Checkbox,
  669. Container,
  670. Content,
  671. DatePicker,
  672. DeckSwiper,
  673. Fab,
  674. Footer,
  675. FooterTab,
  676. Form,
  677. Gravatar,
  678. H1,
  679. H2,
  680. H3,
  681. Header,
  682. IconNB,
  683. Input,
  684. InputGroup,
  685. Item,
  686. Label,
  687. Left,
  688. List,
  689. ListItem,
  690. PickerItem,
  691. Radio,
  692. Right,
  693. Root,
  694. Segment,
  695. Separator,
  696. Spinner,
  697. Subtitle,
  698. SwipeRow,
  699. Switch,
  700. Tab,
  701. TabContainer,
  702. TabHeading,
  703. Text,
  704. Textarea,
  705. Thumbnail,
  706. Title,
  707. Toast,
  708. ToastContainer,
  709. View
  710. }