@loafmarkets/ui 0.1.290 → 0.1.292

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
@@ -12802,7 +12802,7 @@ function OrderPanel({
12802
12802
  var Panel = styled9.div`
12803
12803
  background-color: var(--color-card-darker, #111);
12804
12804
  border-radius: 8px;
12805
- padding: 1.5rem;
12805
+ padding: 1.25rem;
12806
12806
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
12807
12807
  border: 1px solid var(--color-border);
12808
12808
  height: 100%;
@@ -12830,11 +12830,11 @@ var PanelHeader2 = styled9.div`
12830
12830
  display: flex;
12831
12831
  justify-content: space-between;
12832
12832
  align-items: center;
12833
- margin-bottom: 1rem;
12834
- padding-bottom: 0.75rem;
12833
+ margin-bottom: 0.75rem;
12834
+ padding-bottom: 0.5rem;
12835
12835
  border-bottom: 1px solid var(--color-border);
12836
12836
  span:first-child {
12837
- font-size: 1rem;
12837
+ font-size: 0.9rem;
12838
12838
  font-weight: 600;
12839
12839
  color: var(--color-text);
12840
12840
  }
@@ -12855,18 +12855,18 @@ var StatusBadge2 = styled9.span`
12855
12855
  var Card2 = styled9.div`
12856
12856
  background: rgba(0,0,0,0.4);
12857
12857
  border: 1px solid rgba(255,255,255,0.15);
12858
- border-radius: 12px;
12859
- padding: 1rem 1.25rem;
12858
+ border-radius: 10px;
12859
+ padding: 0.75rem 1rem;
12860
12860
 
12861
12861
  @media (max-width: 480px) {
12862
- padding: 0.75rem 1rem;
12863
- border-radius: 10px;
12862
+ padding: 0.6rem 0.85rem;
12863
+ border-radius: 8px;
12864
12864
  }
12865
12865
  `;
12866
12866
  var CardLabel = styled9.div`
12867
- font-size: 0.75rem;
12867
+ font-size: 0.7rem;
12868
12868
  color: var(--color-text-secondary);
12869
- margin-bottom: 0.5rem;
12869
+ margin-bottom: 0.3rem;
12870
12870
  `;
12871
12871
  var CardInputRow = styled9.div`
12872
12872
  display: flex;
@@ -12876,17 +12876,17 @@ var CardInputRow = styled9.div`
12876
12876
  background: transparent;
12877
12877
  border: none;
12878
12878
  outline: none;
12879
- font-size: 1.75rem;
12879
+ font-size: 1.4rem;
12880
12880
  font-weight: 600;
12881
12881
  color: #fff;
12882
12882
  width: 100%;
12883
12883
 
12884
12884
  @media (max-width: 480px) {
12885
- font-size: 1.35rem;
12885
+ font-size: 1.15rem;
12886
12886
  }
12887
12887
  }
12888
12888
  span {
12889
- font-size: 1rem;
12889
+ font-size: 0.9rem;
12890
12890
  color: var(--color-text-secondary);
12891
12891
  font-weight: 500;
12892
12892
  margin-left: 0.75rem;
@@ -12895,14 +12895,14 @@ var CardInputRow = styled9.div`
12895
12895
  `;
12896
12896
  var QuickSelectRow = styled9.div`
12897
12897
  display: flex;
12898
- gap: 0.5rem;
12899
- margin-top: 0.75rem;
12898
+ gap: 0.4rem;
12899
+ margin-top: 0.5rem;
12900
12900
  flex-wrap: wrap;
12901
12901
  button {
12902
12902
  flex: 1;
12903
12903
  min-width: 50px;
12904
- padding: 0.4rem 0;
12905
- font-size: 0.75rem;
12904
+ padding: 0.3rem 0;
12905
+ font-size: 0.7rem;
12906
12906
  font-weight: 500;
12907
12907
  background: rgba(255,255,255,0.05);
12908
12908
  border: 1px solid rgba(255,255,255,0.1);
@@ -12945,7 +12945,7 @@ var DepositButton2 = styled9.button`
12945
12945
  `;
12946
12946
  var Divider2 = styled9.div`
12947
12947
  text-align: center;
12948
- margin: 0.5rem 0;
12948
+ margin: 0.25rem 0;
12949
12949
  color: var(--color-text-secondary);
12950
12950
  `;
12951
12951
  var CardTopRow = styled9.div`
@@ -12961,12 +12961,12 @@ var CardHint = styled9.span`
12961
12961
  `;
12962
12962
  var OrderSummary = styled9.div`
12963
12963
  border-top: 1px solid rgba(255,255,255,0.08);
12964
- padding-top: 1rem;
12965
- margin-top: 0.5rem;
12966
- font-size: 0.8rem;
12964
+ padding-top: 0.65rem;
12965
+ margin-top: 0.35rem;
12966
+ font-size: 0.75rem;
12967
12967
  display: flex;
12968
12968
  flex-direction: column;
12969
- gap: 0.5rem;
12969
+ gap: 0.35rem;
12970
12970
  `;
12971
12971
  var SummaryRow = styled9.div`
12972
12972
  display: flex;
@@ -12985,15 +12985,15 @@ var SummaryTotal = styled9(SummaryRow)`
12985
12985
  var FormBody = styled9.div`
12986
12986
  display: flex;
12987
12987
  flex-direction: column;
12988
- gap: 0.75rem;
12988
+ gap: 0.5rem;
12989
12989
  `;
12990
12990
  var SubscribeButton = styled9.button`
12991
12991
  width: 100%;
12992
- margin-top: 1rem;
12993
- padding: 0.875rem;
12992
+ margin-top: 0.75rem;
12993
+ padding: 0.7rem;
12994
12994
  border-radius: 6px;
12995
12995
  font-weight: 600;
12996
- font-size: 0.9rem;
12996
+ font-size: 0.85rem;
12997
12997
  border: none;
12998
12998
  cursor: pointer;
12999
12999
  transition: all 0.2s;
@@ -13014,27 +13014,27 @@ var SubscribeButton = styled9.button`
13014
13014
  `;
13015
13015
  var BalanceCards = styled9.div`
13016
13016
  display: flex;
13017
- gap: 1rem;
13018
- margin-top: 1rem;
13017
+ gap: 0.75rem;
13018
+ margin-top: 0.75rem;
13019
13019
  flex-wrap: wrap;
13020
13020
  `;
13021
13021
  var BalanceCard = styled9.div`
13022
13022
  flex: 1;
13023
13023
  background: rgba(255,255,255,0.03);
13024
- border-radius: 12px;
13025
- padding: 1rem;
13024
+ border-radius: 10px;
13025
+ padding: 0.75rem;
13026
13026
  text-align: center;
13027
13027
  position: relative;
13028
13028
  `;
13029
13029
  var BalanceLabel = styled9.div`
13030
- font-size: 0.75rem;
13030
+ font-size: 0.7rem;
13031
13031
  color: var(--color-text-secondary);
13032
13032
  text-transform: uppercase;
13033
13033
  letter-spacing: 0.5px;
13034
- margin-bottom: 0.5rem;
13034
+ margin-bottom: 0.35rem;
13035
13035
  `;
13036
13036
  var BalanceValue = styled9.div`
13037
- font-size: 1.5rem;
13037
+ font-size: 1.25rem;
13038
13038
  font-weight: 700;
13039
13039
  color: #fff;
13040
13040
  span {
@@ -13638,7 +13638,6 @@ function PortfolioActivityPanel({
13638
13638
  }) {
13639
13639
  const resolvedDefaultTab = defaultTab ?? (showPositionsTab ? "positions" : showSubscriptionsTab ? "subscriptions" : "orders");
13640
13640
  const [activeTab, setActiveTab] = useState(resolvedDefaultTab);
13641
- const [activityPage, setActivityPage] = useState(0);
13642
13641
  const [pendingCancelOrderId, setPendingCancelOrderId] = useState(null);
13643
13642
  const [cancelAllConfirmOpen, setCancelAllConfirmOpen] = useState(false);
13644
13643
  const [cancellingAll, setCancellingAll] = useState(false);
@@ -13741,7 +13740,7 @@ function PortfolioActivityPanel({
13741
13740
  }));
13742
13741
  return [...orderHistory, ...mapped].sort((a, b) => b.createdAt - a.createdAt);
13743
13742
  }, [showSubscriptionsTab, offeringOrders, orderHistory]);
13744
- const activeTabTotal = useMemo(() => {
13743
+ useMemo(() => {
13745
13744
  switch (activeTab) {
13746
13745
  case "positions":
13747
13746
  return positions.length;
@@ -13775,11 +13774,8 @@ function PortfolioActivityPanel({
13775
13774
  }).length,
13776
13775
  [offeringOrders]
13777
13776
  );
13778
- const activityTotalPages = Math.ceil(activeTabTotal / pageSize);
13779
- const pageSlice = (arr) => arr.slice(activityPage * pageSize, (activityPage + 1) * pageSize);
13780
13777
  const handleTabChange = (tab) => {
13781
13778
  setActiveTab(tab);
13782
- setActivityPage(0);
13783
13779
  };
13784
13780
  return /* @__PURE__ */ jsxs(Container3, { className, style, children: [
13785
13781
  /* @__PURE__ */ jsx(PanelTitle, { children: "Activity" }),
@@ -13841,7 +13837,7 @@ function PortfolioActivityPanel({
13841
13837
  onClosePosition && /* @__PURE__ */ jsx(CToolbarLink, { onClick: () => setCloseAllOpen(true), children: "Sell All" })
13842
13838
  ] })
13843
13839
  ] }),
13844
- pageSlice(sortedPositions).map((pos) => {
13840
+ sortedPositions.map((pos) => {
13845
13841
  const currentValue = pos.quantity * pos.marketPrice;
13846
13842
  const costBasis = pos.quantity * pos.averageEntryPrice;
13847
13843
  const pnl = pos.propertyPnl ?? currentValue - costBasis;
@@ -13935,7 +13931,7 @@ function PortfolioActivityPanel({
13935
13931
  ] }),
13936
13932
  onClosePosition && /* @__PURE__ */ jsx(PositionsHeaderCell, { children: /* @__PURE__ */ jsx(CloseAllHeaderBtn, { onClick: () => setCloseAllOpen(true), children: "Sell All" }) })
13937
13933
  ] }),
13938
- pageSlice(sortedPositions).map((pos) => {
13934
+ sortedPositions.map((pos) => {
13939
13935
  const currentValue = pos.quantity * pos.marketPrice;
13940
13936
  const costBasis = pos.quantity * pos.averageEntryPrice;
13941
13937
  const pnl = pos.propertyPnl ?? currentValue - costBasis;
@@ -14012,7 +14008,7 @@ function PortfolioActivityPanel({
14012
14008
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
14013
14009
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
14014
14010
  ] }),
14015
- pageSlice(offeringOrders).map((order) => {
14011
+ offeringOrders.map((order) => {
14016
14012
  const meta = getOrderStatusMeta(order.status);
14017
14013
  return /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
14018
14014
  /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: order.tokenName }) }),
@@ -14039,7 +14035,7 @@ function PortfolioActivityPanel({
14039
14035
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
14040
14036
  onCancelOrder && /* @__PURE__ */ jsx(GridHeaderCell, {})
14041
14037
  ] }),
14042
- pageSlice(openOrders).map((order) => {
14038
+ openOrders.map((order) => {
14043
14039
  const meta = getOrderStatusMeta(order.status);
14044
14040
  const isMarket = order.type === "MARKET";
14045
14041
  const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
@@ -14084,7 +14080,7 @@ function PortfolioActivityPanel({
14084
14080
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
14085
14081
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
14086
14082
  ] }),
14087
- pageSlice(mergedOrderHistory).map((order) => {
14083
+ mergedOrderHistory.map((order) => {
14088
14084
  const meta = getOrderStatusMeta(order.status);
14089
14085
  const isMarket = order.type === "MARKET";
14090
14086
  const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
@@ -14117,7 +14113,7 @@ function PortfolioActivityPanel({
14117
14113
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Fee" }),
14118
14114
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
14119
14115
  ] }),
14120
- pageSlice(tradeHistory).map((trade) => /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.6fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
14116
+ tradeHistory.map((trade) => /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.6fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
14121
14117
  /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: trade.tokenName }) }),
14122
14118
  /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: sideLabel(trade.side), children: sideLabel(trade.side) }) }),
14123
14119
  /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatNumber2(trade.quantity) }) }),
@@ -14138,7 +14134,7 @@ function PortfolioActivityPanel({
14138
14134
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
14139
14135
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
14140
14136
  ] }),
14141
- pageSlice(transfers).map((t, idx) => {
14137
+ transfers.map((t, idx) => {
14142
14138
  const isDeposit = t.type === "DEPOSIT";
14143
14139
  const statusMeta = getOrderStatusMeta(t.status);
14144
14140
  return /* @__PURE__ */ jsxs(GridRow, { $columns: "0.8fr 1fr 1.5fr 0.8fr 1fr", children: [
@@ -14153,31 +14149,6 @@ function PortfolioActivityPanel({
14153
14149
  ] }, t.blockchainTxHash ?? `transfer-${idx}`);
14154
14150
  })
14155
14151
  ] })
14156
- ] }),
14157
- activityTotalPages > 1 && /* @__PURE__ */ jsxs(PaginationRow, { children: [
14158
- /* @__PURE__ */ jsx(
14159
- PaginationButton,
14160
- {
14161
- type: "button",
14162
- onClick: () => setActivityPage((p) => p - 1),
14163
- disabled: activityPage === 0,
14164
- children: "\u2190 Prev"
14165
- }
14166
- ),
14167
- /* @__PURE__ */ jsxs(PaginationLabel, { children: [
14168
- activityPage + 1,
14169
- " / ",
14170
- activityTotalPages
14171
- ] }),
14172
- /* @__PURE__ */ jsx(
14173
- PaginationButton,
14174
- {
14175
- type: "button",
14176
- onClick: () => setActivityPage((p) => p + 1),
14177
- disabled: activityPage >= activityTotalPages - 1,
14178
- children: "Next \u2192"
14179
- }
14180
- )
14181
14152
  ] })
14182
14153
  ] }),
14183
14154
  cancelAllConfirmOpen && /* @__PURE__ */ jsx(CancelConfirmOverlay, { onClick: () => setCancelAllConfirmOpen(false), children: /* @__PURE__ */ jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
@@ -14392,33 +14363,6 @@ var EmptyState = styled9.div`
14392
14363
  font-size: 0.8rem;
14393
14364
  color: rgba(255, 255, 255, 0.45);
14394
14365
  `;
14395
- var PaginationRow = styled9.div`
14396
- display: flex;
14397
- align-items: center;
14398
- justify-content: center;
14399
- gap: 0.75rem;
14400
- margin-top: 1rem;
14401
- padding-top: 1rem;
14402
- border-top: 1px solid rgba(255, 255, 255, 0.06);
14403
- `;
14404
- var PaginationButton = styled9.button`
14405
- background: transparent;
14406
- border: 1px solid rgba(255, 255, 255, 0.12);
14407
- border-radius: 8px;
14408
- padding: 0.35rem 0.75rem;
14409
- font-size: 0.8rem;
14410
- cursor: pointer;
14411
- color: rgba(255, 255, 255, 0.7);
14412
-
14413
- &:disabled {
14414
- color: rgba(255, 255, 255, 0.2);
14415
- cursor: default;
14416
- }
14417
- `;
14418
- var PaginationLabel = styled9.span`
14419
- font-size: 0.8rem;
14420
- color: rgba(255, 255, 255, 0.4);
14421
- `;
14422
14366
  var PositionsHeader = styled9.div`
14423
14367
  display: grid;
14424
14368
  grid-template-columns: ${(p) => p.$hasClose ? "repeat(6, 1fr) minmax(130px, auto)" : "repeat(6, 1fr)"};