@stella-source/stellasource-dsl 1.3.1 → 1.3.2

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/cjs/index.js CHANGED
@@ -21898,21 +21898,39 @@ const PaymentStatusLabel = styled.span `
21898
21898
  line-height: 20px;
21899
21899
  `;
21900
21900
 
21901
+ var PaymentStatusVariant;
21902
+ (function (PaymentStatusVariant) {
21903
+ PaymentStatusVariant["PAYMENT_PENDING"] = "PaymentPending";
21904
+ PaymentStatusVariant["TERMS_APPLIED"] = "TermsApplied";
21905
+ PaymentStatusVariant["PAYMENT_AUTHORIZED"] = "PaymentAuthorized";
21906
+ PaymentStatusVariant["PAYMENT_PROCESSING"] = "PaymentProcessing";
21907
+ PaymentStatusVariant["PAYMENT_SETTLED"] = "PaymentSettled";
21908
+ PaymentStatusVariant["PAYMENT_FAILED"] = "PaymentFailed";
21909
+ PaymentStatusVariant["PAYMENT_CANCELED"] = "PaymentCanceled";
21910
+ PaymentStatusVariant["PAYMENT_WINDOW_EXPIRED"] = "PaymentWindowExpired";
21911
+ })(PaymentStatusVariant || (PaymentStatusVariant = {}));
21912
+
21901
21913
  const STATUS_ICON_MAP = {
21902
- "Payment Required": "warning",
21903
- "Terms Applied": "check-square",
21904
- "Payment Authorized": "check-square",
21905
- "Payment Processing": "money",
21906
- Paid: "currency-dollar",
21907
- "Payment Failed": "x-circle",
21908
- Canceled: "empty",
21909
- "Payment Window Expired": "hourglass-simple-low",
21914
+ PaymentPending: "warning",
21915
+ TermsApplied: "check-square",
21916
+ PaymentAuthorized: "check-square",
21917
+ PaymentProcessing: "money",
21918
+ PaymentSettled: "currency-dollar",
21919
+ PaymentFailed: "x-circle",
21920
+ PaymentCanceled: "empty",
21921
+ PaymentWindowExpired: "hourglass-simple-low",
21910
21922
  };
21911
21923
  const PaymentStatus = ({ variant, id, className }) => {
21912
- const iconName = STATUS_ICON_MAP[variant];
21924
+ const iconName = variant ? STATUS_ICON_MAP[variant] : "";
21925
+ const labelWords = variant?.split(/(?=[A-Z])/);
21926
+ let label = labelWords ? labelWords.join(" ") : "--";
21927
+ if (variant === PaymentStatusVariant.PAYMENT_SETTLED)
21928
+ label = "Paid";
21929
+ if (variant === PaymentStatusVariant.PAYMENT_CANCELED)
21930
+ label = "Canceled";
21913
21931
  return (a$l.createElement(PaymentStatusComponent, { id: id, className: className },
21914
- a$l.createElement(PaymentStatusIcon, { iconName: iconName, size: 16 }),
21915
- a$l.createElement(PaymentStatusLabel, null, variant)));
21932
+ iconName ? a$l.createElement(PaymentStatusIcon, { iconName: iconName, size: 16 }) : "",
21933
+ a$l.createElement(PaymentStatusLabel, null, label)));
21916
21934
  };
21917
21935
 
21918
21936
  exports.HelperText = HelperText;