Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Jun 28, 2018
0 parents commit d05f06e
Show file tree
Hide file tree
Showing 22 changed files with 221 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
indent_style = space
indent_size = 2

[*.hx]
indent_style = tab
indent_size = 4
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Rudy Ges

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Empty file added README.md
Empty file.
8 changes: 8 additions & 0 deletions build.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# TODO: include enzyme and add tests
-lib react:git:https://github.com/kLabz/haxe-react.git#next
-D react_deprecated_refs

-cp src
# TODO: include files
--js .build/test.js

14 changes: 14 additions & 0 deletions haxelib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "material-ui",
"description": "Material UI - React components that implement Google's Material Design",
"version": "0.0.1",
"releasenote": "TODO",
"url": "https://gitlab.com/k-labz/haxe-oss/haxe-material-ui",
"license": "MIT",
"tags": [],
"classPath": "src",
"contributors": [
"klabz"
]
}

9 changes: 9 additions & 0 deletions src/mui/StandardProps.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package mui;

@:genericBuild(mui.macro.Builder.buildStandardProps())
interface StandardProps<ClassKey:String> {
@:optional var className:String;
@:optional var style:Dynamic; // TODO: React.CSSProperties in ts.react
@:optional var innerRef:react.ReactRef<Any>;
}

7 changes: 7 additions & 0 deletions src/mui/core/AppBar.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core;

import react.ReactComponent;

@:jsRequire('@material-ui/core', 'AppBar')
extern class AppBar extends ReactComponent {}

7 changes: 7 additions & 0 deletions src/mui/core/Button.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core;

import react.ReactComponent;

@:jsRequire('@material-ui/core', 'Button')
extern class Button extends ReactComponent {}

7 changes: 7 additions & 0 deletions src/mui/core/CssBaseline.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core;

import react.ReactComponent;

@:jsRequire('@material-ui/core', 'CssBaseline')
extern class CssBaseline extends ReactComponent {}

7 changes: 7 additions & 0 deletions src/mui/core/LinearProgress.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core;

import react.ReactComponent;

@:jsRequire('@material-ui/core', 'LinearProgress')
extern class LinearProgress extends ReactComponent {}

7 changes: 7 additions & 0 deletions src/mui/core/List.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core;

import react.ReactComponent;

@:jsRequire('@material-ui/core', 'List')
extern class List extends ReactComponent {}

7 changes: 7 additions & 0 deletions src/mui/core/ListItem.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core;

import react.ReactComponent;

@:jsRequire('@material-ui/core', 'ListItem')
extern class ListItem extends ReactComponent {}

7 changes: 7 additions & 0 deletions src/mui/core/ListItemText.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core;

import react.ReactComponent;

@:jsRequire('@material-ui/core', 'ListItemText')
extern class ListItemText extends ReactComponent {}

7 changes: 7 additions & 0 deletions src/mui/core/Paper.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core;

import react.ReactComponent;

@:jsRequire('@material-ui/core', 'Paper')
extern class Paper extends ReactComponent {}

7 changes: 7 additions & 0 deletions src/mui/core/Tab.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core;

import react.ReactComponent;

@:jsRequire('@material-ui/core', 'Tab')
extern class Tab extends ReactComponent {}

14 changes: 14 additions & 0 deletions src/mui/core/Tabs.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package mui.core;

import react.ReactComponent;

// TODO !! (temp)
typedef TabsProps = {
@:optional var className:String;
@:optional var onChange:Dynamic->String->Void;
var value:String;
}

@:jsRequire('@material-ui/core', 'Tabs')
extern class Tabs extends ReactComponentOfProps<TabsProps> {}

7 changes: 7 additions & 0 deletions src/mui/core/Toolbar.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core;

import react.ReactComponent;

@:jsRequire('@material-ui/core', 'Toolbar')
extern class Toolbar extends ReactComponent {}

22 changes: 22 additions & 0 deletions src/mui/core/Typography.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mui.core;

import mui.StandardProps;
import react.ReactComponent;

@:enum abstract TypographyClassKey(String) to String {
var Root = "root";
var Display1 = "display1";
var Display2 = "display2";
var Display3 = "display3";
var Display4 = "display4";
// ... TODO
}

typedef TypographyProps = {
> StandardProps<TypographyClassKey>,
// ... TODO
}

@:jsRequire('@material-ui/core', 'Typography')
extern class Typography extends ReactComponent {}

6 changes: 6 additions & 0 deletions src/mui/core/styles/MuiTheme.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package mui.core.styles;

@:jsRequire('@material-ui/core/styles')
extern class MuiTheme {
public static function createMuiTheme(options:Dynamic):Dynamic;
}
7 changes: 7 additions & 0 deletions src/mui/core/styles/MuiThemeProvider.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mui.core.styles;

import react.ReactComponent;

@:jsRequire('@material-ui/core/styles', 'MuiThemeProvider')
extern class MuiThemeProvider extends ReactComponent {} // TODO: props

31 changes: 31 additions & 0 deletions src/mui/macro/Builder.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package mui.macro;

import haxe.macro.Context;
import haxe.macro.Expr;
import ts.macro.RecordMacro;

class Builder {
public static function buildStandardProps():ComplexType {
var fields = Context.getBuildFields();
var classesType:ComplexType;

try {
classesType = RecordMacro.buildRecord(
Context.getLocalType(),
macro :String,
true
);
} catch (e:String) {
trace('TODO: error message');
return null;
}

fields.push({
kind: FVar(classesType, null),
name: "classes",
pos: Context.currentPos()
});

return TAnonymous(fields);
}
}

0 comments on commit d05f06e

Please sign in to comment.