@loafmarkets/ui 0.1.98 → 0.1.100
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/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1979,6 +1979,7 @@ var Orderbook = React5.forwardRef(
|
|
|
1979
1979
|
onLoafLiquidityClick,
|
|
1980
1980
|
tradeExplorerUrl,
|
|
1981
1981
|
maxLevels,
|
|
1982
|
+
fillHeight = false,
|
|
1982
1983
|
className,
|
|
1983
1984
|
...props
|
|
1984
1985
|
}, ref) => {
|
|
@@ -2079,7 +2080,8 @@ var Orderbook = React5.forwardRef(
|
|
|
2079
2080
|
tradeExplorerUrl,
|
|
2080
2081
|
onPriceClick,
|
|
2081
2082
|
levelCount: effectiveLevels,
|
|
2082
|
-
compactLevelCount: effectiveCompactLevels
|
|
2083
|
+
compactLevelCount: effectiveCompactLevels,
|
|
2084
|
+
fillHeight
|
|
2083
2085
|
};
|
|
2084
2086
|
return /* @__PURE__ */ jsx(
|
|
2085
2087
|
Card,
|
|
@@ -2088,6 +2090,7 @@ var Orderbook = React5.forwardRef(
|
|
|
2088
2090
|
className: cn(
|
|
2089
2091
|
"w-full max-w-[520px] overflow-hidden rounded-[12px] border border-white/10 bg-[#111111] text-white shadow-md flex flex-col",
|
|
2090
2092
|
isCompact && "max-w-none",
|
|
2093
|
+
fillHeight && "h-full",
|
|
2091
2094
|
className
|
|
2092
2095
|
),
|
|
2093
2096
|
...props,
|
|
@@ -2149,7 +2152,8 @@ function DesktopOrderbookLayout({
|
|
|
2149
2152
|
tradeExplorerUrl,
|
|
2150
2153
|
onPriceClick,
|
|
2151
2154
|
levelCount: effectiveLevels,
|
|
2152
|
-
compactLevelCount: _compactLevelCount
|
|
2155
|
+
compactLevelCount: _compactLevelCount,
|
|
2156
|
+
fillHeight
|
|
2153
2157
|
}) {
|
|
2154
2158
|
const midRef = React5.useRef(null);
|
|
2155
2159
|
useMidPriceFlash(midRef, midPrice, "#0b1a24");
|
|
@@ -2254,12 +2258,12 @@ function DesktopOrderbookLayout({
|
|
|
2254
2258
|
);
|
|
2255
2259
|
}) })
|
|
2256
2260
|
}
|
|
2257
|
-
) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-h-0 overflow-hidden", children: [
|
|
2261
|
+
) : /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col min-h-0 overflow-hidden", fillHeight && "flex-1"), children: [
|
|
2258
2262
|
/* @__PURE__ */ jsx(
|
|
2259
2263
|
"div",
|
|
2260
2264
|
{
|
|
2261
|
-
className: "flex flex-col justify-end overflow-hidden flex-shrink-0",
|
|
2262
|
-
style: { height: `${sectionHeight}px` },
|
|
2265
|
+
className: cn("flex flex-col justify-end overflow-hidden", !fillHeight && "flex-shrink-0"),
|
|
2266
|
+
style: fillHeight ? { flex: 1, minHeight: 0 } : { height: `${sectionHeight}px` },
|
|
2263
2267
|
children: isLoading ? Array.from({ length: effectiveLevels }).map((_, i) => /* @__PURE__ */ jsx(SkeletonRow, {}, `ask-skel-${i}`)) : askVisibleLevels.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center px-3 text-xs text-white/40", children: "No asks" }) : askVisibleLevels.map((l, i) => /* @__PURE__ */ jsx(
|
|
2264
2268
|
DepthRow,
|
|
2265
2269
|
{
|
|
@@ -2299,8 +2303,8 @@ function DesktopOrderbookLayout({
|
|
|
2299
2303
|
/* @__PURE__ */ jsx(
|
|
2300
2304
|
"div",
|
|
2301
2305
|
{
|
|
2302
|
-
className: "flex flex-col overflow-hidden flex-shrink-0",
|
|
2303
|
-
style: { height: `${sectionHeight}px` },
|
|
2306
|
+
className: cn("flex flex-col overflow-hidden", !fillHeight && "flex-shrink-0"),
|
|
2307
|
+
style: fillHeight ? { flex: 1, minHeight: 0 } : { height: `${sectionHeight}px` },
|
|
2304
2308
|
children: isLoading ? Array.from({ length: effectiveLevels }).map((_, i) => /* @__PURE__ */ jsx(SkeletonRow, {}, `bid-skel-${i}`)) : bidVisibleLevels.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center px-3 text-xs text-white/40", children: "No bids" }) : bidVisibleLevels.map((l, i) => /* @__PURE__ */ jsx(
|
|
2305
2309
|
DepthRow,
|
|
2306
2310
|
{
|
|
@@ -2737,7 +2741,8 @@ var formatDateShort = (value) => {
|
|
|
2737
2741
|
if (diffS < 60) return "Just now";
|
|
2738
2742
|
if (diffS < 3600) return `${Math.floor(diffS / 60)}m ago`;
|
|
2739
2743
|
if (diffS < 86400) return `${Math.floor(diffS / 3600)}h ago`;
|
|
2740
|
-
|
|
2744
|
+
const time = d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit", hour12: true });
|
|
2745
|
+
return `${time} \xB7 ${d.toLocaleDateString(void 0, { month: "short", day: "numeric" })}`;
|
|
2741
2746
|
};
|
|
2742
2747
|
var formatTimeAgo = (timestamp) => {
|
|
2743
2748
|
const diff = (Date.now() - new Date(timestamp).getTime()) / 1e3;
|