@loafmarkets/ui 0.1.4 → 0.1.6

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
@@ -192,41 +192,88 @@ interface PropertyNewsUpdatesProps extends React.HTMLAttributes<HTMLDivElement>
192
192
  }
193
193
  declare const PropertyNewsUpdates: React.ForwardRefExoticComponent<PropertyNewsUpdatesProps & React.RefAttributes<HTMLDivElement>>;
194
194
 
195
- type PropertyAddressOption = {
195
+ type RangeInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "type">;
196
+ interface TradingSliderProps extends RangeInputProps {
197
+ /**
198
+ * Controlled slider value
199
+ */
200
+ value?: number;
201
+ /**
202
+ * Initial value for the uncontrolled mode
203
+ */
204
+ defaultValue?: number;
205
+ /**
206
+ * Fires whenever the thumb value changes
207
+ */
208
+ onValueChange?: (value: number, event: React.ChangeEvent<HTMLInputElement>) => void;
209
+ /**
210
+ * Label displayed on top of the slider card
211
+ */
212
+ label?: string;
213
+ /**
214
+ * Small helper copy rendered under the label
215
+ */
216
+ helperText?: string;
217
+ /**
218
+ * Custom formatter for the highlighted value on the right
219
+ */
220
+ formatValue?: (value: number) => React.ReactNode;
221
+ /**
222
+ * Text shown next to the minimum tick
223
+ */
224
+ minLabel?: string;
225
+ /**
226
+ * Text shown next to the maximum tick
227
+ */
228
+ maxLabel?: string;
229
+ /**
230
+ * Accent color used for the filled portion of the track
231
+ */
232
+ accentColor?: string;
233
+ }
234
+ declare const TradingSlider: React.ForwardRefExoticComponent<TradingSliderProps & React.RefAttributes<HTMLInputElement>>;
235
+
236
+ type MobileTradeNavItem = {
196
237
  id: string;
197
238
  label: string;
239
+ icon?: React.ReactNode;
198
240
  };
199
- type PropertyValueSummary = {
200
- value: number;
201
- change?: number;
202
- label?: string;
203
- currencySymbol?: string;
204
- formatOptions?: Intl.NumberFormatOptions;
241
+ type MobileTradeNavProps = React.HTMLAttributes<HTMLDivElement> & {
242
+ items: MobileTradeNavItem[];
243
+ activeId: string;
244
+ onChange?: (itemId: string) => void;
205
245
  };
206
- type PropertyPriceSummary = {
207
- value: number;
208
- change?: number;
209
- changePercent?: number;
210
- currencySymbol?: string;
211
- formatOptions?: Intl.NumberFormatOptions;
212
- percentFormatOptions?: Intl.NumberFormatOptions;
246
+ declare const MobileTradeNav: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
247
+ items: MobileTradeNavItem[];
248
+ activeId: string;
249
+ onChange?: (itemId: string) => void;
250
+ } & React.RefAttributes<HTMLDivElement>>;
251
+
252
+ type TradeConfirmationModalDetails = {
253
+ type: 'buy' | 'sell';
254
+ orderType: 'market' | 'limit';
255
+ quantity: number;
256
+ price?: number | null;
257
+ totalValue?: number | null;
258
+ tokenSymbol: string;
259
+ willExecuteImmediately?: boolean;
213
260
  };
214
- type PropertyCompareBarProps = React.HTMLAttributes<HTMLDivElement> & {
215
- addresses: (PropertyAddressOption | string)[];
216
- selectedAddressId?: string;
217
- onSelectAddress?: (addressId: string) => void;
218
- propertyValue?: PropertyValueSummary;
219
- propertyValueVariant?: "classic" | "card" | "pill";
220
- price?: PropertyPriceSummary;
261
+ type TradeConfirmationModalProps = {
262
+ isOpen: boolean;
263
+ onClose: () => void;
264
+ onConfirm: () => void;
265
+ orderDetails?: TradeConfirmationModalDetails | null;
266
+ className?: string;
267
+ estimatedFeeUsd?: number | null;
268
+ estimatedFeeBps?: number | null;
269
+ totalWithFeesUsd?: number | null;
270
+ confirmDisabled?: boolean;
271
+ confirmLoading?: boolean;
272
+ rememberChoiceChecked?: boolean;
273
+ rememberChoiceLabel?: string;
274
+ onRememberChoiceChange?: (checked: boolean) => void;
221
275
  };
222
- declare const PropertyCompareBar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
223
- addresses: (PropertyAddressOption | string)[];
224
- selectedAddressId?: string;
225
- onSelectAddress?: (addressId: string) => void;
226
- propertyValue?: PropertyValueSummary;
227
- propertyValueVariant?: "classic" | "card" | "pill";
228
- price?: PropertyPriceSummary;
229
- } & React.RefAttributes<HTMLDivElement>>;
276
+ declare function TradeConfirmationModal({ isOpen, onClose, onConfirm, orderDetails, className, estimatedFeeUsd: _estimatedFeeUsd, estimatedFeeBps: _estimatedFeeBps, totalWithFeesUsd, confirmDisabled, confirmLoading, rememberChoiceChecked, rememberChoiceLabel, onRememberChoiceChange, }: TradeConfirmationModalProps): React.ReactElement | null;
230
277
 
231
278
  interface LoafLiquidityBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
232
279
  isGlowing?: boolean;
@@ -262,6 +309,19 @@ type YourOrdersTab = {
262
309
  orders: YourOrder[];
263
310
  emptyState?: string;
264
311
  enableCancel?: boolean;
312
+ columnVisibility?: {
313
+ propertyPercent?: boolean;
314
+ pnl?: boolean;
315
+ };
316
+ };
317
+ type RenderTabContentArgs = {
318
+ tab: YourOrdersTab;
319
+ orders: YourOrder[];
320
+ page: number;
321
+ totalPages: number;
322
+ totalOrders: number;
323
+ pageSize: number;
324
+ onPageChange: (page: number) => void;
265
325
  };
266
326
  type YourOrdersProps = React.HTMLAttributes<HTMLDivElement> & {
267
327
  title?: string;
@@ -270,6 +330,7 @@ type YourOrdersProps = React.HTMLAttributes<HTMLDivElement> & {
270
330
  activeTabId?: string;
271
331
  onTabChange?: (tabId: string) => void;
272
332
  renderOrderActions?: (order: YourOrder) => React.ReactNode;
333
+ renderTabContent?: (args: RenderTabContentArgs) => React.ReactNode | null;
273
334
  };
274
335
  declare const YourOrders: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
275
336
  title?: string;
@@ -278,6 +339,7 @@ declare const YourOrders: React.ForwardRefExoticComponent<React.HTMLAttributes<H
278
339
  activeTabId?: string;
279
340
  onTabChange?: (tabId: string) => void;
280
341
  renderOrderActions?: (order: YourOrder) => React.ReactNode;
342
+ renderTabContent?: (args: RenderTabContentArgs) => React.ReactNode | null;
281
343
  } & React.RefAttributes<HTMLDivElement>>;
282
344
 
283
345
  type PriceChartRange = "30s" | "1m" | "5m" | "15m" | "1h" | "4h" | "24h" | "1W" | "1M";
@@ -367,20 +429,4 @@ declare const PropertySubheader: React.ForwardRefExoticComponent<React.HTMLAttri
367
429
  actions?: PropertySubheaderAction[];
368
430
  } & React.RefAttributes<HTMLDivElement>>;
369
431
 
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 };
432
+ 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, PropertyHeroHeader, type PropertyHeroHeaderProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants };
package/dist/index.d.ts CHANGED
@@ -192,41 +192,88 @@ interface PropertyNewsUpdatesProps extends React.HTMLAttributes<HTMLDivElement>
192
192
  }
193
193
  declare const PropertyNewsUpdates: React.ForwardRefExoticComponent<PropertyNewsUpdatesProps & React.RefAttributes<HTMLDivElement>>;
194
194
 
195
- type PropertyAddressOption = {
195
+ type RangeInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "type">;
196
+ interface TradingSliderProps extends RangeInputProps {
197
+ /**
198
+ * Controlled slider value
199
+ */
200
+ value?: number;
201
+ /**
202
+ * Initial value for the uncontrolled mode
203
+ */
204
+ defaultValue?: number;
205
+ /**
206
+ * Fires whenever the thumb value changes
207
+ */
208
+ onValueChange?: (value: number, event: React.ChangeEvent<HTMLInputElement>) => void;
209
+ /**
210
+ * Label displayed on top of the slider card
211
+ */
212
+ label?: string;
213
+ /**
214
+ * Small helper copy rendered under the label
215
+ */
216
+ helperText?: string;
217
+ /**
218
+ * Custom formatter for the highlighted value on the right
219
+ */
220
+ formatValue?: (value: number) => React.ReactNode;
221
+ /**
222
+ * Text shown next to the minimum tick
223
+ */
224
+ minLabel?: string;
225
+ /**
226
+ * Text shown next to the maximum tick
227
+ */
228
+ maxLabel?: string;
229
+ /**
230
+ * Accent color used for the filled portion of the track
231
+ */
232
+ accentColor?: string;
233
+ }
234
+ declare const TradingSlider: React.ForwardRefExoticComponent<TradingSliderProps & React.RefAttributes<HTMLInputElement>>;
235
+
236
+ type MobileTradeNavItem = {
196
237
  id: string;
197
238
  label: string;
239
+ icon?: React.ReactNode;
198
240
  };
199
- type PropertyValueSummary = {
200
- value: number;
201
- change?: number;
202
- label?: string;
203
- currencySymbol?: string;
204
- formatOptions?: Intl.NumberFormatOptions;
241
+ type MobileTradeNavProps = React.HTMLAttributes<HTMLDivElement> & {
242
+ items: MobileTradeNavItem[];
243
+ activeId: string;
244
+ onChange?: (itemId: string) => void;
205
245
  };
206
- type PropertyPriceSummary = {
207
- value: number;
208
- change?: number;
209
- changePercent?: number;
210
- currencySymbol?: string;
211
- formatOptions?: Intl.NumberFormatOptions;
212
- percentFormatOptions?: Intl.NumberFormatOptions;
246
+ declare const MobileTradeNav: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
247
+ items: MobileTradeNavItem[];
248
+ activeId: string;
249
+ onChange?: (itemId: string) => void;
250
+ } & React.RefAttributes<HTMLDivElement>>;
251
+
252
+ type TradeConfirmationModalDetails = {
253
+ type: 'buy' | 'sell';
254
+ orderType: 'market' | 'limit';
255
+ quantity: number;
256
+ price?: number | null;
257
+ totalValue?: number | null;
258
+ tokenSymbol: string;
259
+ willExecuteImmediately?: boolean;
213
260
  };
214
- type PropertyCompareBarProps = React.HTMLAttributes<HTMLDivElement> & {
215
- addresses: (PropertyAddressOption | string)[];
216
- selectedAddressId?: string;
217
- onSelectAddress?: (addressId: string) => void;
218
- propertyValue?: PropertyValueSummary;
219
- propertyValueVariant?: "classic" | "card" | "pill";
220
- price?: PropertyPriceSummary;
261
+ type TradeConfirmationModalProps = {
262
+ isOpen: boolean;
263
+ onClose: () => void;
264
+ onConfirm: () => void;
265
+ orderDetails?: TradeConfirmationModalDetails | null;
266
+ className?: string;
267
+ estimatedFeeUsd?: number | null;
268
+ estimatedFeeBps?: number | null;
269
+ totalWithFeesUsd?: number | null;
270
+ confirmDisabled?: boolean;
271
+ confirmLoading?: boolean;
272
+ rememberChoiceChecked?: boolean;
273
+ rememberChoiceLabel?: string;
274
+ onRememberChoiceChange?: (checked: boolean) => void;
221
275
  };
222
- declare const PropertyCompareBar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
223
- addresses: (PropertyAddressOption | string)[];
224
- selectedAddressId?: string;
225
- onSelectAddress?: (addressId: string) => void;
226
- propertyValue?: PropertyValueSummary;
227
- propertyValueVariant?: "classic" | "card" | "pill";
228
- price?: PropertyPriceSummary;
229
- } & React.RefAttributes<HTMLDivElement>>;
276
+ declare function TradeConfirmationModal({ isOpen, onClose, onConfirm, orderDetails, className, estimatedFeeUsd: _estimatedFeeUsd, estimatedFeeBps: _estimatedFeeBps, totalWithFeesUsd, confirmDisabled, confirmLoading, rememberChoiceChecked, rememberChoiceLabel, onRememberChoiceChange, }: TradeConfirmationModalProps): React.ReactElement | null;
230
277
 
231
278
  interface LoafLiquidityBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
232
279
  isGlowing?: boolean;
@@ -262,6 +309,19 @@ type YourOrdersTab = {
262
309
  orders: YourOrder[];
263
310
  emptyState?: string;
264
311
  enableCancel?: boolean;
312
+ columnVisibility?: {
313
+ propertyPercent?: boolean;
314
+ pnl?: boolean;
315
+ };
316
+ };
317
+ type RenderTabContentArgs = {
318
+ tab: YourOrdersTab;
319
+ orders: YourOrder[];
320
+ page: number;
321
+ totalPages: number;
322
+ totalOrders: number;
323
+ pageSize: number;
324
+ onPageChange: (page: number) => void;
265
325
  };
266
326
  type YourOrdersProps = React.HTMLAttributes<HTMLDivElement> & {
267
327
  title?: string;
@@ -270,6 +330,7 @@ type YourOrdersProps = React.HTMLAttributes<HTMLDivElement> & {
270
330
  activeTabId?: string;
271
331
  onTabChange?: (tabId: string) => void;
272
332
  renderOrderActions?: (order: YourOrder) => React.ReactNode;
333
+ renderTabContent?: (args: RenderTabContentArgs) => React.ReactNode | null;
273
334
  };
274
335
  declare const YourOrders: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
275
336
  title?: string;
@@ -278,6 +339,7 @@ declare const YourOrders: React.ForwardRefExoticComponent<React.HTMLAttributes<H
278
339
  activeTabId?: string;
279
340
  onTabChange?: (tabId: string) => void;
280
341
  renderOrderActions?: (order: YourOrder) => React.ReactNode;
342
+ renderTabContent?: (args: RenderTabContentArgs) => React.ReactNode | null;
281
343
  } & React.RefAttributes<HTMLDivElement>>;
282
344
 
283
345
  type PriceChartRange = "30s" | "1m" | "5m" | "15m" | "1h" | "4h" | "24h" | "1W" | "1M";
@@ -367,20 +429,4 @@ declare const PropertySubheader: React.ForwardRefExoticComponent<React.HTMLAttri
367
429
  actions?: PropertySubheaderAction[];
368
430
  } & React.RefAttributes<HTMLDivElement>>;
369
431
 
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 };
432
+ 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, PropertyHeroHeader, type PropertyHeroHeaderProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, badgeVariants, buttonVariants };