@loafmarkets/ui 0.1.383 → 0.1.385

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
@@ -643,7 +643,7 @@ type HeaderPortfolioData = {
643
643
  pnl: number;
644
644
  pnlPercent: number;
645
645
  };
646
- type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "about" | "portfolio" | "learn" | "api";
646
+ type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "leaderboard" | "leaderboardPage" | "about" | "portfolio" | "learn" | "api";
647
647
  type HeaderLoginPopupComponentProps = {
648
648
  onClose: () => void;
649
649
  initialView?: LoginPopupView;
@@ -664,6 +664,8 @@ type HeaderProps = {
664
664
  apiPath?: string;
665
665
  offeringsPath?: string;
666
666
  propertyMapPath?: string;
667
+ leaderboardPath?: string;
668
+ leaderboardPagePath?: string;
667
669
  portfolioPath?: string;
668
670
  loafLiquidityPath?: string;
669
671
  /** Absolute URL for the auth/login surface (e.g. https://auth.loafmarkets.com/login). */
package/dist/index.d.ts CHANGED
@@ -643,7 +643,7 @@ type HeaderPortfolioData = {
643
643
  pnl: number;
644
644
  pnlPercent: number;
645
645
  };
646
- type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "about" | "portfolio" | "learn" | "api";
646
+ type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "leaderboard" | "leaderboardPage" | "about" | "portfolio" | "learn" | "api";
647
647
  type HeaderLoginPopupComponentProps = {
648
648
  onClose: () => void;
649
649
  initialView?: LoginPopupView;
@@ -664,6 +664,8 @@ type HeaderProps = {
664
664
  apiPath?: string;
665
665
  offeringsPath?: string;
666
666
  propertyMapPath?: string;
667
+ leaderboardPath?: string;
668
+ leaderboardPagePath?: string;
667
669
  portfolioPath?: string;
668
670
  loafLiquidityPath?: string;
669
671
  /** Absolute URL for the auth/login surface (e.g. https://auth.loafmarkets.com/login). */
package/dist/index.js CHANGED
@@ -5067,6 +5067,8 @@ var DEFAULT_ABOUT_PATH = "/about";
5067
5067
  var DEFAULT_LEARN_PATH = "/learn";
5068
5068
  var DEFAULT_API_PATH = "/api";
5069
5069
  var DEFAULT_PROPERTY_MAP_PATH = "/map";
5070
+ var DEFAULT_LEADERBOARD_PATH = "/league";
5071
+ var DEFAULT_LEADERBOARD_PAGE_PATH = "/leaderboard";
5070
5072
  var DEFAULT_PORTFOLIO_PATH = "/portfolio";
5071
5073
  var DEFAULT_LOAF_LIQUIDITY_PATH = "/loaf-liquidity";
5072
5074
  var DEFAULT_AUTH_RETURN_PARAM = "returnTo";
@@ -5087,6 +5089,8 @@ var Header = ({
5087
5089
  apiPath = DEFAULT_API_PATH,
5088
5090
  offeringsPath,
5089
5091
  propertyMapPath = DEFAULT_PROPERTY_MAP_PATH,
5092
+ leaderboardPath = DEFAULT_LEADERBOARD_PATH,
5093
+ leaderboardPagePath = DEFAULT_LEADERBOARD_PAGE_PATH,
5090
5094
  portfolioPath = DEFAULT_PORTFOLIO_PATH,
5091
5095
  loafLiquidityPath = DEFAULT_LOAF_LIQUIDITY_PATH,
5092
5096
  authLoginUrl,
@@ -5360,6 +5364,8 @@ var Header = ({
5360
5364
  const resolvedOfferingsPath = offeringsPath ?? void 0;
5361
5365
  const offeringsHref = resolvedOfferingsPath ?? resolvedHomePath;
5362
5366
  const resolvedPropertyMapPath = propertyMapPath ?? DEFAULT_PROPERTY_MAP_PATH;
5367
+ const resolvedLeaderboardPath = leaderboardPath ?? DEFAULT_LEADERBOARD_PATH;
5368
+ const resolvedLeaderboardPagePath = leaderboardPagePath ?? DEFAULT_LEADERBOARD_PAGE_PATH;
5363
5369
  const resolvedPortfolioPath = portfolioPath ?? DEFAULT_PORTFOLIO_PATH;
5364
5370
  const resolvedLoafLiquidityPath = loafLiquidityPath ?? DEFAULT_LOAF_LIQUIDITY_PATH;
5365
5371
  const inferredActiveTab = (() => {
@@ -5370,6 +5376,8 @@ var Header = ({
5370
5376
  if (locationPath === resolvedApiPath) return "api";
5371
5377
  if (resolvedOfferingsPath && locationPath.startsWith(resolvedOfferingsPath)) return "offerings";
5372
5378
  if (locationPath === resolvedPropertyMapPath) return "propertyMap";
5379
+ if (locationPath === resolvedLeaderboardPagePath) return "leaderboardPage";
5380
+ if (locationPath === resolvedLeaderboardPath) return "leaderboard";
5373
5381
  if (locationPath === resolvedPortfolioPath) return "portfolio";
5374
5382
  return null;
5375
5383
  })();
@@ -5378,6 +5386,8 @@ var Header = ({
5378
5386
  const homeActive = resolvedActiveTab === "home";
5379
5387
  const offeringsActive = resolvedActiveTab === "offerings";
5380
5388
  const propertyMapActive = resolvedActiveTab === "propertyMap";
5389
+ const leaderboardActive = resolvedActiveTab === "leaderboard";
5390
+ const leaderboardPageActive = resolvedActiveTab === "leaderboardPage";
5381
5391
  const aboutActive = resolvedActiveTab === "about";
5382
5392
  const portfolioActive = resolvedActiveTab === "portfolio";
5383
5393
  const learnActive = resolvedActiveTab === "learn";
@@ -5461,48 +5471,91 @@ var Header = ({
5461
5471
  /* @__PURE__ */ jsxRuntime.jsx(
5462
5472
  NavLink,
5463
5473
  {
5464
- href: resolvedLearnPath,
5465
- className: learnActive ? "active" : "",
5474
+ href: resolvedLeaderboardPath,
5475
+ className: leaderboardActive ? "active" : "",
5466
5476
  onClick: (event) => {
5467
5477
  event.preventDefault();
5468
- handleNavigation(resolvedLearnPath);
5478
+ handleNavigation(resolvedLeaderboardPath);
5469
5479
  },
5470
- children: "Learn"
5480
+ children: "Competition"
5471
5481
  }
5472
5482
  ),
5473
5483
  /* @__PURE__ */ jsxRuntime.jsx(
5474
5484
  NavLink,
5475
5485
  {
5476
- href: resolvedAboutPath,
5477
- className: aboutActive ? "active" : "",
5486
+ href: resolvedLeaderboardPagePath,
5487
+ className: leaderboardPageActive ? "active" : "",
5478
5488
  onClick: (event) => {
5479
5489
  event.preventDefault();
5480
- handleNavigation(resolvedAboutPath);
5490
+ handleNavigation(resolvedLeaderboardPagePath);
5481
5491
  },
5482
- children: "About"
5492
+ children: "Leaderboard"
5483
5493
  }
5484
5494
  ),
5485
5495
  /* @__PURE__ */ jsxRuntime.jsx(
5486
5496
  NavLink,
5487
5497
  {
5488
- href: resolvedApiPath,
5489
- className: apiActive ? "active" : "",
5498
+ href: resolvedLearnPath,
5499
+ className: learnActive ? "active" : "",
5490
5500
  onClick: (event) => {
5491
5501
  event.preventDefault();
5492
- handleNavigation(resolvedApiPath);
5502
+ handleNavigation(resolvedLearnPath);
5493
5503
  },
5494
- children: "API"
5495
- }
5496
- ),
5497
- /* @__PURE__ */ jsxRuntime.jsx(
5498
- NavLink,
5499
- {
5500
- href: "https://docs.loafmarkets.com/en/",
5501
- target: "_blank",
5502
- rel: "noopener noreferrer",
5503
- children: "Docs"
5504
+ children: "Learn"
5504
5505
  }
5505
5506
  ),
5507
+ /* @__PURE__ */ jsxRuntime.jsxs(MoreMenu, { className: "more-menu", children: [
5508
+ /* @__PURE__ */ jsxRuntime.jsxs(
5509
+ MoreTrigger,
5510
+ {
5511
+ type: "button",
5512
+ className: `${isMoreMenuOpen ? "open" : ""} ${aboutActive || apiActive ? "active" : ""}`,
5513
+ "aria-haspopup": "true",
5514
+ "aria-expanded": isMoreMenuOpen,
5515
+ onClick: () => setIsMoreMenuOpen((open) => !open),
5516
+ children: [
5517
+ "More",
5518
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 9l6 6 6-6", strokeLinecap: "round", strokeLinejoin: "round" }) })
5519
+ ]
5520
+ }
5521
+ ),
5522
+ isMoreMenuOpen && /* @__PURE__ */ jsxRuntime.jsxs(MoreDropdown, { children: [
5523
+ /* @__PURE__ */ jsxRuntime.jsx(
5524
+ MoreItem,
5525
+ {
5526
+ href: resolvedAboutPath,
5527
+ className: aboutActive ? "active" : "",
5528
+ onClick: (event) => {
5529
+ event.preventDefault();
5530
+ handleNavigation(resolvedAboutPath);
5531
+ },
5532
+ children: "About"
5533
+ }
5534
+ ),
5535
+ /* @__PURE__ */ jsxRuntime.jsx(
5536
+ MoreItem,
5537
+ {
5538
+ href: resolvedApiPath,
5539
+ className: apiActive ? "active" : "",
5540
+ onClick: (event) => {
5541
+ event.preventDefault();
5542
+ handleNavigation(resolvedApiPath);
5543
+ },
5544
+ children: "API"
5545
+ }
5546
+ ),
5547
+ /* @__PURE__ */ jsxRuntime.jsx(
5548
+ MoreItem,
5549
+ {
5550
+ href: "https://docs.loafmarkets.com/en/",
5551
+ target: "_blank",
5552
+ rel: "noopener noreferrer",
5553
+ onClick: () => setIsMoreMenuOpen(false),
5554
+ children: "Docs"
5555
+ }
5556
+ )
5557
+ ] })
5558
+ ] }),
5506
5559
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(
5507
5560
  "div",
5508
5561
  {
@@ -5543,6 +5596,8 @@ var Header = ({
5543
5596
  ),
5544
5597
  /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(offeringsHref), children: "Initial Offerings" }),
5545
5598
  /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedPropertyMapPath), children: "Property Map" }),
5599
+ /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLeaderboardPath), children: "Competition" }),
5600
+ /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLeaderboardPagePath), children: "Leaderboard" }),
5546
5601
  /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLearnPath), children: "Learn" }),
5547
5602
  /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedAboutPath), children: "About" }),
5548
5603
  /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedApiPath), children: "API" }),
@@ -6060,6 +6115,77 @@ var NavLink = styled10__default.default.a`
6060
6115
  }
6061
6116
  }
6062
6117
  `;
6118
+ var MoreMenu = styled10__default.default.div`
6119
+ position: relative;
6120
+ display: flex;
6121
+ align-items: center;
6122
+ height: 56px;
6123
+ `;
6124
+ var MoreTrigger = styled10__default.default.button`
6125
+ margin: 0 12px;
6126
+ padding: 0 4px;
6127
+ height: 56px;
6128
+ display: inline-flex;
6129
+ align-items: center;
6130
+ gap: 4px;
6131
+ background: none;
6132
+ border: none;
6133
+ cursor: pointer;
6134
+ color: #eaecef;
6135
+ font-weight: 500;
6136
+ font-size: 14px;
6137
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
6138
+ letter-spacing: 0.2px;
6139
+ transition: color 0.2s ease;
6140
+
6141
+ &:hover,
6142
+ &.active {
6143
+ color: #E6C87E;
6144
+ }
6145
+
6146
+ svg {
6147
+ width: 14px;
6148
+ height: 14px;
6149
+ transition: transform 0.2s ease;
6150
+ }
6151
+ &.open svg {
6152
+ transform: rotate(180deg);
6153
+ }
6154
+ `;
6155
+ var MoreDropdown = styled10__default.default.div`
6156
+ position: absolute;
6157
+ top: 100%;
6158
+ right: 0;
6159
+ min-width: 160px;
6160
+ padding: 6px;
6161
+ background: #1e2026;
6162
+ border: 1px solid #2b3139;
6163
+ border-radius: 10px;
6164
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
6165
+ display: flex;
6166
+ flex-direction: column;
6167
+ z-index: 1100;
6168
+ `;
6169
+ var MoreItem = styled10__default.default.a`
6170
+ padding: 10px 12px;
6171
+ border-radius: 6px;
6172
+ color: #eaecef;
6173
+ font-weight: 500;
6174
+ font-size: 14px;
6175
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
6176
+ letter-spacing: 0.2px;
6177
+ text-decoration: none;
6178
+ cursor: pointer;
6179
+ transition: background 0.15s ease, color 0.15s ease;
6180
+
6181
+ &:hover {
6182
+ background: #2b3139;
6183
+ color: #E6C87E;
6184
+ }
6185
+ &.active {
6186
+ color: #E6C87E;
6187
+ }
6188
+ `;
6063
6189
  var Button2 = styled10__default.default.button.attrs({ type: "button" })`
6064
6190
  padding: 0.5rem 1rem;
6065
6191
  border-radius: 6px;