@codesinger0/shared-components 1.0.5 → 1.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.js +1 -0
- package/dist/src/components/LargeItemCard.jsx +135 -0
- package/dist/src/index.js +2 -0
- package/package.json +17 -18
- package/dist/components/index.js +0 -1
- package/dist/src/components/index.js +0 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RoundButton } from './components/RoundButton';
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RoundButton } from '../RoundButton.jsx'
|
|
3
|
+
import { motion } from 'framer-motion'
|
|
4
|
+
|
|
5
|
+
const LargeItemCard = ({
|
|
6
|
+
imageUrl,
|
|
7
|
+
title,
|
|
8
|
+
subtitle,
|
|
9
|
+
description,
|
|
10
|
+
buttonLabel,
|
|
11
|
+
onButtonClick,
|
|
12
|
+
reverse = false,
|
|
13
|
+
price,
|
|
14
|
+
discountPrice,
|
|
15
|
+
icons = []
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<section className="relative w-full overflow-visible py-16 px-4">
|
|
19
|
+
{/* Background Section with Text Content */}
|
|
20
|
+
<div className="glass-card relative" style={{ minHeight: '48vh', overflow: 'visible' }}>
|
|
21
|
+
<div className="max-w-7xl mx-auto px-6 pt-16">
|
|
22
|
+
<div className="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center">
|
|
23
|
+
|
|
24
|
+
{/* Text Content */}
|
|
25
|
+
<div
|
|
26
|
+
className={`text-center lg:text-right space-y-6 ${reverse ? 'lg:order-2' : 'lg:order-1'}`}
|
|
27
|
+
dir="rtl"
|
|
28
|
+
>
|
|
29
|
+
<h2 className="title">{title}</h2>
|
|
30
|
+
<h3 className="subtitle">{subtitle}</h3>
|
|
31
|
+
<p className="content-text max-w-md mx-auto lg:mx-0">{description}</p>
|
|
32
|
+
|
|
33
|
+
{/* Price Section */}
|
|
34
|
+
{price && (
|
|
35
|
+
<div className="text-center lg:text-right mt-4">
|
|
36
|
+
{discountPrice && discountPrice < price ? (
|
|
37
|
+
<div className="space-y-1">
|
|
38
|
+
<div className="flex items-center justify-center lg:justify-start gap-2">
|
|
39
|
+
<span className="text-2xl font-bold text-price">
|
|
40
|
+
₪{discountPrice}
|
|
41
|
+
</span>
|
|
42
|
+
<span className="text-sm content-text line-through">
|
|
43
|
+
₪{price}
|
|
44
|
+
</span>
|
|
45
|
+
<span className="bg-red-500 text-white px-2 py-1 rounded-full text-xs font-bold">
|
|
46
|
+
-{Math.round(((price - discountPrice) / price) * 100)}%
|
|
47
|
+
</span>
|
|
48
|
+
</div>
|
|
49
|
+
<div className="text-xs content-text font-medium">
|
|
50
|
+
חיסכון של ₪{price - discountPrice}
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
) : (
|
|
54
|
+
<span className="text-2xl font-bold text-price">
|
|
55
|
+
₪{price}
|
|
56
|
+
</span>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
|
|
61
|
+
<div className="py-4">
|
|
62
|
+
<RoundButton variant="primary" onClick={onButtonClick}>
|
|
63
|
+
{buttonLabel}
|
|
64
|
+
</RoundButton>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
{/* Icons Section */}
|
|
68
|
+
{icons.length > 0 && (
|
|
69
|
+
<div className="flex flex-wrap justify-center lg:justify-start gap-10 mt-6">
|
|
70
|
+
{icons.map((icon, index) => (
|
|
71
|
+
<div key={index} className="flex flex-col items-center justify-center content-text rounded-lg shadow-sm pb-10">
|
|
72
|
+
{icon}
|
|
73
|
+
</div>
|
|
74
|
+
))}
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
{/* Space for image positioning (desktop uses floating image, keep spacer) */}
|
|
80
|
+
<div className={`hidden lg:block relative lg:h-full ${reverse ? 'lg:order-1' : 'lg:order-2'}`}>
|
|
81
|
+
{/* reserved for absolutely positioned image on desktop */}
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
{/* full-width mobile image */}
|
|
88
|
+
<div className="block lg:hidden mt-8 w-full">
|
|
89
|
+
<motion.div
|
|
90
|
+
key={'image'}
|
|
91
|
+
initial={{ opacity: 0, y: 50 }}
|
|
92
|
+
whileInView={{ opacity: 1, y: 0 }}
|
|
93
|
+
viewport={{ once: true }}
|
|
94
|
+
transition={{ delay: 1 * 0.5 }}
|
|
95
|
+
className="h-full"
|
|
96
|
+
>
|
|
97
|
+
<img
|
|
98
|
+
src={imageUrl}
|
|
99
|
+
alt={title}
|
|
100
|
+
className="w-full h-auto rounded-none shadow-2xls"
|
|
101
|
+
/>
|
|
102
|
+
</motion.div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
{/* Floating Image Container (desktop only, unchanged behavior) */}
|
|
107
|
+
<div
|
|
108
|
+
className={`hidden lg:block absolute transform -translate-x-1/2 left-1/2 lg:top-8 ${reverse
|
|
109
|
+
? 'lg:left-16 lg:transform-none lg:translate-x-0'
|
|
110
|
+
: 'lg:left-auto lg:right-16 lg:transform-none lg:translate-x-0'
|
|
111
|
+
}`}
|
|
112
|
+
style={{ zIndex: 10, width: '600px', maxWidth: '90vw' }}
|
|
113
|
+
>
|
|
114
|
+
<div className="relative">
|
|
115
|
+
<motion.div
|
|
116
|
+
key={'image'}
|
|
117
|
+
initial={{ opacity: 0, x: reverse ? -50 : 50 }}
|
|
118
|
+
whileInView={{ opacity: 1, x: 0 }}
|
|
119
|
+
viewport={{ once: true }}
|
|
120
|
+
transition={{ delay: 1 * 0.5 }}
|
|
121
|
+
className="h-full"
|
|
122
|
+
>
|
|
123
|
+
<img
|
|
124
|
+
src={imageUrl}
|
|
125
|
+
alt={title}
|
|
126
|
+
className="w-auto h-auto max-h-[50vh] rounded-lg shadow-2xl border border-primary"
|
|
127
|
+
/>
|
|
128
|
+
</motion.div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</section>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export default LargeItemCard;
|
package/package.json
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codesinger0/shared-components",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "Shared React components for customer projects",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "cp -r src dist"
|
|
11
|
+
},
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"react": ">=18.0.0",
|
|
14
|
+
"lucide-react": ">=0.263.1",
|
|
15
|
+
"framer-motion": ">=12.23.12"
|
|
8
16
|
},
|
|
9
17
|
"repository": {
|
|
10
18
|
"type": "git",
|
|
11
19
|
"url": "git+https://github.com/haggaimagen/shared-components.git"
|
|
12
20
|
},
|
|
13
|
-
"license": "ISC",
|
|
14
21
|
"author": "codesinger0",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"test": "test",
|
|
19
|
-
"build": "cp -r src dist"
|
|
22
|
+
"license": "ISC",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/haggaimagen/shared-components/issues"
|
|
20
25
|
},
|
|
21
|
-
"
|
|
22
|
-
"dist"
|
|
23
|
-
],
|
|
24
|
-
"peerDependencies": {
|
|
25
|
-
"react": ">=18.0.0",
|
|
26
|
-
"lucide-react": ">=0.263.1"
|
|
27
|
-
}
|
|
26
|
+
"homepage": "https://github.com/haggaimagen/shared-components#readme"
|
|
28
27
|
}
|
package/dist/components/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as RoundButton } from './RoundButton';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as RoundButton } from './RoundButton';
|