@unicitylabs/sphere-ui 0.1.21 → 0.1.22

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1648,7 +1648,7 @@ function MediaUploader({
1648
1648
  placeholder: "https://...",
1649
1649
  value: urlInput,
1650
1650
  onChange: (e) => setUrlInput(e.target.value),
1651
- onBlur: () => urlInput && onChange(urlInput)
1651
+ onBlur: () => onChange(urlInput.trim() || null)
1652
1652
  }
1653
1653
  )
1654
1654
  ] })
@@ -1784,6 +1784,9 @@ function getInitials(name) {
1784
1784
  }
1785
1785
  return name.slice(0, 2).toUpperCase();
1786
1786
  }
1787
+ function isPlaceholderUrl(url) {
1788
+ return /^https?:\/\/(?:placehold\.co|placeholder\.com|via\.placeholder\.com|ui-avatars\.com|placekitten\.com|dummyimage\.com)\b/i.test(url);
1789
+ }
1787
1790
  function ProjectLogo({
1788
1791
  name,
1789
1792
  logoUrl,
@@ -1793,7 +1796,8 @@ function ProjectLogo({
1793
1796
  children
1794
1797
  }) {
1795
1798
  const [imgError, setImgError] = useState9(false);
1796
- const showImage = logoUrl && !imgError;
1799
+ const isReal = !!logoUrl && !isPlaceholderUrl(logoUrl);
1800
+ const showImage = isReal && !imgError;
1797
1801
  const tileBackground = `linear-gradient(to bottom right, ${accentColor}, color-mix(in srgb, ${accentColor} 60%, white))`;
1798
1802
  return /* @__PURE__ */ jsxs20(
1799
1803
  "div",
@@ -1810,7 +1814,8 @@ function ProjectLogo({
1810
1814
  }
1811
1815
  }
1812
1816
  ),
1813
- /* @__PURE__ */ jsx25("div", { className: "absolute top-0 right-0 w-1/2 h-1/2 bg-white/10 rounded-bl-full pointer-events-none" }),
1817
+ /* @__PURE__ */ jsx25("div", { className: "absolute inset-x-0 top-0 h-1/2 bg-linear-to-b from-white/25 to-transparent pointer-events-none" }),
1818
+ /* @__PURE__ */ jsx25("div", { className: "absolute top-0 right-0 w-1/2 h-1/2 bg-white/30 rounded-bl-full pointer-events-none" }),
1814
1819
  showImage ? /* @__PURE__ */ jsx25(
1815
1820
  "img",
1816
1821
  {
@@ -2131,7 +2136,6 @@ function ProjectPagePreview({
2131
2136
  achievements = [],
2132
2137
  tags = []
2133
2138
  }) {
2134
- const placeholderLogo = `https://placehold.co/80x80/${accentColor.slice(1)}/white?text=${name[0] ?? "?"}`;
2135
2139
  return /* @__PURE__ */ jsxs24(
2136
2140
  motion4.div,
2137
2141
  {
@@ -2158,15 +2162,13 @@ function ProjectPagePreview({
2158
2162
  "Explore"
2159
2163
  ] })
2160
2164
  ] }),
2161
- /* @__PURE__ */ jsx29("div", { className: "absolute -bottom-6 left-6 sm:left-8 z-10", children: /* @__PURE__ */ jsx29(
2162
- "img",
2165
+ /* @__PURE__ */ jsx29("div", { className: "absolute -bottom-6 left-6 sm:left-8 z-10 rounded-2xl border-4 border-white dark:border-[#060606] shadow-xl overflow-hidden", children: /* @__PURE__ */ jsx29(
2166
+ ProjectLogo,
2163
2167
  {
2164
- src: logoUrl ?? placeholderLogo,
2165
- alt: name,
2166
- className: "w-16 h-16 sm:w-20 sm:h-20 rounded-2xl object-cover border-4 border-white dark:border-[#060606] shadow-xl",
2167
- onError: (e) => {
2168
- e.target.src = placeholderLogo;
2169
- }
2168
+ name,
2169
+ logoUrl,
2170
+ accentColor,
2171
+ size: "lg"
2170
2172
  }
2171
2173
  ) })
2172
2174
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unicitylabs/sphere-ui",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",