sapo-components-ui-rn 1.0.24 → 1.0.25
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 +101 -59
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +101 -58
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- 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",
|
|
@@ -2483,7 +2483,7 @@ var TextInputAffix = function (_a) {
|
|
|
2483
2483
|
var textColor = getTextColor({ theme: theme, disabled: disabled });
|
|
2484
2484
|
var content = (React__default.createElement(Text$2, { maxFontSizeMultiplier: maxFontSizeMultiplier, style: [{ color: textColor }, textStyle, labelStyle], onLayout: onTextLayout, testID: "".concat(testID, "-text") }, text));
|
|
2485
2485
|
return (React__default.createElement(Animated.View, { style: [
|
|
2486
|
-
styles$
|
|
2486
|
+
styles$g.container,
|
|
2487
2487
|
style,
|
|
2488
2488
|
{
|
|
2489
2489
|
opacity: (visible === null || visible === void 0 ? void 0 : visible.interpolate({
|
|
@@ -2494,7 +2494,7 @@ var TextInputAffix = function (_a) {
|
|
|
2494
2494
|
], onLayout: onLayout, testID: testID }, onPress ? (React__default.createElement(Pressable, { onPress: onPress, accessibilityRole: "button", accessibilityLabel: accessibilityLabel }, content)) : (content)));
|
|
2495
2495
|
};
|
|
2496
2496
|
TextInputAffix.displayName = "TextInput.Affix";
|
|
2497
|
-
var styles$
|
|
2497
|
+
var styles$g = StyleSheet.create({
|
|
2498
2498
|
container: {
|
|
2499
2499
|
position: "absolute",
|
|
2500
2500
|
justifyContent: "center",
|
|
@@ -2552,13 +2552,13 @@ var AnimatedText = forwardRef(function AnimatedText(_a, ref) {
|
|
|
2552
2552
|
}
|
|
2553
2553
|
return (React$3.createElement(Animated.Text, __assign({ ref: ref }, rest, { style: [
|
|
2554
2554
|
font,
|
|
2555
|
-
styles$
|
|
2555
|
+
styles$f.text,
|
|
2556
2556
|
{ writingDirection: writingDirection, color: theme.colors.backgroundPrimary },
|
|
2557
2557
|
style,
|
|
2558
2558
|
] })));
|
|
2559
2559
|
}
|
|
2560
2560
|
});
|
|
2561
|
-
var styles$
|
|
2561
|
+
var styles$f = StyleSheet.create({
|
|
2562
2562
|
text: {
|
|
2563
2563
|
textAlign: "left",
|
|
2564
2564
|
},
|
|
@@ -2629,7 +2629,7 @@ var InputLabel = function (props) {
|
|
|
2629
2629
|
return (
|
|
2630
2630
|
// Position colored placeholder and gray placeholder on top of each other and crossfade them
|
|
2631
2631
|
// 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$
|
|
2632
|
+
React__default.createElement(View$1, { pointerEvents: "none", style: [StyleSheet.absoluteFill, styles$e.overflow, styles$e.labelContainer] },
|
|
2633
2633
|
React__default.createElement(Animated.View, { pointerEvents: "none", style: [
|
|
2634
2634
|
StyleSheet.absoluteFill,
|
|
2635
2635
|
Platform.OS !== "web" && { width: width },
|
|
@@ -2667,7 +2667,7 @@ var InputLabel = function (props) {
|
|
|
2667
2667
|
},
|
|
2668
2668
|
], numberOfLines: 1, maxFontSizeMultiplier: maxFontSizeMultiplier, testID: "".concat(testID, "-label-inactive") }, label)))));
|
|
2669
2669
|
};
|
|
2670
|
-
var styles$
|
|
2670
|
+
var styles$e = StyleSheet.create({
|
|
2671
2671
|
overflow: {
|
|
2672
2672
|
overflow: "hidden",
|
|
2673
2673
|
},
|
|
@@ -2680,8 +2680,8 @@ var InputLabel$1 = React__default.memo(InputLabel);
|
|
|
2680
2680
|
var Outline = function (_a) {
|
|
2681
2681
|
var label = _a.label; _a.activeColor; _a.backgroundColor; _a.hasActiveOutline; _a.focused; _a.outlineColor; _a.roundness; var style = _a.style;
|
|
2682
2682
|
return (React$3.createElement(View$1, { testID: "text-input-outline", pointerEvents: "none", style: [
|
|
2683
|
-
styles$
|
|
2684
|
-
!label && styles$
|
|
2683
|
+
styles$d.outline,
|
|
2684
|
+
!label && styles$d.noLabelOutline,
|
|
2685
2685
|
// eslint-disable-next-line react-native/no-inline-styles
|
|
2686
2686
|
{
|
|
2687
2687
|
// backgroundColor,
|
|
@@ -2692,7 +2692,7 @@ var Outline = function (_a) {
|
|
|
2692
2692
|
style,
|
|
2693
2693
|
] }));
|
|
2694
2694
|
};
|
|
2695
|
-
var styles$
|
|
2695
|
+
var styles$d = StyleSheet.create({
|
|
2696
2696
|
outline: {
|
|
2697
2697
|
position: "absolute",
|
|
2698
2698
|
left: 0,
|
|
@@ -2889,7 +2889,7 @@ var TextInputFlat = function (_a) {
|
|
|
2889
2889
|
label: label,
|
|
2890
2890
|
scale: fontScale,
|
|
2891
2891
|
isAndroid: isAndroid,
|
|
2892
|
-
styles: StyleSheet.flatten(dense ? styles$
|
|
2892
|
+
styles: StyleSheet.flatten(dense ? styles$c.inputFlatDense : styles$c.inputFlat),
|
|
2893
2893
|
};
|
|
2894
2894
|
var pad = calculatePadding(paddingSettings);
|
|
2895
2895
|
adjustPaddingFlat(__assign(__assign({}, paddingSettings), { pad: pad }));
|
|
@@ -2915,7 +2915,7 @@ var TextInputFlat = function (_a) {
|
|
|
2915
2915
|
onLabelTextLayout: onLabelTextLayout,
|
|
2916
2916
|
placeholderOpacity: placeholderOpacity,
|
|
2917
2917
|
labelError: error,
|
|
2918
|
-
placeholderStyle: styles$
|
|
2918
|
+
placeholderStyle: styles$c.placeholder,
|
|
2919
2919
|
baseLabelTranslateY: baseLabelTranslateY,
|
|
2920
2920
|
baseLabelTranslateX: baseLabelTranslateX,
|
|
2921
2921
|
font: font,
|
|
@@ -2978,7 +2978,7 @@ var TextInputFlat = function (_a) {
|
|
|
2978
2978
|
left ? (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 })) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 }))),
|
|
2979
2979
|
React$3.createElement(Outline, { style: outlineStyle, label: label, roundness: roundness, hasActiveOutline: hasActiveOutline, focused: parentState.focused, activeColor: activeColor, outlineColor: outlineColor, backgroundColor: backgroundColor }),
|
|
2980
2980
|
React$3.createElement(View$1, { onLayout: onInputLayout, style: [
|
|
2981
|
-
styles$
|
|
2981
|
+
styles$c.labelContainer,
|
|
2982
2982
|
{
|
|
2983
2983
|
minHeight: minHeight,
|
|
2984
2984
|
flex: 1,
|
|
@@ -2986,7 +2986,7 @@ var TextInputFlat = function (_a) {
|
|
|
2986
2986
|
] },
|
|
2987
2987
|
!isAndroid && multiline && !!label && !disabled && (React$3.createElement(View$1, { pointerEvents: "none", style: [
|
|
2988
2988
|
StyleSheet.absoluteFill,
|
|
2989
|
-
dense ? styles$
|
|
2989
|
+
dense ? styles$c.densePatchContainer : styles$c.patchContainer,
|
|
2990
2990
|
{
|
|
2991
2991
|
backgroundColor: viewStyle.backgroundColor || containerStyle.backgroundColor,
|
|
2992
2992
|
left: paddingLeft,
|
|
@@ -2995,7 +2995,7 @@ var TextInputFlat = function (_a) {
|
|
|
2995
2995
|
] })),
|
|
2996
2996
|
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
2997
|
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$
|
|
2998
|
+
styles$c.input,
|
|
2999
2999
|
__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
3000
|
? textAlign
|
|
3001
3001
|
: I18nManager.getConstants().isRTL
|
|
@@ -3004,13 +3004,13 @@ var TextInputFlat = function (_a) {
|
|
|
3004
3004
|
Platform.OS === "web" && { outline: "none" },
|
|
3005
3005
|
contentStyle,
|
|
3006
3006
|
] }))),
|
|
3007
|
-
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$
|
|
3007
|
+
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$c.clearButton },
|
|
3008
3008
|
React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
|
|
3009
3009
|
React$3.createElement(View$1, { style: { flexDirection: "row" } },
|
|
3010
3010
|
right && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
|
|
3011
3011
|
right && (React$3.createElement(View$1, { style: { paddingRight: CONSTANTS.SPACE_12 } }, right)))));
|
|
3012
3012
|
};
|
|
3013
|
-
var styles$
|
|
3013
|
+
var styles$c = StyleSheet.create({
|
|
3014
3014
|
placeholder: {
|
|
3015
3015
|
position: "absolute",
|
|
3016
3016
|
left: 0,
|
|
@@ -5637,7 +5637,7 @@ var TextInputDefault = function (_a) {
|
|
|
5637
5637
|
? rest.placeholder
|
|
5638
5638
|
: label
|
|
5639
5639
|
: 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$
|
|
5640
|
+
styles$b.input,
|
|
5641
5641
|
__assign(__assign({}, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
|
|
5642
5642
|
? textAlign
|
|
5643
5643
|
: I18nManager.getConstants().isRTL
|
|
@@ -5649,12 +5649,12 @@ var TextInputDefault = function (_a) {
|
|
|
5649
5649
|
: CONSTANTS.SPACE_4 }),
|
|
5650
5650
|
contentStyle,
|
|
5651
5651
|
] }))),
|
|
5652
|
-
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$
|
|
5652
|
+
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$b.clearButtonMultiline : styles$b.clearButton },
|
|
5653
5653
|
React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
|
|
5654
5654
|
right && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
|
|
5655
5655
|
right && React$3.createElement(View, { paddingRight: CONSTANTS.SPACE_12 }, right))));
|
|
5656
5656
|
};
|
|
5657
|
-
var styles$
|
|
5657
|
+
var styles$b = StyleSheet.create({
|
|
5658
5658
|
input: {
|
|
5659
5659
|
margin: 0,
|
|
5660
5660
|
flex: 1,
|
|
@@ -5943,7 +5943,7 @@ var Button = function (_a) {
|
|
|
5943
5943
|
var renderButtonStyle = function () {
|
|
5944
5944
|
switch (mode) {
|
|
5945
5945
|
case "outlined":
|
|
5946
|
-
return [styles$
|
|
5946
|
+
return [styles$a.border, { borderColor: colors.borderBrandDefault }];
|
|
5947
5947
|
case "contained":
|
|
5948
5948
|
return [{ backgroundColor: colors.surfaceBrandDefault }];
|
|
5949
5949
|
case "transparent":
|
|
@@ -5966,7 +5966,7 @@ var Button = function (_a) {
|
|
|
5966
5966
|
return (React__default.createElement(View, { row: !full },
|
|
5967
5967
|
React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
|
|
5968
5968
|
React__default.createElement(View, { style: [
|
|
5969
|
-
styles$
|
|
5969
|
+
styles$a.button,
|
|
5970
5970
|
{
|
|
5971
5971
|
borderRadius: CONSTANTS.BORDER_RADIUS_6,
|
|
5972
5972
|
},
|
|
@@ -5976,9 +5976,9 @@ var Button = function (_a) {
|
|
|
5976
5976
|
borderColor && { borderColor: borderColor },
|
|
5977
5977
|
backgroundColor && { backgroundColor: backgroundColor },
|
|
5978
5978
|
renderButtonStyle(),
|
|
5979
|
-
small && styles$
|
|
5979
|
+
small && styles$a.small,
|
|
5980
5980
|
disabled && [
|
|
5981
|
-
styles$
|
|
5981
|
+
styles$a.disabled,
|
|
5982
5982
|
{
|
|
5983
5983
|
borderColor: colors.borderPrimaryDisabled,
|
|
5984
5984
|
backgroundColor: colors.surfacePrimaryDisabled,
|
|
@@ -5995,7 +5995,7 @@ var Button = function (_a) {
|
|
|
5995
5995
|
!isLoading && right,
|
|
5996
5996
|
React__default.createElement(Spacer, { width: right ? CONSTANTS.SPACE_12 : CONSTANTS.SPACE_16 })))));
|
|
5997
5997
|
};
|
|
5998
|
-
var styles$
|
|
5998
|
+
var styles$a = StyleSheet.create({
|
|
5999
5999
|
disabled: { opacity: 0.6 },
|
|
6000
6000
|
button: {
|
|
6001
6001
|
height: CONSTANTS.BUTTON_HEIGHT,
|
|
@@ -6019,7 +6019,7 @@ var ButtonIcon = function (_a) {
|
|
|
6019
6019
|
var colors = useInternalTheme().colors;
|
|
6020
6020
|
return (React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
|
|
6021
6021
|
React__default.createElement(View, __assign({ style: [
|
|
6022
|
-
styles$
|
|
6022
|
+
styles$9.btn,
|
|
6023
6023
|
!hiddenBackground
|
|
6024
6024
|
? {
|
|
6025
6025
|
backgroundColor: backgroundColor || colors.surfaceBrandDefault,
|
|
@@ -6046,7 +6046,7 @@ var ButtonIcon = function (_a) {
|
|
|
6046
6046
|
style,
|
|
6047
6047
|
] }, props), isLoading ? React__default.createElement(ActivityIndicator$1, { size: "small" }) : children)));
|
|
6048
6048
|
};
|
|
6049
|
-
var styles$
|
|
6049
|
+
var styles$9 = StyleSheet.create({
|
|
6050
6050
|
btn: {
|
|
6051
6051
|
justifyContent: "center",
|
|
6052
6052
|
alignItems: "center",
|
|
@@ -6074,7 +6074,7 @@ var FloatingButton = function (_a) {
|
|
|
6074
6074
|
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
6075
|
var colors = useInternalTheme().colors;
|
|
6076
6076
|
return (React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading, style: [
|
|
6077
|
-
styles$
|
|
6077
|
+
styles$8.btn,
|
|
6078
6078
|
top > 0 && { top: top },
|
|
6079
6079
|
right > 0 && { right: right },
|
|
6080
6080
|
left > 0 && { left: left },
|
|
@@ -6100,7 +6100,7 @@ var FloatingButton = function (_a) {
|
|
|
6100
6100
|
style,
|
|
6101
6101
|
] }, props), isLoading ? React__default.createElement(ActivityIndicator$1, { size: "small" }) : children)));
|
|
6102
6102
|
};
|
|
6103
|
-
var styles$
|
|
6103
|
+
var styles$8 = StyleSheet.create({
|
|
6104
6104
|
btn: {
|
|
6105
6105
|
position: "absolute",
|
|
6106
6106
|
},
|
|
@@ -6340,7 +6340,7 @@ var Toast = memoWithRef(function (_props, ref) {
|
|
|
6340
6340
|
}
|
|
6341
6341
|
};
|
|
6342
6342
|
return (React__default.createElement(ViewVisibleAnimated, { ref: viewVisibleAnimatedRef, autoShow: false, scaleEnable: true, style: [
|
|
6343
|
-
styles$
|
|
6343
|
+
styles$7.container,
|
|
6344
6344
|
options.position === POSITION.BOTTOM && {
|
|
6345
6345
|
bottom: bottom
|
|
6346
6346
|
? bottom + handleToastBottomHeight()
|
|
@@ -6351,7 +6351,7 @@ var Toast = memoWithRef(function (_props, ref) {
|
|
|
6351
6351
|
},
|
|
6352
6352
|
] },
|
|
6353
6353
|
React__default.createElement(View, { row: !options.title, center: !options.title, full: true, onPress: onPressToast, style: [
|
|
6354
|
-
styles$
|
|
6354
|
+
styles$7.wrapContent,
|
|
6355
6355
|
{
|
|
6356
6356
|
shadowColor: "black",
|
|
6357
6357
|
shadowOffset: {
|
|
@@ -6365,12 +6365,12 @@ var Toast = memoWithRef(function (_props, ref) {
|
|
|
6365
6365
|
] },
|
|
6366
6366
|
React__default.createElement(View, { row: true, style: { alignItems: "flex-start" } },
|
|
6367
6367
|
React__default.createElement(View, null,
|
|
6368
|
-
React__default.createElement(Image$2, { source: getSourceIcon(), style: styles$
|
|
6368
|
+
React__default.createElement(Image$2, { source: getSourceIcon(), style: styles$7.img })),
|
|
6369
6369
|
React__default.createElement(View, { full: true, paddingLeft: CONSTANTS.SPACE_8 },
|
|
6370
6370
|
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$
|
|
6371
|
+
message.toString().length > 0 && (React__default.createElement(Text$1, { color: colors.textOnFillDefault, numberOfLines: 4, style: !options.title && styles$7.wrapMess }, message)))))));
|
|
6372
6372
|
});
|
|
6373
|
-
var styles$
|
|
6373
|
+
var styles$7 = StyleSheet.create({
|
|
6374
6374
|
wrapMess: { marginLeft: CONSTANTS.SPACE_8, flex: 1 },
|
|
6375
6375
|
wrapContent: {
|
|
6376
6376
|
borderRadius: CONSTANTS.BORDER_RADIUS_12,
|
|
@@ -6589,10 +6589,10 @@ var CountingDot = function (_a) {
|
|
|
6589
6589
|
return React__default.createElement(View, { style: style }, children);
|
|
6590
6590
|
}
|
|
6591
6591
|
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$
|
|
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$6.container, style] },
|
|
6593
|
+
React__default.createElement(Text$1, { size: 10, style: [styles$6.textMedium, textStyle], color: textColor || colors.textOnFillDefault }, value))));
|
|
6594
6594
|
};
|
|
6595
|
-
var styles$
|
|
6595
|
+
var styles$6 = StyleSheet.create(__assign(__assign({}, containerStyles), { container: {
|
|
6596
6596
|
minWidth: 16,
|
|
6597
6597
|
minHeight: 16,
|
|
6598
6598
|
} }));
|
|
@@ -6622,18 +6622,18 @@ var ChipBar = function (_a) {
|
|
|
6622
6622
|
leftIcon && React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_4 }, leftIcon),
|
|
6623
6623
|
React__default.createElement(View, null,
|
|
6624
6624
|
React__default.createElement(Text$1, { numberOfLines: numberOfLines, ellipsizeMode: ellipsizeMode, color: active ? colors.textBrandDefault : colors.textDefault, style: [
|
|
6625
|
-
styles$
|
|
6626
|
-
styles$
|
|
6625
|
+
styles$5.text14,
|
|
6626
|
+
styles$5.textMedium,
|
|
6627
6627
|
disabled && {
|
|
6628
6628
|
color: colors.textSecondary,
|
|
6629
6629
|
},
|
|
6630
6630
|
textStyle,
|
|
6631
6631
|
] }, title)),
|
|
6632
6632
|
rightIcon && React__default.createElement(View, { paddingLeft: CONSTANTS.SPACE_4 }, rightIcon)),
|
|
6633
|
-
badge > 0 && (React__default.createElement(View, { style: styles$
|
|
6633
|
+
badge > 0 && (React__default.createElement(View, { style: styles$5.badgeContainer },
|
|
6634
6634
|
React__default.createElement(CountingDot, { value: badge })))));
|
|
6635
6635
|
};
|
|
6636
|
-
var styles$
|
|
6636
|
+
var styles$5 = StyleSheet.create(__assign(__assign({}, containerStyles), { badgeContainer: {
|
|
6637
6637
|
position: "absolute",
|
|
6638
6638
|
right: 0,
|
|
6639
6639
|
top: -4,
|
|
@@ -6671,14 +6671,14 @@ var Checkbox = function (_a) {
|
|
|
6671
6671
|
React__default.createElement(Icon$1, { name: isActive ? "IconCheckboxActive" : "IconCheckbox", type: "Svg", size: iconSize, color: checkboxColor }))),
|
|
6672
6672
|
React__default.createElement(View, null,
|
|
6673
6673
|
React__default.createElement(Text$1, { color: colors.textDefault, style: [
|
|
6674
|
-
styles$
|
|
6674
|
+
styles$4.text14,
|
|
6675
6675
|
disabled && {
|
|
6676
6676
|
color: colors.textSecondary,
|
|
6677
6677
|
},
|
|
6678
6678
|
textStyle,
|
|
6679
6679
|
] }, content))));
|
|
6680
6680
|
};
|
|
6681
|
-
var styles$
|
|
6681
|
+
var styles$4 = StyleSheet.create(__assign(__assign({}, containerStyles), { icon: {
|
|
6682
6682
|
width: 24,
|
|
6683
6683
|
height: 24,
|
|
6684
6684
|
} }));
|
|
@@ -6713,14 +6713,14 @@ var RadioButton = function (_a) {
|
|
|
6713
6713
|
: "IconRadio", type: "Svg", size: 24, color: getColorCheckbox }))),
|
|
6714
6714
|
React__default.createElement(View, null,
|
|
6715
6715
|
React__default.createElement(Text$1, { color: colors.textDefault, style: [
|
|
6716
|
-
styles$
|
|
6716
|
+
styles$3.text14,
|
|
6717
6717
|
disabled && {
|
|
6718
6718
|
color: colors.textSecondary,
|
|
6719
6719
|
},
|
|
6720
6720
|
textStyle,
|
|
6721
6721
|
] }, content))));
|
|
6722
6722
|
};
|
|
6723
|
-
var styles$
|
|
6723
|
+
var styles$3 = StyleSheet.create(__assign(__assign({}, containerStyles), { icon: {
|
|
6724
6724
|
width: 24,
|
|
6725
6725
|
height: 24,
|
|
6726
6726
|
} }));
|
|
@@ -6751,9 +6751,9 @@ var Avatar = function (_a) {
|
|
|
6751
6751
|
return 16;
|
|
6752
6752
|
}
|
|
6753
6753
|
};
|
|
6754
|
-
return (React__default.createElement(View, { onPress: onPress, width: size, height: size, borderRadius: size / 2, center: true, backgroundColor: backgroundColor || colors.surfaceSecondaryDefault, style: [styles$
|
|
6754
|
+
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
6755
|
};
|
|
6756
|
-
var styles$
|
|
6756
|
+
var styles$2 = StyleSheet.create({
|
|
6757
6757
|
container: {
|
|
6758
6758
|
overflow: "hidden",
|
|
6759
6759
|
},
|
|
@@ -6779,14 +6779,14 @@ var SelectionField = function (_a) {
|
|
|
6779
6779
|
return (React__default.createElement(View, null,
|
|
6780
6780
|
React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
|
|
6781
6781
|
React__default.createElement(View, { style: [
|
|
6782
|
-
styles.container,
|
|
6782
|
+
styles$1.container,
|
|
6783
6783
|
{
|
|
6784
6784
|
borderRadius: BORDER_RADIUS_6,
|
|
6785
6785
|
},
|
|
6786
|
-
[styles.border, { borderColor: colors.borderPrimaryDefault }],
|
|
6786
|
+
[styles$1.border, { borderColor: colors.borderPrimaryDefault }],
|
|
6787
6787
|
borderColor && { borderColor: borderColor },
|
|
6788
6788
|
disabled && [
|
|
6789
|
-
styles.disabled,
|
|
6789
|
+
styles$1.disabled,
|
|
6790
6790
|
{
|
|
6791
6791
|
borderColor: colors.borderPrimaryDisabled,
|
|
6792
6792
|
backgroundColor: colors.surfacePrimaryDisabled,
|
|
@@ -6803,7 +6803,7 @@ var SelectionField = function (_a) {
|
|
|
6803
6803
|
React__default.createElement(Spacer, { width: SPACE_12 }),
|
|
6804
6804
|
React__default.createElement(View, { full: true },
|
|
6805
6805
|
content.toString() !== "" && label.toString() !== "" && (React__default.createElement(Text$1, { color: labelColor || colors.textSecondary, style: [
|
|
6806
|
-
styles.text12,
|
|
6806
|
+
styles$1.text12,
|
|
6807
6807
|
disabled && {
|
|
6808
6808
|
color: colors.textPlaceholder,
|
|
6809
6809
|
},
|
|
@@ -6819,9 +6819,9 @@ var SelectionField = function (_a) {
|
|
|
6819
6819
|
right || React__default.createElement(Icon$1, { name: "IconArrowDown", type: "Svg", size: 24 }),
|
|
6820
6820
|
React__default.createElement(Spacer, { width: SPACE_12 }))),
|
|
6821
6821
|
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)))));
|
|
6822
|
+
React__default.createElement(Text$1, { style: styles$1.text12, color: colors.textErrorDefault }, error)))));
|
|
6823
6823
|
};
|
|
6824
|
-
var styles = StyleSheet.create(__assign(__assign({}, containerStyles), { disabled: { opacity: 0.6 }, container: {
|
|
6824
|
+
var styles$1 = StyleSheet.create(__assign(__assign({}, containerStyles), { disabled: { opacity: 0.6 }, container: {
|
|
6825
6825
|
minHeight: BUTTON_HEIGHT,
|
|
6826
6826
|
flexDirection: "row",
|
|
6827
6827
|
alignItems: "center",
|
|
@@ -6846,6 +6846,48 @@ var SearchInput = function (_a) {
|
|
|
6846
6846
|
};
|
|
6847
6847
|
StyleSheet.create(__assign({}, containerStyles));
|
|
6848
6848
|
|
|
6849
|
+
var Tag = function (_a) {
|
|
6850
|
+
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;
|
|
6851
|
+
var theme = useInternalTheme();
|
|
6852
|
+
var colors = theme.colors;
|
|
6853
|
+
var _j = useState(isActive), active = _j[0], setActive = _j[1];
|
|
6854
|
+
var handlePressTag = useCallback(function () {
|
|
6855
|
+
setActive(!active);
|
|
6856
|
+
onPress === null || onPress === void 0 ? void 0 : onPress();
|
|
6857
|
+
}, [active]);
|
|
6858
|
+
useEffect(function () {
|
|
6859
|
+
setActive(isActive);
|
|
6860
|
+
}, [isActive]);
|
|
6861
|
+
return (React__default.createElement(View, { row: true },
|
|
6862
|
+
React__default.createElement(View, { row: true, disabled: disabled, paddingHorizontal: CONSTANTS.SPACE_12, paddingVertical: CONSTANTS.SPACE_8, borderRadius: borderRadius, alignCenter: true, style: [
|
|
6863
|
+
disabled && {
|
|
6864
|
+
backgroundColor: colors.surfaceSecondaryDefault,
|
|
6865
|
+
borderColor: colors.surfaceSecondaryDefault,
|
|
6866
|
+
},
|
|
6867
|
+
style,
|
|
6868
|
+
], onPress: handlePressTag, backgroundColor: active
|
|
6869
|
+
? colors.surfaceBrandInversePressed
|
|
6870
|
+
: colors.surfaceBrandInverseDefault },
|
|
6871
|
+
leftIcon && React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_4 }, leftIcon),
|
|
6872
|
+
React__default.createElement(View, null,
|
|
6873
|
+
React__default.createElement(Text$1, { numberOfLines: numberOfLines, ellipsizeMode: ellipsizeMode, style: [
|
|
6874
|
+
styles.text14,
|
|
6875
|
+
styles.textMedium,
|
|
6876
|
+
disabled && {
|
|
6877
|
+
color: colors.textSecondary,
|
|
6878
|
+
},
|
|
6879
|
+
textStyle,
|
|
6880
|
+
] }, title)),
|
|
6881
|
+
rightIcon ? (React__default.createElement(View, { paddingLeft: CONSTANTS.SPACE_4 }, rightIcon)) : hideRightIcon ? (React__default.createElement(View, null)) : (React__default.createElement(View, { paddingLeft: CONSTANTS.SPACE_4 },
|
|
6882
|
+
React__default.createElement(Icon$1, { name: "IconClose", type: "Svg", size: 24, color: colors.iconBrandDefault }))))));
|
|
6883
|
+
};
|
|
6884
|
+
var styles = StyleSheet.create(__assign(__assign({}, containerStyles), { badgeContainer: {
|
|
6885
|
+
position: "absolute",
|
|
6886
|
+
right: 0,
|
|
6887
|
+
top: -4,
|
|
6888
|
+
zIndex: 999,
|
|
6889
|
+
} }));
|
|
6890
|
+
|
|
6849
6891
|
var toastRef = React__default.createRef();
|
|
6850
6892
|
var showToast = function (_a) {
|
|
6851
6893
|
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 +6938,5 @@ var ToastProvider = forwardRef$1(function (_a, ref) {
|
|
|
6896
6938
|
renderToast()));
|
|
6897
6939
|
});
|
|
6898
6940
|
|
|
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 };
|
|
6941
|
+
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
6942
|
//# sourceMappingURL=index.esm.js.map
|