elseware-ui 2.6.0 → 2.6.1
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.
|
@@ -4,5 +4,5 @@ export interface PriceTagProps {
|
|
|
4
4
|
code?: string;
|
|
5
5
|
styles?: string;
|
|
6
6
|
}
|
|
7
|
-
declare function PriceTag({ discount, price, code, styles }: PriceTagProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function PriceTag({ discount, price, code, styles }: PriceTagProps): import("react/jsx-runtime").JSX.Element | undefined;
|
|
8
8
|
export { PriceTag };
|
package/build/index.es.js
CHANGED
|
@@ -28539,13 +28539,22 @@ var applyDiscount = function (discount, price) {
|
|
|
28539
28539
|
return (price - (price / 100) * discount).toFixed(2);
|
|
28540
28540
|
};
|
|
28541
28541
|
function PriceTag(_a) {
|
|
28542
|
-
var _b;
|
|
28543
|
-
var discount = _a.discount, price = _a.price,
|
|
28544
|
-
|
|
28545
|
-
|
|
28546
|
-
|
|
28547
|
-
|
|
28548
|
-
|
|
28542
|
+
var _b, _c;
|
|
28543
|
+
var discount = _a.discount, price = _a.price, _d = _a.code, code = _d === void 0 ? "USD" : _d, styles = _a.styles;
|
|
28544
|
+
if (price === 0) {
|
|
28545
|
+
return (jsxRuntime.jsx("div", __assign$1({ className: classnames((_b = {
|
|
28546
|
+
"inline-flex gap-3 text-md w-fit": true
|
|
28547
|
+
},
|
|
28548
|
+
_b["".concat(styles)] = styles,
|
|
28549
|
+
_b)) }, { children: jsxRuntime.jsx("div", __assign$1({ className: "bg-green-700 px-2 py-1 font-bold rounded-md text-gray-200" }, { children: "FREE" })) })));
|
|
28550
|
+
}
|
|
28551
|
+
if (price > 0) {
|
|
28552
|
+
return (jsxRuntime.jsxs("div", __assign$1({ className: classnames((_c = {
|
|
28553
|
+
"inline-flex gap-3 text-md w-fit": true
|
|
28554
|
+
},
|
|
28555
|
+
_c["".concat(styles)] = styles,
|
|
28556
|
+
_c)) }, { children: [discount && discount !== 0 && (jsxRuntime.jsxs("div", __assign$1({ className: "bg-green-700 px-2 py-1 font-bold rounded-md text-gray-200" }, { children: ["-", discount, "%"] }))), jsxRuntime.jsxs("div", __assign$1({ className: "inline-flex gap-1 items-center" }, { children: [discount ? (jsxRuntime.jsxs("div", __assign$1({ className: "inline-flex gap-[3px] font-semibold" }, { children: [jsxRuntime.jsxs("div", __assign$1({ className: "eui-text-sm line-through" }, { children: [getCurrencySymbol(code), price] })), jsxRuntime.jsxs("div", __assign$1({ className: "eui-text-md" }, { children: [getCurrencySymbol(code), applyDiscount(discount, price)] }))] }))) : (jsxRuntime.jsxs("div", __assign$1({ className: "text-gray-50 font-semibold" }, { children: [getCurrencySymbol(code), price] }))), jsxRuntime.jsx("div", __assign$1({ className: "text-yellow-500 font-thin" }, { children: code }))] }))] })));
|
|
28557
|
+
}
|
|
28549
28558
|
}
|
|
28550
28559
|
|
|
28551
28560
|
function StarRating(_a) {
|
package/build/index.js
CHANGED
|
@@ -28565,13 +28565,22 @@ var applyDiscount = function (discount, price) {
|
|
|
28565
28565
|
return (price - (price / 100) * discount).toFixed(2);
|
|
28566
28566
|
};
|
|
28567
28567
|
function PriceTag(_a) {
|
|
28568
|
-
var _b;
|
|
28569
|
-
var discount = _a.discount, price = _a.price,
|
|
28570
|
-
|
|
28571
|
-
|
|
28572
|
-
|
|
28573
|
-
|
|
28574
|
-
|
|
28568
|
+
var _b, _c;
|
|
28569
|
+
var discount = _a.discount, price = _a.price, _d = _a.code, code = _d === void 0 ? "USD" : _d, styles = _a.styles;
|
|
28570
|
+
if (price === 0) {
|
|
28571
|
+
return (jsxRuntime.jsx("div", __assign$1({ className: classnames((_b = {
|
|
28572
|
+
"inline-flex gap-3 text-md w-fit": true
|
|
28573
|
+
},
|
|
28574
|
+
_b["".concat(styles)] = styles,
|
|
28575
|
+
_b)) }, { children: jsxRuntime.jsx("div", __assign$1({ className: "bg-green-700 px-2 py-1 font-bold rounded-md text-gray-200" }, { children: "FREE" })) })));
|
|
28576
|
+
}
|
|
28577
|
+
if (price > 0) {
|
|
28578
|
+
return (jsxRuntime.jsxs("div", __assign$1({ className: classnames((_c = {
|
|
28579
|
+
"inline-flex gap-3 text-md w-fit": true
|
|
28580
|
+
},
|
|
28581
|
+
_c["".concat(styles)] = styles,
|
|
28582
|
+
_c)) }, { children: [discount && discount !== 0 && (jsxRuntime.jsxs("div", __assign$1({ className: "bg-green-700 px-2 py-1 font-bold rounded-md text-gray-200" }, { children: ["-", discount, "%"] }))), jsxRuntime.jsxs("div", __assign$1({ className: "inline-flex gap-1 items-center" }, { children: [discount ? (jsxRuntime.jsxs("div", __assign$1({ className: "inline-flex gap-[3px] font-semibold" }, { children: [jsxRuntime.jsxs("div", __assign$1({ className: "eui-text-sm line-through" }, { children: [getCurrencySymbol(code), price] })), jsxRuntime.jsxs("div", __assign$1({ className: "eui-text-md" }, { children: [getCurrencySymbol(code), applyDiscount(discount, price)] }))] }))) : (jsxRuntime.jsxs("div", __assign$1({ className: "text-gray-50 font-semibold" }, { children: [getCurrencySymbol(code), price] }))), jsxRuntime.jsx("div", __assign$1({ className: "text-yellow-500 font-thin" }, { children: code }))] }))] })));
|
|
28583
|
+
}
|
|
28575
28584
|
}
|
|
28576
28585
|
|
|
28577
28586
|
function StarRating(_a) {
|