├── .eslintrc
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature-request.md
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── build-and-deploy.yml
│ └── build-pr.yaml
├── .gitignore
├── .prettierrc
├── .vscode
├── extensions.json
└── settings.json
├── LICENSE
├── README.md
├── config-overrides.js
├── injectLatestProps.js
├── package.json
├── patches
└── @react-native-community+toolbar-android+0.1.0-rc.2.patch
├── public
├── CNAME
├── _redirects
├── favicon.ico
├── index.html
├── logo.png
├── logo192.png
├── logo512.png
├── manifest.json
├── netlify.toml
├── robots.txt
└── thumbnail.png
└── src
├── App.css
├── App.js
├── App.test.js
├── assets
├── RNE_Logo.png
├── SVG
│ ├── bootstrap.svg
│ ├── design.svg
│ ├── explore.svg
│ └── tweak.svg
└── sample.jpg
├── components
├── Footer
│ ├── Footer.module.css
│ └── index.jsx
├── PropDrawer
│ └── index.jsx
└── playground
│ └── index.jsx
├── containers
├── Drawer
│ └── index.jsx
├── Navigation
│ └── index.jsx
├── Spinner
│ └── index.jsx
└── index.jsx
├── content
├── AirbnbRating
│ ├── airbnbrating.playground.jsx
│ └── index.jsx
├── Avatar
│ ├── avatar.playground.jsx
│ └── index.jsx
├── Badge
│ ├── badge.playground.jsx
│ └── index.jsx
├── BottomSheet
│ ├── bottomsheet.playground.jsx
│ └── index.jsx
├── Button
│ ├── button.playground.jsx
│ └── index.jsx
├── ButtonGroup
│ ├── buttongroup.playground.jsx
│ └── index.jsx
├── Card
│ ├── card.playground.jsx
│ └── index.jsx
├── CheckBox
│ ├── checkbox.playground.jsx
│ └── index.jsx
├── Divider
│ ├── divider.playground.jsx
│ └── index.jsx
├── FAB
│ ├── fab.playground.jsx
│ └── index.jsx
├── Header
│ ├── header.playground.jsx
│ └── index.jsx
├── Icon
│ ├── icon.playground.jsx
│ └── index.jsx
├── Image
│ ├── index.jsx
│ └── input.playground.jsx
├── Input
│ ├── index.jsx
│ └── input.playground.jsx
├── LinearProgress
│ ├── index.jsx
│ └── linearprogress.playground.jsx
├── ListItem
│ ├── index.jsx
│ └── listitem.playground.jsx
├── Overlay
│ ├── index.jsx
│ └── overlay.playground.jsx
├── Pricing
│ ├── index.jsx
│ └── pricing.playground.jsx
├── Rating
│ ├── index.jsx
│ └── rating.playground.jsx
├── SearchBar
│ ├── index.jsx
│ └── searchbar.playground.jsx
├── Slider
│ ├── index.jsx
│ └── slider.playground.jsx
├── SocialIcon
│ ├── index.jsx
│ └── socialicon.playground.jsx
├── SpeedDial
│ ├── index.jsx
│ └── speeddial.playground.jsx
├── Switch
│ ├── index.jsx
│ └── switch.playground.jsx
├── Tab
│ ├── index.jsx
│ └── tab.playground.jsx
├── Text
│ ├── index.jsx
│ └── text.playground.jsx
├── Tile
│ ├── index.jsx
│ └── tile.playground.jsx
├── ToolTip
│ ├── index.jsx
│ └── tooltip.playground.jsx
└── utils
│ └── createReactViewBaseConfig.js
├── index.css
├── index.js
├── logo.svg
├── pages
├── explore
│ ├── Explore.module.css
│ └── index.jsx
└── home
│ ├── animation.json
│ ├── animation.jsx
│ └── index.jsx
└── serviceWorker.js
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parserOptions": {
3 | "ecmaVersion": 2019,
4 | "sourceType": "module",
5 | // enable jsx support
6 | "ecmaFeatures": {
7 | "jsx": true
8 | }
9 | },
10 | "extends": [
11 | "eslint:recommended",
12 | "plugin:react/recommended",
13 | "plugin:jest/recommended",
14 | "plugin:react-hooks/recommended",
15 | "plugin:jsx-a11y/recommended",
16 | "plugin:json/recommended"
17 | ],
18 | "rules": {
19 | "react/jsx-uses-react": "error",
20 | "react/jsx-uses-vars": "error",
21 | "react-hooks/rules-of-hooks": "error",
22 | "react-hooks/exhaustive-deps": "warn"
23 | },
24 | "env": {
25 | "browser": true,
26 | "node": true,
27 | "commonjs": true,
28 | "es6": true
29 | },
30 | "plugins": ["react", "jest", "react-hooks", "jsx-a11y"],
31 | "settings": {
32 | "react": {
33 | "version": "detect"
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | ---
5 |
6 |
11 |
12 | **Explain what you did (Required)**
13 |
14 |
15 |
16 | **Expected behavior (Required)**
17 |
18 |
19 |
20 | **Describe the bug (Required)**
21 |
22 |
23 |
24 | **To Reproduce (Required)**
25 |
26 | > We highly recommend that you re-create the bug on [Snack](https://snack.expo.io). If not, list the steps that a reviewer can take to reproduce the behaviour:
27 |
28 | Example:
29 |
30 | **Snack** : https://snack.expo.io/xxx
31 |
32 | - Steps
33 | 1. Go to '...'
34 | 2. Click on '....'
35 | 3. Scroll down to '....'
36 | 4. See error
37 |
38 | **Screenshots (Required)**
39 |
40 |
41 |
42 | **Your Environment (Required):**
43 |
44 | | software | version |
45 | | --------------------- | ------- |
46 | | react-native-elements | |
47 | | react-native | |
48 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Suggest an idea or enhancement for this project
4 | ---
5 |
6 | **Is your feature request related to a problem? Please Describe.**
7 |
8 |
9 |
10 | **Describe the solution you'd like**
11 |
12 |
13 |
14 | **Describe alternatives you've considered**
15 |
16 |
17 |
18 | **Additional context**
19 |
20 |
21 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | **What kind of change does this PR introduce?**
4 |
5 |
6 |
7 | **Did you add tests for your changes?**
8 |
9 | **If relevant, did you update the documentation?**
10 |
11 | **Summary**
12 |
13 |
14 |
15 |
16 | **Does this PR introduce a breaking change?**
17 |
18 |
19 |
20 | **Other information**
21 |
--------------------------------------------------------------------------------
/.github/workflows/build-and-deploy.yml:
--------------------------------------------------------------------------------
1 | name: Build and Deploy
2 | on:
3 | push:
4 | branches:
5 | - master
6 | jobs:
7 | build-and-deploy:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: Checkout 🛎️
11 | uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
12 | with:
13 | persist-credentials: false
14 |
15 | - name: Setup Node.js Env
16 | uses: actions/setup-node@v2
17 | with:
18 | node-version: "12"
19 | - name: Install svn
20 | run: sudo apt-get install subversion
21 | - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
22 | run: |
23 | npm i
24 | npm run prepare
25 | npm run build
26 | env:
27 | CI: false
28 |
29 | - name: Deploy 🚀
30 | uses: JamesIves/github-pages-deploy-action@3.7.1
31 | with:
32 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 | BRANCH: gh-pages # The branch the action should deploy to.
34 | FOLDER: build # The folder the action should deploy.
35 | CLEAN: true # Automatically remove deleted files from the deploy branch
36 |
--------------------------------------------------------------------------------
/.github/workflows/build-pr.yaml:
--------------------------------------------------------------------------------
1 | name: Build and Deploy
2 | on: [pull_request]
3 | jobs:
4 | build:
5 | runs-on: ubuntu-latest
6 | steps:
7 | - name: Checkout 🛎️
8 | uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
9 | with:
10 | persist-credentials: false
11 |
12 | - name: Setup Node.js Env
13 | uses: actions/setup-node@v2
14 | with:
15 | node-version: "12"
16 | - name: Install svn
17 | run: sudo apt-get install subversion
18 | - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
19 | run: |
20 | npm i
21 | npm run prepare
22 | npm run build
23 | env:
24 | CI: false
25 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | node_modules
5 | .pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 | .idea
21 | package-json.lock
22 | package-lock.json
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 | yarn.lock
27 |
28 | # Remote docs
29 | src/content/Props
30 | react-native-elements
31 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "arrowParens": "always",
3 | "bracketSpacing": true,
4 | "embeddedLanguageFormatting": "auto",
5 | "htmlWhitespaceSensitivity": "css",
6 | "insertPragma": false,
7 | "jsxBracketSameLine": false,
8 | "jsxSingleQuote": false,
9 | "printWidth": 80,
10 | "proseWrap": "always",
11 | "quoteProps": "as-needed",
12 | "requirePragma": false,
13 | "semi": true,
14 | "singleQuote": false,
15 | "tabWidth": 2,
16 | "trailingComma": "es5",
17 | "useTabs": false,
18 | "vueIndentScriptAndStyle": false,
19 | "endOfLine": "auto"
20 | }
21 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "esbenp.prettier-vscode",
4 | "vscodeshift.material-ui-snippets",
5 | "dbaeumer.vscode-eslint"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | /* recommmended settings for vscode */
2 | {
3 | "editor.defaultFormatter": "esbenp.prettier-vscode",
4 | "editor.formatOnSave": true,
5 | "editor.rulers": [80],
6 | "editor.snippetSuggestions": "top",
7 | "[javascript]": {
8 | "editor.defaultFormatter": "esbenp.prettier-vscode",
9 | "editor.suggestSelection": "recentlyUsed",
10 | "editor.suggest.showKeywords": false
11 | },
12 | "files.exclude": {
13 | "USE_GITIGNORE": true
14 | },
15 | "search.exclude": {
16 | "**/node_modules": true,
17 | "**/bower_components": true,
18 | "**/coverage": true,
19 | "**/dist": true,
20 | "**/build": true,
21 | "**/.build": true,
22 | "**/.gh-pages": true
23 | },
24 | "editor.codeActionsOnSave": {
25 | "source.fixAll.eslint": false
26 | },
27 | "eslint.validate": [
28 | "javascript",
29 | "javascriptreact",
30 | "typescript",
31 | "typescriptreact"
32 | ],
33 | "eslint.options": {
34 | "env": {
35 | "browser": true,
36 | "jest/globals": true,
37 | "es6": true
38 | },
39 | "parserOptions": {
40 | "ecmaVersion": 2019,
41 | "sourceType": "module",
42 | "ecmaFeatures": {
43 | "jsx": true
44 | }
45 | },
46 | "rules": {
47 | "no-debugger": "off"
48 | }
49 | },
50 | "editor.formatOnPaste": false
51 | }
52 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2016 Nader Dabit
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | React Native Elements Playground 🚀
9 | React Native elements Playground is An interactive component playground. Which allows you to interact with different React Native Element Components.
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 | ### Installation
36 |
37 | 1. Clone the repo
38 |
39 | ```sh
40 | git clone https://github.com/react-native-elements/playground.git
41 | cd playground
42 | ```
43 |
44 | 2. Install NPM packages
45 |
46 | ```sh
47 | npm i
48 | ```
49 |
50 | 3. Prepare (File path is UNIX based, might not work with Windows. PR Appreciated)
51 |
52 | ```sh
53 | npm run prepare
54 | ```
55 |
56 | 4. Run the development server
57 |
58 | ```sh
59 | npm start
60 | ```
61 |
62 | ## Releated Projects
63 |
64 |
65 | - React Native Elements
66 |
67 |
68 | - React Native Elements Storybook
69 |
70 |
71 | - React Native Elements App
72 |
73 |
74 | ## Documentation
75 |
76 | [View the full docs of React Native elements here](https://reactnativeelements.com/docs/overview)
77 |
78 | ## Contributing
79 |
80 | Interested in contributing to this repo? Check out our
81 | [Contributing Guide](https://reactnativeelements.com/docs/contributing)
82 | and submit a PR for a new feature/bug fix.
83 |
84 | ### First Contributors
85 |
86 | We encourage everyone to contribute & submit PR's especially first-time
87 | contributors. Look for the label `Good First Issue` on the issues. Click
88 | [here](https://github.com/react-native-elements/playground/labels/%F0%9F%91%B6%20Good%20First%20Issue)
89 | to see them.
90 |
91 | If there is something you's like to see or request a new feature, please submit
92 | an
93 | [issue](https://github.com/react-native-elements/playground/issues/new/choose)
94 | or a
95 | [pull request](https://github.com/react-native-elements/playground/pulls).
96 |
97 | ### Slack Community
98 |
99 | In case you have any other question or would like to come say **Hi!** to the RNE
100 | community, join our [Slack team](https://react-native-elements-slack.herokuapp.com).
101 | See you on the other side! 👋😃
102 |
103 | ## Backers
104 |
105 | [Become a backer](https://opencollective.com/react-native-elements#backer) and show your support for React Native Elements.
106 |
107 | [](https://opencollective.com/react-native-elements/backer/0/website)
108 | [](https://opencollective.com/react-native-elements/backer/1/website)
109 | [](https://opencollective.com/react-native-elements/backer/2/website)
110 | [](https://opencollective.com/react-native-elements/backer/3/website)
111 | [](https://opencollective.com/react-native-elements/backer/4/website)
112 | [](https://opencollective.com/react-native-elements/backer/5/website)
113 | [](https://opencollective.com/react-native-elements/backer/6/website)
114 | [](https://opencollective.com/react-native-elements/backer/7/website)
115 | [](https://opencollective.com/react-native-elements/backer/8/website)
116 | [](https://opencollective.com/react-native-elements/backer/9/website)
117 | [](https://opencollective.com/react-native-elements/backer/10/website)
118 | [](https://opencollective.com/react-native-elements/backer/11/website)
119 | [](https://opencollective.com/react-native-elements/backer/12/website)
120 | [](https://opencollective.com/react-native-elements/backer/13/website)
121 | [](https://opencollective.com/react-native-elements/backer/14/website)
122 | [](https://opencollective.com/react-native-elements/backer/15/website)
123 | [](https://opencollective.com/react-native-elements/backer/16/website)
124 | [](https://opencollective.com/react-native-elements/backer/17/website)
125 | [](https://opencollective.com/react-native-elements/backer/18/website)
126 | [](https://opencollective.com/react-native-elements/backer/19/website)
127 | [](https://opencollective.com/react-native-elements/backer/20/website)
128 | [](https://opencollective.com/react-native-elements/backer/21/website)
129 | [](https://opencollective.com/react-native-elements/backer/22/website)
130 | [](https://opencollective.com/react-native-elements/backer/23/website)
131 | [](https://opencollective.com/react-native-elements/backer/24/website)
132 | [](https://opencollective.com/react-native-elements/backer/25/website)
133 | [](https://opencollective.com/react-native-elements/backer/26/website)
134 | [](https://opencollective.com/react-native-elements/backer/27/website)
135 | [](https://opencollective.com/react-native-elements/backer/28/website)
136 | [](https://opencollective.com/react-native-elements/backer/29/website)
137 |
138 | ## Sponsors
139 |
140 | Do you use React Native Elements in production? If so, consider supporting this project as it will allow the maintainers to dedicate more time to maintaining this project and also building new features for everyone. Also, your app or company's logo will show [on GitHub](https://github.com/react-native-elements/react-native-elements#sponsors) and link to your website - who doesn't want a little extra exposure? [Here's the info](https://opencollective.com/react-native-elements#sponsor).
141 |
142 | [](https://opencollective.com/react-native-elements/sponsor/0/website)
143 | [](https://opencollective.com/react-native-elements/sponsor/1/website)
144 | [](https://opencollective.com/react-native-elements/sponsor/2/website)
145 | [](https://opencollective.com/react-native-elements/sponsor/3/website)
146 | [](https://opencollective.com/react-native-elements/sponsor/4/website)
147 | [](https://opencollective.com/react-native-elements/sponsor/5/website)
148 | [](https://opencollective.com/react-native-elements/sponsor/6/website)
149 | [](https://opencollective.com/react-native-elements/sponsor/7/website)
150 | [](https://opencollective.com/react-native-elements/sponsor/8/website)
151 | [](https://opencollective.com/react-native-elements/sponsor/9/website)
152 | [](https://opencollective.com/react-native-elements/sponsor/10/website)
153 | [](https://opencollective.com/react-native-elements/sponsor/11/website)
154 | [](https://opencollective.com/react-native-elements/sponsor/12/website)
155 | [](https://opencollective.com/react-native-elements/sponsor/13/website)
156 | [](https://opencollective.com/react-native-elements/sponsor/14/website)
157 | [](https://opencollective.com/react-native-elements/sponsor/15/website)
158 | [](https://opencollective.com/react-native-elements/sponsor/16/website)
159 | [](https://opencollective.com/react-native-elements/sponsor/17/website)
160 | [](https://opencollective.com/react-native-elements/sponsor/18/website)
161 | [](https://opencollective.com/react-native-elements/sponsor/19/website)
162 |
--------------------------------------------------------------------------------
/config-overrides.js:
--------------------------------------------------------------------------------
1 | const path = require("path");
2 | const {
3 | override,
4 | addBabelPlugins,
5 | babelInclude,
6 | addWebpackAlias,
7 | addBabelPresets,
8 | } = require("customize-cra");
9 |
10 | module.exports = override(
11 | ...addBabelPlugins("@babel/plugin-proposal-class-properties"),
12 | ...addBabelPresets([
13 | "@babel/preset-env",
14 | {
15 | targets: {
16 | browsers: ["> 1%", "last 2 versions"],
17 | },
18 | modules: "commonjs",
19 | },
20 | ]),
21 | babelInclude(
22 | [
23 | path.resolve(__dirname, "node_modules/react-native-elements"),
24 | path.resolve(__dirname, "node_modules/react-native-vector-icons"),
25 | path.resolve(__dirname, "node_modules/react-native-ratings"),
26 | path.resolve(__dirname, "src"),
27 | ],
28 | addWebpackAlias({
29 | "react-native$": "react-native-web",
30 | "react-native-linear-gradient": "react-native-web-linear-gradient",
31 | })
32 | )
33 | );
34 |
--------------------------------------------------------------------------------
/injectLatestProps.js:
--------------------------------------------------------------------------------
1 | const { execSync } = require("child_process");
2 | const findRemoveSync = require("find-remove");
3 | const cpDir = require("copy-dir");
4 |
5 | /*
6 | * 1. find and delete any directory named react-native-elements
7 | * 2. find and delete any directory named Props
8 | * 3. clone the react-native-elements(https://github.com/react-native-elements/react-native-elements) repo
9 | * 4. copy Props folder from cloned repo into our project
10 | */
11 |
12 | try {
13 | // Point 1. depth=1 required (to avoid deleting node_modules/react-native-elements)
14 | let result = findRemoveSync(".", {
15 | maxLevel: 1,
16 | dir: "react-native-elements",
17 | });
18 | console.log("✔️ Removed ?: ", result);
19 |
20 | // Point 2
21 | result = findRemoveSync("./src/content", { dir: "Props" });
22 | console.log("✔️ Removed ?: ", result);
23 |
24 | // Point 3
25 | execSync(
26 | "git clone https://github.com/react-native-elements/react-native-elements --depth=1",
27 | (err, stdout, stderr) => {
28 | if (err) {
29 | // node couldn't execute the command
30 | return;
31 | }
32 | // the *entire* stdout and stderr (buffered)
33 | console.log(`stdout: ${stdout}`);
34 | console.log(`stderr: ${stderr}`);
35 | }
36 | );
37 | console.log("✔️ Cloned react-native-elements");
38 |
39 | execSync(
40 | "sed -i '/## Props/,$!d' ./react-native-elements/website/docs/main/*.mdx",
41 | (err, stdout, stderr) => {
42 | if (err) {
43 | // node couldn't execute the command
44 | return;
45 | }
46 | // the *entire* stdout and stderr (buffered)
47 | console.log(`stdout: ${stdout}`);
48 | console.log(`stderr: ${stderr}`);
49 | }
50 | );
51 |
52 | // Point 4
53 | cpDir.sync(
54 | "./react-native-elements/website/docs/main",
55 | "./src/content/Props"
56 | );
57 | console.log("✔️ Copied Props to src/content/Props");
58 | } catch (err) {
59 | console.error(err);
60 | return;
61 | }
62 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-elements-playground",
3 | "version": "3.0.0",
4 | "private": true,
5 | "homepage": "https://react-native-elements.js.org",
6 | "dependencies": {
7 | "@material-ui/core": "^4.11.0",
8 | "@material-ui/icons": "^4.9.1",
9 | "@material-ui/styles": "^4.10.0",
10 | "@react-native-community/toolbar-android": "^0.1.0-rc.2",
11 | "copy-dir": "^1.3.0",
12 | "find-remove": "^3.0.0",
13 | "history": "^5.0.0",
14 | "mdx.macro": "^0.2.9",
15 | "modal-react-native-web": "^0.2.0",
16 | "react": "^16.13.0",
17 | "react-dom": "^16.13.0",
18 | "react-helmet": "^6.1.0",
19 | "react-lottie": "^1.2.3",
20 | "react-native-elements": "*",
21 | "react-native-safe-area-context": "^3.2.0",
22 | "react-native-vector-icons": "^6.7.0",
23 | "react-native-web": "^0.12.0",
24 | "react-native-web-linear-gradient": "^1.1.1",
25 | "react-router-dom": "^5.2.0",
26 | "react-scripts": "3.4.1",
27 | "react-view": "^2.3.2"
28 | },
29 | "scripts": {
30 | "start": "react-app-rewired start",
31 | "build": "react-app-rewired build",
32 | "test": "react-app-rewired test",
33 | "eject": "react-scripts eject",
34 | "predeploy": "npm run build",
35 | "prepare": "node injectLatestProps.js",
36 | "deploy": "gh-pages -d build",
37 | "postinstall": "patch-package",
38 | "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|json)\" --ignore-unknown",
39 | "format": "npm run prettier -- --write",
40 | "check-format": "npm run prettier -- --check",
41 | "lint": "eslint --ignore-path .gitignore . --fix",
42 | "check-lint": "eslint --ignore-path .gitignore .",
43 | "make-consistent": "npm run format && npm run lint",
44 | "validate": "npm run check-format && npm run check-lint"
45 | },
46 | "eslintConfig": {
47 | "extends": "react-app"
48 | },
49 | "browserslist": {
50 | "production": [">0.2%", "not dead", "not op_mini all"],
51 | "development": [
52 | "last 1 chrome version",
53 | "last 1 firefox version",
54 | "last 1 safari version"
55 | ]
56 | },
57 | "devDependencies": {
58 | "@babel/plugin-proposal-class-properties": "^7.10.4",
59 | "@babel/preset-env": "^7.13.12",
60 | "customize-cra": "^1.0.0",
61 | "eslint-plugin-jest": "^24.3.5",
62 | "eslint-plugin-json": "^2.1.2",
63 | "eslint-plugin-jsx-a11y": "^6.4.1",
64 | "eslint-plugin-react": "^7.23.2",
65 | "eslint-plugin-react-hooks": "^4.2.0",
66 | "gh-pages": "^3.1.0",
67 | "husky": "^6.0.0",
68 | "lint-staged": "^10.5.4",
69 | "patch-package": "^6.2.2",
70 | "postinstall-postinstall": "^2.1.0",
71 | "prettier": "^2.2.1",
72 | "react-app-rewired": "^2.1.6"
73 | },
74 | "husky": {
75 | "hooks": {
76 | "pre-commit": "lint-staged"
77 | }
78 | },
79 | "lint-staged": {
80 | "*.{js,jsx,css,md,json}": ["npm run validate", "git add"]
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/patches/@react-native-community+toolbar-android+0.1.0-rc.2.patch:
--------------------------------------------------------------------------------
1 | diff --git a/node_modules/@react-native-community/toolbar-android/js/ToolbarAndroid.web.js b/node_modules/@react-native-community/toolbar-android/js/ToolbarAndroid.web.js
2 | index 31f0017..c7aaafc 100644
3 | --- a/node_modules/@react-native-community/toolbar-android/js/ToolbarAndroid.web.js
4 | +++ b/node_modules/@react-native-community/toolbar-android/js/ToolbarAndroid.web.js
5 | @@ -7,12 +7,12 @@
6 | * @format
7 | */
8 |
9 | -'use strict';
10 | +"use strict";
11 |
12 | let m;
13 | try {
14 | // This is an optional dependency. However, webpack might still show warning message.
15 | - m = require('react-native/Libraries/Components/UnimplementedViews/UnimplementedView');
16 | + m = require("react-native-web/dist/modules/UnimplementedView");
17 | } catch {
18 | // If failed to find react-native UnimplementedView, just returns an empty module so
19 | // this won't cause bundling related error, however any subsequent attempt of using this module
20 |
--------------------------------------------------------------------------------
/public/CNAME:
--------------------------------------------------------------------------------
1 | react-native-elements.js.org
--------------------------------------------------------------------------------
/public/_redirects:
--------------------------------------------------------------------------------
1 | /* /index.html 200
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/react-native-elements/playground/c6ac9e9a88110c2f1d367b556cb7adbced6e4693/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
13 |
14 |
23 | Playground | React Native Elements
24 |
28 |
32 |
33 |
37 |
46 |
47 |
48 |
49 |
50 | Playground 🚀 | React Native Elements
51 |
52 |
56 |
57 |
58 |
59 |
60 |
61 |
65 |
69 |
70 |
71 |
72 |
76 |
80 |
84 |
88 |
89 |
95 |
96 | You need to enable JavaScript to run this app.
97 |
98 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/react-native-elements/playground/c6ac9e9a88110c2f1d367b556cb7adbced6e4693/public/logo.png
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/react-native-elements/playground/c6ac9e9a88110c2f1d367b556cb7adbced6e4693/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/react-native-elements/playground/c6ac9e9a88110c2f1d367b556cb7adbced6e4693/public/logo512.png
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/public/netlify.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | command = "npm run prepare && npm run build"
3 | publish = "build/"
4 | base = "/"
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 |
--------------------------------------------------------------------------------
/public/thumbnail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/react-native-elements/playground/c6ac9e9a88110c2f1d367b556cb7adbced6e4693/public/thumbnail.png
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | animation: App-logo-spin infinite 20s linear;
7 | height: 40vmin;
8 | pointer-events: none;
9 | }
10 |
11 | .App-header {
12 | background-color: #282c34;
13 | min-height: 100vh;
14 | display: flex;
15 | flex-direction: column;
16 | align-items: center;
17 | justify-content: center;
18 | font-size: calc(10px + 2vmin);
19 | color: white;
20 | }
21 |
22 | .App-link {
23 | color: #61dafb;
24 | }
25 |
26 | @keyframes App-logo-spin {
27 | from {
28 | transform: rotate(0deg);
29 | }
30 | to {
31 | transform: rotate(360deg);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {
3 | SafeAreaInsetsContext,
4 | SafeAreaProvider,
5 | } from "react-native-safe-area-context";
6 |
7 | import Root from "./containers";
8 | import "./App.css";
9 | function App() {
10 | return (
11 |
12 |
13 |
28 |
29 |
30 |
31 | );
32 | }
33 |
34 | export default App;
35 |
--------------------------------------------------------------------------------
/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | // eslint-disable-next-line jest/expect-expect
6 | it("renders without crashing", () => {
7 | const div = document.createElement("div");
8 | ReactDOM.render( , div);
9 | ReactDOM.unmountComponentAtNode(div);
10 | });
11 |
--------------------------------------------------------------------------------
/src/assets/RNE_Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/react-native-elements/playground/c6ac9e9a88110c2f1d367b556cb7adbced6e4693/src/assets/RNE_Logo.png
--------------------------------------------------------------------------------
/src/assets/SVG/bootstrap.svg:
--------------------------------------------------------------------------------
1 | drawkit-grape-pack-illustration-14
--------------------------------------------------------------------------------
/src/assets/SVG/design.svg:
--------------------------------------------------------------------------------
1 | drawkit-grape-pack-illustration-18
--------------------------------------------------------------------------------
/src/assets/SVG/explore.svg:
--------------------------------------------------------------------------------
1 | drawkit-grape-pack-illustration-10
--------------------------------------------------------------------------------
/src/assets/SVG/tweak.svg:
--------------------------------------------------------------------------------
1 | drawkit-grape-pack-illustration-17
--------------------------------------------------------------------------------
/src/assets/sample.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/react-native-elements/playground/c6ac9e9a88110c2f1d367b556cb7adbced6e4693/src/assets/sample.jpg
--------------------------------------------------------------------------------
/src/components/Footer/Footer.module.css:
--------------------------------------------------------------------------------
1 | footer {
2 | margin-top: 2rem;
3 | width: 100%;
4 | background: #212121;
5 | color: #fafafa;
6 | padding: 1rem;
7 | bottom: 0;
8 | }
9 |
10 | .footer_product_info {
11 | font-weight: 200;
12 | font-style: italic;
13 | color: #cac8c8;
14 | }
15 |
16 | .footer_product_img {
17 | width: 150px;
18 | padding: 1rem 0;
19 | display: block;
20 | transition: transform 0.2s;
21 | margin-bottom: 5px;
22 | }
23 |
24 | .footer_product_img:hover {
25 | transform: scale(1.09);
26 | }
27 |
28 | .footer_github_img {
29 | margin-right: 10px;
30 | transition: transform 0.2s;
31 | }
32 | .footer_github_img:hover {
33 | transform: scale(1.09);
34 | }
35 |
36 | .netlify_img {
37 | transition: transform 0.2s;
38 | }
39 | .netlify_img:hover {
40 | transform: scale(1.3);
41 | }
42 |
--------------------------------------------------------------------------------
/src/components/Footer/index.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Link } from "react-router-dom";
3 | import {
4 | Paper,
5 | Grid,
6 | ListItem,
7 | Typography,
8 | Button,
9 | Divider,
10 | } from "@material-ui/core";
11 | import pjson from "../../../package.json";
12 | import styles from "./Footer.module.css";
13 |
14 | function Footer() {
15 | return (
16 |
98 | );
99 | }
100 |
101 | export default Footer;
102 |
--------------------------------------------------------------------------------
/src/components/PropDrawer/index.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import clsx from "clsx";
3 | import { makeStyles } from "@material-ui/core/styles";
4 |
5 | import { Drawer, Fab } from "@material-ui/core";
6 |
7 | export default function TemporaryDrawer(props) {
8 | const [state, setState] = React.useState({
9 | right: false,
10 | });
11 |
12 | const toggleDrawer = (anchor, open) => (event) => {
13 | if (
14 | event.type === "keydown" &&
15 | (event.key === "Tab" || event.key === "Shift")
16 | ) {
17 | return;
18 | }
19 |
20 | setState({ ...state, [anchor]: open });
21 | };
22 |
23 | return (
24 |
25 |
26 |
37 | Prop Explorer
38 |
39 |
44 |
51 | {props.children}
52 |
53 |
54 |
55 |
56 | );
57 | }
58 |
--------------------------------------------------------------------------------
/src/components/playground/index.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 |
3 | import {
4 | Compiler,
5 | Knobs,
6 | Editor,
7 | Error,
8 | ActionButtons,
9 | Placeholder,
10 | } from "react-view";
11 |
12 | export default ({ params, containerStyle = {} }) => {
13 | return (
14 |
15 |
22 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | );
35 | };
36 |
--------------------------------------------------------------------------------
/src/containers/Drawer/index.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import PropTypes from "prop-types";
3 | import AppBar from "@material-ui/core/AppBar";
4 | import CssBaseline from "@material-ui/core/CssBaseline";
5 |
6 | import Drawer from "@material-ui/core/Drawer";
7 | import Hidden from "@material-ui/core/Hidden";
8 | import IconButton from "@material-ui/core/IconButton";
9 |
10 | import List from "@material-ui/core/List";
11 | import ListItem from "@material-ui/core/ListItem";
12 | import { GitHub } from "@material-ui/icons";
13 | import ListItemText from "@material-ui/core/ListItemText";
14 |
15 | import MenuIcon from "@material-ui/icons/Menu";
16 | import Toolbar from "@material-ui/core/Toolbar";
17 | import Typography from "@material-ui/core/Typography";
18 | import Brightness2Icon from "@material-ui/icons/Brightness2";
19 | import WbSunnyIcon from "@material-ui/icons/WbSunny";
20 | import { Button, Container } from "@material-ui/core";
21 | import { makeStyles, useTheme } from "@material-ui/core/styles";
22 |
23 | import Navigation from "../Navigation";
24 | import { Link } from "react-router-dom";
25 | import { Components_Index } from "../Navigation";
26 |
27 | const drawerWidth = 200;
28 |
29 | const useStyles = makeStyles((theme) => ({
30 | root: {
31 | display: "flex",
32 | },
33 | drawer: {
34 | [theme.breakpoints.up("sm")]: {
35 | width: drawerWidth,
36 | flexShrink: 0,
37 | },
38 | },
39 | appBar: {
40 | [theme.breakpoints.up("sm")]: {
41 | width: `calc(100% - ${drawerWidth}px)`,
42 | marginLeft: drawerWidth,
43 | },
44 | zIndex: theme.zIndex.drawer + 1,
45 | },
46 | menuButton: {
47 | marginRight: theme.spacing(2),
48 | [theme.breakpoints.up("sm")]: {
49 | display: "none",
50 | },
51 | },
52 | // necessary for content to be below app bar
53 | toolbar: theme.mixins.toolbar,
54 | drawerPaper: {
55 | width: drawerWidth,
56 | },
57 | content: {
58 | flexGrow: 1,
59 | paddingTop: "1.5rem",
60 | minHeight: "100vh",
61 | },
62 |
63 | sideListItem: {
64 | transition: "0.1s all ease-in",
65 | "&:hover": {
66 | borderRight: "5px solid #2089dc",
67 | },
68 | "&:focus": {
69 | borderRight: "5px solid #2089dc",
70 | },
71 | },
72 | }));
73 |
74 | function ResponsiveDrawer(props) {
75 | const { window, darkState, handleThemeChange } = props;
76 | const classes = useStyles();
77 | const theme = useTheme();
78 | const [mobileOpen, setMobileOpen] = React.useState(false);
79 | const [selectedIndex, setSelectedIndex] = React.useState(-1);
80 |
81 | const handleDrawerToggle = (value) => {
82 | if (value === false) {
83 | setMobileOpen(false);
84 | } else {
85 | setMobileOpen(true);
86 | }
87 | };
88 |
89 | const handleListItemClick = (event, index) => {
90 | setSelectedIndex(index);
91 | };
92 |
93 | const drawer = (
94 |
95 |
96 | handleDrawerToggle(false)}>
97 |
98 | Playground{" "}
99 |
100 | 🚀
101 |
102 |
103 |
104 |
105 |
106 | {Components_Index.map((elm, index) => (
107 | handleDrawerToggle(false)}
111 | >
112 | handleListItemClick(event, index)}
117 | className={classes.sideListItem}
118 | >
119 |
120 |
121 |
122 | ))}
123 |
124 |
125 | );
126 |
127 | const container =
128 | window !== undefined ? () => window().document.body : undefined;
129 |
130 | return (
131 |
132 |
133 |
134 |
135 |
142 |
143 |
144 |
145 |
146 | React Native Elements
147 |
148 |
149 |
150 |
151 | {darkState ? : }
152 |
153 |
158 | Docs
159 |
160 |
166 |
167 |
168 |
169 |
170 |
171 |
172 | {/* The implementation can be swapped with js to avoid SEO duplication of links. */}
173 |
174 | handleDrawerToggle(false)}
180 | classes={{
181 | paper: classes.drawerPaper,
182 | }}
183 | ModalProps={{
184 | keepMounted: true, // Better open performance on mobile.
185 | }}
186 | >
187 | {drawer}
188 |
189 |
190 |
191 |
198 | {drawer}
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 | );
210 | }
211 |
212 | ResponsiveDrawer.propTypes = {
213 | /**
214 | * Injected by the documentation to work in an iframe.
215 | * You won't need it on your project.
216 | */
217 | window: PropTypes.func,
218 | };
219 |
220 | export default ResponsiveDrawer;
221 |
--------------------------------------------------------------------------------
/src/containers/Navigation/index.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import {
4 | BrowserRouter as Router,
5 | Switch,
6 | Route,
7 | Link,
8 | Redirect,
9 | } from "react-router-dom";
10 | import { Helmet } from "react-helmet";
11 |
12 | import Footer from "../../components/Footer";
13 |
14 | // Pages
15 | import HomePage from "../../pages/home";
16 | import ExplorePage from "../../pages/explore";
17 | // Playground
18 | import Avatar from "../../content/Avatar";
19 | import Button from "../../content/Button";
20 | import Badge from "../../content/Badge";
21 | import Tile from "../../content/Tile";
22 | import Tab from "../../content/Tab";
23 | import Card from "../../content/Card";
24 | import ToolTip from "../../content/ToolTip";
25 | import Text from "../../content/Text";
26 | import SocialIcon from "../../content/SocialIcon";
27 | import Slider from "../../content/Slider";
28 | import SearchBar from "../../content/SearchBar";
29 | import SpeedDial from "../../content/SpeedDial";
30 | import Rating from "../../content/Rating";
31 | import AirbnbRating from "../../content/AirbnbRating";
32 | import Pricing from "../../content/Pricing";
33 | import Overlay from "../../content/Overlay";
34 | import ListItem from "../../content/ListItem";
35 | import LinearProgress from "../../content/LinearProgress";
36 | import Input from "../../content/Input";
37 | import Image from "../../content/Image";
38 | import Icon from "../../content/Icon";
39 | import Header from "../../content/Header";
40 | import CheckBox from "../../content/CheckBox";
41 | import BottomSheet from "../../content/BottomSheet";
42 | import ButtonGroup from "../../content/ButtonGroup";
43 | import Divider from "../../content/Divider";
44 | import FAB from "../../content/FAB";
45 | import SwitchComponent from "../../content/Switch";
46 |
47 | export const Components_Index = [
48 | {
49 | name: "Avatar",
50 | component: Avatar,
51 | path: "/avatar",
52 | },
53 | {
54 | name: "Badge",
55 | component: Badge,
56 | path: "/badge",
57 | },
58 | {
59 | name: "BottomSheet",
60 | component: BottomSheet,
61 | path: "/bottom-sheet",
62 | },
63 | {
64 | name: "Button",
65 | component: Button,
66 | path: "/button",
67 | },
68 | {
69 | name: "ButtonGroup",
70 | component: ButtonGroup,
71 | path: "/button-group",
72 | },
73 | {
74 | name: "Card",
75 | component: Card,
76 | path: "/card",
77 | },
78 | {
79 | name: "CheckBox",
80 | component: CheckBox,
81 | path: "/checkbox",
82 | },
83 |
84 | {
85 | name: "Divider",
86 | component: Divider,
87 | path: "/divider",
88 | },
89 | {
90 | name: "FAB",
91 | component: FAB,
92 | path: "/fab",
93 | },
94 |
95 | {
96 | name: "Header",
97 | component: Header,
98 | path: "/header",
99 | },
100 |
101 | {
102 | name: "Icon",
103 | component: Icon,
104 | path: "/icon",
105 | },
106 |
107 | {
108 | name: "Image",
109 | component: Image,
110 | path: "/image",
111 | },
112 |
113 | {
114 | name: "Input",
115 | component: Input,
116 | path: "/input",
117 | },
118 | {
119 | name: "LinearProgress",
120 | component: LinearProgress,
121 | path: "/linear-progress",
122 | },
123 | {
124 | name: "ListItem",
125 | component: ListItem,
126 | path: "/list-item",
127 | },
128 |
129 | {
130 | name: "Overlay",
131 | component: Overlay,
132 | path: "/overlay",
133 | },
134 |
135 | {
136 | name: "Pricing",
137 | component: Pricing,
138 | path: "/pricing",
139 | },
140 |
141 | {
142 | name: "Rating",
143 | component: Rating,
144 | path: "/rating",
145 | },
146 | {
147 | name: "Rating (Airbnb)",
148 | component: AirbnbRating,
149 | path: "/airbnb-rating",
150 | },
151 |
152 | {
153 | name: "SearchBar",
154 | component: SearchBar,
155 | path: "/search-bar",
156 | },
157 |
158 | {
159 | name: "Slider",
160 | component: Slider,
161 | path: "/slider",
162 | },
163 | {
164 | name: "SocialIcon",
165 | component: SocialIcon,
166 | path: "/social-icon",
167 | },
168 | {
169 | name: "SpeedDial",
170 | component: SpeedDial,
171 | path: "/speed-dial",
172 | },
173 | {
174 | name: "Tab",
175 | component: Tab,
176 | path: "/tab",
177 | },
178 | {
179 | name: "Switch",
180 | component: SwitchComponent,
181 | path: "/switch",
182 | },
183 | {
184 | name: "Text",
185 | component: Text,
186 | path: "/text",
187 | },
188 | {
189 | name: "Tile",
190 | component: Tile,
191 | path: "/tile",
192 | },
193 | {
194 | name: "ToolTip",
195 | component: ToolTip,
196 | path: "/tooltip",
197 | },
198 | ];
199 |
200 | export default function App() {
201 | return (
202 |
203 |
204 | {Components_Index.map((elm, idx) => {
205 | return (
206 |
207 |
208 |
209 | {elm.name} | Playground 🚀 - React Native Elements
210 |
211 |
212 |
213 |
214 | );
215 | })}
216 |
217 |
218 |
219 | Explore | Playground{" "}
220 |
221 | 🚀
222 | {" "}
223 | - React Native Elements
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 | );
236 | }
237 |
--------------------------------------------------------------------------------
/src/containers/Spinner/index.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import CircularProgress from "@material-ui/core/CircularProgress";
4 | import { makeStyles } from "@material-ui/core/styles";
5 |
6 | const useStyles = makeStyles((theme) => ({
7 | progress: {
8 | display: "flex",
9 | "& > * + *": {
10 | marginLeft: theme.spacing(2),
11 | },
12 | },
13 | }));
14 |
15 | export default function Spinner() {
16 | const classes = useStyles();
17 |
18 | return (
19 |
20 |
21 |
22 | );
23 | }
24 |
--------------------------------------------------------------------------------
/src/containers/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import Drawer from "./Drawer";
3 | import { ThemeProvider, createMuiTheme } from "@material-ui/core/styles";
4 | import { HashRouter as Router } from "react-router-dom";
5 | import { useEffect } from "react";
6 |
7 | export default function () {
8 | const [darkState, setDarkState] = useState(
9 | () => JSON.parse(localStorage.getItem("dark")) || false
10 | );
11 |
12 | const palletType = darkState ? "dark" : "light";
13 | const theme = createMuiTheme({
14 | palette: {
15 | type: palletType,
16 | primary: {
17 | main: darkState ? "#242526" : "#2089dc",
18 | },
19 | },
20 | });
21 |
22 | const handleThemeChange = () => {
23 | setDarkState(!darkState);
24 | };
25 |
26 | useEffect(() => {
27 | localStorage.setItem("dark", JSON.stringify(darkState));
28 | }, [darkState]);
29 |
30 | return (
31 |
32 |
33 |
34 |
35 |
36 | );
37 | }
38 |
--------------------------------------------------------------------------------
/src/content/AirbnbRating/airbnbrating.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { AirbnbRating } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const AirbnbRatingPlayground = () => {
7 | const params = useView({
8 | componentName: "AirbnbRating",
9 | props: {
10 | count: {
11 | type: PropTypes.Number,
12 | value: 5,
13 | },
14 | defaultRating: {
15 | type: PropTypes.Number,
16 | value: 1,
17 | },
18 | reviews: {
19 | type: PropTypes.Array,
20 | value: `["Terrible", "Bad", "Okay", "Good", "Great"]`,
21 | },
22 |
23 | onFinishRating: {
24 | type: PropTypes.Function,
25 | value: `() => console.log("onFinishRating()")`,
26 | },
27 |
28 | showRating: {
29 | type: PropTypes.Boolean,
30 | value: true,
31 | },
32 | },
33 | scope: {
34 | AirbnbRating,
35 | },
36 | imports: {
37 | "react-native-elements": {
38 | named: ["AirbnbRating"],
39 | },
40 | },
41 | });
42 |
43 | return (
44 |
45 |
46 |
47 | );
48 | };
49 |
50 | export default AirbnbRatingPlayground;
51 |
--------------------------------------------------------------------------------
/src/content/AirbnbRating/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./airbnbrating.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Rating.mdx"));
9 |
10 | export default function AirbnbPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Avatar/avatar.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Avatar } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const AvatarPlay = () => {
7 | const params = useView({
8 | componentName: "Avatar",
9 | props: {
10 | activeOpacity: {
11 | value: 0.2,
12 | type: PropTypes.Number,
13 | },
14 | avatarStyle: {
15 | value: `{}`,
16 | type: PropTypes.Object,
17 | },
18 | containerStyle: {
19 | value: `{ backgroundColor: '#BDBDBD' }`,
20 | type: PropTypes.Object,
21 | },
22 | icon: {
23 | value: `{}`,
24 | type: PropTypes.Object,
25 | },
26 | iconStyle: {
27 | value: `{}`,
28 | type: PropTypes.Object,
29 | },
30 | imageProps: {
31 | value: `{}`,
32 | type: PropTypes.Object,
33 | },
34 | onLongPress: {
35 | value: `()=>alert('onLongPress')`,
36 | type: PropTypes.Function,
37 | },
38 | onPress: {
39 | value: `()=>alert('onPress')`,
40 | type: PropTypes.Function,
41 | },
42 |
43 | overlayContainerStyle: {
44 | value: `{}`,
45 | type: PropTypes.Object,
46 | },
47 | placeholderStyle: {
48 | value: `{}`,
49 | type: PropTypes.Object,
50 | },
51 | rounded: {
52 | value: true,
53 | type: PropTypes.Boolean,
54 | description: "Indicates that the button is disabled",
55 | },
56 | size: {
57 | value: "large",
58 | options: {
59 | small: "small",
60 | medium: "medium",
61 | large: "large",
62 | xlarge: "xlarge",
63 | },
64 | type: PropTypes.Enum,
65 | description: "Defines the size of the Avatar",
66 | },
67 |
68 | source: {
69 | value: `{uri:""}`,
70 | type: PropTypes.Object,
71 | },
72 | title: {
73 | value: "P",
74 | type: PropTypes.String,
75 | description: "Visible label.",
76 | },
77 | titleStyle: {
78 | value: `{}`,
79 | type: PropTypes.Object,
80 | },
81 | renderPlaceholderContent: {
82 | type: PropTypes.ReactNode,
83 | },
84 | Component: {
85 | type: PropTypes.ReactNode,
86 | },
87 | ImageComponent: {
88 | type: PropTypes.ReactNode,
89 | },
90 | // titleProps: {
91 | // value: `{}`,
92 | // type: PropTypes.Object,
93 | // },
94 | // titleStyle: {
95 | // value: `{marginHorizontal: 5}`,
96 | // type: PropTypes.Object,
97 | // },
98 | // type: {
99 | // value: "solid",
100 | // defaultValue: "solid",
101 | // options: { solid: "Solid", clear: "Clear", outline: "Outline" },
102 | // type: PropTypes.Enum,
103 | // description: "Defines the type of the button.",
104 | // },
105 | },
106 | scope: {
107 | Avatar,
108 | },
109 | imports: {
110 | "react-native-elements": {
111 | named: ["Avatar"],
112 | },
113 | },
114 | });
115 |
116 | return (
117 |
118 |
119 |
120 | );
121 | };
122 |
123 | export default AvatarPlay;
124 |
--------------------------------------------------------------------------------
/src/content/Avatar/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./avatar.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Avatar.mdx"));
9 |
10 | export default function Avatar() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Badge/badge.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Badge } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const BadgePlayground = () => {
7 | const params = useView({
8 | componentName: "Badge",
9 | props: {
10 | badgeStyle: {
11 | value: `{}`,
12 |
13 | type: PropTypes.Object,
14 | },
15 | containerStyle: {
16 | value: `{}`,
17 | defaultValue: {},
18 | type: PropTypes.Object,
19 | },
20 | onPress: {
21 | value: `() => {alert("onPress");}`,
22 | type: PropTypes.Function,
23 | },
24 | status: {
25 | value: "primary",
26 | options: {
27 | primary: "primary",
28 | success: "success",
29 | warning: "warning",
30 | error: "error",
31 | },
32 | type: PropTypes.Enum,
33 | description: "Defines the type of the button.",
34 | },
35 | textProps: {
36 | value: `{}`,
37 | type: PropTypes.Object,
38 | },
39 | textStyle: {
40 | value: `{color:"#EFE"}`,
41 | type: PropTypes.Object,
42 | },
43 | value: {
44 | type: PropTypes.String,
45 | value: "Hello 👋",
46 | },
47 | Component: {
48 | defaultValue: null,
49 | type: PropTypes.Object,
50 | },
51 | options: {
52 | value: `{}`,
53 | type: PropTypes.Object,
54 | },
55 | },
56 | scope: {
57 | Badge,
58 | },
59 | imports: {
60 | "react-native-elements": {
61 | named: ["Badge"],
62 | },
63 | },
64 | });
65 |
66 | return (
67 |
68 |
69 |
70 | );
71 | };
72 |
73 | export default BadgePlayground;
74 |
--------------------------------------------------------------------------------
/src/content/Badge/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./badge.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Badge.mdx"));
9 |
10 | export default function TilePlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/BottomSheet/bottomsheet.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { useState } from "react";
3 | import { View } from "react-native";
4 | import { BottomSheet, Text } from "react-native-elements";
5 |
6 | import Playground from "../../components/playground";
7 | import { useView, PropTypes } from "react-view";
8 |
9 | const BottomSheetPlayground = () => {
10 | const params = useView({
11 | componentName: "BottomSheet",
12 | props: {
13 | children: {
14 | type: PropTypes.ReactNode,
15 | value: `Some Content `,
16 | },
17 | isVisible: {
18 | type: PropTypes.Boolean,
19 | value: false,
20 | },
21 | modalProps: {
22 | type: PropTypes.Object,
23 | value: `{ presentationStyle: "fullScreen" , visible:true}`,
24 | description: "Modal Props -> https://reactnative.dev/docs/modal",
25 | },
26 | containerStyle: {
27 | value: `{}`,
28 | type: PropTypes.Object,
29 | },
30 | },
31 | scope: {
32 | BottomSheet,
33 | Text,
34 | },
35 | imports: {
36 | "react-native-elements": {
37 | named: ["BottomSheet", "Text"],
38 | },
39 | },
40 | });
41 |
42 | return (
43 |
44 |
45 |
46 | );
47 | };
48 |
49 | export default BottomSheetPlayground;
50 |
--------------------------------------------------------------------------------
/src/content/BottomSheet/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./bottomsheet.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/BottomSheet.mdx"));
9 | export default function BottomSheetPlayground() {
10 | return (
11 |
12 |
13 |
}>
14 |
15 |
16 |
17 |
18 |
19 | );
20 | }
21 |
--------------------------------------------------------------------------------
/src/content/Button/button.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Button } from "react-native-elements";
3 | import Icon from "react-native-vector-icons/dist/MaterialCommunityIcons";
4 | import LinearGradient from "react-native-web-linear-gradient";
5 | import Playground from "../../components/playground";
6 |
7 | import { useView, PropTypes } from "react-view";
8 |
9 | export default () => {
10 | const params = useView({
11 | componentName: "Button",
12 | props: {
13 | buttonStyle: {
14 | value: `{ width: 150 }`,
15 | type: PropTypes.Object,
16 | },
17 | containerStyle: {
18 | defaultValue: `{}`,
19 | value: `{margin: 5 }`,
20 | type: PropTypes.Object,
21 | },
22 | disabled: {
23 | value: false,
24 | type: PropTypes.Boolean,
25 | description: "Indicates that the button is disabled",
26 | },
27 | disabledStyle: {
28 | value: `{ borderWidth:2, borderColor:"#00F" }`,
29 | type: PropTypes.Object,
30 | description: "",
31 | },
32 | disabledTitleStyle: {
33 | value: `{ color:'#00F' }`,
34 | type: PropTypes.Object,
35 | description: "",
36 | },
37 | linearGradientProps: {
38 | value: `null`,
39 | type: PropTypes.Object,
40 | },
41 | ViewComponent: {
42 | value: ``,
43 | type: PropTypes.ReactNode,
44 | },
45 | icon: {
46 | value: ` `,
51 | // value: `dsf
`,
52 | type: PropTypes.ReactNode,
53 | },
54 | iconContainerStyle: {
55 | value: `{background:'#000'}`,
56 | type: PropTypes.Object,
57 | },
58 | iconRight: {
59 | value: false,
60 | type: PropTypes.Boolean,
61 | description: "Indicates that the button is disabled",
62 | },
63 | loading: {
64 | value: false,
65 | type: PropTypes.Boolean,
66 | description: "Indicates that the loading state",
67 | },
68 | loadingProps: {
69 | value: `{animating:true}`,
70 | type: PropTypes.Object,
71 | },
72 | loadingStyle: {
73 | value: `{}`,
74 | type: PropTypes.Object,
75 | },
76 | onPress: {
77 | value: '() => alert("click")',
78 | type: PropTypes.Function,
79 | description: "Function called when button is clicked.",
80 | },
81 | raised: {
82 | value: false,
83 | type: PropTypes.Boolean,
84 | description: "Indicates that the button is disabled",
85 | },
86 | title: {
87 | value: "Hello",
88 | type: PropTypes.String,
89 | description: "Visible label.",
90 | },
91 | titleProps: {
92 | value: `{}`,
93 | type: PropTypes.Object,
94 | },
95 | titleStyle: {
96 | value: `{marginHorizontal: 5}`,
97 | type: PropTypes.Object,
98 | },
99 | type: {
100 | value: "solid",
101 | defaultValue: "solid",
102 | options: { solid: "Solid", clear: "Clear", outline: "Outline" },
103 | type: PropTypes.Enum,
104 | description: "Defines the type of the button.",
105 | },
106 | },
107 | scope: {
108 | Button,
109 | Icon,
110 | LinearGradient,
111 | },
112 | imports: {
113 | "react-native-elements": {
114 | named: ["Button"],
115 | },
116 | "react-native-vector-icons/dist/MaterialCommunityIcons": {
117 | default: "Icon",
118 | },
119 | "react-native-linear-gradient": {
120 | default: "LinearGradient",
121 | },
122 | },
123 | });
124 |
125 | return (
126 |
127 |
128 |
129 | );
130 | };
131 |
--------------------------------------------------------------------------------
/src/content/Button/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Component, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./button.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Button.mdx"));
9 |
10 | class App extends Component {
11 | render() {
12 | return (
13 |
14 |
15 |
}>
16 |
17 |
18 |
19 |
20 |
21 | );
22 | }
23 | }
24 | export default App;
25 |
--------------------------------------------------------------------------------
/src/content/ButtonGroup/buttongroup.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { ButtonGroup } from "react-native-elements";
3 |
4 | import Playground from "../../components/playground";
5 | import { useView, PropTypes } from "react-view";
6 |
7 | const ButtonGroupPlayground = () => {
8 | const params = useView({
9 | componentName: "ButtonGroup",
10 | props: {
11 | buttonStyle: {
12 | type: PropTypes.Object,
13 | value: `{width:100}`,
14 | },
15 | buttonContainerStyle: { type: PropTypes.Object, value: `{}` },
16 | buttons: {
17 | type: PropTypes.Array,
18 | value: `['Hello', 'World', 'React',"Native","Elements"]`,
19 | },
20 | Component: {
21 | type: PropTypes.ReactNode,
22 | description:
23 | "React Native Component TouchableOpacity (ios) or TouchableNativeFeedback (android)",
24 | value: null,
25 | },
26 | containerStyle: { type: PropTypes.Object, value: `{}` },
27 | disabled: {
28 | type: PropTypes.Array,
29 | description:
30 | "boolean OR number[]. Controls if buttons are disabled. Setting true makes all of them disabled, while using an array only makes those indices disabled.",
31 |
32 | value: `[3,4]`,
33 | },
34 | disabledStyle: {
35 | type: PropTypes.Object,
36 | value: `{}`,
37 | },
38 | disabledTextStyle: {
39 | type: PropTypes.Object,
40 | value: `{}`,
41 | },
42 | disabledSelectedStyle: {
43 | type: PropTypes.Object,
44 | value: `{}`,
45 | },
46 | disabledSelectedTextStyle: {
47 | type: PropTypes.Object,
48 | value: `{}`,
49 | },
50 | innerBorderStyle: {
51 | type: PropTypes.Object,
52 | value: `{}`,
53 | },
54 | onPress: {
55 | type: PropTypes.Function,
56 | value: `(selectedIdx) => setSelectedIndex(selectedIdx)`,
57 | propHook: {
58 | what: `selectedIdx`,
59 | into: `selectedIndex`,
60 | },
61 | },
62 | selectMultiple: {
63 | type: PropTypes.Boolean,
64 | value: false,
65 | },
66 | selectedButtonStyle: {
67 | type: PropTypes.Object,
68 | value: `{}`,
69 | },
70 | selectedIndex: {
71 | type: PropTypes.Number,
72 | value: `1`,
73 | stateful: true,
74 | },
75 | selectedIndexes: {
76 | type: PropTypes.Array,
77 | value: `[]`,
78 | stateful: true,
79 | },
80 | selectedTextStyle: {
81 | type: PropTypes.Object,
82 | value: `{}`,
83 | },
84 | textStyle: {
85 | type: PropTypes.Object,
86 | value: `{}`,
87 | },
88 | underlayColor: {
89 | type: PropTypes.String,
90 | value: null,
91 | },
92 | vertical: {
93 | type: PropTypes.Boolean,
94 | value: false,
95 | },
96 | },
97 | scope: {
98 | ButtonGroup,
99 | },
100 | imports: {
101 | "react-native-elements": {
102 | named: ["ButtonGroup"],
103 | },
104 | },
105 | });
106 |
107 | return (
108 |
109 |
110 |
111 | );
112 | };
113 |
114 | export default ButtonGroupPlayground;
115 |
--------------------------------------------------------------------------------
/src/content/ButtonGroup/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./buttongroup.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/ButtonGroup.mdx"));
9 |
10 | export default function ButtonGroupPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Card/card.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Card } from "react-native-elements";
3 | import { View, Image, Text } from "react-native";
4 | import Playground from "../../components/playground";
5 | import { useView, PropTypes } from "react-view";
6 |
7 | const CardPlayground = () => {
8 | const params = useView({
9 | componentName: "Card",
10 | props: {
11 | children: {
12 | value: `
13 | CARD WITH DIVIDER
14 |
15 |
16 |
21 | Pranshu Chittora
22 |
23 | `,
24 | type: PropTypes.ReactNode,
25 | imports: {
26 | "react-native": {
27 | named: ["View", "Image"],
28 | },
29 | },
30 | },
31 | containerStyle: {
32 | value: `{}`,
33 | type: PropTypes.Object,
34 | },
35 | wrapperStyle: {
36 | value: `{}`,
37 | type: PropTypes.Object,
38 | },
39 | },
40 | scope: {
41 | Card,
42 | View,
43 | Image,
44 | Text,
45 | },
46 | imports: {
47 | "react-native-elements": {
48 | named: ["Card"],
49 | },
50 | // "react-native": {
51 | // named: ["View", "Image", "Text"],
52 | // },
53 | },
54 | });
55 |
56 | return (
57 |
58 |
59 |
60 | );
61 | };
62 |
63 | export default CardPlayground;
64 |
--------------------------------------------------------------------------------
/src/content/Card/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./card.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Card.mdx"));
9 |
10 | export default function CardPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/CheckBox/checkbox.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { CheckBox } from "react-native-elements";
3 |
4 | import Playground from "../../components/playground";
5 | import { useView, PropTypes } from "react-view";
6 |
7 | const HeaderPlayground = () => {
8 | const params = useView({
9 | componentName: "CheckBox",
10 | props: {
11 | center: {
12 | type: PropTypes.Boolean,
13 | value: false,
14 | description: "Aligns checkbox to center (optional)",
15 | },
16 | right: {
17 | type: PropTypes.Boolean,
18 | value: false,
19 | description: "Aligns checkbox to right (optional)",
20 | },
21 | checked: {
22 | type: PropTypes.Boolean,
23 | value: false,
24 | stateful: true,
25 | description: "Flag for checking the icon (required)",
26 | },
27 | checkedColor: {
28 | type: PropTypes.String,
29 | value: "#0F0",
30 | description: "Default checked color (optional)",
31 | },
32 | checkedIcon: {
33 | type: PropTypes.Object,
34 | value: ``,
35 | description: `string OR React Native Component `,
36 | },
37 | checkedTitle: {
38 | type: PropTypes.String,
39 | value: `Great!`,
40 | description: "Specify a custom checked message (optional)",
41 | },
42 | Component: {
43 | type: PropTypes.ReactNode,
44 | value: null,
45 | description: "React Native Component",
46 | },
47 | containerStyle: {
48 | type: PropTypes.Object,
49 | value: `{width: "75%"}`,
50 | description: "Style of main container (optional)",
51 | },
52 | fontFamily: {
53 | type: PropTypes.String,
54 | value: null,
55 | description: "Specify different font family",
56 | },
57 | iconRight: {
58 | type: PropTypes.Boolean,
59 | value: false,
60 | description: "Moves icon to right of text (optional)",
61 | },
62 | iconType: {
63 | type: PropTypes.String,
64 | value: null,
65 | description: "type of icon set",
66 | },
67 | onIconPress: {
68 | type: PropTypes.Function,
69 | value: `() => setChecked(!checked)`,
70 | propHook: {
71 | what: "!checked",
72 | into: "checked",
73 | },
74 | description: "onPress function for checkbox (required)",
75 | },
76 | onLongIconPress: {
77 | type: PropTypes.Function,
78 | value: `() => console.log("onLongIconPress()")`,
79 | description: "onLongPress function for checkbox (optional)",
80 | },
81 | onLongPress: {
82 | type: PropTypes.Function,
83 | value: `() => console.log("onLongPress()")`,
84 | description: "onLongPress function for checkbox (optional)",
85 | },
86 | onPress: {
87 | type: PropTypes.Function,
88 | value: `() => console.log("onPress()")`,
89 | description: "onPress function for container (optional)",
90 | },
91 | size: {
92 | type: PropTypes.Number,
93 | value: 30,
94 | description: "Size of the checkbox",
95 | },
96 | textStyle: {
97 | type: PropTypes.Object,
98 | value: `{}`,
99 | description: "Style of text (optional)",
100 | },
101 | title: {
102 | type: PropTypes.Object,
103 | value: `"Check for Awesomeness"`,
104 | description: "Title of checkbox",
105 | },
106 | titleProps: {
107 | type: PropTypes.Object,
108 | value: `{}`,
109 | description: "Additional props for the title Text component (optional)",
110 | },
111 | uncheckedColor: {
112 | type: PropTypes.String,
113 | value: `#F00`,
114 | description: "Default unchecked color (optional)",
115 | },
116 | uncheckedIcon: {
117 | type: PropTypes.Object,
118 | value: null,
119 | description: "string OR React Native Component",
120 | },
121 | },
122 | scope: {
123 | CheckBox,
124 | },
125 | imports: {
126 | "react-native-elements": {
127 | named: ["CheckBox"],
128 | },
129 | },
130 | });
131 |
132 | return (
133 |
134 |
135 |
136 | );
137 | };
138 |
139 | export default HeaderPlayground;
140 |
--------------------------------------------------------------------------------
/src/content/CheckBox/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./checkbox.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/CheckBox.mdx"));
9 |
10 | export default function CheckBoxPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Divider/divider.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Divider, useTheme } from "react-native-elements";
3 |
4 | import Playground from "../../components/playground";
5 | import { useView, PropTypes } from "react-view";
6 |
7 | const DividerPlayground = () => {
8 | const { theme } = useTheme();
9 | const params = useView({
10 | componentName: "Divider",
11 | props: {
12 | style: {
13 | type: PropTypes.Object,
14 | value: `{width:"80%",margin:20}`,
15 | description: "Apply style to the divider.",
16 | },
17 | color: {
18 | type: PropTypes.String,
19 | value: theme.colors.primary,
20 | description: "Apply color to the divider.",
21 | },
22 | inset: {
23 | type: PropTypes.Boolean,
24 | value: false,
25 | description: "Applies inset to the divider if true. Default is left.",
26 | },
27 | insetType: {
28 | type: PropTypes.String,
29 | value: "left",
30 | description:
31 | "Add inset to the divider in left, right, or in both direction. Choose among left, right, or middle.",
32 | },
33 | subHeader: {
34 | type: PropTypes.String,
35 | value: "React native elements",
36 | description: "Adds a sub-header next to divider.",
37 | },
38 | subHeaderStyle: {
39 | type: PropTypes.Object,
40 | value: `{}`,
41 | description: "Adds styles to the sub header of divider.",
42 | },
43 | width: {
44 | type: PropTypes.Number,
45 | value: 1,
46 | description: "Add width to the divider.",
47 | },
48 | orientation: {
49 | type: PropTypes.String,
50 | value: "horizontal",
51 | description: "Adds orientation to the divider.",
52 | },
53 | },
54 | scope: {
55 | Divider,
56 | },
57 | imports: {
58 | "react-native-elements": {
59 | named: ["Divider"],
60 | },
61 | },
62 | });
63 |
64 | return (
65 |
66 |
67 |
68 | );
69 | };
70 |
71 | export default DividerPlayground;
72 |
--------------------------------------------------------------------------------
/src/content/Divider/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./divider.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Divider.mdx"));
9 |
10 | export default function DividerPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/FAB/fab.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { FAB } from "react-native-elements";
3 |
4 | import Playground from "../../components/playground";
5 | import { useView, PropTypes } from "react-view";
6 |
7 | const FabPlayground = () => {
8 | const params = useView({
9 | componentName: "FAB",
10 | props: {
11 | style: {
12 | type: PropTypes.Object,
13 | value: `{width:"80%",margin:20}`,
14 | },
15 | placement: {
16 | type: PropTypes.Enum,
17 | options: { left: "left", right: "right" },
18 | value: "left",
19 | },
20 | color: {
21 | type: PropTypes.String,
22 | value: "",
23 | },
24 | size: {
25 | type: PropTypes.Enum,
26 | options: { small: "small", large: "large" },
27 | value: "small",
28 | },
29 | visible: {
30 | type: PropTypes.Boolean,
31 | value: false,
32 | },
33 | upperCase: {
34 | type: PropTypes.Boolean,
35 | value: false,
36 | },
37 | overlayColor: {
38 | type: PropTypes.String,
39 | value: "#454545",
40 | },
41 | title: {
42 | type: PropTypes.String,
43 | value: "Create",
44 | },
45 | icon: {
46 | type: PropTypes.Object,
47 | value: `{ name: 'edit', color: '#fff' }`,
48 | },
49 | },
50 | scope: {
51 | FAB,
52 | },
53 | imports: {
54 | "react-native-elements": {
55 | named: ["FAB"],
56 | },
57 | },
58 | });
59 |
60 | return (
61 |
62 |
63 |
64 | );
65 | };
66 |
67 | export default FabPlayground;
68 |
--------------------------------------------------------------------------------
/src/content/FAB/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Playground from "./fab.playground";
6 |
7 | const Content = lazy(() => importMDX("../Props/FAB.mdx"));
8 |
9 | export default function FabPlayground() {
10 | return (
11 | }>
14 |
15 |
16 |
17 |
18 |
19 | );
20 | }
21 |
--------------------------------------------------------------------------------
/src/content/Header/header.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Header, Icon } from "react-native-elements";
3 | import { SafeAreaProvider } from "react-native-safe-area-context";
4 | import Playground from "../../components/playground";
5 | import { useView, PropTypes } from "react-view";
6 |
7 | const HeaderPlayground = () => {
8 | const params = useView({
9 | componentName: "Header",
10 | props: {
11 | backgroundColor: {
12 | type: PropTypes.String,
13 | value: null,
14 | },
15 | backgroundImage: {
16 | type: PropTypes.Object,
17 | value: null,
18 | },
19 | backgroundImageStyle: {
20 | type: PropTypes.Object,
21 | value: `{}`,
22 | },
23 | barStyle: {
24 | type: PropTypes.Enum,
25 | options: {
26 | default: "default",
27 | "light-content": "light-content",
28 | "dark-content": "dark-content",
29 | },
30 | value: "default",
31 | },
32 |
33 | centerComponent: {
34 | type: PropTypes.Object,
35 | value: `{ text: 'MY TITLE', style: { color: '#fff' } }`,
36 | description:
37 | "{ text: string, ...Text props} OR { icon: string, ...Icon props} OR React element or component",
38 | },
39 | centerContainerStyle: {
40 | type: PropTypes.Object,
41 | value: `{}`,
42 | },
43 | containerStyle: {
44 | type: PropTypes.Object,
45 | value: `{width:350}`,
46 | },
47 | leftComponent: {
48 | type: PropTypes.Object,
49 | value: `{ icon: 'menu', color: '#fff' }`,
50 | },
51 | leftContainerStyle: {
52 | type: PropTypes.Object,
53 | value: `{}`,
54 | description: `{...Gradient props}`,
55 | },
56 | linearGradientProps: {
57 | type: PropTypes.Object,
58 | value: `{}`,
59 | },
60 |
61 | placement: {
62 | type: PropTypes.Enum,
63 | options: {
64 | center: "center",
65 | left: "left",
66 | right: "right",
67 | },
68 | value: "center",
69 | },
70 |
71 | rightComponent: {
72 | type: PropTypes.Object,
73 | value: `{ icon: 'home', color: '#fff' }`,
74 | },
75 | rightContainerStyle: {
76 | type: PropTypes.Object,
77 | value: `{}`,
78 | },
79 | statusBarProps: {
80 | type: PropTypes.Object,
81 | value: `{}`,
82 | },
83 | ViewComponent: {
84 | type: PropTypes.ReactNode,
85 | value: null,
86 | },
87 | },
88 | scope: {
89 | Header,
90 | Icon,
91 | },
92 | imports: {
93 | "react-native-elements": {
94 | named: ["Header", "Icon"],
95 | },
96 | "react-native-safe-area-context": {
97 | named: ["SafeAreaProvider"],
98 | },
99 | },
100 | });
101 |
102 | return (
103 |
104 |
105 |
106 |
107 |
108 | );
109 | };
110 |
111 | export default HeaderPlayground;
112 |
--------------------------------------------------------------------------------
/src/content/Header/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./header.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Header.mdx"));
9 |
10 | export default function HeaderPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Icon/icon.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { useState } from "react";
3 | import { View } from "react-native";
4 | import { Icon } from "react-native-elements";
5 |
6 | import Playground from "../../components/playground";
7 | import { useView, PropTypes } from "react-view";
8 |
9 | const IconPlayground = () => {
10 | const params = useView({
11 | componentName: "Icon",
12 | props: {
13 | brand: {
14 | type: PropTypes.Boolean,
15 | value: false,
16 | },
17 |
18 | color: {
19 | type: PropTypes.String,
20 | value: "#0CC",
21 | },
22 | Component: {
23 | type: PropTypes.ReactNode,
24 | value: null,
25 | description:
26 | "View if no onPress method is defined, TouchableHighlight if onPress method is defined",
27 | },
28 |
29 | containerStyle: {
30 | type: PropTypes.Object,
31 | value: `{}`,
32 | },
33 | disabled: {
34 | type: PropTypes.Boolean,
35 | value: false,
36 | },
37 | disabledStyle: {
38 | type: PropTypes.Object,
39 | value: `{}`,
40 | },
41 |
42 | iconProps: {
43 | type: PropTypes.Object,
44 | value: `{}`,
45 | description: "{...Icon props}",
46 | },
47 | iconStyle: {
48 | type: PropTypes.Object,
49 | value: `{}`,
50 | },
51 |
52 | name: {
53 | type: PropTypes.String,
54 | value: "devices",
55 | },
56 |
57 | onLongPress: {
58 | type: PropTypes.Function,
59 | value: `() => console.log("onLongPress()")`,
60 | },
61 | onPress: {
62 | type: PropTypes.Function,
63 | value: `() => console.log("onPress()")`,
64 | },
65 | raised: {
66 | type: PropTypes.Boolean,
67 | value: false,
68 | },
69 | reverse: {
70 | type: PropTypes.Boolean,
71 | value: false,
72 | },
73 | reverseColor: {
74 | type: PropTypes.String,
75 | value: null,
76 | },
77 | size: {
78 | type: PropTypes.Number,
79 | value: 40,
80 | },
81 | solid: {
82 | type: PropTypes.Boolean,
83 | value: false,
84 | },
85 | type: {
86 | type: PropTypes.String,
87 | value: "material",
88 | },
89 | underlayColor: {
90 | type: PropTypes.String,
91 | value: null,
92 | },
93 | },
94 | scope: {
95 | Icon,
96 | },
97 | imports: {
98 | "react-native-elements": {
99 | named: ["Icon"],
100 | },
101 | },
102 | });
103 |
104 | return (
105 |
106 |
107 |
108 | );
109 | };
110 |
111 | export default IconPlayground;
112 |
--------------------------------------------------------------------------------
/src/content/Icon/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./icon.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Icon.mdx"));
9 |
10 | export default function IconPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Image/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./input.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Image.mdx"));
9 |
10 | export default function ImagePlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Image/input.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Image } from "react-native-elements";
3 |
4 | import Playground from "../../components/playground";
5 | import { useView, PropTypes } from "react-view";
6 |
7 | const ImagePlayground = () => {
8 | const params = useView({
9 | componentName: "Image",
10 | props: {
11 | containerStyle: {
12 | type: PropTypes.Object,
13 | value: `{}`,
14 | },
15 | ImageComponent: {
16 | type: PropTypes.ReactNode,
17 | value: null,
18 | description: "Specify a different component as the Image component.",
19 | },
20 | onLongPress: {
21 | type: PropTypes.Function,
22 | value: `() => console.log("onLongPress()")`,
23 | },
24 | onPress: {
25 | type: PropTypes.Function,
26 | value: `() => console.log("onPress()")`,
27 | },
28 | PlaceholderContent: {
29 | type: PropTypes.ReactNode,
30 | value: null,
31 | },
32 | placeholderStyle: {
33 | type: PropTypes.Object,
34 | value: `{}`,
35 | },
36 | transition: {
37 | type: PropTypes.Boolean,
38 | value: false,
39 | },
40 | transitionDuration: {
41 | type: PropTypes.Number,
42 | value: 1000,
43 | },
44 | source: {
45 | type: PropTypes.Object,
46 | value: `{uri: "https://user-images.githubusercontent.com/5962998/65694309-a825f000-e043-11e9-8382-db0dba0851e3.png"}`,
47 | },
48 | style: {
49 | type: PropTypes.Object,
50 | value: `{ width: 200, height: 200 }`,
51 | },
52 | },
53 | scope: {
54 | Image,
55 | },
56 | imports: {
57 | "react-native-elements": {
58 | named: ["Image"],
59 | },
60 | },
61 | });
62 |
63 | return (
64 |
65 |
66 |
67 | );
68 | };
69 |
70 | export default ImagePlayground;
71 |
--------------------------------------------------------------------------------
/src/content/Input/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./input.playground.jsx";
7 | const Content = lazy(() => importMDX("../Props/Input.mdx"));
8 |
9 | export default function InputPlayground() {
10 | return (
11 |
12 |
13 |
}>
14 |
15 |
16 |
17 |
18 |
19 | );
20 | }
21 |
--------------------------------------------------------------------------------
/src/content/Input/input.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { useState } from "react";
3 | import { View } from "react-native";
4 | import { Input } from "react-native-elements";
5 | import Icon from "react-native-vector-icons/dist/MaterialCommunityIcons";
6 | import Playground from "../../components/playground";
7 | import { useView, PropTypes } from "react-view";
8 |
9 | const InputPlayground = () => {
10 | const params = useView({
11 | componentName: "Input",
12 | props: {
13 | containerStyle: {
14 | type: PropTypes.Object,
15 | value: `{}`,
16 | },
17 | disabled: {
18 | type: PropTypes.Boolean,
19 | value: false,
20 | },
21 | disabledInputStyle: {
22 | type: PropTypes.Object,
23 | value: `{background:"#ddd"}`,
24 | },
25 |
26 | inputContainerStyle: {
27 | type: PropTypes.Object,
28 | value: `{}`,
29 | },
30 | errorMessage: {
31 | type: PropTypes.String,
32 | value: "Oops! that's not correct.",
33 | },
34 | errorStyle: {
35 | type: PropTypes.Object,
36 | value: `{}`,
37 | },
38 | errorProps: {
39 | type: PropTypes.Object,
40 | description:
41 | "props to be passed to the React Native Text component used to display the error message (optional)",
42 | value: `{}`,
43 | },
44 | inputStyle: {
45 | type: PropTypes.Object,
46 | value: `{}`,
47 | },
48 | label: {
49 | type: PropTypes.ReactNode,
50 | value: `"User Form"`,
51 | description: "string OR React element or component ",
52 | },
53 | labelStyle: {
54 | type: PropTypes.Object,
55 | value: `{}`,
56 | },
57 | labelProps: {
58 | type: PropTypes.Object,
59 | value: `{}`,
60 | description: "{...Text props} OR passed component props ",
61 | },
62 | leftIcon: {
63 | type: PropTypes.ReactNode,
64 | value: ``,
65 | },
66 | leftIconContainerStyle: {
67 | type: PropTypes.Object,
68 | value: `{}`,
69 | },
70 | rightIcon: {
71 | type: PropTypes.ReactNode,
72 | value: ``,
73 | },
74 | rightIconContainerStyle: {
75 | type: PropTypes.Object,
76 | value: `{}`,
77 | },
78 | renderErrorMessage: {
79 | type: PropTypes.Boolean,
80 | value: false,
81 | description:
82 | "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.",
83 | },
84 | InputComponent: {
85 | type: PropTypes.ReactNode,
86 | },
87 | placeholder: {
88 | type: PropTypes.String,
89 | value: "Enter Name",
90 | },
91 | },
92 | scope: {
93 | Input,
94 | Icon,
95 | },
96 | imports: {
97 | "react-native-elements": {
98 | named: ["Input"],
99 | },
100 | "react-native-vector-icons/MaterialCommunityIcons": {
101 | default: "Icon",
102 | },
103 | },
104 | });
105 |
106 | return (
107 |
108 |
109 |
110 | );
111 | };
112 |
113 | export default InputPlayground;
114 |
--------------------------------------------------------------------------------
/src/content/LinearProgress/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Playground from "./linearprogress.playground";
6 | const Content = lazy(() => importMDX("../Props/LinearProgress.mdx"));
7 |
8 | export default function LinearProgressPlayground() {
9 | return (
10 | }>
13 |
14 |
15 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/src/content/LinearProgress/linearprogress.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { LinearProgress } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const LinearProgressPlayground = () => {
7 | const params = useView({
8 | componentName: "LinearProgress",
9 | props: {
10 | value: {
11 | type: PropTypes.Number,
12 | value: 0,
13 | },
14 | variant: {
15 | type: PropTypes.Enum,
16 | options: { determinate: "determinate", indeterminate: "indeterminate" },
17 | value: "indeterminate",
18 | },
19 | style: {
20 | type: PropTypes.Object,
21 | value: `{width: "90%"}`,
22 | },
23 | color: {
24 | type: PropTypes.String,
25 | value: "secondary",
26 | },
27 | trackColor: {
28 | type: PropTypes.String,
29 | value: "",
30 | },
31 | },
32 | scope: {
33 | LinearProgress,
34 | },
35 | imports: {
36 | "react-native-elements": {
37 | named: ["LinearProgress"],
38 | },
39 | },
40 | });
41 |
42 | return (
43 |
44 |
45 |
46 | );
47 | };
48 |
49 | export default LinearProgressPlayground;
50 |
--------------------------------------------------------------------------------
/src/content/ListItem/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Playground from "./listitem.playground.jsx";
6 | import Spinner from "../../containers/Spinner";
7 |
8 | const Content = lazy(() => importMDX("../Props/ListItem.mdx"));
9 |
10 | export default function ListItemPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/ListItem/listitem.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { TouchableHighlight } from "react-native";
3 | import { ListItem, Avatar, Text } from "react-native-elements";
4 |
5 | import Playground from "../../components/playground";
6 | import { useView, PropTypes } from "react-view";
7 |
8 | const ListItemPlayground = () => {
9 | const params = useView({
10 | componentName: "ListItem",
11 | props: {
12 | children: {
13 | type: PropTypes.ReactNode,
14 | value: `
15 |
16 | Pranshu Chittora
17 | React Native Elements
18 | `,
19 | },
20 | bottomDivider: {
21 | type: PropTypes.Boolean,
22 | value: false,
23 | },
24 | Component: {
25 | type: PropTypes.Object,
26 | value: `TouchableHighlight`,
27 | description:
28 | "View or TouchableHighlight (default) if onPress method is added as prop",
29 | },
30 | containerStyle: {
31 | type: PropTypes.Object,
32 | value: `{}`,
33 | },
34 | disabled: {
35 | type: PropTypes.Boolean,
36 | value: false,
37 | },
38 | disabledStyle: {
39 | type: PropTypes.Object,
40 | value: `{opacity:0.5}`,
41 | },
42 | onLongPress: {
43 | type: PropTypes.Function,
44 | value: `() => console.log("onLongPress()")`,
45 | },
46 | onPress: {
47 | type: PropTypes.Function,
48 | value: `() => console.log("onLongPress()")`,
49 | },
50 | pad: {
51 | type: PropTypes.Number,
52 | value: 20,
53 | },
54 | topDivider: {
55 | type: PropTypes.Boolean,
56 | value: false,
57 | },
58 | ViewComponent: {
59 | type: PropTypes.Object,
60 | value: ``,
61 | description: "ontainer for linear gradient (for non-expo user)",
62 | },
63 | },
64 | scope: {
65 | ListItem,
66 | Avatar,
67 | Text,
68 | TouchableHighlight,
69 | },
70 | imports: {
71 | "react-native-elements": {
72 | named: ["ListItem", "Avatar"],
73 | },
74 | "react-native": {
75 | named: ["TouchableHighlight"],
76 | },
77 | },
78 | });
79 |
80 | return (
81 |
82 |
83 |
84 | );
85 | };
86 |
87 | export default ListItemPlayground;
88 |
--------------------------------------------------------------------------------
/src/content/Overlay/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./overlay.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Overlay.mdx"));
9 |
10 | export default function OverlayPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Overlay/overlay.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Text, TouchableOpacity } from "react-native";
3 | import { Overlay } from "react-native-elements";
4 | import Modal from "modal-react-native-web";
5 |
6 | import Playground from "../../components/playground";
7 | import { useView, PropTypes } from "react-view";
8 |
9 | const OverlayPlayground = () => {
10 | const params = useView({
11 | componentName: "Overlay",
12 | props: {
13 | backdropStyle: {
14 | type: PropTypes.Object,
15 | value: `{}`,
16 | },
17 | children: {
18 | type: PropTypes.ReactNode,
19 | value: `Some content setIsVisible(!isVisible)}>Click to close `,
20 | propHook: ({ getInstrumentOnChange, fnBodyAppend }) => ({
21 | JSXAttribute(path) {
22 | if (path.get("name").node.name === "onPress") {
23 | fnBodyAppend(
24 | path.get("value"),
25 | getInstrumentOnChange("false", "isVisible")
26 | );
27 | }
28 | },
29 | }),
30 | },
31 | isVisible: {
32 | type: PropTypes.Boolean,
33 |
34 | defaultValue: false,
35 |
36 | stateful: true,
37 | },
38 | fullScreen: {
39 | type: PropTypes.Boolean,
40 | value: false,
41 | },
42 | ModalComponent: {
43 | type: PropTypes.Object,
44 | value: `Modal`,
45 | },
46 | onBackdropPress: {
47 | type: PropTypes.Function,
48 | value: `() => setIsVisible(!isVisible)`,
49 | propHook: {
50 | what: `false`,
51 | into: `isVisible`,
52 | },
53 | },
54 | overlayStyle: {
55 | type: PropTypes.Object,
56 | value: `{}`,
57 | },
58 | },
59 | scope: {
60 | Overlay,
61 | Modal,
62 | Text,
63 | TouchableOpacity,
64 | },
65 | imports: {
66 | "react-native-elements": {
67 | named: ["Overlay", "Text", "TouchableOpacity"],
68 | },
69 | "modal-react-native-web": {
70 | default: "Modal",
71 | },
72 | },
73 | });
74 |
75 | return (
76 |
77 |
78 |
79 | );
80 | };
81 |
82 | export default OverlayPlayground;
83 |
--------------------------------------------------------------------------------
/src/content/Pricing/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./pricing.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/PricingCard.mdx"));
9 |
10 | export default function PricingPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Pricing/pricing.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { PricingCard } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const PricingPlayground = () => {
7 | const params = useView({
8 | componentName: "PricingCard",
9 | props: {
10 | button: {
11 | type: PropTypes.Object,
12 | value: `{ title: 'GET STARTED', icon: 'flight-takeoff' }`,
13 | },
14 | color: {
15 | type: PropTypes.String,
16 | value: "#4f9deb",
17 | },
18 | containerStyle: {
19 | type: PropTypes.Object,
20 | value: `{}`,
21 | },
22 | info: {
23 | type: PropTypes.Array,
24 | value: `['1 User', 'Basic Support', 'All Core Features']`,
25 | },
26 | infoStyle: {
27 | type: PropTypes.Object,
28 | value: `{}`,
29 | },
30 | onButtonPress: {
31 | type: PropTypes.Function,
32 | value: `() => console.log("onButtonPress()")`,
33 | },
34 | price: {
35 | type: PropTypes.String,
36 | value: "$100",
37 | },
38 | pricingStyle: {
39 | type: PropTypes.Object,
40 | value: `{}`,
41 | },
42 |
43 | title: {
44 | type: PropTypes.String,
45 | value: "Pro+",
46 | },
47 | titleStyle: {
48 | type: PropTypes.Object,
49 | value: `{}`,
50 | },
51 | wrapperStyle: {
52 | type: PropTypes.Object,
53 | value: `{padding:10}`,
54 | },
55 | },
56 | scope: {
57 | PricingCard,
58 | },
59 | imports: {
60 | "react-native-elements": {
61 | named: ["PricingCard"],
62 | },
63 | },
64 | });
65 |
66 | return (
67 |
68 |
69 |
70 | );
71 | };
72 |
73 | export default PricingPlayground;
74 |
--------------------------------------------------------------------------------
/src/content/Rating/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Playground from "./rating.playground.jsx";
6 | import Spinner from "../../containers/Spinner";
7 |
8 | const Content = lazy(() => importMDX("../Props/Rating.mdx"));
9 |
10 | export default function RatingPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Rating/rating.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { useState } from "react";
3 | import { View } from "react-native";
4 | import { Rating } from "react-native-elements";
5 | import Playground from "../../components/playground";
6 | import { useView, PropTypes } from "react-view";
7 | import SocialIconPlayground from ".";
8 |
9 | const RatingPlayground = () => {
10 | const params = useView({
11 | componentName: "Rating",
12 | props: {
13 | fractions: {
14 | type: PropTypes.Number,
15 | value: 0,
16 | },
17 | imageSize: {
18 | type: PropTypes.Number,
19 | value: 70,
20 | },
21 | minValue: {
22 | type: PropTypes.Number,
23 | value: 0,
24 | },
25 | onFinishRating: {
26 | type: PropTypes.Function,
27 | value: `() => console.log("onFinishRating()")`,
28 | },
29 | onStartRating: {
30 | type: PropTypes.Function,
31 | value: `() => console.log("onStartRating()")`,
32 | },
33 | ratingBackgroundColor: {
34 | type: PropTypes.String,
35 | value: "#FFF",
36 | },
37 | tintColor: {
38 | type: PropTypes.String,
39 | value: "",
40 | },
41 | ratingColor: {
42 | type: PropTypes.String,
43 | value: "#FF0",
44 | },
45 | ratingCount: {
46 | type: PropTypes.Number,
47 | value: 5,
48 | },
49 | ratingImage: {
50 | type: PropTypes.String,
51 | value: "star",
52 | },
53 | ratingTextColor: {
54 | type: PropTypes.String,
55 | value: "#222",
56 | },
57 | readonly: {
58 | type: PropTypes.Boolean,
59 | value: false,
60 | },
61 | reviews: {
62 | type: PropTypes.Array,
63 | value: `["Terrible", "Bad", "Okay", "Good", "Great"]`,
64 | },
65 | showRating: {
66 | type: PropTypes.Boolean,
67 | value: true,
68 | },
69 | startingValue: {
70 | type: PropTypes.Number,
71 | value: "0",
72 | },
73 | style: {
74 | type: PropTypes.Object,
75 | value: `{}`,
76 | },
77 | type: {
78 | type: PropTypes.Enum,
79 | options: {
80 | star: "star",
81 | rocket: "rocket",
82 | bell: "bell",
83 | heart: "heart",
84 | custom: "custom",
85 | },
86 | value: "star",
87 | },
88 | },
89 | scope: {
90 | Rating,
91 | },
92 | imports: {
93 | "react-native-elements": {
94 | named: ["Rating"],
95 | },
96 | },
97 | });
98 |
99 | return (
100 |
101 |
102 |
103 | );
104 | };
105 |
106 | export default RatingPlayground;
107 |
--------------------------------------------------------------------------------
/src/content/SearchBar/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./searchbar.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/SearchBar.mdx"));
9 |
10 | export default function SearchBarPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/SearchBar/searchbar.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { SearchBar } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const SearchBarPlayground = () => {
7 | const params = useView({
8 | componentName: "SearchBar",
9 | props: {
10 | platform: {
11 | value: "default",
12 | options: {
13 | default: "default",
14 | ios: "ios",
15 | android: "android",
16 | },
17 | type: PropTypes.Enum,
18 | description: "Defines the Platfrom.",
19 | },
20 | clearIcon: {
21 | type: PropTypes.Object,
22 | value: "",
23 | },
24 | searchIcon: {
25 | type: PropTypes.Object,
26 | value: "",
27 | },
28 | cancelIcon: {
29 | type: PropTypes.Object,
30 | value: "",
31 | description: "Android Only",
32 | },
33 | containerStyle: {
34 | type: PropTypes.Object,
35 | value: `{}`,
36 | },
37 | inputContainerStyle: {
38 | type: PropTypes.Object,
39 | value: `{}`,
40 | },
41 |
42 | inputStyle: {
43 | type: PropTypes.Object,
44 | value: `{}`,
45 | },
46 |
47 | leftIconContainerStyle: {
48 | type: PropTypes.Object,
49 | value: `{}`,
50 | },
51 |
52 | rightIconContainerStyle: {
53 | type: PropTypes.Object,
54 | value: `{}`,
55 | },
56 | lightTheme: {
57 | type: PropTypes.Boolean,
58 | value: false,
59 | description: "Default (platform) only ",
60 | },
61 | loadingProps: {
62 | type: PropTypes.Object,
63 | value: `{}`,
64 | },
65 | onChangeText: {
66 | type: PropTypes.Function,
67 | value: `(newVal) => setValue(newVal)`,
68 | },
69 | onClearText: {
70 | type: PropTypes.Function,
71 | value: `() => console.log(onClearText())`,
72 | },
73 | placeholder: {
74 | type: PropTypes.String,
75 | value: "Type query here...",
76 | },
77 | placeholderTextColor: {
78 | type: PropTypes.String,
79 | value: "#888",
80 | },
81 | round: {
82 | type: PropTypes.Boolean,
83 | value: false,
84 | description: "Default (platform) only ",
85 | },
86 | showCancel: {
87 | type: PropTypes.Boolean,
88 | value: false,
89 | description: "ios (platform) only ",
90 | },
91 | showLoading: {
92 | type: PropTypes.Boolean,
93 | value: false,
94 | description: "Shows loader",
95 | },
96 | underlineColorAndroid: {
97 | type: PropTypes.String,
98 | value: "",
99 | },
100 | cancelButtonTitle: {
101 | type: PropTypes.String,
102 | value: "Cancel",
103 | description: "ios (platform) only ",
104 | },
105 | cancelButtonProps: {
106 | type: PropTypes.Object,
107 | value: `{}`,
108 | description: "ios (platform) only ",
109 | },
110 | onCancel: {
111 | type: PropTypes.Function,
112 | value: `() => console.log(onCancel())`,
113 | },
114 | value: {
115 | type: PropTypes.String,
116 | value: "",
117 | stateful: true,
118 | },
119 | },
120 | scope: {
121 | SearchBar,
122 | },
123 | imports: {
124 | "react-native-elements": {
125 | named: ["SearchBar"],
126 | },
127 | },
128 | });
129 |
130 | return (
131 |
132 |
133 |
134 | );
135 | };
136 |
137 | export default SearchBarPlayground;
138 |
--------------------------------------------------------------------------------
/src/content/Slider/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./slider.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Slider.mdx"));
9 |
10 | export default function SliderPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Slider/slider.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Slider, Icon } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const SliderPlayground = () => {
7 | const params = useView({
8 | componentName: "Slider",
9 | props: {
10 | animateTransitions: {
11 | value: true,
12 | type: PropTypes.Boolean,
13 | },
14 | animationConfig: {
15 | valie: `{}`,
16 | type: PropTypes.Object,
17 | },
18 | animationType: {
19 | value: "timing",
20 | options: {
21 | timing: "timing",
22 | spring: "spring",
23 | },
24 | type: PropTypes.Enum,
25 | description: "Defines the Animation type.",
26 | },
27 | debugTouchArea: {
28 | type: PropTypes.Boolean,
29 | value: false,
30 | description:
31 | "Set this to true to visually see the thumb touch rect in green.",
32 | },
33 | disabled: {
34 | type: PropTypes.Boolean,
35 | value: false,
36 | description: "Disables the slider",
37 | },
38 | maximumTrackTintColor: {
39 | type: PropTypes.String,
40 | value: "#ccc",
41 | },
42 | maximumValue: {
43 | value: 100,
44 | type: PropTypes.Number,
45 | },
46 | minimumTrackTintColor: {
47 | type: PropTypes.String,
48 | value: "#222",
49 | },
50 |
51 | minimumValue: {
52 | value: 0,
53 | type: PropTypes.Number,
54 | },
55 |
56 | allowTouchTrack: {
57 | type: PropTypes.Boolean,
58 | value: false,
59 | description:
60 | "If true, thumb will respond and jump to any touch along the track.",
61 | },
62 | onSlidingComplete: {
63 | type: PropTypes.Function,
64 | value: `() => console.log("onSlidingComplete()")`,
65 | },
66 | onSlidingStart: {
67 | type: PropTypes.Function,
68 | value: `() => console.log("onSlidingStart()")`,
69 | },
70 | onValueChange: {
71 | type: PropTypes.Function,
72 | value: `(value) => console.log("onValueChange()",value)`,
73 | },
74 |
75 | orientation: {
76 | value: "horizontal",
77 | options: {
78 | horizontal: "horizontal",
79 | vertical: "vertical",
80 | },
81 | type: PropTypes.Enum,
82 | description: "Slider's Orientation",
83 | },
84 |
85 | step: {
86 | value: 1,
87 | type: PropTypes.Number,
88 | },
89 |
90 | style: {
91 | value: `{width:"80%",height:200}`,
92 | type: PropTypes.Object,
93 | },
94 |
95 | thumbStyle: {
96 | value: `{ height: 20, width: 20 }`,
97 | type: PropTypes.Object,
98 | },
99 |
100 | thumbProps: {
101 | value: `{
102 | children: (
103 |
111 | ),
112 | }`,
113 | type: PropTypes.Object,
114 | },
115 |
116 | thumbTintColor: {
117 | type: PropTypes.String,
118 | value: `#0c0`,
119 | },
120 |
121 | thumbTouchSize: {
122 | type: PropTypes.Object,
123 | value: `{width: 40, height: 40}`,
124 | },
125 | trackStyle: {
126 | value: `{ height: 10,borderRadius:20 }`,
127 | type: PropTypes.Object,
128 | },
129 |
130 | value: {
131 | value: 50,
132 | type: PropTypes.Number,
133 | },
134 | },
135 | scope: {
136 | Slider,
137 | Icon,
138 | },
139 | imports: {
140 | "react-native-elements": {
141 | named: ["Slider", "Icon"],
142 | },
143 | },
144 | });
145 |
146 | return (
147 |
148 |
149 |
150 | );
151 | };
152 |
153 | export default SliderPlayground;
154 |
--------------------------------------------------------------------------------
/src/content/SocialIcon/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./socialicon.playground.jsx";
7 | const Content = lazy(() => importMDX("../Props/SocialIcon.mdx"));
8 |
9 | export default function SocialIconPlayground() {
10 | return (
11 |
12 |
13 |
}>
14 |
15 |
16 |
17 |
18 |
19 | );
20 | }
21 |
--------------------------------------------------------------------------------
/src/content/SocialIcon/socialicon.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { SocialIcon } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const SocialIconPlayground = () => {
7 | const params = useView({
8 | componentName: "SocialIcon",
9 | props: {
10 | activityIndicatorStyle: {
11 | type: PropTypes.Object,
12 | value: ``,
13 | description: "Style to render when in loading state"
14 | },
15 | button: { type: PropTypes.Boolean, value: false },
16 | Component: {
17 | type: PropTypes.ReactNode,
18 | description: "React Native Component. Default => TouchableHighlight",
19 | value: null,
20 | },
21 | disabled: {
22 | type: PropTypes.Boolean,
23 | value: false,
24 | },
25 | fontFamily: {
26 | type: PropTypes.String,
27 | description: "System font bold (iOS), Sans Serif Black (android)",
28 | },
29 | fontStyle: {
30 | type: PropTypes.Object,
31 | value: `{}`,
32 | },
33 | fontWeight: {
34 | type: PropTypes.String,
35 | description:
36 | "specify font weight of title if set as a button with a title",
37 | },
38 | iconColor: {
39 | type: PropTypes.String,
40 | value: ``,
41 | },
42 | iconSize: {
43 | type: PropTypes.Number,
44 | value: 25,
45 | },
46 | iconStyle: {
47 | type: PropTypes.Object,
48 | value: `{}`,
49 | },
50 | iconType: {
51 | type: PropTypes.String,
52 | value: `font-awesome`,
53 | },
54 | light: {
55 | type: PropTypes.Boolean,
56 | value: false,
57 | },
58 | loading: {
59 | type: PropTypes.Boolean,
60 | value: false,
61 | },
62 | onLongPress: {
63 | type: PropTypes.Function,
64 | value: `() => console.log("onLongPress()")`,
65 | },
66 | onPress: {
67 | type: PropTypes.Function,
68 | value: `() => console.log("onPress()")`,
69 | },
70 | raised: {
71 | type: PropTypes.Boolean,
72 | value: false,
73 | },
74 | style: {
75 | type: PropTypes.Object,
76 | value: `{paddingHorizontal:10}`,
77 | },
78 | title: {
79 | type: PropTypes.String,
80 | value: "GitHub",
81 | description: "title if made into a button.",
82 | },
83 | type: {
84 | type: PropTypes.String,
85 | value: "github",
86 | },
87 | underlayColor: {
88 | type: PropTypes.String,
89 | value: ``,
90 | },
91 | },
92 | scope: {
93 | SocialIcon,
94 | },
95 | imports: {
96 | "react-native-elements": {
97 | named: ["SocialIcon"],
98 | },
99 | },
100 | });
101 |
102 | return (
103 |
104 |
105 |
106 | );
107 | };
108 |
109 | export default SocialIconPlayground;
110 |
--------------------------------------------------------------------------------
/src/content/SpeedDial/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Playground from "./speeddial.playground";
6 |
7 | const Content = lazy(() => importMDX("../Props/SpeedDial.mdx"));
8 |
9 | export default function SpeedDialPlayground() {
10 | return (
11 | }>
14 |
15 |
16 |
17 |
18 |
19 | );
20 | }
21 |
--------------------------------------------------------------------------------
/src/content/SpeedDial/speeddial.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { SpeedDial } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const SpeedDialPlayground = () => {
7 | const params = useView({
8 | componentName: "SpeedDial",
9 | props: {
10 | children: {
11 | value: `
12 | console.log('Add Something')}
16 | />
17 | console.log('Delete Something')}
21 | />`,
22 | },
23 | isOpen: {
24 | type: PropTypes.Boolean,
25 | value: true,
26 | },
27 | openIcon: {
28 | type: PropTypes.Object,
29 | value: `{ name: 'close', color: '#fff' }`,
30 | },
31 | onOpen: {
32 | type: PropTypes.Function,
33 | value: `() => console.log("onOpen()")`,
34 | },
35 | onClose: {
36 | type: PropTypes.Function,
37 | value: `() => console.log("onClose()")`,
38 | },
39 | transitionDuration: {
40 | type: PropTypes.Number,
41 | value: 150,
42 | },
43 | icon: {
44 | type: PropTypes.Object,
45 | value: `{ name: 'edit', color: '#fff' }`,
46 | },
47 | },
48 | scope: {
49 | SpeedDial,
50 | },
51 | imports: {
52 | "react-native-elements": {
53 | named: ["SpeedDial"],
54 | },
55 | },
56 | });
57 |
58 | return (
59 |
60 |
61 |
62 | );
63 | };
64 |
65 | export default SpeedDialPlayground;
66 |
--------------------------------------------------------------------------------
/src/content/Switch/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Playground from "./switch.playground.jsx";
6 | const Content = lazy(() => importMDX("../Props/Switch.mdx"));
7 |
8 | export default function SwitchPlayground() {
9 | return (
10 | }>
13 |
14 |
15 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/src/content/Switch/switch.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Switch, useTheme } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const SwitchPlayground = () => {
7 | const { theme } = useTheme();
8 | const params = useView({
9 | componentName: "Switch",
10 | props: {
11 | color: {
12 | value: theme.colors.primary,
13 | type: PropTypes.String,
14 | description: "Color",
15 | },
16 | value: {
17 | value: false,
18 | type: PropTypes.Boolean,
19 | description: "Value",
20 | stateful: true,
21 | },
22 | onValueChange: {
23 | value: "() => setValue(!value)",
24 | propHook: {
25 | what: "!value",
26 | into: "value",
27 | },
28 | type: PropTypes.Function,
29 | description: "Function called when switch state is changed.",
30 | },
31 | },
32 | scope: {
33 | Switch,
34 | },
35 | imports: {
36 | "react-native-elements": {
37 | named: ["Switch"],
38 | },
39 | },
40 | });
41 |
42 | return (
43 |
44 |
45 |
46 | );
47 | };
48 |
49 | export default SwitchPlayground;
50 |
--------------------------------------------------------------------------------
/src/content/Tab/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Playground from "./tab.playground.jsx";
6 | const Content = lazy(() => importMDX("../Props/Tab.mdx"));
7 |
8 | export default function TabPlayground() {
9 | return (
10 | }>
13 |
14 |
15 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/src/content/Tab/tab.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Tab } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const TabPlayground = () => {
7 | const params = useView({
8 | componentName: "Tab",
9 | props: {
10 | children: {
11 | value: `
12 |
13 |
14 |
15 | `,
16 | type: PropTypes.ReactNode,
17 | },
18 | value: {
19 | type: PropTypes.Number,
20 | value: 0,
21 | },
22 | onChange: {
23 | type: PropTypes.Function,
24 | value: `() => console.log("onChange()")`,
25 | },
26 | disableIndicator: {
27 | type: PropTypes.Boolean,
28 | value: false,
29 | },
30 | indicatorStyle: {
31 | type: PropTypes.Object,
32 | value: `{}`,
33 | },
34 | variant: {
35 | type: PropTypes.Enum,
36 | options: { primary: "primary", default: "default" },
37 | value: "default",
38 | },
39 | },
40 | scope: {
41 | Tab,
42 | },
43 | imports: {
44 | "react-native-elements": {
45 | named: ["Tab"],
46 | },
47 | },
48 | });
49 |
50 | return (
51 |
52 |
53 |
54 | );
55 | };
56 |
57 | export default TabPlayground;
58 |
--------------------------------------------------------------------------------
/src/content/Text/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./text.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Text.mdx"));
9 |
10 | export default function TextPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Text/text.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Text } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | const TextPlayground = () => {
7 | const params = useView({
8 | componentName: "Text",
9 | props: {
10 | h1: {
11 | value: true,
12 | type: PropTypes.Boolean,
13 | description: "Heading 1",
14 | },
15 | h1Style: {
16 | value: `{}`,
17 | type: PropTypes.Object,
18 | description: "Styling for h1",
19 | },
20 | h2: {
21 | value: false,
22 | type: PropTypes.Boolean,
23 | description: "Heading 2",
24 | },
25 | h2Style: {
26 | value: `{}`,
27 | type: PropTypes.Object,
28 | description: "Styling for h2",
29 | },
30 | h3: {
31 | value: false,
32 | type: PropTypes.Boolean,
33 | description: "Heading 3",
34 | },
35 | h3Style: {
36 | value: `{}`,
37 | type: PropTypes.Object,
38 | description: "Styling for h3",
39 | },
40 | h4: {
41 | value: false,
42 | type: PropTypes.Boolean,
43 | description: "Heading 4",
44 | },
45 | h4Style: {
46 | value: `{}`,
47 | type: PropTypes.Object,
48 | description: "Styling for h4",
49 | },
50 | style: {
51 | value: `{}`,
52 | type: PropTypes.Object,
53 | description: "Styling of the text",
54 | },
55 | children: {
56 | value: "This is a Text.",
57 | type: PropTypes.String,
58 | description: "Text Content",
59 | },
60 | },
61 | scope: {
62 | Text,
63 | },
64 | imports: {
65 | "react-native-elements": {
66 | named: ["Text"],
67 | },
68 | },
69 | });
70 |
71 | return (
72 |
73 |
74 |
75 | );
76 | };
77 |
78 | export default TextPlayground;
79 |
--------------------------------------------------------------------------------
/src/content/Tile/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./tile.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Tile.mdx"));
9 |
10 | export default function TilePlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/Tile/tile.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Tile } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 |
6 | import SampleImage from "../../assets/sample.jpg";
7 |
8 | const TilePlayground = () => {
9 | const params = useView({
10 | componentName: "Tile",
11 | props: {
12 | activeOpacity: {
13 | value: 0.5,
14 | type: PropTypes.Number,
15 | },
16 | caption: {
17 | value: "Tile caption",
18 | type: PropTypes.String,
19 | description: "",
20 | },
21 | captionStyle: {
22 | type: PropTypes.Object,
23 | value: `{}`,
24 | },
25 | containerStyle: {
26 | type: PropTypes.Object,
27 | value: `{}`,
28 | },
29 | contentContainerStyle: {
30 | type: PropTypes.Object,
31 | value: `{}`,
32 | },
33 | featured: {
34 | type: PropTypes.Boolean,
35 | value: false,
36 | },
37 | height: {
38 | type: PropTypes.Number,
39 | value: 300,
40 | },
41 | icon: {
42 | type: PropTypes.Object,
43 | value: ``,
44 | description:
45 | "object {name: string, color: string, size: number, type: string (default is material, or choose from supported icon sets), iconStyle: object(style)}",
46 | },
47 | iconContainerStyle: {
48 | type: PropTypes.Object,
49 | value: `{}`,
50 | },
51 | ImageComponent: { type: PropTypes.ReactNode, value: null },
52 | imageContainerStyle: {
53 | type: PropTypes.Object,
54 | value: `{}`,
55 | },
56 | imageProps: { type: PropTypes.Object, value: `{}` },
57 | imageSrc: {
58 | type: PropTypes.ReactNode,
59 | value: `SampleImage`,
60 | },
61 |
62 | onPress: {
63 | type: PropTypes.Function,
64 | value: `() => console.log("imageProps()")`,
65 | },
66 | overlayContainerStyle: {
67 | type: PropTypes.Object,
68 | value: `{}`,
69 | },
70 | title: {
71 | type: PropTypes.String,
72 | value: "",
73 | },
74 | titleNumberOfLines: {
75 | type: PropTypes.Number,
76 | value: null,
77 | },
78 | titleStyle: {
79 | type: PropTypes.Object,
80 | value: `{}`,
81 | },
82 |
83 | width: { type: PropTypes.Number, value: "400" },
84 | },
85 | scope: {
86 | Tile,
87 | SampleImage,
88 | },
89 | imports: {
90 | "react-native-elements": {
91 | named: ["Tile"],
92 | },
93 | },
94 | });
95 |
96 | return (
97 |
98 |
99 |
100 | );
101 | };
102 |
103 | export default TilePlayground;
104 |
--------------------------------------------------------------------------------
/src/content/ToolTip/index.jsx:
--------------------------------------------------------------------------------
1 | import React, { lazy, Suspense } from "react";
2 | import { importMDX } from "mdx.macro";
3 |
4 | import PropDrawer from "../../components/PropDrawer";
5 | import Spinner from "../../containers/Spinner";
6 | import Playground from "./tooltip.playground.jsx";
7 |
8 | const Content = lazy(() => importMDX("../Props/Tooltip.mdx"));
9 |
10 | export default function ToolTipPlayground() {
11 | return (
12 |
13 |
14 |
}>
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/src/content/ToolTip/tooltip.playground.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Tooltip, Text } from "react-native-elements";
3 | import Playground from "../../components/playground";
4 | import { useView, PropTypes } from "react-view";
5 | import Modal from "modal-react-native-web";
6 |
7 | const ToolTipPlayground = () => {
8 | const params = useView({
9 | componentName: "Tooltip",
10 | props: {
11 | popover: {
12 | value: `PopOver Content `,
13 | type: PropTypes.ReactNode,
14 | },
15 | children: {
16 | value: `Hello, There `,
17 | },
18 | backgroundColor: {
19 | value: ``,
20 | type: PropTypes.String,
21 | },
22 | closeOnlyOnBackdropPress: {
23 | value: false,
24 | type: PropTypes.Boolean,
25 | },
26 | containerStyle: {
27 | value: `{}`,
28 | type: PropTypes.Object,
29 | },
30 | height: {
31 | value: 40,
32 | type: PropTypes.Number,
33 | },
34 | width: {
35 | value: 150,
36 | type: PropTypes.Number,
37 | },
38 | highlightColor: {
39 | value: "transparent",
40 | type: PropTypes.String,
41 | },
42 | ModalComponent: {
43 | value: `Modal`,
44 | type: PropTypes.Object,
45 | },
46 | onClose: {
47 | value: `() => console.log("onClose()")`,
48 | type: PropTypes.Function,
49 | },
50 | onOpen: {
51 | value: `() => console.log("onOpen()")`,
52 | type: PropTypes.Function,
53 | },
54 | overlayColor: {
55 | value: `rgba(250, 250, 250, 0.70)`,
56 | type: PropTypes.String,
57 | },
58 | pointerColor: {
59 | value: ``,
60 | type: PropTypes.String,
61 | },
62 | skipAndroidStatusBar: {
63 | value: false,
64 | type: PropTypes.Boolean,
65 | },
66 | toggleAction: {
67 | value: ``,
68 | type: PropTypes.String,
69 | },
70 | toggleOnPress: {
71 | defaultValue: true,
72 | value: true,
73 | type: PropTypes.Boolean,
74 | },
75 | withOverlay: {
76 | defaultValue: true,
77 | value: true,
78 | type: PropTypes.Boolean,
79 | },
80 | withPointer: {
81 | defaultValue: true,
82 | value: true,
83 | type: PropTypes.Boolean,
84 | },
85 | },
86 | scope: {
87 | Tooltip,
88 | Text,
89 | Modal,
90 | },
91 | imports: {
92 | "react-native-elements": {
93 | named: ["Tooltip", "Text"],
94 | },
95 | "modal-react-native-web": {
96 | default: "Modal",
97 | },
98 | },
99 | });
100 |
101 | return (
102 |
103 |
104 |
105 | );
106 | };
107 |
108 | export default ToolTipPlayground;
109 |
--------------------------------------------------------------------------------
/src/content/utils/createReactViewBaseConfig.js:
--------------------------------------------------------------------------------
1 | export default function createReactViewBaseConfig(componentName, RNComponent) {
2 | if (!componentName || !RNComponent) {
3 | throw new Error(
4 | "createBaseComponent needs a componentName name and RNComponent"
5 | );
6 | }
7 |
8 | return {
9 | componentName,
10 | scope: {
11 | RNComponent,
12 | },
13 | imports: {
14 | "react-native-elements": {
15 | named: [componentName],
16 | },
17 | },
18 | };
19 | }
20 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import "./index.css";
4 | import App from "./App";
5 | import * as serviceWorker from "./serviceWorker";
6 | import "react-native-safe-area-context";
7 |
8 | ReactDOM.render( , document.getElementById("root"));
9 |
10 | // If you want your app to work offline and load faster, you can change
11 | // unregister() to register() below. Note this comes with some pitfalls.
12 | // Learn more about service workers: https://bit.ly/CRA-PWA
13 | serviceWorker.unregister();
14 |
--------------------------------------------------------------------------------
/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/pages/explore/Explore.module.css:
--------------------------------------------------------------------------------
1 | .paperPosition {
2 | height: 60px;
3 | padding: 5px 10px;
4 | align-items: center;
5 | display: flex;
6 | position: relative;
7 | }
8 | .arrow {
9 | position: absolute;
10 | right: 10px;
11 | }
12 | .gridContainer {
13 | margin-top: 10;
14 | }
--------------------------------------------------------------------------------
/src/pages/explore/index.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Typography, Paper, Grid } from "@material-ui/core";
3 | import { Link } from "react-router-dom";
4 | import { ArrowForward } from "@material-ui/icons";
5 | import styles from "./Explore.module.css"
6 | import { Components_Index } from "../../containers/Navigation";
7 |
8 | function Expore() {
9 | return (
10 |
11 | Explore
12 |
13 |
14 | {Components_Index.map((elm, idx) => {
15 | return (
16 |
17 |
18 |
19 | {elm.name}
20 |
21 |
22 |
23 |
24 | );
25 | })}
26 |
27 |
28 | );
29 | }
30 |
31 | export default Expore;
--------------------------------------------------------------------------------
/src/pages/home/animation.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Lottie from "react-lottie";
3 | import animationData from "./animation.json";
4 |
5 | export default function App() {
6 | const defaultOptions = {
7 | loop: true,
8 | autoplay: true,
9 | animationData: animationData,
10 | rendererSettings: {
11 | preserveAspectRatio: "xMidYMid slice",
12 | },
13 | };
14 |
15 | return ;
16 | }
17 |
--------------------------------------------------------------------------------
/src/pages/home/index.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Typography, Grid, Paper, Divider, Button } from "@material-ui/core";
3 | import { Link } from "react-router-dom";
4 |
5 | import LBannerAnimation from "./animation.jsx";
6 |
7 | function HomePage() {
8 | return (
9 |
10 |
11 |
12 |
18 | Exploring possibilities
19 |
20 |
24 | with React Native Elements
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | Explore Now{" "}
39 |
40 | 🌇
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | {FEATURES_LIST.map((feature, idx) => {
49 | return (
50 |
51 |
52 |
53 | );
54 | })}
55 |
56 |
57 |
63 |
64 | Why?
65 |
66 | React Native Elements houses a lot of components, and these
67 | components come with a lot of customisation and tweaks via props.
68 | Sometimes the user gets confused and wastes a lot of time in
69 | achieving the desired result.
70 |
71 | We came across a lot of such questions every day and sometimes user
72 | reports bugs which aren't bugs but just improper
73 | implementation/usage of the components.
74 |
75 |
76 |
77 | How it solves the problem?
78 |
79 | With Playground, users can explore components and tweak them as per
80 | their use-case and generate production-ready code. Or they can
81 | explore new possibilities with the components and improve the
82 | overall experience.
83 |
84 |
85 |
86 |
87 | );
88 | }
89 |
90 | export default HomePage;
91 |
92 | const FeatureCard = (props) => {
93 | return (
94 |
95 |
105 |
106 | {props.title}
107 | {props.content}
108 |
109 |
110 | );
111 | };
112 |
113 | const FEATURES_LIST = [
114 | {
115 | banner: require("../../assets/SVG/design.svg"),
116 | title: "Design",
117 | content: "From Design -> Code.",
118 | },
119 | {
120 | banner: require("../../assets/SVG/tweak.svg"),
121 | title: "Tweak",
122 | content: "Tweak components for the best-fit.",
123 | },
124 | {
125 | banner: require("../../assets/SVG/explore.svg"),
126 | title: "Explore",
127 | content: "Explore new possibilities",
128 | },
129 | {
130 | banner: require("../../assets/SVG/bootstrap.svg"),
131 | title: "Bootstrap",
132 | content: "Shhh... Generate code, bootstrap applications and relax.",
133 | },
134 | ];
135 |
--------------------------------------------------------------------------------
/src/serviceWorker.js:
--------------------------------------------------------------------------------
1 | // This optional code is used to register a service worker.
2 | // register() is not called by default.
3 |
4 | // This lets the app load faster on subsequent visits in production, and gives
5 | // it offline capabilities. However, it also means that developers (and users)
6 | // will only see deployed updates on subsequent visits to a page, after all the
7 | // existing tabs open on the page have been closed, since previously cached
8 | // resources are updated in the background.
9 |
10 | // To learn more about the benefits of this model and instructions on how to
11 | // opt-in, read https://bit.ly/CRA-PWA
12 |
13 | const isLocalhost = Boolean(
14 | window.location.hostname === "localhost" ||
15 | // [::1] is the IPv6 localhost address.
16 | window.location.hostname === "[::1]" ||
17 | // 127.0.0.1/8 is considered localhost for IPv4.
18 | window.location.hostname.match(
19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
20 | )
21 | );
22 |
23 | export function register(config) {
24 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
25 | // The URL constructor is available in all browsers that support SW.
26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
27 | if (publicUrl.origin !== window.location.origin) {
28 | // Our service worker won't work if PUBLIC_URL is on a different origin
29 | // from what our page is served on. This might happen if a CDN is used to
30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374
31 | return;
32 | }
33 |
34 | window.addEventListener("load", () => {
35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
36 |
37 | if (isLocalhost) {
38 | // This is running on localhost. Let's check if a service worker still exists or not.
39 | checkValidServiceWorker(swUrl, config);
40 |
41 | // Add some additional logging to localhost, pointing developers to the
42 | // service worker/PWA documentation.
43 | navigator.serviceWorker.ready.then(() => {
44 | console.log(
45 | "This web app is being served cache-first by a service " +
46 | "worker. To learn more, visit https://bit.ly/CRA-PWA"
47 | );
48 | });
49 | } else {
50 | // Is not localhost. Just register service worker
51 | registerValidSW(swUrl, config);
52 | }
53 | });
54 | }
55 | }
56 |
57 | function registerValidSW(swUrl, config) {
58 | navigator.serviceWorker
59 | .register(swUrl)
60 | .then((registration) => {
61 | registration.onupdatefound = () => {
62 | const installingWorker = registration.installing;
63 | if (installingWorker == null) {
64 | return;
65 | }
66 | installingWorker.onstatechange = () => {
67 | if (installingWorker.state === "installed") {
68 | if (navigator.serviceWorker.controller) {
69 | // At this point, the updated precached content has been fetched,
70 | // but the previous service worker will still serve the older
71 | // content until all client tabs are closed.
72 | console.log(
73 | "New content is available and will be used when all " +
74 | "tabs for this page are closed. See https://bit.ly/CRA-PWA."
75 | );
76 |
77 | // Execute callback
78 | if (config && config.onUpdate) {
79 | config.onUpdate(registration);
80 | }
81 | } else {
82 | // At this point, everything has been precached.
83 | // It's the perfect time to display a
84 | // "Content is cached for offline use." message.
85 | console.log("Content is cached for offline use.");
86 |
87 | // Execute callback
88 | if (config && config.onSuccess) {
89 | config.onSuccess(registration);
90 | }
91 | }
92 | }
93 | };
94 | };
95 | })
96 | .catch((error) => {
97 | console.error("Error during service worker registration:", error);
98 | });
99 | }
100 |
101 | function checkValidServiceWorker(swUrl, config) {
102 | // Check if the service worker can be found. If it can't reload the page.
103 | fetch(swUrl)
104 | .then((response) => {
105 | // Ensure service worker exists, and that we really are getting a JS file.
106 | const contentType = response.headers.get("content-type");
107 | if (
108 | response.status === 404 ||
109 | (contentType != null && contentType.indexOf("javascript") === -1)
110 | ) {
111 | // No service worker found. Probably a different app. Reload the page.
112 | navigator.serviceWorker.ready.then((registration) => {
113 | registration.unregister().then(() => {
114 | window.location.reload();
115 | });
116 | });
117 | } else {
118 | // Service worker found. Proceed as normal.
119 | registerValidSW(swUrl, config);
120 | }
121 | })
122 | .catch(() => {
123 | console.log(
124 | "No internet connection found. App is running in offline mode."
125 | );
126 | });
127 | }
128 |
129 | export function unregister() {
130 | if ("serviceWorker" in navigator) {
131 | navigator.serviceWorker.ready.then((registration) => {
132 | registration.unregister();
133 | });
134 | }
135 | }
136 |
--------------------------------------------------------------------------------