@launchui/launch-ui 1.0.0 → 1.0.1
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/package.json
CHANGED
|
@@ -12,10 +12,12 @@ export const CardContainer = ({
|
|
|
12
12
|
children,
|
|
13
13
|
className,
|
|
14
14
|
containerClassName,
|
|
15
|
+
style,
|
|
15
16
|
}: {
|
|
16
17
|
children: React.ReactNode;
|
|
17
18
|
className?: string;
|
|
18
19
|
containerClassName?: string;
|
|
20
|
+
style?: React.CSSProperties;
|
|
19
21
|
}) => {
|
|
20
22
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
21
23
|
const [isMouseEntered, setIsMouseEntered] = useState(false);
|
|
@@ -72,6 +74,7 @@ export const CardContainer = ({
|
|
|
72
74
|
transformStyle: "preserve-3d",
|
|
73
75
|
rotateX,
|
|
74
76
|
rotateY,
|
|
77
|
+
...style
|
|
75
78
|
}}
|
|
76
79
|
className={`flex items-center justify-center relative transition-all duration-200 ease-linear ${className}`}
|
|
77
80
|
>
|
|
@@ -88,16 +91,19 @@ export const CardContainer = ({
|
|
|
88
91
|
export const CardBody = ({
|
|
89
92
|
children,
|
|
90
93
|
className,
|
|
94
|
+
style,
|
|
91
95
|
}: {
|
|
92
96
|
children: React.ReactNode;
|
|
93
97
|
className?: string;
|
|
98
|
+
style?: React.CSSProperties;
|
|
94
99
|
}) => {
|
|
95
100
|
return (
|
|
96
101
|
<div
|
|
97
102
|
style={{
|
|
98
103
|
transformStyle: "preserve-3d",
|
|
104
|
+
...style
|
|
99
105
|
}}
|
|
100
|
-
className={`
|
|
106
|
+
className={`[transform-style:preserve-3d] [&>*]:[transform-style:preserve-3d] ${className}`}
|
|
101
107
|
>
|
|
102
108
|
{children}
|
|
103
109
|
</div>
|
|
@@ -167,7 +173,12 @@ interface ThreeDCardProps {
|
|
|
167
173
|
description?: string;
|
|
168
174
|
imageUrl?: string;
|
|
169
175
|
ctaText?: string;
|
|
176
|
+
ctaHref?: string;
|
|
170
177
|
actionText?: string;
|
|
178
|
+
actionHref?: string;
|
|
179
|
+
className?: string;
|
|
180
|
+
containerClassName?: string;
|
|
181
|
+
style?: React.CSSProperties;
|
|
171
182
|
}
|
|
172
183
|
|
|
173
184
|
export function ThreeDCard({
|
|
@@ -175,16 +186,24 @@ export function ThreeDCard({
|
|
|
175
186
|
description = "Hover over this card to unleash the power of CSS perspective",
|
|
176
187
|
imageUrl = "https://images.unsplash.com/photo-1441974231531-c6227db76b6e?q=80&w=2560&auto=format&fit=crop",
|
|
177
188
|
ctaText = "Try now \u2192",
|
|
178
|
-
|
|
189
|
+
ctaHref = "#",
|
|
190
|
+
actionText = "Sign up",
|
|
191
|
+
actionHref = "#",
|
|
192
|
+
className,
|
|
193
|
+
containerClassName,
|
|
194
|
+
style
|
|
179
195
|
}: ThreeDCardProps) {
|
|
180
196
|
return (
|
|
181
|
-
<CardContainer className=
|
|
182
|
-
<CardBody
|
|
197
|
+
<CardContainer className={`inter-var w-full flex justify-center items-center ${containerClassName}`}>
|
|
198
|
+
<CardBody
|
|
199
|
+
style={style}
|
|
200
|
+
className={`bg-gray-50 relative group/card dark:hover:shadow-2xl dark:hover:shadow-emerald-500/[0.1] dark:bg-black dark:border-white/[0.2] border-black/[0.1] w-full max-w-[22rem] sm:max-w-[30rem] h-auto rounded-xl p-6 border ${className}`}
|
|
201
|
+
>
|
|
183
202
|
|
|
184
203
|
{/* Title Elevated */}
|
|
185
204
|
<CardItem
|
|
186
205
|
translateZ="50"
|
|
187
|
-
className="text-
|
|
206
|
+
className="text-xl font-bold text-neutral-600 dark:text-white"
|
|
188
207
|
>
|
|
189
208
|
{title}
|
|
190
209
|
</CardItem>
|
|
@@ -193,18 +212,18 @@ export function ThreeDCard({
|
|
|
193
212
|
<CardItem
|
|
194
213
|
as="p"
|
|
195
214
|
translateZ="60"
|
|
196
|
-
className="text-neutral-500 text-
|
|
215
|
+
className="text-neutral-500 text-sm max-w-sm mt-2 dark:text-neutral-300"
|
|
197
216
|
>
|
|
198
217
|
{description}
|
|
199
218
|
</CardItem>
|
|
200
219
|
|
|
201
220
|
{/* Imagery container with maximum depth and radius */}
|
|
202
|
-
<CardItem translateZ="100" className="w-full mt-
|
|
221
|
+
<CardItem translateZ="100" className="w-full mt-4">
|
|
203
222
|
<img
|
|
204
223
|
src={imageUrl}
|
|
205
224
|
height="1000"
|
|
206
225
|
width="1000"
|
|
207
|
-
className="h-60 w-full object-cover rounded-xl group-hover/card:shadow-xl
|
|
226
|
+
className="h-60 w-full object-cover rounded-xl group-hover/card:shadow-xl"
|
|
208
227
|
alt="thumbnail"
|
|
209
228
|
/>
|
|
210
229
|
</CardItem>
|
|
@@ -214,8 +233,9 @@ export function ThreeDCard({
|
|
|
214
233
|
{/* Lower left navigation prompt */}
|
|
215
234
|
<CardItem
|
|
216
235
|
translateZ={20}
|
|
217
|
-
as="
|
|
218
|
-
|
|
236
|
+
as="a"
|
|
237
|
+
href={ctaHref}
|
|
238
|
+
className="px-4 py-2 rounded-xl text-xs font-normal text-black dark:text-white hover:underline underline-offset-4 cursor-pointer inline-block"
|
|
219
239
|
>
|
|
220
240
|
{ctaText}
|
|
221
241
|
</CardItem>
|
|
@@ -223,8 +243,9 @@ export function ThreeDCard({
|
|
|
223
243
|
{/* Right primary action capsule */}
|
|
224
244
|
<CardItem
|
|
225
245
|
translateZ={20}
|
|
226
|
-
as="
|
|
227
|
-
|
|
246
|
+
as="a"
|
|
247
|
+
href={actionHref}
|
|
248
|
+
className="px-4 py-2 rounded-xl bg-black dark:bg-white dark:text-black text-white text-xs font-bold shadow-md transition-all active:scale-95 cursor-pointer inline-block"
|
|
228
249
|
>
|
|
229
250
|
{actionText}
|
|
230
251
|
</CardItem>
|