@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.
@@ -8,7 +8,7 @@ declare const _default: {
8
8
  control: {
9
9
  type: string;
10
10
  };
11
- options: PaymentStatusVariant[];
11
+ options: (PaymentStatusVariant | null)[];
12
12
  };
13
13
  };
14
14
  args: {
@@ -1,15 +1,15 @@
1
1
  export declare enum PaymentStatusVariant {
2
- PAYMENT_REQUIRED = "Payment Required",
3
- TERMS_APPLIED = "Terms Applied",
4
- PAYMENT_AUTHORIZED = "Payment Authorized",
5
- PAYMENT_PROCESSING = "Payment Processing",
6
- PAID = "Paid",
7
- PAYMENT_FAILED = "Payment Failed",
8
- CANCELED = "Canceled",
9
- PAYMENT_WINDOW_EXPIRED = "Payment Window Expired"
2
+ PAYMENT_PENDING = "PaymentPending",
3
+ TERMS_APPLIED = "TermsApplied",
4
+ PAYMENT_AUTHORIZED = "PaymentAuthorized",
5
+ PAYMENT_PROCESSING = "PaymentProcessing",
6
+ PAYMENT_SETTLED = "PaymentSettled",
7
+ PAYMENT_FAILED = "PaymentFailed",
8
+ PAYMENT_CANCELED = "PaymentCanceled",
9
+ PAYMENT_WINDOW_EXPIRED = "PaymentWindowExpired"
10
10
  }
11
11
  export interface PaymentStatusProps {
12
12
  id?: string;
13
13
  className?: string;
14
- variant: `${PaymentStatusVariant}`;
14
+ variant: `${PaymentStatusVariant}` | null;
15
15
  }
@@ -21878,21 +21878,39 @@ const PaymentStatusLabel = styled.span `
21878
21878
  line-height: 20px;
21879
21879
  `;
21880
21880
 
21881
+ var PaymentStatusVariant;
21882
+ (function (PaymentStatusVariant) {
21883
+ PaymentStatusVariant["PAYMENT_PENDING"] = "PaymentPending";
21884
+ PaymentStatusVariant["TERMS_APPLIED"] = "TermsApplied";
21885
+ PaymentStatusVariant["PAYMENT_AUTHORIZED"] = "PaymentAuthorized";
21886
+ PaymentStatusVariant["PAYMENT_PROCESSING"] = "PaymentProcessing";
21887
+ PaymentStatusVariant["PAYMENT_SETTLED"] = "PaymentSettled";
21888
+ PaymentStatusVariant["PAYMENT_FAILED"] = "PaymentFailed";
21889
+ PaymentStatusVariant["PAYMENT_CANCELED"] = "PaymentCanceled";
21890
+ PaymentStatusVariant["PAYMENT_WINDOW_EXPIRED"] = "PaymentWindowExpired";
21891
+ })(PaymentStatusVariant || (PaymentStatusVariant = {}));
21892
+
21881
21893
  const STATUS_ICON_MAP = {
21882
- "Payment Required": "warning",
21883
- "Terms Applied": "check-square",
21884
- "Payment Authorized": "check-square",
21885
- "Payment Processing": "money",
21886
- Paid: "currency-dollar",
21887
- "Payment Failed": "x-circle",
21888
- Canceled: "empty",
21889
- "Payment Window Expired": "hourglass-simple-low",
21894
+ PaymentPending: "warning",
21895
+ TermsApplied: "check-square",
21896
+ PaymentAuthorized: "check-square",
21897
+ PaymentProcessing: "money",
21898
+ PaymentSettled: "currency-dollar",
21899
+ PaymentFailed: "x-circle",
21900
+ PaymentCanceled: "empty",
21901
+ PaymentWindowExpired: "hourglass-simple-low",
21890
21902
  };
21891
21903
  const PaymentStatus = ({ variant, id, className }) => {
21892
- const iconName = STATUS_ICON_MAP[variant];
21904
+ const iconName = variant ? STATUS_ICON_MAP[variant] : "";
21905
+ const labelWords = variant?.split(/(?=[A-Z])/);
21906
+ let label = labelWords ? labelWords.join(" ") : "--";
21907
+ if (variant === PaymentStatusVariant.PAYMENT_SETTLED)
21908
+ label = "Paid";
21909
+ if (variant === PaymentStatusVariant.PAYMENT_CANCELED)
21910
+ label = "Canceled";
21893
21911
  return (a__default.createElement(PaymentStatusComponent, { id: id, className: className },
21894
- a__default.createElement(PaymentStatusIcon, { iconName: iconName, size: 16 }),
21895
- a__default.createElement(PaymentStatusLabel, null, variant)));
21912
+ iconName ? a__default.createElement(PaymentStatusIcon, { iconName: iconName, size: 16 }) : "",
21913
+ a__default.createElement(PaymentStatusLabel, null, label)));
21896
21914
  };
21897
21915
 
21898
21916
  export { HelperText, IconButton, Label, Loader, NumberInput, Pagination, PasswordInput, PaymentStatus, StellaButton, StellaButtonVariant, StellaIcon, Styles, Sync, Table, TableUnitsAndTotals, TextInput, Tooltip };