@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.js CHANGED
@@ -5577,6 +5577,50 @@ var Header = ({
5577
5577
  }
5578
5578
  ),
5579
5579
  isAuthenticated ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
5580
+ portfolioSummary && isPortfolioBarVisible && (() => {
5581
+ const fmtInline = (n) => n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
5582
+ const isPLPos = portfolioSummary.pnl >= 0;
5583
+ return /* @__PURE__ */ jsxRuntime.jsxs(PortfolioInline, { className: "loaf-portfolio-inline", children: [
5584
+ /* @__PURE__ */ jsxRuntime.jsxs(PBMetric, { children: [
5585
+ /* @__PURE__ */ jsxRuntime.jsx(PBMetricLabel, { children: "Holdings" }),
5586
+ /* @__PURE__ */ jsxRuntime.jsxs(PBMetricValue, { children: [
5587
+ "$",
5588
+ fmtInline(portfolioSummary.holdings)
5589
+ ] })
5590
+ ] }),
5591
+ /* @__PURE__ */ jsxRuntime.jsx(PBOperator, { children: "+" }),
5592
+ /* @__PURE__ */ jsxRuntime.jsxs(PBMetric, { children: [
5593
+ /* @__PURE__ */ jsxRuntime.jsx(PBMetricLabel, { children: "Cash" }),
5594
+ /* @__PURE__ */ jsxRuntime.jsxs(PBMetricValue, { children: [
5595
+ "$",
5596
+ fmtInline(portfolioSummary.cash)
5597
+ ] })
5598
+ ] }),
5599
+ /* @__PURE__ */ jsxRuntime.jsx(PBOperator, { children: "=" }),
5600
+ /* @__PURE__ */ jsxRuntime.jsxs(PBMetric, { children: [
5601
+ /* @__PURE__ */ jsxRuntime.jsx(PBMetricLabel, { children: "Portfolio" }),
5602
+ /* @__PURE__ */ jsxRuntime.jsxs(PBMetricValue, { style: { color: "#D4AF37", fontWeight: 700 }, children: [
5603
+ "$",
5604
+ fmtInline(portfolioSummary.portfolioValue)
5605
+ ] })
5606
+ ] }),
5607
+ /* @__PURE__ */ jsxRuntime.jsx(PBDot, {}),
5608
+ /* @__PURE__ */ jsxRuntime.jsxs(PBMetric, { children: [
5609
+ /* @__PURE__ */ jsxRuntime.jsx(PBMetricLabel, { children: "P&L" }),
5610
+ /* @__PURE__ */ jsxRuntime.jsxs(PBMetricValue, { $positive: isPLPos, $negative: !isPLPos, children: [
5611
+ isPLPos ? "+" : "",
5612
+ "$",
5613
+ fmtInline(Math.abs(portfolioSummary.pnl)),
5614
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "0.6rem", marginLeft: "2px", opacity: 0.7 }, children: [
5615
+ "(",
5616
+ isPLPos ? "+" : "",
5617
+ portfolioSummary.pnlPercent.toFixed(2),
5618
+ "%)"
5619
+ ] })
5620
+ ] })
5621
+ ] })
5622
+ ] });
5623
+ })(),
5580
5624
  portfolioSummary && /* @__PURE__ */ jsxRuntime.jsx(
5581
5625
  PortfolioEyeButton,
5582
5626
  {
@@ -5662,8 +5706,8 @@ var Header = ({
5662
5706
  isAuthenticated && portfolioSummary && isPortfolioBarVisible && (() => {
5663
5707
  const fmt = (n) => n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
5664
5708
  const isPLPositive = portfolioSummary.pnl >= 0;
5665
- return /* @__PURE__ */ jsxRuntime.jsx(PortfolioBarContainer, { children: /* @__PURE__ */ jsxRuntime.jsxs(PortfolioBarPill, { ref: portfolioPillRef, children: [
5666
- portfolioArrowLeft !== null && /* @__PURE__ */ jsxRuntime.jsx(PortfolioBarArrow, { style: { left: `${portfolioArrowLeft}px` } }),
5709
+ return /* @__PURE__ */ jsxRuntime.jsx(PortfolioBarContainer, { className: "loaf-portfolio-bar loaf-portfolio-bar-dropdown", children: /* @__PURE__ */ jsxRuntime.jsxs(PortfolioBarPill, { ref: portfolioPillRef, className: "loaf-portfolio-pill", children: [
5710
+ portfolioArrowLeft !== null && /* @__PURE__ */ jsxRuntime.jsx(PortfolioBarArrow, { className: "loaf-portfolio-arrow", style: { left: `${portfolioArrowLeft}px` } }),
5667
5711
  /* @__PURE__ */ jsxRuntime.jsxs(PBMetric, { children: [
5668
5712
  /* @__PURE__ */ jsxRuntime.jsx(PBMetricLabel, { children: "Holdings" }),
5669
5713
  /* @__PURE__ */ jsxRuntime.jsxs(PBMetricValue, { children: [
@@ -6180,7 +6224,7 @@ var PortfolioBarContainer = styled25__default.default.div`
6180
6224
  left: 0;
6181
6225
  right: 0;
6182
6226
  z-index: 999;
6183
- display: flex;
6227
+ display: none;
6184
6228
  justify-content: flex-end;
6185
6229
  align-items: flex-start;
6186
6230
  padding: 0 5%;
@@ -6199,6 +6243,7 @@ var PortfolioBarContainer = styled25__default.default.div`
6199
6243
  }
6200
6244
 
6201
6245
  @media (max-width: 768px) {
6246
+ display: flex;
6202
6247
  top: calc(46px + 0.5rem);
6203
6248
  padding: 0 0.75rem;
6204
6249
  justify-content: center;
@@ -6258,6 +6303,16 @@ var PortfolioBarArrow = styled25__default.default.div`
6258
6303
  box-shadow: -2px -2px 6px rgba(0, 0, 0, 0.25);
6259
6304
  pointer-events: none;
6260
6305
  `;
6306
+ var PortfolioInline = styled25__default.default.div`
6307
+ display: flex;
6308
+ align-items: center;
6309
+ gap: 1rem;
6310
+ margin-right: 0.75rem;
6311
+
6312
+ @media (max-width: 768px) {
6313
+ display: none;
6314
+ }
6315
+ `;
6261
6316
  var PBMetric = styled25__default.default.div`
6262
6317
  display: flex;
6263
6318
  flex-direction: column;