@bunnyapp/components 1.8.0-beta.3 → 1.8.0-beta.4
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
|
@@ -1283,7 +1283,7 @@ const DEFAULT_CONFIG = {
|
|
|
1283
1283
|
};
|
|
1284
1284
|
|
|
1285
1285
|
// This will be replaced at build time by rollup-plugin-replace
|
|
1286
|
-
const PACKAGE_VERSION = '1.8.0-beta.
|
|
1286
|
+
const PACKAGE_VERSION = '1.8.0-beta.3';
|
|
1287
1287
|
const createRequestHeaders = (token) => {
|
|
1288
1288
|
const headers = createClientDevHeaders({ token });
|
|
1289
1289
|
// Add the components version header
|
|
@@ -26561,20 +26561,6 @@ function priceListChargePriceDescription(maskedPriceListCharge) {
|
|
|
26561
26561
|
return `Per ${unitName ? `${unitName} / ` : ''}${priceListCharge.showPriceAsMonthly ? 'month' : periodLabel}`;
|
|
26562
26562
|
}
|
|
26563
26563
|
|
|
26564
|
-
const GetActiveCharges_PriceListChargeFragment = t(`
|
|
26565
|
-
fragment GetActiveCharges_PriceListChargeFragment on PriceListCharge {
|
|
26566
|
-
deprecated
|
|
26567
|
-
featureAddon
|
|
26568
|
-
}
|
|
26569
|
-
`);
|
|
26570
|
-
// Active charges: any charge that is not deprecated and not a feature addon
|
|
26571
|
-
function getActiveCharges(charges) {
|
|
26572
|
-
return charges.filter(maskedCharge => {
|
|
26573
|
-
const charge = readFragment(GetActiveCharges_PriceListChargeFragment, maskedCharge);
|
|
26574
|
-
return !charge.deprecated && !charge.featureAddon;
|
|
26575
|
-
});
|
|
26576
|
-
}
|
|
26577
|
-
|
|
26578
26564
|
const getPriceListUnitName_PriceListFragment = t(`
|
|
26579
26565
|
fragment getPriceListUnitName_PriceListFragment on PriceList {
|
|
26580
26566
|
charges {
|
|
@@ -26717,12 +26703,10 @@ const PricingTooltip_PriceListChargeFragment = t(`
|
|
|
26717
26703
|
...priceListChargePriceDescription_PriceListChargeFragment
|
|
26718
26704
|
...ChargeHasPriceTiers_PriceListChargeFragment
|
|
26719
26705
|
...ChargePriceTiers_PriceListChargeFragment
|
|
26720
|
-
...GetActiveCharges_PriceListChargeFragment
|
|
26721
26706
|
}
|
|
26722
26707
|
`, [
|
|
26723
26708
|
ChargeHasPriceTiers_PriceListChargeFragment,
|
|
26724
26709
|
ChargePriceTiers_PriceListChargeFragment,
|
|
26725
|
-
GetActiveCharges_PriceListChargeFragment,
|
|
26726
26710
|
priceListChargePriceDescription_PriceListChargeFragment
|
|
26727
26711
|
]);
|
|
26728
26712
|
const PricingTooltip_PriceListFragment = t(`
|
|
@@ -26736,16 +26720,15 @@ const PricingTooltip_PriceListFragment = t(`
|
|
|
26736
26720
|
const PricingTooltip = ({ className, priceListCharges: maskedPriceListCharges, currencyId, }) => {
|
|
26737
26721
|
// Read fragments
|
|
26738
26722
|
const priceListCharges = maskedPriceListCharges.map(charge => readFragment(PricingTooltip_PriceListChargeFragment, charge));
|
|
26739
|
-
const activeCharges = getActiveCharges(priceListCharges);
|
|
26740
26723
|
const content = react.useMemo(() => {
|
|
26741
|
-
return (jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-3", children:
|
|
26724
|
+
return (jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-3", children: priceListCharges === null || priceListCharges === void 0 ? void 0 : priceListCharges.map((charge, index) => {
|
|
26742
26725
|
const hasPriceTiers = chargeHasPriceTiers(charge);
|
|
26743
26726
|
if (hasPriceTiers) {
|
|
26744
26727
|
return jsxRuntime.jsx(ChargePriceTiers, { charge: charge, currencyId: currencyId }, index);
|
|
26745
26728
|
}
|
|
26746
26729
|
return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-1", children: [jsxRuntime.jsx("div", { className: "bunny-text-white bunny-font-bold", children: charge.name }), jsxRuntime.jsxs("div", { className: "bunny-text-gray-400 bunny-text-xs/3", children: [getChargeBasePrice(charge, currencyId), ' ', priceListChargePriceDescription(charge)] })] }, index));
|
|
26747
26730
|
}) }));
|
|
26748
|
-
}, [
|
|
26731
|
+
}, [priceListCharges, currencyId]);
|
|
26749
26732
|
return (jsxRuntime.jsx(Tooltip, { className: `bunny-text-gray-400 bunny-text-sm ${className}`, title: content, children: jsxRuntime.jsx(icons.InfoCircleOutlined, { className: "bunny-text-gray-400 ", size: 15 }) }));
|
|
26750
26733
|
};
|
|
26751
26734
|
|
|
@@ -26759,6 +26742,20 @@ function isEmptyHTML(html) {
|
|
|
26759
26742
|
return /^<[^>]*>(\s*)<\/[^>]*>$/.test(html);
|
|
26760
26743
|
}
|
|
26761
26744
|
|
|
26745
|
+
const GetActiveCharges_PriceListChargeFragment = t(`
|
|
26746
|
+
fragment GetActiveCharges_PriceListChargeFragment on PriceListCharge {
|
|
26747
|
+
deprecated
|
|
26748
|
+
featureAddon
|
|
26749
|
+
}
|
|
26750
|
+
`);
|
|
26751
|
+
// Active charges: any charge that is not deprecated and not a feature addon
|
|
26752
|
+
function getActiveCharges(charges) {
|
|
26753
|
+
return charges.filter(maskedCharge => {
|
|
26754
|
+
const charge = readFragment(GetActiveCharges_PriceListChargeFragment, maskedCharge);
|
|
26755
|
+
return !charge.deprecated && !charge.featureAddon;
|
|
26756
|
+
});
|
|
26757
|
+
}
|
|
26758
|
+
|
|
26762
26759
|
const BillingPeriodDescription_PriceListFragment = t(`
|
|
26763
26760
|
fragment BillingPeriodDescription_PriceListFragment on PriceList {
|
|
26764
26761
|
periodMonths
|
|
@@ -17,8 +17,6 @@ export declare const PricingTooltip_PriceListChargeFragment: import("gql.tada").
|
|
|
17
17
|
ChargeHasPriceTiers_PriceListChargeFragment: "PriceListCharge";
|
|
18
18
|
} & {
|
|
19
19
|
ChargePriceTiers_PriceListChargeFragment: "PriceListCharge";
|
|
20
|
-
} & {
|
|
21
|
-
GetActiveCharges_PriceListChargeFragment: "PriceListCharge";
|
|
22
20
|
};
|
|
23
21
|
}, {}, {
|
|
24
22
|
fragment: "PricingTooltip_PriceListChargeFragment";
|
package/dist/esm/index.js
CHANGED
|
@@ -1281,7 +1281,7 @@ const DEFAULT_CONFIG = {
|
|
|
1281
1281
|
};
|
|
1282
1282
|
|
|
1283
1283
|
// This will be replaced at build time by rollup-plugin-replace
|
|
1284
|
-
const PACKAGE_VERSION = '1.8.0-beta.
|
|
1284
|
+
const PACKAGE_VERSION = '1.8.0-beta.3';
|
|
1285
1285
|
const createRequestHeaders = (token) => {
|
|
1286
1286
|
const headers = createClientDevHeaders({ token });
|
|
1287
1287
|
// Add the components version header
|
|
@@ -26559,20 +26559,6 @@ function priceListChargePriceDescription(maskedPriceListCharge) {
|
|
|
26559
26559
|
return `Per ${unitName ? `${unitName} / ` : ''}${priceListCharge.showPriceAsMonthly ? 'month' : periodLabel}`;
|
|
26560
26560
|
}
|
|
26561
26561
|
|
|
26562
|
-
const GetActiveCharges_PriceListChargeFragment = t(`
|
|
26563
|
-
fragment GetActiveCharges_PriceListChargeFragment on PriceListCharge {
|
|
26564
|
-
deprecated
|
|
26565
|
-
featureAddon
|
|
26566
|
-
}
|
|
26567
|
-
`);
|
|
26568
|
-
// Active charges: any charge that is not deprecated and not a feature addon
|
|
26569
|
-
function getActiveCharges(charges) {
|
|
26570
|
-
return charges.filter(maskedCharge => {
|
|
26571
|
-
const charge = readFragment(GetActiveCharges_PriceListChargeFragment, maskedCharge);
|
|
26572
|
-
return !charge.deprecated && !charge.featureAddon;
|
|
26573
|
-
});
|
|
26574
|
-
}
|
|
26575
|
-
|
|
26576
26562
|
const getPriceListUnitName_PriceListFragment = t(`
|
|
26577
26563
|
fragment getPriceListUnitName_PriceListFragment on PriceList {
|
|
26578
26564
|
charges {
|
|
@@ -26715,12 +26701,10 @@ const PricingTooltip_PriceListChargeFragment = t(`
|
|
|
26715
26701
|
...priceListChargePriceDescription_PriceListChargeFragment
|
|
26716
26702
|
...ChargeHasPriceTiers_PriceListChargeFragment
|
|
26717
26703
|
...ChargePriceTiers_PriceListChargeFragment
|
|
26718
|
-
...GetActiveCharges_PriceListChargeFragment
|
|
26719
26704
|
}
|
|
26720
26705
|
`, [
|
|
26721
26706
|
ChargeHasPriceTiers_PriceListChargeFragment,
|
|
26722
26707
|
ChargePriceTiers_PriceListChargeFragment,
|
|
26723
|
-
GetActiveCharges_PriceListChargeFragment,
|
|
26724
26708
|
priceListChargePriceDescription_PriceListChargeFragment
|
|
26725
26709
|
]);
|
|
26726
26710
|
const PricingTooltip_PriceListFragment = t(`
|
|
@@ -26734,16 +26718,15 @@ const PricingTooltip_PriceListFragment = t(`
|
|
|
26734
26718
|
const PricingTooltip = ({ className, priceListCharges: maskedPriceListCharges, currencyId, }) => {
|
|
26735
26719
|
// Read fragments
|
|
26736
26720
|
const priceListCharges = maskedPriceListCharges.map(charge => readFragment(PricingTooltip_PriceListChargeFragment, charge));
|
|
26737
|
-
const activeCharges = getActiveCharges(priceListCharges);
|
|
26738
26721
|
const content = useMemo(() => {
|
|
26739
|
-
return (jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-3", children:
|
|
26722
|
+
return (jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-3", children: priceListCharges === null || priceListCharges === void 0 ? void 0 : priceListCharges.map((charge, index) => {
|
|
26740
26723
|
const hasPriceTiers = chargeHasPriceTiers(charge);
|
|
26741
26724
|
if (hasPriceTiers) {
|
|
26742
26725
|
return jsx(ChargePriceTiers, { charge: charge, currencyId: currencyId }, index);
|
|
26743
26726
|
}
|
|
26744
26727
|
return (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-1", children: [jsx("div", { className: "bunny-text-white bunny-font-bold", children: charge.name }), jsxs("div", { className: "bunny-text-gray-400 bunny-text-xs/3", children: [getChargeBasePrice(charge, currencyId), ' ', priceListChargePriceDescription(charge)] })] }, index));
|
|
26745
26728
|
}) }));
|
|
26746
|
-
}, [
|
|
26729
|
+
}, [priceListCharges, currencyId]);
|
|
26747
26730
|
return (jsx(Tooltip, { className: `bunny-text-gray-400 bunny-text-sm ${className}`, title: content, children: jsx(InfoCircleOutlined, { className: "bunny-text-gray-400 ", size: 15 }) }));
|
|
26748
26731
|
};
|
|
26749
26732
|
|
|
@@ -26757,6 +26740,20 @@ function isEmptyHTML(html) {
|
|
|
26757
26740
|
return /^<[^>]*>(\s*)<\/[^>]*>$/.test(html);
|
|
26758
26741
|
}
|
|
26759
26742
|
|
|
26743
|
+
const GetActiveCharges_PriceListChargeFragment = t(`
|
|
26744
|
+
fragment GetActiveCharges_PriceListChargeFragment on PriceListCharge {
|
|
26745
|
+
deprecated
|
|
26746
|
+
featureAddon
|
|
26747
|
+
}
|
|
26748
|
+
`);
|
|
26749
|
+
// Active charges: any charge that is not deprecated and not a feature addon
|
|
26750
|
+
function getActiveCharges(charges) {
|
|
26751
|
+
return charges.filter(maskedCharge => {
|
|
26752
|
+
const charge = readFragment(GetActiveCharges_PriceListChargeFragment, maskedCharge);
|
|
26753
|
+
return !charge.deprecated && !charge.featureAddon;
|
|
26754
|
+
});
|
|
26755
|
+
}
|
|
26756
|
+
|
|
26760
26757
|
const BillingPeriodDescription_PriceListFragment = t(`
|
|
26761
26758
|
fragment BillingPeriodDescription_PriceListFragment on PriceList {
|
|
26762
26759
|
periodMonths
|
|
@@ -17,8 +17,6 @@ export declare const PricingTooltip_PriceListChargeFragment: import("gql.tada").
|
|
|
17
17
|
ChargeHasPriceTiers_PriceListChargeFragment: "PriceListCharge";
|
|
18
18
|
} & {
|
|
19
19
|
ChargePriceTiers_PriceListChargeFragment: "PriceListCharge";
|
|
20
|
-
} & {
|
|
21
|
-
GetActiveCharges_PriceListChargeFragment: "PriceListCharge";
|
|
22
20
|
};
|
|
23
21
|
}, {}, {
|
|
24
22
|
fragment: "PricingTooltip_PriceListChargeFragment";
|
package/package.json
CHANGED