@codesinger0/shared-components 1.1.16 → 1.1.18

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.
@@ -13,7 +13,7 @@ const Hero = ({
13
13
  // Overlay
14
14
  opacity = 70,
15
15
  overlayColor = 'white',
16
-
16
+
17
17
  // Hero text props
18
18
  title,
19
19
  subtitle,
@@ -40,6 +40,13 @@ const Hero = ({
40
40
  introContent: introContentClass = 'subtitle'
41
41
  } = classNames;
42
42
 
43
+ const hexToRgba = (hex, alpha) => {
44
+ const r = parseInt(hex.slice(1, 3), 16);
45
+ const g = parseInt(hex.slice(3, 5), 16);
46
+ const b = parseInt(hex.slice(5, 7), 16);
47
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
48
+ };
49
+
43
50
  return (
44
51
  <>
45
52
  <section className="hero-section relative w-full overflow-hidden" style={{ height: mediaHeight }}>
@@ -61,7 +68,13 @@ const Hero = ({
61
68
  {/* Content Overlay */}
62
69
  <div
63
70
  className="relative z-10 flex items-center justify-center h-full"
64
- style={{ backgroundColor: `rgba(255, 255, 255, ${opacity / 100})` }}
71
+ style={{
72
+ background: overlayColor === 'white' ? `rgba(255, 255, 255, ${opacity / 100})` :
73
+ overlayColor === 'black' ? `rgba(0, 0, 0, ${opacity / 100})` :
74
+ overlayColor.startsWith('#') ? hexToRgba(overlayColor, opacity / 100) :
75
+ overlayColor.startsWith('rgb') ? overlayColor :
76
+ `rgba(255, 255, 255, ${opacity / 100})` // fallback to white
77
+ }}
65
78
  >
66
79
  <div className="text-center px-0">
67
80
  <motion.div
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codesinger0/shared-components",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "Shared React components for customer projects",
5
5
  "main": "dist/index.js",
6
6
  "files": [