@loafmarkets/ui 0.1.97 → 0.1.99

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
 
@@ -913,8 +915,9 @@ type AssetSelectorBarProps = {
913
915
  selectorItems?: readonly SelectorItem[];
914
916
  onSelect?: (tokenName: string) => void;
915
917
  trailing?: ReactNode;
918
+ imageUrl?: string;
916
919
  };
917
- declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
920
+ declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, imageUrl, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
918
921
 
919
922
  type IpoStatus = 'PENDING' | 'LIVE' | 'CLOSED' | 'CANCELLED';
920
923
  type SaleData = {
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
 
@@ -913,8 +915,9 @@ type AssetSelectorBarProps = {
913
915
  selectorItems?: readonly SelectorItem[];
914
916
  onSelect?: (tokenName: string) => void;
915
917
  trailing?: ReactNode;
918
+ imageUrl?: string;
916
919
  };
917
- declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
920
+ declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, imageUrl, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
918
921
 
919
922
  type IpoStatus = 'PENDING' | 'LIVE' | 'CLOSED' | 'CANCELLED';
920
923
  type SaleData = {
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
  {
@@ -9671,7 +9675,8 @@ function AssetSelectorBar({
9671
9675
  currentTokenName,
9672
9676
  selectorItems,
9673
9677
  onSelect,
9674
- trailing
9678
+ trailing,
9679
+ imageUrl
9675
9680
  }) {
9676
9681
  const [isDropdownOpen, setIsDropdownOpen] = React5.useState(false);
9677
9682
  const hasItems = selectorItems && selectorItems.length > 0;
@@ -9680,6 +9685,7 @@ function AssetSelectorBar({
9680
9685
  ...offeringValuation != null ? [{ label: "Offering Valuation", value: `$${offeringValuation.toLocaleString()}` }] : []
9681
9686
  ];
9682
9687
  return /* @__PURE__ */ jsxRuntime.jsx(AssetSelectorWrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(IPOAssetSelector, { children: [
9688
+ imageUrl && /* @__PURE__ */ jsxRuntime.jsx(AssetThumbnail, { src: imageUrl, alt: propertyName }),
9683
9689
  /* @__PURE__ */ jsxRuntime.jsx(AssetSelectorDropdown, { onClick: () => hasItems && setIsDropdownOpen((prev) => !prev), children: /* @__PURE__ */ jsxRuntime.jsxs(AssetName, { children: [
9684
9690
  propertyName,
9685
9691
  hasItems && /* @__PURE__ */ jsxRuntime.jsx(
@@ -9769,6 +9775,20 @@ var IPOAssetSelector = styled25__default.default.div`
9769
9775
  padding: 0.6rem 0.75rem;
9770
9776
  }
9771
9777
  `;
9778
+ var AssetThumbnail = styled25__default.default.img`
9779
+ width: 40px;
9780
+ height: 40px;
9781
+ border-radius: 8px;
9782
+ object-fit: cover;
9783
+ flex-shrink: 0;
9784
+ border: 1px solid rgba(255, 255, 255, 0.1);
9785
+
9786
+ @media (max-width: 768px) {
9787
+ width: 32px;
9788
+ height: 32px;
9789
+ border-radius: 6px;
9790
+ }
9791
+ `;
9772
9792
  var AssetSelectorDropdown = styled25__default.default.div`
9773
9793
  display: flex;
9774
9794
  align-items: center;
@@ -11968,7 +11988,7 @@ function PortfolioActivityPanel({
11968
11988
  ] }),
11969
11989
  /* @__PURE__ */ jsxRuntime.jsxs(HoldingsQuantity, { children: [
11970
11990
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
11971
- pos.quantity.toFixed(2),
11991
+ formatNumber2(pos.quantity),
11972
11992
  " ",
11973
11993
  pos.tokenName
11974
11994
  ] }),
@@ -11980,8 +12000,7 @@ function PortfolioActivityPanel({
11980
12000
  /* @__PURE__ */ jsxRuntime.jsxs(HoldingsPnL, { children: [
11981
12001
  /* @__PURE__ */ jsxRuntime.jsxs(PnLAmount, { $positive: isPositive, children: [
11982
12002
  isPositive ? "+" : "-",
11983
- "$",
11984
- Math.abs(pnl).toFixed(2)
12003
+ formatCurrency5(Math.abs(pnl))
11985
12004
  ] }),
11986
12005
  /* @__PURE__ */ jsxRuntime.jsxs(PnLPercentage, { $positive: isPositive, children: [
11987
12006
  isPositive ? "+" : "",