sapo-components-ui-rn 1.0.24 → 1.0.26
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/index.d.ts +1 -0
- package/dist/index.esm.js +102 -66
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +102 -65
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Tag/index.tsx +0 -1
- package/src/components/View/index.tsx +1 -8
- package/src/index.ts +1 -0
- package/src/index.tsx +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export { default as RadioButton } from "./components/RadioButton";
|
|
|
26
26
|
export { default as Avatar } from "./components/Avatar";
|
|
27
27
|
export { default as SelectionField } from "./components/SelectionField";
|
|
28
28
|
export { default as SearchInput } from "./components/SearchInput";
|
|
29
|
+
export { default as Tag } from "./components/Tag";
|
|
29
30
|
export type { Props as ActivityIndicatorProps } from "./components/ActivityIndicator";
|
|
30
31
|
export type { Props as SwitchProps } from "./components/Switch/Switch";
|
|
31
32
|
export type { Props as TextInputProps } from "./components/TextInput/TextInput";
|
package/dist/index.esm.js
CHANGED
|
@@ -1699,7 +1699,7 @@ var ActivityIndicator = function (_a) {
|
|
|
1699
1699
|
height: size / 2,
|
|
1700
1700
|
overflow: "hidden",
|
|
1701
1701
|
};
|
|
1702
|
-
return (React$3.createElement(View$1, __assign({ style: [styles$
|
|
1702
|
+
return (React$3.createElement(View$1, __assign({ style: [styles$i.container, style] }, rest, { accessible: true, accessibilityRole: "progressbar", accessibilityState: { busy: animating } }),
|
|
1703
1703
|
React$3.createElement(Animated.View, { style: [{ width: size, height: size, opacity: fade }], collapsable: false }, [0, 1].map(function (index) {
|
|
1704
1704
|
// Thanks to https://github.com/n4kz/react-native-indicators for the great work
|
|
1705
1705
|
var inputRange = Array.from(new Array(frames), function (_, frameIndex) { return frameIndex / (frames - 1); });
|
|
@@ -1744,7 +1744,7 @@ var ActivityIndicator = function (_a) {
|
|
|
1744
1744
|
borderWidth: size / 10,
|
|
1745
1745
|
borderRadius: size / 2,
|
|
1746
1746
|
};
|
|
1747
|
-
return (React$3.createElement(Animated.View, { key: index, style: [styles$
|
|
1747
|
+
return (React$3.createElement(Animated.View, { key: index, style: [styles$i.layer] },
|
|
1748
1748
|
React$3.createElement(Animated.View, { style: layerStyle },
|
|
1749
1749
|
React$3.createElement(Animated.View, { style: [containerStyle, offsetStyle], collapsable: false },
|
|
1750
1750
|
React$3.createElement(Animated.View, { style: viewportStyle },
|
|
@@ -1752,7 +1752,7 @@ var ActivityIndicator = function (_a) {
|
|
|
1752
1752
|
React$3.createElement(Animated.View, { style: lineStyle })))))));
|
|
1753
1753
|
}))));
|
|
1754
1754
|
};
|
|
1755
|
-
var styles$
|
|
1755
|
+
var styles$i = StyleSheet.create({
|
|
1756
1756
|
container: {
|
|
1757
1757
|
justifyContent: "center",
|
|
1758
1758
|
alignItems: "center",
|
|
@@ -1860,11 +1860,11 @@ var ProgressBar = function (_a) {
|
|
|
1860
1860
|
? {}
|
|
1861
1861
|
: { min: 0, max: 100, now: Math.round(progress * 100) }, testID: testID }),
|
|
1862
1862
|
React$3.createElement(Animated.View, { style: [
|
|
1863
|
-
styles$
|
|
1863
|
+
styles$h.container,
|
|
1864
1864
|
{ backgroundColor: trackTintColor, opacity: fade },
|
|
1865
1865
|
style,
|
|
1866
1866
|
] }, width ? (React$3.createElement(Animated.View, { testID: "".concat(testID, "-fill"), style: [
|
|
1867
|
-
styles$
|
|
1867
|
+
styles$h.progressBar,
|
|
1868
1868
|
{
|
|
1869
1869
|
width: width,
|
|
1870
1870
|
backgroundColor: tintColor,
|
|
@@ -1908,7 +1908,7 @@ var ProgressBar = function (_a) {
|
|
|
1908
1908
|
fillStyle,
|
|
1909
1909
|
] })) : null)));
|
|
1910
1910
|
};
|
|
1911
|
-
var styles$
|
|
1911
|
+
var styles$h = StyleSheet.create({
|
|
1912
1912
|
container: {
|
|
1913
1913
|
height: 4,
|
|
1914
1914
|
overflow: "hidden",
|
|
@@ -1921,8 +1921,6 @@ var styles$g = StyleSheet.create({
|
|
|
1921
1921
|
|
|
1922
1922
|
var ViewCustom = function (_a) {
|
|
1923
1923
|
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;
|
|
1924
|
-
var theme = useInternalTheme();
|
|
1925
|
-
var colors = theme.colors;
|
|
1926
1924
|
var getStyle = function () {
|
|
1927
1925
|
var styleCustom = {};
|
|
1928
1926
|
if (row) {
|
|
@@ -2008,11 +2006,7 @@ var ViewCustom = function (_a) {
|
|
|
2008
2006
|
};
|
|
2009
2007
|
var defaultStyle = getStyle();
|
|
2010
2008
|
var Component = onPress ? TouchableOpacity : View$1;
|
|
2011
|
-
return (React__default.createElement(Component, { activeOpacity: activeOpacity, onPress: onPress, disabled: disabled, style: [
|
|
2012
|
-
{ backgroundColor: colors.backgroundPrimary },
|
|
2013
|
-
defaultStyle,
|
|
2014
|
-
style,
|
|
2015
|
-
] }, children));
|
|
2009
|
+
return (React__default.createElement(Component, { activeOpacity: activeOpacity, onPress: onPress, disabled: disabled, style: [defaultStyle, style] }, children));
|
|
2016
2010
|
};
|
|
2017
2011
|
var View = React__default.memo(ViewCustom);
|
|
2018
2012
|
|
|
@@ -2483,7 +2477,7 @@ var TextInputAffix = function (_a) {
|
|
|
2483
2477
|
var textColor = getTextColor({ theme: theme, disabled: disabled });
|
|
2484
2478
|
var content = (React__default.createElement(Text$2, { maxFontSizeMultiplier: maxFontSizeMultiplier, style: [{ color: textColor }, textStyle, labelStyle], onLayout: onTextLayout, testID: "".concat(testID, "-text") }, text));
|
|
2485
2479
|
return (React__default.createElement(Animated.View, { style: [
|
|
2486
|
-
styles$
|
|
2480
|
+
styles$g.container,
|
|
2487
2481
|
style,
|
|
2488
2482
|
{
|
|
2489
2483
|
opacity: (visible === null || visible === void 0 ? void 0 : visible.interpolate({
|
|
@@ -2494,7 +2488,7 @@ var TextInputAffix = function (_a) {
|
|
|
2494
2488
|
], onLayout: onLayout, testID: testID }, onPress ? (React__default.createElement(Pressable, { onPress: onPress, accessibilityRole: "button", accessibilityLabel: accessibilityLabel }, content)) : (content)));
|
|
2495
2489
|
};
|
|
2496
2490
|
TextInputAffix.displayName = "TextInput.Affix";
|
|
2497
|
-
var styles$
|
|
2491
|
+
var styles$g = StyleSheet.create({
|
|
2498
2492
|
container: {
|
|
2499
2493
|
position: "absolute",
|
|
2500
2494
|
justifyContent: "center",
|
|
@@ -2552,13 +2546,13 @@ var AnimatedText = forwardRef(function AnimatedText(_a, ref) {
|
|
|
2552
2546
|
}
|
|
2553
2547
|
return (React$3.createElement(Animated.Text, __assign({ ref: ref }, rest, { style: [
|
|
2554
2548
|
font,
|
|
2555
|
-
styles$
|
|
2549
|
+
styles$f.text,
|
|
2556
2550
|
{ writingDirection: writingDirection, color: theme.colors.backgroundPrimary },
|
|
2557
2551
|
style,
|
|
2558
2552
|
] })));
|
|
2559
2553
|
}
|
|
2560
2554
|
});
|
|
2561
|
-
var styles$
|
|
2555
|
+
var styles$f = StyleSheet.create({
|
|
2562
2556
|
text: {
|
|
2563
2557
|
textAlign: "left",
|
|
2564
2558
|
},
|
|
@@ -2629,7 +2623,7 @@ var InputLabel = function (props) {
|
|
|
2629
2623
|
return (
|
|
2630
2624
|
// Position colored placeholder and gray placeholder on top of each other and crossfade them
|
|
2631
2625
|
// This gives the effect of animating the color, but allows us to use native driver
|
|
2632
|
-
React__default.createElement(View$1, { pointerEvents: "none", style: [StyleSheet.absoluteFill, styles$
|
|
2626
|
+
React__default.createElement(View$1, { pointerEvents: "none", style: [StyleSheet.absoluteFill, styles$e.overflow, styles$e.labelContainer] },
|
|
2633
2627
|
React__default.createElement(Animated.View, { pointerEvents: "none", style: [
|
|
2634
2628
|
StyleSheet.absoluteFill,
|
|
2635
2629
|
Platform.OS !== "web" && { width: width },
|
|
@@ -2667,7 +2661,7 @@ var InputLabel = function (props) {
|
|
|
2667
2661
|
},
|
|
2668
2662
|
], numberOfLines: 1, maxFontSizeMultiplier: maxFontSizeMultiplier, testID: "".concat(testID, "-label-inactive") }, label)))));
|
|
2669
2663
|
};
|
|
2670
|
-
var styles$
|
|
2664
|
+
var styles$e = StyleSheet.create({
|
|
2671
2665
|
overflow: {
|
|
2672
2666
|
overflow: "hidden",
|
|
2673
2667
|
},
|
|
@@ -2680,8 +2674,8 @@ var InputLabel$1 = React__default.memo(InputLabel);
|
|
|
2680
2674
|
var Outline = function (_a) {
|
|
2681
2675
|
var label = _a.label; _a.activeColor; _a.backgroundColor; _a.hasActiveOutline; _a.focused; _a.outlineColor; _a.roundness; var style = _a.style;
|
|
2682
2676
|
return (React$3.createElement(View$1, { testID: "text-input-outline", pointerEvents: "none", style: [
|
|
2683
|
-
styles$
|
|
2684
|
-
!label && styles$
|
|
2677
|
+
styles$d.outline,
|
|
2678
|
+
!label && styles$d.noLabelOutline,
|
|
2685
2679
|
// eslint-disable-next-line react-native/no-inline-styles
|
|
2686
2680
|
{
|
|
2687
2681
|
// backgroundColor,
|
|
@@ -2692,7 +2686,7 @@ var Outline = function (_a) {
|
|
|
2692
2686
|
style,
|
|
2693
2687
|
] }));
|
|
2694
2688
|
};
|
|
2695
|
-
var styles$
|
|
2689
|
+
var styles$d = StyleSheet.create({
|
|
2696
2690
|
outline: {
|
|
2697
2691
|
position: "absolute",
|
|
2698
2692
|
left: 0,
|
|
@@ -2889,7 +2883,7 @@ var TextInputFlat = function (_a) {
|
|
|
2889
2883
|
label: label,
|
|
2890
2884
|
scale: fontScale,
|
|
2891
2885
|
isAndroid: isAndroid,
|
|
2892
|
-
styles: StyleSheet.flatten(dense ? styles$
|
|
2886
|
+
styles: StyleSheet.flatten(dense ? styles$c.inputFlatDense : styles$c.inputFlat),
|
|
2893
2887
|
};
|
|
2894
2888
|
var pad = calculatePadding(paddingSettings);
|
|
2895
2889
|
adjustPaddingFlat(__assign(__assign({}, paddingSettings), { pad: pad }));
|
|
@@ -2915,7 +2909,7 @@ var TextInputFlat = function (_a) {
|
|
|
2915
2909
|
onLabelTextLayout: onLabelTextLayout,
|
|
2916
2910
|
placeholderOpacity: placeholderOpacity,
|
|
2917
2911
|
labelError: error,
|
|
2918
|
-
placeholderStyle: styles$
|
|
2912
|
+
placeholderStyle: styles$c.placeholder,
|
|
2919
2913
|
baseLabelTranslateY: baseLabelTranslateY,
|
|
2920
2914
|
baseLabelTranslateX: baseLabelTranslateX,
|
|
2921
2915
|
font: font,
|
|
@@ -2978,7 +2972,7 @@ var TextInputFlat = function (_a) {
|
|
|
2978
2972
|
left ? (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 })) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 }))),
|
|
2979
2973
|
React$3.createElement(Outline, { style: outlineStyle, label: label, roundness: roundness, hasActiveOutline: hasActiveOutline, focused: parentState.focused, activeColor: activeColor, outlineColor: outlineColor, backgroundColor: backgroundColor }),
|
|
2980
2974
|
React$3.createElement(View$1, { onLayout: onInputLayout, style: [
|
|
2981
|
-
styles$
|
|
2975
|
+
styles$c.labelContainer,
|
|
2982
2976
|
{
|
|
2983
2977
|
minHeight: minHeight,
|
|
2984
2978
|
flex: 1,
|
|
@@ -2986,7 +2980,7 @@ var TextInputFlat = function (_a) {
|
|
|
2986
2980
|
] },
|
|
2987
2981
|
!isAndroid && multiline && !!label && !disabled && (React$3.createElement(View$1, { pointerEvents: "none", style: [
|
|
2988
2982
|
StyleSheet.absoluteFill,
|
|
2989
|
-
dense ? styles$
|
|
2983
|
+
dense ? styles$c.densePatchContainer : styles$c.patchContainer,
|
|
2990
2984
|
{
|
|
2991
2985
|
backgroundColor: viewStyle.backgroundColor || containerStyle.backgroundColor,
|
|
2992
2986
|
left: paddingLeft,
|
|
@@ -2995,7 +2989,7 @@ var TextInputFlat = function (_a) {
|
|
|
2995
2989
|
] })),
|
|
2996
2990
|
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 :
|
|
2997
2991
|
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: [
|
|
2998
|
-
styles$
|
|
2992
|
+
styles$c.input,
|
|
2999
2993
|
__assign(__assign({ paddingLeft: paddingLeft, paddingRight: paddingRight, paddingTop: CONSTANTS.SPACE_12 }, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
|
|
3000
2994
|
? textAlign
|
|
3001
2995
|
: I18nManager.getConstants().isRTL
|
|
@@ -3004,13 +2998,13 @@ var TextInputFlat = function (_a) {
|
|
|
3004
2998
|
Platform.OS === "web" && { outline: "none" },
|
|
3005
2999
|
contentStyle,
|
|
3006
3000
|
] }))),
|
|
3007
|
-
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$
|
|
3001
|
+
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$c.clearButton },
|
|
3008
3002
|
React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
|
|
3009
3003
|
React$3.createElement(View$1, { style: { flexDirection: "row" } },
|
|
3010
3004
|
right && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
|
|
3011
3005
|
right && (React$3.createElement(View$1, { style: { paddingRight: CONSTANTS.SPACE_12 } }, right)))));
|
|
3012
3006
|
};
|
|
3013
|
-
var styles$
|
|
3007
|
+
var styles$c = StyleSheet.create({
|
|
3014
3008
|
placeholder: {
|
|
3015
3009
|
position: "absolute",
|
|
3016
3010
|
left: 0,
|
|
@@ -5637,7 +5631,7 @@ var TextInputDefault = function (_a) {
|
|
|
5637
5631
|
? rest.placeholder
|
|
5638
5632
|
: label
|
|
5639
5633
|
: rest.placeholder, editable: !disabled && editable, selectionColor: selectionColor, cursorColor: typeof cursorColor === "undefined" ? activeColor : cursorColor, placeholderTextColor: placeholderTextColorBasedOnState, onFocus: onFocus, onBlur: onBlur, underlineColorAndroid: "transparent", multiline: multiline, style: [
|
|
5640
|
-
styles$
|
|
5634
|
+
styles$b.input,
|
|
5641
5635
|
__assign(__assign({}, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
|
|
5642
5636
|
? textAlign
|
|
5643
5637
|
: I18nManager.getConstants().isRTL
|
|
@@ -5649,12 +5643,12 @@ var TextInputDefault = function (_a) {
|
|
|
5649
5643
|
: CONSTANTS.SPACE_4 }),
|
|
5650
5644
|
contentStyle,
|
|
5651
5645
|
] }))),
|
|
5652
|
-
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$
|
|
5646
|
+
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$b.clearButtonMultiline : styles$b.clearButton },
|
|
5653
5647
|
React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
|
|
5654
5648
|
right && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
|
|
5655
5649
|
right && React$3.createElement(View, { paddingRight: CONSTANTS.SPACE_12 }, right))));
|
|
5656
5650
|
};
|
|
5657
|
-
var styles$
|
|
5651
|
+
var styles$b = StyleSheet.create({
|
|
5658
5652
|
input: {
|
|
5659
5653
|
margin: 0,
|
|
5660
5654
|
flex: 1,
|
|
@@ -5943,7 +5937,7 @@ var Button = function (_a) {
|
|
|
5943
5937
|
var renderButtonStyle = function () {
|
|
5944
5938
|
switch (mode) {
|
|
5945
5939
|
case "outlined":
|
|
5946
|
-
return [styles$
|
|
5940
|
+
return [styles$a.border, { borderColor: colors.borderBrandDefault }];
|
|
5947
5941
|
case "contained":
|
|
5948
5942
|
return [{ backgroundColor: colors.surfaceBrandDefault }];
|
|
5949
5943
|
case "transparent":
|
|
@@ -5966,7 +5960,7 @@ var Button = function (_a) {
|
|
|
5966
5960
|
return (React__default.createElement(View, { row: !full },
|
|
5967
5961
|
React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
|
|
5968
5962
|
React__default.createElement(View, { style: [
|
|
5969
|
-
styles$
|
|
5963
|
+
styles$a.button,
|
|
5970
5964
|
{
|
|
5971
5965
|
borderRadius: CONSTANTS.BORDER_RADIUS_6,
|
|
5972
5966
|
},
|
|
@@ -5976,9 +5970,9 @@ var Button = function (_a) {
|
|
|
5976
5970
|
borderColor && { borderColor: borderColor },
|
|
5977
5971
|
backgroundColor && { backgroundColor: backgroundColor },
|
|
5978
5972
|
renderButtonStyle(),
|
|
5979
|
-
small && styles$
|
|
5973
|
+
small && styles$a.small,
|
|
5980
5974
|
disabled && [
|
|
5981
|
-
styles$
|
|
5975
|
+
styles$a.disabled,
|
|
5982
5976
|
{
|
|
5983
5977
|
borderColor: colors.borderPrimaryDisabled,
|
|
5984
5978
|
backgroundColor: colors.surfacePrimaryDisabled,
|
|
@@ -5995,7 +5989,7 @@ var Button = function (_a) {
|
|
|
5995
5989
|
!isLoading && right,
|
|
5996
5990
|
React__default.createElement(Spacer, { width: right ? CONSTANTS.SPACE_12 : CONSTANTS.SPACE_16 })))));
|
|
5997
5991
|
};
|
|
5998
|
-
var styles$
|
|
5992
|
+
var styles$a = StyleSheet.create({
|
|
5999
5993
|
disabled: { opacity: 0.6 },
|
|
6000
5994
|
button: {
|
|
6001
5995
|
height: CONSTANTS.BUTTON_HEIGHT,
|
|
@@ -6019,7 +6013,7 @@ var ButtonIcon = function (_a) {
|
|
|
6019
6013
|
var colors = useInternalTheme().colors;
|
|
6020
6014
|
return (React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
|
|
6021
6015
|
React__default.createElement(View, __assign({ style: [
|
|
6022
|
-
styles$
|
|
6016
|
+
styles$9.btn,
|
|
6023
6017
|
!hiddenBackground
|
|
6024
6018
|
? {
|
|
6025
6019
|
backgroundColor: backgroundColor || colors.surfaceBrandDefault,
|
|
@@ -6046,7 +6040,7 @@ var ButtonIcon = function (_a) {
|
|
|
6046
6040
|
style,
|
|
6047
6041
|
] }, props), isLoading ? React__default.createElement(ActivityIndicator$1, { size: "small" }) : children)));
|
|
6048
6042
|
};
|
|
6049
|
-
var styles$
|
|
6043
|
+
var styles$9 = StyleSheet.create({
|
|
6050
6044
|
btn: {
|
|
6051
6045
|
justifyContent: "center",
|
|
6052
6046
|
alignItems: "center",
|
|
@@ -6074,7 +6068,7 @@ var FloatingButton = function (_a) {
|
|
|
6074
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 ? 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;
|
|
6075
6069
|
var colors = useInternalTheme().colors;
|
|
6076
6070
|
return (React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading, style: [
|
|
6077
|
-
styles$
|
|
6071
|
+
styles$8.btn,
|
|
6078
6072
|
top > 0 && { top: top },
|
|
6079
6073
|
right > 0 && { right: right },
|
|
6080
6074
|
left > 0 && { left: left },
|
|
@@ -6100,7 +6094,7 @@ var FloatingButton = function (_a) {
|
|
|
6100
6094
|
style,
|
|
6101
6095
|
] }, props), isLoading ? React__default.createElement(ActivityIndicator$1, { size: "small" }) : children)));
|
|
6102
6096
|
};
|
|
6103
|
-
var styles$
|
|
6097
|
+
var styles$8 = StyleSheet.create({
|
|
6104
6098
|
btn: {
|
|
6105
6099
|
position: "absolute",
|
|
6106
6100
|
},
|
|
@@ -6340,7 +6334,7 @@ var Toast = memoWithRef(function (_props, ref) {
|
|
|
6340
6334
|
}
|
|
6341
6335
|
};
|
|
6342
6336
|
return (React__default.createElement(ViewVisibleAnimated, { ref: viewVisibleAnimatedRef, autoShow: false, scaleEnable: true, style: [
|
|
6343
|
-
styles$
|
|
6337
|
+
styles$7.container,
|
|
6344
6338
|
options.position === POSITION.BOTTOM && {
|
|
6345
6339
|
bottom: bottom
|
|
6346
6340
|
? bottom + handleToastBottomHeight()
|
|
@@ -6351,7 +6345,7 @@ var Toast = memoWithRef(function (_props, ref) {
|
|
|
6351
6345
|
},
|
|
6352
6346
|
] },
|
|
6353
6347
|
React__default.createElement(View, { row: !options.title, center: !options.title, full: true, onPress: onPressToast, style: [
|
|
6354
|
-
styles$
|
|
6348
|
+
styles$7.wrapContent,
|
|
6355
6349
|
{
|
|
6356
6350
|
shadowColor: "black",
|
|
6357
6351
|
shadowOffset: {
|
|
@@ -6365,12 +6359,12 @@ var Toast = memoWithRef(function (_props, ref) {
|
|
|
6365
6359
|
] },
|
|
6366
6360
|
React__default.createElement(View, { row: true, style: { alignItems: "flex-start" } },
|
|
6367
6361
|
React__default.createElement(View, null,
|
|
6368
|
-
React__default.createElement(Image$2, { source: getSourceIcon(), style: styles$
|
|
6362
|
+
React__default.createElement(Image$2, { source: getSourceIcon(), style: styles$7.img })),
|
|
6369
6363
|
React__default.createElement(View, { full: true, paddingLeft: CONSTANTS.SPACE_8 },
|
|
6370
6364
|
React__default.createElement(Text$1, { bold: true, color: colors.textOnFillDefault }, options.title),
|
|
6371
|
-
message.toString().length > 0 && (React__default.createElement(Text$1, { color: colors.textOnFillDefault, numberOfLines: 4, style: !options.title && styles$
|
|
6365
|
+
message.toString().length > 0 && (React__default.createElement(Text$1, { color: colors.textOnFillDefault, numberOfLines: 4, style: !options.title && styles$7.wrapMess }, message)))))));
|
|
6372
6366
|
});
|
|
6373
|
-
var styles$
|
|
6367
|
+
var styles$7 = StyleSheet.create({
|
|
6374
6368
|
wrapMess: { marginLeft: CONSTANTS.SPACE_8, flex: 1 },
|
|
6375
6369
|
wrapContent: {
|
|
6376
6370
|
borderRadius: CONSTANTS.BORDER_RADIUS_12,
|
|
@@ -6589,10 +6583,10 @@ var CountingDot = function (_a) {
|
|
|
6589
6583
|
return React__default.createElement(View, { style: style }, children);
|
|
6590
6584
|
}
|
|
6591
6585
|
return (React__default.createElement(View, { row: true },
|
|
6592
|
-
React__default.createElement(View, { center: true, borderRadius: CONSTANTS.BORDER_RADIUS_12, backgroundColor: backgroundColor || colors.surfaceCriticalDefault, paddingHorizontal: CONSTANTS.SPACE_4, paddingVertical: CONSTANTS.SPACE_2, style: [styles$
|
|
6593
|
-
React__default.createElement(Text$1, { size: 10, style: [styles$
|
|
6586
|
+
React__default.createElement(View, { center: true, borderRadius: CONSTANTS.BORDER_RADIUS_12, backgroundColor: backgroundColor || colors.surfaceCriticalDefault, paddingHorizontal: CONSTANTS.SPACE_4, paddingVertical: CONSTANTS.SPACE_2, style: [styles$6.container, style] },
|
|
6587
|
+
React__default.createElement(Text$1, { size: 10, style: [styles$6.textMedium, textStyle], color: textColor || colors.textOnFillDefault }, value))));
|
|
6594
6588
|
};
|
|
6595
|
-
var styles$
|
|
6589
|
+
var styles$6 = StyleSheet.create(__assign(__assign({}, containerStyles), { container: {
|
|
6596
6590
|
minWidth: 16,
|
|
6597
6591
|
minHeight: 16,
|
|
6598
6592
|
} }));
|
|
@@ -6622,18 +6616,18 @@ var ChipBar = function (_a) {
|
|
|
6622
6616
|
leftIcon && React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_4 }, leftIcon),
|
|
6623
6617
|
React__default.createElement(View, null,
|
|
6624
6618
|
React__default.createElement(Text$1, { numberOfLines: numberOfLines, ellipsizeMode: ellipsizeMode, color: active ? colors.textBrandDefault : colors.textDefault, style: [
|
|
6625
|
-
styles$
|
|
6626
|
-
styles$
|
|
6619
|
+
styles$5.text14,
|
|
6620
|
+
styles$5.textMedium,
|
|
6627
6621
|
disabled && {
|
|
6628
6622
|
color: colors.textSecondary,
|
|
6629
6623
|
},
|
|
6630
6624
|
textStyle,
|
|
6631
6625
|
] }, title)),
|
|
6632
6626
|
rightIcon && React__default.createElement(View, { paddingLeft: CONSTANTS.SPACE_4 }, rightIcon)),
|
|
6633
|
-
badge > 0 && (React__default.createElement(View, { style: styles$
|
|
6627
|
+
badge > 0 && (React__default.createElement(View, { style: styles$5.badgeContainer },
|
|
6634
6628
|
React__default.createElement(CountingDot, { value: badge })))));
|
|
6635
6629
|
};
|
|
6636
|
-
var styles$
|
|
6630
|
+
var styles$5 = StyleSheet.create(__assign(__assign({}, containerStyles), { badgeContainer: {
|
|
6637
6631
|
position: "absolute",
|
|
6638
6632
|
right: 0,
|
|
6639
6633
|
top: -4,
|
|
@@ -6671,14 +6665,14 @@ var Checkbox = function (_a) {
|
|
|
6671
6665
|
React__default.createElement(Icon$1, { name: isActive ? "IconCheckboxActive" : "IconCheckbox", type: "Svg", size: iconSize, color: checkboxColor }))),
|
|
6672
6666
|
React__default.createElement(View, null,
|
|
6673
6667
|
React__default.createElement(Text$1, { color: colors.textDefault, style: [
|
|
6674
|
-
styles$
|
|
6668
|
+
styles$4.text14,
|
|
6675
6669
|
disabled && {
|
|
6676
6670
|
color: colors.textSecondary,
|
|
6677
6671
|
},
|
|
6678
6672
|
textStyle,
|
|
6679
6673
|
] }, content))));
|
|
6680
6674
|
};
|
|
6681
|
-
var styles$
|
|
6675
|
+
var styles$4 = StyleSheet.create(__assign(__assign({}, containerStyles), { icon: {
|
|
6682
6676
|
width: 24,
|
|
6683
6677
|
height: 24,
|
|
6684
6678
|
} }));
|
|
@@ -6713,14 +6707,14 @@ var RadioButton = function (_a) {
|
|
|
6713
6707
|
: "IconRadio", type: "Svg", size: 24, color: getColorCheckbox }))),
|
|
6714
6708
|
React__default.createElement(View, null,
|
|
6715
6709
|
React__default.createElement(Text$1, { color: colors.textDefault, style: [
|
|
6716
|
-
styles$
|
|
6710
|
+
styles$3.text14,
|
|
6717
6711
|
disabled && {
|
|
6718
6712
|
color: colors.textSecondary,
|
|
6719
6713
|
},
|
|
6720
6714
|
textStyle,
|
|
6721
6715
|
] }, content))));
|
|
6722
6716
|
};
|
|
6723
|
-
var styles$
|
|
6717
|
+
var styles$3 = StyleSheet.create(__assign(__assign({}, containerStyles), { icon: {
|
|
6724
6718
|
width: 24,
|
|
6725
6719
|
height: 24,
|
|
6726
6720
|
} }));
|
|
@@ -6751,9 +6745,9 @@ var Avatar = function (_a) {
|
|
|
6751
6745
|
return 16;
|
|
6752
6746
|
}
|
|
6753
6747
|
};
|
|
6754
|
-
return (React__default.createElement(View, { onPress: onPress, width: size, height: size, borderRadius: size / 2, center: true, backgroundColor: backgroundColor || colors.surfaceSecondaryDefault, style: [styles$
|
|
6748
|
+
return (React__default.createElement(View, { onPress: onPress, width: size, height: size, borderRadius: size / 2, center: true, backgroundColor: backgroundColor || colors.surfaceSecondaryDefault, style: [styles$2.container, style] }, source ? (React__default.createElement(Image$1, { useFastImage: true, resizeMode: "cover", source: source, style: [{ width: size, height: size }, imageStyle] })) : (React__default.createElement(Text$1, { size: getSize(size), color: textColor || colors.textSecondary, style: textStyle || { fontWeight: "500" } }, getInitials(name)))));
|
|
6755
6749
|
};
|
|
6756
|
-
var styles$
|
|
6750
|
+
var styles$2 = StyleSheet.create({
|
|
6757
6751
|
container: {
|
|
6758
6752
|
overflow: "hidden",
|
|
6759
6753
|
},
|
|
@@ -6779,14 +6773,14 @@ var SelectionField = function (_a) {
|
|
|
6779
6773
|
return (React__default.createElement(View, null,
|
|
6780
6774
|
React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
|
|
6781
6775
|
React__default.createElement(View, { style: [
|
|
6782
|
-
styles.container,
|
|
6776
|
+
styles$1.container,
|
|
6783
6777
|
{
|
|
6784
6778
|
borderRadius: BORDER_RADIUS_6,
|
|
6785
6779
|
},
|
|
6786
|
-
[styles.border, { borderColor: colors.borderPrimaryDefault }],
|
|
6780
|
+
[styles$1.border, { borderColor: colors.borderPrimaryDefault }],
|
|
6787
6781
|
borderColor && { borderColor: borderColor },
|
|
6788
6782
|
disabled && [
|
|
6789
|
-
styles.disabled,
|
|
6783
|
+
styles$1.disabled,
|
|
6790
6784
|
{
|
|
6791
6785
|
borderColor: colors.borderPrimaryDisabled,
|
|
6792
6786
|
backgroundColor: colors.surfacePrimaryDisabled,
|
|
@@ -6803,7 +6797,7 @@ var SelectionField = function (_a) {
|
|
|
6803
6797
|
React__default.createElement(Spacer, { width: SPACE_12 }),
|
|
6804
6798
|
React__default.createElement(View, { full: true },
|
|
6805
6799
|
content.toString() !== "" && label.toString() !== "" && (React__default.createElement(Text$1, { color: labelColor || colors.textSecondary, style: [
|
|
6806
|
-
styles.text12,
|
|
6800
|
+
styles$1.text12,
|
|
6807
6801
|
disabled && {
|
|
6808
6802
|
color: colors.textPlaceholder,
|
|
6809
6803
|
},
|
|
@@ -6819,9 +6813,9 @@ var SelectionField = function (_a) {
|
|
|
6819
6813
|
right || React__default.createElement(Icon$1, { name: "IconArrowDown", type: "Svg", size: 24 }),
|
|
6820
6814
|
React__default.createElement(Spacer, { width: SPACE_12 }))),
|
|
6821
6815
|
error.length > 0 && (React__default.createElement(View, { paddingHorizontal: SPACE_12, paddingVertical: SPACE_4 },
|
|
6822
|
-
React__default.createElement(Text$1, { style: styles.text12, color: colors.textErrorDefault }, error)))));
|
|
6816
|
+
React__default.createElement(Text$1, { style: styles$1.text12, color: colors.textErrorDefault }, error)))));
|
|
6823
6817
|
};
|
|
6824
|
-
var styles = StyleSheet.create(__assign(__assign({}, containerStyles), { disabled: { opacity: 0.6 }, container: {
|
|
6818
|
+
var styles$1 = StyleSheet.create(__assign(__assign({}, containerStyles), { disabled: { opacity: 0.6 }, container: {
|
|
6825
6819
|
minHeight: BUTTON_HEIGHT,
|
|
6826
6820
|
flexDirection: "row",
|
|
6827
6821
|
alignItems: "center",
|
|
@@ -6846,6 +6840,48 @@ var SearchInput = function (_a) {
|
|
|
6846
6840
|
};
|
|
6847
6841
|
StyleSheet.create(__assign({}, containerStyles));
|
|
6848
6842
|
|
|
6843
|
+
var Tag = function (_a) {
|
|
6844
|
+
var style = _a.style, _b = _a.borderRadius, borderRadius = _b === void 0 ? CONSTANTS.BORDER_RADIUS_ROUNDED : _b, _c = _a.title, title = _c === void 0 ? "content" : _c, textStyle = _a.textStyle, onPress = _a.onPress, _d = _a.disabled, disabled = _d === void 0 ? false : _d, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _e = _a.isActive, isActive = _e === void 0 ? false : _e, _f = _a.ellipsizeMode, ellipsizeMode = _f === void 0 ? "tail" : _f, _g = _a.numberOfLines, numberOfLines = _g === void 0 ? 1 : _g, _h = _a.hideRightIcon, hideRightIcon = _h === void 0 ? false : _h;
|
|
6845
|
+
var theme = useInternalTheme();
|
|
6846
|
+
var colors = theme.colors;
|
|
6847
|
+
var _j = useState(isActive), active = _j[0], setActive = _j[1];
|
|
6848
|
+
var handlePressTag = useCallback(function () {
|
|
6849
|
+
setActive(!active);
|
|
6850
|
+
onPress === null || onPress === void 0 ? void 0 : onPress();
|
|
6851
|
+
}, [active]);
|
|
6852
|
+
useEffect(function () {
|
|
6853
|
+
setActive(isActive);
|
|
6854
|
+
}, [isActive]);
|
|
6855
|
+
return (React__default.createElement(View, { row: true },
|
|
6856
|
+
React__default.createElement(View, { row: true, disabled: disabled, paddingHorizontal: CONSTANTS.SPACE_12, paddingVertical: CONSTANTS.SPACE_8, borderRadius: borderRadius, alignCenter: true, style: [
|
|
6857
|
+
disabled && {
|
|
6858
|
+
backgroundColor: colors.surfaceSecondaryDefault,
|
|
6859
|
+
borderColor: colors.surfaceSecondaryDefault,
|
|
6860
|
+
},
|
|
6861
|
+
style,
|
|
6862
|
+
], onPress: handlePressTag, backgroundColor: active
|
|
6863
|
+
? colors.surfaceBrandInversePressed
|
|
6864
|
+
: colors.surfaceBrandInverseDefault },
|
|
6865
|
+
leftIcon && React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_4 }, leftIcon),
|
|
6866
|
+
React__default.createElement(View, null,
|
|
6867
|
+
React__default.createElement(Text$1, { numberOfLines: numberOfLines, ellipsizeMode: ellipsizeMode, style: [
|
|
6868
|
+
styles.text14,
|
|
6869
|
+
styles.textMedium,
|
|
6870
|
+
disabled && {
|
|
6871
|
+
color: colors.textSecondary,
|
|
6872
|
+
},
|
|
6873
|
+
textStyle,
|
|
6874
|
+
] }, title)),
|
|
6875
|
+
rightIcon ? (React__default.createElement(View, { paddingLeft: CONSTANTS.SPACE_4 }, rightIcon)) : hideRightIcon ? (React__default.createElement(View, null)) : (React__default.createElement(View, { paddingLeft: CONSTANTS.SPACE_4 },
|
|
6876
|
+
React__default.createElement(Icon$1, { name: "IconClose", type: "Svg", size: 24, color: colors.iconBrandDefault }))))));
|
|
6877
|
+
};
|
|
6878
|
+
var styles = StyleSheet.create(__assign(__assign({}, containerStyles), { badgeContainer: {
|
|
6879
|
+
position: "absolute",
|
|
6880
|
+
right: 0,
|
|
6881
|
+
top: -4,
|
|
6882
|
+
zIndex: 999,
|
|
6883
|
+
} }));
|
|
6884
|
+
|
|
6849
6885
|
var toastRef = React__default.createRef();
|
|
6850
6886
|
var showToast = function (_a) {
|
|
6851
6887
|
var message = _a.message, _b = _a.duration, duration = _b === void 0 ? 5000 : _b, _c = _a.position, position = _c === void 0 ? "top" : _c, _d = _a.type, type = _d === void 0 ? "success" : _d, _e = _a.onPress, onPress = _e === void 0 ? function () { } : _e, title = _a.title, _f = _a.spacer, spacer = _f === void 0 ? "normal" : _f;
|
|
@@ -6896,5 +6932,5 @@ var ToastProvider = forwardRef$1(function (_a, ref) {
|
|
|
6896
6932
|
renderToast()));
|
|
6897
6933
|
});
|
|
6898
6934
|
|
|
6899
|
-
export { ActivityIndicator, Avatar, Badge, index$3 as Button, index$2 as ButtonIcon, CONSTANTS, Checkbox, ChipBar, CountingDot, DarkTheme, DefaultTheme, index$1 as FloatingButton, Image$1 as Image, LightTheme, ProgressBar, RadioButton, SearchInput, index as SelectionField, Spacer, Switch, Text$1 as Text, TextInput, ThemeColors, ThemeProvider, Toast, ToastProvider, View, adaptNavigationTheme, configureFonts, overlay, shadow, showToast, toastRef, useTheme };
|
|
6935
|
+
export { ActivityIndicator, Avatar, Badge, index$3 as Button, index$2 as ButtonIcon, 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 };
|
|
6900
6936
|
//# sourceMappingURL=index.esm.js.map
|