@loafmarkets/ui 0.1.96 → 0.1.98

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
@@ -913,8 +913,9 @@ type AssetSelectorBarProps = {
913
913
  selectorItems?: readonly SelectorItem[];
914
914
  onSelect?: (tokenName: string) => void;
915
915
  trailing?: ReactNode;
916
+ imageUrl?: string;
916
917
  };
917
- declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
918
+ declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, imageUrl, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
918
919
 
919
920
  type IpoStatus = 'PENDING' | 'LIVE' | 'CLOSED' | 'CANCELLED';
920
921
  type SaleData = {
package/dist/index.d.ts CHANGED
@@ -913,8 +913,9 @@ type AssetSelectorBarProps = {
913
913
  selectorItems?: readonly SelectorItem[];
914
914
  onSelect?: (tokenName: string) => void;
915
915
  trailing?: ReactNode;
916
+ imageUrl?: string;
916
917
  };
917
- declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
918
+ declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, imageUrl, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
918
919
 
919
920
  type IpoStatus = 'PENDING' | 'LIVE' | 'CLOSED' | 'CANCELLED';
920
921
  type SaleData = {
package/dist/index.js CHANGED
@@ -9671,7 +9671,8 @@ function AssetSelectorBar({
9671
9671
  currentTokenName,
9672
9672
  selectorItems,
9673
9673
  onSelect,
9674
- trailing
9674
+ trailing,
9675
+ imageUrl
9675
9676
  }) {
9676
9677
  const [isDropdownOpen, setIsDropdownOpen] = React5.useState(false);
9677
9678
  const hasItems = selectorItems && selectorItems.length > 0;
@@ -9680,6 +9681,7 @@ function AssetSelectorBar({
9680
9681
  ...offeringValuation != null ? [{ label: "Offering Valuation", value: `$${offeringValuation.toLocaleString()}` }] : []
9681
9682
  ];
9682
9683
  return /* @__PURE__ */ jsxRuntime.jsx(AssetSelectorWrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(IPOAssetSelector, { children: [
9684
+ imageUrl && /* @__PURE__ */ jsxRuntime.jsx(AssetThumbnail, { src: imageUrl, alt: propertyName }),
9683
9685
  /* @__PURE__ */ jsxRuntime.jsx(AssetSelectorDropdown, { onClick: () => hasItems && setIsDropdownOpen((prev) => !prev), children: /* @__PURE__ */ jsxRuntime.jsxs(AssetName, { children: [
9684
9686
  propertyName,
9685
9687
  hasItems && /* @__PURE__ */ jsxRuntime.jsx(
@@ -9769,6 +9771,20 @@ var IPOAssetSelector = styled25__default.default.div`
9769
9771
  padding: 0.6rem 0.75rem;
9770
9772
  }
9771
9773
  `;
9774
+ var AssetThumbnail = styled25__default.default.img`
9775
+ width: 40px;
9776
+ height: 40px;
9777
+ border-radius: 8px;
9778
+ object-fit: cover;
9779
+ flex-shrink: 0;
9780
+ border: 1px solid rgba(255, 255, 255, 0.1);
9781
+
9782
+ @media (max-width: 768px) {
9783
+ width: 32px;
9784
+ height: 32px;
9785
+ border-radius: 6px;
9786
+ }
9787
+ `;
9772
9788
  var AssetSelectorDropdown = styled25__default.default.div`
9773
9789
  display: flex;
9774
9790
  align-items: center;
@@ -11813,8 +11829,8 @@ var InsufficientFunds = styled25__default.default.div`
11813
11829
  `;
11814
11830
  var ACTIVITY_PAGE_SIZE_DEFAULT = 10;
11815
11831
  var formatCurrency5 = (value, opts) => {
11816
- const min = opts?.minimumFractionDigits ?? 2;
11817
- const max = opts?.maximumFractionDigits ?? 2;
11832
+ const min = 2;
11833
+ const max = 2;
11818
11834
  return `$${value.toLocaleString("en-US", { minimumFractionDigits: min, maximumFractionDigits: max })}`;
11819
11835
  };
11820
11836
  var formatNumber2 = (value, maximumFractionDigits = 2) => value.toLocaleString("en-US", { minimumFractionDigits: 0, maximumFractionDigits });
@@ -11967,17 +11983,20 @@ function PortfolioActivityPanel({
11967
11983
  ] })
11968
11984
  ] }),
11969
11985
  /* @__PURE__ */ jsxRuntime.jsxs(HoldingsQuantity, { children: [
11970
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: formatCurrency5(currentValue) }),
11971
- /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "0.65rem", color: "rgba(255,255,255,0.4)" }, children: [
11986
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
11987
+ formatNumber2(pos.quantity),
11988
+ " ",
11989
+ pos.tokenName
11990
+ ] }),
11991
+ /* @__PURE__ */ jsxRuntime.jsxs(HoldingsAvgEntry, { children: [
11972
11992
  "Avg ",
11973
- formatCurrency5(costBasis, { maximumFractionDigits: 0 })
11993
+ formatCurrency5(pos.averageEntryPrice)
11974
11994
  ] })
11975
11995
  ] }),
11976
11996
  /* @__PURE__ */ jsxRuntime.jsxs(HoldingsPnL, { children: [
11977
11997
  /* @__PURE__ */ jsxRuntime.jsxs(PnLAmount, { $positive: isPositive, children: [
11978
11998
  isPositive ? "+" : "-",
11979
- "$",
11980
- Math.abs(pnl).toFixed(2)
11999
+ formatCurrency5(Math.abs(pnl))
11981
12000
  ] }),
11982
12001
  /* @__PURE__ */ jsxRuntime.jsxs(PnLPercentage, { $positive: isPositive, children: [
11983
12002
  isPositive ? "+" : "",
@@ -12404,7 +12423,7 @@ var HoldingsQuantity = styled25__default.default.div`
12404
12423
  font-weight: 500;
12405
12424
  color: #fff;
12406
12425
  `;
12407
- styled25__default.default.div`
12426
+ var HoldingsAvgEntry = styled25__default.default.div`
12408
12427
  font-size: 0.7rem;
12409
12428
  color: var(--color-accent, #E6C87E);
12410
12429
  font-weight: 500;