@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 +29 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/PaymentStatus/PaymentStatus.stories.d.ts +1 -1
- package/dist/cjs/types/components/PaymentStatus/types.d.ts +9 -9
- package/dist/esm/index.esm.js +29 -11
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/types/components/PaymentStatus/PaymentStatus.stories.d.ts +1 -1
- package/dist/esm/types/components/PaymentStatus/types.d.ts +9 -9
- package/dist/index.d.ts +9 -9
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare enum PaymentStatusVariant {
|
|
2
|
-
|
|
3
|
-
TERMS_APPLIED = "
|
|
4
|
-
PAYMENT_AUTHORIZED = "
|
|
5
|
-
PAYMENT_PROCESSING = "
|
|
6
|
-
|
|
7
|
-
PAYMENT_FAILED = "
|
|
8
|
-
|
|
9
|
-
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
|
}
|
package/dist/esm/index.esm.js
CHANGED
|
@@ -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
|
-
|
|
21883
|
-
|
|
21884
|
-
|
|
21885
|
-
|
|
21886
|
-
|
|
21887
|
-
|
|
21888
|
-
|
|
21889
|
-
|
|
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,
|
|
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 };
|