@loafmarkets/ui 0.1.325 → 0.1.326

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.js CHANGED
@@ -11593,6 +11593,192 @@ var SignInButton = styled9__default.default.button`
11593
11593
  background: rgba(240, 185, 11, 0.1);
11594
11594
  }
11595
11595
  `;
11596
+ var slideIn = styled9.keyframes`
11597
+ from { transform: translateX(110%); opacity: 0; }
11598
+ to { transform: translateX(0); opacity: 1; }
11599
+ `;
11600
+ var slideOut = styled9.keyframes`
11601
+ from { transform: translateX(0); opacity: 1; }
11602
+ to { transform: translateX(110%); opacity: 0; }
11603
+ `;
11604
+ var progressShrink = styled9.keyframes`
11605
+ from { width: 100%; }
11606
+ to { width: 0%; }
11607
+ `;
11608
+ var VARIANT_COLORS = {
11609
+ success: { accent: "#0ecb81", icon: "\u2713" },
11610
+ error: { accent: "#f6465d", icon: "\u2715" },
11611
+ sell: { accent: "#f6465d", icon: "\u2713" },
11612
+ info: { accent: "#E6C656", icon: "\u2139" },
11613
+ pending: { accent: "#7EB3E6", icon: "\u25CC" }
11614
+ };
11615
+ var Wrapper2 = styled9__default.default.div`
11616
+ position: relative;
11617
+ display: flex;
11618
+ flex-direction: column;
11619
+ gap: 0;
11620
+ width: 340px;
11621
+ background: #0d0f1a;
11622
+ border: 1px solid rgba(255, 255, 255, 0.08);
11623
+ border-radius: 10px;
11624
+ overflow: hidden;
11625
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04);
11626
+ animation: ${({ $exiting }) => $exiting ? styled9.css`${slideOut} 0.28s cubic-bezier(0.4,0,1,1) forwards` : styled9.css`${slideIn} 0.32s cubic-bezier(0,0,0.2,1) forwards`};
11627
+ pointer-events: all;
11628
+ `;
11629
+ var Body = styled9__default.default.div`
11630
+ display: flex;
11631
+ align-items: flex-start;
11632
+ gap: 12px;
11633
+ padding: 14px 16px 12px;
11634
+ `;
11635
+ var IconDot = styled9__default.default.div`
11636
+ flex-shrink: 0;
11637
+ width: 28px;
11638
+ height: 28px;
11639
+ border-radius: 50%;
11640
+ background: ${({ $color }) => $color}1a;
11641
+ border: 1px solid ${({ $color }) => $color}55;
11642
+ display: flex;
11643
+ align-items: center;
11644
+ justify-content: center;
11645
+ font-size: 0.75rem;
11646
+ font-weight: 700;
11647
+ color: ${({ $color }) => $color};
11648
+ margin-top: 1px;
11649
+ `;
11650
+ var Content = styled9__default.default.div`
11651
+ flex: 1;
11652
+ min-width: 0;
11653
+ `;
11654
+ var Title2 = styled9__default.default.p`
11655
+ margin: 0 0 2px;
11656
+ font-size: 0.8rem;
11657
+ font-weight: 600;
11658
+ color: #fff;
11659
+ letter-spacing: 0.01em;
11660
+ `;
11661
+ var Amount = styled9__default.default.p`
11662
+ margin: 0 0 6px;
11663
+ font-size: 1.05rem;
11664
+ font-weight: 700;
11665
+ color: #E6C656;
11666
+ letter-spacing: -0.01em;
11667
+ `;
11668
+ var TxRow = styled9__default.default.a`
11669
+ display: inline-flex;
11670
+ align-items: center;
11671
+ gap: 5px;
11672
+ font-family: 'IBM Plex Mono', 'Space Mono', monospace;
11673
+ font-size: 0.68rem;
11674
+ color: rgba(255, 255, 255, 0.4);
11675
+ text-decoration: none;
11676
+ transition: color 0.15s;
11677
+ &:hover {
11678
+ color: #7EB3E6;
11679
+ }
11680
+ `;
11681
+ var TxArrow = styled9__default.default.span`
11682
+ font-size: 0.6rem;
11683
+ opacity: 0.6;
11684
+ `;
11685
+ var CloseBtn = styled9__default.default.button`
11686
+ flex-shrink: 0;
11687
+ background: none;
11688
+ border: none;
11689
+ padding: 2px 4px;
11690
+ cursor: pointer;
11691
+ color: rgba(255, 255, 255, 0.25);
11692
+ font-size: 0.9rem;
11693
+ line-height: 1;
11694
+ transition: color 0.15s;
11695
+ &:hover { color: rgba(255, 255, 255, 0.7); }
11696
+ `;
11697
+ var ProgressBar = styled9__default.default.div`
11698
+ height: 2px;
11699
+ background: rgba(255, 255, 255, 0.06);
11700
+ position: relative;
11701
+ &::after {
11702
+ content: '';
11703
+ position: absolute;
11704
+ left: 0;
11705
+ top: 0;
11706
+ height: 100%;
11707
+ background: ${({ $color }) => $color};
11708
+ animation: ${styled9.css`${progressShrink} ${({ $duration }) => $duration}ms linear forwards`};
11709
+ }
11710
+ `;
11711
+ var Container = styled9__default.default.div`
11712
+ position: fixed;
11713
+ bottom: 24px;
11714
+ right: 24px;
11715
+ z-index: 9999;
11716
+ display: flex;
11717
+ flex-direction: column-reverse;
11718
+ gap: 10px;
11719
+ pointer-events: none;
11720
+ `;
11721
+ var DEFAULT_EXPLORER = "https://sepolia.basescan.org/tx/";
11722
+ function truncateHash(hash) {
11723
+ return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
11724
+ }
11725
+ function ToastItem({ toast, onDismiss }) {
11726
+ const [exiting, setExiting] = React5.useState(false);
11727
+ const timerRef = React5.useRef(null);
11728
+ const dismiss = React5.useCallback(() => {
11729
+ setExiting(true);
11730
+ setTimeout(() => onDismiss(toast.id), 280);
11731
+ }, [onDismiss, toast.id]);
11732
+ React5.useEffect(() => {
11733
+ const duration2 = toast.duration ?? 6e3;
11734
+ if (duration2 > 0) {
11735
+ timerRef.current = setTimeout(dismiss, duration2);
11736
+ }
11737
+ return () => {
11738
+ if (timerRef.current) clearTimeout(timerRef.current);
11739
+ };
11740
+ }, [dismiss, toast.duration]);
11741
+ const { accent, icon } = VARIANT_COLORS[toast.variant];
11742
+ const duration = toast.duration ?? 6e3;
11743
+ const explorerBase = toast.explorerUrl ?? DEFAULT_EXPLORER;
11744
+ const txUrl = toast.txHash ? `${explorerBase}${toast.txHash}` : void 0;
11745
+ return /* @__PURE__ */ jsxRuntime.jsxs(Wrapper2, { $exiting: exiting, children: [
11746
+ /* @__PURE__ */ jsxRuntime.jsxs(Body, { children: [
11747
+ /* @__PURE__ */ jsxRuntime.jsx(IconDot, { $color: accent, children: icon }),
11748
+ /* @__PURE__ */ jsxRuntime.jsxs(Content, { children: [
11749
+ /* @__PURE__ */ jsxRuntime.jsx(Title2, { children: toast.title }),
11750
+ toast.amount && /* @__PURE__ */ jsxRuntime.jsx(Amount, { children: toast.amount }),
11751
+ toast.txHash && txUrl && /* @__PURE__ */ jsxRuntime.jsxs(TxRow, { href: txUrl, target: "_blank", rel: "noopener noreferrer", children: [
11752
+ truncateHash(toast.txHash),
11753
+ /* @__PURE__ */ jsxRuntime.jsx(TxArrow, { children: "\u2197" })
11754
+ ] })
11755
+ ] }),
11756
+ /* @__PURE__ */ jsxRuntime.jsx(CloseBtn, { type: "button", onClick: dismiss, "aria-label": "Dismiss", children: "\u2715" })
11757
+ ] }),
11758
+ duration > 0 && /* @__PURE__ */ jsxRuntime.jsx(ProgressBar, { $color: accent, $duration: duration })
11759
+ ] });
11760
+ }
11761
+ var ToastContext = React5.createContext(null);
11762
+ function ToastProvider({ children }) {
11763
+ const [toasts, setToasts] = React5.useState([]);
11764
+ const addToast = React5.useCallback((data) => {
11765
+ const id = `toast-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`;
11766
+ setToasts((prev) => [...prev, { ...data, id }]);
11767
+ return id;
11768
+ }, []);
11769
+ const dismiss = React5.useCallback((id) => {
11770
+ setToasts((prev) => prev.filter((t) => t.id !== id));
11771
+ }, []);
11772
+ return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value: { toast: addToast, dismiss }, children: [
11773
+ children,
11774
+ /* @__PURE__ */ jsxRuntime.jsx(Container, { children: toasts.map((t) => /* @__PURE__ */ jsxRuntime.jsx(ToastItem, { toast: t, onDismiss: dismiss }, t.id)) })
11775
+ ] });
11776
+ }
11777
+ function useToast() {
11778
+ const ctx = React5.useContext(ToastContext);
11779
+ if (!ctx) throw new Error("useToast must be used within a ToastProvider");
11780
+ return ctx;
11781
+ }
11596
11782
  function AssetSelectorBar({
11597
11783
  propertyName,
11598
11784
  tokenPrice,
@@ -11880,11 +12066,11 @@ var IPOOptionLocation = styled9__default.default.div`
11880
12066
  font-weight: 500;
11881
12067
  }
11882
12068
  `;
11883
- var slideOut = styled9.keyframes`
12069
+ var slideOut2 = styled9.keyframes`
11884
12070
  0% { transform: translateY(0); opacity: 1; }
11885
12071
  100% { transform: translateY(100%); opacity: 0; }
11886
12072
  `;
11887
- var slideIn = styled9.keyframes`
12073
+ var slideIn2 = styled9.keyframes`
11888
12074
  0% { transform: translateY(-100%); opacity: 0; }
11889
12075
  100% { transform: translateY(0); opacity: 1; }
11890
12076
  `;
@@ -11897,13 +12083,13 @@ var SlideWrap = styled9__default.default.span`
11897
12083
  `;
11898
12084
  var SlideNew = styled9__default.default.span`
11899
12085
  display: inline-block;
11900
- animation: ${(props) => props.$animate ? slideIn : "none"} 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
12086
+ animation: ${(props) => props.$animate ? slideIn2 : "none"} 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
11901
12087
  `;
11902
12088
  var SlideOld = styled9__default.default.span`
11903
12089
  position: absolute;
11904
12090
  top: 0;
11905
12091
  left: 0;
11906
- animation: ${slideOut} 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
12092
+ animation: ${slideOut2} 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
11907
12093
  `;
11908
12094
  function SlideDigit({ value }) {
11909
12095
  const prevRef = React5.useRef(value);
@@ -11995,7 +12181,7 @@ function OfferingProgressCard({
11995
12181
  }
11996
12182
  if (variant === "home") {
11997
12183
  const isPreLive = !ipoStarted && ipoStatus !== "CLOSED" && ipoStatus !== "CANCELLED";
11998
- return /* @__PURE__ */ jsxRuntime.jsxs(Container, { style, className, children: [
12184
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container2, { style, className, children: [
11999
12185
  /* @__PURE__ */ jsxRuntime.jsxs(Header2, { children: [
12000
12186
  /* @__PURE__ */ jsxRuntime.jsxs("h3", { children: [
12001
12187
  /* @__PURE__ */ jsxRuntime.jsx(fa.FaChartLine, {}),
@@ -12077,7 +12263,7 @@ function OfferingProgressCard({
12077
12263
  ] })
12078
12264
  ] });
12079
12265
  }
12080
- return /* @__PURE__ */ jsxRuntime.jsxs(Container, { style, className, children: [
12266
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container2, { style, className, children: [
12081
12267
  /* @__PURE__ */ jsxRuntime.jsxs(Header2, { children: [
12082
12268
  /* @__PURE__ */ jsxRuntime.jsxs("h3", { children: [
12083
12269
  /* @__PURE__ */ jsxRuntime.jsx(fa.FaChartLine, {}),
@@ -12178,7 +12364,7 @@ function OfferingProgressCard({
12178
12364
  ] })
12179
12365
  ] });
12180
12366
  }
12181
- var Container = styled9__default.default.div`
12367
+ var Container2 = styled9__default.default.div`
12182
12368
  background-color: var(--color-card-darker, #111);
12183
12369
  border-radius: 8px;
12184
12370
  padding: 1.5rem;
@@ -12431,192 +12617,6 @@ var HomeSpinner = styled9__default.default.span`
12431
12617
  to { transform: rotate(360deg); }
12432
12618
  }
12433
12619
  `;
12434
- var slideIn2 = styled9.keyframes`
12435
- from { transform: translateX(110%); opacity: 0; }
12436
- to { transform: translateX(0); opacity: 1; }
12437
- `;
12438
- var slideOut2 = styled9.keyframes`
12439
- from { transform: translateX(0); opacity: 1; }
12440
- to { transform: translateX(110%); opacity: 0; }
12441
- `;
12442
- var progressShrink = styled9.keyframes`
12443
- from { width: 100%; }
12444
- to { width: 0%; }
12445
- `;
12446
- var VARIANT_COLORS = {
12447
- success: { accent: "#0ecb81", icon: "\u2713" },
12448
- error: { accent: "#f6465d", icon: "\u2715" },
12449
- sell: { accent: "#f6465d", icon: "\u2713" },
12450
- info: { accent: "#E6C656", icon: "\u2139" },
12451
- pending: { accent: "#7EB3E6", icon: "\u25CC" }
12452
- };
12453
- var Wrapper2 = styled9__default.default.div`
12454
- position: relative;
12455
- display: flex;
12456
- flex-direction: column;
12457
- gap: 0;
12458
- width: 340px;
12459
- background: #0d0f1a;
12460
- border: 1px solid rgba(255, 255, 255, 0.08);
12461
- border-radius: 10px;
12462
- overflow: hidden;
12463
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04);
12464
- animation: ${({ $exiting }) => $exiting ? styled9.css`${slideOut2} 0.28s cubic-bezier(0.4,0,1,1) forwards` : styled9.css`${slideIn2} 0.32s cubic-bezier(0,0,0.2,1) forwards`};
12465
- pointer-events: all;
12466
- `;
12467
- var Body = styled9__default.default.div`
12468
- display: flex;
12469
- align-items: flex-start;
12470
- gap: 12px;
12471
- padding: 14px 16px 12px;
12472
- `;
12473
- var IconDot = styled9__default.default.div`
12474
- flex-shrink: 0;
12475
- width: 28px;
12476
- height: 28px;
12477
- border-radius: 50%;
12478
- background: ${({ $color }) => $color}1a;
12479
- border: 1px solid ${({ $color }) => $color}55;
12480
- display: flex;
12481
- align-items: center;
12482
- justify-content: center;
12483
- font-size: 0.75rem;
12484
- font-weight: 700;
12485
- color: ${({ $color }) => $color};
12486
- margin-top: 1px;
12487
- `;
12488
- var Content = styled9__default.default.div`
12489
- flex: 1;
12490
- min-width: 0;
12491
- `;
12492
- var Title2 = styled9__default.default.p`
12493
- margin: 0 0 2px;
12494
- font-size: 0.8rem;
12495
- font-weight: 600;
12496
- color: #fff;
12497
- letter-spacing: 0.01em;
12498
- `;
12499
- var Amount = styled9__default.default.p`
12500
- margin: 0 0 6px;
12501
- font-size: 1.05rem;
12502
- font-weight: 700;
12503
- color: #E6C656;
12504
- letter-spacing: -0.01em;
12505
- `;
12506
- var TxRow = styled9__default.default.a`
12507
- display: inline-flex;
12508
- align-items: center;
12509
- gap: 5px;
12510
- font-family: 'IBM Plex Mono', 'Space Mono', monospace;
12511
- font-size: 0.68rem;
12512
- color: rgba(255, 255, 255, 0.4);
12513
- text-decoration: none;
12514
- transition: color 0.15s;
12515
- &:hover {
12516
- color: #7EB3E6;
12517
- }
12518
- `;
12519
- var TxArrow = styled9__default.default.span`
12520
- font-size: 0.6rem;
12521
- opacity: 0.6;
12522
- `;
12523
- var CloseBtn = styled9__default.default.button`
12524
- flex-shrink: 0;
12525
- background: none;
12526
- border: none;
12527
- padding: 2px 4px;
12528
- cursor: pointer;
12529
- color: rgba(255, 255, 255, 0.25);
12530
- font-size: 0.9rem;
12531
- line-height: 1;
12532
- transition: color 0.15s;
12533
- &:hover { color: rgba(255, 255, 255, 0.7); }
12534
- `;
12535
- var ProgressBar = styled9__default.default.div`
12536
- height: 2px;
12537
- background: rgba(255, 255, 255, 0.06);
12538
- position: relative;
12539
- &::after {
12540
- content: '';
12541
- position: absolute;
12542
- left: 0;
12543
- top: 0;
12544
- height: 100%;
12545
- background: ${({ $color }) => $color};
12546
- animation: ${styled9.css`${progressShrink} ${({ $duration }) => $duration}ms linear forwards`};
12547
- }
12548
- `;
12549
- var Container2 = styled9__default.default.div`
12550
- position: fixed;
12551
- bottom: 24px;
12552
- right: 24px;
12553
- z-index: 9999;
12554
- display: flex;
12555
- flex-direction: column-reverse;
12556
- gap: 10px;
12557
- pointer-events: none;
12558
- `;
12559
- var DEFAULT_EXPLORER = "https://sepolia.basescan.org/tx/";
12560
- function truncateHash(hash) {
12561
- return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
12562
- }
12563
- function ToastItem({ toast, onDismiss }) {
12564
- const [exiting, setExiting] = React5.useState(false);
12565
- const timerRef = React5.useRef(null);
12566
- const dismiss = React5.useCallback(() => {
12567
- setExiting(true);
12568
- setTimeout(() => onDismiss(toast.id), 280);
12569
- }, [onDismiss, toast.id]);
12570
- React5.useEffect(() => {
12571
- const duration2 = toast.duration ?? 6e3;
12572
- if (duration2 > 0) {
12573
- timerRef.current = setTimeout(dismiss, duration2);
12574
- }
12575
- return () => {
12576
- if (timerRef.current) clearTimeout(timerRef.current);
12577
- };
12578
- }, [dismiss, toast.duration]);
12579
- const { accent, icon } = VARIANT_COLORS[toast.variant];
12580
- const duration = toast.duration ?? 6e3;
12581
- const explorerBase = toast.explorerUrl ?? DEFAULT_EXPLORER;
12582
- const txUrl = toast.txHash ? `${explorerBase}${toast.txHash}` : void 0;
12583
- return /* @__PURE__ */ jsxRuntime.jsxs(Wrapper2, { $exiting: exiting, children: [
12584
- /* @__PURE__ */ jsxRuntime.jsxs(Body, { children: [
12585
- /* @__PURE__ */ jsxRuntime.jsx(IconDot, { $color: accent, children: icon }),
12586
- /* @__PURE__ */ jsxRuntime.jsxs(Content, { children: [
12587
- /* @__PURE__ */ jsxRuntime.jsx(Title2, { children: toast.title }),
12588
- toast.amount && /* @__PURE__ */ jsxRuntime.jsx(Amount, { children: toast.amount }),
12589
- toast.txHash && txUrl && /* @__PURE__ */ jsxRuntime.jsxs(TxRow, { href: txUrl, target: "_blank", rel: "noopener noreferrer", children: [
12590
- truncateHash(toast.txHash),
12591
- /* @__PURE__ */ jsxRuntime.jsx(TxArrow, { children: "\u2197" })
12592
- ] })
12593
- ] }),
12594
- /* @__PURE__ */ jsxRuntime.jsx(CloseBtn, { type: "button", onClick: dismiss, "aria-label": "Dismiss", children: "\u2715" })
12595
- ] }),
12596
- duration > 0 && /* @__PURE__ */ jsxRuntime.jsx(ProgressBar, { $color: accent, $duration: duration })
12597
- ] });
12598
- }
12599
- var ToastContext = React5.createContext(null);
12600
- function ToastProvider({ children }) {
12601
- const [toasts, setToasts] = React5.useState([]);
12602
- const addToast = React5.useCallback((data) => {
12603
- const id = `toast-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`;
12604
- setToasts((prev) => [...prev, { ...data, id }]);
12605
- return id;
12606
- }, []);
12607
- const dismiss = React5.useCallback((id) => {
12608
- setToasts((prev) => prev.filter((t) => t.id !== id));
12609
- }, []);
12610
- return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value: { toast: addToast, dismiss }, children: [
12611
- children,
12612
- /* @__PURE__ */ jsxRuntime.jsx(Container2, { children: toasts.map((t) => /* @__PURE__ */ jsxRuntime.jsx(ToastItem, { toast: t, onDismiss: dismiss }, t.id)) })
12613
- ] });
12614
- }
12615
- function useToast() {
12616
- const ctx = React5.useContext(ToastContext);
12617
- if (!ctx) throw new Error("useToast must be used within a ToastProvider");
12618
- return ctx;
12619
- }
12620
12620
  function useCountdown(opensAt) {
12621
12621
  const [now, setNow] = React5.useState(() => Math.floor(Date.now() / 1e3));
12622
12622
  React5.useEffect(() => {
@@ -12665,9 +12665,9 @@ function OrderPanel({
12665
12665
  onDeposit,
12666
12666
  onVerifyIdentity,
12667
12667
  tokenDisplayName,
12668
- tokenSymbol
12668
+ tokenSymbol,
12669
+ toast
12669
12670
  }) {
12670
- const { toast } = useToast();
12671
12671
  const countdown = useCountdown(opensAt);
12672
12672
  const [payInputValue, setPayInputValue] = React5.useState("");
12673
12673
  const [receiveInputValue, setReceiveInputValue] = React5.useState("");
@@ -15370,6 +15370,7 @@ function PropertyBuy({
15370
15370
  newsItems = [],
15371
15371
  newsConnectionStatus
15372
15372
  }) {
15373
+ const { toast } = useToast();
15373
15374
  const [sliderValue, setSliderValue] = React5.useState(0);
15374
15375
  const [availableBalance, setAvailableBalance] = React5.useState(walletUsdcBalance ?? 0);
15375
15376
  const [manualOrderAmount, setManualOrderAmount] = React5.useState(null);
@@ -15603,7 +15604,8 @@ function PropertyBuy({
15603
15604
  hasInsufficientFunds,
15604
15605
  onPlaceAnotherOrder: handlePlaceAnotherOrder,
15605
15606
  onDeposit,
15606
- onVerifyIdentity
15607
+ onVerifyIdentity,
15608
+ toast
15607
15609
  }
15608
15610
  ),
15609
15611
  purchaseError && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: "0.75rem", padding: "0.75rem 1rem", borderRadius: "8px", background: "rgba(246,70,93,0.1)", border: "1px solid rgba(246,70,93,0.3)", color: "#f6465d", fontSize: "0.8rem", fontWeight: 500 }, children: purchaseError })