@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 CHANGED
@@ -107,6 +107,8 @@ interface OrderbookProps extends React$1.HTMLAttributes<HTMLDivElement> {
107
107
  tradeExplorerUrl?: (txHash: string) => string;
108
108
  /** Override the number of visible price levels per side (default 5). */
109
109
  maxLevels?: number;
110
+ /** When true, asks/bids sections stretch to fill the container instead of using fixed pixel heights. */
111
+ fillHeight?: boolean;
110
112
  }
111
113
  declare const Orderbook: React$1.ForwardRefExoticComponent<OrderbookProps & React$1.RefAttributes<HTMLDivElement>>;
112
114
 
package/dist/index.d.ts CHANGED
@@ -107,6 +107,8 @@ interface OrderbookProps extends React$1.HTMLAttributes<HTMLDivElement> {
107
107
  tradeExplorerUrl?: (txHash: string) => string;
108
108
  /** Override the number of visible price levels per side (default 5). */
109
109
  maxLevels?: number;
110
+ /** When true, asks/bids sections stretch to fill the container instead of using fixed pixel heights. */
111
+ fillHeight?: boolean;
110
112
  }
111
113
  declare const Orderbook: React$1.ForwardRefExoticComponent<OrderbookProps & React$1.RefAttributes<HTMLDivElement>>;
112
114
 
package/dist/index.js CHANGED
@@ -2005,6 +2005,7 @@ var Orderbook = React5__namespace.forwardRef(
2005
2005
  onLoafLiquidityClick,
2006
2006
  tradeExplorerUrl,
2007
2007
  maxLevels,
2008
+ fillHeight = false,
2008
2009
  className,
2009
2010
  ...props
2010
2011
  }, ref) => {
@@ -2105,7 +2106,8 @@ var Orderbook = React5__namespace.forwardRef(
2105
2106
  tradeExplorerUrl,
2106
2107
  onPriceClick,
2107
2108
  levelCount: effectiveLevels,
2108
- compactLevelCount: effectiveCompactLevels
2109
+ compactLevelCount: effectiveCompactLevels,
2110
+ fillHeight
2109
2111
  };
2110
2112
  return /* @__PURE__ */ jsxRuntime.jsx(
2111
2113
  Card,
@@ -2114,6 +2116,7 @@ var Orderbook = React5__namespace.forwardRef(
2114
2116
  className: cn(
2115
2117
  "w-full max-w-[520px] overflow-hidden rounded-[12px] border border-white/10 bg-[#111111] text-white shadow-md flex flex-col",
2116
2118
  isCompact && "max-w-none",
2119
+ fillHeight && "h-full",
2117
2120
  className
2118
2121
  ),
2119
2122
  ...props,
@@ -2175,7 +2178,8 @@ function DesktopOrderbookLayout({
2175
2178
  tradeExplorerUrl,
2176
2179
  onPriceClick,
2177
2180
  levelCount: effectiveLevels,
2178
- compactLevelCount: _compactLevelCount
2181
+ compactLevelCount: _compactLevelCount,
2182
+ fillHeight
2179
2183
  }) {
2180
2184
  const midRef = React5__namespace.useRef(null);
2181
2185
  useMidPriceFlash(midRef, midPrice, "#0b1a24");
@@ -2280,12 +2284,12 @@ function DesktopOrderbookLayout({
2280
2284
  );
2281
2285
  }) })
2282
2286
  }
2283
- ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col min-h-0 overflow-hidden", children: [
2287
+ ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col min-h-0 overflow-hidden", fillHeight && "flex-1"), children: [
2284
2288
  /* @__PURE__ */ jsxRuntime.jsx(
2285
2289
  "div",
2286
2290
  {
2287
- className: "flex flex-col justify-end overflow-hidden flex-shrink-0",
2288
- style: { height: `${sectionHeight}px` },
2291
+ className: cn("flex flex-col justify-end overflow-hidden", !fillHeight && "flex-shrink-0"),
2292
+ style: fillHeight ? { flex: 1, minHeight: 0 } : { height: `${sectionHeight}px` },
2289
2293
  children: isLoading ? Array.from({ length: effectiveLevels }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonRow, {}, `ask-skel-${i}`)) : askVisibleLevels.length === 0 ? /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
2290
2294
  DepthRow,
2291
2295
  {
@@ -2325,8 +2329,8 @@ function DesktopOrderbookLayout({
2325
2329
  /* @__PURE__ */ jsxRuntime.jsx(
2326
2330
  "div",
2327
2331
  {
2328
- className: "flex flex-col overflow-hidden flex-shrink-0",
2329
- style: { height: `${sectionHeight}px` },
2332
+ className: cn("flex flex-col overflow-hidden", !fillHeight && "flex-shrink-0"),
2333
+ style: fillHeight ? { flex: 1, minHeight: 0 } : { height: `${sectionHeight}px` },
2330
2334
  children: isLoading ? Array.from({ length: effectiveLevels }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonRow, {}, `bid-skel-${i}`)) : bidVisibleLevels.length === 0 ? /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
2331
2335
  DepthRow,
2332
2336
  {
@@ -2763,7 +2767,8 @@ var formatDateShort = (value) => {
2763
2767
  if (diffS < 60) return "Just now";
2764
2768
  if (diffS < 3600) return `${Math.floor(diffS / 60)}m ago`;
2765
2769
  if (diffS < 86400) return `${Math.floor(diffS / 3600)}h ago`;
2766
- return d.toLocaleDateString(void 0, { month: "short", day: "numeric" });
2770
+ const time = d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit", hour12: true });
2771
+ return `${time} \xB7 ${d.toLocaleDateString(void 0, { month: "short", day: "numeric" })}`;
2767
2772
  };
2768
2773
  var formatTimeAgo = (timestamp) => {
2769
2774
  const diff = (Date.now() - new Date(timestamp).getTime()) / 1e3;