@loafmarkets/ui 0.1.8 → 0.1.9

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
@@ -1,5 +1,6 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import * as React from 'react';
3
+ import React__default from 'react';
3
4
  import { VariantProps } from 'class-variance-authority';
4
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
6
  import * as LightweightCharts from 'lightweight-charts';
@@ -280,6 +281,13 @@ interface LoafLiquidityBadgeProps extends React.HTMLAttributes<HTMLSpanElement>
280
281
  }
281
282
  declare const LoafLiquidityBadge: React.ForwardRefExoticComponent<LoafLiquidityBadgeProps & React.RefAttributes<HTMLSpanElement>>;
282
283
 
284
+ type LoafLiquidityLogoProps = {
285
+ onClick?: () => void;
286
+ isGlowing?: boolean;
287
+ className?: string;
288
+ };
289
+ declare const LoafLiquidityLogo: React.FC<LoafLiquidityLogoProps>;
290
+
283
291
  type YourOrderSide = "buy" | "sell";
284
292
  type YourOrder = {
285
293
  id: string;
@@ -404,6 +412,49 @@ declare const PropertyHeroHeader: React.ForwardRefExoticComponent<React.HTMLAttr
404
412
  onMakeOffer?: () => void;
405
413
  } & React.RefAttributes<HTMLDivElement>>;
406
414
 
415
+ type HeaderUser = {
416
+ displayName?: string | null;
417
+ email?: string | null;
418
+ walletAddress?: string | null;
419
+ };
420
+ type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "about";
421
+ type HeaderProps = {
422
+ currentUser?: HeaderUser | null;
423
+ isAuthenticated?: boolean;
424
+ locationPath?: string;
425
+ activeTab?: HeaderActiveTab;
426
+ onNavigate?: (path: string) => void;
427
+ onLogout?: () => Promise<void> | void;
428
+ onSignInClick?: () => void;
429
+ loginPopupComponent?: React__default.ComponentType<{
430
+ onClose: () => void;
431
+ }>;
432
+ tradeUrl?: string;
433
+ tradePath?: string;
434
+ homePath?: string;
435
+ aboutPath?: string;
436
+ offeringsPath?: string;
437
+ propertyMapPath?: string;
438
+ loafLiquidityPath?: string;
439
+ /** Absolute URL for the auth/login surface (e.g. https://auth.loafmarkets.com/login). */
440
+ authLoginUrl?: string | null;
441
+ /** Query parameter added to authLoginUrl for redirecting back to the originating SPA. */
442
+ authReturnParam?: string | null;
443
+ /**
444
+ * Custom resolver for the "return to" URL. Defaults to window.location.href, but you can
445
+ * inject your own implementation (e.g. saved pathname for native apps or React Router state).
446
+ */
447
+ getAuthReturnUrl?: () => string | null | undefined;
448
+ logoHref?: string;
449
+ onLogoClick?: () => void;
450
+ onLoafLiquidityClick?: () => void;
451
+ onTradeClick?: () => void;
452
+ onProfileNavigate?: () => void;
453
+ onOrdersNavigate?: () => void;
454
+ onWalletNavigate?: () => void;
455
+ };
456
+ declare const Header: React__default.FC<HeaderProps>;
457
+
407
458
  type PropertySubheaderTab = {
408
459
  id: string;
409
460
  label: string;
@@ -429,6 +480,46 @@ declare const PropertySubheader: React.ForwardRefExoticComponent<React.HTMLAttri
429
480
  actions?: PropertySubheaderAction[];
430
481
  } & React.RefAttributes<HTMLDivElement>>;
431
482
 
483
+ type EmailCodeParams = {
484
+ email: string;
485
+ isSignUp: boolean;
486
+ handle?: string | null;
487
+ };
488
+ type VerifyCodeParams = {
489
+ code: string;
490
+ email: string;
491
+ };
492
+ type DemoLoginResult = {
493
+ success: boolean;
494
+ };
495
+ type DemoLoginHandler = (email: string, handle?: string | null) => Promise<DemoLoginResult | void> | DemoLoginResult | void;
496
+ type LoginPopupProps = {
497
+ onClose: () => void;
498
+ onOpenEarlyAccess?: () => void;
499
+ /**
500
+ * Optional flag that indicates an authenticated session exists. When true (and autoCloseOnAuth is enabled)
501
+ * the popup will close automatically, mirroring the loaf-demo behaviour that watched Privy + demo auth state.
502
+ */
503
+ isAuthenticated?: boolean;
504
+ /** Optional user payload that, when truthy, also triggers the auto close effect. */
505
+ currentUser?: unknown;
506
+ /**
507
+ * Handler that should kick off an email OTP flow (e.g. Privy's sendCode). When omitted, the component will
508
+ * display an inline error explaining that email auth is unavailable.
509
+ */
510
+ onSendEmailCode?: (params: EmailCodeParams) => Promise<void> | void;
511
+ /** Handler invoked when the user submits the 6-digit OTP code. */
512
+ onVerifyEmailCode?: (params: VerifyCodeParams) => Promise<void> | void;
513
+ /** Optional handler used for demo / local login flows before falling back to email OTP. */
514
+ onDemoLogin?: DemoLoginHandler;
515
+ /** Override for the logo shown in the popup header. */
516
+ logoSrc?: string;
517
+ logoAlt?: string;
518
+ /** Disable auto-closing behaviour tied to isAuthenticated/currentUser flags. */
519
+ autoCloseOnAuth?: boolean;
520
+ };
521
+ declare const LoginPopup: React__default.FC<LoginPopupProps>;
522
+
432
523
  type PropertyAddressOption = {
433
524
  id: string;
434
525
  label: string;
@@ -465,4 +556,4 @@ declare const PropertyCompareBar: React.ForwardRefExoticComponent<React.HTMLAttr
465
556
  price?: PropertyPriceSummary;
466
557
  } & React.RefAttributes<HTMLDivElement>>;
467
558
 
468
- export { Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, LoafLiquidityBadge, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyCompareBar, type PropertyCompareBarProps, PropertyHeroHeader, type PropertyHeroHeaderProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, type PropertyValueSummary, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants };
559
+ export { Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Header, type HeaderProps, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, LoafLiquidityBadge, LoafLiquidityLogo, type LoafLiquidityLogoProps, LoginPopup, type LoginPopupProps, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyCompareBar, type PropertyCompareBarProps, PropertyHeroHeader, type PropertyHeroHeaderProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, type PropertyValueSummary, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import * as React from 'react';
3
+ import React__default from 'react';
3
4
  import { VariantProps } from 'class-variance-authority';
4
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
6
  import * as LightweightCharts from 'lightweight-charts';
@@ -280,6 +281,13 @@ interface LoafLiquidityBadgeProps extends React.HTMLAttributes<HTMLSpanElement>
280
281
  }
281
282
  declare const LoafLiquidityBadge: React.ForwardRefExoticComponent<LoafLiquidityBadgeProps & React.RefAttributes<HTMLSpanElement>>;
282
283
 
284
+ type LoafLiquidityLogoProps = {
285
+ onClick?: () => void;
286
+ isGlowing?: boolean;
287
+ className?: string;
288
+ };
289
+ declare const LoafLiquidityLogo: React.FC<LoafLiquidityLogoProps>;
290
+
283
291
  type YourOrderSide = "buy" | "sell";
284
292
  type YourOrder = {
285
293
  id: string;
@@ -404,6 +412,49 @@ declare const PropertyHeroHeader: React.ForwardRefExoticComponent<React.HTMLAttr
404
412
  onMakeOffer?: () => void;
405
413
  } & React.RefAttributes<HTMLDivElement>>;
406
414
 
415
+ type HeaderUser = {
416
+ displayName?: string | null;
417
+ email?: string | null;
418
+ walletAddress?: string | null;
419
+ };
420
+ type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "about";
421
+ type HeaderProps = {
422
+ currentUser?: HeaderUser | null;
423
+ isAuthenticated?: boolean;
424
+ locationPath?: string;
425
+ activeTab?: HeaderActiveTab;
426
+ onNavigate?: (path: string) => void;
427
+ onLogout?: () => Promise<void> | void;
428
+ onSignInClick?: () => void;
429
+ loginPopupComponent?: React__default.ComponentType<{
430
+ onClose: () => void;
431
+ }>;
432
+ tradeUrl?: string;
433
+ tradePath?: string;
434
+ homePath?: string;
435
+ aboutPath?: string;
436
+ offeringsPath?: string;
437
+ propertyMapPath?: string;
438
+ loafLiquidityPath?: string;
439
+ /** Absolute URL for the auth/login surface (e.g. https://auth.loafmarkets.com/login). */
440
+ authLoginUrl?: string | null;
441
+ /** Query parameter added to authLoginUrl for redirecting back to the originating SPA. */
442
+ authReturnParam?: string | null;
443
+ /**
444
+ * Custom resolver for the "return to" URL. Defaults to window.location.href, but you can
445
+ * inject your own implementation (e.g. saved pathname for native apps or React Router state).
446
+ */
447
+ getAuthReturnUrl?: () => string | null | undefined;
448
+ logoHref?: string;
449
+ onLogoClick?: () => void;
450
+ onLoafLiquidityClick?: () => void;
451
+ onTradeClick?: () => void;
452
+ onProfileNavigate?: () => void;
453
+ onOrdersNavigate?: () => void;
454
+ onWalletNavigate?: () => void;
455
+ };
456
+ declare const Header: React__default.FC<HeaderProps>;
457
+
407
458
  type PropertySubheaderTab = {
408
459
  id: string;
409
460
  label: string;
@@ -429,6 +480,46 @@ declare const PropertySubheader: React.ForwardRefExoticComponent<React.HTMLAttri
429
480
  actions?: PropertySubheaderAction[];
430
481
  } & React.RefAttributes<HTMLDivElement>>;
431
482
 
483
+ type EmailCodeParams = {
484
+ email: string;
485
+ isSignUp: boolean;
486
+ handle?: string | null;
487
+ };
488
+ type VerifyCodeParams = {
489
+ code: string;
490
+ email: string;
491
+ };
492
+ type DemoLoginResult = {
493
+ success: boolean;
494
+ };
495
+ type DemoLoginHandler = (email: string, handle?: string | null) => Promise<DemoLoginResult | void> | DemoLoginResult | void;
496
+ type LoginPopupProps = {
497
+ onClose: () => void;
498
+ onOpenEarlyAccess?: () => void;
499
+ /**
500
+ * Optional flag that indicates an authenticated session exists. When true (and autoCloseOnAuth is enabled)
501
+ * the popup will close automatically, mirroring the loaf-demo behaviour that watched Privy + demo auth state.
502
+ */
503
+ isAuthenticated?: boolean;
504
+ /** Optional user payload that, when truthy, also triggers the auto close effect. */
505
+ currentUser?: unknown;
506
+ /**
507
+ * Handler that should kick off an email OTP flow (e.g. Privy's sendCode). When omitted, the component will
508
+ * display an inline error explaining that email auth is unavailable.
509
+ */
510
+ onSendEmailCode?: (params: EmailCodeParams) => Promise<void> | void;
511
+ /** Handler invoked when the user submits the 6-digit OTP code. */
512
+ onVerifyEmailCode?: (params: VerifyCodeParams) => Promise<void> | void;
513
+ /** Optional handler used for demo / local login flows before falling back to email OTP. */
514
+ onDemoLogin?: DemoLoginHandler;
515
+ /** Override for the logo shown in the popup header. */
516
+ logoSrc?: string;
517
+ logoAlt?: string;
518
+ /** Disable auto-closing behaviour tied to isAuthenticated/currentUser flags. */
519
+ autoCloseOnAuth?: boolean;
520
+ };
521
+ declare const LoginPopup: React__default.FC<LoginPopupProps>;
522
+
432
523
  type PropertyAddressOption = {
433
524
  id: string;
434
525
  label: string;
@@ -465,4 +556,4 @@ declare const PropertyCompareBar: React.ForwardRefExoticComponent<React.HTMLAttr
465
556
  price?: PropertyPriceSummary;
466
557
  } & React.RefAttributes<HTMLDivElement>>;
467
558
 
468
- export { Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, LoafLiquidityBadge, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyCompareBar, type PropertyCompareBarProps, PropertyHeroHeader, type PropertyHeroHeaderProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, type PropertyValueSummary, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants };
559
+ export { Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Header, type HeaderProps, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, LoafLiquidityBadge, LoafLiquidityLogo, type LoafLiquidityLogoProps, LoginPopup, type LoginPopupProps, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyCompareBar, type PropertyCompareBarProps, PropertyHeroHeader, type PropertyHeroHeaderProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, type PropertyValueSummary, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants };