@loafmarkets/ui 0.1.113 → 0.1.115

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
@@ -5551,6 +5551,50 @@ var Header = ({
5551
5551
  }
5552
5552
  ),
5553
5553
  isAuthenticated ? /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
5554
+ portfolioSummary && isPortfolioBarVisible && (() => {
5555
+ const fmtInline = (n) => n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
5556
+ const isPLPos = portfolioSummary.pnl >= 0;
5557
+ return /* @__PURE__ */ jsxs(PortfolioInline, { className: "loaf-portfolio-inline", children: [
5558
+ /* @__PURE__ */ jsxs(PBMetric, { children: [
5559
+ /* @__PURE__ */ jsx(PBMetricLabel, { children: "Holdings" }),
5560
+ /* @__PURE__ */ jsxs(PBMetricValue, { children: [
5561
+ "$",
5562
+ fmtInline(portfolioSummary.holdings)
5563
+ ] })
5564
+ ] }),
5565
+ /* @__PURE__ */ jsx(PBOperator, { children: "+" }),
5566
+ /* @__PURE__ */ jsxs(PBMetric, { children: [
5567
+ /* @__PURE__ */ jsx(PBMetricLabel, { children: "Cash" }),
5568
+ /* @__PURE__ */ jsxs(PBMetricValue, { children: [
5569
+ "$",
5570
+ fmtInline(portfolioSummary.cash)
5571
+ ] })
5572
+ ] }),
5573
+ /* @__PURE__ */ jsx(PBOperator, { children: "=" }),
5574
+ /* @__PURE__ */ jsxs(PBMetric, { children: [
5575
+ /* @__PURE__ */ jsx(PBMetricLabel, { children: "Portfolio" }),
5576
+ /* @__PURE__ */ jsxs(PBMetricValue, { style: { color: "#D4AF37", fontWeight: 700 }, children: [
5577
+ "$",
5578
+ fmtInline(portfolioSummary.portfolioValue)
5579
+ ] })
5580
+ ] }),
5581
+ /* @__PURE__ */ jsx(PBDot, {}),
5582
+ /* @__PURE__ */ jsxs(PBMetric, { children: [
5583
+ /* @__PURE__ */ jsx(PBMetricLabel, { children: "P&L" }),
5584
+ /* @__PURE__ */ jsxs(PBMetricValue, { $positive: isPLPos, $negative: !isPLPos, children: [
5585
+ isPLPos ? "+" : "",
5586
+ "$",
5587
+ fmtInline(Math.abs(portfolioSummary.pnl)),
5588
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: "0.6rem", marginLeft: "2px", opacity: 0.7 }, children: [
5589
+ "(",
5590
+ isPLPos ? "+" : "",
5591
+ portfolioSummary.pnlPercent.toFixed(2),
5592
+ "%)"
5593
+ ] })
5594
+ ] })
5595
+ ] })
5596
+ ] });
5597
+ })(),
5554
5598
  portfolioSummary && /* @__PURE__ */ jsx(
5555
5599
  PortfolioEyeButton,
5556
5600
  {
@@ -5636,8 +5680,8 @@ var Header = ({
5636
5680
  isAuthenticated && portfolioSummary && isPortfolioBarVisible && (() => {
5637
5681
  const fmt = (n) => n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
5638
5682
  const isPLPositive = portfolioSummary.pnl >= 0;
5639
- return /* @__PURE__ */ jsx(PortfolioBarContainer, { children: /* @__PURE__ */ jsxs(PortfolioBarPill, { ref: portfolioPillRef, children: [
5640
- portfolioArrowLeft !== null && /* @__PURE__ */ jsx(PortfolioBarArrow, { style: { left: `${portfolioArrowLeft}px` } }),
5683
+ return /* @__PURE__ */ jsx(PortfolioBarContainer, { className: "loaf-portfolio-bar loaf-portfolio-bar-dropdown", children: /* @__PURE__ */ jsxs(PortfolioBarPill, { ref: portfolioPillRef, className: "loaf-portfolio-pill", children: [
5684
+ portfolioArrowLeft !== null && /* @__PURE__ */ jsx(PortfolioBarArrow, { className: "loaf-portfolio-arrow", style: { left: `${portfolioArrowLeft}px` } }),
5641
5685
  /* @__PURE__ */ jsxs(PBMetric, { children: [
5642
5686
  /* @__PURE__ */ jsx(PBMetricLabel, { children: "Holdings" }),
5643
5687
  /* @__PURE__ */ jsxs(PBMetricValue, { children: [
@@ -6154,7 +6198,7 @@ var PortfolioBarContainer = styled25.div`
6154
6198
  left: 0;
6155
6199
  right: 0;
6156
6200
  z-index: 999;
6157
- display: flex;
6201
+ display: none;
6158
6202
  justify-content: flex-end;
6159
6203
  align-items: flex-start;
6160
6204
  padding: 0 5%;
@@ -6173,6 +6217,7 @@ var PortfolioBarContainer = styled25.div`
6173
6217
  }
6174
6218
 
6175
6219
  @media (max-width: 768px) {
6220
+ display: flex;
6176
6221
  top: calc(46px + 0.5rem);
6177
6222
  padding: 0 0.75rem;
6178
6223
  justify-content: center;
@@ -6232,6 +6277,16 @@ var PortfolioBarArrow = styled25.div`
6232
6277
  box-shadow: -2px -2px 6px rgba(0, 0, 0, 0.25);
6233
6278
  pointer-events: none;
6234
6279
  `;
6280
+ var PortfolioInline = styled25.div`
6281
+ display: flex;
6282
+ align-items: center;
6283
+ gap: 1rem;
6284
+ margin-right: 0.75rem;
6285
+
6286
+ @media (max-width: 768px) {
6287
+ display: none;
6288
+ }
6289
+ `;
6235
6290
  var PBMetric = styled25.div`
6236
6291
  display: flex;
6237
6292
  flex-direction: column;