@loafmarkets/ui 0.1.357 → 0.1.359

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
@@ -4565,9 +4565,14 @@ var PriceChart = React5.forwardRef(
4565
4565
  }
4566
4566
  );
4567
4567
  PriceChart.displayName = "PriceChart";
4568
- var formatPrice3 = (value, currencySymbol) => {
4568
+ var formatPrice3 = (value, currencySymbol, compact) => {
4569
4569
  const abs = Math.abs(value);
4570
4570
  if (abs >= 1e6) {
4571
+ if (!compact) {
4572
+ return `${currencySymbol}${Math.round(value).toLocaleString(void 0, {
4573
+ maximumFractionDigits: 0
4574
+ })}`;
4575
+ }
4571
4576
  const unit = abs >= 1e12 ? { v: 1e12, s: "T" } : abs >= 1e9 ? { v: 1e9, s: "B" } : { v: 1e6, s: "M" };
4572
4577
  return `${currencySymbol}${(value / unit.v).toFixed(1)}${unit.s}`;
4573
4578
  }
@@ -4610,6 +4615,14 @@ var PropertyHeroHeader = React5.forwardRef(
4610
4615
  const tradeHoverColor = "#f5dd9a";
4611
4616
  const [isTradeInteracting, setIsTradeInteracting] = React5.useState(false);
4612
4617
  const [isOfferInteracting, setIsOfferInteracting] = React5.useState(false);
4618
+ const [isMobile, setIsMobile] = React5.useState(
4619
+ () => typeof window !== "undefined" && window.innerWidth <= 768
4620
+ );
4621
+ React5.useEffect(() => {
4622
+ const onResize = () => setIsMobile(window.innerWidth <= 768);
4623
+ window.addEventListener("resize", onResize);
4624
+ return () => window.removeEventListener("resize", onResize);
4625
+ }, []);
4613
4626
  const isTradeDisabled = !onTrade;
4614
4627
  const isMakeOfferButtonDisabled = makeOfferDisabled || !onMakeOffer;
4615
4628
  const showMakeOfferButton = !hideMakeOfferButton;
@@ -4657,7 +4670,7 @@ var PropertyHeroHeader = React5.forwardRef(
4657
4670
  isLoading ? /* @__PURE__ */ jsx(Skeleton, { width: 110, height: 24 }) : price == null ? null : /* @__PURE__ */ jsxs(PriceRow, { children: [
4658
4671
  /* @__PURE__ */ jsx(CurrencyLabel, { children: "USD" }),
4659
4672
  changePercent != null ? /* @__PURE__ */ jsx(PriceArrow, { $isPositive: isPositive, children: isPositive ? "\u25B2" : "\u25BC" }) : null,
4660
- formatPrice3(price, "")
4673
+ formatPrice3(price, "", isMobile)
4661
4674
  ] }),
4662
4675
  changePercent != null ? /* @__PURE__ */ jsxs(PriceChangeRow, { $isPositive: isPositive, children: [
4663
4676
  priceChange != null ? `${isPositive ? "+" : ""}${priceChange.toFixed(2)} ` : null,
@@ -6439,7 +6452,8 @@ var LoginPopup = ({
6439
6452
  initialView,
6440
6453
  kycStatus: kycStatusProp,
6441
6454
  walletAddress,
6442
- onSubmitReferralCode
6455
+ onSubmitReferralCode,
6456
+ onJoinWaitlist
6443
6457
  }) => {
6444
6458
  const [view, setView] = useState(() => initialView ?? "main");
6445
6459
  const [email, setEmail] = useState("");
@@ -6450,6 +6464,8 @@ var LoginPopup = ({
6450
6464
  const [referralCode, setReferralCode] = useState("");
6451
6465
  const [referralLoading, setReferralLoading] = useState(false);
6452
6466
  const [referralError, setReferralError] = useState("");
6467
+ const [waitlistLoading, setWaitlistLoading] = useState(false);
6468
+ const [waitlistMessage, setWaitlistMessage] = useState("");
6453
6469
  const [loading, setLoading] = useState(false);
6454
6470
  const [isSignUp, setIsSignUp] = useState(false);
6455
6471
  const [fundingAmount] = useState("");
@@ -6819,30 +6835,6 @@ var LoginPopup = ({
6819
6835
  /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M12 2C9.79 2 8 3.79 8 6v4H6c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2h-2V6c0-2.21-1.79-4-4-4zm-2 4c0-1.1.9-2 2-2s2 .9 2 2v4h-4V6zm2 9a2 2 0 100 4 2 2 0 000-4z" }) }),
6820
6836
  "Sign in with Passkey"
6821
6837
  ] })
6822
- ] }),
6823
- /* @__PURE__ */ jsx(Divider, {}),
6824
- /* @__PURE__ */ jsxs(AnnotationContainer, { children: [
6825
- /* @__PURE__ */ jsxs(Annotation, { children: [
6826
- /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M21 18v1c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h14c1.1 0 2 .9 2 2v1h-9c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2h9zm-9-2h10V8H12v8zm4-2.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z" }) }),
6827
- /* @__PURE__ */ jsxs(AnnotationText, { children: [
6828
- /* @__PURE__ */ jsx(AnnotationLabel, { children: "\u2190 Digital Asset users" }),
6829
- "Connect your Web3 wallet to access your assets"
6830
- ] })
6831
- ] }),
6832
- /* @__PURE__ */ jsxs(Annotation, { children: [
6833
- /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z" }) }),
6834
- /* @__PURE__ */ jsxs(AnnotationText, { children: [
6835
- /* @__PURE__ */ jsx(AnnotationLabel, { children: "\u2190 Traditional Finance users" }),
6836
- "Sign in with email, no web3 experience needed"
6837
- ] })
6838
- ] }),
6839
- /* @__PURE__ */ jsxs(Annotation, { children: [
6840
- /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z" }) }),
6841
- /* @__PURE__ */ jsxs(AnnotationText, { children: [
6842
- /* @__PURE__ */ jsx(AnnotationLabel, { children: "\u2190 Self custodial" }),
6843
- "We never have ownership of your assets. All units are self custodial"
6844
- ] })
6845
- ] })
6846
6838
  ] })
6847
6839
  ] }) });
6848
6840
  }
@@ -7102,6 +7094,22 @@ var LoginPopup = ({
7102
7094
  setReferralLoading(false);
7103
7095
  }
7104
7096
  };
7097
+ const handleJoinWaitlistSkip = async () => {
7098
+ if (!onJoinWaitlist) {
7099
+ onClose();
7100
+ return;
7101
+ }
7102
+ setReferralError("");
7103
+ setWaitlistLoading(true);
7104
+ try {
7105
+ const message = await onJoinWaitlist(email);
7106
+ setWaitlistMessage(message || "You're on the waitlist.");
7107
+ setTimeout(() => onClose(), 1400);
7108
+ } catch (err) {
7109
+ setReferralError(err instanceof Error ? err.message : "Couldn't join the waitlist. Please try again.");
7110
+ setWaitlistLoading(false);
7111
+ }
7112
+ };
7105
7113
  return /* @__PURE__ */ jsx(Overlay2, { onClick: onClose, children: /* @__PURE__ */ jsxs(PopupContainer, { onClick: (event) => event.stopPropagation(), children: [
7106
7114
  /* @__PURE__ */ jsx(CloseButton, { onClick: onClose, "aria-label": "Close login popup", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }) }) }),
7107
7115
  /* @__PURE__ */ jsxs(OnboardingStepContainer, { children: [
@@ -7121,7 +7129,7 @@ var LoginPopup = ({
7121
7129
  /* @__PURE__ */ jsx("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }),
7122
7130
  /* @__PURE__ */ jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
7123
7131
  ] }) }),
7124
- /* @__PURE__ */ jsx(OnboardingHeading, { children: "Do you have a referral code?" }),
7132
+ /* @__PURE__ */ jsx(OnboardingHeading, { children: "Enter code to access Private Beta trading" }),
7125
7133
  /* @__PURE__ */ jsx(OnboardingSubtext, { style: { marginBottom: "1.5rem" }, children: "Enter your code to unlock $100k in testnet USD, or skip to continue." }),
7126
7134
  /* @__PURE__ */ jsxs(EmailFormContainer, { style: { width: "100%", marginBottom: 0 }, children: [
7127
7135
  /* @__PURE__ */ jsx(
@@ -7151,13 +7159,17 @@ var LoginPopup = ({
7151
7159
  ),
7152
7160
  referralError && /* @__PURE__ */ jsx(StatusMessage, { $error: true, children: referralError })
7153
7161
  ] }),
7154
- /* @__PURE__ */ jsx(
7162
+ waitlistMessage ? /* @__PURE__ */ jsxs(StatusMessage, { style: { marginTop: "0.75rem" }, children: [
7163
+ "\u2713 ",
7164
+ waitlistMessage
7165
+ ] }) : /* @__PURE__ */ jsx(
7155
7166
  OnboardingSkipButton,
7156
7167
  {
7157
7168
  type: "button",
7158
- onClick: onClose,
7169
+ onClick: () => void handleJoinWaitlistSkip(),
7170
+ disabled: waitlistLoading,
7159
7171
  style: { marginTop: "0.75rem" },
7160
- children: "Skip for now"
7172
+ children: waitlistLoading ? "Joining\u2026" : "Skip for now & join Waitlist"
7161
7173
  }
7162
7174
  )
7163
7175
  ] })
@@ -7555,57 +7567,12 @@ var LoginButton = styled9.button`
7555
7567
  color: var(--color-accent, #e6c656);
7556
7568
  }
7557
7569
  `;
7558
- var Divider = styled9.div`
7559
- display: flex;
7560
- align-items: center;
7561
- margin: 1.5rem 0;
7562
-
7563
- &::before,
7564
- &::after {
7565
- content: "";
7566
- flex: 1;
7567
- height: 1px;
7568
- background-color: rgba(230, 198, 86, 0.2);
7569
- }
7570
- `;
7571
7570
  var InfoText = styled9.p`
7572
7571
  color: var(--color-text-secondary, #848e9c);
7573
7572
  font-size: 0.875rem;
7574
7573
  text-align: center;
7575
7574
  line-height: 1.5;
7576
7575
  `;
7577
- var AnnotationContainer = styled9.div`
7578
- display: flex;
7579
- flex-direction: column;
7580
- gap: 0.75rem;
7581
- margin-top: 1.5rem;
7582
- padding-top: 1.5rem;
7583
- border-top: 1px solid rgba(230, 198, 86, 0.2);
7584
- `;
7585
- var Annotation = styled9.div`
7586
- display: flex;
7587
- align-items: flex-start;
7588
- gap: 1rem;
7589
- color: var(--color-text-secondary, #848e9c);
7590
- font-size: 0.8rem;
7591
-
7592
- svg {
7593
- width: 16px;
7594
- height: 16px;
7595
- flex-shrink: 0;
7596
- margin-top: 2px;
7597
- color: var(--color-accent, #e6c656);
7598
- }
7599
- `;
7600
- var AnnotationText = styled9.span`
7601
- flex: 1;
7602
- line-height: 1.4;
7603
- `;
7604
- var AnnotationLabel = styled9.span`
7605
- color: var(--color-text, #eaecef);
7606
- font-weight: 500;
7607
- margin-right: 0.25rem;
7608
- `;
7609
7576
  var EmailFormContainer = styled9.div`
7610
7577
  display: flex;
7611
7578
  flex-direction: column;
@@ -9192,8 +9159,7 @@ function PropertyOverview({
9192
9159
  propertyLocation: location,
9193
9160
  videoUrl,
9194
9161
  tokenName,
9195
- onPhotoClick: onPhotosClick,
9196
- hideMap: true
9162
+ onPhotoClick: onPhotosClick
9197
9163
  }
9198
9164
  ),
9199
9165
  /* @__PURE__ */ jsx(FeaturesPanel, { children: features.map((item, i) => /* @__PURE__ */ jsxs(AssetFeatureItem, { children: [
@@ -12172,7 +12138,7 @@ function OrderPanel({
12172
12138
  ] })
12173
12139
  ] })
12174
12140
  ] }),
12175
- /* @__PURE__ */ jsx(Divider2, { children: "\u2193" }),
12141
+ /* @__PURE__ */ jsx(Divider, { children: "\u2193" }),
12176
12142
  /* @__PURE__ */ jsxs(ReadyChecklist, { children: [
12177
12143
  /* @__PURE__ */ jsx(ChecklistTitle, { children: "Get ready to invest" }),
12178
12144
  /* @__PURE__ */ jsx(ChecklistSub, { children: "Complete these steps to be first in line" }),
@@ -12346,7 +12312,7 @@ function OrderPanel({
12346
12312
  }
12347
12313
  )
12348
12314
  ] }),
12349
- /* @__PURE__ */ jsx(Divider2, { children: "\u2193" }),
12315
+ /* @__PURE__ */ jsx(Divider, { children: "\u2193" }),
12350
12316
  /* @__PURE__ */ jsxs(Card2, { children: [
12351
12317
  /* @__PURE__ */ jsxs(CardTopRow, { children: [
12352
12318
  /* @__PURE__ */ jsx(CardLabel, { children: ipoStarted ? "You Receive" : "You'll Receive" }),
@@ -12645,7 +12611,7 @@ var DepositButton2 = styled9.button`
12645
12611
  cursor: pointer;
12646
12612
  font-weight: 500;
12647
12613
  `;
12648
- var Divider2 = styled9.div`
12614
+ var Divider = styled9.div`
12649
12615
  text-align: center;
12650
12616
  margin: 0.25rem 0;
12651
12617
  color: var(--color-text-secondary);