@loafmarkets/ui 0.1.57 → 0.1.59

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.mjs CHANGED
@@ -9,7 +9,7 @@ import styled25, { keyframes, css } from 'styled-components';
9
9
  import { Newspaper, BedDouble, Bath, CarFront } from 'lucide-react';
10
10
  import * as LightweightCharts from 'lightweight-charts';
11
11
  import { BiChevronUp, BiChevronDown, BiX, BiCoin, BiWallet, BiCreditCard, BiCalendar, BiInfoCircle, BiPencil, BiImages, BiVideo, BiMap } from 'react-icons/bi';
12
- import { FaBitcoin, FaChartLine } from 'react-icons/fa';
12
+ import { FaChartLine, FaBitcoin } from 'react-icons/fa';
13
13
  import { FiExternalLink } from 'react-icons/fi';
14
14
 
15
15
  // src/components/button.tsx
@@ -9667,7 +9667,9 @@ function OfferingProgressCard({
9667
9667
  subscriberCount = 0,
9668
9668
  raisedAmount,
9669
9669
  targetAmount,
9670
- isPrivateClient = false
9670
+ isPrivateClient = false,
9671
+ style,
9672
+ className
9671
9673
  }) {
9672
9674
  const [currentTime, setCurrentTime] = useState(/* @__PURE__ */ new Date());
9673
9675
  const [countdown, setCountdown] = useState(null);
@@ -9697,7 +9699,7 @@ function OfferingProgressCard({
9697
9699
  const interval = setInterval(() => setCountdown(calculateCountdown()), 1e3);
9698
9700
  return () => clearInterval(interval);
9699
9701
  }, [opensAt]);
9700
- return /* @__PURE__ */ jsxs(Container, { children: [
9702
+ return /* @__PURE__ */ jsxs(Container, { style, className, children: [
9701
9703
  /* @__PURE__ */ jsxs(Header2, { children: [
9702
9704
  /* @__PURE__ */ jsxs("h3", { children: [
9703
9705
  /* @__PURE__ */ jsx(FaChartLine, {}),
@@ -10693,6 +10695,17 @@ function OrderPanel({
10693
10695
  const v = e.target.value;
10694
10696
  if (v === "" || /^\d*\.?\d{0,2}$/.test(v)) {
10695
10697
  setPayInputValue(v);
10698
+ const parsed = parseInt(v.replace(/[^0-9]/g, ""), 10) || 0;
10699
+ if (parsed <= 0) {
10700
+ setManualOrderAmount(null);
10701
+ setSliderValue(0);
10702
+ } else if (parsed >= availableBalance) {
10703
+ setManualOrderAmount(null);
10704
+ setSliderValue(100);
10705
+ } else {
10706
+ setManualOrderAmount(parsed);
10707
+ setSliderValue(availableBalance === 0 ? 0 : Math.round(Math.max(0, parsed / availableBalance * 100)));
10708
+ }
10696
10709
  }
10697
10710
  },
10698
10711
  onKeyDown: (e) => {
@@ -10764,6 +10777,18 @@ function OrderPanel({
10764
10777
  const v = e.target.value;
10765
10778
  if (v === "" || /^\d+$/.test(v)) {
10766
10779
  setReceiveInputValue(v);
10780
+ const units = Math.floor(parseInt(v.replace(/[^0-9]/g, ""), 10) || 0);
10781
+ const spend = units * tokenPrice;
10782
+ if (units <= 0) {
10783
+ setManualOrderAmount(null);
10784
+ setSliderValue(0);
10785
+ } else if (spend >= availableBalance) {
10786
+ setManualOrderAmount(null);
10787
+ setSliderValue(100);
10788
+ } else {
10789
+ setManualOrderAmount(spend);
10790
+ setSliderValue(availableBalance === 0 ? 0 : Math.round(Math.max(0, spend / availableBalance * 100)));
10791
+ }
10767
10792
  }
10768
10793
  },
10769
10794
  onKeyDown: (e) => {
@@ -15237,6 +15262,6 @@ function hasPendingActivity(data) {
15237
15262
  }) ?? false;
15238
15263
  }
15239
15264
 
15240
- export { AssetSelectorBar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Header, HousePositionSlider, HousePositionSliderMobile, LoafLiquidityBadge, LoafLiquidityLogo, LoginPopup, MobileTradeNav, Orderbook, owner_booking_default as OwnerBooking, PaymentPopup, PortfolioActivityPanel, PortfolioSummary, PriceChart, PropertyBuy, PropertyCompareBar, PropertyDocuments, PropertyHeroHeader, PropertyHistory, PropertyInspectionTimes, PropertyNewsUpdates, PropertyOffers, PropertyOverview, PropertyPhotoGallery, PropertySubheader, PropertyTour, PropertyValuation, Skeleton, ToastProvider, TradeConfirmationModal, TradingSlider, YourOrders, badgeVariants, buttonVariants, hasPendingActivity, useAdaptivePolling, useToast };
15265
+ export { AssetSelectorBar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Header, HousePositionSlider, HousePositionSliderMobile, LoafLiquidityBadge, LoafLiquidityLogo, LoginPopup, MobileTradeNav, OfferingProgressCard, Orderbook, owner_booking_default as OwnerBooking, PaymentPopup, PortfolioActivityPanel, PortfolioSummary, PriceChart, PropertyBuy, PropertyCompareBar, PropertyDocuments, PropertyHeroHeader, PropertyHistory, PropertyInspectionTimes, PropertyNewsUpdates, PropertyOffers, PropertyOverview, PropertyPhotoGallery, PropertySubheader, PropertyTour, PropertyValuation, Skeleton, ToastProvider, TradeConfirmationModal, TradingSlider, YourOrders, badgeVariants, buttonVariants, hasPendingActivity, useAdaptivePolling, useToast };
15241
15266
  //# sourceMappingURL=index.mjs.map
15242
15267
  //# sourceMappingURL=index.mjs.map