@loafmarkets/ui 0.1.212 → 0.1.214

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
@@ -8525,6 +8525,7 @@ function PropertyOverview({
8525
8525
  const [showDividendHistory, setShowDividendHistory] = React5.useState(false);
8526
8526
  const [showHolders, setShowHolders] = React5.useState(false);
8527
8527
  const [copiedAddress, setCopiedAddress] = React5.useState(false);
8528
+ const [statsTab, setStatsTab] = React5.useState("token");
8528
8529
  const description = descriptionProp ?? overviewData?.description ?? DEFAULT_DESCRIPTION;
8529
8530
  const landSize = landProp ?? overviewData?.landSizeSqm ?? null;
8530
8531
  const buildingSize = buildingProp ?? overviewData?.buildingSizeSqm ?? null;
@@ -8582,7 +8583,7 @@ function PropertyOverview({
8582
8583
  { label: "Location", value: location || "\u2014" }
8583
8584
  ];
8584
8585
  const vol24hDollar = volume24h != null && tokenPriceValue ? volume24h * tokenPriceValue : null;
8585
- const holdRatio = (() => {
8586
+ (() => {
8586
8587
  if (!tokenMarketCap || tokenMarketCap <= 0 || vol24hDollar == null) return null;
8587
8588
  const turnover = vol24hDollar / (tokenMarketCap / 2);
8588
8589
  const holdPct = Math.max(0, Math.min(100, (1 - turnover) * 100));
@@ -8656,46 +8657,40 @@ function PropertyOverview({
8656
8657
  ] }),
8657
8658
  /* @__PURE__ */ jsxRuntime.jsxs(Section, { children: [
8658
8659
  /* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { children: "Statistics" }),
8659
- /* @__PURE__ */ jsxRuntime.jsxs(StatsGrid, { children: [
8660
- /* @__PURE__ */ jsxRuntime.jsxs(StatsColumn, { children: [
8661
- /* @__PURE__ */ jsxRuntime.jsx(StatsColumnHeader, { children: "Token Performance" }),
8662
- tokenStats.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(StatRow, { $gold: !!item.gold, children: [
8663
- /* @__PURE__ */ jsxRuntime.jsx(StatLabel, { children: item.label }),
8664
- item.label === "Holders" && holderCount != null ? /* @__PURE__ */ jsxRuntime.jsx(StatValueClickable, { onClick: () => setShowHolders(true), children: item.value }) : /* @__PURE__ */ jsxRuntime.jsx(StatValue, { $gold: !!item.gold, children: item.value })
8665
- ] }, item.label)),
8666
- holdRatio && /* @__PURE__ */ jsxRuntime.jsxs(HoldRatioWrap, { children: [
8667
- /* @__PURE__ */ jsxRuntime.jsxs(HoldRatioTitle, { children: [
8668
- /* @__PURE__ */ jsxRuntime.jsx(HoldRatioTitleText, { children: "Holding Ratio" }),
8669
- /* @__PURE__ */ jsxRuntime.jsx(HoldRatioInfo, { "data-tip": "Proportion of token holders vs active traders over the last 24 hours, measured by trading volume against market capitalisation.", children: "?" })
8670
- ] }),
8671
- /* @__PURE__ */ jsxRuntime.jsxs(HoldRatioHeader, { children: [
8672
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
8673
- /* @__PURE__ */ jsxRuntime.jsx(HoldRatioLabel, { $side: "hold", children: "Holding " }),
8674
- /* @__PURE__ */ jsxRuntime.jsxs(HoldRatioValue, { $side: "hold", children: [
8675
- holdRatio.holdPct.toFixed(1),
8676
- "%"
8677
- ] })
8678
- ] }),
8679
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
8680
- /* @__PURE__ */ jsxRuntime.jsxs(HoldRatioValue, { $side: "trade", children: [
8681
- holdRatio.tradePct,
8682
- "%"
8683
- ] }),
8684
- /* @__PURE__ */ jsxRuntime.jsx(HoldRatioLabel, { $side: "trade", children: " Trading" })
8685
- ] })
8686
- ] }),
8687
- /* @__PURE__ */ jsxRuntime.jsx(HoldRatioTrack, { children: /* @__PURE__ */ jsxRuntime.jsx(HoldRatioFill, { $pct: holdRatio.holdPct }) })
8688
- ] })
8660
+ /* @__PURE__ */ jsxRuntime.jsxs(StatsDesktop, { children: [
8661
+ /* @__PURE__ */ jsxRuntime.jsxs(StatsRowSection, { children: [
8662
+ /* @__PURE__ */ jsxRuntime.jsx(StatsRowLabel, { children: "Token Performance" }),
8663
+ /* @__PURE__ */ jsxRuntime.jsx(StatsHRow, { children: tokenStats.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(StatsHCell, { children: [
8664
+ /* @__PURE__ */ jsxRuntime.jsx(StatsHCellLabel, { children: item.label }),
8665
+ item.label === "Holders" && holderCount != null ? /* @__PURE__ */ jsxRuntime.jsx(StatValueClickable, { onClick: () => setShowHolders(true), children: item.value }) : /* @__PURE__ */ jsxRuntime.jsx(StatsHCellValue, { $gold: !!item.gold, children: item.value })
8666
+ ] }, item.label)) })
8689
8667
  ] }),
8690
- /* @__PURE__ */ jsxRuntime.jsxs(StatsColumn, { children: [
8691
- /* @__PURE__ */ jsxRuntime.jsx(StatsColumnHeader, { children: "Property Fundamentals" }),
8668
+ /* @__PURE__ */ jsxRuntime.jsxs(StatsRowSection, { children: [
8669
+ /* @__PURE__ */ jsxRuntime.jsx(StatsRowLabel, { children: "Property Fundamentals" }),
8670
+ /* @__PURE__ */ jsxRuntime.jsx(StatsHRow, { children: propertyStats.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(StatsHCell, { children: [
8671
+ /* @__PURE__ */ jsxRuntime.jsx(StatsHCellLabel, { children: item.label }),
8672
+ /* @__PURE__ */ jsxRuntime.jsx(StatsHCellValue, { children: item.value })
8673
+ ] }, item.label)) }),
8674
+ /* @__PURE__ */ jsxRuntime.jsx(DividendHistoryBtn, { onClick: () => setShowDividendHistory(true), children: "See Dividend History \u2192" })
8675
+ ] })
8676
+ ] }),
8677
+ /* @__PURE__ */ jsxRuntime.jsx(StatsMobile, { children: /* @__PURE__ */ jsxRuntime.jsxs(StatsTabbedCard, { children: [
8678
+ /* @__PURE__ */ jsxRuntime.jsxs(StatsTabBar, { children: [
8679
+ /* @__PURE__ */ jsxRuntime.jsx(StatsTab, { $active: statsTab === "token", onClick: () => setStatsTab("token"), children: "Token" }),
8680
+ /* @__PURE__ */ jsxRuntime.jsx(StatsTab, { $active: statsTab === "property", onClick: () => setStatsTab("property"), children: "Property" })
8681
+ ] }),
8682
+ statsTab === "token" && /* @__PURE__ */ jsxRuntime.jsx(StatsTabContent, { children: tokenStats.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(StatRow, { $gold: !!item.gold, children: [
8683
+ /* @__PURE__ */ jsxRuntime.jsx(StatLabel, { children: item.label }),
8684
+ item.label === "Holders" && holderCount != null ? /* @__PURE__ */ jsxRuntime.jsx(StatValueClickable, { onClick: () => setShowHolders(true), children: item.value }) : /* @__PURE__ */ jsxRuntime.jsx(StatValue, { $gold: !!item.gold, children: item.value })
8685
+ ] }, item.label)) }),
8686
+ statsTab === "property" && /* @__PURE__ */ jsxRuntime.jsxs(StatsTabContent, { children: [
8692
8687
  propertyStats.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(StatRow, { children: [
8693
8688
  /* @__PURE__ */ jsxRuntime.jsx(StatLabel, { children: item.label }),
8694
8689
  /* @__PURE__ */ jsxRuntime.jsx(StatValue, { children: item.value })
8695
8690
  ] }, item.label)),
8696
8691
  /* @__PURE__ */ jsxRuntime.jsx(DividendHistoryBtn, { onClick: () => setShowDividendHistory(true), children: "See Dividend History \u2192" })
8697
8692
  ] })
8698
- ] })
8693
+ ] }) })
8699
8694
  ] }),
8700
8695
  showDividendHistory && /* @__PURE__ */ jsxRuntime.jsx(
8701
8696
  DividendHistoryPopup,
@@ -9356,6 +9351,89 @@ var ChainLogoImg = styled9__default.default.img`
9356
9351
  width: auto;
9357
9352
  vertical-align: middle;
9358
9353
  `;
9354
+ var StatsDesktop = styled9__default.default.div`
9355
+ display: flex;
9356
+ flex-direction: column;
9357
+ gap: 1.5rem;
9358
+ @media (max-width: 768px) { display: none; }
9359
+ `;
9360
+ var StatsMobile = styled9__default.default.div`
9361
+ display: none;
9362
+ @media (max-width: 768px) { display: block; }
9363
+ `;
9364
+ var StatsRowSection = styled9__default.default.div`
9365
+ display: flex;
9366
+ flex-direction: column;
9367
+ gap: 0.5rem;
9368
+ `;
9369
+ var StatsRowLabel = styled9__default.default.div`
9370
+ font-size: 0.65rem;
9371
+ color: #D4AF37;
9372
+ text-transform: uppercase;
9373
+ letter-spacing: 0.12em;
9374
+ font-weight: 600;
9375
+ `;
9376
+ var StatsHRow = styled9__default.default.div`
9377
+ display: flex;
9378
+ gap: 0;
9379
+ background: rgba(255,255,255,0.025);
9380
+ border: 1px solid rgba(255,255,255,0.06);
9381
+ border-radius: 10px;
9382
+ overflow: hidden;
9383
+ `;
9384
+ var StatsHCell = styled9__default.default.div`
9385
+ flex: 1;
9386
+ display: flex;
9387
+ flex-direction: column;
9388
+ align-items: center;
9389
+ gap: 6px;
9390
+ padding: 1rem 0.75rem;
9391
+ border-right: 1px solid rgba(255,255,255,0.04);
9392
+ &:last-child { border-right: none; }
9393
+ transition: background 0.15s;
9394
+ &:hover { background: rgba(255,255,255,0.03); }
9395
+ `;
9396
+ var StatsHCellLabel = styled9__default.default.span`
9397
+ font-size: 0.7rem;
9398
+ color: rgba(255,255,255,0.4);
9399
+ font-weight: 400;
9400
+ white-space: nowrap;
9401
+ `;
9402
+ var StatsHCellValue = styled9__default.default.span`
9403
+ font-size: 0.92rem;
9404
+ font-weight: 500;
9405
+ color: ${(p) => p.$gold ? "#D4AF37" : "#fff"};
9406
+ font-variant-numeric: tabular-nums;
9407
+ `;
9408
+ var StatsTabbedCard = styled9__default.default.div`
9409
+ background: rgba(255,255,255,0.025);
9410
+ border: 1px solid rgba(255,255,255,0.06);
9411
+ border-radius: 10px;
9412
+ max-width: 400px;
9413
+ `;
9414
+ var StatsTabBar = styled9__default.default.div`
9415
+ display: flex;
9416
+ border-bottom: 1px solid rgba(255,255,255,0.06);
9417
+ `;
9418
+ var StatsTab = styled9__default.default.button`
9419
+ flex: 1;
9420
+ padding: 0.85rem 1rem;
9421
+ background: none;
9422
+ border: none;
9423
+ font-size: 0.68rem;
9424
+ font-weight: 600;
9425
+ text-transform: uppercase;
9426
+ letter-spacing: 0.1em;
9427
+ cursor: pointer;
9428
+ transition: color 0.15s, border-color 0.15s;
9429
+ color: ${(p) => p.$active ? "#D4AF37" : "rgba(255,255,255,0.35)"};
9430
+ border-bottom: 2px solid ${(p) => p.$active ? "#D4AF37" : "transparent"};
9431
+ margin-bottom: -1px;
9432
+ &:hover { color: ${(p) => p.$active ? "#D4AF37" : "rgba(255,255,255,0.6)"}; }
9433
+ `;
9434
+ var StatsTabContent = styled9__default.default.div`
9435
+ padding: 0.5rem 1.25rem 1.25rem;
9436
+ `;
9359
9437
  var StatsGrid = styled9__default.default.div`
9360
9438
  display: grid;
9361
9439
  grid-template-columns: 340px 340px;
@@ -9738,7 +9816,7 @@ var SecurityDocLink = styled9__default.default.a`
9738
9816
  color: rgba(212,175,55,0.9);
9739
9817
  }
9740
9818
  `;
9741
- var HoldRatioWrap = styled9__default.default.div`
9819
+ styled9__default.default.div`
9742
9820
  display: flex;
9743
9821
  flex-direction: column;
9744
9822
  gap: 6px;
@@ -9746,19 +9824,19 @@ var HoldRatioWrap = styled9__default.default.div`
9746
9824
  margin-top: 0.5rem;
9747
9825
  border-top: 1px solid rgba(255,255,255,0.04);
9748
9826
  `;
9749
- var HoldRatioTitle = styled9__default.default.div`
9827
+ styled9__default.default.div`
9750
9828
  display: flex;
9751
9829
  align-items: center;
9752
9830
  gap: 5px;
9753
9831
  `;
9754
- var HoldRatioTitleText = styled9__default.default.span`
9832
+ styled9__default.default.span`
9755
9833
  font-size: 0.65rem;
9756
9834
  font-weight: 600;
9757
9835
  text-transform: uppercase;
9758
9836
  letter-spacing: 0.06em;
9759
9837
  color: rgba(255,255,255,0.4);
9760
9838
  `;
9761
- var HoldRatioInfo = styled9__default.default.span`
9839
+ styled9__default.default.span`
9762
9840
  position: relative;
9763
9841
  display: inline-flex;
9764
9842
  align-items: center;
@@ -9801,32 +9879,32 @@ var HoldRatioInfo = styled9__default.default.span`
9801
9879
  opacity: 1;
9802
9880
  }
9803
9881
  `;
9804
- var HoldRatioHeader = styled9__default.default.div`
9882
+ styled9__default.default.div`
9805
9883
  display: flex;
9806
9884
  align-items: center;
9807
9885
  justify-content: space-between;
9808
9886
  `;
9809
- var HoldRatioLabel = styled9__default.default.span`
9887
+ styled9__default.default.span`
9810
9888
  font-size: 0.7rem;
9811
9889
  font-weight: 600;
9812
9890
  text-transform: uppercase;
9813
9891
  letter-spacing: 0.05em;
9814
9892
  color: ${(p) => p.$side === "trade" ? "rgba(246, 70, 93, 0.6)" : "rgba(14, 203, 129, 0.6)"};
9815
9893
  `;
9816
- var HoldRatioValue = styled9__default.default.span`
9894
+ styled9__default.default.span`
9817
9895
  font-size: 0.75rem;
9818
9896
  font-weight: 600;
9819
9897
  font-variant-numeric: tabular-nums;
9820
9898
  color: ${(p) => p.$side === "trade" ? "rgba(246, 70, 93, 0.7)" : "rgba(14, 203, 129, 0.7)"};
9821
9899
  `;
9822
- var HoldRatioTrack = styled9__default.default.div`
9900
+ styled9__default.default.div`
9823
9901
  height: 6px;
9824
9902
  border-radius: 3px;
9825
9903
  background: rgba(246, 70, 93, 0.15);
9826
9904
  overflow: hidden;
9827
9905
  position: relative;
9828
9906
  `;
9829
- var HoldRatioFill = styled9__default.default.div`
9907
+ styled9__default.default.div`
9830
9908
  height: 100%;
9831
9909
  width: ${(p) => p.$pct}%;
9832
9910
  border-radius: 3px;