app-studio 0.0.7 → 0.0.11
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 +165 -117
- 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 +162 -115
- package/dist/app-studio.esm.js.map +1 -1
- package/dist/components/Element.d.ts +12 -19
- 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/dist/utils/style.d.ts +4 -0
- package/package.json +3 -3
- package/dist/components/Layout.d.ts +0 -11
- package/src/components/Element.tsx +0 -488
- package/src/components/Image.tsx +0 -49
- package/src/components/Layout.tsx +0 -49
- package/src/components/Text.tsx +0 -61
- package/src/components/View.md +0 -6
- package/src/components/View.tsx +0 -24
- package/src/components/Wrapper.tsx +0 -11
- package/src/hooks/useMount.ts +0 -6
- package/src/hooks/useResponsive.ts +0 -102
- package/src/index.tsx +0 -8
- package/src/providers/Responsive.tsx +0 -61
- package/src/providers/Theme.tsx +0 -73
- package/src/types/module.d.ts +0 -1
- package/src/types/style.d.ts +0 -696
- package/src/utils/colors.ts +0 -321
- package/src/utils/env.ts +0 -43
- package/src/utils/shadow.ts +0 -102
- package/src/utils/typography.ts +0 -45
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}>
|
|
@@ -8,6 +8,7 @@ var React = require('react');
|
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
9
|
var Color = _interopDefault(require('color-convert'));
|
|
10
10
|
var styled = _interopDefault(require('styled-components'));
|
|
11
|
+
var unitlessKeys = _interopDefault(require('@emotion/unitless'));
|
|
11
12
|
|
|
12
13
|
function _inheritsLoose(subClass, superClass) {
|
|
13
14
|
subClass.prototype = Object.create(superClass.prototype);
|
|
@@ -492,26 +493,51 @@ var shadows = {
|
|
|
492
493
|
}
|
|
493
494
|
};
|
|
494
495
|
|
|
495
|
-
var
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
496
|
+
var unitlessStyleProps = /*#__PURE__*/Object.keys(unitlessKeys);
|
|
497
|
+
var validStyleProps = ['alignContent', 'alignItems', 'alignSelf', 'alignmentBaseline', 'all', 'animation', 'animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction', 'appearance', 'backdropFilter', 'backfaceVisibility', 'background', 'backgroundAttachment', 'backgroundBlendMode', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPosition', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundRepeatX', 'backgroundRepeatY', 'backgroundSize', 'baselineShift', 'blockSize', 'border', 'borderBlockEnd', 'borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth', 'borderBlockStart', 'borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth', 'borderBottom', 'borderBottomColor', 'borderBottomLeftRadius', 'borderBottomRightRadius', 'borderBottomStyle', 'borderBottomWidth', 'borderCollapse', 'borderColor', 'borderImage', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderInlineEnd', 'borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth', 'borderInlineStart', 'borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth', 'borderLeft', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRadius', 'borderRight', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderSpacing', 'borderStyle', 'borderTop', 'borderTopColor', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderTopStyle', 'borderTopWidth', 'borderWidth', 'bottom', 'boxShadow', 'boxSizing', 'breakAfter', 'breakBefore', 'breakInside', 'bufferedRendering', 'captionSide', 'caretColor', 'clear', 'clip', 'clipPath', 'clipRule', 'color', 'colorInterpolation', 'colorInterpolationFilters', 'colorRendering', 'columnCount', 'columnFill', 'columnGap', 'columnRule', 'columnRuleColor', 'columnRuleStyle', 'columnRuleWidth', 'columnSpan', 'columnWidth', 'columns', 'contain', 'content', 'counterIncrement', 'counterReset', 'cursor', 'cx', 'cy', 'd', 'direction', 'display', 'dominantBaseline', 'emptyCells', 'fill', 'fillOpacity', 'fillRule', 'filter', 'flex', 'flexBasis', 'flexDirection', 'flexFlow', 'flexGrow', 'flexShrink', 'flexWrap', 'float', 'floodColor', 'floodOpacity', 'font', 'fontDisplay', 'fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontSize', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariationSettings', 'fontWeight', 'gap', 'grid', 'gridArea', 'gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridColumn', 'gridColumnEnd', 'gridColumnGap', 'gridColumnStart', 'gridGap', 'gridRow', 'gridRowEnd', 'gridRowGap', 'gridRowStart', 'gridTemplate', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows', 'height', 'hyphens', 'imageRendering', 'inlineSize', 'isolation', 'justifyContent', 'justifyItems', 'justifySelf', 'left', 'letterSpacing', 'lightingColor', 'lineBreak', 'lineHeight', 'listStyle', 'listStyleImage', 'listStylePosition', 'listStyleType', 'margin', 'marginBlockEnd', 'marginBlockStart', 'marginBottom', 'marginInlineEnd', 'marginInlineStart', 'marginLeft', 'marginRight', 'marginTop', 'marker', 'markerEnd', 'markerMid', 'markerStart', 'mask', 'maskType', 'maxBlockSize', 'maxHeight', 'maxInlineSize', 'maxWidth', 'maxZoom', 'minBlockSize', 'minHeight', 'minInlineSize', 'minWidth', 'minZoom', 'mixBlendMode', 'objectFit', 'objectPosition', 'offset', 'offsetDistance', 'offsetPath', 'offsetRotate', 'opacity', 'order', 'orientation', 'orphans', 'outline', 'outlineColor', 'outlineOffset', 'outlineStyle', 'outlineWidth', 'overflow', 'overflowAnchor', 'overflowWrap', 'overflowX', 'overflowY', 'overscrollBehavior', 'overscrollBehaviorBlock', 'overscrollBehaviorInline', 'overscrollBehaviorX', 'overscrollBehaviorY', 'padding', 'paddingBlockEnd', 'paddingBlockStart', 'paddingBottom', 'paddingInlineEnd', 'paddingInlineStart', 'paddingLeft', 'paddingRight', 'paddingTop', 'page', 'pageBreakAfter', 'pageBreakBefore', 'pageBreakInside', 'paintOrder', 'perspective', 'perspectiveOrigin', 'placeContent', 'placeItems', 'placeSelf', 'pointerEvents', 'position', 'quotes', 'r', 'resize', 'right', 'rowGap', 'rx', 'ry', 'scrollBehavior', 'scrollMargin', 'scrollMarginBlock', 'scrollMarginBlockEnd', 'scrollMarginBlockStart', 'scrollMarginBottom', 'scrollMarginInline', 'scrollMarginInlineEnd', 'scrollMarginInlineStart', 'scrollMarginLeft', 'scrollMarginRight', 'scrollMarginTop', 'scrollPadding', 'scrollPaddingBlock', 'scrollPaddingBlockEnd', 'scrollPaddingBlockStart', 'scrollPaddingBottom', 'scrollPaddingInline', 'scrollPaddingInlineEnd', 'scrollPaddingInlineStart', 'scrollPaddingLeft', 'scrollPaddingRight', 'scrollPaddingTop', 'scrollSnapAlign', 'scrollSnapStop', 'scrollSnapType', 'shapeImageThreshold', 'shapeMargin', 'shapeOutside', 'shapeRendering', 'size', 'speak', 'src', 'stopColor', 'stopOpacity', 'stroke', 'strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'tabSize', 'tableLayout', 'textAlign', 'textAlignLast', 'textAnchor', 'textCombineUpright', 'textDecoration', 'textDecorationColor', 'textDecorationLine', 'textDecorationSkipInk', 'textDecorationStyle', 'textIndent', 'textOrientation', 'textOverflow', 'textRendering', 'textShadow', 'textSizeAdjust', 'textTransform', 'textUnderlinePosition', 'top', 'touchAction', 'transform', 'transformBox', 'transformOrigin', 'transformStyle', 'transition', 'transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction', 'unicodeBidi', 'unicodeRange', 'userSelect', 'userZoom', 'vectorEffect', 'verticalAlign', 'visibility', 'whiteSpace', 'widows', 'width', 'willChange', 'wordBreak', 'wordSpacing', 'wordWrap', 'writingMode', 'x', 'y', 'zIndex', 'zoom', 'alwaysBounceHorizontal', 'alwaysBounceVertical', 'automaticallyAdjustContentInsets', 'bounces', 'bouncesZoom', 'canCancelContentTouches', 'centerContent', 'contentLayoutStyle', 'contentInset', 'contentInsetAdjustmentBehavior', 'contentOffset', 'decelerationRate', 'directionalLockEnabled', 'disableIntervalMomentum', 'disableScrollViewPanResponder', 'endFillColor', 'fadingEdgeLength', 'horizontal', 'indicatorStyle', 'invertStickyHeaders', 'keyboardDismissMode', 'keyboardShouldPersistTaps', 'maintainVisibleContentPosition', 'maximumZoomScale', 'minimumZoomScale', 'nestedScrollEnabled', 'onContentSizeChange', 'onMomentumScrollBegin', 'onMomentumScrollEnd', 'onScroll', 'onScrollBeginDrag', 'onScrollEndDrag', 'onScrollToTop', 'overScrollMode', 'pagingEnabled', 'persistentScrollbar', 'pinchGestureEnabled', 'refreshControl', 'removeClippedSubviews', 'scrollBarThumbImage', 'scrollEnabled', 'scrollEventThrottle', 'scrollIndicatorInsets', 'scrollPerfTag', 'scrollToOverflowEnabled', 'scrollsToTop', 'DEPRECATED_sendUpdatedChildFrames', 'showsHorizontalScrollIndicator', 'showsVerticalScrollIndicator', 'snapToAlignment', 'snapToEnd', 'snapToInterval', 'snapToOffsets', 'snapToStart', 'stickyHeaderIndices', 'zoomScale', 'borderRightColor', 'backfaceVisibility', 'borderBottomColor', 'borderBottomEndRadius', 'borderBottomLeftRadius', 'borderBottomRightRadius', 'borderBottomStartRadius', 'borderBottomWidth', 'borderColor', 'borderEndColor', 'borderLeftColor', 'borderLeftWidth', 'borderRadius', 'backgroundColor', 'borderRightWidth', 'borderStartColor', 'borderStyle', 'borderTopColor', 'borderTopEndRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderTopStartRadius', 'borderTopWidth', 'borderWidth', 'border', 'opacity', 'elevation', 'shadowColor', 'shadowOffset', 'shadowOpacity', 'shadowRadius', 'alignContent', 'alignItems', 'alignSelf', 'aspectRatio', 'borderBottomWidth', 'borderEndWidth', 'borderLeftWidth', 'borderRightWidth', 'borderStartWidth', 'borderTopWidth', 'borderWidth', 'bottom', 'direction', 'display', 'end', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'height', 'justifyContent', 'left', 'margin', 'marginBottom', 'marginEnd', 'marginHorizontal', 'marginLeft', 'marginRight', 'marginStart', 'marginTop', 'marginVertical', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'overflow', 'overflowX', 'overflowY', 'padding', 'paddingBottom', 'paddingEnd', 'paddingHorizontal', 'paddingLeft', 'paddingRight', 'paddingStart', 'paddingTop', 'paddingVertical', 'position', 'right', 'start', 'top', 'width', 'zIndex', 'borderTopRightRadius', 'backfaceVisibility', 'borderBottomLeftRadius', 'borderBottomRightRadius', 'borderColor', 'borderRadius', 'borderTopLeftRadius', 'backgroundColor', 'borderWidth', 'opacity', 'overflow', 'overflowX', 'overflowY', 'resizeMode', 'tintColor', 'overlayColor', 'transform', 'transformMatrix', 'rotation', 'scaleX', 'scaleY', 'translateX', 'translateY', 'perspective', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'skewX', 'skewY', 'testID', 'decomposedMatrix'];
|
|
498
|
+
/**
|
|
499
|
+
* @param {string} prefix vendor-specific prefix, eg: Webkit
|
|
500
|
+
* @param {string} key style name, eg: transitionDuration
|
|
501
|
+
* @return {string} style name prefixed with `prefix`, properly camelCased, eg:
|
|
502
|
+
* WebkitTransitionDuration
|
|
503
|
+
*/
|
|
504
|
+
|
|
505
|
+
function prefixKey(prefix, key) {
|
|
506
|
+
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Support style names that may come passed in prefixed by adding permutations
|
|
510
|
+
* of vendor prefixes.
|
|
511
|
+
*/
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
var prefixes = ['webkit', 'ms', 'moz'];
|
|
515
|
+
/**
|
|
516
|
+
* Add vendor prefixing to unitless style keys.
|
|
517
|
+
*/
|
|
518
|
+
|
|
519
|
+
unitlessStyleProps.forEach(function (prop) {
|
|
520
|
+
prefixes.forEach(function (prefix) {
|
|
521
|
+
unitlessStyleProps.push(prefixKey(prefix, prop));
|
|
522
|
+
});
|
|
523
|
+
});
|
|
524
|
+
/**
|
|
525
|
+
* Add all unitless style keys to valid style keys.
|
|
526
|
+
*/
|
|
527
|
+
|
|
528
|
+
unitlessStyleProps.forEach(function (prop) {
|
|
529
|
+
if (validStyleProps.includes(prop)) {
|
|
530
|
+
validStyleProps.push(prop);
|
|
531
|
+
}
|
|
532
|
+
});
|
|
511
533
|
var StyleProps = {};
|
|
512
|
-
|
|
534
|
+
validStyleProps.map(function (property) {
|
|
513
535
|
StyleProps[property] = true;
|
|
514
536
|
});
|
|
537
|
+
var isStyleProp = function isStyleProp(property) {
|
|
538
|
+
return StyleProps[property] !== undefined;
|
|
539
|
+
};
|
|
540
|
+
|
|
515
541
|
var NumberPropsStyle = {};
|
|
516
542
|
var NumberProps = ['numberOfLines', 'fontWeight', 'timeStamp', 'flex', 'flexGrow', 'flexShrink', 'order', 'zIndex', 'aspectRatio', 'shadowOpacity', 'shadowRadius', 'scale', 'opacity', 'min', 'max', 'now'];
|
|
517
543
|
NumberProps.map(function (property) {
|
|
@@ -526,7 +552,7 @@ var applyStyle = function applyStyle(props) {
|
|
|
526
552
|
|
|
527
553
|
var newProps = {};
|
|
528
554
|
|
|
529
|
-
if (props.onClick) {
|
|
555
|
+
if (props.onClick && newProps.cursor == undefined) {
|
|
530
556
|
newProps.cursor = 'pointer';
|
|
531
557
|
}
|
|
532
558
|
|
|
@@ -572,7 +598,7 @@ var applyStyle = function applyStyle(props) {
|
|
|
572
598
|
}
|
|
573
599
|
|
|
574
600
|
Object.keys(props).map(function (property) {
|
|
575
|
-
if (
|
|
601
|
+
if (isStyleProp(property) || property == 'on') {
|
|
576
602
|
if (typeof props[property] === 'number' && NumberPropsStyle[property] === undefined) {
|
|
577
603
|
newProps[property] = props[property] + 'px';
|
|
578
604
|
} else if (property.toLowerCase().indexOf('color') !== -1) {
|
|
@@ -641,6 +667,15 @@ var StyledView = /*#__PURE__*/styled.div(function (props) {
|
|
|
641
667
|
var StyledImage = /*#__PURE__*/styled.img(function (props) {
|
|
642
668
|
return applyStyle(props);
|
|
643
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
|
+
});
|
|
644
679
|
var ViewElement = /*#__PURE__*/function (_React$PureComponent) {
|
|
645
680
|
_inheritsLoose(ViewElement, _React$PureComponent);
|
|
646
681
|
|
|
@@ -688,122 +723,134 @@ var ImageElement = /*#__PURE__*/function (_React$PureComponent2) {
|
|
|
688
723
|
|
|
689
724
|
return ImageElement;
|
|
690
725
|
}(React__default.PureComponent);
|
|
726
|
+
var SpanElement = /*#__PURE__*/function (_React$PureComponent3) {
|
|
727
|
+
_inheritsLoose(SpanElement, _React$PureComponent3);
|
|
691
728
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
}
|
|
695
|
-
var SafeArea = View;
|
|
696
|
-
var Scroll = function Scroll(props) {
|
|
697
|
-
return React__default.createElement(View, Object.assign({
|
|
698
|
-
overflow: 'auto'
|
|
699
|
-
}, props));
|
|
700
|
-
};
|
|
729
|
+
function SpanElement() {
|
|
730
|
+
return _React$PureComponent3.apply(this, arguments) || this;
|
|
731
|
+
}
|
|
701
732
|
|
|
702
|
-
var
|
|
703
|
-
_excluded2 = ["size", "src"],
|
|
704
|
-
_excluded3 = ["size", "src"];
|
|
705
|
-
var ImageBackground = /*#__PURE__*/function (_React$PureComponent) {
|
|
706
|
-
_inheritsLoose(ImageBackground, _React$PureComponent);
|
|
733
|
+
var _proto3 = SpanElement.prototype;
|
|
707
734
|
|
|
708
|
-
function
|
|
709
|
-
|
|
710
|
-
}
|
|
735
|
+
_proto3.render = function render() {
|
|
736
|
+
var onClick = this.props.onClick;
|
|
711
737
|
|
|
712
|
-
|
|
738
|
+
if (this.props.onPress !== undefined) {
|
|
739
|
+
onClick = this.props.onPress;
|
|
740
|
+
}
|
|
713
741
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
onClick = _this$props.onClick,
|
|
718
|
-
onPress = _this$props.onPress,
|
|
719
|
-
props = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
720
|
-
|
|
721
|
-
return React__default.createElement(View, Object.assign({
|
|
722
|
-
style: {
|
|
723
|
-
backgroundSize: 'contain',
|
|
724
|
-
backgroundImage: "url(\"" + src + "\")",
|
|
725
|
-
backgroundPosition: 'center center',
|
|
726
|
-
backgroundRepeat: 'no-repeat'
|
|
727
|
-
},
|
|
728
|
-
onClick: onClick ? onClick : onPress
|
|
729
|
-
}, props));
|
|
742
|
+
return React__default.createElement(StyledSpan, Object.assign({}, this.props, {
|
|
743
|
+
onClick: onClick
|
|
744
|
+
}));
|
|
730
745
|
};
|
|
731
746
|
|
|
732
|
-
return
|
|
747
|
+
return SpanElement;
|
|
733
748
|
}(React__default.PureComponent);
|
|
734
|
-
var
|
|
735
|
-
|
|
736
|
-
};
|
|
737
|
-
var RoundedImage = function RoundedImage(_ref) {
|
|
738
|
-
var size = _ref.size,
|
|
739
|
-
src = _ref.src,
|
|
740
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
741
|
-
|
|
742
|
-
return React__default.createElement(ImageBackground, Object.assign({
|
|
743
|
-
borderRadius: size / 2,
|
|
744
|
-
size: size,
|
|
745
|
-
src: src
|
|
746
|
-
}, props));
|
|
747
|
-
};
|
|
748
|
-
var SquaredImage = function SquaredImage(_ref2) {
|
|
749
|
-
var size = _ref2.size,
|
|
750
|
-
src = _ref2.src,
|
|
751
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded3);
|
|
752
|
-
|
|
753
|
-
return React__default.createElement(ImageBackground, Object.assign({}, props, {
|
|
754
|
-
size: size,
|
|
755
|
-
src: src
|
|
756
|
-
}));
|
|
757
|
-
};
|
|
758
|
-
|
|
759
|
-
var _excluded$1 = ["toUpperCase", "children", "toFormat"];
|
|
760
|
-
var TextSpan = /*#__PURE__*/styled.div(function (props) {
|
|
761
|
-
props.display = 'inherit';
|
|
762
|
-
props.flexDirection = 'column';
|
|
763
|
-
return applyStyle(props);
|
|
764
|
-
});
|
|
765
|
-
var Text = /*#__PURE__*/function (_React$PureComponent) {
|
|
766
|
-
_inheritsLoose(Text, _React$PureComponent);
|
|
749
|
+
var InputElement = /*#__PURE__*/function (_React$PureComponent4) {
|
|
750
|
+
_inheritsLoose(InputElement, _React$PureComponent4);
|
|
767
751
|
|
|
768
|
-
function
|
|
769
|
-
return _React$
|
|
752
|
+
function InputElement() {
|
|
753
|
+
return _React$PureComponent4.apply(this, arguments) || this;
|
|
770
754
|
}
|
|
771
755
|
|
|
772
|
-
var
|
|
756
|
+
var _proto4 = InputElement.prototype;
|
|
773
757
|
|
|
774
|
-
|
|
775
|
-
var
|
|
776
|
-
_this$props$toUpperCa = _this$props.toUpperCase,
|
|
777
|
-
toUpperCase = _this$props$toUpperCa === void 0 ? false : _this$props$toUpperCa,
|
|
778
|
-
children = _this$props.children,
|
|
779
|
-
_this$props$toFormat = _this$props.toFormat,
|
|
780
|
-
toFormat = _this$props$toFormat === void 0 ? false : _this$props$toFormat,
|
|
781
|
-
props = _objectWithoutPropertiesLoose(_this$props, _excluded$1);
|
|
782
|
-
|
|
783
|
-
var content = children;
|
|
784
|
-
|
|
785
|
-
if (children && typeof children === 'string') {
|
|
786
|
-
content = children.toString().trim();
|
|
787
|
-
}
|
|
758
|
+
_proto4.render = function render() {
|
|
759
|
+
var onClick = this.props.onClick;
|
|
788
760
|
|
|
789
|
-
if (
|
|
790
|
-
|
|
761
|
+
if (this.props.onPress !== undefined) {
|
|
762
|
+
onClick = this.props.onPress;
|
|
791
763
|
}
|
|
792
764
|
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
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;
|
|
799
786
|
}
|
|
800
787
|
|
|
801
|
-
return React__default.createElement(
|
|
788
|
+
return React__default.createElement(StyledForm, Object.assign({}, this.props, {
|
|
789
|
+
onClick: onClick
|
|
790
|
+
}));
|
|
802
791
|
};
|
|
803
792
|
|
|
804
|
-
return
|
|
793
|
+
return FormElement;
|
|
805
794
|
}(React__default.PureComponent);
|
|
806
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
|
+
|
|
807
854
|
var useMount = function useMount(callback) {
|
|
808
855
|
React.useEffect(function () {
|
|
809
856
|
callback();
|
|
@@ -917,14 +964,15 @@ var useResponsive = function useResponsive() {
|
|
|
917
964
|
};
|
|
918
965
|
};
|
|
919
966
|
|
|
967
|
+
exports.Div = Div;
|
|
968
|
+
exports.Form = Form;
|
|
920
969
|
exports.Image = Image;
|
|
921
|
-
exports.
|
|
970
|
+
exports.Input = Input;
|
|
922
971
|
exports.ResponsiveContext = ResponsiveContext;
|
|
923
972
|
exports.ResponsiveProvider = ResponsiveProvider;
|
|
924
|
-
exports.RoundedImage = RoundedImage;
|
|
925
973
|
exports.SafeArea = SafeArea;
|
|
926
974
|
exports.Scroll = Scroll;
|
|
927
|
-
exports.
|
|
975
|
+
exports.Span = Span;
|
|
928
976
|
exports.Text = Text;
|
|
929
977
|
exports.TextSpan = TextSpan;
|
|
930
978
|
exports.ThemeContext = ThemeContext;
|