@windrun-huaiin/third-ui 15.1.0 → 15.1.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/dist/main/hero-media.d.ts +14 -0
- package/dist/main/hero-media.js +12 -0
- package/dist/main/hero-media.mjs +10 -0
- package/dist/main/hero-section.d.ts +10 -0
- package/dist/main/hero-section.js +11 -0
- package/dist/main/hero-section.mjs +9 -0
- package/dist/main/index.d.ts +2 -0
- package/dist/main/index.js +4 -0
- package/dist/main/index.mjs +2 -0
- package/package.json +3 -3
- package/src/main/hero-media.tsx +53 -0
- package/src/main/hero-section.tsx +36 -0
- package/src/main/index.ts +3 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface HeroMediaProps {
|
|
2
|
+
src: string;
|
|
3
|
+
alt: string;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
sizes?: string;
|
|
7
|
+
maxWidthClassName?: string;
|
|
8
|
+
wrapperClassName?: string;
|
|
9
|
+
imageClassName?: string;
|
|
10
|
+
placeholderClassName?: string;
|
|
11
|
+
preload?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function HeroMedia({ src, alt, width, height, sizes, maxWidthClassName, wrapperClassName, imageClassName, placeholderClassName, preload, }: HeroMediaProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var delayedImg = require('./delayed-img.js');
|
|
6
|
+
var utils = require('@windrun-huaiin/lib/utils');
|
|
7
|
+
|
|
8
|
+
function HeroMedia({ src, alt, width, height, sizes = "(max-width: 768px) 90vw, (max-width: 1200px) 45vw, 35vw", maxWidthClassName = "max-w-[500px]", wrapperClassName, imageClassName, placeholderClassName, preload = true, }) {
|
|
9
|
+
return (jsxRuntime.jsx("div", { className: utils.cn("w-full", maxWidthClassName), children: jsxRuntime.jsx("div", { className: utils.cn("group relative overflow-hidden rounded-lg shadow-purple-500/20", wrapperClassName), style: { aspectRatio: `${width} / ${height}` }, children: jsxRuntime.jsx(delayedImg.DelayedImg, { src: src, alt: alt, fill: true, preload: preload, sizes: sizes, className: utils.cn("rounded-lg object-cover group-hover:scale-105", imageClassName), wrapperClassName: "h-full w-full", placeholderClassName: utils.cn("rounded-lg", placeholderClassName) }) }) }));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.HeroMedia = HeroMedia;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { DelayedImg } from './delayed-img.mjs';
|
|
4
|
+
import { cn } from '@windrun-huaiin/lib/utils';
|
|
5
|
+
|
|
6
|
+
function HeroMedia({ src, alt, width, height, sizes = "(max-width: 768px) 90vw, (max-width: 1200px) 45vw, 35vw", maxWidthClassName = "max-w-[500px]", wrapperClassName, imageClassName, placeholderClassName, preload = true, }) {
|
|
7
|
+
return (jsx("div", { className: cn("w-full", maxWidthClassName), children: jsx("div", { className: cn("group relative overflow-hidden rounded-lg shadow-purple-500/20", wrapperClassName), style: { aspectRatio: `${width} / ${height}` }, children: jsx(DelayedImg, { src: src, alt: alt, fill: true, preload: preload, sizes: sizes, className: cn("rounded-lg object-cover group-hover:scale-105", imageClassName), wrapperClassName: "h-full w-full", placeholderClassName: cn("rounded-lg", placeholderClassName) }) }) }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { HeroMedia };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
interface HeroSectionProps {
|
|
3
|
+
content: ReactNode;
|
|
4
|
+
media: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
contentClassName?: string;
|
|
7
|
+
mediaClassName?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function HeroSection({ content, media, className, contentClassName, mediaClassName, }: HeroSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var utils = require('@windrun-huaiin/lib/utils');
|
|
6
|
+
|
|
7
|
+
function HeroSection({ content, media, className, contentClassName, mediaClassName, }) {
|
|
8
|
+
return (jsxRuntime.jsxs("section", { className: utils.cn("mx-auto mt-12 flex max-w-6xl flex-col gap-10 px-6 py-8 md:min-w-[calc(100vw-22rem)] md:px-4 md:flex-row md:items-center md:gap-12", className), children: [jsxRuntime.jsx("div", { className: utils.cn("flex-1 space-y-6", contentClassName), children: content }), jsxRuntime.jsx("div", { className: utils.cn("relative flex flex-1 justify-center md:justify-end", mediaClassName), children: media })] }));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.HeroSection = HeroSection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { cn } from '@windrun-huaiin/lib/utils';
|
|
4
|
+
|
|
5
|
+
function HeroSection({ content, media, className, contentClassName, mediaClassName, }) {
|
|
6
|
+
return (jsxs("section", { className: cn("mx-auto mt-12 flex max-w-6xl flex-col gap-10 px-6 py-8 md:min-w-[calc(100vw-22rem)] md:px-4 md:flex-row md:items-center md:gap-12", className), children: [jsx("div", { className: cn("flex-1 space-y-6", contentClassName), children: content }), jsx("div", { className: cn("relative flex flex-1 justify-center md:justify-end", mediaClassName), children: media })] }));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { HeroSection };
|
package/dist/main/index.d.ts
CHANGED
|
@@ -16,3 +16,5 @@ export { MoneyPriceInteractive } from './money-price/money-price-interactive';
|
|
|
16
16
|
export { MoneyPriceButton } from './money-price/money-price-button';
|
|
17
17
|
export { CreditOverviewClient } from './credit/credit-overview-client';
|
|
18
18
|
export { CreditNavButton } from './credit/credit-nav-button';
|
|
19
|
+
export { HeroMedia } from './hero-media';
|
|
20
|
+
export { HeroSection } from './hero-section';
|
package/dist/main/index.js
CHANGED
|
@@ -22,6 +22,8 @@ var moneyPriceInteractive = require('./money-price/money-price-interactive.js');
|
|
|
22
22
|
var moneyPriceButton = require('./money-price/money-price-button.js');
|
|
23
23
|
var creditOverviewClient = require('./credit/credit-overview-client.js');
|
|
24
24
|
var creditNavButton = require('./credit/credit-nav-button.js');
|
|
25
|
+
var heroMedia = require('./hero-media.js');
|
|
26
|
+
var heroSection = require('./hero-section.js');
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
|
|
@@ -49,3 +51,5 @@ exports.MoneyPriceInteractive = moneyPriceInteractive.MoneyPriceInteractive;
|
|
|
49
51
|
exports.MoneyPriceButton = moneyPriceButton.MoneyPriceButton;
|
|
50
52
|
exports.CreditOverviewClient = creditOverviewClient.CreditOverviewClient;
|
|
51
53
|
exports.CreditNavButton = creditNavButton.CreditNavButton;
|
|
54
|
+
exports.HeroMedia = heroMedia.HeroMedia;
|
|
55
|
+
exports.HeroSection = heroSection.HeroSection;
|
package/dist/main/index.mjs
CHANGED
|
@@ -20,3 +20,5 @@ export { MoneyPriceInteractive } from './money-price/money-price-interactive.mjs
|
|
|
20
20
|
export { MoneyPriceButton } from './money-price/money-price-button.mjs';
|
|
21
21
|
export { CreditOverviewClient } from './credit/credit-overview-client.mjs';
|
|
22
22
|
export { CreditNavButton } from './credit/credit-nav-button.mjs';
|
|
23
|
+
export { HeroMedia } from './hero-media.mjs';
|
|
24
|
+
export { HeroSection } from './hero-section.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windrun-huaiin/third-ui",
|
|
3
|
-
"version": "15.1.
|
|
3
|
+
"version": "15.1.1",
|
|
4
4
|
"description": "Third-party integrated UI components for windrun-huaiin projects",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"swiper": "^12.1.2",
|
|
91
91
|
"tslib": "^2.8.1",
|
|
92
92
|
"zod": "^4.3.6",
|
|
93
|
-
"@windrun-huaiin/base-ui": "^15.1.
|
|
94
|
-
"@windrun-huaiin/lib": "^15.1.
|
|
93
|
+
"@windrun-huaiin/base-ui": "^15.1.1",
|
|
94
|
+
"@windrun-huaiin/lib": "^15.1.1"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"clsx": "^2.1.1",
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { DelayedImg } from "./delayed-img";
|
|
4
|
+
import { cn } from '@windrun-huaiin/lib/utils';
|
|
5
|
+
|
|
6
|
+
interface HeroMediaProps {
|
|
7
|
+
src: string;
|
|
8
|
+
alt: string;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
sizes?: string;
|
|
12
|
+
maxWidthClassName?: string;
|
|
13
|
+
wrapperClassName?: string;
|
|
14
|
+
imageClassName?: string;
|
|
15
|
+
placeholderClassName?: string;
|
|
16
|
+
preload?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function HeroMedia({
|
|
20
|
+
src,
|
|
21
|
+
alt,
|
|
22
|
+
width,
|
|
23
|
+
height,
|
|
24
|
+
sizes = "(max-width: 768px) 90vw, (max-width: 1200px) 45vw, 35vw",
|
|
25
|
+
maxWidthClassName = "max-w-[500px]",
|
|
26
|
+
wrapperClassName,
|
|
27
|
+
imageClassName,
|
|
28
|
+
placeholderClassName,
|
|
29
|
+
preload = true,
|
|
30
|
+
}: HeroMediaProps) {
|
|
31
|
+
return (
|
|
32
|
+
<div className={cn("w-full", maxWidthClassName)}>
|
|
33
|
+
<div
|
|
34
|
+
className={cn(
|
|
35
|
+
"group relative overflow-hidden rounded-lg shadow-purple-500/20",
|
|
36
|
+
wrapperClassName,
|
|
37
|
+
)}
|
|
38
|
+
style={{ aspectRatio: `${width} / ${height}` }}
|
|
39
|
+
>
|
|
40
|
+
<DelayedImg
|
|
41
|
+
src={src}
|
|
42
|
+
alt={alt}
|
|
43
|
+
fill
|
|
44
|
+
preload={preload}
|
|
45
|
+
sizes={sizes}
|
|
46
|
+
className={cn("rounded-lg object-cover group-hover:scale-105", imageClassName)}
|
|
47
|
+
wrapperClassName="h-full w-full"
|
|
48
|
+
placeholderClassName={cn("rounded-lg", placeholderClassName)}
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import { cn } from '@windrun-huaiin/lib/utils';
|
|
5
|
+
|
|
6
|
+
interface HeroSectionProps {
|
|
7
|
+
content: ReactNode;
|
|
8
|
+
media: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
contentClassName?: string;
|
|
11
|
+
mediaClassName?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function HeroSection({
|
|
15
|
+
content,
|
|
16
|
+
media,
|
|
17
|
+
className,
|
|
18
|
+
contentClassName,
|
|
19
|
+
mediaClassName,
|
|
20
|
+
}: HeroSectionProps) {
|
|
21
|
+
return (
|
|
22
|
+
<section
|
|
23
|
+
className={cn(
|
|
24
|
+
"mx-auto mt-12 flex max-w-6xl flex-col gap-10 px-6 py-8 md:min-w-[calc(100vw-22rem)] md:px-4 md:flex-row md:items-center md:gap-12",
|
|
25
|
+
className,
|
|
26
|
+
)}
|
|
27
|
+
>
|
|
28
|
+
<div className={cn("flex-1 space-y-6", contentClassName)}>
|
|
29
|
+
{content}
|
|
30
|
+
</div>
|
|
31
|
+
<div className={cn("relative flex flex-1 justify-center md:justify-end", mediaClassName)}>
|
|
32
|
+
{media}
|
|
33
|
+
</div>
|
|
34
|
+
</section>
|
|
35
|
+
);
|
|
36
|
+
}
|
package/src/main/index.ts
CHANGED
|
@@ -21,3 +21,6 @@ export { MoneyPriceButton } from './money-price/money-price-button';
|
|
|
21
21
|
|
|
22
22
|
export { CreditOverviewClient } from './credit/credit-overview-client';
|
|
23
23
|
export { CreditNavButton } from './credit/credit-nav-button';
|
|
24
|
+
|
|
25
|
+
export { HeroMedia } from './hero-media';
|
|
26
|
+
export { HeroSection } from './hero-section';
|