@loafmarkets/ui 0.0.6 → 0.0.7

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
@@ -4,7 +4,7 @@ import { cva } from 'class-variance-authority';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
- import { CalendarDays, ArrowUpRight, Newspaper, BedDouble, Bath, CarFront, Building2, Sparkles, LineChart } from 'lucide-react';
7
+ import { Newspaper, BedDouble, Bath, CarFront } from 'lucide-react';
8
8
  import { createChart } from 'lightweight-charts';
9
9
 
10
10
  // src/components/button.tsx
@@ -146,8 +146,8 @@ var PortfolioSummary = React5.forwardRef(
146
146
  onResetAccount,
147
147
  positionsHeading = "Current Positions",
148
148
  emptyPositionsText = "No positions yet. Start trading to build your portfolio!",
149
- formatCurrency = defaultFormatCurrency,
150
- formatPercent = defaultFormatPercent,
149
+ formatCurrency: formatCurrency2 = defaultFormatCurrency,
150
+ formatPercent: formatPercent2 = defaultFormatPercent,
151
151
  formatSignedCurrency = defaultFormatSignedCurrency,
152
152
  className,
153
153
  children,
@@ -184,15 +184,15 @@ var PortfolioSummary = React5.forwardRef(
184
184
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
185
185
  /* @__PURE__ */ jsxs("div", { children: [
186
186
  /* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.5px] text-white/50", children: "Available Cash" }),
187
- /* @__PURE__ */ jsx("p", { className: "mt-1 text-[1.25rem] font-semibold text-white", children: formatCurrency(availableCash) })
187
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-[1.25rem] font-semibold text-white", children: formatCurrency2(availableCash) })
188
188
  ] }),
189
189
  /* @__PURE__ */ jsxs("div", { children: [
190
190
  /* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.5px] text-white/50", children: "Portfolio Value" }),
191
- /* @__PURE__ */ jsx("p", { className: "mt-1 text-[1.25rem] font-semibold text-white", children: formatCurrency(portfolioValue) })
191
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-[1.25rem] font-semibold text-white", children: formatCurrency2(portfolioValue) })
192
192
  ] }),
193
193
  /* @__PURE__ */ jsxs("div", { children: [
194
194
  /* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.5px] text-white/50", children: "Total Return" }),
195
- /* @__PURE__ */ jsx("p", { className: cn("mt-1 text-[1.25rem] font-semibold", totalReturnClassName), children: formatPercent(totalReturnPercent) })
195
+ /* @__PURE__ */ jsx("p", { className: cn("mt-1 text-[1.25rem] font-semibold", totalReturnClassName), children: formatPercent2(totalReturnPercent) })
196
196
  ] }),
197
197
  /* @__PURE__ */ jsxs("div", { children: [
198
198
  /* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.5px] text-white/50", children: "Unrealized P&L" }),
@@ -819,6 +819,9 @@ function DepthRow({
819
819
  ] });
820
820
  }
821
821
  var clamp2 = (value, min, max) => Math.min(max, Math.max(min, value));
822
+ var LEVEL_ROWS_VISIBLE = 6;
823
+ var DEPTH_ROW_HEIGHT_PX = 34;
824
+ var SECTION_HEIGHT = LEVEL_ROWS_VISIBLE * DEPTH_ROW_HEIGHT_PX;
822
825
  var Orderbook = React5.forwardRef(
823
826
  ({
824
827
  asks,
@@ -959,18 +962,25 @@ var Orderbook = React5.forwardRef(
959
962
  ] }, `${trade.type}-${trade.price}-${trade.amount}-${trade.time ?? i}`)) })
960
963
  }
961
964
  ) : /* @__PURE__ */ jsxs(Fragment, { children: [
962
- /* @__PURE__ */ jsx("div", { className: "divide-y divide-white/5", children: asks.map((l, idx) => /* @__PURE__ */ jsx(
963
- DepthRow,
965
+ /* @__PURE__ */ jsx(
966
+ "div",
964
967
  {
965
- side: "ask",
966
- price: l.price,
967
- amount: l.amount,
968
- depthPct: (l.depth ?? l.amount) / maxAskDepth * 100,
969
- precision,
970
- amountPrecision
971
- },
972
- `ask-${idx}-${l.price}-${l.amount}`
973
- )) }),
968
+ className: "divide-y divide-white/5 overflow-y-auto",
969
+ style: { height: `${SECTION_HEIGHT}px`, scrollbarGutter: "stable" },
970
+ children: asks.map((l, idx) => /* @__PURE__ */ jsx(
971
+ DepthRow,
972
+ {
973
+ side: "ask",
974
+ price: l.price,
975
+ amount: l.amount,
976
+ depthPct: (l.depth ?? l.amount) / maxAskDepth * 100,
977
+ precision,
978
+ amountPrecision
979
+ },
980
+ `ask-${idx}-${l.price}-${l.amount}`
981
+ ))
982
+ }
983
+ ),
974
984
  /* @__PURE__ */ jsxs("div", { className: "mt-2 grid grid-cols-2 items-center gap-3 bg-[#0b1a24] px-3 py-2", children: [
975
985
  /* @__PURE__ */ jsxs("div", { className: cn("text-lg font-semibold tabular-nums", midClass), children: [
976
986
  "$",
@@ -983,18 +993,25 @@ var Orderbook = React5.forwardRef(
983
993
  ] }),
984
994
  /* @__PURE__ */ jsx("div", {})
985
995
  ] }),
986
- /* @__PURE__ */ jsx("div", { className: "divide-y divide-white/5", children: bids.map((l, idx) => /* @__PURE__ */ jsx(
987
- DepthRow,
996
+ /* @__PURE__ */ jsx(
997
+ "div",
988
998
  {
989
- side: "bid",
990
- price: l.price,
991
- amount: l.amount,
992
- depthPct: (l.depth ?? l.amount) / maxBidDepth * 100,
993
- precision,
994
- amountPrecision
995
- },
996
- `bid-${idx}-${l.price}-${l.amount}`
997
- )) })
999
+ className: "divide-y divide-white/5 overflow-y-auto",
1000
+ style: { height: `${SECTION_HEIGHT}px`, scrollbarGutter: "stable" },
1001
+ children: bids.map((l, idx) => /* @__PURE__ */ jsx(
1002
+ DepthRow,
1003
+ {
1004
+ side: "bid",
1005
+ price: l.price,
1006
+ amount: l.amount,
1007
+ depthPct: (l.depth ?? l.amount) / maxBidDepth * 100,
1008
+ precision,
1009
+ amountPrecision
1010
+ },
1011
+ `bid-${idx}-${l.price}-${l.amount}`
1012
+ ))
1013
+ }
1014
+ )
998
1015
  ] })
999
1016
  ] })
1000
1017
  ]
@@ -1096,132 +1113,208 @@ var PropertyTour = React5.forwardRef(
1096
1113
  }
1097
1114
  );
1098
1115
  PropertyTour.displayName = "PropertyTour";
1099
- var TYPE_META = {
1116
+ var ITEMS_PER_PAGE = 4;
1117
+ var ROW_HEIGHT_PX = 86;
1118
+ var ensureAnimationsInjected = () => {
1119
+ if (typeof document === "undefined") return;
1120
+ if (document.getElementById("property-news-updates-animations")) return;
1121
+ const style = document.createElement("style");
1122
+ style.id = "property-news-updates-animations";
1123
+ style.textContent = `
1124
+ @keyframes propertyNewsPulse {
1125
+ 0% { opacity: 0.6; transform: scale(0.9); }
1126
+ 50% { opacity: 1; transform: scale(1); }
1127
+ 100% { opacity: 0.6; transform: scale(0.9); }
1128
+ }
1129
+
1130
+ @keyframes propertyNewsSlideIn {
1131
+ from { transform: translateY(-6px); opacity: 0; }
1132
+ to { transform: translateY(0); opacity: 1; }
1133
+ }
1134
+ `;
1135
+ document.head.appendChild(style);
1136
+ };
1137
+ var categoryStyles = {
1100
1138
  property: {
1101
1139
  label: "Property Update",
1102
- accent: "#f8d12f",
1103
- pillBg: "rgba(248, 209, 47, 0.12)",
1104
- pillBorder: "rgba(248, 209, 47, 0.45)",
1105
- pillColor: "#f8d12f",
1106
- icon: Building2
1140
+ backgroundColor: "rgba(14, 203, 129, 0.15)",
1141
+ borderColor: "rgba(14, 203, 129, 0.45)",
1142
+ color: "#0ecb81"
1107
1143
  },
1108
1144
  market: {
1109
- label: "Market Insight",
1110
- accent: "#0ecb81",
1111
- pillBg: "rgba(14, 203, 129, 0.12)",
1112
- pillBorder: "rgba(14, 203, 129, 0.45)",
1113
- pillColor: "#0ecb81",
1114
- icon: LineChart
1115
- },
1116
- portfolio: {
1117
- label: "Portfolio Signal",
1118
- accent: "#6c8cff",
1119
- pillBg: "rgba(108, 140, 255, 0.12)",
1120
- pillBorder: "rgba(108, 140, 255, 0.45)",
1121
- pillColor: "#c9d5ff",
1122
- icon: Sparkles
1145
+ label: "Market News",
1146
+ backgroundColor: "rgba(248, 209, 47, 0.15)",
1147
+ borderColor: "rgba(248, 209, 47, 0.45)",
1148
+ color: "#f8d12f"
1123
1149
  }
1124
1150
  };
1125
- var getTypeMeta = (type) => {
1126
- if (!type) return TYPE_META.property;
1127
- const key = type;
1128
- if (key in TYPE_META) return TYPE_META[key];
1129
- return {
1130
- label: type.toString(),
1131
- accent: "#f5f5f5",
1132
- pillBg: "rgba(255,255,255,0.08)",
1133
- pillBorder: "rgba(255,255,255,0.25)",
1134
- pillColor: "#ffffff",
1135
- icon: Newspaper
1136
- };
1137
- };
1138
1151
  var formatDate = (value) => {
1139
- const date = typeof value === "string" ? new Date(value) : value;
1140
- if (Number.isNaN(date.getTime())) return typeof value === "string" ? value : "";
1141
- return date.toLocaleDateString(void 0, {
1152
+ if (typeof value === "string") return value;
1153
+ if (!(value instanceof Date) || Number.isNaN(value.getTime())) return "";
1154
+ return value.toLocaleDateString(void 0, {
1142
1155
  month: "short",
1143
1156
  day: "numeric",
1144
1157
  year: "numeric"
1145
1158
  });
1146
1159
  };
1147
1160
  var PropertyNewsUpdates = React5.forwardRef(
1148
- ({ className, heading = "Latest property intelligence", subheading, items, emptyState, ...props }, ref) => {
1161
+ ({
1162
+ className,
1163
+ heading = "Property News & Headlines",
1164
+ subheading,
1165
+ items,
1166
+ emptyState,
1167
+ highlightFirst = true,
1168
+ ...props
1169
+ }, ref) => {
1170
+ const [page, setPage] = React5.useState(0);
1171
+ React5.useEffect(() => {
1172
+ ensureAnimationsInjected();
1173
+ }, []);
1149
1174
  const hasItems = Array.isArray(items) && items.length > 0;
1175
+ const totalPages = React5.useMemo(() => hasItems ? Math.max(1, Math.ceil(items.length / ITEMS_PER_PAGE)) : 1, [hasItems, items.length]);
1176
+ React5.useEffect(() => {
1177
+ setPage((prev) => Math.min(prev, totalPages - 1));
1178
+ }, [totalPages]);
1179
+ const paginatedItems = hasItems ? items.slice(page * ITEMS_PER_PAGE, page * ITEMS_PER_PAGE + ITEMS_PER_PAGE) : [];
1150
1180
  return /* @__PURE__ */ jsxs(
1151
1181
  "div",
1152
1182
  {
1153
1183
  ref,
1154
1184
  className: cn(
1155
- "w-full max-w-[480px] rounded-[20px] border border-white/10 bg-gradient-to-br from-[#06090f] via-[#0f1621] to-[#111b2a] p-6 text-white shadow-[0_30px_80px_rgba(3,7,18,0.65)] backdrop-blur-xl",
1185
+ "w-full max-w-[840px] rounded-2xl border border-white/10 bg-[#0b0e10] p-5 text-white shadow-[0_20px_40px_rgba(0,0,0,0.35)]",
1156
1186
  className
1157
1187
  ),
1158
1188
  ...props,
1159
1189
  children: [
1160
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
1161
- /* @__PURE__ */ jsx("p", { className: "text-[0.85rem] uppercase tracking-[0.25em] text-white/50", children: heading }),
1162
- subheading ? /* @__PURE__ */ jsx("p", { className: "text-sm text-white/60", children: subheading }) : null
1163
- ] }),
1164
- /* @__PURE__ */ jsx("div", { className: "mt-5 flex flex-col gap-4", children: hasItems ? items.map((item, index) => {
1165
- const meta = getTypeMeta(item.type);
1166
- const Icon = meta.icon;
1167
- const key = item.id ?? `${item.title}-${index}`;
1168
- const content = /* @__PURE__ */ jsxs(
1190
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
1191
+ /* @__PURE__ */ jsxs("div", { children: [
1192
+ /* @__PURE__ */ jsx("p", { className: "text-lg font-semibold text-white", children: heading }),
1193
+ subheading ? /* @__PURE__ */ jsx("p", { className: "text-sm text-white/60", children: subheading }) : null
1194
+ ] }),
1195
+ /* @__PURE__ */ jsxs(
1169
1196
  "div",
1170
1197
  {
1171
- className: "relative flex w-full gap-4 rounded-2xl border border-white/5 bg-white/[0.04] p-4 transition hover:border-white/15 hover:bg-white/[0.06]",
1198
+ className: "inline-flex items-center font-semibold uppercase text-emerald-300",
1199
+ style: { gap: "0.35rem", fontSize: "0.8rem", letterSpacing: "0.15em" },
1172
1200
  children: [
1173
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
1174
- /* @__PURE__ */ jsx(
1175
- "div",
1176
- {
1177
- className: "flex h-12 w-12 items-center justify-center rounded-full border text-white",
1178
- style: {
1179
- background: meta.pillBg,
1180
- borderColor: meta.pillBorder,
1181
- color: meta.pillColor
1182
- },
1183
- children: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" })
1184
- }
1185
- ),
1186
- index !== items.length - 1 ? /* @__PURE__ */ jsx("div", { className: "mt-2 h-full w-px flex-1 bg-white/10" }) : null
1187
- ] }),
1188
- /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col", children: [
1189
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
1190
- /* @__PURE__ */ jsx("span", { className: "text-[0.7rem] font-semibold uppercase tracking-[0.3em]", style: { color: meta.accent }, children: meta.label }),
1191
- /* @__PURE__ */ jsxs("span", { className: "flex items-center text-xs text-white/60", children: [
1192
- /* @__PURE__ */ jsx(CalendarDays, { className: "mr-1 h-3.5 w-3.5" }),
1193
- formatDate(item.date)
1194
- ] })
1195
- ] }),
1196
- /* @__PURE__ */ jsx("p", { className: "mt-2 text-base font-semibold leading-snug", children: item.title }),
1197
- item.description ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-white/65", children: item.description }) : null,
1198
- (item.href || item.onAction) && item.actionLabel ? /* @__PURE__ */ jsxs(
1199
- "button",
1200
- {
1201
- type: "button",
1202
- className: "group mt-3 inline-flex items-center gap-1 text-sm font-semibold text-white transition hover:text-white/80",
1203
- onClick: () => {
1204
- if (item.href) {
1205
- window?.open?.(item.href, "_blank", "noopener,noreferrer");
1206
- }
1207
- item.onAction?.(item);
1208
- },
1209
- children: [
1210
- item.actionLabel,
1211
- /* @__PURE__ */ jsx(ArrowUpRight, { className: "h-4 w-4 transition group-hover:translate-x-0.5 group-hover:-translate-y-0.5" })
1212
- ]
1201
+ /* @__PURE__ */ jsx(
1202
+ "span",
1203
+ {
1204
+ style: {
1205
+ display: "inline-block",
1206
+ width: "6px",
1207
+ height: "6px",
1208
+ borderRadius: "50%",
1209
+ backgroundColor: "#34d399",
1210
+ animation: "propertyNewsPulse 2s infinite"
1213
1211
  }
1214
- ) : null
1215
- ] })
1212
+ }
1213
+ ),
1214
+ "LIVE"
1216
1215
  ]
1217
- },
1218
- key
1219
- );
1220
- return content;
1221
- }) : emptyState ?? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center rounded-2xl border border-dashed border-white/20 px-6 py-10 text-center text-sm text-white/60", children: [
1222
- /* @__PURE__ */ jsx(Newspaper, { className: "mb-3 h-8 w-8 text-white/40" }),
1223
- "No property news yet. Updates will land here as soon as we receive new intelligence."
1224
- ] }) })
1216
+ }
1217
+ )
1218
+ ] }),
1219
+ /* @__PURE__ */ jsx(
1220
+ "div",
1221
+ {
1222
+ className: "mt-4 flex flex-col gap-3",
1223
+ style: { minHeight: `${ITEMS_PER_PAGE * ROW_HEIGHT_PX}px` },
1224
+ children: hasItems ? paginatedItems.map((item, index) => {
1225
+ const absoluteIndex = page * ITEMS_PER_PAGE + index;
1226
+ const key = item.displayId ?? item.id ?? `${item.title}-${absoluteIndex}`;
1227
+ const styles = categoryStyles[item.type] ?? categoryStyles.market;
1228
+ const dateLabel = item.isNew ?? (highlightFirst && absoluteIndex === 0) ? "Just now" : typeof item.date === "string" && item.date.trim().length > 0 ? item.date : formatDate(item.date);
1229
+ const isHighlighted = item.isNew ?? (highlightFirst && absoluteIndex === 0);
1230
+ return /* @__PURE__ */ jsxs(
1231
+ "div",
1232
+ {
1233
+ style: {
1234
+ padding: "0.75rem",
1235
+ borderRadius: "6px",
1236
+ backgroundColor: isHighlighted ? "rgba(14, 203, 129, 0.1)" : "transparent",
1237
+ border: "1px solid transparent",
1238
+ transition: "background-color 0.2s",
1239
+ animation: item.isNew ? "propertyNewsSlideIn 0.5s ease-out" : void 0
1240
+ },
1241
+ children: [
1242
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "0.9375rem", fontWeight: 500, marginBottom: "0.35rem" }, children: item.title }),
1243
+ /* @__PURE__ */ jsxs(
1244
+ "div",
1245
+ {
1246
+ style: {
1247
+ display: "flex",
1248
+ justifyContent: "space-between",
1249
+ alignItems: "center",
1250
+ fontSize: "0.75rem",
1251
+ color: "#b5b8c5"
1252
+ },
1253
+ children: [
1254
+ /* @__PURE__ */ jsx("span", { style: { color: isHighlighted ? "#0ecb81" : "inherit" }, children: dateLabel }),
1255
+ /* @__PURE__ */ jsx(
1256
+ "span",
1257
+ {
1258
+ style: {
1259
+ padding: "0.25rem 0.6rem",
1260
+ borderRadius: "4px",
1261
+ border: `1px solid ${styles.borderColor}`,
1262
+ backgroundColor: styles.backgroundColor,
1263
+ color: styles.color,
1264
+ fontSize: "0.68rem",
1265
+ fontWeight: 600,
1266
+ textTransform: "uppercase"
1267
+ },
1268
+ children: item.type === "property" ? styles.label : "Market News"
1269
+ }
1270
+ )
1271
+ ]
1272
+ }
1273
+ )
1274
+ ]
1275
+ },
1276
+ key
1277
+ );
1278
+ }) : emptyState ?? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center rounded-2xl border border-dashed border-white/20 px-6 py-10 text-center text-sm text-white/60", children: [
1279
+ /* @__PURE__ */ jsx(Newspaper, { className: "mb-3 h-8 w-8 text-white/40" }),
1280
+ "No property news yet. Updates will land here as soon as we receive new intelligence."
1281
+ ] })
1282
+ }
1283
+ ),
1284
+ hasItems && totalPages > 1 ? /* @__PURE__ */ jsxs("div", { className: "mt-4 flex items-center justify-between text-xs text-white/60", children: [
1285
+ /* @__PURE__ */ jsx(
1286
+ "button",
1287
+ {
1288
+ type: "button",
1289
+ onClick: () => setPage((prev) => Math.max(0, prev - 1)),
1290
+ disabled: page === 0,
1291
+ className: cn(
1292
+ "rounded-full border border-white/15 px-3 py-1 uppercase tracking-[0.2em]",
1293
+ page === 0 ? "opacity-40 cursor-not-allowed" : "hover:border-white/40"
1294
+ ),
1295
+ children: "Prev"
1296
+ }
1297
+ ),
1298
+ /* @__PURE__ */ jsxs("span", { className: "font-medium text-white/70", children: [
1299
+ "Page ",
1300
+ page + 1,
1301
+ " / ",
1302
+ totalPages
1303
+ ] }),
1304
+ /* @__PURE__ */ jsx(
1305
+ "button",
1306
+ {
1307
+ type: "button",
1308
+ onClick: () => setPage((prev) => Math.min(totalPages - 1, prev + 1)),
1309
+ disabled: page >= totalPages - 1,
1310
+ className: cn(
1311
+ "rounded-full border border-white/15 px-3 py-1 uppercase tracking-[0.2em]",
1312
+ page >= totalPages - 1 ? "opacity-40 cursor-not-allowed" : "hover:border-white/40"
1313
+ ),
1314
+ children: "Next"
1315
+ }
1316
+ )
1317
+ ] }) : null
1225
1318
  ]
1226
1319
  }
1227
1320
  );
@@ -1366,152 +1459,263 @@ var PropertyCompareBar = React5.forwardRef(
1366
1459
  }
1367
1460
  );
1368
1461
  PropertyCompareBar.displayName = "PropertyCompareBar";
1369
- var clampPct = (pct) => Math.min(100, Math.max(0, pct));
1370
- var EditIcon = ({ className }) => /* @__PURE__ */ jsxs(
1371
- "svg",
1372
- {
1373
- viewBox: "0 0 24 24",
1374
- fill: "none",
1375
- xmlns: "http://www.w3.org/2000/svg",
1376
- className,
1377
- children: [
1378
- /* @__PURE__ */ jsx(
1379
- "path",
1380
- {
1381
- d: "M12 20H21",
1382
- stroke: "currentColor",
1383
- strokeWidth: "2",
1384
- strokeLinecap: "round",
1385
- strokeLinejoin: "round"
1386
- }
1387
- ),
1388
- /* @__PURE__ */ jsx(
1389
- "path",
1390
- {
1391
- d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5Z",
1392
- stroke: "currentColor",
1393
- strokeWidth: "2",
1394
- strokeLinecap: "round",
1395
- strokeLinejoin: "round"
1396
- }
1397
- )
1398
- ]
1399
- }
1400
- );
1462
+ var TABS = [
1463
+ { id: "portfolio", label: "Portfolio" },
1464
+ { id: "openOrders", label: "Open Orders" },
1465
+ { id: "tradeHistory", label: "Trade History" },
1466
+ { id: "orderHistory", label: "Order History" }
1467
+ ];
1468
+ var panelStyle = {
1469
+ width: "100%",
1470
+ borderRadius: "16px",
1471
+ backgroundColor: "#111111",
1472
+ border: "1px solid rgba(255,255,255,0.08)",
1473
+ color: "#ffffff",
1474
+ display: "flex",
1475
+ flexDirection: "column"
1476
+ };
1477
+ var headerStyle = {
1478
+ padding: "1.25rem 1.5rem 0.5rem"
1479
+ };
1480
+ var titleStyle = {
1481
+ margin: 0,
1482
+ fontSize: "1.1rem",
1483
+ fontWeight: 600
1484
+ };
1485
+ var tabsRowStyle = {
1486
+ display: "flex",
1487
+ gap: "0.5rem",
1488
+ padding: "0 1.5rem",
1489
+ borderBottom: "1px solid rgba(255,255,255,0.08)"
1490
+ };
1491
+ var tabButtonBase = {
1492
+ background: "none",
1493
+ border: "none",
1494
+ color: "rgba(255,255,255,0.5)",
1495
+ fontSize: "0.9rem",
1496
+ fontWeight: 400,
1497
+ padding: "0.75rem 1rem",
1498
+ cursor: "pointer",
1499
+ position: "relative",
1500
+ transition: "color 0.2s ease"
1501
+ };
1502
+ var tabContentWrapper = {
1503
+ padding: "1.25rem 1.5rem 1.5rem",
1504
+ display: "flex",
1505
+ flexDirection: "column",
1506
+ gap: "0.75rem",
1507
+ flex: 1
1508
+ };
1509
+ var tableHeaderStyle = {
1510
+ display: "grid",
1511
+ gridTemplateColumns: "1.8fr 0.9fr 0.7fr 0.8fr 0.8fr 1fr",
1512
+ gap: "0.5rem",
1513
+ paddingBottom: "0.75rem",
1514
+ borderBottom: "1px solid rgba(255,255,255,0.1)",
1515
+ minWidth: "700px"
1516
+ };
1517
+ var tableHeaderCell = {
1518
+ fontSize: "0.7rem",
1519
+ fontWeight: 700,
1520
+ color: "#ffffff",
1521
+ textTransform: "uppercase",
1522
+ letterSpacing: "0.3px"
1523
+ };
1524
+ var emptyStateStyle = {
1525
+ flex: 1,
1526
+ display: "flex",
1527
+ alignItems: "center",
1528
+ justifyContent: "center",
1529
+ textAlign: "center",
1530
+ color: "rgba(255,255,255,0.6)",
1531
+ fontSize: "0.95rem",
1532
+ border: "1px dashed rgba(255,255,255,0.12)",
1533
+ borderRadius: "8px",
1534
+ minHeight: "220px"
1535
+ };
1536
+ var rowStyle = {
1537
+ display: "grid",
1538
+ gridTemplateColumns: "1.8fr 0.9fr 0.7fr 0.8fr 0.8fr 1fr",
1539
+ gap: "0.5rem",
1540
+ alignItems: "center",
1541
+ minWidth: "700px",
1542
+ padding: "0.75rem 0",
1543
+ borderBottom: "1px solid rgba(255,255,255,0.08)"
1544
+ };
1545
+ var formatCurrency = (value) => {
1546
+ if (value == null || Number.isNaN(value)) return "\u2014";
1547
+ return `$${value.toLocaleString(void 0, {
1548
+ minimumFractionDigits: 2,
1549
+ maximumFractionDigits: 2
1550
+ })}`;
1551
+ };
1552
+ var formatPercent = (value, fractionDigits = 2) => {
1553
+ if (value == null || Number.isNaN(value)) return "\u2014";
1554
+ return `${value.toFixed(fractionDigits)}%`;
1555
+ };
1401
1556
  var YourOrders = React5.forwardRef(
1402
- ({
1403
- className,
1404
- title = "Your Orders",
1405
- orders,
1406
- onEditPrice,
1407
- onEditAmount,
1408
- onCancel,
1409
- ...props
1410
- }, ref) => {
1411
- return /* @__PURE__ */ jsxs(
1412
- Card,
1413
- {
1414
- ref,
1415
- className: cn(
1416
- "w-full min-h-[301.52px] rounded-[12px] border border-white/10 bg-black/30 text-white backdrop-blur-md max-[1024px]:min-h-[250px] max-[480px]:min-h-[200px]",
1417
- className
1418
- ),
1419
- ...props,
1420
- children: [
1421
- /* @__PURE__ */ jsx(CardHeader, { className: "px-6 pb-2 pt-6", children: /* @__PURE__ */ jsx(CardTitle, { className: "m-0 text-[1.1rem] font-semibold text-white", children: title }) }),
1422
- /* @__PURE__ */ jsxs("div", { className: "px-6 pb-6 pt-2", children: [
1423
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[1.2fr_0.8fr_1fr_1fr_1fr_1fr_1.2fr_0.8fr] border-b border-white/10 pb-2 text-[0.85rem] font-medium text-white/60", children: [
1424
- /* @__PURE__ */ jsx("div", { className: "px-2", children: "Asset" }),
1425
- /* @__PURE__ */ jsx("div", { className: "px-2", children: "Type" }),
1426
- /* @__PURE__ */ jsx("div", { className: "px-2", children: "Date" }),
1427
- /* @__PURE__ */ jsx("div", { className: "px-2", children: "Price" }),
1428
- /* @__PURE__ */ jsx("div", { className: "px-2", children: "Amount" }),
1429
- /* @__PURE__ */ jsx("div", { className: "px-2", children: "Total" }),
1430
- /* @__PURE__ */ jsx("div", { className: "px-2", children: "Filled" }),
1431
- /* @__PURE__ */ jsx("div", { className: "px-2 text-center", children: "Actions" })
1432
- ] }),
1433
- orders.length === 0 ? /* @__PURE__ */ jsx("div", { className: "py-10 text-center text-sm text-white/50", children: "No orders" }) : /* @__PURE__ */ jsx("div", { children: orders.map((order) => {
1434
- const sideClass = order.side === "buy" ? "text-[#0ecb81]" : "text-[#f6465d]";
1435
- const filled = clampPct(order.filledPercent ?? 0);
1436
- const isCancelled = order.status?.toUpperCase() === "CANCELLED";
1437
- const canEditPrice = Boolean(onEditPrice);
1438
- const canEditAmount = Boolean(onEditAmount);
1439
- const canCancel = Boolean(onCancel);
1440
- return /* @__PURE__ */ jsxs(
1441
- "div",
1442
- {
1443
- className: "grid grid-cols-[1.5fr_0.8fr_0.8fr_1fr_0.8fr_1fr_1fr_0.8fr] items-center border-b border-white/5 py-2 text-[0.9rem] transition-colors hover:bg-white/[0.03]",
1444
- children: [
1445
- /* @__PURE__ */ jsx("div", { className: "truncate px-2 font-medium", children: order.asset }),
1446
- /* @__PURE__ */ jsx("div", { className: cn("px-2 font-medium uppercase", sideClass), children: order.side }),
1447
- /* @__PURE__ */ jsx("div", { className: "px-2 font-medium", children: order.date }),
1448
- /* @__PURE__ */ jsxs("div", { className: "px-2 font-medium", children: [
1449
- /* @__PURE__ */ jsxs("span", { className: "tabular-nums", children: [
1450
- "$",
1451
- order.price.toLocaleString()
1452
- ] }),
1453
- /* @__PURE__ */ jsx(
1454
- "button",
1455
- {
1456
- type: "button",
1457
- onClick: canEditPrice ? () => onEditPrice?.(order) : void 0,
1458
- className: cn(
1459
- "ml-1 inline-flex items-center justify-center text-white/60 transition-colors",
1460
- canEditPrice ? "cursor-pointer hover:text-[#C9A227] active:translate-y-px" : "cursor-default"
1461
- ),
1462
- "aria-label": "Edit price",
1463
- children: /* @__PURE__ */ jsx(EditIcon, { className: "h-[14px] w-[14px]" })
1464
- }
1465
- )
1466
- ] }),
1467
- /* @__PURE__ */ jsxs("div", { className: "px-2 font-medium", children: [
1468
- /* @__PURE__ */ jsx("span", { className: "tabular-nums", children: order.amount.toLocaleString() }),
1469
- /* @__PURE__ */ jsx(
1470
- "button",
1557
+ ({ className, title = "Portfolio Holdings (Demo)", orders, ...props }, ref) => {
1558
+ const [activeTab, setActiveTab] = React5.useState("portfolio");
1559
+ const hasOrders = Array.isArray(orders) && orders.length > 0;
1560
+ const renderPortfolio = () => {
1561
+ if (!hasOrders) {
1562
+ return /* @__PURE__ */ jsx("div", { style: emptyStateStyle, children: "No holdings yet. Start trading to build your portfolio." });
1563
+ }
1564
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1565
+ /* @__PURE__ */ jsxs("div", { style: tableHeaderStyle, children: [
1566
+ /* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "Property" }),
1567
+ /* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "Value" }),
1568
+ /* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "Holding" }),
1569
+ /* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "% of Property" }),
1570
+ /* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "Avg Price" }),
1571
+ /* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "P&L" })
1572
+ ] }),
1573
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "0.65rem" }, children: orders.map((order) => {
1574
+ const propertyName = order.asset;
1575
+ const holding = order.holdingLabel ?? `${order.amount.toLocaleString(void 0, {
1576
+ minimumFractionDigits: 0,
1577
+ maximumFractionDigits: 2
1578
+ })} ${propertyName}`;
1579
+ const value = order.value ?? order.total;
1580
+ const portfolioShare = order.portfolioSharePercent != null ? `${order.portfolioSharePercent.toFixed(1)}% of portfolio` : void 0;
1581
+ const propertyPercent = order.propertyPercent;
1582
+ const avgPrice = order.avgEntryPrice ?? order.price;
1583
+ const pnlValue = order.pnlValue;
1584
+ const pnlPercent = order.pnlPercent;
1585
+ const pnlPositive = pnlValue != null ? pnlValue >= 0 : (pnlPercent ?? 0) >= 0;
1586
+ const currentPrice = order.currentPrice ?? order.price;
1587
+ const priceChangePercent = order.priceChangePercent ?? order.pnlPercent;
1588
+ const priceChangePositive = order.priceChangePositive ?? (priceChangePercent != null ? priceChangePercent >= 0 : void 0);
1589
+ return /* @__PURE__ */ jsxs("div", { style: rowStyle, children: [
1590
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "1rem", alignItems: "center" }, children: [
1591
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "0.15rem" }, children: [
1592
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "0.9rem", fontWeight: 500 }, children: propertyName }),
1593
+ portfolioShare ? /* @__PURE__ */ jsx("div", { style: { fontSize: "0.72rem", color: "rgba(255,255,255,0.5)" }, children: portfolioShare }) : null
1594
+ ] }),
1595
+ currentPrice != null ? /* @__PURE__ */ jsxs("div", { children: [
1596
+ /* @__PURE__ */ jsxs(
1597
+ "div",
1598
+ {
1599
+ style: {
1600
+ fontSize: "0.9rem",
1601
+ color: "var(--color-text, #ffffff)",
1602
+ display: "flex",
1603
+ alignItems: "center",
1604
+ gap: "0.25rem"
1605
+ },
1606
+ children: [
1607
+ priceChangePositive != null ? /* @__PURE__ */ jsx(
1608
+ "span",
1471
1609
  {
1472
- type: "button",
1473
- onClick: canEditAmount ? () => onEditAmount?.(order) : void 0,
1474
- className: cn(
1475
- "ml-1 inline-flex items-center justify-center text-white/60 transition-colors",
1476
- canEditAmount ? "cursor-pointer hover:text-[#C9A227] active:translate-y-px" : "cursor-default"
1477
- ),
1478
- "aria-label": "Edit amount",
1479
- children: /* @__PURE__ */ jsx(EditIcon, { className: "h-[14px] w-[14px]" })
1610
+ style: {
1611
+ color: priceChangePositive ? "#0ecb81" : "#f6465d",
1612
+ fontSize: "0.7em"
1613
+ },
1614
+ children: priceChangePositive ? "\u25B2" : "\u25BC"
1480
1615
  }
1481
- )
1482
- ] }),
1483
- /* @__PURE__ */ jsxs("div", { className: "px-2 font-medium tabular-nums", children: [
1484
- "$",
1485
- order.total.toLocaleString()
1486
- ] }),
1487
- /* @__PURE__ */ jsxs("div", { className: "px-2", children: [
1488
- /* @__PURE__ */ jsxs("div", { className: "text-[0.875rem] font-medium tabular-nums", children: [
1489
- filled.toFixed(0),
1490
- "%"
1491
- ] }),
1492
- /* @__PURE__ */ jsx("div", { className: "mt-1 h-1 w-4/5 overflow-hidden rounded-sm bg-white/10", children: /* @__PURE__ */ jsx("div", { className: "h-full rounded-sm bg-[#C9A227]", style: { width: `${filled}%` } }) })
1493
- ] }),
1494
- /* @__PURE__ */ jsx("div", { className: "px-2 text-center", children: isCancelled ? /* @__PURE__ */ jsx("span", { className: "inline-flex items-center justify-center rounded border border-white/20 px-3 py-1 text-[0.78rem] uppercase tracking-wide text-[#f6465d]", children: "Cancelled" }) : /* @__PURE__ */ jsx(
1495
- "button",
1496
- {
1497
- type: "button",
1498
- onClick: canCancel ? () => onCancel?.(order) : void 0,
1499
- className: cn(
1500
- "rounded border border-white/40 px-3 py-1 text-[0.8rem] text-white/70 transition-colors",
1501
- canCancel ? "cursor-pointer hover:bg-white/10 active:text-[#f6465d] active:border-[#f6465d] active:translate-y-px" : "cursor-default"
1502
- ),
1503
- children: "Cancel"
1504
- }
1505
- ) })
1506
- ]
1616
+ ) : null,
1617
+ formatCurrency(currentPrice)
1618
+ ]
1619
+ }
1620
+ ),
1621
+ priceChangePercent != null ? /* @__PURE__ */ jsxs(
1622
+ "div",
1623
+ {
1624
+ style: {
1625
+ fontSize: "0.7rem",
1626
+ color: priceChangePositive ? "#0ecb81" : "#f6465d"
1627
+ },
1628
+ children: [
1629
+ "(",
1630
+ priceChangePositive ? "+" : "",
1631
+ priceChangePercent.toFixed(2),
1632
+ "%)"
1633
+ ]
1634
+ }
1635
+ ) : null
1636
+ ] }) : null
1637
+ ] }),
1638
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "0.9rem", fontWeight: 500, color: "#D4AF37" }, children: formatCurrency(value) }),
1639
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "0.9rem", color: "rgba(255,255,255,0.92)" }, children: holding }),
1640
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "0.9rem", color: "rgba(255,255,255,0.8)" }, children: formatPercent(propertyPercent, 3) }),
1641
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "0.9rem", color: "rgba(255,255,255,0.9)" }, children: formatCurrency(avgPrice) }),
1642
+ /* @__PURE__ */ jsxs(
1643
+ "div",
1644
+ {
1645
+ style: {
1646
+ fontSize: "0.9rem",
1647
+ fontWeight: 500,
1648
+ color: pnlPositive ? "#0ecb81" : "#f6465d"
1507
1649
  },
1508
- order.id
1509
- );
1510
- }) })
1511
- ] })
1512
- ]
1513
- }
1514
- );
1650
+ children: [
1651
+ pnlValue != null ? `${pnlPositive ? "+" : "-"}${formatCurrency(Math.abs(pnlValue))}` : formatCurrency(pnlValue),
1652
+ pnlPercent != null ? /* @__PURE__ */ jsxs("span", { style: { marginLeft: "0.35rem", fontSize: "0.75rem", color: "rgba(255,255,255,0.6)" }, children: [
1653
+ "(",
1654
+ pnlPositive ? "+" : "",
1655
+ pnlPercent.toFixed(1),
1656
+ "%)"
1657
+ ] }) : null
1658
+ ]
1659
+ }
1660
+ )
1661
+ ] }, order.id);
1662
+ }) })
1663
+ ] });
1664
+ };
1665
+ const renderOtherTab = (label) => /* @__PURE__ */ jsx("div", { style: emptyStateStyle, children: `No ${label.toLowerCase()} data available.` });
1666
+ let tabContent = null;
1667
+ switch (activeTab) {
1668
+ case "portfolio":
1669
+ tabContent = renderPortfolio();
1670
+ break;
1671
+ case "openOrders":
1672
+ tabContent = renderOtherTab("Open Orders");
1673
+ break;
1674
+ case "tradeHistory":
1675
+ tabContent = renderOtherTab("Trade History");
1676
+ break;
1677
+ case "orderHistory":
1678
+ tabContent = renderOtherTab("Order History");
1679
+ break;
1680
+ default:
1681
+ tabContent = null;
1682
+ }
1683
+ return /* @__PURE__ */ jsxs("div", { ref, style: panelStyle, className, ...props, children: [
1684
+ /* @__PURE__ */ jsx("div", { style: headerStyle, children: /* @__PURE__ */ jsx("h3", { style: titleStyle, children: title }) }),
1685
+ /* @__PURE__ */ jsx("div", { style: tabsRowStyle, children: TABS.map((tab) => {
1686
+ const isActive = activeTab === tab.id;
1687
+ return /* @__PURE__ */ jsxs(
1688
+ "button",
1689
+ {
1690
+ type: "button",
1691
+ onClick: () => setActiveTab(tab.id),
1692
+ style: {
1693
+ ...tabButtonBase,
1694
+ color: isActive ? "#ffffff" : "rgba(255,255,255,0.55)",
1695
+ fontWeight: isActive ? 600 : 400
1696
+ },
1697
+ children: [
1698
+ tab.label,
1699
+ isActive ? /* @__PURE__ */ jsx(
1700
+ "div",
1701
+ {
1702
+ style: {
1703
+ position: "absolute",
1704
+ bottom: "-1px",
1705
+ left: 0,
1706
+ right: 0,
1707
+ height: "2px",
1708
+ background: "#f0b90b"
1709
+ }
1710
+ }
1711
+ ) : null
1712
+ ]
1713
+ },
1714
+ tab.id
1715
+ );
1716
+ }) }),
1717
+ /* @__PURE__ */ jsx("div", { style: tabContentWrapper, children: tabContent })
1718
+ ] });
1515
1719
  }
1516
1720
  );
1517
1721
  YourOrders.displayName = "YourOrders";
@@ -1721,7 +1925,10 @@ var PropertyHeroHeader = React5.forwardRef(
1721
1925
  ...props
1722
1926
  }, ref) => {
1723
1927
  const isPositive = changePercent == null ? void 0 : changePercent >= 0;
1724
- const tradeHoverColor = "var(--color-accent-hover, #f8d12f)";
1928
+ const accentColor = "#e6c87e";
1929
+ const tradeHoverColor = "#f5dd9a";
1930
+ const [isTradeInteracting, setIsTradeInteracting] = React5.useState(false);
1931
+ const [isOfferInteracting, setIsOfferInteracting] = React5.useState(false);
1725
1932
  return /* @__PURE__ */ jsxs(
1726
1933
  "div",
1727
1934
  {
@@ -1807,20 +2014,30 @@ var PropertyHeroHeader = React5.forwardRef(
1807
2014
  propertyTypeLabel == null ? null : /* @__PURE__ */ jsx("div", { children: propertyTypeLabel })
1808
2015
  ] })
1809
2016
  ] }),
1810
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 max-[768px]:w-full max-[768px]:flex-row max-[768px]:justify-between max-[768px]:gap-2 max-[480px]:gap-2", children: [
2017
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3 max-[768px]:w-full max-[768px]:justify-between max-[768px]:gap-2 max-[480px]:gap-2", children: [
1811
2018
  /* @__PURE__ */ jsx(
1812
2019
  "button",
1813
2020
  {
1814
2021
  type: "button",
1815
2022
  onClick: onTrade,
1816
- className: "rounded border border-transparent px-6 py-3 font-semibold transition-all hover:-translate-y-0.5 hover:shadow-[0_4px_8px_rgba(0,0,0,0.2)] active:translate-y-0 active:shadow-[0_2px_4px_rgba(0,0,0,0.1)] max-[768px]:flex-1 max-[768px]:px-5 max-[768px]:py-2.5 max-[768px]:text-[0.95rem] max-[480px]:px-4 max-[480px]:py-2 max-[480px]:text-[0.9rem]",
1817
- style: { backgroundColor: "var(--color-accent, #e6c87e)", color: "black" },
1818
- onMouseEnter: (e) => {
1819
- e.currentTarget.style.backgroundColor = tradeHoverColor;
1820
- },
1821
- onMouseLeave: (e) => {
1822
- e.currentTarget.style.backgroundColor = "var(--color-accent, #e6c87e)";
2023
+ className: "flex items-center justify-center rounded border font-semibold transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_4px_8px_rgba(0,0,0,0.2)] active:translate-y-0 active:shadow-[0_2px_4px_rgba(0,0,0,0.1)] text-[0.95rem] max-[480px]:text-[0.9rem]",
2024
+ style: {
2025
+ backgroundColor: isTradeInteracting ? tradeHoverColor : accentColor,
2026
+ color: "black",
2027
+ width: "88.06px",
2028
+ height: "43px",
2029
+ minWidth: "88.06px",
2030
+ borderColor: isTradeInteracting ? accentColor : "transparent",
2031
+ boxShadow: isTradeInteracting ? `0 0 0 2px rgba(0,0,0,0.4), 0 0 0 4px ${accentColor}` : "none"
1823
2032
  },
2033
+ onMouseEnter: () => setIsTradeInteracting(true),
2034
+ onMouseLeave: () => setIsTradeInteracting(false),
2035
+ onMouseDown: () => setIsTradeInteracting(true),
2036
+ onMouseUp: () => setIsTradeInteracting(false),
2037
+ onFocus: () => setIsTradeInteracting(true),
2038
+ onBlur: () => setIsTradeInteracting(false),
2039
+ onTouchStart: () => setIsTradeInteracting(true),
2040
+ onTouchEnd: () => setIsTradeInteracting(false),
1824
2041
  children: "Trade"
1825
2042
  }
1826
2043
  ),
@@ -1829,18 +2046,24 @@ var PropertyHeroHeader = React5.forwardRef(
1829
2046
  {
1830
2047
  type: "button",
1831
2048
  onClick: onMakeOffer,
1832
- className: "rounded border px-6 py-3 font-semibold transition-all hover:-translate-y-0.5 hover:shadow-[0_4px_8px_rgba(0,0,0,0.2)] active:translate-y-0 active:shadow-[0_2px_4px_rgba(0,0,0,0.1)] max-[768px]:flex-1 max-[768px]:px-5 max-[768px]:py-2.5 max-[768px]:text-[0.95rem] max-[480px]:px-4 max-[480px]:py-2 max-[480px]:text-[0.9rem]",
2049
+ className: "flex items-center justify-center rounded border font-semibold transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_4px_8px_rgba(0,0,0,0.2)] active:translate-y-0 active:shadow-[0_2px_4px_rgba(0,0,0,0.1)] text-[0.95rem] max-[480px]:text-[0.9rem]",
1833
2050
  style: {
1834
- backgroundColor: "transparent",
1835
- borderColor: "var(--color-accent, #e6c87e)",
1836
- color: "var(--color-accent, #e6c87e)"
1837
- },
1838
- onMouseEnter: (e) => {
1839
- e.currentTarget.style.backgroundColor = "rgba(240, 185, 11, 0.1)";
1840
- },
1841
- onMouseLeave: (e) => {
1842
- e.currentTarget.style.backgroundColor = "transparent";
2051
+ backgroundColor: isOfferInteracting ? accentColor : "transparent",
2052
+ borderColor: accentColor,
2053
+ color: isOfferInteracting ? "black" : accentColor,
2054
+ width: "127.14px",
2055
+ height: "43px",
2056
+ minWidth: "127.14px",
2057
+ boxShadow: isOfferInteracting ? `0 0 0 2px rgba(0,0,0,0.4), 0 0 0 4px ${accentColor}` : "none"
1843
2058
  },
2059
+ onMouseEnter: () => setIsOfferInteracting(true),
2060
+ onMouseLeave: () => setIsOfferInteracting(false),
2061
+ onMouseDown: () => setIsOfferInteracting(true),
2062
+ onMouseUp: () => setIsOfferInteracting(false),
2063
+ onFocus: () => setIsOfferInteracting(true),
2064
+ onBlur: () => setIsOfferInteracting(false),
2065
+ onTouchStart: () => setIsOfferInteracting(true),
2066
+ onTouchEnd: () => setIsOfferInteracting(false),
1844
2067
  children: "Make Offer"
1845
2068
  }
1846
2069
  )