sapo-components-ui-rn 1.0.50 → 1.0.52
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/dist/components/Button/index.d.ts +2 -2
- package/dist/components/ButtonIcon/index.d.ts +1 -1
- package/dist/components/View/index.d.ts +7 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.esm.js +54 -76
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +54 -77
- package/dist/index.js.map +1 -1
- package/dist/styles/themes/tokens.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Button/index.tsx +3 -3
- package/src/components/ButtonIcon/index.tsx +6 -2
- package/src/components/SearchInput/index.tsx +1 -1
- package/src/components/View/index.tsx +30 -0
- package/src/index.ts +0 -1
- package/src/index.tsx +0 -1
- package/src/styles/themes/tokens.tsx +2 -1
|
@@ -11,7 +11,6 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
11
11
|
isLoading?: boolean;
|
|
12
12
|
left?: React.ReactNode;
|
|
13
13
|
right?: React.ReactNode;
|
|
14
|
-
small?: boolean;
|
|
15
14
|
margin?: Number;
|
|
16
15
|
textProps?: IText;
|
|
17
16
|
textColor?: string;
|
|
@@ -24,6 +23,7 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
24
23
|
onPress?: (res?: any) => void;
|
|
25
24
|
full?: boolean;
|
|
26
25
|
theme?: ThemeProp;
|
|
26
|
+
buttonSize?: "normal" | "small";
|
|
27
27
|
}
|
|
28
|
-
declare const _default: React.MemoExoticComponent<({ style, title, border, borderColor, isLoading, left, right,
|
|
28
|
+
declare const _default: React.MemoExoticComponent<({ style, title, border, borderColor, isLoading, left, right, margin, textStyle, textProps, onPress, disabled, backgroundColor, textColor, bold, size, medium, mode, transparent, full, theme: themeOverrides, buttonSize, ...props }: ButtonProps) => React.JSX.Element>;
|
|
29
29
|
export default _default;
|
|
@@ -6,13 +6,13 @@ export interface ButtonIconProps {
|
|
|
6
6
|
onPress?: (val?: any) => void;
|
|
7
7
|
style?: StyleProp<ViewStyle>;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
-
size?: number;
|
|
10
9
|
hiddenBackground?: boolean;
|
|
11
10
|
props?: object;
|
|
12
11
|
border?: boolean;
|
|
13
12
|
circle?: boolean;
|
|
14
13
|
backgroundColor?: string;
|
|
15
14
|
borderColor?: string;
|
|
15
|
+
mode?: "normal" | "small";
|
|
16
16
|
}
|
|
17
17
|
declare const _default: React.MemoExoticComponent<React.ComponentType<ButtonIconProps>>;
|
|
18
18
|
export default _default;
|
|
@@ -33,9 +33,15 @@ interface ViewProps {
|
|
|
33
33
|
wrap?: boolean;
|
|
34
34
|
borderBottomWidth?: number;
|
|
35
35
|
borderBottomColor?: string;
|
|
36
|
+
borderTopWidth?: number;
|
|
37
|
+
borderTopColor?: string;
|
|
38
|
+
borderLeftWidth?: number;
|
|
39
|
+
borderLeftColor?: string;
|
|
40
|
+
borderRightWidth?: number;
|
|
41
|
+
borderRightColor?: string;
|
|
36
42
|
borderRadius?: number;
|
|
37
43
|
borderWidth?: number;
|
|
38
44
|
borderColor?: string;
|
|
39
45
|
}
|
|
40
|
-
declare const _default: React.MemoExoticComponent<({ row, full, justifyCenter, justifyBetween, alignCenter, center, color, backgroundColor, width, height, padding, paddingHorizontal, paddingVertical, marginHorizontal, marginVertical, paddingLeft, paddingRight, paddingTop, alignEnd, wrap, borderBottomWidth, borderBottomColor, borderRadius, borderWidth, borderColor, style, onPress, activeOpacity, children, disabled, paddingBottom, marginTop, marginBottom, marginLeft, marginRight, }: ViewProps) => React.JSX.Element>;
|
|
46
|
+
declare const _default: React.MemoExoticComponent<({ row, full, justifyCenter, justifyBetween, alignCenter, center, color, backgroundColor, width, height, padding, paddingHorizontal, paddingVertical, marginHorizontal, marginVertical, paddingLeft, paddingRight, paddingTop, alignEnd, wrap, borderBottomWidth, borderBottomColor, borderRadius, borderWidth, borderColor, style, onPress, activeOpacity, children, disabled, paddingBottom, marginTop, marginBottom, marginLeft, marginRight, borderTopWidth, borderTopColor, borderLeftWidth, borderLeftColor, borderRightWidth, borderRightColor, }: ViewProps) => React.JSX.Element>;
|
|
41
47
|
export default _default;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export { default as ProgressBar } from "./components/ProgressBar";
|
|
|
11
11
|
export { default as Switch } from "./components/Switch/Switch";
|
|
12
12
|
export { default as TextInput } from "./components/TextInput/TextInput";
|
|
13
13
|
export { default as Button } from "./components/Button";
|
|
14
|
-
export { default as ButtonIcon } from "./components/ButtonIcon";
|
|
15
14
|
export { default as FloatingButton } from "./components/FloatingButton";
|
|
16
15
|
export { default as Text } from "./components/Text";
|
|
17
16
|
export { default as Toast } from "./components/Toast";
|
package/dist/index.esm.js
CHANGED
|
@@ -560,9 +560,10 @@ var CONSTANTS = {
|
|
|
560
560
|
DEVICE_WIDTH: Dimensions.get("window").width,
|
|
561
561
|
HEADER_HEIGHT: 50,
|
|
562
562
|
BUTTON_HEIGHT: 48,
|
|
563
|
-
BUTTON_HEIGHT_SMALL:
|
|
563
|
+
BUTTON_HEIGHT_SMALL: 36,
|
|
564
564
|
RADIO_BUTTON_HEIGHT: 20,
|
|
565
565
|
BUTTON_ICON: 36,
|
|
566
|
+
BUTTON_ICON_SMALL: 36,
|
|
566
567
|
SPACE_0: 0,
|
|
567
568
|
SPACE_2: 2,
|
|
568
569
|
SPACE_4: 4,
|
|
@@ -1707,7 +1708,7 @@ var ActivityIndicator = function (_a) {
|
|
|
1707
1708
|
height: size / 2,
|
|
1708
1709
|
overflow: "hidden",
|
|
1709
1710
|
};
|
|
1710
|
-
return (React$3.createElement(View$1, __assign({ style: [styles$
|
|
1711
|
+
return (React$3.createElement(View$1, __assign({ style: [styles$h.container, style] }, rest, { accessible: true, accessibilityRole: "progressbar", accessibilityState: { busy: animating } }),
|
|
1711
1712
|
React$3.createElement(Animated.View, { style: [{ width: size, height: size, opacity: fade }], collapsable: false }, [0, 1].map(function (index) {
|
|
1712
1713
|
// Thanks to https://github.com/n4kz/react-native-indicators for the great work
|
|
1713
1714
|
var inputRange = Array.from(new Array(frames), function (_, frameIndex) { return frameIndex / (frames - 1); });
|
|
@@ -1752,7 +1753,7 @@ var ActivityIndicator = function (_a) {
|
|
|
1752
1753
|
borderWidth: size / 10,
|
|
1753
1754
|
borderRadius: size / 2,
|
|
1754
1755
|
};
|
|
1755
|
-
return (React$3.createElement(Animated.View, { key: index, style: [styles$
|
|
1756
|
+
return (React$3.createElement(Animated.View, { key: index, style: [styles$h.layer] },
|
|
1756
1757
|
React$3.createElement(Animated.View, { style: layerStyle },
|
|
1757
1758
|
React$3.createElement(Animated.View, { style: [containerStyle, offsetStyle], collapsable: false },
|
|
1758
1759
|
React$3.createElement(Animated.View, { style: viewportStyle },
|
|
@@ -1760,7 +1761,7 @@ var ActivityIndicator = function (_a) {
|
|
|
1760
1761
|
React$3.createElement(Animated.View, { style: lineStyle })))))));
|
|
1761
1762
|
}))));
|
|
1762
1763
|
};
|
|
1763
|
-
var styles$
|
|
1764
|
+
var styles$h = StyleSheet.create({
|
|
1764
1765
|
container: {
|
|
1765
1766
|
justifyContent: "center",
|
|
1766
1767
|
alignItems: "center",
|
|
@@ -1868,11 +1869,11 @@ var ProgressBar = function (_a) {
|
|
|
1868
1869
|
? {}
|
|
1869
1870
|
: { min: 0, max: 100, now: Math.round(progress * 100) }, testID: testID }),
|
|
1870
1871
|
React$3.createElement(Animated.View, { style: [
|
|
1871
|
-
styles$
|
|
1872
|
+
styles$g.container,
|
|
1872
1873
|
{ backgroundColor: trackTintColor, opacity: fade },
|
|
1873
1874
|
style,
|
|
1874
1875
|
] }, width ? (React$3.createElement(Animated.View, { testID: "".concat(testID, "-fill"), style: [
|
|
1875
|
-
styles$
|
|
1876
|
+
styles$g.progressBar,
|
|
1876
1877
|
{
|
|
1877
1878
|
width: width,
|
|
1878
1879
|
backgroundColor: tintColor,
|
|
@@ -1916,7 +1917,7 @@ var ProgressBar = function (_a) {
|
|
|
1916
1917
|
fillStyle,
|
|
1917
1918
|
] })) : null)));
|
|
1918
1919
|
};
|
|
1919
|
-
var styles$
|
|
1920
|
+
var styles$g = StyleSheet.create({
|
|
1920
1921
|
container: {
|
|
1921
1922
|
height: 4,
|
|
1922
1923
|
overflow: "hidden",
|
|
@@ -1928,7 +1929,7 @@ var styles$h = StyleSheet.create({
|
|
|
1928
1929
|
});
|
|
1929
1930
|
|
|
1930
1931
|
var ViewCustom = function (_a) {
|
|
1931
|
-
var row = _a.row, full = _a.full, justifyCenter = _a.justifyCenter, justifyBetween = _a.justifyBetween, alignCenter = _a.alignCenter, center = _a.center, color = _a.color, backgroundColor = _a.backgroundColor, width = _a.width, height = _a.height, padding = _a.padding, paddingHorizontal = _a.paddingHorizontal, paddingVertical = _a.paddingVertical, marginHorizontal = _a.marginHorizontal, marginVertical = _a.marginVertical, paddingLeft = _a.paddingLeft, paddingRight = _a.paddingRight, paddingTop = _a.paddingTop, alignEnd = _a.alignEnd, wrap = _a.wrap, borderBottomWidth = _a.borderBottomWidth, borderBottomColor = _a.borderBottomColor, borderRadius = _a.borderRadius, borderWidth = _a.borderWidth, borderColor = _a.borderColor, style = _a.style, onPress = _a.onPress, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, children = _a.children, disabled = _a.disabled, paddingBottom = _a.paddingBottom, marginTop = _a.marginTop, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, marginRight = _a.marginRight;
|
|
1932
|
+
var row = _a.row, full = _a.full, justifyCenter = _a.justifyCenter, justifyBetween = _a.justifyBetween, alignCenter = _a.alignCenter, center = _a.center, color = _a.color, backgroundColor = _a.backgroundColor, width = _a.width, height = _a.height, padding = _a.padding, paddingHorizontal = _a.paddingHorizontal, paddingVertical = _a.paddingVertical, marginHorizontal = _a.marginHorizontal, marginVertical = _a.marginVertical, paddingLeft = _a.paddingLeft, paddingRight = _a.paddingRight, paddingTop = _a.paddingTop, alignEnd = _a.alignEnd, wrap = _a.wrap, borderBottomWidth = _a.borderBottomWidth, borderBottomColor = _a.borderBottomColor, borderRadius = _a.borderRadius, borderWidth = _a.borderWidth, borderColor = _a.borderColor, style = _a.style, onPress = _a.onPress, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, children = _a.children, disabled = _a.disabled, paddingBottom = _a.paddingBottom, marginTop = _a.marginTop, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, marginRight = _a.marginRight, borderTopWidth = _a.borderTopWidth, borderTopColor = _a.borderTopColor, borderLeftWidth = _a.borderLeftWidth, borderLeftColor = _a.borderLeftColor, borderRightWidth = _a.borderRightWidth, borderRightColor = _a.borderRightColor;
|
|
1932
1933
|
var getStyle = function () {
|
|
1933
1934
|
var styleCustom = {};
|
|
1934
1935
|
if (row) {
|
|
@@ -2013,6 +2014,24 @@ var ViewCustom = function (_a) {
|
|
|
2013
2014
|
if (borderBottomColor) {
|
|
2014
2015
|
styleCustom.borderBottomColor = borderBottomColor;
|
|
2015
2016
|
}
|
|
2017
|
+
if (borderTopWidth) {
|
|
2018
|
+
styleCustom.borderTopWidth = borderTopWidth;
|
|
2019
|
+
}
|
|
2020
|
+
if (borderTopColor) {
|
|
2021
|
+
styleCustom.borderTopColor = borderTopColor;
|
|
2022
|
+
}
|
|
2023
|
+
if (borderLeftWidth) {
|
|
2024
|
+
styleCustom.borderLeftWidth = borderLeftWidth;
|
|
2025
|
+
}
|
|
2026
|
+
if (borderLeftColor) {
|
|
2027
|
+
styleCustom.borderLeftColor = borderLeftColor;
|
|
2028
|
+
}
|
|
2029
|
+
if (borderRightWidth) {
|
|
2030
|
+
styleCustom.borderRightWidth = borderRightWidth;
|
|
2031
|
+
}
|
|
2032
|
+
if (borderRightColor) {
|
|
2033
|
+
styleCustom.borderRightColor = borderRightColor;
|
|
2034
|
+
}
|
|
2016
2035
|
if (borderRadius) {
|
|
2017
2036
|
styleCustom.borderRadius = borderRadius;
|
|
2018
2037
|
}
|
|
@@ -2491,7 +2510,7 @@ var TextInputAffix = function (_a) {
|
|
|
2491
2510
|
var textColor = getTextColor({ theme: theme, disabled: disabled });
|
|
2492
2511
|
var content = (React__default.createElement(Text$2, { maxFontSizeMultiplier: maxFontSizeMultiplier, style: [{ color: textColor }, textStyle, labelStyle], onLayout: onTextLayout, testID: "".concat(testID, "-text") }, text));
|
|
2493
2512
|
return (React__default.createElement(Animated.View, { style: [
|
|
2494
|
-
styles$
|
|
2513
|
+
styles$f.container,
|
|
2495
2514
|
style,
|
|
2496
2515
|
{
|
|
2497
2516
|
opacity: (visible === null || visible === void 0 ? void 0 : visible.interpolate({
|
|
@@ -2502,7 +2521,7 @@ var TextInputAffix = function (_a) {
|
|
|
2502
2521
|
], onLayout: onLayout, testID: testID }, onPress ? (React__default.createElement(Pressable, { onPress: onPress, accessibilityRole: "button", accessibilityLabel: accessibilityLabel }, content)) : (content)));
|
|
2503
2522
|
};
|
|
2504
2523
|
TextInputAffix.displayName = "TextInput.Affix";
|
|
2505
|
-
var styles$
|
|
2524
|
+
var styles$f = StyleSheet.create({
|
|
2506
2525
|
container: {
|
|
2507
2526
|
position: "absolute",
|
|
2508
2527
|
justifyContent: "center",
|
|
@@ -2560,13 +2579,13 @@ var AnimatedText = forwardRef(function AnimatedText(_a, ref) {
|
|
|
2560
2579
|
}
|
|
2561
2580
|
return (React$3.createElement(Animated.Text, __assign({ ref: ref }, rest, { style: [
|
|
2562
2581
|
font,
|
|
2563
|
-
styles$
|
|
2582
|
+
styles$e.text,
|
|
2564
2583
|
{ writingDirection: writingDirection, color: theme.colors.backgroundPrimary },
|
|
2565
2584
|
style,
|
|
2566
2585
|
] })));
|
|
2567
2586
|
}
|
|
2568
2587
|
});
|
|
2569
|
-
var styles$
|
|
2588
|
+
var styles$e = StyleSheet.create({
|
|
2570
2589
|
text: {
|
|
2571
2590
|
textAlign: "left",
|
|
2572
2591
|
},
|
|
@@ -2637,7 +2656,7 @@ var InputLabel = function (props) {
|
|
|
2637
2656
|
return (
|
|
2638
2657
|
// Position colored placeholder and gray placeholder on top of each other and crossfade them
|
|
2639
2658
|
// This gives the effect of animating the color, but allows us to use native driver
|
|
2640
|
-
React__default.createElement(View$1, { pointerEvents: "none", style: [StyleSheet.absoluteFill, styles$
|
|
2659
|
+
React__default.createElement(View$1, { pointerEvents: "none", style: [StyleSheet.absoluteFill, styles$d.overflow, styles$d.labelContainer] },
|
|
2641
2660
|
React__default.createElement(Animated.View, { pointerEvents: "none", style: [
|
|
2642
2661
|
StyleSheet.absoluteFill,
|
|
2643
2662
|
Platform.OS !== "web" && { width: width },
|
|
@@ -2675,7 +2694,7 @@ var InputLabel = function (props) {
|
|
|
2675
2694
|
},
|
|
2676
2695
|
], numberOfLines: 1, maxFontSizeMultiplier: maxFontSizeMultiplier, testID: "".concat(testID, "-label-inactive") }, label)))));
|
|
2677
2696
|
};
|
|
2678
|
-
var styles$
|
|
2697
|
+
var styles$d = StyleSheet.create({
|
|
2679
2698
|
overflow: {
|
|
2680
2699
|
overflow: "hidden",
|
|
2681
2700
|
},
|
|
@@ -2688,8 +2707,8 @@ var InputLabel$1 = React__default.memo(InputLabel);
|
|
|
2688
2707
|
var Outline = function (_a) {
|
|
2689
2708
|
var label = _a.label; _a.activeColor; _a.backgroundColor; _a.hasActiveOutline; _a.focused; _a.outlineColor; _a.roundness; var style = _a.style;
|
|
2690
2709
|
return (React$3.createElement(View$1, { testID: "text-input-outline", pointerEvents: "none", style: [
|
|
2691
|
-
styles$
|
|
2692
|
-
!label && styles$
|
|
2710
|
+
styles$c.outline,
|
|
2711
|
+
!label && styles$c.noLabelOutline,
|
|
2693
2712
|
// eslint-disable-next-line react-native/no-inline-styles
|
|
2694
2713
|
{
|
|
2695
2714
|
// backgroundColor,
|
|
@@ -2700,7 +2719,7 @@ var Outline = function (_a) {
|
|
|
2700
2719
|
style,
|
|
2701
2720
|
] }));
|
|
2702
2721
|
};
|
|
2703
|
-
var styles$
|
|
2722
|
+
var styles$c = StyleSheet.create({
|
|
2704
2723
|
outline: {
|
|
2705
2724
|
position: "absolute",
|
|
2706
2725
|
left: 0,
|
|
@@ -2938,7 +2957,7 @@ var TextInputFlat = function (_a) {
|
|
|
2938
2957
|
label: label,
|
|
2939
2958
|
scale: fontScale,
|
|
2940
2959
|
isAndroid: isAndroid,
|
|
2941
|
-
styles: StyleSheet.flatten(dense ? styles$
|
|
2960
|
+
styles: StyleSheet.flatten(dense ? styles$b.inputFlatDense : styles$b.inputFlat),
|
|
2942
2961
|
};
|
|
2943
2962
|
var pad = calculatePadding(paddingSettings);
|
|
2944
2963
|
adjustPaddingFlat(__assign(__assign({}, paddingSettings), { pad: pad }));
|
|
@@ -2964,7 +2983,7 @@ var TextInputFlat = function (_a) {
|
|
|
2964
2983
|
onLabelTextLayout: onLabelTextLayout,
|
|
2965
2984
|
placeholderOpacity: placeholderOpacity,
|
|
2966
2985
|
labelError: error,
|
|
2967
|
-
placeholderStyle: styles$
|
|
2986
|
+
placeholderStyle: styles$b.placeholder,
|
|
2968
2987
|
baseLabelTranslateY: baseLabelTranslateY,
|
|
2969
2988
|
baseLabelTranslateX: baseLabelTranslateX,
|
|
2970
2989
|
font: font,
|
|
@@ -3027,7 +3046,7 @@ var TextInputFlat = function (_a) {
|
|
|
3027
3046
|
left ? React$3.createElement(Spacer, { width: SPACE_8 }) : React$3.createElement(Spacer, { width: SPACE_12 })),
|
|
3028
3047
|
React$3.createElement(Outline, { style: outlineStyle, label: label, roundness: roundness, hasActiveOutline: hasActiveOutline, focused: parentState.focused, activeColor: activeColor, outlineColor: outlineColor, backgroundColor: backgroundColor }),
|
|
3029
3048
|
React$3.createElement(View$1, { onLayout: onInputLayout, style: [
|
|
3030
|
-
styles$
|
|
3049
|
+
styles$b.labelContainer,
|
|
3031
3050
|
{
|
|
3032
3051
|
minHeight: minHeight,
|
|
3033
3052
|
flex: 1,
|
|
@@ -3035,7 +3054,7 @@ var TextInputFlat = function (_a) {
|
|
|
3035
3054
|
] },
|
|
3036
3055
|
label ? (React$3.createElement(InputLabel$1, __assign({ labeled: parentState.labeled, error: parentState.error, focused: parentState.focused, scaledLabel: scaledLabel, wiggle: Boolean(parentState.value && labelProps.labelError), labelLayoutMeasured: parentState.labelLayout.measured, labelLayoutWidth: parentState.labelLayout.width, labelLayoutHeight: parentState.labelLayout.height }, labelProps))) : null, render === null || render === void 0 ? void 0 :
|
|
3037
3056
|
render(__assign(__assign({}, rest), { ref: innerRef, onChangeText: handleChangeText, value: inputValue, placeholder: rest.placeholder, editable: !disabled && editable, selectionColor: selectionColor, cursorColor: typeof cursorColor === "undefined" ? activeColor : cursorColor, placeholderTextColor: placeholderTextColorBasedOnState, onFocus: onFocus, onBlur: onBlur, underlineColorAndroid: "transparent", multiline: multiline, style: [
|
|
3038
|
-
styles$
|
|
3057
|
+
styles$b.input,
|
|
3039
3058
|
__assign(__assign({ paddingLeft: paddingLeft, paddingRight: paddingRight, paddingTop: parentState.focused || parentState.value ? SPACE_12 : 0 }, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
|
|
3040
3059
|
? textAlign
|
|
3041
3060
|
: I18nManager.getConstants().isRTL
|
|
@@ -3043,13 +3062,13 @@ var TextInputFlat = function (_a) {
|
|
|
3043
3062
|
: "left", marginTop: Platform.OS === "android" ? SPACE_8 : 0 }),
|
|
3044
3063
|
contentStyle,
|
|
3045
3064
|
] }))),
|
|
3046
|
-
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$
|
|
3065
|
+
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$b.clearButton },
|
|
3047
3066
|
React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: SPACE_12 })),
|
|
3048
3067
|
React$3.createElement(View$1, { style: { flexDirection: "row" } },
|
|
3049
3068
|
right && React$3.createElement(Spacer, { width: SPACE_8 }),
|
|
3050
3069
|
right && React$3.createElement(View$1, { style: { paddingRight: SPACE_12 } }, right))));
|
|
3051
3070
|
};
|
|
3052
|
-
var styles$
|
|
3071
|
+
var styles$b = StyleSheet.create({
|
|
3053
3072
|
placeholder: {
|
|
3054
3073
|
position: "absolute",
|
|
3055
3074
|
left: 0,
|
|
@@ -5691,7 +5710,7 @@ var TextInputDefault = function (_a) {
|
|
|
5691
5710
|
? rest.placeholder
|
|
5692
5711
|
: label
|
|
5693
5712
|
: rest.placeholder, editable: !disabled && editable, selectionColor: selectionColor, cursorColor: typeof cursorColor === "undefined" ? activeColor : cursorColor, placeholderTextColor: placeholderTextColorBasedOnState, onFocus: onFocus, onBlur: onBlur, underlineColorAndroid: "transparent", multiline: multiline, style: [
|
|
5694
|
-
styles$
|
|
5713
|
+
styles$a.input,
|
|
5695
5714
|
__assign(__assign({}, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
|
|
5696
5715
|
? textAlign
|
|
5697
5716
|
: I18nManager.getConstants().isRTL
|
|
@@ -5699,12 +5718,12 @@ var TextInputDefault = function (_a) {
|
|
|
5699
5718
|
: "left", height: height ? height : 44, paddingTop: getPaddingTopValue(), paddingBottom: multiline ? CONSTANTS.SPACE_4 : 0 }),
|
|
5700
5719
|
contentStyle,
|
|
5701
5720
|
] }))),
|
|
5702
|
-
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$
|
|
5721
|
+
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$a.clearButtonMultiline : styles$a.clearButton },
|
|
5703
5722
|
React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
|
|
5704
5723
|
right && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
|
|
5705
5724
|
right && (React$3.createElement(View, { center: true, paddingRight: CONSTANTS.SPACE_12 }, right)))));
|
|
5706
5725
|
};
|
|
5707
|
-
var styles$
|
|
5726
|
+
var styles$a = StyleSheet.create({
|
|
5708
5727
|
input: {
|
|
5709
5728
|
margin: 0,
|
|
5710
5729
|
flex: 1,
|
|
@@ -5984,7 +6003,7 @@ var ScaleButton = function (_a) {
|
|
|
5984
6003
|
var ScaleButton$1 = React__default.memo(ScaleButton);
|
|
5985
6004
|
|
|
5986
6005
|
var Button = function (_a) {
|
|
5987
|
-
var style = _a.style, title = _a.title; _a.border; var borderColor = _a.borderColor, isLoading = _a.isLoading, left = _a.left, right = _a.right
|
|
6006
|
+
var style = _a.style, title = _a.title; _a.border; var borderColor = _a.borderColor, isLoading = _a.isLoading, left = _a.left, right = _a.right; _a.margin; var textStyle = _a.textStyle, textProps = _a.textProps, onPress = _a.onPress, disabled = _a.disabled, backgroundColor = _a.backgroundColor, textColor = _a.textColor, _b = _a.bold, bold = _b === void 0 ? true : _b, _c = _a.size, size = _c === void 0 ? 16 : _c, _d = _a.medium, medium = _d === void 0 ? false : _d, _e = _a.mode, mode = _e === void 0 ? "contained" : _e; _a.transparent; var _g = _a.full, full = _g === void 0 ? false : _g; _a.theme; var _h = _a.buttonSize, buttonSize = _h === void 0 ? "normal" : _h, props = __rest(_a, ["style", "title", "border", "borderColor", "isLoading", "left", "right", "margin", "textStyle", "textProps", "onPress", "disabled", "backgroundColor", "textColor", "bold", "size", "medium", "mode", "transparent", "full", "theme", "buttonSize"]);
|
|
5988
6007
|
var theme = useInternalTheme();
|
|
5989
6008
|
var colors = theme.colors;
|
|
5990
6009
|
var disabledTextStyle = {
|
|
@@ -5993,7 +6012,7 @@ var Button = function (_a) {
|
|
|
5993
6012
|
var renderButtonStyle = function () {
|
|
5994
6013
|
switch (mode) {
|
|
5995
6014
|
case "outlined":
|
|
5996
|
-
return [styles$
|
|
6015
|
+
return [styles$9.border, { borderColor: colors.borderBrandDefault }];
|
|
5997
6016
|
case "contained":
|
|
5998
6017
|
return [{ backgroundColor: colors.surfaceBrandDefault }];
|
|
5999
6018
|
case "transparent":
|
|
@@ -6016,7 +6035,7 @@ var Button = function (_a) {
|
|
|
6016
6035
|
return (React__default.createElement(View, { row: !full },
|
|
6017
6036
|
React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
|
|
6018
6037
|
React__default.createElement(View, { style: [
|
|
6019
|
-
styles$
|
|
6038
|
+
styles$9.button,
|
|
6020
6039
|
{
|
|
6021
6040
|
borderRadius: CONSTANTS.BORDER_RADIUS_6,
|
|
6022
6041
|
},
|
|
@@ -6026,9 +6045,9 @@ var Button = function (_a) {
|
|
|
6026
6045
|
borderColor && { borderColor: borderColor },
|
|
6027
6046
|
backgroundColor && { backgroundColor: backgroundColor },
|
|
6028
6047
|
renderButtonStyle(),
|
|
6029
|
-
small && styles$
|
|
6048
|
+
buttonSize === "small" && styles$9.small,
|
|
6030
6049
|
disabled && [
|
|
6031
|
-
styles$
|
|
6050
|
+
styles$9.disabled,
|
|
6032
6051
|
{
|
|
6033
6052
|
borderColor: colors.borderPrimaryDisabled,
|
|
6034
6053
|
backgroundColor: colors.surfacePrimaryDisabled,
|
|
@@ -6045,7 +6064,7 @@ var Button = function (_a) {
|
|
|
6045
6064
|
!isLoading && right,
|
|
6046
6065
|
React__default.createElement(Spacer, { width: right ? CONSTANTS.SPACE_12 : CONSTANTS.SPACE_16 })))));
|
|
6047
6066
|
};
|
|
6048
|
-
var styles$
|
|
6067
|
+
var styles$9 = StyleSheet.create({
|
|
6049
6068
|
disabled: { opacity: 0.6 },
|
|
6050
6069
|
button: {
|
|
6051
6070
|
height: CONSTANTS.BUTTON_HEIGHT,
|
|
@@ -6062,48 +6081,7 @@ var styles$a = StyleSheet.create({
|
|
|
6062
6081
|
height: CONSTANTS.BUTTON_HEIGHT_SMALL,
|
|
6063
6082
|
},
|
|
6064
6083
|
});
|
|
6065
|
-
var index$
|
|
6066
|
-
|
|
6067
|
-
var ButtonIcon = function (_a) {
|
|
6068
|
-
var isLoading = _a.isLoading, disabled = _a.disabled, onPress = _a.onPress, style = _a.style, _b = _a.hiddenBackground, hiddenBackground = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? CONSTANTS.BUTTON_HEIGHT : _c, border = _a.border, children = _a.children, circle = _a.circle, backgroundColor = _a.backgroundColor, borderColor = _a.borderColor, props = _a.props;
|
|
6069
|
-
var colors = useInternalTheme().colors;
|
|
6070
|
-
return (React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
|
|
6071
|
-
React__default.createElement(View, __assign({ style: [
|
|
6072
|
-
styles$9.btn,
|
|
6073
|
-
!hiddenBackground
|
|
6074
|
-
? {
|
|
6075
|
-
backgroundColor: backgroundColor || colors.surfaceBrandDefault,
|
|
6076
|
-
}
|
|
6077
|
-
: {
|
|
6078
|
-
backgroundColor: "transparent",
|
|
6079
|
-
},
|
|
6080
|
-
{
|
|
6081
|
-
width: size,
|
|
6082
|
-
height: size,
|
|
6083
|
-
},
|
|
6084
|
-
border && {
|
|
6085
|
-
borderWidth: CONSTANTS.BORDER_WIDTH_1,
|
|
6086
|
-
borderColor: borderColor || colors.borderBrandDefault,
|
|
6087
|
-
backgroundColor: backgroundColor || colors.surfacePrimaryDefault,
|
|
6088
|
-
},
|
|
6089
|
-
circle && {
|
|
6090
|
-
borderRadius: size / 2,
|
|
6091
|
-
},
|
|
6092
|
-
disabled && {
|
|
6093
|
-
borderWidth: 0,
|
|
6094
|
-
backgroundColor: colors.surfaceBrandDisabled,
|
|
6095
|
-
},
|
|
6096
|
-
style,
|
|
6097
|
-
] }, props), isLoading ? React__default.createElement(ActivityIndicator$1, { size: "small" }) : children)));
|
|
6098
|
-
};
|
|
6099
|
-
var styles$9 = StyleSheet.create({
|
|
6100
|
-
btn: {
|
|
6101
|
-
justifyContent: "center",
|
|
6102
|
-
alignItems: "center",
|
|
6103
|
-
borderRadius: CONSTANTS.BORDER_RADIUS_6,
|
|
6104
|
-
},
|
|
6105
|
-
});
|
|
6106
|
-
var index$2 = memoDeepEqual(ButtonIcon);
|
|
6084
|
+
var index$2 = React__default.memo(Button);
|
|
6107
6085
|
|
|
6108
6086
|
var FloatingButton = function (_a) {
|
|
6109
6087
|
var isLoading = _a.isLoading, disabled = _a.disabled, onPress = _a.onPress, style = _a.style, _b = _a.hiddenBackground, hiddenBackground = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? BUTTON_HEIGHT : _c, children = _a.children, backgroundColor = _a.backgroundColor, props = _a.props, _d = _a.top, top = _d === void 0 ? 0 : _d, _e = _a.right, right = _e === void 0 ? 0 : _e, _f = _a.left, left = _f === void 0 ? 0 : _f, _g = _a.bottom, bottom = _g === void 0 ? 0 : _g;
|
|
@@ -6876,7 +6854,7 @@ var SearchInput = function (_a) {
|
|
|
6876
6854
|
return (React__default.createElement(TextInput, { left: React__default.createElement(View, { center: true },
|
|
6877
6855
|
React__default.createElement(Icon$1, { name: "IconSearch", type: "Svg", size: 18 })), disabled: disabled, value: value, clearButton: clearButton, mode: "default", label: placeholder, placeholder: placeholder, right: rightIcon, onFocus: onFocus, onBlur: onBlur, allowFontScaling: false, onChangeText: onChangeText, textStyle: textStyle, style: [
|
|
6878
6856
|
{
|
|
6879
|
-
height: height ||
|
|
6857
|
+
height: height || 36,
|
|
6880
6858
|
},
|
|
6881
6859
|
style,
|
|
6882
6860
|
], contentStyle: [
|
|
@@ -6977,5 +6955,5 @@ var ToastProvider = forwardRef$1(function (_a, ref) {
|
|
|
6977
6955
|
renderToast()));
|
|
6978
6956
|
});
|
|
6979
6957
|
|
|
6980
|
-
export { ActivityIndicator, Avatar, Badge, index$
|
|
6958
|
+
export { ActivityIndicator, Avatar, Badge, index$2 as Button, CONSTANTS, Checkbox, ChipBar, CountingDot, DarkTheme, DefaultTheme, index$1 as FloatingButton, Image$1 as Image, LightTheme, ProgressBar, RadioButton, SearchInput, index as SelectionField, Spacer, Switch, Tag, Text$1 as Text, TextInput, ThemeColors, ThemeProvider, Toast, ToastProvider, View, adaptNavigationTheme, configureFonts, overlay, shadow, showToast, toastRef, useTheme };
|
|
6981
6959
|
//# sourceMappingURL=index.esm.js.map
|