@loafmarkets/ui 0.1.385 → 0.1.387

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
@@ -643,7 +643,26 @@ type HeaderPortfolioData = {
643
643
  pnl: number;
644
644
  pnlPercent: number;
645
645
  };
646
- type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "leaderboard" | "leaderboardPage" | "about" | "portfolio" | "learn" | "api";
646
+ /**
647
+ * A single nav entry. The consuming app owns the entire nav set (which tabs,
648
+ * their labels, order and grouping) — the Header is a render-only view of this
649
+ * list, so different products/branches ship the same Header and only differ in
650
+ * the array they pass.
651
+ */
652
+ type HeaderNavItem = {
653
+ /** Stable id; also the value matched against `activeKey`. */
654
+ key: string;
655
+ label: string;
656
+ path: string;
657
+ /** Opens in a new tab (e.g. external Docs); never inferred active. */
658
+ external?: boolean;
659
+ /** "primary" = on the bar (default); "more" = inside the More dropdown. */
660
+ group?: "primary" | "more";
661
+ /** Active-tab inference: "exact" (default) or "prefix" (e.g. /offerings/*). */
662
+ match?: "exact" | "prefix";
663
+ /** Overrides navigation when clicked (e.g. trade chunk warm-up). */
664
+ onSelect?: () => void;
665
+ };
647
666
  type HeaderLoginPopupComponentProps = {
648
667
  onClose: () => void;
649
668
  initialView?: LoginPopupView;
@@ -652,21 +671,16 @@ type HeaderProps = {
652
671
  currentUser?: HeaderUser | null;
653
672
  isAuthenticated?: boolean;
654
673
  locationPath?: string;
655
- activeTab?: HeaderActiveTab;
674
+ /** The full nav set, owned by the consuming app. Rendered in order. */
675
+ navItems: HeaderNavItem[];
676
+ /** Force a nav item active by its `key`; otherwise inferred from locationPath. */
677
+ activeKey?: string;
656
678
  onNavigate?: (path: string) => void;
657
679
  onLogout?: () => Promise<void> | void;
658
680
  onSignInClick?: () => void;
659
681
  loginPopupComponent?: React__default.ComponentType<HeaderLoginPopupComponentProps>;
660
- tradePath?: string;
682
+ /** Logo link target (the logo is not a nav item). */
661
683
  homePath?: string;
662
- aboutPath?: string;
663
- learnPath?: string;
664
- apiPath?: string;
665
- offeringsPath?: string;
666
- propertyMapPath?: string;
667
- leaderboardPath?: string;
668
- leaderboardPagePath?: string;
669
- portfolioPath?: string;
670
684
  loafLiquidityPath?: string;
671
685
  /** Absolute URL for the auth/login surface (e.g. https://auth.loafmarkets.com/login). */
672
686
  authLoginUrl?: string | null;
@@ -680,12 +694,10 @@ type HeaderProps = {
680
694
  logoHref?: string;
681
695
  onLogoClick?: () => void;
682
696
  onLoafLiquidityClick?: () => void;
683
- onTradeClick?: () => void;
684
697
  onProfileNavigate?: () => void;
685
698
  onOrdersNavigate?: () => void;
686
699
  onWalletNavigate?: () => void;
687
700
  onSettingsClick?: () => void;
688
- showTradeTab?: boolean;
689
701
  portfolioSummary?: HeaderPortfolioData | null;
690
702
  /**
691
703
  * True while a brand-new user's test funds (100k mock USD) are being deposited
@@ -1001,6 +1013,8 @@ type PortfolioActivityPanelProps = {
1001
1013
  /** Click handler for the asset name in the Open Orders / Order History / Trade History rows — opens that asset. */
1002
1014
  onAssetClick?: (tokenName: string) => void;
1003
1015
  onClosePosition?: (tokenName: string, type: 'market' | 'limit', quantity: number, marketPrice: number) => void;
1016
+ /** Open the shareable position card for a held position. */
1017
+ onSharePosition?: (pos: PortfolioPosition) => void;
1004
1018
  offeringOrders?: readonly OfferingOrder[];
1005
1019
  openOrders?: readonly OrderHistoryItem[];
1006
1020
  orderHistory?: readonly OrderHistoryItem[];
@@ -1017,7 +1031,7 @@ type PortfolioActivityPanelProps = {
1017
1031
  className?: string;
1018
1032
  style?: React.CSSProperties;
1019
1033
  };
1020
- declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onAssetClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, cancellingOrderId, compactPositions, defaultTab, onTabChange, pageSize, blockExplorerBaseUrl: _blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
1034
+ 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;
1021
1035
 
1022
1036
  type SelectorItem = {
1023
1037
  readonly tokenName: string;
@@ -1310,4 +1324,4 @@ declare function extractSparkline(candles: ReadonlyArray<{
1310
1324
  }>, maxPoints?: number): number[];
1311
1325
  declare const SparklineChart: React__default.NamedExoticComponent<SparklineChartProps>;
1312
1326
 
1313
- 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 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 };
1327
+ 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 };
package/dist/index.d.ts CHANGED
@@ -643,7 +643,26 @@ type HeaderPortfolioData = {
643
643
  pnl: number;
644
644
  pnlPercent: number;
645
645
  };
646
- type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "leaderboard" | "leaderboardPage" | "about" | "portfolio" | "learn" | "api";
646
+ /**
647
+ * A single nav entry. The consuming app owns the entire nav set (which tabs,
648
+ * their labels, order and grouping) — the Header is a render-only view of this
649
+ * list, so different products/branches ship the same Header and only differ in
650
+ * the array they pass.
651
+ */
652
+ type HeaderNavItem = {
653
+ /** Stable id; also the value matched against `activeKey`. */
654
+ key: string;
655
+ label: string;
656
+ path: string;
657
+ /** Opens in a new tab (e.g. external Docs); never inferred active. */
658
+ external?: boolean;
659
+ /** "primary" = on the bar (default); "more" = inside the More dropdown. */
660
+ group?: "primary" | "more";
661
+ /** Active-tab inference: "exact" (default) or "prefix" (e.g. /offerings/*). */
662
+ match?: "exact" | "prefix";
663
+ /** Overrides navigation when clicked (e.g. trade chunk warm-up). */
664
+ onSelect?: () => void;
665
+ };
647
666
  type HeaderLoginPopupComponentProps = {
648
667
  onClose: () => void;
649
668
  initialView?: LoginPopupView;
@@ -652,21 +671,16 @@ type HeaderProps = {
652
671
  currentUser?: HeaderUser | null;
653
672
  isAuthenticated?: boolean;
654
673
  locationPath?: string;
655
- activeTab?: HeaderActiveTab;
674
+ /** The full nav set, owned by the consuming app. Rendered in order. */
675
+ navItems: HeaderNavItem[];
676
+ /** Force a nav item active by its `key`; otherwise inferred from locationPath. */
677
+ activeKey?: string;
656
678
  onNavigate?: (path: string) => void;
657
679
  onLogout?: () => Promise<void> | void;
658
680
  onSignInClick?: () => void;
659
681
  loginPopupComponent?: React__default.ComponentType<HeaderLoginPopupComponentProps>;
660
- tradePath?: string;
682
+ /** Logo link target (the logo is not a nav item). */
661
683
  homePath?: string;
662
- aboutPath?: string;
663
- learnPath?: string;
664
- apiPath?: string;
665
- offeringsPath?: string;
666
- propertyMapPath?: string;
667
- leaderboardPath?: string;
668
- leaderboardPagePath?: string;
669
- portfolioPath?: string;
670
684
  loafLiquidityPath?: string;
671
685
  /** Absolute URL for the auth/login surface (e.g. https://auth.loafmarkets.com/login). */
672
686
  authLoginUrl?: string | null;
@@ -680,12 +694,10 @@ type HeaderProps = {
680
694
  logoHref?: string;
681
695
  onLogoClick?: () => void;
682
696
  onLoafLiquidityClick?: () => void;
683
- onTradeClick?: () => void;
684
697
  onProfileNavigate?: () => void;
685
698
  onOrdersNavigate?: () => void;
686
699
  onWalletNavigate?: () => void;
687
700
  onSettingsClick?: () => void;
688
- showTradeTab?: boolean;
689
701
  portfolioSummary?: HeaderPortfolioData | null;
690
702
  /**
691
703
  * True while a brand-new user's test funds (100k mock USD) are being deposited
@@ -1001,6 +1013,8 @@ type PortfolioActivityPanelProps = {
1001
1013
  /** Click handler for the asset name in the Open Orders / Order History / Trade History rows — opens that asset. */
1002
1014
  onAssetClick?: (tokenName: string) => void;
1003
1015
  onClosePosition?: (tokenName: string, type: 'market' | 'limit', quantity: number, marketPrice: number) => void;
1016
+ /** Open the shareable position card for a held position. */
1017
+ onSharePosition?: (pos: PortfolioPosition) => void;
1004
1018
  offeringOrders?: readonly OfferingOrder[];
1005
1019
  openOrders?: readonly OrderHistoryItem[];
1006
1020
  orderHistory?: readonly OrderHistoryItem[];
@@ -1017,7 +1031,7 @@ type PortfolioActivityPanelProps = {
1017
1031
  className?: string;
1018
1032
  style?: React.CSSProperties;
1019
1033
  };
1020
- declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onAssetClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, cancellingOrderId, compactPositions, defaultTab, onTabChange, pageSize, blockExplorerBaseUrl: _blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
1034
+ 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;
1021
1035
 
1022
1036
  type SelectorItem = {
1023
1037
  readonly tokenName: string;
@@ -1310,4 +1324,4 @@ declare function extractSparkline(candles: ReadonlyArray<{
1310
1324
  }>, maxPoints?: number): number[];
1311
1325
  declare const SparklineChart: React__default.NamedExoticComponent<SparklineChartProps>;
1312
1326
 
1313
- 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 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 };
1327
+ 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 };