@bze/bze-ui-kit 0.3.0 → 0.4.0
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/README.md +11 -11
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +50 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -678,11 +678,28 @@ var formatTimeRemaining = (targetDate) => {
|
|
|
678
678
|
if (minutes > 0) parts.push(`${minutes}m`);
|
|
679
679
|
return parts.join(" ") || "Now";
|
|
680
680
|
};
|
|
681
|
-
|
|
682
|
-
|
|
681
|
+
function formatTimeRemainingFromEpochs(endEpoch, currentEpoch) {
|
|
682
|
+
let epochDiff;
|
|
683
|
+
if (currentEpoch !== void 0) {
|
|
684
|
+
const endBN = toBigNumber(endEpoch);
|
|
685
|
+
const currentBN = toBigNumber(currentEpoch);
|
|
686
|
+
epochDiff = endBN.minus(currentBN);
|
|
687
|
+
if (epochDiff.lte(0)) {
|
|
688
|
+
return "Ended";
|
|
689
|
+
}
|
|
690
|
+
const hoursRemaining = epochDiff.toNumber();
|
|
691
|
+
const daysRemaining = Math.floor(hoursRemaining / 24);
|
|
692
|
+
const hoursRemainder = hoursRemaining % 24;
|
|
693
|
+
if (daysRemaining > 0) {
|
|
694
|
+
return `${daysRemaining}d ${hoursRemainder}h`;
|
|
695
|
+
}
|
|
696
|
+
return `${hoursRemainder}h`;
|
|
697
|
+
}
|
|
698
|
+
epochDiff = toBigNumber(endEpoch);
|
|
699
|
+
if (epochDiff.lte(0)) {
|
|
683
700
|
return "Now";
|
|
684
701
|
}
|
|
685
|
-
const totalSeconds =
|
|
702
|
+
const totalSeconds = epochDiff.multipliedBy(60).toNumber();
|
|
686
703
|
const days = Math.floor(totalSeconds / (60 * 60 * 24));
|
|
687
704
|
const hours = Math.floor(totalSeconds % (60 * 60 * 24) / (60 * 60));
|
|
688
705
|
const minutes = Math.floor(totalSeconds % (60 * 60) / 60);
|
|
@@ -691,7 +708,7 @@ var formatTimeRemainingFromEpochs = (epochs) => {
|
|
|
691
708
|
if (hours > 0) parts.push(`${hours}h`);
|
|
692
709
|
if (minutes > 0) parts.push(`${minutes}m`);
|
|
693
710
|
return parts.join(" ") || "Now";
|
|
694
|
-
}
|
|
711
|
+
}
|
|
695
712
|
|
|
696
713
|
// src/utils/functions.ts
|
|
697
714
|
async function sleep(ms) {
|
|
@@ -4863,6 +4880,33 @@ function SettingsToggle({ accentColor }) {
|
|
|
4863
4880
|
}
|
|
4864
4881
|
);
|
|
4865
4882
|
}
|
|
4883
|
+
|
|
4884
|
+
// src/components/testnet-banner.tsx
|
|
4885
|
+
import { Box as Box3, Text as Text4 } from "@chakra-ui/react";
|
|
4886
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
4887
|
+
var TestnetBanner = () => {
|
|
4888
|
+
if (!isTestnetChain()) {
|
|
4889
|
+
return null;
|
|
4890
|
+
}
|
|
4891
|
+
return /* @__PURE__ */ jsx7(
|
|
4892
|
+
Box3,
|
|
4893
|
+
{
|
|
4894
|
+
position: "fixed",
|
|
4895
|
+
bottom: "0",
|
|
4896
|
+
left: "0",
|
|
4897
|
+
right: "0",
|
|
4898
|
+
bg: "red.600",
|
|
4899
|
+
color: "white",
|
|
4900
|
+
textAlign: "center",
|
|
4901
|
+
py: "1",
|
|
4902
|
+
zIndex: "banner",
|
|
4903
|
+
fontSize: "xs",
|
|
4904
|
+
fontWeight: "bold",
|
|
4905
|
+
letterSpacing: "wide",
|
|
4906
|
+
children: /* @__PURE__ */ jsx7(Text4, { children: "YOU ARE ON TESTNET" })
|
|
4907
|
+
}
|
|
4908
|
+
);
|
|
4909
|
+
};
|
|
4866
4910
|
export {
|
|
4867
4911
|
ASSET_TYPE_FACTORY,
|
|
4868
4912
|
ASSET_TYPE_IBC,
|
|
@@ -4907,6 +4951,7 @@ export {
|
|
|
4907
4951
|
TESTNET_CHAIN_INFO_FALLBACK,
|
|
4908
4952
|
TOKEN_LOGO_PLACEHOLDER,
|
|
4909
4953
|
TTL_NO_EXPIRY,
|
|
4954
|
+
TestnetBanner,
|
|
4910
4955
|
Toaster,
|
|
4911
4956
|
TxStatus,
|
|
4912
4957
|
VALIDATION_ERRORS,
|