Skip to content

Commit 761ef57

Browse files
agustin107epicfaace
authored andcommitted
Add material-ui theme (rjsf-team#1420)
* Add material-ui theme Related to issue rjsf-team#1222 * Delete LICENSE and update README This is according to PR conversation * Move material-ui theme into themes folder and delete example folder
1 parent d8b8039 commit 761ef57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1435
-0
lines changed

themes/material-ui/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.log
2+
.DS_Store
3+
node_modules
4+
.cache
5+
.rts2_cache_cjs
6+
.rts2_cache_esm
7+
.rts2_cache_umd
8+
dist

themes/material-ui/README.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<!--
2+
*** Thanks for checking out this README Template. If you have a suggestion that would
3+
*** make this better please fork the repo and create a pull request or simple open
4+
*** an issue with the tag "enhancement".
5+
*** Thanks again! Now go create something AMAZING! :D
6+
-->
7+
8+
<!-- PROJECT SHIELDS -->
9+
<!--
10+
*** I'm using markdown "reference style" links for readability.
11+
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
12+
*** See the bottom of this document for the declaration of the reference variables
13+
*** for build-url, contributors-url, etc. This is an optional, concise syntax you may use.
14+
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
15+
-->
16+
17+
[![Build Status][build-shield]][build-url]
18+
[![npm][npm-shield]][npm-url]
19+
[![npm downloads][npm-dl-shield]][npm-dl-url]
20+
[![Contributors][contributors-shield]][contributors-url]
21+
[![MIT License][license-shield]][license-url]
22+
23+
<!-- PROJECT LOGO -->
24+
<br />
25+
<p align="center">
26+
<a href="https://github.com/cybertec-postgresql/rjsf-material-ui">
27+
<img src="https://raw.githubusercontent.com/cybertec-postgresql/rjsf-material-ui/master/rjsf-material-ui-logo.png" alt="Logo" width="140" height="120">
28+
</a>
29+
30+
<h3 align="center">rjsf-material-ui</h3>
31+
32+
<p align="center">
33+
Material-UI theme, fields and widgets for <a href="https://github.com/mozilla-services/react-jsonschema-form/"><code>react-jsonschema-form</code></a>.
34+
<br />
35+
<a href="https://github.com/cybertec-postgresql/rjsf-material-ui"><strong>Explore the docs »</strong></a>
36+
<br />
37+
<br />
38+
<a href="https://cybertec-postgresql.github.io/rjsf-material-ui/">View Playground</a>
39+
·
40+
<a href="https://github.com/cybertec-postgresql/rjsf-material-ui/issues">Report Bug</a>
41+
·
42+
<a href="https://github.com/cybertec-postgresql/rjsf-material-ui/issues">Request Feature</a>
43+
</p>
44+
</p>
45+
46+
<!-- TABLE OF CONTENTS -->
47+
48+
## Table of Contents
49+
50+
- [About the Project](#about-the-project)
51+
- [Built With](#built-with)
52+
- [Getting Started](#getting-started)
53+
- [Prerequisites](#prerequisites)
54+
- [Installation](#installation)
55+
- [Usage](#usage)
56+
- [Roadmap](#roadmap)
57+
- [Contributing](#contributing)
58+
- [License](#license)
59+
- [Contact](#contact)
60+
61+
<!-- ABOUT THE PROJECT -->
62+
63+
## About The Project
64+
65+
[![rjsf-material-ui Screen Shot][product-screenshot]](https://cybertec-postgresql.github.io/rjsf-material-ui)
66+
67+
Exports `material-ui` theme, fields and widgets for `react-jsonschema-form`.
68+
69+
### Built With
70+
71+
- [react-jsonschema-form](https://github.com/mozilla-services/react-jsonschema-form/)
72+
- [Material-UI](https://material-ui.com/)
73+
- [Typescript](https://www.typescriptlang.org/)
74+
75+
<!-- GETTING STARTED -->
76+
77+
## Getting Started
78+
79+
### Prerequisites
80+
81+
- `@material-ui/core >= 4.2.0` ([in 4.2.0, the `slider` component was added to the core](https://github.com/mui-org/material-ui/pull/16416))
82+
- `@material-ui/icons`
83+
- `react-jsonschema-form >= 1.6.0` ([in 1.6.0, the `withTheme` HOC was added](https://github.com/mozilla-services/react-jsonschema-form/pull/1226))
84+
85+
```sh
86+
yarn add @material-ui/core @material-ui/icons react-jsonschema-form
87+
```
88+
89+
### Installation
90+
91+
```sh
92+
yarn add rjsf-material-ui
93+
```
94+
95+
<!-- USAGE EXAMPLES -->
96+
97+
## Usage
98+
99+
```javascript
100+
import { withTheme } from 'react-jsonschema-form';
101+
import { Theme as MuiTheme } from 'rjsf-material-ui';
102+
103+
const Form = withTheme(MuiTheme);
104+
```
105+
106+
or
107+
108+
```javascript
109+
import MuiForm from 'rjsf-material-ui';
110+
```
111+
112+
<!-- ROADMAP -->
113+
114+
## Roadmap
115+
116+
See the [open issues](https://cybertec-postgresql.github.io/rjsf-material-ui/issues) for a list of proposed features (and known issues).
117+
118+
<!-- CONTRIBUTING -->
119+
120+
## Contributing
121+
122+
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
123+
124+
1. Fork the Project
125+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
126+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
127+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
128+
5. Open a Pull Request
129+
130+
<!-- CONTACT -->
131+
132+
## Contact
133+
134+
Cybertec TEAM - [@postgressupport](https://twitter.com/postgressupport) - office@cybertec.at - https://www.cybertec-postgresql.com
135+
136+
Project Link: [https://cybertec-postgresql.github.io/rjsf-material-ui](https://cybertec-postgresql.github.io/rjsf-material-ui)
137+
138+
<!-- MARKDOWN LINKS & IMAGES -->
139+
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
140+
141+
[build-shield]: https://img.shields.io/circleci/build/github/cybertec-postgresql/rjsf-material-ui.svg?style=flat-square&token=a58b0890f96bff2b53eef0f4d9c9e5d16eec2200
142+
[build-url]: https://circleci.com/gh/cybertec-postgresql/rjsf-material-ui
143+
[contributors-shield]: https://img.shields.io/badge/contributors-1-orange.svg?style=flat-square
144+
[contributors-url]: https://github.com/cybertec-postgresql/rjsf-material-ui/graphs/contributors
145+
[license-shield]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
146+
[license-url]: https://choosealicense.com/licenses/mit
147+
[npm-shield]: https://img.shields.io/npm/v/rjsf-material-ui/latest.svg?style=flat-square
148+
[npm-url]: https://www.npmjs.com/package/rjsf-material-ui
149+
[npm-dl-shield]: https://img.shields.io/npm/dm/rjsf-material-ui.svg?style=flat-square
150+
[npm-dl-url]: https://www.npmjs.com/package/rjsf-material-ui
151+
[product-screenshot]: https://raw.githubusercontent.com/cybertec-postgresql/rjsf-material-ui/master/screenshot.png

themes/material-ui/package.json

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"name": "rjsf-material-ui",
3+
"version": "0.3.6",
4+
"main": "dist/index.js",
5+
"module": "dist/rjsf-material-ui.esm.js",
6+
"typings": "dist/index.d.ts",
7+
"description": "Material UI theme, fields and widgets for react-jsonschema-form",
8+
"files": [
9+
"dist"
10+
],
11+
"scripts": {
12+
"start": "tsdx watch",
13+
"build": "tsdx build",
14+
"clean": "rimraf dist",
15+
"test": "tsdx test --env=jsdom",
16+
"npm": "np",
17+
"publish-to-npm": "run-s clean build npm"
18+
},
19+
"peerDependencies": {
20+
"@material-ui/core": "^4.2.0",
21+
"@material-ui/icons": "^4.2.1",
22+
"react": ">=16",
23+
"react-jsonschema-form": "^1.6.1"
24+
},
25+
"devDependencies": {
26+
"@babel/core": "^7.0.0-0",
27+
"@babel/plugin-proposal-class-properties": "^7.5.5",
28+
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
29+
"@babel/plugin-transform-runtime": "^7.5.5",
30+
"@babel/preset-env": "^7.5.5",
31+
"@babel/preset-react": "^7.0.0",
32+
"@material-ui/core": "^4.2.0",
33+
"@material-ui/icons": "^4.2.1",
34+
"@types/jest": "^24.0.15",
35+
"@types/json-schema": "^7.0.3",
36+
"@types/react": "^16.8.23",
37+
"@types/react-dom": "^16.8.4",
38+
"@types/react-jsonschema-form": "^1.6.2",
39+
"husky": "^3.0.0",
40+
"np": "^5.0.3",
41+
"npm-run-all": "^4.1.5",
42+
"prettier": "^1.18.2",
43+
"pretty-quick": "^1.11.1",
44+
"react": "^16.8.6",
45+
"react-dom": "^16.8.6",
46+
"react-jsonschema-form": "^1.6.1",
47+
"rimraf": "^2.6.3",
48+
"tsdx": "^0.7.2",
49+
"tslib": "^1.10.0",
50+
"typescript": "^3.5.3"
51+
},
52+
"husky": {
53+
"hooks": {
54+
"pre-commit": "pretty-quick --staged"
55+
}
56+
},
57+
"prettier": {
58+
"printWidth": 80,
59+
"semi": true,
60+
"singleQuote": true,
61+
"trailingComma": "es5"
62+
},
63+
"publishConfig": {
64+
"access": "public"
65+
},
66+
"author": "Agustin N. R. Ramirez <agustin.ramirez@cybertec.at>",
67+
"contributors": [
68+
"Lorenz Henk <lorenz.henk@cybertec.at>"
69+
],
70+
"keywords": [
71+
"Material UI",
72+
"react-jsonschema-form",
73+
"jsonschema",
74+
"json-schema",
75+
"json",
76+
"schema",
77+
"form",
78+
"react",
79+
"material-ui",
80+
"rjsf-material-ui"
81+
],
82+
"repository": {
83+
"type": "git",
84+
"url": "git+https://github.com/cybertec-postgresql/rjsf-material-ui.git"
85+
},
86+
"license": "MIT"
87+
}
80.2 KB
Loading

themes/material-ui/screenshot.png

390 KB
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
3+
import { AddButtonProps } from 'react-jsonschema-form';
4+
5+
import Button from '@material-ui/core/Button';
6+
import AddIcon from '@material-ui/icons/Add';
7+
8+
const AddButton: React.FC<AddButtonProps> = props => (
9+
<Button {...props} color="secondary">
10+
<AddIcon /> Add Item
11+
</Button>
12+
);
13+
14+
export default AddButton;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default } from './AddButton';
2+
export * from './AddButton';

0 commit comments

Comments
 (0)