@loafmarkets/ui 0.1.349 → 0.1.351

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
@@ -6419,6 +6419,7 @@ var LoginPopup = ({
6419
6419
  onClose,
6420
6420
  onOpenEarlyAccess,
6421
6421
  onWalletLogin,
6422
+ onPasskeyLogin,
6422
6423
  isAuthenticated,
6423
6424
  currentUser,
6424
6425
  onSendEmailCode,
@@ -6529,6 +6530,20 @@ var LoginPopup = ({
6529
6530
  onOpenEarlyAccess();
6530
6531
  }
6531
6532
  };
6533
+ const handlePasskeyLogin = async () => {
6534
+ if (!onPasskeyLogin) return;
6535
+ setError("");
6536
+ setLoading(true);
6537
+ try {
6538
+ await onPasskeyLogin();
6539
+ onClose();
6540
+ } catch (err) {
6541
+ const message = err instanceof Error ? err.message : "Passkey sign-in failed";
6542
+ setError(message);
6543
+ } finally {
6544
+ setLoading(false);
6545
+ }
6546
+ };
6532
6547
  const handleEmailClick = (signUp = false) => {
6533
6548
  setIsSignUp(signUp);
6534
6549
  setView("email");
@@ -6663,7 +6678,11 @@ var LoginPopup = ({
6663
6678
  try {
6664
6679
  await onVerifyEmailCode({ code, email });
6665
6680
  if (isSignUp) {
6666
- setView(onSubmitReferralCode ? "referral" : "funding");
6681
+ if (onSubmitReferralCode) {
6682
+ setView("referral");
6683
+ } else {
6684
+ onClose();
6685
+ }
6667
6686
  setLoading(false);
6668
6687
  return;
6669
6688
  }
@@ -6786,6 +6805,10 @@ var LoginPopup = ({
6786
6805
  /* @__PURE__ */ jsxs(LoginButton, { onClick: handleWalletLogin, children: [
6787
6806
  /* @__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" }) }),
6788
6807
  "Sign in with Wallet"
6808
+ ] }),
6809
+ onPasskeyLogin && /* @__PURE__ */ jsxs(LoginButton, { onClick: handlePasskeyLogin, disabled: loading, children: [
6810
+ /* @__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" }) }),
6811
+ "Sign in with Passkey"
6789
6812
  ] })
6790
6813
  ] }),
6791
6814
  /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginTop: "0.5rem", marginBottom: "1rem" }, children: /* @__PURE__ */ jsx(
@@ -6872,7 +6895,8 @@ var LoginPopup = ({
6872
6895
  loading ? /* @__PURE__ */ jsxs(AccountCreationLoader, { children: [
6873
6896
  /* @__PURE__ */ jsx(SpinnerRing, {}),
6874
6897
  /* @__PURE__ */ jsx(AccountCreationText, { children: isSignUp ? "Preparing your account\u2026" : "Signing you in\u2026" }),
6875
- /* @__PURE__ */ jsx(AccountCreationSubtext, { children: "This may take a few seconds" })
6898
+ /* @__PURE__ */ jsx(AccountCreationSubtext, { children: "This may take a few seconds" }),
6899
+ /* @__PURE__ */ jsx(PreparingFacts, {})
6876
6900
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
6877
6901
  /* @__PURE__ */ jsxs(BackButton, { onClick: () => setView("email"), children: [
6878
6902
  /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" }) }),
@@ -7075,7 +7099,7 @@ var LoginPopup = ({
7075
7099
  setReferralLoading(true);
7076
7100
  try {
7077
7101
  await onSubmitReferralCode?.(trimmed);
7078
- setView("funding");
7102
+ onClose();
7079
7103
  } catch (err) {
7080
7104
  setReferralError(err instanceof Error ? err.message : "Invalid referral code. Please try again.");
7081
7105
  } finally {
@@ -7102,7 +7126,7 @@ var LoginPopup = ({
7102
7126
  /* @__PURE__ */ jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
7103
7127
  ] }) }),
7104
7128
  /* @__PURE__ */ jsx(OnboardingHeading, { children: "Do you have a referral code?" }),
7105
- /* @__PURE__ */ jsx(OnboardingSubtext, { style: { marginBottom: "1.5rem" }, children: "Enter your code to unlock full access, or skip to continue." }),
7129
+ /* @__PURE__ */ jsx(OnboardingSubtext, { style: { marginBottom: "1.5rem" }, children: "Enter your code to unlock $100k in testnet USD, or skip to continue." }),
7106
7130
  /* @__PURE__ */ jsxs(EmailFormContainer, { style: { width: "100%", marginBottom: 0 }, children: [
7107
7131
  /* @__PURE__ */ jsx(
7108
7132
  EmailInput,
@@ -7135,7 +7159,7 @@ var LoginPopup = ({
7135
7159
  OnboardingSkipButton,
7136
7160
  {
7137
7161
  type: "button",
7138
- onClick: () => setView("funding"),
7162
+ onClick: onClose,
7139
7163
  style: { marginTop: "0.75rem" },
7140
7164
  children: "Skip for now"
7141
7165
  }
@@ -7977,6 +8001,59 @@ var SpinnerRing = styled9.div`
7977
8001
  to { transform: rotate(360deg); }
7978
8002
  }
7979
8003
  `;
8004
+ var PREPARING_FACTS = [
8005
+ "Property is the world's largest asset class \u2014 worth over US$300 trillion.",
8006
+ "Loaf settles trades in about 1 second. Traditional property takes ~90 days.",
8007
+ "Our matching engine processes orders in 30 microseconds.",
8008
+ "Every token is backed 1:1 by land-title-registered property.",
8009
+ "Own a slice of premium real estate \u2014 no mortgage, no paperwork.",
8010
+ "Buy and sell property as easily as a stock, on a live orderbook.",
8011
+ "Earn rental yield on the exact fraction of property you own.",
8012
+ "Title-backed by the NSW Land Registry \u2014 real ownership, on-chain.",
8013
+ "Loaf ran the world's first property IPO."
8014
+ ];
8015
+ var FactCard = styled9.div`
8016
+ margin-top: 1.5rem;
8017
+ max-width: 340px;
8018
+ padding: 0.85rem 1.1rem;
8019
+ border: 1px solid rgba(230, 198, 86, 0.18);
8020
+ border-radius: 12px;
8021
+ background: rgba(230, 198, 86, 0.05);
8022
+ text-align: center;
8023
+ `;
8024
+ var FactLabel = styled9.div`
8025
+ font-size: 0.6rem;
8026
+ letter-spacing: 0.12em;
8027
+ text-transform: uppercase;
8028
+ font-weight: 700;
8029
+ color: var(--color-accent, #e6c656);
8030
+ margin-bottom: 0.4rem;
8031
+ `;
8032
+ var FactText = styled9.p`
8033
+ margin: 0;
8034
+ font-size: 0.85rem;
8035
+ line-height: 1.5;
8036
+ color: var(--color-text, #eaecef);
8037
+ animation: factFade 0.5s ease;
8038
+
8039
+ @keyframes factFade {
8040
+ from { opacity: 0; transform: translateY(4px); }
8041
+ to { opacity: 1; transform: translateY(0); }
8042
+ }
8043
+ `;
8044
+ var PreparingFacts = () => {
8045
+ const [index, setIndex] = useState(() => Math.floor(Math.random() * PREPARING_FACTS.length));
8046
+ useEffect(() => {
8047
+ const id = setInterval(() => {
8048
+ setIndex((i) => (i + 1) % PREPARING_FACTS.length);
8049
+ }, 4e3);
8050
+ return () => clearInterval(id);
8051
+ }, []);
8052
+ return /* @__PURE__ */ jsxs(FactCard, { children: [
8053
+ /* @__PURE__ */ jsx(FactLabel, { children: "Did you know?" }),
8054
+ /* @__PURE__ */ jsx(FactText, { children: PREPARING_FACTS[index] }, index)
8055
+ ] });
8056
+ };
7980
8057
  LoginPopup.displayName = "LoginPopup";
7981
8058
  var PropertyCompareBar = React5.forwardRef(
7982
8059
  ({
@@ -18054,13 +18131,16 @@ function ToastItem({ toast, onDismiss }) {
18054
18131
  ] });
18055
18132
  }
18056
18133
  var ToastContext = createContext(null);
18057
- function ToastProvider({ children }) {
18134
+ function ToastProvider({ children, maxVisible }) {
18058
18135
  const [toasts, setToasts] = useState([]);
18059
18136
  const addToast = useCallback((data) => {
18060
18137
  const id = `toast-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`;
18061
- setToasts((prev) => [...prev, { ...data, id }]);
18138
+ setToasts((prev) => {
18139
+ const next = [...prev, { ...data, id }];
18140
+ return maxVisible && next.length > maxVisible ? next.slice(next.length - maxVisible) : next;
18141
+ });
18062
18142
  return id;
18063
- }, []);
18143
+ }, [maxVisible]);
18064
18144
  const update = useCallback((id, patch) => {
18065
18145
  setToasts((prev) => prev.map((t) => t.id === id ? { ...t, ...patch } : t));
18066
18146
  }, []);