@loafmarkets/ui 0.1.65 → 0.1.67

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
@@ -2901,7 +2901,6 @@ var PropertyNewsUpdates = React5__namespace.forwardRef(
2901
2901
  const [homePage, setHomePage] = React5__namespace.useState(0);
2902
2902
  const purchaseItems = purchasesProp ?? [];
2903
2903
  const [page, setPage] = React5__namespace.useState(0);
2904
- const [expandedId, setExpandedId] = React5__namespace.useState(null);
2905
2904
  const [selectedItem, setSelectedItem] = React5__namespace.useState(null);
2906
2905
  React5__namespace.useEffect(() => {
2907
2906
  ensureAnimationsInjected();
@@ -2927,9 +2926,6 @@ var PropertyNewsUpdates = React5__namespace.forwardRef(
2927
2926
  [homeFilteredItems.length]
2928
2927
  );
2929
2928
  const homePaginatedItems = homeFilteredItems.slice(homePage * ITEMS_PER_PAGE, (homePage + 1) * ITEMS_PER_PAGE);
2930
- const toggleExpand = React5__namespace.useCallback((key) => {
2931
- setExpandedId((prev) => prev === key ? null : key);
2932
- }, []);
2933
2929
  return /* @__PURE__ */ jsxRuntime.jsxs(
2934
2930
  "div",
2935
2931
  {
@@ -3014,37 +3010,40 @@ var PropertyNewsUpdates = React5__namespace.forwardRef(
3014
3010
  const key = item.displayId ?? item.id ?? `${item.title}-${index}`;
3015
3011
  const isProperty = item.type === "property";
3016
3012
  const sentimentInfo = getSentimentInfo(item.sentimentScore);
3017
- const isExpanded = expandedId === key;
3018
3013
  return /* @__PURE__ */ jsxRuntime.jsxs(
3019
- "div",
3014
+ "button",
3020
3015
  {
3021
- style: { padding: "0.75rem 0", borderBottom: index < homePaginatedItems.length - 1 ? "1px solid rgba(255,255,255,0.05)" : "none" },
3016
+ type: "button",
3017
+ onClick: () => setSelectedItem(item),
3018
+ style: {
3019
+ width: "100%",
3020
+ textAlign: "left",
3021
+ background: "transparent",
3022
+ border: "none",
3023
+ cursor: "pointer",
3024
+ padding: "0.75rem 0",
3025
+ borderBottom: index < homePaginatedItems.length - 1 ? "1px solid rgba(255,255,255,0.05)" : "none",
3026
+ display: "flex",
3027
+ justifyContent: "space-between",
3028
+ alignItems: "flex-start",
3029
+ gap: "0.5rem",
3030
+ color: "inherit"
3031
+ },
3022
3032
  children: [
3023
- /* @__PURE__ */ jsxRuntime.jsxs(
3024
- "button",
3025
- {
3026
- type: "button",
3027
- onClick: () => toggleExpand(key),
3028
- style: { width: "100%", textAlign: "left", background: "transparent", border: "none", cursor: "pointer", padding: 0, display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: "0.5rem", color: "inherit" },
3029
- children: [
3030
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
3031
- /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { fontSize: "0.85rem", fontWeight: 400, marginBottom: "0.25rem", color: "#f8f9fa", lineHeight: 1.4 }, children: item.title }),
3032
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "0.5rem", alignItems: "center", flexWrap: "wrap" }, children: [
3033
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#848e9c", fontSize: "0.7rem" }, children: typeof item.date === "string" ? item.date : formatDate(item.date) }),
3034
- item.source && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { padding: "0.1rem 0.4rem", borderRadius: "3px", fontSize: "0.62rem", fontWeight: 500, backgroundColor: "rgba(255,255,255,0.07)", color: "#848e9c", whiteSpace: "nowrap" }, children: item.source }),
3035
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { padding: "0.15rem 0.4rem", borderRadius: "2px", fontSize: "0.65rem", fontWeight: 500, backgroundColor: isProperty ? "rgba(14,203,129,0.1)" : "rgba(240,185,11,0.1)", color: isProperty ? "#0ecb81" : "#f0b90b" }, children: isProperty ? "Property Update" : "Market News" }),
3036
- sentimentInfo && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "0.65rem", fontWeight: 600, color: sentimentInfo.color }, children: [
3037
- sentimentInfo.arrow,
3038
- " ",
3039
- sentimentInfo.label
3040
- ] })
3041
- ] })
3042
- ] }),
3043
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "center", color: "#848e9c", marginLeft: "0.5rem", paddingTop: "2px" }, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", style: { transition: "transform 0.2s", transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)" }, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }) }) })
3044
- ]
3045
- }
3046
- ),
3047
- isExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: "0.625rem", padding: "0.75rem", background: "rgba(255,255,255,0.04)", borderRadius: "6px", borderLeft: `3px solid ${sentimentInfo?.color ?? "rgba(255,255,255,0.15)"}`, animation: "propertyNewsSlideIn 0.2s ease-out" }, children: item.summary ? /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "0.8rem", color: "rgba(255,255,255,0.72)", lineHeight: 1.65, margin: 0 }, children: item.summary }) : /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "0.78rem", color: "rgba(255,255,255,0.35)", fontStyle: "italic", margin: 0 }, children: "Summary not available." }) })
3033
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
3034
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { fontSize: "0.85rem", fontWeight: 400, marginBottom: "0.25rem", color: "#f8f9fa", lineHeight: 1.4 }, children: item.title }),
3035
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "0.5rem", alignItems: "center", flexWrap: "wrap" }, children: [
3036
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#848e9c", fontSize: "0.7rem" }, children: typeof item.date === "string" ? item.date : formatDate(item.date) }),
3037
+ item.source && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { padding: "0.1rem 0.4rem", borderRadius: "3px", fontSize: "0.62rem", fontWeight: 500, backgroundColor: "rgba(255,255,255,0.07)", color: "#848e9c", whiteSpace: "nowrap" }, children: item.source }),
3038
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { padding: "0.15rem 0.4rem", borderRadius: "2px", fontSize: "0.65rem", fontWeight: 500, backgroundColor: isProperty ? "rgba(14,203,129,0.1)" : "rgba(240,185,11,0.1)", color: isProperty ? "#0ecb81" : "#f0b90b" }, children: isProperty ? "Property Update" : "Market News" }),
3039
+ sentimentInfo && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "0.65rem", fontWeight: 600, color: sentimentInfo.color }, children: [
3040
+ sentimentInfo.arrow,
3041
+ " ",
3042
+ sentimentInfo.label
3043
+ ] })
3044
+ ] })
3045
+ ] }),
3046
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: "#848e9c", paddingTop: "2px", flexShrink: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }) }) })
3048
3047
  ]
3049
3048
  },
3050
3049
  key
@@ -3170,7 +3169,7 @@ var PropertyNewsUpdates = React5__namespace.forwardRef(
3170
3169
  }
3171
3170
  )
3172
3171
  ] }),
3173
- selectedItem && !isHomeVariant && !isPurchaseVariant && /* @__PURE__ */ jsxRuntime.jsx(NewsArticleModal, { item: selectedItem, onClose: () => setSelectedItem(null) })
3172
+ selectedItem && !isPurchaseVariant && /* @__PURE__ */ jsxRuntime.jsx(NewsArticleModal, { item: selectedItem, onClose: () => setSelectedItem(null) })
3174
3173
  ]
3175
3174
  }
3176
3175
  );