@loafmarkets/ui 0.1.350 → 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.d.mts CHANGED
@@ -984,8 +984,9 @@ type ToastContextValue = {
984
984
  update: (id: string, patch: Partial<Omit<ToastData, 'id'>>) => void;
985
985
  dismiss: (id: string) => void;
986
986
  };
987
- declare function ToastProvider({ children }: {
987
+ declare function ToastProvider({ children, maxVisible }: {
988
988
  children: React__default.ReactNode;
989
+ maxVisible?: number;
989
990
  }): react_jsx_runtime.JSX.Element;
990
991
  declare function useToast(): ToastContextValue;
991
992
 
package/dist/index.d.ts CHANGED
@@ -984,8 +984,9 @@ type ToastContextValue = {
984
984
  update: (id: string, patch: Partial<Omit<ToastData, 'id'>>) => void;
985
985
  dismiss: (id: string) => void;
986
986
  };
987
- declare function ToastProvider({ children }: {
987
+ declare function ToastProvider({ children, maxVisible }: {
988
988
  children: React__default.ReactNode;
989
+ maxVisible?: number;
989
990
  }): react_jsx_runtime.JSX.Element;
990
991
  declare function useToast(): ToastContextValue;
991
992
 
package/dist/index.js CHANGED
@@ -6704,7 +6704,11 @@ var LoginPopup = ({
6704
6704
  try {
6705
6705
  await onVerifyEmailCode({ code, email });
6706
6706
  if (isSignUp) {
6707
- setView(onSubmitReferralCode ? "referral" : "funding");
6707
+ if (onSubmitReferralCode) {
6708
+ setView("referral");
6709
+ } else {
6710
+ onClose();
6711
+ }
6708
6712
  setLoading(false);
6709
6713
  return;
6710
6714
  }
@@ -6917,7 +6921,8 @@ var LoginPopup = ({
6917
6921
  loading ? /* @__PURE__ */ jsxRuntime.jsxs(AccountCreationLoader, { children: [
6918
6922
  /* @__PURE__ */ jsxRuntime.jsx(SpinnerRing, {}),
6919
6923
  /* @__PURE__ */ jsxRuntime.jsx(AccountCreationText, { children: isSignUp ? "Preparing your account\u2026" : "Signing you in\u2026" }),
6920
- /* @__PURE__ */ jsxRuntime.jsx(AccountCreationSubtext, { children: "This may take a few seconds" })
6924
+ /* @__PURE__ */ jsxRuntime.jsx(AccountCreationSubtext, { children: "This may take a few seconds" }),
6925
+ /* @__PURE__ */ jsxRuntime.jsx(PreparingFacts, {})
6921
6926
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6922
6927
  /* @__PURE__ */ jsxRuntime.jsxs(BackButton, { onClick: () => setView("email"), children: [
6923
6928
  /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" }) }),
@@ -7120,7 +7125,7 @@ var LoginPopup = ({
7120
7125
  setReferralLoading(true);
7121
7126
  try {
7122
7127
  await onSubmitReferralCode?.(trimmed);
7123
- setView("funding");
7128
+ onClose();
7124
7129
  } catch (err) {
7125
7130
  setReferralError(err instanceof Error ? err.message : "Invalid referral code. Please try again.");
7126
7131
  } finally {
@@ -7147,7 +7152,7 @@ var LoginPopup = ({
7147
7152
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
7148
7153
  ] }) }),
7149
7154
  /* @__PURE__ */ jsxRuntime.jsx(OnboardingHeading, { children: "Do you have a referral code?" }),
7150
- /* @__PURE__ */ jsxRuntime.jsx(OnboardingSubtext, { style: { marginBottom: "1.5rem" }, children: "Enter your code to unlock full access, or skip to continue." }),
7155
+ /* @__PURE__ */ jsxRuntime.jsx(OnboardingSubtext, { style: { marginBottom: "1.5rem" }, children: "Enter your code to unlock $100k in testnet USD, or skip to continue." }),
7151
7156
  /* @__PURE__ */ jsxRuntime.jsxs(EmailFormContainer, { style: { width: "100%", marginBottom: 0 }, children: [
7152
7157
  /* @__PURE__ */ jsxRuntime.jsx(
7153
7158
  EmailInput,
@@ -7180,7 +7185,7 @@ var LoginPopup = ({
7180
7185
  OnboardingSkipButton,
7181
7186
  {
7182
7187
  type: "button",
7183
- onClick: () => setView("funding"),
7188
+ onClick: onClose,
7184
7189
  style: { marginTop: "0.75rem" },
7185
7190
  children: "Skip for now"
7186
7191
  }
@@ -8022,6 +8027,59 @@ var SpinnerRing = styled9__default.default.div`
8022
8027
  to { transform: rotate(360deg); }
8023
8028
  }
8024
8029
  `;
8030
+ var PREPARING_FACTS = [
8031
+ "Property is the world's largest asset class \u2014 worth over US$300 trillion.",
8032
+ "Loaf settles trades in about 1 second. Traditional property takes ~90 days.",
8033
+ "Our matching engine processes orders in 30 microseconds.",
8034
+ "Every token is backed 1:1 by land-title-registered property.",
8035
+ "Own a slice of premium real estate \u2014 no mortgage, no paperwork.",
8036
+ "Buy and sell property as easily as a stock, on a live orderbook.",
8037
+ "Earn rental yield on the exact fraction of property you own.",
8038
+ "Title-backed by the NSW Land Registry \u2014 real ownership, on-chain.",
8039
+ "Loaf ran the world's first property IPO."
8040
+ ];
8041
+ var FactCard = styled9__default.default.div`
8042
+ margin-top: 1.5rem;
8043
+ max-width: 340px;
8044
+ padding: 0.85rem 1.1rem;
8045
+ border: 1px solid rgba(230, 198, 86, 0.18);
8046
+ border-radius: 12px;
8047
+ background: rgba(230, 198, 86, 0.05);
8048
+ text-align: center;
8049
+ `;
8050
+ var FactLabel = styled9__default.default.div`
8051
+ font-size: 0.6rem;
8052
+ letter-spacing: 0.12em;
8053
+ text-transform: uppercase;
8054
+ font-weight: 700;
8055
+ color: var(--color-accent, #e6c656);
8056
+ margin-bottom: 0.4rem;
8057
+ `;
8058
+ var FactText = styled9__default.default.p`
8059
+ margin: 0;
8060
+ font-size: 0.85rem;
8061
+ line-height: 1.5;
8062
+ color: var(--color-text, #eaecef);
8063
+ animation: factFade 0.5s ease;
8064
+
8065
+ @keyframes factFade {
8066
+ from { opacity: 0; transform: translateY(4px); }
8067
+ to { opacity: 1; transform: translateY(0); }
8068
+ }
8069
+ `;
8070
+ var PreparingFacts = () => {
8071
+ const [index, setIndex] = React5.useState(() => Math.floor(Math.random() * PREPARING_FACTS.length));
8072
+ React5.useEffect(() => {
8073
+ const id = setInterval(() => {
8074
+ setIndex((i) => (i + 1) % PREPARING_FACTS.length);
8075
+ }, 4e3);
8076
+ return () => clearInterval(id);
8077
+ }, []);
8078
+ return /* @__PURE__ */ jsxRuntime.jsxs(FactCard, { children: [
8079
+ /* @__PURE__ */ jsxRuntime.jsx(FactLabel, { children: "Did you know?" }),
8080
+ /* @__PURE__ */ jsxRuntime.jsx(FactText, { children: PREPARING_FACTS[index] }, index)
8081
+ ] });
8082
+ };
8025
8083
  LoginPopup.displayName = "LoginPopup";
8026
8084
  var PropertyCompareBar = React5__namespace.forwardRef(
8027
8085
  ({
@@ -18099,13 +18157,16 @@ function ToastItem({ toast, onDismiss }) {
18099
18157
  ] });
18100
18158
  }
18101
18159
  var ToastContext = React5.createContext(null);
18102
- function ToastProvider({ children }) {
18160
+ function ToastProvider({ children, maxVisible }) {
18103
18161
  const [toasts, setToasts] = React5.useState([]);
18104
18162
  const addToast = React5.useCallback((data) => {
18105
18163
  const id = `toast-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`;
18106
- setToasts((prev) => [...prev, { ...data, id }]);
18164
+ setToasts((prev) => {
18165
+ const next = [...prev, { ...data, id }];
18166
+ return maxVisible && next.length > maxVisible ? next.slice(next.length - maxVisible) : next;
18167
+ });
18107
18168
  return id;
18108
- }, []);
18169
+ }, [maxVisible]);
18109
18170
  const update = React5.useCallback((id, patch) => {
18110
18171
  setToasts((prev) => prev.map((t) => t.id === id ? { ...t, ...patch } : t));
18111
18172
  }, []);