@loafmarkets/ui 0.1.410 → 0.1.412

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
@@ -57,6 +57,23 @@ interface PortfolioSummaryProps extends React$1.HTMLAttributes<HTMLDivElement> {
57
57
  }
58
58
  declare const PortfolioSummary: React$1.ForwardRefExoticComponent<PortfolioSummaryProps & React$1.RefAttributes<HTMLDivElement>>;
59
59
 
60
+ /**
61
+ * The market maker's real state for this market — never decorative:
62
+ * active → green (quoting both sides)
63
+ * reduced → gold (one-sided / throttled)
64
+ * free → red (not quoting — peer-to-peer only)
65
+ * unknown → grey (no status from the API; NEVER a fabricated green)
66
+ * Same vocabulary as the consuming app's liquidityDotState() SSOT, which maps the
67
+ * API `liquidity.status` ('active' | 'limited' | 'inactive').
68
+ */
69
+ type LoafLiquidityDotState = "active" | "reduced" | "free" | "unknown";
70
+ interface LoafLiquidityBadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
71
+ isGlowing?: boolean;
72
+ /** Market-maker state driving the dot colour. Omitted → grey "unknown". */
73
+ status?: LoafLiquidityDotState;
74
+ }
75
+ declare const LoafLiquidityBadge: React$1.ForwardRefExoticComponent<LoafLiquidityBadgeProps & React$1.RefAttributes<HTMLSpanElement>>;
76
+
60
77
  type OrderbookSide = "ask" | "bid";
61
78
  type OrderbookLevel = {
62
79
  price: number;
@@ -105,6 +122,13 @@ interface OrderbookProps extends React$1.HTMLAttributes<HTMLDivElement> {
105
122
  * a custom `rightHeader` is supplied.
106
123
  */
107
124
  onLoafLiquidityClick?: () => void;
125
+ /**
126
+ * Market-maker state for THIS market, driving the Loaf Liquidity badge dot.
127
+ * Consumers map the API `liquidity.status` ('active' | 'limited' | 'inactive')
128
+ * through their liquidityDotState() SSOT. Omitted → grey "unknown" — the dot is
129
+ * never a decorative green.
130
+ */
131
+ liquidityStatus?: LoafLiquidityDotState;
108
132
  /** Given a trade's txHash, returns the full explorer URL to link to. Defaults to Sepolia Etherscan. */
109
133
  tradeExplorerUrl?: (txHash: string) => string;
110
134
  /** Override the number of visible price levels per side (default 5). */
@@ -329,11 +353,6 @@ type TradeConfirmationModalProps = {
329
353
  };
330
354
  declare function TradeConfirmationModal({ isOpen, onClose, onConfirm, orderDetails, className, estimatedFeeUsd: _estimatedFeeUsd, estimatedFeeBps: _estimatedFeeBps, totalWithFeesUsd, confirmDisabled, confirmLoading, rememberChoiceChecked, rememberChoiceLabel, onRememberChoiceChange, }: TradeConfirmationModalProps): React$1.ReactElement | null;
331
355
 
332
- interface LoafLiquidityBadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
333
- isGlowing?: boolean;
334
- }
335
- declare const LoafLiquidityBadge: React$1.ForwardRefExoticComponent<LoafLiquidityBadgeProps & React$1.RefAttributes<HTMLSpanElement>>;
336
-
337
356
  type LoafLiquidityLogoProps = {
338
357
  onClick?: () => void;
339
358
  isGlowing?: boolean;
@@ -1043,6 +1062,18 @@ type PortfolioActivityPanelProps = {
1043
1062
  /** Click handler for the asset name in the Open Orders / Order History / Trade History rows — opens that asset. */
1044
1063
  onAssetClick?: (tokenName: string) => void;
1045
1064
  onClosePosition?: (tokenName: string, type: 'market' | 'limit', quantity: number, marketPrice: number) => void;
1065
+ /**
1066
+ * Close EVERY open position, in one handover to the host page. Sell All only
1067
+ * renders when this is provided.
1068
+ *
1069
+ * The panel deliberately does not sequence this itself: `onClosePosition` is
1070
+ * the per-ROW action, and on a trading page it re-points the page at that
1071
+ * row's market — so fanning it out per position navigated once per position
1072
+ * and closed nothing. The host owns ordering, per-order submission and the
1073
+ * result report (and, once the backend session signer is retired, the
1074
+ * signature prompt each order needs).
1075
+ */
1076
+ onCloseAllPositions?: (type: 'market' | 'limit') => Promise<void> | void;
1046
1077
  /** Open the shareable position card for a held position. */
1047
1078
  onSharePosition?: (pos: PortfolioPosition) => void;
1048
1079
  offeringOrders?: readonly OfferingOrder[];
@@ -1061,7 +1092,7 @@ type PortfolioActivityPanelProps = {
1061
1092
  className?: string;
1062
1093
  style?: React.CSSProperties;
1063
1094
  };
1064
- declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onSharePosition, onAssetClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, cancellingOrderId, compactPositions, defaultTab, onTabChange, pageSize, blockExplorerBaseUrl: _blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
1095
+ declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onSharePosition, onAssetClick, onClosePosition, onCloseAllPositions, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, cancellingOrderId, compactPositions, defaultTab, onTabChange, pageSize, blockExplorerBaseUrl: _blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
1065
1096
 
1066
1097
  type SelectorItem = {
1067
1098
  readonly tokenName: string;
@@ -1356,4 +1387,4 @@ declare function extractSparkline(candles: ReadonlyArray<{
1356
1387
  }>, maxPoints?: number): number[];
1357
1388
  declare const SparklineChart: React__default.NamedExoticComponent<SparklineChartProps>;
1358
1389
 
1359
- export { type ActivityTabId, AssetSelectorBar, type AssetSelectorBarProps, type AssetSelectorMetric, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, ContactPopup, type ContactPopupProps, type FinancialItem, type FundWalletParams, type FundWalletResult, Header, type HeaderNavItem, type HeaderPortfolioData, type HeaderProps, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, type InspectionSlot, LoafLiquidityBadge, LoafLiquidityLogo, type LoafLiquidityLogoProps, LoginPopup, type LoginPopupProps, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, type OfferStatus, OfferingProgressCard, type OfferingProgressCardProps, OnboardingGuide, type OnboardingGuideProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, type OverviewImage, type OverviewResponse, OwnerBooking, type OwnerBookingProps, PaymentPopup, type PaymentPopupProps, PortfolioActivityPanel, type PortfolioActivityPanelProps, type PortfolioPosition, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyBuy, PropertyCompareBar, type PropertyCompareBarProps, PropertyDocuments, type PropertyGalleryHotspot, type PropertyGalleryImage, PropertyHeroHeader, type PropertyHeroHeaderProps, PropertyHistory, type PropertyInfoItem, PropertyInspectionTimes, PropertyMediaRow, type PropertyMediaRowProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyOffer, PropertyOffers, type PropertyOffersProps, PropertyOverview, type PropertyOverviewProps, PropertyPhotoGallery, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, PropertyValuation, type PropertyValuationProps, type PropertyValueSummary, type PurchaseFeedItem, type SelectorItem, SiteFooter, Skeleton, type SkeletonProps, SlideDigit, SparklineChart, type SparklineChartProps, type ToastData, ToastProvider, type ToastVariant, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants, extractSparkline, hasPendingActivity, useAdaptivePolling, useToast };
1390
+ export { type ActivityTabId, AssetSelectorBar, type AssetSelectorBarProps, type AssetSelectorMetric, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, ContactPopup, type ContactPopupProps, type FinancialItem, type FundWalletParams, type FundWalletResult, Header, type HeaderNavItem, type HeaderPortfolioData, type HeaderProps, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, type InspectionSlot, LoafLiquidityBadge, type LoafLiquidityDotState, LoafLiquidityLogo, type LoafLiquidityLogoProps, LoginPopup, type LoginPopupProps, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, type OfferStatus, OfferingProgressCard, type OfferingProgressCardProps, OnboardingGuide, type OnboardingGuideProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, type OverviewImage, type OverviewResponse, OwnerBooking, type OwnerBookingProps, PaymentPopup, type PaymentPopupProps, PortfolioActivityPanel, type PortfolioActivityPanelProps, type PortfolioPosition, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyBuy, PropertyCompareBar, type PropertyCompareBarProps, PropertyDocuments, type PropertyGalleryHotspot, type PropertyGalleryImage, PropertyHeroHeader, type PropertyHeroHeaderProps, PropertyHistory, type PropertyInfoItem, PropertyInspectionTimes, PropertyMediaRow, type PropertyMediaRowProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyOffer, PropertyOffers, type PropertyOffersProps, PropertyOverview, type PropertyOverviewProps, PropertyPhotoGallery, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, PropertyValuation, type PropertyValuationProps, type PropertyValueSummary, type PurchaseFeedItem, type SelectorItem, SiteFooter, Skeleton, type SkeletonProps, SlideDigit, SparklineChart, type SparklineChartProps, type ToastData, ToastProvider, type ToastVariant, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants, extractSparkline, hasPendingActivity, useAdaptivePolling, useToast };
package/dist/index.d.ts CHANGED
@@ -57,6 +57,23 @@ interface PortfolioSummaryProps extends React$1.HTMLAttributes<HTMLDivElement> {
57
57
  }
58
58
  declare const PortfolioSummary: React$1.ForwardRefExoticComponent<PortfolioSummaryProps & React$1.RefAttributes<HTMLDivElement>>;
59
59
 
60
+ /**
61
+ * The market maker's real state for this market — never decorative:
62
+ * active → green (quoting both sides)
63
+ * reduced → gold (one-sided / throttled)
64
+ * free → red (not quoting — peer-to-peer only)
65
+ * unknown → grey (no status from the API; NEVER a fabricated green)
66
+ * Same vocabulary as the consuming app's liquidityDotState() SSOT, which maps the
67
+ * API `liquidity.status` ('active' | 'limited' | 'inactive').
68
+ */
69
+ type LoafLiquidityDotState = "active" | "reduced" | "free" | "unknown";
70
+ interface LoafLiquidityBadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
71
+ isGlowing?: boolean;
72
+ /** Market-maker state driving the dot colour. Omitted → grey "unknown". */
73
+ status?: LoafLiquidityDotState;
74
+ }
75
+ declare const LoafLiquidityBadge: React$1.ForwardRefExoticComponent<LoafLiquidityBadgeProps & React$1.RefAttributes<HTMLSpanElement>>;
76
+
60
77
  type OrderbookSide = "ask" | "bid";
61
78
  type OrderbookLevel = {
62
79
  price: number;
@@ -105,6 +122,13 @@ interface OrderbookProps extends React$1.HTMLAttributes<HTMLDivElement> {
105
122
  * a custom `rightHeader` is supplied.
106
123
  */
107
124
  onLoafLiquidityClick?: () => void;
125
+ /**
126
+ * Market-maker state for THIS market, driving the Loaf Liquidity badge dot.
127
+ * Consumers map the API `liquidity.status` ('active' | 'limited' | 'inactive')
128
+ * through their liquidityDotState() SSOT. Omitted → grey "unknown" — the dot is
129
+ * never a decorative green.
130
+ */
131
+ liquidityStatus?: LoafLiquidityDotState;
108
132
  /** Given a trade's txHash, returns the full explorer URL to link to. Defaults to Sepolia Etherscan. */
109
133
  tradeExplorerUrl?: (txHash: string) => string;
110
134
  /** Override the number of visible price levels per side (default 5). */
@@ -329,11 +353,6 @@ type TradeConfirmationModalProps = {
329
353
  };
330
354
  declare function TradeConfirmationModal({ isOpen, onClose, onConfirm, orderDetails, className, estimatedFeeUsd: _estimatedFeeUsd, estimatedFeeBps: _estimatedFeeBps, totalWithFeesUsd, confirmDisabled, confirmLoading, rememberChoiceChecked, rememberChoiceLabel, onRememberChoiceChange, }: TradeConfirmationModalProps): React$1.ReactElement | null;
331
355
 
332
- interface LoafLiquidityBadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
333
- isGlowing?: boolean;
334
- }
335
- declare const LoafLiquidityBadge: React$1.ForwardRefExoticComponent<LoafLiquidityBadgeProps & React$1.RefAttributes<HTMLSpanElement>>;
336
-
337
356
  type LoafLiquidityLogoProps = {
338
357
  onClick?: () => void;
339
358
  isGlowing?: boolean;
@@ -1043,6 +1062,18 @@ type PortfolioActivityPanelProps = {
1043
1062
  /** Click handler for the asset name in the Open Orders / Order History / Trade History rows — opens that asset. */
1044
1063
  onAssetClick?: (tokenName: string) => void;
1045
1064
  onClosePosition?: (tokenName: string, type: 'market' | 'limit', quantity: number, marketPrice: number) => void;
1065
+ /**
1066
+ * Close EVERY open position, in one handover to the host page. Sell All only
1067
+ * renders when this is provided.
1068
+ *
1069
+ * The panel deliberately does not sequence this itself: `onClosePosition` is
1070
+ * the per-ROW action, and on a trading page it re-points the page at that
1071
+ * row's market — so fanning it out per position navigated once per position
1072
+ * and closed nothing. The host owns ordering, per-order submission and the
1073
+ * result report (and, once the backend session signer is retired, the
1074
+ * signature prompt each order needs).
1075
+ */
1076
+ onCloseAllPositions?: (type: 'market' | 'limit') => Promise<void> | void;
1046
1077
  /** Open the shareable position card for a held position. */
1047
1078
  onSharePosition?: (pos: PortfolioPosition) => void;
1048
1079
  offeringOrders?: readonly OfferingOrder[];
@@ -1061,7 +1092,7 @@ type PortfolioActivityPanelProps = {
1061
1092
  className?: string;
1062
1093
  style?: React.CSSProperties;
1063
1094
  };
1064
- declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onSharePosition, onAssetClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, cancellingOrderId, compactPositions, defaultTab, onTabChange, pageSize, blockExplorerBaseUrl: _blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
1095
+ declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onSharePosition, onAssetClick, onClosePosition, onCloseAllPositions, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, cancellingOrderId, compactPositions, defaultTab, onTabChange, pageSize, blockExplorerBaseUrl: _blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
1065
1096
 
1066
1097
  type SelectorItem = {
1067
1098
  readonly tokenName: string;
@@ -1356,4 +1387,4 @@ declare function extractSparkline(candles: ReadonlyArray<{
1356
1387
  }>, maxPoints?: number): number[];
1357
1388
  declare const SparklineChart: React__default.NamedExoticComponent<SparklineChartProps>;
1358
1389
 
1359
- export { type ActivityTabId, AssetSelectorBar, type AssetSelectorBarProps, type AssetSelectorMetric, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, ContactPopup, type ContactPopupProps, type FinancialItem, type FundWalletParams, type FundWalletResult, Header, type HeaderNavItem, type HeaderPortfolioData, type HeaderProps, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, type InspectionSlot, LoafLiquidityBadge, LoafLiquidityLogo, type LoafLiquidityLogoProps, LoginPopup, type LoginPopupProps, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, type OfferStatus, OfferingProgressCard, type OfferingProgressCardProps, OnboardingGuide, type OnboardingGuideProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, type OverviewImage, type OverviewResponse, OwnerBooking, type OwnerBookingProps, PaymentPopup, type PaymentPopupProps, PortfolioActivityPanel, type PortfolioActivityPanelProps, type PortfolioPosition, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyBuy, PropertyCompareBar, type PropertyCompareBarProps, PropertyDocuments, type PropertyGalleryHotspot, type PropertyGalleryImage, PropertyHeroHeader, type PropertyHeroHeaderProps, PropertyHistory, type PropertyInfoItem, PropertyInspectionTimes, PropertyMediaRow, type PropertyMediaRowProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyOffer, PropertyOffers, type PropertyOffersProps, PropertyOverview, type PropertyOverviewProps, PropertyPhotoGallery, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, PropertyValuation, type PropertyValuationProps, type PropertyValueSummary, type PurchaseFeedItem, type SelectorItem, SiteFooter, Skeleton, type SkeletonProps, SlideDigit, SparklineChart, type SparklineChartProps, type ToastData, ToastProvider, type ToastVariant, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants, extractSparkline, hasPendingActivity, useAdaptivePolling, useToast };
1390
+ export { type ActivityTabId, AssetSelectorBar, type AssetSelectorBarProps, type AssetSelectorMetric, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, ContactPopup, type ContactPopupProps, type FinancialItem, type FundWalletParams, type FundWalletResult, Header, type HeaderNavItem, type HeaderPortfolioData, type HeaderProps, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, type InspectionSlot, LoafLiquidityBadge, type LoafLiquidityDotState, LoafLiquidityLogo, type LoafLiquidityLogoProps, LoginPopup, type LoginPopupProps, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, type OfferStatus, OfferingProgressCard, type OfferingProgressCardProps, OnboardingGuide, type OnboardingGuideProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, type OverviewImage, type OverviewResponse, OwnerBooking, type OwnerBookingProps, PaymentPopup, type PaymentPopupProps, PortfolioActivityPanel, type PortfolioActivityPanelProps, type PortfolioPosition, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyBuy, PropertyCompareBar, type PropertyCompareBarProps, PropertyDocuments, type PropertyGalleryHotspot, type PropertyGalleryImage, PropertyHeroHeader, type PropertyHeroHeaderProps, PropertyHistory, type PropertyInfoItem, PropertyInspectionTimes, PropertyMediaRow, type PropertyMediaRowProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyOffer, PropertyOffers, type PropertyOffersProps, PropertyOverview, type PropertyOverviewProps, PropertyPhotoGallery, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, PropertyValuation, type PropertyValuationProps, type PropertyValueSummary, type PurchaseFeedItem, type SelectorItem, SiteFooter, Skeleton, type SkeletonProps, SlideDigit, SparklineChart, type SparklineChartProps, type ToastData, ToastProvider, type ToastVariant, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants, extractSparkline, hasPendingActivity, useAdaptivePolling, useToast };
package/dist/index.js CHANGED
@@ -1640,12 +1640,23 @@ var StatusDot = styled10__default.default.span`
1640
1640
  width: 6px;
1641
1641
  height: 6px;
1642
1642
  border-radius: 50%;
1643
- background: #0ecb81;
1644
1643
  flex-shrink: 0;
1645
- animation: ${breathe} 3s ease-in-out infinite;
1644
+
1645
+ ${({ $state }) => $state === "active" ? styled10.css`
1646
+ background: #0ecb81;
1647
+ animation: ${breathe} 3s ease-in-out infinite;
1648
+ ` : $state === "reduced" ? styled10.css`
1649
+ background: #e6c87e;
1650
+ box-shadow: 0 0 4px rgba(240, 185, 11, 0.4);
1651
+ ` : $state === "free" ? styled10.css`
1652
+ background: #f6465d;
1653
+ box-shadow: 0 0 4px rgba(246, 70, 93, 0.4);
1654
+ ` : styled10.css`
1655
+ background: rgba(255, 255, 255, 0.3);
1656
+ `}
1646
1657
  `;
1647
1658
  var LoafLiquidityBadge = React5__namespace.forwardRef(
1648
- ({ className, isGlowing, onClick, children, ...props }, ref) => {
1659
+ ({ className, isGlowing, status = "unknown", onClick, children, ...props }, ref) => {
1649
1660
  return /* @__PURE__ */ jsxRuntime.jsxs(
1650
1661
  LogoContainer,
1651
1662
  {
@@ -1656,11 +1667,11 @@ var LoafLiquidityBadge = React5__namespace.forwardRef(
1656
1667
  role: onClick ? "button" : void 0,
1657
1668
  ...props,
1658
1669
  children: [
1659
- /* @__PURE__ */ jsxRuntime.jsxs(LogoText, { children: [
1670
+ /* @__PURE__ */ jsxRuntime.jsxs(LogoText, { className: "loaf-ll-label", children: [
1660
1671
  /* @__PURE__ */ jsxRuntime.jsx(LoafLogoImage, { src: Loaf_logo_Banner_default, alt: "Loaf" }),
1661
1672
  /* @__PURE__ */ jsxRuntime.jsx(LiquidityText, { children: children ?? "Liquidity" })
1662
1673
  ] }),
1663
- /* @__PURE__ */ jsxRuntime.jsx(StatusDot, {})
1674
+ /* @__PURE__ */ jsxRuntime.jsx(StatusDot, { $state: status, "data-liquidity": status })
1664
1675
  ]
1665
1676
  }
1666
1677
  );
@@ -1907,13 +1918,21 @@ var Orderbook = React5__namespace.forwardRef(
1907
1918
  isLoading = false,
1908
1919
  onPriceClick,
1909
1920
  onLoafLiquidityClick,
1921
+ liquidityStatus,
1910
1922
  tradeExplorerUrl,
1911
1923
  maxLevels,
1912
1924
  fillHeight = false,
1913
1925
  className,
1914
1926
  ...props
1915
1927
  }, ref) => {
1916
- const resolvedRightHeader = rightHeader ?? /* @__PURE__ */ jsxRuntime.jsx(LoafLiquidityBadge, { className: "text-[0.6rem] orderbook-ll-badge", onClick: onLoafLiquidityClick });
1928
+ const resolvedRightHeader = rightHeader ?? /* @__PURE__ */ jsxRuntime.jsx(
1929
+ LoafLiquidityBadge,
1930
+ {
1931
+ className: "text-[0.6rem] orderbook-ll-badge",
1932
+ onClick: onLoafLiquidityClick,
1933
+ status: liquidityStatus
1934
+ }
1935
+ );
1917
1936
  const [tab, setTabState] = React5__namespace.useState(defaultTab);
1918
1937
  const setTab = setTabState;
1919
1938
  const effectiveTab = showTradesTab ? tab : "orderbook";
@@ -15203,6 +15222,7 @@ function PortfolioActivityPanel({
15203
15222
  onSharePosition,
15204
15223
  onAssetClick,
15205
15224
  onClosePosition,
15225
+ onCloseAllPositions,
15206
15226
  offeringOrders = [],
15207
15227
  openOrders = [],
15208
15228
  orderHistory = [],
@@ -15227,6 +15247,8 @@ function PortfolioActivityPanel({
15227
15247
  const [cancellingAll, setCancellingAll] = React5.useState(false);
15228
15248
  const [closeAllOpen, setCloseAllOpen] = React5.useState(false);
15229
15249
  const [closeAllType, setCloseAllType] = React5.useState("market");
15250
+ const [closingAll, setClosingAll] = React5.useState(false);
15251
+ const hasPositionActions = !!(onClosePosition || onSharePosition || onCloseAllPositions);
15230
15252
  const [posSortKey, setPosSortKey] = React5.useState("asset");
15231
15253
  const [posSortAsc, setPosSortAsc] = React5.useState(true);
15232
15254
  const handlePosSort = (key) => {
@@ -15405,7 +15427,6 @@ function PortfolioActivityPanel({
15405
15427
  const pagedTradeHistory = sortedTradeHistory.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
15406
15428
  const pagedTransfers = sortedTransfers.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
15407
15429
  return /* @__PURE__ */ jsxRuntime.jsxs(Container2, { className, style, children: [
15408
- /* @__PURE__ */ jsxRuntime.jsx(PanelTitle, { children: "Activity" }),
15409
15430
  /* @__PURE__ */ jsxRuntime.jsxs(TabContainer, { children: [
15410
15431
  showPositionsTab && /* @__PURE__ */ jsxRuntime.jsxs(Tab, { $active: activeTab === "positions", onClick: () => handleTabChange("positions"), children: [
15411
15432
  "Trading Positions",
@@ -15461,7 +15482,7 @@ function PortfolioActivityPanel({
15461
15482
  ] }),
15462
15483
  /* @__PURE__ */ jsxRuntime.jsxs(CToolbarActions, { children: [
15463
15484
  /* @__PURE__ */ jsxRuntime.jsx(CToolbarLink, { onClick: toggleExpandAll, children: allExpanded ? "Collapse All" : "Expand All" }),
15464
- onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(CToolbarLink, { onClick: () => setCloseAllOpen(true), children: "Sell All" })
15485
+ onCloseAllPositions && /* @__PURE__ */ jsxRuntime.jsx(CToolbarLink, { onClick: () => setCloseAllOpen(true), children: "Sell All" })
15465
15486
  ] })
15466
15487
  ] }),
15467
15488
  sortedPositions.map((pos) => {
@@ -15537,7 +15558,7 @@ function PortfolioActivityPanel({
15537
15558
  })
15538
15559
  ] }),
15539
15560
  positions.length > 0 && !compactPositions && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
15540
- /* @__PURE__ */ jsxRuntime.jsxs(PositionsHeader, { $hasClose: !!(onClosePosition || onSharePosition), children: [
15561
+ /* @__PURE__ */ jsxRuntime.jsxs(PositionsHeader, { $hasClose: hasPositionActions, children: [
15541
15562
  /* @__PURE__ */ jsxRuntime.jsxs(SortableHeaderCell, { $active: posSortKey === "asset", onClick: () => handlePosSort("asset"), children: [
15542
15563
  "Asset ",
15543
15564
  posSortKey === "asset" && (posSortAsc ? "\u2191" : "\u2193")
@@ -15562,7 +15583,7 @@ function PortfolioActivityPanel({
15562
15583
  "PNL (%) ",
15563
15584
  posSortKey === "pnl" && (posSortAsc ? "\u2191" : "\u2193")
15564
15585
  ] }),
15565
- onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(PositionsHeaderCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CloseAllHeaderBtn, { onClick: () => setCloseAllOpen(true), children: "Sell All" }) })
15586
+ onCloseAllPositions && /* @__PURE__ */ jsxRuntime.jsx(PositionsHeaderCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CloseAllHeaderBtn, { onClick: () => setCloseAllOpen(true), children: "Sell All" }) })
15566
15587
  ] }),
15567
15588
  sortedPositions.map((pos) => {
15568
15589
  const currentValue = pos.totalQuantity * pos.marketPrice;
@@ -15570,7 +15591,7 @@ function PortfolioActivityPanel({
15570
15591
  const pnl = pos.propertyPnl ?? currentValue - costBasis;
15571
15592
  const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
15572
15593
  const isPositive = pnl >= 0;
15573
- return /* @__PURE__ */ jsxRuntime.jsxs(PositionsRow, { $hasClose: !!(onClosePosition || onSharePosition), children: [
15594
+ return /* @__PURE__ */ jsxRuntime.jsxs(PositionsRow, { $hasClose: hasPositionActions, children: [
15574
15595
  /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
15575
15596
  /* @__PURE__ */ jsxRuntime.jsx(HoldingsPropertyLink, { onClick: () => onPositionClick?.(pos.tokenName, pos.isIpoAllocation), children: pos.tokenName }),
15576
15597
  pos.settling && /* @__PURE__ */ jsxRuntime.jsx(SettlingTip, { children: /* @__PURE__ */ jsxRuntime.jsx(SettlingSpinner, {}) })
@@ -15617,11 +15638,15 @@ function PortfolioActivityPanel({
15617
15638
  ] }, pos.tokenName);
15618
15639
  })
15619
15640
  ] }),
15620
- positions.length > 0 && closeAllOpen && onClosePosition && typeof document !== "undefined" && ReactDOM.createPortal(
15621
- /* @__PURE__ */ jsxRuntime.jsx(CloseAllOverlay, { onClick: () => setCloseAllOpen(false), children: /* @__PURE__ */ jsxRuntime.jsxs(CloseAllModal, { onClick: (e) => e.stopPropagation(), children: [
15622
- /* @__PURE__ */ jsxRuntime.jsx(CloseAllModalX, { onClick: () => setCloseAllOpen(false), children: "\xD7" }),
15641
+ positions.length > 0 && closeAllOpen && onCloseAllPositions && typeof document !== "undefined" && ReactDOM.createPortal(
15642
+ /* @__PURE__ */ jsxRuntime.jsx(CloseAllOverlay, { onClick: () => {
15643
+ if (!closingAll) setCloseAllOpen(false);
15644
+ }, children: /* @__PURE__ */ jsxRuntime.jsxs(CloseAllModal, { onClick: (e) => e.stopPropagation(), children: [
15645
+ /* @__PURE__ */ jsxRuntime.jsx(CloseAllModalX, { onClick: () => {
15646
+ if (!closingAll) setCloseAllOpen(false);
15647
+ }, children: "\xD7" }),
15623
15648
  /* @__PURE__ */ jsxRuntime.jsx(CloseAllTitle, { children: "Confirm Sell All" }),
15624
- /* @__PURE__ */ jsxRuntime.jsx(CloseAllDesc, { children: "This will sell all your positions and cancel their associated TP/SL orders." }),
15649
+ /* @__PURE__ */ jsxRuntime.jsx(CloseAllDesc, { children: "This places a sell order for every position you hold, one at a time." }),
15625
15650
  /* @__PURE__ */ jsxRuntime.jsxs(CloseAllOption, { onClick: () => setCloseAllType("market"), children: [
15626
15651
  /* @__PURE__ */ jsxRuntime.jsx(CloseAllRadio, { $selected: closeAllType === "market" }),
15627
15652
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Market Sell" })
@@ -15630,14 +15655,22 @@ function PortfolioActivityPanel({
15630
15655
  /* @__PURE__ */ jsxRuntime.jsx(CloseAllRadio, { $selected: closeAllType === "limit" }),
15631
15656
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Limit Sell at Mid Price" })
15632
15657
  ] }),
15633
- /* @__PURE__ */ jsxRuntime.jsxs(CloseAllConfirmBtn, { onClick: () => {
15634
- positions.forEach((pos) => onClosePosition(pos.tokenName, closeAllType, pos.quantity, pos.marketPrice));
15635
- setCloseAllOpen(false);
15636
- }, children: [
15637
- "Confirm ",
15638
- closeAllType === "market" ? "Market" : "Limit",
15639
- " Sell"
15640
- ] })
15658
+ /* @__PURE__ */ jsxRuntime.jsx(
15659
+ CloseAllConfirmBtn,
15660
+ {
15661
+ disabled: closingAll,
15662
+ onClick: async () => {
15663
+ setClosingAll(true);
15664
+ try {
15665
+ await onCloseAllPositions(closeAllType);
15666
+ } finally {
15667
+ setClosingAll(false);
15668
+ setCloseAllOpen(false);
15669
+ }
15670
+ },
15671
+ children: closingAll ? "Selling\u2026" : `Confirm ${closeAllType === "market" ? "Market" : "Limit"} Sell`
15672
+ }
15673
+ )
15641
15674
  ] }) }),
15642
15675
  document.body
15643
15676
  )
@@ -16196,17 +16229,6 @@ var ContentScroll = styled10__default.default.div`
16196
16229
  &::-webkit-scrollbar-track { background: transparent; }
16197
16230
  &::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }
16198
16231
  `;
16199
- var PanelTitle = styled10__default.default.h3`
16200
- font-size: 1rem;
16201
- font-weight: 600;
16202
- color: var(--color-text, #fff);
16203
- margin: 0 0 0.75rem;
16204
- padding-left: 1rem;
16205
- /* Redundant on mobile — the tab row already says what this is. Reclaim the space. */
16206
- @media (max-width: 768px) {
16207
- display: none;
16208
- }
16209
- `;
16210
16232
  var TabContainer = styled10__default.default.div`
16211
16233
  display: flex;
16212
16234
  gap: 0;
@@ -16659,9 +16681,14 @@ var CloseAllConfirmBtn = styled10__default.default.button`
16659
16681
  cursor: pointer;
16660
16682
  transition: all 0.15s ease;
16661
16683
 
16662
- &:hover {
16684
+ &:hover:not(:disabled) {
16663
16685
  background: rgba(246, 70, 93, 0.25);
16664
16686
  }
16687
+
16688
+ &:disabled {
16689
+ opacity: 0.5;
16690
+ cursor: not-allowed;
16691
+ }
16665
16692
  `;
16666
16693
  var CToolbar = styled10__default.default.div`
16667
16694
  display: flex;