app-studio 0.0.6 → 0.0.10
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 +188 -136
- 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 +185 -134
- 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);
|
|
@@ -403,8 +404,8 @@ var shadows = {
|
|
|
403
404
|
0: {
|
|
404
405
|
shadowColor: '#000',
|
|
405
406
|
shadowOffset: {
|
|
406
|
-
width:
|
|
407
|
-
height:
|
|
407
|
+
width: 1,
|
|
408
|
+
height: 2
|
|
408
409
|
},
|
|
409
410
|
shadowOpacity: 0.18,
|
|
410
411
|
shadowRadius: 1.0
|
|
@@ -412,8 +413,8 @@ var shadows = {
|
|
|
412
413
|
1: {
|
|
413
414
|
shadowColor: '#000',
|
|
414
415
|
shadowOffset: {
|
|
415
|
-
width:
|
|
416
|
-
height:
|
|
416
|
+
width: 2,
|
|
417
|
+
height: 2
|
|
417
418
|
},
|
|
418
419
|
shadowOpacity: 0.2,
|
|
419
420
|
shadowRadius: 1.41
|
|
@@ -421,8 +422,8 @@ var shadows = {
|
|
|
421
422
|
2: {
|
|
422
423
|
shadowColor: '#000',
|
|
423
424
|
shadowOffset: {
|
|
424
|
-
width:
|
|
425
|
-
height:
|
|
425
|
+
width: 3,
|
|
426
|
+
height: 3
|
|
426
427
|
},
|
|
427
428
|
shadowOpacity: 0.22,
|
|
428
429
|
shadowRadius: 2.22
|
|
@@ -430,8 +431,8 @@ var shadows = {
|
|
|
430
431
|
3: {
|
|
431
432
|
shadowColor: '#000',
|
|
432
433
|
shadowOffset: {
|
|
433
|
-
width:
|
|
434
|
-
height:
|
|
434
|
+
width: 4,
|
|
435
|
+
height: 4
|
|
435
436
|
},
|
|
436
437
|
shadowOpacity: 0.23,
|
|
437
438
|
shadowRadius: 2.62
|
|
@@ -439,8 +440,8 @@ var shadows = {
|
|
|
439
440
|
4: {
|
|
440
441
|
shadowColor: '#000',
|
|
441
442
|
shadowOffset: {
|
|
442
|
-
width:
|
|
443
|
-
height:
|
|
443
|
+
width: 5,
|
|
444
|
+
height: 5
|
|
444
445
|
},
|
|
445
446
|
shadowOpacity: 0.25,
|
|
446
447
|
shadowRadius: 3.84
|
|
@@ -448,8 +449,8 @@ var shadows = {
|
|
|
448
449
|
5: {
|
|
449
450
|
shadowColor: '#000',
|
|
450
451
|
shadowOffset: {
|
|
451
|
-
width:
|
|
452
|
-
height:
|
|
452
|
+
width: 6,
|
|
453
|
+
height: 6
|
|
453
454
|
},
|
|
454
455
|
shadowOpacity: 0.27,
|
|
455
456
|
shadowRadius: 4.65
|
|
@@ -457,8 +458,8 @@ var shadows = {
|
|
|
457
458
|
6: {
|
|
458
459
|
shadowColor: '#000',
|
|
459
460
|
shadowOffset: {
|
|
460
|
-
width:
|
|
461
|
-
height:
|
|
461
|
+
width: 7,
|
|
462
|
+
height: 7
|
|
462
463
|
},
|
|
463
464
|
shadowOpacity: 0.29,
|
|
464
465
|
shadowRadius: 4.65
|
|
@@ -466,8 +467,8 @@ var shadows = {
|
|
|
466
467
|
7: {
|
|
467
468
|
shadowColor: '#000',
|
|
468
469
|
shadowOffset: {
|
|
469
|
-
width:
|
|
470
|
-
height:
|
|
470
|
+
width: 8,
|
|
471
|
+
height: 8
|
|
471
472
|
},
|
|
472
473
|
shadowOpacity: 0.3,
|
|
473
474
|
shadowRadius: 4.65
|
|
@@ -475,8 +476,8 @@ var shadows = {
|
|
|
475
476
|
8: {
|
|
476
477
|
shadowColor: '#000',
|
|
477
478
|
shadowOffset: {
|
|
478
|
-
width:
|
|
479
|
-
height:
|
|
479
|
+
width: 9,
|
|
480
|
+
height: 9
|
|
480
481
|
},
|
|
481
482
|
shadowOpacity: 0.32,
|
|
482
483
|
shadowRadius: 5.46
|
|
@@ -484,34 +485,59 @@ var shadows = {
|
|
|
484
485
|
9: {
|
|
485
486
|
shadowColor: '#000',
|
|
486
487
|
shadowOffset: {
|
|
487
|
-
width:
|
|
488
|
-
height:
|
|
488
|
+
width: 10,
|
|
489
|
+
height: 10
|
|
489
490
|
},
|
|
490
491
|
shadowOpacity: 0.34,
|
|
491
492
|
shadowRadius: 6.27
|
|
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,121 +723,137 @@ 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);
|
|
728
|
+
|
|
729
|
+
function SpanElement() {
|
|
730
|
+
return _React$PureComponent3.apply(this, arguments) || this;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
var _proto3 = SpanElement.prototype;
|
|
734
|
+
|
|
735
|
+
_proto3.render = function render() {
|
|
736
|
+
var onClick = this.props.onClick;
|
|
737
|
+
|
|
738
|
+
if (this.props.onPress !== undefined) {
|
|
739
|
+
onClick = this.props.onPress;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
return React__default.createElement(StyledSpan, Object.assign({}, this.props, {
|
|
743
|
+
onClick: onClick
|
|
744
|
+
}));
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
return SpanElement;
|
|
748
|
+
}(React__default.PureComponent);
|
|
749
|
+
var InputElement = /*#__PURE__*/function (_React$PureComponent4) {
|
|
750
|
+
_inheritsLoose(InputElement, _React$PureComponent4);
|
|
751
|
+
|
|
752
|
+
function InputElement() {
|
|
753
|
+
return _React$PureComponent4.apply(this, arguments) || this;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
var _proto4 = InputElement.prototype;
|
|
757
|
+
|
|
758
|
+
_proto4.render = function render() {
|
|
759
|
+
var onClick = this.props.onClick;
|
|
760
|
+
|
|
761
|
+
if (this.props.onPress !== undefined) {
|
|
762
|
+
onClick = this.props.onPress;
|
|
763
|
+
}
|
|
764
|
+
|
|
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;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
return React__default.createElement(StyledForm, Object.assign({}, this.props, {
|
|
789
|
+
onClick: onClick
|
|
790
|
+
}));
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
return FormElement;
|
|
794
|
+
}(React__default.PureComponent);
|
|
691
795
|
|
|
692
796
|
var View = function View(props) {
|
|
693
797
|
return React__default.createElement(ViewElement, Object.assign({}, props));
|
|
694
798
|
};
|
|
799
|
+
var Div = View;
|
|
695
800
|
var SafeArea = View;
|
|
696
801
|
var Scroll = function Scroll(props) {
|
|
697
802
|
return React__default.createElement(View, Object.assign({
|
|
698
803
|
overflow: 'auto'
|
|
699
804
|
}, props));
|
|
700
805
|
};
|
|
806
|
+
var Span = function Span(props) {
|
|
807
|
+
return React__default.createElement(SpanElement, Object.assign({}, props));
|
|
808
|
+
};
|
|
701
809
|
|
|
702
|
-
var _excluded = ["src", "onClick", "onPress"],
|
|
703
|
-
_excluded2 = ["size", "src"],
|
|
704
|
-
_excluded3 = ["size", "src"];
|
|
705
|
-
var ImageBackground = /*#__PURE__*/function (_React$PureComponent) {
|
|
706
|
-
_inheritsLoose(ImageBackground, _React$PureComponent);
|
|
707
|
-
|
|
708
|
-
function ImageBackground() {
|
|
709
|
-
return _React$PureComponent.apply(this, arguments) || this;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
var _proto = ImageBackground.prototype;
|
|
713
|
-
|
|
714
|
-
_proto.render = function render() {
|
|
715
|
-
var _this$props = this.props,
|
|
716
|
-
src = _this$props.src,
|
|
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));
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
return ImageBackground;
|
|
733
|
-
}(React__default.PureComponent);
|
|
734
810
|
var Image = function Image(props) {
|
|
735
811
|
return React__default.createElement(ImageElement, Object.assign({}, props));
|
|
736
812
|
};
|
|
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
813
|
|
|
759
|
-
var _excluded
|
|
760
|
-
var TextSpan = /*#__PURE__*/styled.
|
|
761
|
-
props.display = 'inherit';
|
|
762
|
-
props.flexDirection = 'column';
|
|
814
|
+
var _excluded = ["toUpperCase", "children"];
|
|
815
|
+
var TextSpan = /*#__PURE__*/styled.span(function (props) {
|
|
763
816
|
return applyStyle(props);
|
|
764
817
|
});
|
|
765
|
-
var Text =
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
}
|
|
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);
|
|
771
823
|
|
|
772
|
-
var
|
|
824
|
+
var content = children;
|
|
773
825
|
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
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
|
-
}
|
|
788
|
-
|
|
789
|
-
if (typeof content === 'string' && toUpperCase) {
|
|
790
|
-
content = content.toUpperCase();
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
if (typeof content === 'string' && toFormat) {
|
|
794
|
-
content = content.split('\n').map(function (item, key) {
|
|
795
|
-
return React__default.createElement("span", {
|
|
796
|
-
key: key.toString()
|
|
797
|
-
}, item, React__default.createElement("br", null));
|
|
798
|
-
});
|
|
799
|
-
}
|
|
826
|
+
if (children && typeof children === 'string') {
|
|
827
|
+
content = children.toString().trim();
|
|
828
|
+
}
|
|
800
829
|
|
|
801
|
-
|
|
802
|
-
|
|
830
|
+
if (typeof content === 'string' && toUpperCase) {
|
|
831
|
+
content = content.toUpperCase();
|
|
832
|
+
} // if (typeof content === 'string' && toFormat) {
|
|
833
|
+
// const newtext: any = content
|
|
834
|
+
// .split('\n')
|
|
835
|
+
// .map((item: any, key: number): any => {
|
|
836
|
+
// return (
|
|
837
|
+
// <span key={key.toString()}>
|
|
838
|
+
// {item}
|
|
839
|
+
// <br />
|
|
840
|
+
// </span>
|
|
841
|
+
// );
|
|
842
|
+
// });
|
|
843
|
+
// }
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
return React__default.createElement(TextSpan, Object.assign({}, textPops, {
|
|
847
|
+
children: content
|
|
848
|
+
}));
|
|
849
|
+
};
|
|
803
850
|
|
|
804
|
-
|
|
805
|
-
|
|
851
|
+
var Form = function Form(props) {
|
|
852
|
+
return React__default.createElement(FormElement, Object.assign({}, props));
|
|
853
|
+
};
|
|
854
|
+
var Input = function Input(props) {
|
|
855
|
+
return React__default.createElement(InputElement, Object.assign({}, props));
|
|
856
|
+
};
|
|
806
857
|
|
|
807
858
|
var useMount = function useMount(callback) {
|
|
808
859
|
React.useEffect(function () {
|
|
@@ -917,14 +968,15 @@ var useResponsive = function useResponsive() {
|
|
|
917
968
|
};
|
|
918
969
|
};
|
|
919
970
|
|
|
971
|
+
exports.Div = Div;
|
|
972
|
+
exports.Form = Form;
|
|
920
973
|
exports.Image = Image;
|
|
921
|
-
exports.
|
|
974
|
+
exports.Input = Input;
|
|
922
975
|
exports.ResponsiveContext = ResponsiveContext;
|
|
923
976
|
exports.ResponsiveProvider = ResponsiveProvider;
|
|
924
|
-
exports.RoundedImage = RoundedImage;
|
|
925
977
|
exports.SafeArea = SafeArea;
|
|
926
978
|
exports.Scroll = Scroll;
|
|
927
|
-
exports.
|
|
979
|
+
exports.Span = Span;
|
|
928
980
|
exports.Text = Text;
|
|
929
981
|
exports.TextSpan = TextSpan;
|
|
930
982
|
exports.ThemeContext = ThemeContext;
|