@stella-source/stellasource-dsl 1.3.0 → 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
  }
@@ -21868,7 +21868,8 @@ const PaymentStatusComponent = styled.div `
21868
21868
  gap: 3px;
21869
21869
  font-family: "Inter", sans-serif;
21870
21870
  font-weight: 500;
21871
- font-size: 16px;
21871
+ font-size: 12px;
21872
+ color: var(--charcoal);
21872
21873
  `;
21873
21874
  const PaymentStatusIcon = styled(StellaIcon) `
21874
21875
  flex-shrink: 0;
@@ -21877,21 +21878,39 @@ const PaymentStatusLabel = styled.span `
21877
21878
  line-height: 20px;
21878
21879
  `;
21879
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
+
21880
21893
  const STATUS_ICON_MAP = {
21881
- "Payment Required": "warning",
21882
- "Terms Applied": "check-square",
21883
- "Payment Authorized": "check-square",
21884
- "Payment Processing": "money",
21885
- Paid: "currency-dollar",
21886
- "Payment Failed": "x-circle",
21887
- Canceled: "empty",
21888
- "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",
21889
21902
  };
21890
21903
  const PaymentStatus = ({ variant, id, className }) => {
21891
- 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";
21892
21911
  return (a__default.createElement(PaymentStatusComponent, { id: id, className: className },
21893
- a__default.createElement(PaymentStatusIcon, { iconName: iconName }),
21894
- a__default.createElement(PaymentStatusLabel, null, variant)));
21912
+ iconName ? a__default.createElement(PaymentStatusIcon, { iconName: iconName, size: 16 }) : "",
21913
+ a__default.createElement(PaymentStatusLabel, null, label)));
21895
21914
  };
21896
21915
 
21897
21916
  export { HelperText, IconButton, Label, Loader, NumberInput, Pagination, PasswordInput, PaymentStatus, StellaButton, StellaButtonVariant, StellaIcon, Styles, Sync, Table, TableUnitsAndTotals, TextInput, Tooltip };