@loafmarkets/ui 0.0.9 → 0.1.1

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
@@ -2,7 +2,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
2
2
  import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import { Time } from 'lightweight-charts';
5
+ import * as LightweightCharts from 'lightweight-charts';
6
6
 
7
7
  declare const buttonVariants: (props?: ({
8
8
  variant?: "primary" | "accent" | "accentOutline" | "media" | "outline" | "ghost" | "danger" | null | undefined;
@@ -82,6 +82,7 @@ interface OrderbookProps extends React.HTMLAttributes<HTMLDivElement> {
82
82
  defaultTab?: "orderbook" | "trades";
83
83
  onTabChange?: (tab: "orderbook" | "trades") => void;
84
84
  rightHeader?: React.ReactNode;
85
+ variant?: "auto" | "default" | "compact";
85
86
  }
86
87
  declare const Orderbook: React.ForwardRefExoticComponent<OrderbookProps & React.RefAttributes<HTMLDivElement>>;
87
88
 
@@ -122,6 +123,36 @@ interface HousePositionSliderProps extends React.HTMLAttributes<HTMLDivElement>
122
123
  }
123
124
  declare function HousePositionSlider({ tokenId, tokenSymbol, totalTokens, currentPrice, availableCash, tokensHeld, pendingOrders, defaultOrderType, orderbook, ownershipPercentOverride, onConfirmOrder, className, ...props }: HousePositionSliderProps): react_jsx_runtime.JSX.Element;
124
125
 
126
+ type HousePositionSliderMobileOrderPayload = {
127
+ side: "buy" | "sell";
128
+ orderType: "market" | "limit";
129
+ tokenId: string;
130
+ tokenSymbol: string;
131
+ price: number;
132
+ deltaTokens: number;
133
+ deltaValue: number;
134
+ targetOwnership: number;
135
+ targetTokens: number;
136
+ targetValue: number;
137
+ };
138
+ type HousePositionSliderMobileOrderbook = {
139
+ bids?: OrderbookLevel[];
140
+ asks?: OrderbookLevel[];
141
+ };
142
+ interface HousePositionSliderMobileProps extends React.HTMLAttributes<HTMLDivElement> {
143
+ tokenId: string;
144
+ tokenSymbol: string;
145
+ totalTokens: number;
146
+ currentPrice: number;
147
+ availableCash: number;
148
+ tokensHeld: number;
149
+ defaultOrderType?: "market" | "limit";
150
+ orderbook?: HousePositionSliderMobileOrderbook;
151
+ ownershipPercentOverride?: number;
152
+ onConfirmOrder?: (payload: HousePositionSliderMobileOrderPayload) => void;
153
+ }
154
+ declare function HousePositionSliderMobile({ tokenId, tokenSymbol, totalTokens, currentPrice, availableCash, tokensHeld, defaultOrderType, orderbook, ownershipPercentOverride, onConfirmOrder, className, ...props }: HousePositionSliderMobileProps): react_jsx_runtime.JSX.Element;
155
+
125
156
  type PropertyTourProps = Omit<React.ComponentPropsWithoutRef<typeof Card>, "title"> & {
126
157
  title: string;
127
158
  src: string;
@@ -165,23 +196,43 @@ type PropertyAddressOption = {
165
196
  id: string;
166
197
  label: string;
167
198
  };
199
+ type PropertyValueSummary = {
200
+ value: number;
201
+ change?: number;
202
+ label?: string;
203
+ currencySymbol?: string;
204
+ formatOptions?: Intl.NumberFormatOptions;
205
+ };
206
+ type PropertyPriceSummary = {
207
+ value: number;
208
+ change?: number;
209
+ changePercent?: number;
210
+ currencySymbol?: string;
211
+ formatOptions?: Intl.NumberFormatOptions;
212
+ percentFormatOptions?: Intl.NumberFormatOptions;
213
+ };
168
214
  type PropertyCompareBarProps = React.HTMLAttributes<HTMLDivElement> & {
169
215
  addresses: (PropertyAddressOption | string)[];
170
216
  selectedAddressId?: string;
171
217
  onSelectAddress?: (addressId: string) => void;
172
- compareLabel?: string;
173
- onCompareClick?: () => void;
174
- compareIcon?: React.ReactNode;
218
+ propertyValue?: PropertyValueSummary;
219
+ propertyValueVariant?: "classic" | "card" | "pill";
220
+ price?: PropertyPriceSummary;
175
221
  };
176
222
  declare const PropertyCompareBar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
177
223
  addresses: (PropertyAddressOption | string)[];
178
224
  selectedAddressId?: string;
179
225
  onSelectAddress?: (addressId: string) => void;
180
- compareLabel?: string;
181
- onCompareClick?: () => void;
182
- compareIcon?: React.ReactNode;
226
+ propertyValue?: PropertyValueSummary;
227
+ propertyValueVariant?: "classic" | "card" | "pill";
228
+ price?: PropertyPriceSummary;
183
229
  } & React.RefAttributes<HTMLDivElement>>;
184
230
 
231
+ interface LoafLiquidityBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
232
+ isGlowing?: boolean;
233
+ }
234
+ declare const LoafLiquidityBadge: React.ForwardRefExoticComponent<LoafLiquidityBadgeProps & React.RefAttributes<HTMLSpanElement>>;
235
+
185
236
  type YourOrderSide = "buy" | "sell";
186
237
  type YourOrder = {
187
238
  id: string;
@@ -217,7 +268,7 @@ declare const YourOrders: React.ForwardRefExoticComponent<React.HTMLAttributes<H
217
268
 
218
269
  type PriceChartRange = "1D" | "1W" | "1M" | "3M" | "1Y";
219
270
  type PriceChartCandle = {
220
- time: Time;
271
+ time: LightweightCharts.Time;
221
272
  open: number;
222
273
  high: number;
223
274
  low: number;
@@ -302,4 +353,20 @@ declare const PropertySubheader: React.ForwardRefExoticComponent<React.HTMLAttri
302
353
  actions?: PropertySubheaderAction[];
303
354
  } & React.RefAttributes<HTMLDivElement>>;
304
355
 
305
- 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, type HousePositionSliderOrderPayload, type HousePositionSliderProps, 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, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants };
356
+ type MobileTradeNavItem = {
357
+ id: string;
358
+ label: string;
359
+ icon?: React.ReactNode;
360
+ };
361
+ type MobileTradeNavProps = React.HTMLAttributes<HTMLDivElement> & {
362
+ items: MobileTradeNavItem[];
363
+ activeId: string;
364
+ onChange?: (itemId: string) => void;
365
+ };
366
+ declare const MobileTradeNav: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
367
+ items: MobileTradeNavItem[];
368
+ activeId: string;
369
+ onChange?: (itemId: string) => void;
370
+ } & React.RefAttributes<HTMLDivElement>>;
371
+
372
+ 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, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants };
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
2
2
  import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import { Time } from 'lightweight-charts';
5
+ import * as LightweightCharts from 'lightweight-charts';
6
6
 
7
7
  declare const buttonVariants: (props?: ({
8
8
  variant?: "primary" | "accent" | "accentOutline" | "media" | "outline" | "ghost" | "danger" | null | undefined;
@@ -82,6 +82,7 @@ interface OrderbookProps extends React.HTMLAttributes<HTMLDivElement> {
82
82
  defaultTab?: "orderbook" | "trades";
83
83
  onTabChange?: (tab: "orderbook" | "trades") => void;
84
84
  rightHeader?: React.ReactNode;
85
+ variant?: "auto" | "default" | "compact";
85
86
  }
86
87
  declare const Orderbook: React.ForwardRefExoticComponent<OrderbookProps & React.RefAttributes<HTMLDivElement>>;
87
88
 
@@ -122,6 +123,36 @@ interface HousePositionSliderProps extends React.HTMLAttributes<HTMLDivElement>
122
123
  }
123
124
  declare function HousePositionSlider({ tokenId, tokenSymbol, totalTokens, currentPrice, availableCash, tokensHeld, pendingOrders, defaultOrderType, orderbook, ownershipPercentOverride, onConfirmOrder, className, ...props }: HousePositionSliderProps): react_jsx_runtime.JSX.Element;
124
125
 
126
+ type HousePositionSliderMobileOrderPayload = {
127
+ side: "buy" | "sell";
128
+ orderType: "market" | "limit";
129
+ tokenId: string;
130
+ tokenSymbol: string;
131
+ price: number;
132
+ deltaTokens: number;
133
+ deltaValue: number;
134
+ targetOwnership: number;
135
+ targetTokens: number;
136
+ targetValue: number;
137
+ };
138
+ type HousePositionSliderMobileOrderbook = {
139
+ bids?: OrderbookLevel[];
140
+ asks?: OrderbookLevel[];
141
+ };
142
+ interface HousePositionSliderMobileProps extends React.HTMLAttributes<HTMLDivElement> {
143
+ tokenId: string;
144
+ tokenSymbol: string;
145
+ totalTokens: number;
146
+ currentPrice: number;
147
+ availableCash: number;
148
+ tokensHeld: number;
149
+ defaultOrderType?: "market" | "limit";
150
+ orderbook?: HousePositionSliderMobileOrderbook;
151
+ ownershipPercentOverride?: number;
152
+ onConfirmOrder?: (payload: HousePositionSliderMobileOrderPayload) => void;
153
+ }
154
+ declare function HousePositionSliderMobile({ tokenId, tokenSymbol, totalTokens, currentPrice, availableCash, tokensHeld, defaultOrderType, orderbook, ownershipPercentOverride, onConfirmOrder, className, ...props }: HousePositionSliderMobileProps): react_jsx_runtime.JSX.Element;
155
+
125
156
  type PropertyTourProps = Omit<React.ComponentPropsWithoutRef<typeof Card>, "title"> & {
126
157
  title: string;
127
158
  src: string;
@@ -165,23 +196,43 @@ type PropertyAddressOption = {
165
196
  id: string;
166
197
  label: string;
167
198
  };
199
+ type PropertyValueSummary = {
200
+ value: number;
201
+ change?: number;
202
+ label?: string;
203
+ currencySymbol?: string;
204
+ formatOptions?: Intl.NumberFormatOptions;
205
+ };
206
+ type PropertyPriceSummary = {
207
+ value: number;
208
+ change?: number;
209
+ changePercent?: number;
210
+ currencySymbol?: string;
211
+ formatOptions?: Intl.NumberFormatOptions;
212
+ percentFormatOptions?: Intl.NumberFormatOptions;
213
+ };
168
214
  type PropertyCompareBarProps = React.HTMLAttributes<HTMLDivElement> & {
169
215
  addresses: (PropertyAddressOption | string)[];
170
216
  selectedAddressId?: string;
171
217
  onSelectAddress?: (addressId: string) => void;
172
- compareLabel?: string;
173
- onCompareClick?: () => void;
174
- compareIcon?: React.ReactNode;
218
+ propertyValue?: PropertyValueSummary;
219
+ propertyValueVariant?: "classic" | "card" | "pill";
220
+ price?: PropertyPriceSummary;
175
221
  };
176
222
  declare const PropertyCompareBar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
177
223
  addresses: (PropertyAddressOption | string)[];
178
224
  selectedAddressId?: string;
179
225
  onSelectAddress?: (addressId: string) => void;
180
- compareLabel?: string;
181
- onCompareClick?: () => void;
182
- compareIcon?: React.ReactNode;
226
+ propertyValue?: PropertyValueSummary;
227
+ propertyValueVariant?: "classic" | "card" | "pill";
228
+ price?: PropertyPriceSummary;
183
229
  } & React.RefAttributes<HTMLDivElement>>;
184
230
 
231
+ interface LoafLiquidityBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
232
+ isGlowing?: boolean;
233
+ }
234
+ declare const LoafLiquidityBadge: React.ForwardRefExoticComponent<LoafLiquidityBadgeProps & React.RefAttributes<HTMLSpanElement>>;
235
+
185
236
  type YourOrderSide = "buy" | "sell";
186
237
  type YourOrder = {
187
238
  id: string;
@@ -217,7 +268,7 @@ declare const YourOrders: React.ForwardRefExoticComponent<React.HTMLAttributes<H
217
268
 
218
269
  type PriceChartRange = "1D" | "1W" | "1M" | "3M" | "1Y";
219
270
  type PriceChartCandle = {
220
- time: Time;
271
+ time: LightweightCharts.Time;
221
272
  open: number;
222
273
  high: number;
223
274
  low: number;
@@ -302,4 +353,20 @@ declare const PropertySubheader: React.ForwardRefExoticComponent<React.HTMLAttri
302
353
  actions?: PropertySubheaderAction[];
303
354
  } & React.RefAttributes<HTMLDivElement>>;
304
355
 
305
- 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, type HousePositionSliderOrderPayload, type HousePositionSliderProps, 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, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants };
356
+ type MobileTradeNavItem = {
357
+ id: string;
358
+ label: string;
359
+ icon?: React.ReactNode;
360
+ };
361
+ type MobileTradeNavProps = React.HTMLAttributes<HTMLDivElement> & {
362
+ items: MobileTradeNavItem[];
363
+ activeId: string;
364
+ onChange?: (itemId: string) => void;
365
+ };
366
+ declare const MobileTradeNav: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
367
+ items: MobileTradeNavItem[];
368
+ activeId: string;
369
+ onChange?: (itemId: string) => void;
370
+ } & React.RefAttributes<HTMLDivElement>>;
371
+
372
+ 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, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants };