sapo-components-ui-rn 1.1.2 → 1.1.3

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.
@@ -1,13 +1,20 @@
1
1
  import React from "react";
2
2
  import { StyleProp, ViewStyle, TextStyle } from "react-native";
3
+ type BadgeType = "success" | "error" | "info" | "warning" | "default";
4
+ type BadgeSize = "default" | "small" | "tiny";
5
+ type BadgeMode = "default" | "outline";
3
6
  interface BadgeProps {
4
7
  children?: React.ReactNode;
5
- value: string;
8
+ value?: string;
6
9
  borderColor?: string;
7
10
  backgroundColor?: string;
8
11
  style?: StyleProp<ViewStyle>;
9
12
  textColor?: string;
10
13
  textStyle?: StyleProp<TextStyle>;
14
+ type?: BadgeType;
15
+ badgeSize?: BadgeSize;
16
+ mode?: BadgeMode;
17
+ textSize?: number;
11
18
  }
12
- declare const Badge: ({ children, value, borderColor, backgroundColor, style, textColor, textStyle, }: BadgeProps) => React.JSX.Element;
19
+ declare const Badge: React.NamedExoticComponent<BadgeProps>;
13
20
  export default Badge;
package/dist/index.esm.js CHANGED
@@ -1801,7 +1801,7 @@ var Switch = memo(function (_a) {
1801
1801
  return (React$3.createElement(View, { row: true },
1802
1802
  React$3.createElement(TouchableOpacity, { activeOpacity: 1, onPress: handleSwitch, disabled: disabled, style: disabled ? { opacity: 0.6 } : {} },
1803
1803
  React$3.createElement(Animated.View, { style: [
1804
- styles$i.vSegment,
1804
+ styles$j.vSegment,
1805
1805
  backgroundColor,
1806
1806
  {
1807
1807
  width: 52,
@@ -1809,7 +1809,7 @@ var Switch = memo(function (_a) {
1809
1809
  },
1810
1810
  ] },
1811
1811
  React$3.createElement(Animated.View, { style: [
1812
- styles$i.animated,
1812
+ styles$j.animated,
1813
1813
  animatedStyle,
1814
1814
  {
1815
1815
  width: 28,
@@ -1819,7 +1819,7 @@ var Switch = memo(function (_a) {
1819
1819
  },
1820
1820
  ] })))));
1821
1821
  });
1822
- var styles$i = StyleSheet.create({
1822
+ var styles$j = StyleSheet.create({
1823
1823
  vSegment: {
1824
1824
  overflow: "hidden",
1825
1825
  borderRadius: 100,
@@ -2195,7 +2195,7 @@ var TextInputAffix = function (_a) {
2195
2195
  var textColor = getTextColor({ theme: theme, disabled: disabled });
2196
2196
  var content = (React__default.createElement(Text$2, { maxFontSizeMultiplier: maxFontSizeMultiplier, style: [{ color: textColor }, textStyle, labelStyle], onLayout: onTextLayout, testID: "".concat(testID, "-text") }, text));
2197
2197
  return (React__default.createElement(Animated$1.View, { style: [
2198
- styles$h.container,
2198
+ styles$i.container,
2199
2199
  style,
2200
2200
  {
2201
2201
  opacity: (visible === null || visible === void 0 ? void 0 : visible.interpolate({
@@ -2206,7 +2206,7 @@ var TextInputAffix = function (_a) {
2206
2206
  ], onLayout: onLayout, testID: testID }, onPress ? (React__default.createElement(Pressable, { onPress: onPress, accessibilityRole: "button", accessibilityLabel: accessibilityLabel }, content)) : (content)));
2207
2207
  };
2208
2208
  TextInputAffix.displayName = "TextInput.Affix";
2209
- var styles$h = StyleSheet.create({
2209
+ var styles$i = StyleSheet.create({
2210
2210
  container: {
2211
2211
  position: "absolute",
2212
2212
  justifyContent: "center",
@@ -2264,13 +2264,13 @@ var AnimatedText = forwardRef(function AnimatedText(_a, ref) {
2264
2264
  }
2265
2265
  return (React$3.createElement(Animated$1.Text, __assign({ ref: ref }, rest, { style: [
2266
2266
  font,
2267
- styles$g.text,
2267
+ styles$h.text,
2268
2268
  { writingDirection: writingDirection, color: theme.colors.backgroundPrimary },
2269
2269
  style,
2270
2270
  ] })));
2271
2271
  }
2272
2272
  });
2273
- var styles$g = StyleSheet.create({
2273
+ var styles$h = StyleSheet.create({
2274
2274
  text: {
2275
2275
  textAlign: "left",
2276
2276
  },
@@ -4852,7 +4852,7 @@ var InputLabel = function (props) {
4852
4852
  return (
4853
4853
  // Position colored placeholder and gray placeholder on top of each other and crossfade them
4854
4854
  // This gives the effect of animating the color, but allows us to use native driver
4855
- React__default.createElement(View$1, { pointerEvents: "none", style: [StyleSheet.absoluteFill, styles$f.overflow, styles$f.labelContainer] },
4855
+ React__default.createElement(View$1, { pointerEvents: "none", style: [StyleSheet.absoluteFill, styles$g.overflow, styles$g.labelContainer] },
4856
4856
  React__default.createElement(Animated$1.View, { pointerEvents: "none", style: [
4857
4857
  StyleSheet.absoluteFill,
4858
4858
  Platform.OS !== "web" && { width: width },
@@ -4894,7 +4894,7 @@ var InputLabel = function (props) {
4894
4894
  label,
4895
4895
  required && React__default.createElement(Text$1, { color: theme.colors.textErrorDefault }, " *"))))));
4896
4896
  };
4897
- var styles$f = StyleSheet.create({
4897
+ var styles$g = StyleSheet.create({
4898
4898
  overflow: {
4899
4899
  overflow: "hidden",
4900
4900
  },
@@ -4907,8 +4907,8 @@ var InputLabel$1 = React__default.memo(InputLabel);
4907
4907
  var Outline = function (_a) {
4908
4908
  var label = _a.label; _a.activeColor; _a.backgroundColor; _a.hasActiveOutline; _a.focused; _a.outlineColor; _a.roundness; var style = _a.style;
4909
4909
  return (React$3.createElement(View$1, { testID: "text-input-outline", pointerEvents: "none", style: [
4910
- styles$e.outline,
4911
- !label && styles$e.noLabelOutline,
4910
+ styles$f.outline,
4911
+ !label && styles$f.noLabelOutline,
4912
4912
  // eslint-disable-next-line react-native/no-inline-styles
4913
4913
  {
4914
4914
  // backgroundColor,
@@ -4919,7 +4919,7 @@ var Outline = function (_a) {
4919
4919
  style,
4920
4920
  ] }));
4921
4921
  };
4922
- var styles$e = StyleSheet.create({
4922
+ var styles$f = StyleSheet.create({
4923
4923
  outline: {
4924
4924
  position: "absolute",
4925
4925
  left: 0,
@@ -5198,7 +5198,7 @@ var TextInputFlat = function (_a) {
5198
5198
  label: label,
5199
5199
  scale: fontScale,
5200
5200
  isAndroid: isAndroid,
5201
- styles: StyleSheet.flatten(dense ? styles$d.inputFlatDense : styles$d.inputFlat),
5201
+ styles: StyleSheet.flatten(dense ? styles$e.inputFlatDense : styles$e.inputFlat),
5202
5202
  };
5203
5203
  var pad = calculatePadding(paddingSettings);
5204
5204
  adjustPaddingFlat(__assign(__assign({}, paddingSettings), { pad: pad }));
@@ -5224,7 +5224,7 @@ var TextInputFlat = function (_a) {
5224
5224
  onLabelTextLayout: onLabelTextLayout,
5225
5225
  placeholderOpacity: placeholderOpacity,
5226
5226
  labelError: error,
5227
- placeholderStyle: styles$d.placeholder,
5227
+ placeholderStyle: styles$e.placeholder,
5228
5228
  baseLabelTranslateY: baseLabelTranslateY,
5229
5229
  baseLabelTranslateX: baseLabelTranslateX,
5230
5230
  font: font,
@@ -5343,7 +5343,7 @@ var TextInputFlat = function (_a) {
5343
5343
  left ? React$3.createElement(Spacer, { width: SPACE_8 }) : React$3.createElement(Spacer, { width: SPACE_12 })),
5344
5344
  React$3.createElement(Outline, { style: outlineStyle, label: label, roundness: roundness, hasActiveOutline: hasActiveOutline, focused: parentState.focused, activeColor: activeColor, outlineColor: outlineColor, backgroundColor: backgroundColor }),
5345
5345
  React$3.createElement(View$1, { onLayout: onInputLayout, style: [
5346
- styles$d.labelContainer,
5346
+ styles$e.labelContainer,
5347
5347
  {
5348
5348
  minHeight: minHeight,
5349
5349
  flex: 1,
@@ -5356,12 +5356,12 @@ var TextInputFlat = function (_a) {
5356
5356
  (prefix === null || prefix === void 0 ? void 0 : prefix.toString()) !== "" &&
5357
5357
  renderPrefix(), render === null || render === void 0 ? void 0 :
5358
5358
  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: [
5359
- styles$d.input,
5359
+ styles$e.input,
5360
5360
  __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", marginTop: Platform.OS === "android" ? SPACE_8 : SPACE_2 }),
5361
5361
  contentStyle,
5362
5362
  ] })),
5363
5363
  renderSuffix())),
5364
- parentState.focused && !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$d.clearButton },
5364
+ parentState.focused && !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$e.clearButton },
5365
5365
  React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: SPACE_12 })),
5366
5366
  checkLineRightAction() && (React$3.createElement(Spacer, { width: 1, height: 24, backgroundColor: theme.colors.borderPrimaryDefault, style: {
5367
5367
  marginRight: SPACE_8,
@@ -5376,10 +5376,10 @@ var TextInputFlat = function (_a) {
5376
5376
  right && (React$3.createElement(View$1, { style: {
5377
5377
  paddingRight: SPACE_12,
5378
5378
  } }, right)))),
5379
- error && (textError === null || textError === void 0 ? void 0 : textError.toString()) !== "" && (React$3.createElement(View$1, { style: styles$d.vError },
5379
+ error && (textError === null || textError === void 0 ? void 0 : textError.toString()) !== "" && (React$3.createElement(View$1, { style: styles$e.vError },
5380
5380
  React$3.createElement(Text$1, { size: 12, numberOfLines: 1, color: theme.colors.textErrorDefault }, textError)))));
5381
5381
  };
5382
- var styles$d = StyleSheet.create({
5382
+ var styles$e = StyleSheet.create({
5383
5383
  placeholder: {
5384
5384
  position: "absolute",
5385
5385
  left: 0,
@@ -5585,7 +5585,7 @@ var TextInputDefault = function (_a) {
5585
5585
  ? rest.placeholder
5586
5586
  : label
5587
5587
  : rest.placeholder, editable: !disabled && editable, selectionColor: selectionColor, cursorColor: typeof cursorColor === "undefined" ? activeColor : cursorColor, placeholderTextColor: placeholderTextColorBasedOnState, onFocus: onFocus, onBlur: onBlur, underlineColorAndroid: "transparent", multiline: multiline, style: [
5588
- styles$c.input,
5588
+ styles$d.input,
5589
5589
  __assign(__assign({}, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
5590
5590
  ? textAlign
5591
5591
  : I18nManager.getConstants().isRTL
@@ -5606,12 +5606,12 @@ var TextInputDefault = function (_a) {
5606
5606
  : rest.placeholder, editable: !disabled && editable, selectionColor: selectionColor, cursorColor: typeof cursorColor === "undefined"
5607
5607
  ? activeColor
5608
5608
  : cursorColor, placeholderTextColor: placeholderTextColorBasedOnState, onFocus: onFocus, onBlur: onBlur, underlineColorAndroid: "transparent", multiline: multiline, style: [
5609
- styles$c.input,
5609
+ styles$d.input,
5610
5610
  __assign(__assign({}, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", height: height ? height : 48, paddingTop: getPaddingTopValue(), paddingBottom: multiline ? CONSTANTS.SPACE_4 : 0 }),
5611
5611
  contentStyle,
5612
5612
  ] })),
5613
5613
  !multiline && renderSuffix()))),
5614
- parentState.focused && !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$c.clearButtonMultiline : styles$c.clearButton },
5614
+ parentState.focused && !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$d.clearButtonMultiline : styles$d.clearButton },
5615
5615
  React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
5616
5616
  checkLineRightAction() && (React$3.createElement(Spacer, { width: 1, height: 24, backgroundColor: colors.borderPrimaryDefault, style: {
5617
5617
  marginRight: CONSTANTS.SPACE_8,
@@ -5621,10 +5621,10 @@ var TextInputDefault = function (_a) {
5621
5621
  paddingRight: CONSTANTS.SPACE_12,
5622
5622
  paddingTop: multiline ? CONSTANTS.SPACE_12 : 0,
5623
5623
  } }, right))),
5624
- error && (textError === null || textError === void 0 ? void 0 : textError.toString()) !== "" && (React$3.createElement(View, { style: styles$c.vError },
5624
+ error && (textError === null || textError === void 0 ? void 0 : textError.toString()) !== "" && (React$3.createElement(View, { style: styles$d.vError },
5625
5625
  React$3.createElement(Text$1, { size: 12, numberOfLines: 1, color: theme.colors.textErrorDefault }, textError)))));
5626
5626
  };
5627
- var styles$c = StyleSheet.create({
5627
+ var styles$d = StyleSheet.create({
5628
5628
  input: {
5629
5629
  margin: 0,
5630
5630
  flex: 1,
@@ -5826,12 +5826,12 @@ var TextInputNumber = function (_a) {
5826
5826
  return (React__default.createElement(View, null,
5827
5827
  React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onShowModalKeyboard }, props, { disabled: disabled || false }),
5828
5828
  React__default.createElement(View, { style: [
5829
- styles$b.container,
5829
+ styles$c.container,
5830
5830
  {
5831
5831
  borderRadius: BORDER_RADIUS_6,
5832
5832
  },
5833
5833
  [
5834
- styles$b.border,
5834
+ styles$c.border,
5835
5835
  {
5836
5836
  borderColor: isShowModalKeyboard
5837
5837
  ? colors.borderBrandDefault
@@ -5845,7 +5845,7 @@ var TextInputNumber = function (_a) {
5845
5845
  },
5846
5846
  ],
5847
5847
  disabled && [
5848
- styles$b.disabled,
5848
+ styles$c.disabled,
5849
5849
  {
5850
5850
  borderColor: colors.borderPrimaryDisabled,
5851
5851
  backgroundColor: colors.surfacePrimaryDisabled,
@@ -5887,51 +5887,51 @@ var TextInputNumber = function (_a) {
5887
5887
  !disabled && textError.length > 0 && (React__default.createElement(View, { paddingHorizontal: SPACE_12, paddingVertical: SPACE_4 },
5888
5888
  React__default.createElement(Text$1, { size: 12, numberOfLines: 1, color: theme.colors.textErrorDefault }, textError))),
5889
5889
  React__default.createElement(Modal, { visible: isShowModalKeyboard, transparent: true, animationType: "fade", onRequestClose: onCloseModalKeyboard },
5890
- React__default.createElement(TouchableOpacity, { style: styles$b.modalOverlay, activeOpacity: 1, onPress: onCloseModalKeyboard },
5891
- React__default.createElement(View, { onPress: function () { }, activeOpacity: 1, backgroundColor: colors.surfacePrimaryDefault, style: styles$b.modalContent },
5892
- React__default.createElement(Text$1, { style: [styles$b.modalTitle, styles$b.text18] }, label),
5890
+ React__default.createElement(TouchableOpacity, { style: styles$c.modalOverlay, activeOpacity: 1, onPress: onCloseModalKeyboard },
5891
+ React__default.createElement(View, { onPress: function () { }, activeOpacity: 1, backgroundColor: colors.surfacePrimaryDefault, style: styles$c.modalContent },
5892
+ React__default.createElement(Text$1, { style: [styles$c.modalTitle, styles$c.text18] }, label),
5893
5893
  React__default.createElement(View, { width: "100%" },
5894
5894
  React__default.createElement(View, { paddingHorizontal: SPACE_40 },
5895
- React__default.createElement(Text$1, { numberOfLines: 1, style: [styles$b.text30, styles$b.valueText] }, formatNumberInput$1(inputValue, formatDecimal) || "0")),
5896
- React__default.createElement(TouchableOpacity, { onPress: handleClear, style: styles$b.clearButton },
5895
+ React__default.createElement(Text$1, { numberOfLines: 1, style: [styles$c.text30, styles$c.valueText] }, formatNumberInput$1(inputValue, formatDecimal) || "0")),
5896
+ React__default.createElement(TouchableOpacity, { onPress: handleClear, style: styles$c.clearButton },
5897
5897
  React__default.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24, color: colors.textSecondary }))),
5898
- React__default.createElement(View, { style: styles$b.keyboardGrid }, [
5898
+ React__default.createElement(View, { style: styles$c.keyboardGrid }, [
5899
5899
  ["1", "2", "3"],
5900
5900
  ["4", "5", "6"],
5901
5901
  ["7", "8", "9"],
5902
5902
  [type === "integer" ? "000" : ".", "0", "del"],
5903
- ].map(function (row, rowIndex) { return (React__default.createElement(View, { key: rowIndex, style: styles$b.keyboardRow }, row.map(function (key) { return (React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, key: key, style: [
5904
- styles$b.keyButton,
5905
- key === "000" && type === "float" && styles$b.disabledKey,
5903
+ ].map(function (row, rowIndex) { return (React__default.createElement(View, { key: rowIndex, style: styles$c.keyboardRow }, row.map(function (key) { return (React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, key: key, style: [
5904
+ styles$c.keyButton,
5905
+ key === "000" && type === "float" && styles$c.disabledKey,
5906
5906
  key === "." &&
5907
5907
  inputValue.includes(".") &&
5908
- styles$b.disabledKey,
5908
+ styles$c.disabledKey,
5909
5909
  ], onPress: function () { return handleKeyPress(key); }, disabled: (key === "000" && type === "float") ||
5910
5910
  (key === "." && inputValue.includes(".")) }, key === "del" ? (React__default.createElement(Icon$1, { name: "IconDelNumber", type: "Svg", size: 24 })) : (React__default.createElement(Text$1, { style: [
5911
- styles$b.keyText,
5912
- styles$b.text22,
5911
+ styles$c.keyText,
5912
+ styles$c.text22,
5913
5913
  key === "000" &&
5914
5914
  type === "float" &&
5915
- styles$b.disabledKeyText,
5915
+ styles$c.disabledKeyText,
5916
5916
  key === "." &&
5917
5917
  inputValue.includes(".") &&
5918
- styles$b.disabledKeyText,
5918
+ styles$c.disabledKeyText,
5919
5919
  ] }, key)))); }))); })),
5920
- React__default.createElement(View, { style: styles$b.actionRow },
5921
- React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, style: styles$b.actionButton, onPress: onCloseModalKeyboard },
5922
- React__default.createElement(Text$1, { style: [styles$b.actionText, styles$b.text16] }, "\u0110\u00F3ng")),
5920
+ React__default.createElement(View, { style: styles$c.actionRow },
5921
+ React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, style: styles$c.actionButton, onPress: onCloseModalKeyboard },
5922
+ React__default.createElement(Text$1, { style: [styles$c.actionText, styles$c.text16] }, "\u0110\u00F3ng")),
5923
5923
  React__default.createElement(Spacer, { style: {
5924
5924
  height: "100%",
5925
5925
  }, width: 1, backgroundColor: colors.borderPrimaryDefault }),
5926
- React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, style: [styles$b.actionButton, !canSave && { opacity: 0.5 }], onPress: handleSave, disabled: !canSave },
5926
+ React__default.createElement(TouchableOpacity, { activeOpacity: 0.8, style: [styles$c.actionButton, !canSave && { opacity: 0.5 }], onPress: handleSave, disabled: !canSave },
5927
5927
  React__default.createElement(Text$1, { style: [
5928
- styles$b.actionText,
5929
- styles$b.text16,
5928
+ styles$c.actionText,
5929
+ styles$c.text16,
5930
5930
  { color: colors.textBrandDefault },
5931
5931
  !canSave && { color: colors.textSecondary },
5932
5932
  ] }, "L\u01B0u"))))))));
5933
5933
  };
5934
- var styles$b = StyleSheet.create(__assign(__assign({}, containerStyles), { disabled: { opacity: 0.6 }, container: {
5934
+ var styles$c = StyleSheet.create(__assign(__assign({}, containerStyles), { disabled: { opacity: 0.6 }, container: {
5935
5935
  height: 48,
5936
5936
  flexDirection: "row",
5937
5937
  alignItems: "center",
@@ -6261,7 +6261,7 @@ var Button = function (_a) {
6261
6261
  switch (mode) {
6262
6262
  case "outlined":
6263
6263
  return [
6264
- styles$a.border,
6264
+ styles$b.border,
6265
6265
  { borderColor: colors.borderBrandDefault },
6266
6266
  critical && {
6267
6267
  backgroundColor: colors.surfacePrimaryDefault,
@@ -6312,8 +6312,8 @@ var Button = function (_a) {
6312
6312
  borderRadius: CONSTANTS.BORDER_RADIUS_6,
6313
6313
  paddingHorizontal: 0,
6314
6314
  },
6315
- styles$a.small,
6316
- disabled && !isLoading && [styles$a.disabled],
6315
+ styles$b.small,
6316
+ disabled && !isLoading && [styles$b.disabled],
6317
6317
  isLoading && { justifyContent: "center" },
6318
6318
  style,
6319
6319
  ], disabled: isLoading }, isLoading ? (React__default.createElement(ActivityIndicator, { color: (textStyle === null || textStyle === void 0 ? void 0 : textStyle.color) || colors.textBrandDefault })) : (React__default.createElement(View, { row: true },
@@ -6326,7 +6326,7 @@ var Button = function (_a) {
6326
6326
  return (React__default.createElement(View, { row: !full },
6327
6327
  React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading }),
6328
6328
  React__default.createElement(View, { width: width, margin: margin, style: [
6329
- styles$a.button,
6329
+ styles$b.button,
6330
6330
  {
6331
6331
  borderRadius: CONSTANTS.BORDER_RADIUS_6,
6332
6332
  },
@@ -6336,10 +6336,10 @@ var Button = function (_a) {
6336
6336
  borderColor && { borderColor: borderColor },
6337
6337
  backgroundColor && { backgroundColor: backgroundColor },
6338
6338
  renderButtonStyle(),
6339
- buttonSize === "small" && styles$a.small,
6339
+ buttonSize === "small" && styles$b.small,
6340
6340
  disabled &&
6341
6341
  !isLoading && [
6342
- styles$a.disabled,
6342
+ styles$b.disabled,
6343
6343
  {
6344
6344
  borderColor: colors.borderPrimaryDisabled,
6345
6345
  backgroundColor: colors.surfacePrimaryDisabled,
@@ -6361,7 +6361,7 @@ var Button = function (_a) {
6361
6361
  !isLoading && right,
6362
6362
  React__default.createElement(Spacer, { width: right ? CONSTANTS.SPACE_12 : CONSTANTS.SPACE_16 })))))));
6363
6363
  };
6364
- var styles$a = StyleSheet.create({
6364
+ var styles$b = StyleSheet.create({
6365
6365
  disabled: { opacity: 0.6 },
6366
6366
  button: {
6367
6367
  height: CONSTANTS.BUTTON_HEIGHT,
@@ -6383,7 +6383,7 @@ var FloatingButton = function (_a) {
6383
6383
  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;
6384
6384
  var colors = useInternalTheme().colors;
6385
6385
  return (React__default.createElement(TouchableOpacity, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading, style: [
6386
- styles$9.btn,
6386
+ styles$a.btn,
6387
6387
  top > 0 && { top: top },
6388
6388
  right > 0 && { right: right },
6389
6389
  left > 0 && { left: left },
@@ -6409,7 +6409,7 @@ var FloatingButton = function (_a) {
6409
6409
  style,
6410
6410
  ] }, props), isLoading ? React__default.createElement(ActivityIndicator, { size: "small" }) : children)));
6411
6411
  };
6412
- var styles$9 = StyleSheet.create({
6412
+ var styles$a = StyleSheet.create({
6413
6413
  btn: {
6414
6414
  position: "absolute",
6415
6415
  },
@@ -6649,7 +6649,7 @@ var Toast = memoWithRef(function (_props, ref) {
6649
6649
  }
6650
6650
  };
6651
6651
  return (React__default.createElement(ViewVisibleAnimated, { ref: viewVisibleAnimatedRef, autoShow: false, scaleEnable: true, style: [
6652
- styles$8.container,
6652
+ styles$9.container,
6653
6653
  options.position === POSITION.BOTTOM && {
6654
6654
  bottom: bottom
6655
6655
  ? bottom + handleToastBottomHeight()
@@ -6660,7 +6660,7 @@ var Toast = memoWithRef(function (_props, ref) {
6660
6660
  },
6661
6661
  ] },
6662
6662
  React__default.createElement(View, { row: !options.title, center: !options.title, full: true, activeOpacity: 0.8, onPress: onPressToast, style: [
6663
- styles$8.wrapContent,
6663
+ styles$9.wrapContent,
6664
6664
  {
6665
6665
  shadowColor: "black",
6666
6666
  shadowOffset: {
@@ -6677,9 +6677,9 @@ var Toast = memoWithRef(function (_props, ref) {
6677
6677
  React__default.createElement(Icon$1, { name: getSourceIcon(), type: "Svg", size: 20 })),
6678
6678
  React__default.createElement(View, { full: true, paddingLeft: CONSTANTS.SPACE_8 },
6679
6679
  React__default.createElement(Text$1, { bold: true, color: colors.textOnFillDefault }, options.title),
6680
- message.toString().length > 0 && (React__default.createElement(Text$1, { color: colors.textOnFillDefault, numberOfLines: 4, style: !options.title && styles$8.wrapMess }, message)))))));
6680
+ message.toString().length > 0 && (React__default.createElement(Text$1, { color: colors.textOnFillDefault, numberOfLines: 4, style: !options.title && styles$9.wrapMess }, message)))))));
6681
6681
  });
6682
- var styles$8 = StyleSheet.create({
6682
+ var styles$9 = StyleSheet.create({
6683
6683
  wrapMess: { marginLeft: CONSTANTS.SPACE_8, flex: 1 },
6684
6684
  wrapContent: {
6685
6685
  borderRadius: CONSTANTS.BORDER_RADIUS_12,
@@ -6779,17 +6779,133 @@ var Image = function (props) {
6779
6779
  };
6780
6780
  var Image$1 = memoDeepEqual(Image);
6781
6781
 
6782
- var Badge = function (_a) {
6783
- var children = _a.children, _b = _a.value, value = _b === void 0 ? "1" : _b, borderColor = _a.borderColor, backgroundColor = _a.backgroundColor, style = _a.style, textColor = _a.textColor, textStyle = _a.textStyle;
6782
+ var BADGE_CONFIGS = {
6783
+ sizes: {
6784
+ small: {
6785
+ paddingHorizontal: CONSTANTS.SPACE_4,
6786
+ minWidth: 16,
6787
+ minHeight: 16,
6788
+ textSize: 10,
6789
+ },
6790
+ default: {
6791
+ paddingHorizontal: CONSTANTS.SPACE_8,
6792
+ minWidth: 16,
6793
+ textSize: 12,
6794
+ },
6795
+ },
6796
+ tiny: {
6797
+ width: 8,
6798
+ height: 8,
6799
+ borderRadius: 4,
6800
+ },
6801
+ };
6802
+ var Badge = React__default.memo(function (_a) {
6803
+ var children = _a.children, _b = _a.value, value = _b === void 0 ? "1" : _b, style = _a.style, textColor = _a.textColor, textStyle = _a.textStyle, _c = _a.type, type = _c === void 0 ? "success" : _c, _d = _a.badgeSize, badgeSize = _d === void 0 ? "default" : _d, _e = _a.mode, mode = _e === void 0 ? "default" : _e, textSize = _a.textSize, borderColor = _a.borderColor, backgroundColor = _a.backgroundColor;
6784
6804
  var theme = useInternalTheme();
6785
6805
  var colors = theme.colors;
6786
6806
  if (children) {
6787
6807
  return React__default.createElement(View, { style: style }, children);
6788
6808
  }
6809
+ var sizeStyles = useMemo(function () {
6810
+ if (badgeSize === "tiny")
6811
+ return null;
6812
+ return BADGE_CONFIGS.sizes[badgeSize];
6813
+ }, [badgeSize]);
6814
+ var typeStyles = useMemo(function () {
6815
+ var configs = {
6816
+ success: {
6817
+ default: {
6818
+ borderWidth: 0,
6819
+ backgroundColor: backgroundColor || colors.surfaceSuccessDefault,
6820
+ },
6821
+ outline: {
6822
+ borderColor: borderColor || colors.borderSuccessDefault,
6823
+ backgroundColor: backgroundColor || colors.surfaceSuccessInverseDefault,
6824
+ },
6825
+ },
6826
+ error: {
6827
+ default: {
6828
+ borderWidth: 0,
6829
+ backgroundColor: backgroundColor || colors.surfaceCriticalDefault,
6830
+ },
6831
+ outline: {
6832
+ borderColor: borderColor || colors.borderErrorDefault,
6833
+ backgroundColor: backgroundColor || colors.surfaceCriticalInverseDefault,
6834
+ },
6835
+ },
6836
+ info: {
6837
+ default: {
6838
+ borderWidth: 0,
6839
+ backgroundColor: backgroundColor || colors.surfacePrimaryInverseDefault,
6840
+ },
6841
+ outline: {
6842
+ borderColor: borderColor || colors.borderInfoDefault,
6843
+ backgroundColor: backgroundColor || colors.surfaceInfoInverseDefault,
6844
+ },
6845
+ },
6846
+ warning: {
6847
+ default: {
6848
+ borderWidth: 0,
6849
+ backgroundColor: backgroundColor || colors.surfaceWarningDefault,
6850
+ },
6851
+ outline: {
6852
+ borderColor: borderColor || colors.borderWarningDefault,
6853
+ backgroundColor: backgroundColor || colors.surfaceWarningInverseDefault,
6854
+ },
6855
+ },
6856
+ default: {
6857
+ default: {
6858
+ borderWidth: 0,
6859
+ backgroundColor: backgroundColor || colors.surfaceInfoDefault,
6860
+ },
6861
+ outline: {
6862
+ borderColor: borderColor || colors.borderInfoDefault,
6863
+ backgroundColor: backgroundColor || colors.surfaceInfoInverseDefault,
6864
+ },
6865
+ },
6866
+ };
6867
+ return configs[type][mode];
6868
+ }, [colors, type, mode, borderColor, backgroundColor]);
6869
+ var textColorStyle = useMemo(function () {
6870
+ var textConfigs = {
6871
+ success: {
6872
+ default: colors.textOnFillDefault,
6873
+ outline: colors.textSuccessDefault,
6874
+ },
6875
+ error: {
6876
+ default: colors.textOnFillDefault,
6877
+ outline: colors.textCriticalDefault,
6878
+ },
6879
+ info: {
6880
+ default: colors.textOnFillDefault,
6881
+ outline: colors.textInfoDefault,
6882
+ },
6883
+ warning: {
6884
+ default: colors.textOnFillDefault,
6885
+ outline: colors.textWarningDefault,
6886
+ },
6887
+ default: {
6888
+ default: colors.textOnFillDefault,
6889
+ outline: colors.textInfoDefault,
6890
+ },
6891
+ };
6892
+ return textConfigs[type][mode];
6893
+ }, [colors, type, mode]);
6894
+ var finalTextSize = useMemo(function () {
6895
+ var _a;
6896
+ if (badgeSize === "tiny")
6897
+ return 0;
6898
+ return textSize || ((_a = BADGE_CONFIGS.sizes[badgeSize]) === null || _a === void 0 ? void 0 : _a.textSize) || 12;
6899
+ }, [textSize, badgeSize]);
6900
+ if (badgeSize === "tiny") {
6901
+ return (React__default.createElement(View, { row: true, width: BADGE_CONFIGS.tiny.width, height: BADGE_CONFIGS.tiny.height, borderRadius: BADGE_CONFIGS.tiny.borderRadius, backgroundColor: typeStyles.backgroundColor }));
6902
+ }
6789
6903
  return (React__default.createElement(View, { row: true },
6790
- React__default.createElement(View, { borderRadius: CONSTANTS.BORDER_RADIUS_12, borderWidth: CONSTANTS.BORDER_WIDTH_1, borderColor: borderColor || colors.borderPrimaryDefault, backgroundColor: backgroundColor || colors.surfaceSecondaryDefault, paddingHorizontal: CONSTANTS.SPACE_8, paddingVertical: CONSTANTS.SPACE_4, style: style },
6791
- React__default.createElement(Text$1, { size: 12, color: textColor || colors.textSecondary, style: textStyle }, value))));
6792
- };
6904
+ React__default.createElement(View, { center: true, borderRadius: 999, borderWidth: CONSTANTS.BORDER_WIDTH_1, style: [sizeStyles, typeStyles, style] },
6905
+ React__default.createElement(Text$1, { size: finalTextSize, color: textColor || textColorStyle, style: [styles$8.textMedium, textStyle] }, value))));
6906
+ });
6907
+ Badge.displayName = "Badge";
6908
+ var styles$8 = StyleSheet.create(__assign({}, containerStyles));
6793
6909
 
6794
6910
  var CountingDot = function (_a) {
6795
6911
  var children = _a.children, _b = _a.value, value = _b === void 0 ? "1" : _b, backgroundColor = _a.backgroundColor, style = _a.style, textColor = _a.textColor, textStyle = _a.textStyle;