@loafmarkets/ui 0.1.0 → 0.1.2

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;
@@ -172,12 +203,21 @@ type PropertyValueSummary = {
172
203
  currencySymbol?: string;
173
204
  formatOptions?: Intl.NumberFormatOptions;
174
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
+ };
175
214
  type PropertyCompareBarProps = React.HTMLAttributes<HTMLDivElement> & {
176
215
  addresses: (PropertyAddressOption | string)[];
177
216
  selectedAddressId?: string;
178
217
  onSelectAddress?: (addressId: string) => void;
179
218
  propertyValue?: PropertyValueSummary;
180
219
  propertyValueVariant?: "classic" | "card" | "pill";
220
+ price?: PropertyPriceSummary;
181
221
  };
182
222
  declare const PropertyCompareBar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
183
223
  addresses: (PropertyAddressOption | string)[];
@@ -185,6 +225,7 @@ declare const PropertyCompareBar: React.ForwardRefExoticComponent<React.HTMLAttr
185
225
  onSelectAddress?: (addressId: string) => void;
186
226
  propertyValue?: PropertyValueSummary;
187
227
  propertyValueVariant?: "classic" | "card" | "pill";
228
+ price?: PropertyPriceSummary;
188
229
  } & React.RefAttributes<HTMLDivElement>>;
189
230
 
190
231
  interface LoafLiquidityBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
@@ -214,20 +255,34 @@ type YourOrder = {
214
255
  priceChangePercent?: number;
215
256
  priceChangePositive?: boolean;
216
257
  };
217
- type YourOrdersProps = React.HTMLAttributes<HTMLDivElement> & {
258
+ type YourOrdersTab = {
259
+ id: string;
260
+ label: string;
218
261
  title?: string;
219
262
  orders: YourOrder[];
263
+ emptyState?: string;
264
+ enableCancel?: boolean;
265
+ };
266
+ type YourOrdersProps = React.HTMLAttributes<HTMLDivElement> & {
267
+ title?: string;
268
+ orders?: YourOrder[];
269
+ tabs?: YourOrdersTab[];
270
+ activeTabId?: string;
271
+ onTabChange?: (tabId: string) => void;
220
272
  renderOrderActions?: (order: YourOrder) => React.ReactNode;
221
273
  };
222
274
  declare const YourOrders: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
223
275
  title?: string;
224
- orders: YourOrder[];
276
+ orders?: YourOrder[];
277
+ tabs?: YourOrdersTab[];
278
+ activeTabId?: string;
279
+ onTabChange?: (tabId: string) => void;
225
280
  renderOrderActions?: (order: YourOrder) => React.ReactNode;
226
281
  } & React.RefAttributes<HTMLDivElement>>;
227
282
 
228
283
  type PriceChartRange = "1D" | "1W" | "1M" | "3M" | "1Y";
229
284
  type PriceChartCandle = {
230
- time: Time;
285
+ time: LightweightCharts.Time;
231
286
  open: number;
232
287
  high: number;
233
288
  low: number;
@@ -312,4 +367,20 @@ declare const PropertySubheader: React.ForwardRefExoticComponent<React.HTMLAttri
312
367
  actions?: PropertySubheaderAction[];
313
368
  } & React.RefAttributes<HTMLDivElement>>;
314
369
 
315
- 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, LoafLiquidityBadge, 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 };
370
+ type MobileTradeNavItem = {
371
+ id: string;
372
+ label: string;
373
+ icon?: React.ReactNode;
374
+ };
375
+ type MobileTradeNavProps = React.HTMLAttributes<HTMLDivElement> & {
376
+ items: MobileTradeNavItem[];
377
+ activeId: string;
378
+ onChange?: (itemId: string) => void;
379
+ };
380
+ declare const MobileTradeNav: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
381
+ items: MobileTradeNavItem[];
382
+ activeId: string;
383
+ onChange?: (itemId: string) => void;
384
+ } & React.RefAttributes<HTMLDivElement>>;
385
+
386
+ 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;
@@ -172,12 +203,21 @@ type PropertyValueSummary = {
172
203
  currencySymbol?: string;
173
204
  formatOptions?: Intl.NumberFormatOptions;
174
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
+ };
175
214
  type PropertyCompareBarProps = React.HTMLAttributes<HTMLDivElement> & {
176
215
  addresses: (PropertyAddressOption | string)[];
177
216
  selectedAddressId?: string;
178
217
  onSelectAddress?: (addressId: string) => void;
179
218
  propertyValue?: PropertyValueSummary;
180
219
  propertyValueVariant?: "classic" | "card" | "pill";
220
+ price?: PropertyPriceSummary;
181
221
  };
182
222
  declare const PropertyCompareBar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
183
223
  addresses: (PropertyAddressOption | string)[];
@@ -185,6 +225,7 @@ declare const PropertyCompareBar: React.ForwardRefExoticComponent<React.HTMLAttr
185
225
  onSelectAddress?: (addressId: string) => void;
186
226
  propertyValue?: PropertyValueSummary;
187
227
  propertyValueVariant?: "classic" | "card" | "pill";
228
+ price?: PropertyPriceSummary;
188
229
  } & React.RefAttributes<HTMLDivElement>>;
189
230
 
190
231
  interface LoafLiquidityBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
@@ -214,20 +255,34 @@ type YourOrder = {
214
255
  priceChangePercent?: number;
215
256
  priceChangePositive?: boolean;
216
257
  };
217
- type YourOrdersProps = React.HTMLAttributes<HTMLDivElement> & {
258
+ type YourOrdersTab = {
259
+ id: string;
260
+ label: string;
218
261
  title?: string;
219
262
  orders: YourOrder[];
263
+ emptyState?: string;
264
+ enableCancel?: boolean;
265
+ };
266
+ type YourOrdersProps = React.HTMLAttributes<HTMLDivElement> & {
267
+ title?: string;
268
+ orders?: YourOrder[];
269
+ tabs?: YourOrdersTab[];
270
+ activeTabId?: string;
271
+ onTabChange?: (tabId: string) => void;
220
272
  renderOrderActions?: (order: YourOrder) => React.ReactNode;
221
273
  };
222
274
  declare const YourOrders: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
223
275
  title?: string;
224
- orders: YourOrder[];
276
+ orders?: YourOrder[];
277
+ tabs?: YourOrdersTab[];
278
+ activeTabId?: string;
279
+ onTabChange?: (tabId: string) => void;
225
280
  renderOrderActions?: (order: YourOrder) => React.ReactNode;
226
281
  } & React.RefAttributes<HTMLDivElement>>;
227
282
 
228
283
  type PriceChartRange = "1D" | "1W" | "1M" | "3M" | "1Y";
229
284
  type PriceChartCandle = {
230
- time: Time;
285
+ time: LightweightCharts.Time;
231
286
  open: number;
232
287
  high: number;
233
288
  low: number;
@@ -312,4 +367,20 @@ declare const PropertySubheader: React.ForwardRefExoticComponent<React.HTMLAttri
312
367
  actions?: PropertySubheaderAction[];
313
368
  } & React.RefAttributes<HTMLDivElement>>;
314
369
 
315
- 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, LoafLiquidityBadge, 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 };
370
+ type MobileTradeNavItem = {
371
+ id: string;
372
+ label: string;
373
+ icon?: React.ReactNode;
374
+ };
375
+ type MobileTradeNavProps = React.HTMLAttributes<HTMLDivElement> & {
376
+ items: MobileTradeNavItem[];
377
+ activeId: string;
378
+ onChange?: (itemId: string) => void;
379
+ };
380
+ declare const MobileTradeNav: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
381
+ items: MobileTradeNavItem[];
382
+ activeId: string;
383
+ onChange?: (itemId: string) => void;
384
+ } & React.RefAttributes<HTMLDivElement>>;
385
+
386
+ 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 };