app-studio 0.0.8 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/app-studio.cjs.development.js +120 -98
- package/dist/app-studio.cjs.development.js.map +1 -1
- package/dist/app-studio.cjs.production.min.js +1 -1
- package/dist/app-studio.cjs.production.min.js.map +1 -1
- package/dist/app-studio.esm.js +117 -96
- package/dist/app-studio.esm.js.map +1 -1
- package/dist/components/Element.d.ts +12 -0
- package/dist/components/Form.d.ts +23 -0
- package/dist/components/Image.d.ts +2 -10
- package/dist/components/Text.d.ts +3 -6
- package/dist/components/View.d.ts +3 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/Layout.d.ts +0 -11
package/README.md
CHANGED
|
@@ -79,9 +79,10 @@ function Example() {
|
|
|
79
79
|
}
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
### Responsive
|
|
83
82
|
|
|
83
|
+
You can Use View is use <div> tag you can use Div, Span, Form, Input, Image components if you need another tag.
|
|
84
84
|
|
|
85
|
+
### Responsive
|
|
85
86
|
|
|
86
87
|
```jsx
|
|
87
88
|
import React from 'react';
|
|
@@ -89,6 +90,8 @@ import { ResponsiveProvider } from 'app-studio';
|
|
|
89
90
|
|
|
90
91
|
const Example = () => {
|
|
91
92
|
const { screen, on } = useResponsive();
|
|
93
|
+
// "screen" provide you the screen size corresponding to you breakpoints
|
|
94
|
+
// "on" tell you is screen size is included corresponding to you devices
|
|
92
95
|
const responsive = {
|
|
93
96
|
xs: {
|
|
94
97
|
backgroundColor: 'red',
|
|
@@ -168,7 +171,8 @@ const theme = {
|
|
|
168
171
|
}
|
|
169
172
|
|
|
170
173
|
};
|
|
171
|
-
|
|
174
|
+
// color will be replaced by the value form the theme
|
|
175
|
+
// all the colors props like backgroundColor will have the color from the theme
|
|
172
176
|
function Example() {
|
|
173
177
|
return (
|
|
174
178
|
<ThemeProvider theme={theme}>
|
|
@@ -667,6 +667,15 @@ var StyledView = /*#__PURE__*/styled.div(function (props) {
|
|
|
667
667
|
var StyledImage = /*#__PURE__*/styled.img(function (props) {
|
|
668
668
|
return applyStyle(props);
|
|
669
669
|
});
|
|
670
|
+
var StyledSpan = /*#__PURE__*/styled.span(function (props) {
|
|
671
|
+
return applyStyle(props);
|
|
672
|
+
});
|
|
673
|
+
var StyledInput = /*#__PURE__*/styled.input(function (props) {
|
|
674
|
+
return applyStyle(props);
|
|
675
|
+
});
|
|
676
|
+
var StyledForm = /*#__PURE__*/styled.form(function (props) {
|
|
677
|
+
return applyStyle(props);
|
|
678
|
+
});
|
|
670
679
|
var ViewElement = /*#__PURE__*/function (_React$PureComponent) {
|
|
671
680
|
_inheritsLoose(ViewElement, _React$PureComponent);
|
|
672
681
|
|
|
@@ -714,122 +723,134 @@ var ImageElement = /*#__PURE__*/function (_React$PureComponent2) {
|
|
|
714
723
|
|
|
715
724
|
return ImageElement;
|
|
716
725
|
}(React__default.PureComponent);
|
|
726
|
+
var SpanElement = /*#__PURE__*/function (_React$PureComponent3) {
|
|
727
|
+
_inheritsLoose(SpanElement, _React$PureComponent3);
|
|
717
728
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}
|
|
721
|
-
var SafeArea = View;
|
|
722
|
-
var Scroll = function Scroll(props) {
|
|
723
|
-
return React__default.createElement(View, Object.assign({
|
|
724
|
-
overflow: 'auto'
|
|
725
|
-
}, props));
|
|
726
|
-
};
|
|
729
|
+
function SpanElement() {
|
|
730
|
+
return _React$PureComponent3.apply(this, arguments) || this;
|
|
731
|
+
}
|
|
727
732
|
|
|
728
|
-
var
|
|
729
|
-
_excluded2 = ["size", "src"],
|
|
730
|
-
_excluded3 = ["size", "src"];
|
|
731
|
-
var ImageBackground = /*#__PURE__*/function (_React$PureComponent) {
|
|
732
|
-
_inheritsLoose(ImageBackground, _React$PureComponent);
|
|
733
|
+
var _proto3 = SpanElement.prototype;
|
|
733
734
|
|
|
734
|
-
function
|
|
735
|
-
|
|
736
|
-
}
|
|
735
|
+
_proto3.render = function render() {
|
|
736
|
+
var onClick = this.props.onClick;
|
|
737
737
|
|
|
738
|
-
|
|
738
|
+
if (this.props.onPress !== undefined) {
|
|
739
|
+
onClick = this.props.onPress;
|
|
740
|
+
}
|
|
739
741
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
onClick = _this$props.onClick,
|
|
744
|
-
onPress = _this$props.onPress,
|
|
745
|
-
props = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
746
|
-
|
|
747
|
-
return React__default.createElement(View, Object.assign({
|
|
748
|
-
style: {
|
|
749
|
-
backgroundSize: 'contain',
|
|
750
|
-
backgroundImage: "url(\"" + src + "\")",
|
|
751
|
-
backgroundPosition: 'center center',
|
|
752
|
-
backgroundRepeat: 'no-repeat'
|
|
753
|
-
},
|
|
754
|
-
onClick: onClick ? onClick : onPress
|
|
755
|
-
}, props));
|
|
742
|
+
return React__default.createElement(StyledSpan, Object.assign({}, this.props, {
|
|
743
|
+
onClick: onClick
|
|
744
|
+
}));
|
|
756
745
|
};
|
|
757
746
|
|
|
758
|
-
return
|
|
747
|
+
return SpanElement;
|
|
759
748
|
}(React__default.PureComponent);
|
|
760
|
-
var
|
|
761
|
-
|
|
762
|
-
};
|
|
763
|
-
var RoundedImage = function RoundedImage(_ref) {
|
|
764
|
-
var size = _ref.size,
|
|
765
|
-
src = _ref.src,
|
|
766
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
767
|
-
|
|
768
|
-
return React__default.createElement(ImageBackground, Object.assign({
|
|
769
|
-
borderRadius: size / 2,
|
|
770
|
-
size: size,
|
|
771
|
-
src: src
|
|
772
|
-
}, props));
|
|
773
|
-
};
|
|
774
|
-
var SquaredImage = function SquaredImage(_ref2) {
|
|
775
|
-
var size = _ref2.size,
|
|
776
|
-
src = _ref2.src,
|
|
777
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded3);
|
|
778
|
-
|
|
779
|
-
return React__default.createElement(ImageBackground, Object.assign({}, props, {
|
|
780
|
-
size: size,
|
|
781
|
-
src: src
|
|
782
|
-
}));
|
|
783
|
-
};
|
|
784
|
-
|
|
785
|
-
var _excluded$1 = ["toUpperCase", "children", "toFormat"];
|
|
786
|
-
var TextSpan = /*#__PURE__*/styled.div(function (props) {
|
|
787
|
-
props.display = 'inherit';
|
|
788
|
-
props.flexDirection = 'column';
|
|
789
|
-
return applyStyle(props);
|
|
790
|
-
});
|
|
791
|
-
var Text = /*#__PURE__*/function (_React$PureComponent) {
|
|
792
|
-
_inheritsLoose(Text, _React$PureComponent);
|
|
749
|
+
var InputElement = /*#__PURE__*/function (_React$PureComponent4) {
|
|
750
|
+
_inheritsLoose(InputElement, _React$PureComponent4);
|
|
793
751
|
|
|
794
|
-
function
|
|
795
|
-
return _React$
|
|
752
|
+
function InputElement() {
|
|
753
|
+
return _React$PureComponent4.apply(this, arguments) || this;
|
|
796
754
|
}
|
|
797
755
|
|
|
798
|
-
var
|
|
756
|
+
var _proto4 = InputElement.prototype;
|
|
799
757
|
|
|
800
|
-
|
|
801
|
-
var
|
|
802
|
-
_this$props$toUpperCa = _this$props.toUpperCase,
|
|
803
|
-
toUpperCase = _this$props$toUpperCa === void 0 ? false : _this$props$toUpperCa,
|
|
804
|
-
children = _this$props.children,
|
|
805
|
-
_this$props$toFormat = _this$props.toFormat,
|
|
806
|
-
toFormat = _this$props$toFormat === void 0 ? false : _this$props$toFormat,
|
|
807
|
-
props = _objectWithoutPropertiesLoose(_this$props, _excluded$1);
|
|
808
|
-
|
|
809
|
-
var content = children;
|
|
810
|
-
|
|
811
|
-
if (children && typeof children === 'string') {
|
|
812
|
-
content = children.toString().trim();
|
|
813
|
-
}
|
|
758
|
+
_proto4.render = function render() {
|
|
759
|
+
var onClick = this.props.onClick;
|
|
814
760
|
|
|
815
|
-
if (
|
|
816
|
-
|
|
761
|
+
if (this.props.onPress !== undefined) {
|
|
762
|
+
onClick = this.props.onPress;
|
|
817
763
|
}
|
|
818
764
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
765
|
+
return React__default.createElement(StyledInput, Object.assign({}, this.props, {
|
|
766
|
+
onClick: onClick
|
|
767
|
+
}));
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
return InputElement;
|
|
771
|
+
}(React__default.PureComponent);
|
|
772
|
+
var FormElement = /*#__PURE__*/function (_React$PureComponent5) {
|
|
773
|
+
_inheritsLoose(FormElement, _React$PureComponent5);
|
|
774
|
+
|
|
775
|
+
function FormElement() {
|
|
776
|
+
return _React$PureComponent5.apply(this, arguments) || this;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
var _proto5 = FormElement.prototype;
|
|
780
|
+
|
|
781
|
+
_proto5.render = function render() {
|
|
782
|
+
var onClick = this.props.onClick;
|
|
783
|
+
|
|
784
|
+
if (this.props.onPress !== undefined) {
|
|
785
|
+
onClick = this.props.onPress;
|
|
825
786
|
}
|
|
826
787
|
|
|
827
|
-
return React__default.createElement(
|
|
788
|
+
return React__default.createElement(StyledForm, Object.assign({}, this.props, {
|
|
789
|
+
onClick: onClick
|
|
790
|
+
}));
|
|
828
791
|
};
|
|
829
792
|
|
|
830
|
-
return
|
|
793
|
+
return FormElement;
|
|
831
794
|
}(React__default.PureComponent);
|
|
832
795
|
|
|
796
|
+
var View = function View(props) {
|
|
797
|
+
return React__default.createElement(ViewElement, Object.assign({}, props));
|
|
798
|
+
};
|
|
799
|
+
var Div = View;
|
|
800
|
+
var SafeArea = View;
|
|
801
|
+
var Scroll = function Scroll(props) {
|
|
802
|
+
return React__default.createElement(View, Object.assign({
|
|
803
|
+
overflow: 'auto'
|
|
804
|
+
}, props));
|
|
805
|
+
};
|
|
806
|
+
var Span = function Span(props) {
|
|
807
|
+
return React__default.createElement(SpanElement, Object.assign({}, props));
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
var Image = function Image(props) {
|
|
811
|
+
return React__default.createElement(ImageElement, Object.assign({}, props));
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
var _excluded = ["toUpperCase", "children"];
|
|
815
|
+
var TextSpan = /*#__PURE__*/styled.span(function (props) {
|
|
816
|
+
return applyStyle(props);
|
|
817
|
+
});
|
|
818
|
+
var Text = function Text(props) {
|
|
819
|
+
var _props$toUpperCase = props.toUpperCase,
|
|
820
|
+
toUpperCase = _props$toUpperCase === void 0 ? false : _props$toUpperCase,
|
|
821
|
+
children = props.children,
|
|
822
|
+
textPops = _objectWithoutPropertiesLoose(props, _excluded);
|
|
823
|
+
|
|
824
|
+
var content = children;
|
|
825
|
+
|
|
826
|
+
if (typeof content === 'string' && toUpperCase) {
|
|
827
|
+
content = content.toUpperCase();
|
|
828
|
+
} // if (typeof content === 'string' && toFormat) {
|
|
829
|
+
// const newtext: any = content
|
|
830
|
+
// .split('\n')
|
|
831
|
+
// .map((item: any, key: number): any => {
|
|
832
|
+
// return (
|
|
833
|
+
// <span key={key.toString()}>
|
|
834
|
+
// {item}
|
|
835
|
+
// <br />
|
|
836
|
+
// </span>
|
|
837
|
+
// );
|
|
838
|
+
// });
|
|
839
|
+
// }
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
return React__default.createElement(TextSpan, Object.assign({}, textPops, {
|
|
843
|
+
children: content
|
|
844
|
+
}));
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
var Form = function Form(props) {
|
|
848
|
+
return React__default.createElement(FormElement, Object.assign({}, props));
|
|
849
|
+
};
|
|
850
|
+
var Input = function Input(props) {
|
|
851
|
+
return React__default.createElement(InputElement, Object.assign({}, props));
|
|
852
|
+
};
|
|
853
|
+
|
|
833
854
|
var useMount = function useMount(callback) {
|
|
834
855
|
React.useEffect(function () {
|
|
835
856
|
callback();
|
|
@@ -943,14 +964,15 @@ var useResponsive = function useResponsive() {
|
|
|
943
964
|
};
|
|
944
965
|
};
|
|
945
966
|
|
|
967
|
+
exports.Div = Div;
|
|
968
|
+
exports.Form = Form;
|
|
946
969
|
exports.Image = Image;
|
|
947
|
-
exports.
|
|
970
|
+
exports.Input = Input;
|
|
948
971
|
exports.ResponsiveContext = ResponsiveContext;
|
|
949
972
|
exports.ResponsiveProvider = ResponsiveProvider;
|
|
950
|
-
exports.RoundedImage = RoundedImage;
|
|
951
973
|
exports.SafeArea = SafeArea;
|
|
952
974
|
exports.Scroll = Scroll;
|
|
953
|
-
exports.
|
|
975
|
+
exports.Span = Span;
|
|
954
976
|
exports.Text = Text;
|
|
955
977
|
exports.TextSpan = TextSpan;
|
|
956
978
|
exports.ThemeContext = ThemeContext;
|