sapo-components-ui-rn 1.1.5 → 1.1.7

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,9 +1,9 @@
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 = "large" | "medium" | "small";
5
- type BadgeMode = "default" | "outline";
6
- type ProgressType = "full" | "half" | "empty" | "none";
3
+ export type BadgeType = "success" | "error" | "info" | "warning" | "default";
4
+ export type BadgeSize = "large" | "medium" | "small";
5
+ export type BadgeMode = "default" | "outline";
6
+ export type ProgressType = "full" | "half" | "empty" | "none";
7
7
  interface BadgeProps {
8
8
  value?: string;
9
9
  borderColor?: string;
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export { default as Toast } from "./components/Toast";
13
13
  export { default as View } from "./components/View";
14
14
  export { default as Spacer } from "./components/Spacer";
15
15
  export { default as Image } from "./components/Image";
16
- export { default as Badge } from "./components/Badge";
16
+ export { default as Badge, type BadgeType, type BadgeSize, type BadgeMode, type ProgressType, } from "./components/Badge";
17
17
  export { default as CountingDot } from "./components/CountingDot";
18
18
  export { default as ChipBar } from "./components/ChipBar";
19
19
  export { default as Checkbox } from "./components/Checkbox";
package/dist/index.esm.js CHANGED
@@ -6838,7 +6838,7 @@ var ProgressCircle = function (_a) {
6838
6838
  } }));
6839
6839
  };
6840
6840
  var Badge = React__default.memo(function (_a) {
6841
- var _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 ? "large" : _d, _e = _a.mode, mode = _e === void 0 ? "default" : _e, textSize = _a.textSize, borderColor = _a.borderColor, backgroundColor = _a.backgroundColor, _f = _a.progressType, progressType = _f === void 0 ? "none" : _f, leftIcon = _a.leftIcon;
6841
+ var _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 ? "default" : _c, _d = _a.badgeSize, badgeSize = _d === void 0 ? "large" : _d, _e = _a.mode, mode = _e === void 0 ? "default" : _e, textSize = _a.textSize, borderColor = _a.borderColor, backgroundColor = _a.backgroundColor, _f = _a.progressType, progressType = _f === void 0 ? "none" : _f, leftIcon = _a.leftIcon;
6842
6842
  var theme = useInternalTheme();
6843
6843
  var colors = theme.colors;
6844
6844
  var sizeStyles = useMemo(function () {
@@ -6851,6 +6851,7 @@ var Badge = React__default.memo(function (_a) {
6851
6851
  success: {
6852
6852
  default: {
6853
6853
  borderWidth: 0,
6854
+ borderColor: borderColor || colors.borderSuccessDefault,
6854
6855
  backgroundColor: backgroundColor || colors.surfaceSuccessDefault,
6855
6856
  },
6856
6857
  outline: {
@@ -6861,6 +6862,7 @@ var Badge = React__default.memo(function (_a) {
6861
6862
  error: {
6862
6863
  default: {
6863
6864
  borderWidth: 0,
6865
+ borderColor: borderColor || colors.borderErrorDefault,
6864
6866
  backgroundColor: backgroundColor || colors.surfaceCriticalDefault,
6865
6867
  },
6866
6868
  outline: {
@@ -6871,6 +6873,7 @@ var Badge = React__default.memo(function (_a) {
6871
6873
  info: {
6872
6874
  default: {
6873
6875
  borderWidth: 0,
6876
+ borderColor: borderColor || colors.borderPrimaryDefault,
6874
6877
  backgroundColor: backgroundColor || colors.surfacePrimaryInverseDefault,
6875
6878
  },
6876
6879
  outline: {
@@ -6881,6 +6884,7 @@ var Badge = React__default.memo(function (_a) {
6881
6884
  warning: {
6882
6885
  default: {
6883
6886
  borderWidth: 0,
6887
+ borderColor: borderColor || colors.borderWarningDefault,
6884
6888
  backgroundColor: backgroundColor || colors.surfaceWarningDefault,
6885
6889
  },
6886
6890
  outline: {
@@ -6891,6 +6895,7 @@ var Badge = React__default.memo(function (_a) {
6891
6895
  default: {
6892
6896
  default: {
6893
6897
  borderWidth: 0,
6898
+ borderColor: borderColor || colors.borderInfoDefault,
6894
6899
  backgroundColor: backgroundColor || colors.surfaceInfoDefault,
6895
6900
  },
6896
6901
  outline: {
@@ -6939,7 +6944,7 @@ var Badge = React__default.memo(function (_a) {
6939
6944
  return (React__default.createElement(View, { row: true },
6940
6945
  React__default.createElement(View, { row: true, center: true, borderRadius: 999, borderWidth: CONSTANTS.BORDER_WIDTH_1, style: [sizeStyles, typeStyles, style] },
6941
6946
  leftIcon && React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_4 }, leftIcon),
6942
- progressType !== "none" && (React__default.createElement(ProgressCircle, { progress: progressType, color: textColorStyle })),
6947
+ progressType !== "none" && (React__default.createElement(ProgressCircle, { progress: progressType, color: typeStyles.borderColor })),
6943
6948
  React__default.createElement(View, { paddingLeft: progressType !== "none" ? CONSTANTS.SPACE_4 : 0 },
6944
6949
  React__default.createElement(Text$1, { size: finalTextSize, color: textColor || textColorStyle, style: [styles$8.textMedium, textStyle] }, value)))));
6945
6950
  });