zuljaman-banner-components 1.0.0
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/README.md +242 -0
- package/dist/adapters/NextJSAdapter.d.ts +17 -0
- package/dist/adapters/NextJSAdapter.d.ts.map +1 -0
- package/dist/adapters/NextJSAdapter.js +7 -0
- package/dist/adapters/SSRAdapter.d.ts +8 -0
- package/dist/adapters/SSRAdapter.d.ts.map +1 -0
- package/dist/adapters/SSRAdapter.js +2 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +5 -0
- package/dist/components/BannerVisor.d.ts +12 -0
- package/dist/components/BannerVisor.d.ts.map +1 -0
- package/dist/components/BannerVisor.js +99 -0
- package/dist/components/Style1/BannerStyle1.d.ts +18 -0
- package/dist/components/Style1/BannerStyle1.d.ts.map +1 -0
- package/dist/components/Style1/BannerStyle1.js +22 -0
- package/dist/components/Style1/substyles/BannerSubstyle1.d.ts +12 -0
- package/dist/components/Style1/substyles/BannerSubstyle1.d.ts.map +1 -0
- package/dist/components/Style1/substyles/BannerSubstyle1.js +44 -0
- package/dist/components/Style1/substyles/BannerSubstyle2.d.ts +12 -0
- package/dist/components/Style1/substyles/BannerSubstyle2.d.ts.map +1 -0
- package/dist/components/Style1/substyles/BannerSubstyle2.js +44 -0
- package/dist/components/Style1/substyles/BannerSubstyle3.d.ts +12 -0
- package/dist/components/Style1/substyles/BannerSubstyle3.d.ts.map +1 -0
- package/dist/components/Style1/substyles/BannerSubstyle3.js +53 -0
- package/dist/components/Style1/substyles/index.d.ts +7 -0
- package/dist/components/Style1/substyles/index.d.ts.map +1 -0
- package/dist/components/Style1/substyles/index.js +6 -0
- package/dist/components/Style2/BannerStyle2.d.ts +18 -0
- package/dist/components/Style2/BannerStyle2.d.ts.map +1 -0
- package/dist/components/Style2/BannerStyle2.js +27 -0
- package/dist/components/Style2/substyles/BannerSubstyle1.d.ts +12 -0
- package/dist/components/Style2/substyles/BannerSubstyle1.d.ts.map +1 -0
- package/dist/components/Style2/substyles/BannerSubstyle1.js +27 -0
- package/dist/components/Style2/substyles/BannerSubstyle2.d.ts +12 -0
- package/dist/components/Style2/substyles/BannerSubstyle2.d.ts.map +1 -0
- package/dist/components/Style2/substyles/BannerSubstyle2.js +27 -0
- package/dist/components/Style2/substyles/BannerSubstyle3.d.ts +12 -0
- package/dist/components/Style2/substyles/BannerSubstyle3.d.ts.map +1 -0
- package/dist/components/Style2/substyles/BannerSubstyle3.js +27 -0
- package/dist/components/Style2/substyles/index.d.ts +7 -0
- package/dist/components/Style2/substyles/index.d.ts.map +1 -0
- package/dist/components/Style2/substyles/index.js +6 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +6 -0
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +4 -0
- package/dist/constants/styleConfigs.d.ts +11 -0
- package/dist/constants/styleConfigs.d.ts.map +1 -0
- package/dist/constants/styleConfigs.js +24 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/styles/index.d.ts +5 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/index.js +4 -0
- package/dist/styles/shadowUtils.d.ts +21 -0
- package/dist/styles/shadowUtils.d.ts.map +1 -0
- package/dist/styles/shadowUtils.js +107 -0
- package/dist/types.d.ts +98 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +20 -0
- package/dist/utils.d.ts +16 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +29 -0
- package/package.json +62 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BannerSubstyle3 for Style1 - Platform-agnostic version
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
"use client";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useMemo } from "react";
|
|
8
|
+
import { createAbstractShadowStyle } from "../../../styles/shadowUtils";
|
|
9
|
+
// Helper function to replace multiple spaces with newlines
|
|
10
|
+
const formatCopy = (text) => {
|
|
11
|
+
if (!text)
|
|
12
|
+
return "";
|
|
13
|
+
return text.replace(/\s{2,}/g, "\n");
|
|
14
|
+
};
|
|
15
|
+
export const BannerSubstyle3 = ({ copy1, copy2, fontSize_01, fontSize_02, logoUrl, backgroundImageUrl, ImageComponent, }) => {
|
|
16
|
+
const { shadowStyle, logoShadowStyle } = useMemo(() => {
|
|
17
|
+
// --- Randomized Shadow Parameters ---
|
|
18
|
+
// Text Shadow (Bottom)
|
|
19
|
+
const baseTextSize = 70;
|
|
20
|
+
const textVariationSize = 20; // +/- 10%
|
|
21
|
+
const randomTextSize = Math.floor(baseTextSize + (Math.random() - 0.5) * textVariationSize);
|
|
22
|
+
const baseTextIntensity = 0.85;
|
|
23
|
+
const textVariationIntensity = 0.2; // +/- 0.1
|
|
24
|
+
const randomTextIntensity = baseTextIntensity + (Math.random() - 0.5) * textVariationIntensity;
|
|
25
|
+
// Logo Shadow (Top-Left)
|
|
26
|
+
const baseLogoSize = 250;
|
|
27
|
+
const logoVariationSize = 20; // +/- 10%
|
|
28
|
+
const randomLogoSize = Math.floor(baseLogoSize + (Math.random() - 0.5) * logoVariationSize);
|
|
29
|
+
const baseLogoIntensity = 0.65;
|
|
30
|
+
const logoVariationIntensity = 0.2; // +/- 0.1
|
|
31
|
+
const randomLogoIntensity = baseLogoIntensity + (Math.random() - 0.5) * logoVariationIntensity;
|
|
32
|
+
// --- Generate Styles with Random Values ---
|
|
33
|
+
const shadowStyle = createAbstractShadowStyle({
|
|
34
|
+
// direction: "bottom", // Default
|
|
35
|
+
size: `${randomTextSize}%`,
|
|
36
|
+
intensity: randomTextIntensity,
|
|
37
|
+
});
|
|
38
|
+
const logoShadowStyle = createAbstractShadowStyle({
|
|
39
|
+
direction: "top-left",
|
|
40
|
+
size: `${randomLogoSize}%`,
|
|
41
|
+
intensity: randomLogoIntensity,
|
|
42
|
+
});
|
|
43
|
+
return { shadowStyle, logoShadowStyle };
|
|
44
|
+
}, []); // Empty dependency array ensures this runs only once on mount
|
|
45
|
+
// Process the copy strings
|
|
46
|
+
const formattedCopy1 = useMemo(() => formatCopy(copy1), [copy1]);
|
|
47
|
+
const formattedCopy2 = useMemo(() => formatCopy(copy2), [copy2]);
|
|
48
|
+
return (_jsxs("div", { className: "inset-0 flex flex-col items-start justify-between h-full pb-20 relative isolate overflow-hidden gap-4", children: [backgroundImageUrl && (_jsx(ImageComponent, { src: backgroundImageUrl, alt: "Background", width: 1080, height: 1350, className: "object-cover absolute inset-0 w-full h-full -z-10", style: { objectFit: 'cover' } })), _jsx("div", { style: shadowStyle, className: "relative z-10", "aria-hidden": "true" }), _jsx("div", { style: logoShadowStyle, className: "relative z-10", "aria-hidden": "true" }), _jsxs("div", { className: "relative px-20 pt-20 flex justify-between w-full z-20", children: [_jsx("div", { className: "relative w-64 h-64 pr-64", children: logoUrl && (_jsx(ImageComponent, { src: logoUrl, alt: "Logo", width: 256, height: 256, className: "object-contain absolute inset-0 w-full h-full", style: { objectFit: 'contain' } })) }), _jsx("p", { style: {
|
|
49
|
+
fontSize: `calc(${fontSize_01} * 0.8)`,
|
|
50
|
+
}, className: "text-right w-2/3 leading-tight whitespace-pre-wrap", children: formattedCopy1 })] }), _jsx("div", { className: "w-full px-20 relative z-20", children: _jsx("p", { style: {
|
|
51
|
+
fontSize: fontSize_02,
|
|
52
|
+
}, className: "font-bold text-center leading-tight whitespace-pre-wrap", children: formattedCopy2 }) })] }));
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Style1/substyles/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BannerStyle2 component - Platform-agnostic version
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { ImageProps } from "../../types";
|
|
7
|
+
interface BannerStyle2Props {
|
|
8
|
+
copy1?: string;
|
|
9
|
+
copy2?: string;
|
|
10
|
+
bannerSubstyle?: number;
|
|
11
|
+
logoUrl?: string;
|
|
12
|
+
sizeMultiplier?: number;
|
|
13
|
+
backgroundImageUrl?: string;
|
|
14
|
+
ImageComponent: React.ComponentType<ImageProps>;
|
|
15
|
+
}
|
|
16
|
+
export declare const BannerStyle2: React.FC<BannerStyle2Props>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=BannerStyle2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerStyle2.d.ts","sourceRoot":"","sources":["../../../src/components/Style2/BannerStyle2.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;CACjD;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAiCpD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BannerStyle2 component - Platform-agnostic version
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
"use client";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { BannerSubstyle1, BannerSubstyle2, BannerSubstyle3 } from "./substyles";
|
|
8
|
+
import { calculateStyleFontSizes } from "../../utils";
|
|
9
|
+
export const BannerStyle2 = ({ copy1, copy2, bannerSubstyle = 1, logoUrl, backgroundImageUrl, ImageComponent, }) => {
|
|
10
|
+
// Use the utility function to calculate font sizes with Style2 constrained parameters
|
|
11
|
+
const fontSizes = calculateStyleFontSizes(copy1, copy2, {
|
|
12
|
+
baseSizeRem1: 3.8,
|
|
13
|
+
baseSizeRem2: 4.0,
|
|
14
|
+
maxLengthThreshold: 35,
|
|
15
|
+
reductionFactor: 0.18
|
|
16
|
+
});
|
|
17
|
+
const substyleProps = {
|
|
18
|
+
copy1,
|
|
19
|
+
fontSize_01: fontSizes.fontSize_01,
|
|
20
|
+
copy2,
|
|
21
|
+
fontSize_02: fontSizes.fontSize_02,
|
|
22
|
+
logoUrl,
|
|
23
|
+
backgroundImageUrl,
|
|
24
|
+
ImageComponent,
|
|
25
|
+
};
|
|
26
|
+
return (_jsxs("div", { className: "w-full h-full text-white", children: [bannerSubstyle === 1 && _jsx(BannerSubstyle1, { ...substyleProps }), bannerSubstyle === 2 && _jsx(BannerSubstyle2, { ...substyleProps }), bannerSubstyle === 3 && _jsx(BannerSubstyle3, { ...substyleProps })] }));
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BannerSubstyle1 for Style2 - Platform-agnostic version
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { BannerSubstyleProps, ImageProps } from "../../../types";
|
|
7
|
+
interface BannerSubstyle1Props extends BannerSubstyleProps {
|
|
8
|
+
ImageComponent: React.ComponentType<ImageProps>;
|
|
9
|
+
}
|
|
10
|
+
export declare const BannerSubstyle1: React.FC<BannerSubstyle1Props>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=BannerSubstyle1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerSubstyle1.d.ts","sourceRoot":"","sources":["../../../../src/components/Style2/substyles/BannerSubstyle1.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtE,UAAU,oBAAqB,SAAQ,mBAAmB;IACxD,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;CACjD;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAkF1D,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BannerSubstyle1 for Style2 - Platform-agnostic version
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
"use client";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createAbstractShadowStyle } from "../../../styles/shadowUtils";
|
|
8
|
+
export const BannerSubstyle1 = ({ copy1, copy2, fontSize_01, fontSize_02, logoUrl, backgroundImageUrl, ImageComponent, }) => {
|
|
9
|
+
const shadowStyle01 = createAbstractShadowStyle({
|
|
10
|
+
direction: "bottom",
|
|
11
|
+
size: `70%`,
|
|
12
|
+
intensity: 0.8,
|
|
13
|
+
});
|
|
14
|
+
const shadowStyle02 = createAbstractShadowStyle({
|
|
15
|
+
direction: "top",
|
|
16
|
+
size: `45%`,
|
|
17
|
+
intensity: 0.8,
|
|
18
|
+
});
|
|
19
|
+
return (_jsxs("div", { className: "inset-0 flex flex-col items-center justify-between h-full text-center isolate overflow-hidden pt-8 px-20 pb-24 relative bg-neutral-900", children: [backgroundImageUrl && (_jsx(ImageComponent, { src: backgroundImageUrl, alt: "Background image", width: 1080, height: 1350, className: "object-cover absolute inset-0 w-full h-full -z-10 opacity-65 blur-[2px]", style: { objectFit: 'cover' } })), _jsx("div", { className: "relative z-20 flex-shrink-0", children: _jsx("div", { className: "relative w-64 h-64 mx-auto", children: logoUrl && (_jsx(ImageComponent, { src: logoUrl, alt: "Business logo", width: 256, height: 256, className: "object-contain absolute inset-0 w-full h-full", style: { objectFit: 'contain' } })) }) }), _jsx("div", { style: shadowStyle01, className: "absolute z-10 bottom-0", "aria-hidden": "true" }), _jsx("div", { style: shadowStyle02, className: "absolute z-10", "aria-hidden": "true" }), _jsxs("div", { className: "w-full text-center relative z-20 flex-grow flex flex-col items-center justify-end gap-16", children: [_jsx("div", { className: "bg-white py-4 px-5 rounded-lg w-1/2 ml-auto shadow-lg rotate-3", children: _jsx("p", { style: {
|
|
20
|
+
fontSize: fontSize_02 ? `calc(${fontSize_02} * 0.5)` : "1rem",
|
|
21
|
+
fontFamily: "var(--font-lato), sans-serif",
|
|
22
|
+
}, className: "font-bold text-black leading-tight whitespace-pre-wrap text-center", children: copy2 }) }), _jsx("p", { style: {
|
|
23
|
+
fontSize: fontSize_01,
|
|
24
|
+
fontWeight: "900",
|
|
25
|
+
fontFamily: "var(--font-roboto), sans-serif",
|
|
26
|
+
}, className: "leading-none whitespace-pre-wrap text-white uppercase tracking-wider text-shadow-lg", children: copy1 })] })] }));
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BannerSubstyle2 for Style2 - Platform-agnostic version
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { BannerSubstyleProps, ImageProps } from "../../../types";
|
|
7
|
+
interface BannerSubstyle2Props extends BannerSubstyleProps {
|
|
8
|
+
ImageComponent: React.ComponentType<ImageProps>;
|
|
9
|
+
}
|
|
10
|
+
export declare const BannerSubstyle2: React.FC<BannerSubstyle2Props>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=BannerSubstyle2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerSubstyle2.d.ts","sourceRoot":"","sources":["../../../../src/components/Style2/substyles/BannerSubstyle2.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtE,UAAU,oBAAqB,SAAQ,mBAAmB;IACxD,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;CACjD;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+E1D,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BannerSubstyle2 for Style2 - Platform-agnostic version
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
"use client";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createAbstractShadowStyle } from "../../../styles/shadowUtils";
|
|
8
|
+
export const BannerSubstyle2 = ({ copy1, copy2, fontSize_01, fontSize_02, logoUrl, backgroundImageUrl, ImageComponent, }) => {
|
|
9
|
+
const shadowStyle01 = createAbstractShadowStyle({
|
|
10
|
+
direction: "bottom",
|
|
11
|
+
size: `70%`,
|
|
12
|
+
intensity: 0.8,
|
|
13
|
+
});
|
|
14
|
+
const shadowStyle02 = createAbstractShadowStyle({
|
|
15
|
+
direction: "top",
|
|
16
|
+
size: `40%`,
|
|
17
|
+
intensity: 0.8,
|
|
18
|
+
});
|
|
19
|
+
return (_jsxs("div", { className: "inset-0 flex flex-col justify-between h-full text-center isolate overflow-hidden pt-8 px-16 pb-24 relative bg-neutral-900", children: [backgroundImageUrl && (_jsx(ImageComponent, { src: backgroundImageUrl, alt: "Background image", width: 1080, height: 1350, className: "object-cover absolute inset-0 w-full h-full -z-10 opacity-65 blur-[2px]", style: { objectFit: 'cover' } })), _jsxs("div", { className: "relative z-20 flex-shrink-0 flex flex-col justify-between gap-8", children: [_jsx("div", { className: "relative w-64 h-64 mx-auto", children: logoUrl && (_jsx(ImageComponent, { src: logoUrl, alt: "Business logo", width: 256, height: 256, className: "object-contain absolute inset-0 w-full h-full", style: { objectFit: 'contain' } })) }), _jsx("div", { className: "bg-white py-6 px-4 rounded-lg w-1/2 mr-auto -rotate-3 shadow-lg", children: _jsx("p", { style: {
|
|
20
|
+
fontSize: fontSize_02 ? `calc(${fontSize_02} * 0.45)` : "1rem",
|
|
21
|
+
fontFamily: "var(--font-lato), sans-serif",
|
|
22
|
+
}, className: "font-bold text-black leading-tight whitespace-pre-wrap text-center", children: copy2 }) })] }), _jsx("div", { style: shadowStyle01, className: "absolute z-10 bottom-0", "aria-hidden": "true" }), _jsx("div", { style: shadowStyle02, className: "absolute z-10", "aria-hidden": "true" }), _jsx("p", { style: {
|
|
23
|
+
fontSize: fontSize_01,
|
|
24
|
+
fontWeight: "900",
|
|
25
|
+
fontFamily: "var(--font-roboto), sans-serif",
|
|
26
|
+
}, className: "leading-none whitespace-pre-wrap text-white uppercase tracking-wider text-shadow-lg text-right", children: copy1 })] }));
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BannerSubstyle3 for Style2 - Platform-agnostic version
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { BannerSubstyleProps, ImageProps } from "../../../types";
|
|
7
|
+
interface BannerSubstyle3Props extends BannerSubstyleProps {
|
|
8
|
+
ImageComponent: React.ComponentType<ImageProps>;
|
|
9
|
+
}
|
|
10
|
+
export declare const BannerSubstyle3: React.FC<BannerSubstyle3Props>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=BannerSubstyle3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerSubstyle3.d.ts","sourceRoot":"","sources":["../../../../src/components/Style2/substyles/BannerSubstyle3.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtE,UAAU,oBAAqB,SAAQ,mBAAmB;IACxD,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;CACjD;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+E1D,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BannerSubstyle3 for Style2 - Platform-agnostic version
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
"use client";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createAbstractShadowStyle } from "../../../styles/shadowUtils";
|
|
8
|
+
export const BannerSubstyle3 = ({ copy1, copy2, fontSize_01, fontSize_02, logoUrl, backgroundImageUrl, ImageComponent, }) => {
|
|
9
|
+
const shadowStyle01 = createAbstractShadowStyle({
|
|
10
|
+
direction: "bottom",
|
|
11
|
+
size: `70%`,
|
|
12
|
+
intensity: 0.8,
|
|
13
|
+
});
|
|
14
|
+
const shadowStyle02 = createAbstractShadowStyle({
|
|
15
|
+
direction: "top",
|
|
16
|
+
size: `40%`,
|
|
17
|
+
intensity: 0.8,
|
|
18
|
+
});
|
|
19
|
+
return (_jsxs("div", { className: "inset-0 flex flex-col justify-between h-full text-center isolate overflow-hidden pt-8 px-16 pb-24 relative bg-neutral-900", children: [backgroundImageUrl && (_jsx(ImageComponent, { src: backgroundImageUrl, alt: "Background image", width: 1080, height: 1350, className: "object-cover absolute inset-0 w-full h-full -z-10 opacity-65 blur-[2px]", style: { objectFit: 'cover' } })), _jsxs("div", { className: "relative z-20 flex-shrink-0 flex flex-col justify-between gap-8", children: [_jsx("div", { className: "relative w-64 h-64 mx-auto", children: logoUrl && (_jsx(ImageComponent, { src: logoUrl, alt: "Business logo", width: 256, height: 256, className: "object-contain absolute inset-0 w-full h-full", style: { objectFit: 'contain' } })) }), _jsx("div", { className: "bg-white py-6 px-4 rounded-lg w-1/2 ml-auto rotate-3 shadow-lg", children: _jsx("p", { style: {
|
|
20
|
+
fontSize: fontSize_02 ? `calc(${fontSize_02} * 0.45)` : "1rem",
|
|
21
|
+
fontFamily: "var(--font-lato), sans-serif",
|
|
22
|
+
}, className: "font-bold text-black leading-tight whitespace-pre-wrap text-center", children: copy2 }) })] }), _jsx("div", { style: shadowStyle01, className: "absolute z-10 bottom-0", "aria-hidden": "true" }), _jsx("div", { style: shadowStyle02, className: "absolute z-10", "aria-hidden": "true" }), _jsx("p", { style: {
|
|
23
|
+
fontSize: fontSize_01,
|
|
24
|
+
fontWeight: "900",
|
|
25
|
+
fontFamily: "var(--font-roboto), sans-serif",
|
|
26
|
+
}, className: "leading-none whitespace-pre-wrap text-white uppercase tracking-wider text-shadow-lg text-left", children: copy1 })] }));
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Style2/substyles/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Style-specific font configurations
|
|
3
|
+
* Based on banner style requirements from the original implementations
|
|
4
|
+
*/
|
|
5
|
+
import type { StyleFontConfig } from '../types';
|
|
6
|
+
export declare const STYLE_FONT_CONFIGS: Record<number, StyleFontConfig>;
|
|
7
|
+
export declare const DEFAULT_BANNER_WIDTH = 1080;
|
|
8
|
+
export declare const DEFAULT_BANNER_HEIGHT = 1350;
|
|
9
|
+
export declare const DEFAULT_STORY_WIDTH = 1080;
|
|
10
|
+
export declare const DEFAULT_STORY_HEIGHT = 1920;
|
|
11
|
+
//# sourceMappingURL=styleConfigs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleConfigs.d.ts","sourceRoot":"","sources":["../../src/constants/styleConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAa9D,CAAC;AAGF,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAG1C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,oBAAoB,OAAO,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Style-specific font configurations
|
|
3
|
+
* Based on banner style requirements from the original implementations
|
|
4
|
+
*/
|
|
5
|
+
export const STYLE_FONT_CONFIGS = {
|
|
6
|
+
1: {
|
|
7
|
+
baseSizeRem1: 2.5, // Base size for copy1 in rem
|
|
8
|
+
baseSizeRem2: 1.8, // Base size for copy2 in rem
|
|
9
|
+
maxLengthThreshold: 30,
|
|
10
|
+
reductionFactor: 0.05
|
|
11
|
+
},
|
|
12
|
+
2: {
|
|
13
|
+
baseSizeRem1: 2.2, // Base size for copy1 in rem
|
|
14
|
+
baseSizeRem2: 1.6, // Base size for copy2 in rem
|
|
15
|
+
maxLengthThreshold: 35,
|
|
16
|
+
reductionFactor: 0.04
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
// Default banner dimensions
|
|
20
|
+
export const DEFAULT_BANNER_WIDTH = 1080;
|
|
21
|
+
export const DEFAULT_BANNER_HEIGHT = 1350;
|
|
22
|
+
// Default story dimensions
|
|
23
|
+
export const DEFAULT_STORY_WIDTH = 1080;
|
|
24
|
+
export const DEFAULT_STORY_HEIGHT = 1920;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zuljaman/banner-components - Main package exports
|
|
3
|
+
*
|
|
4
|
+
* Platform-agnostic banner components for Next.js and AWS Lambda
|
|
5
|
+
* Based on consolidated implementation from Next.js app with enhanced features
|
|
6
|
+
*/
|
|
7
|
+
export * from './components';
|
|
8
|
+
export * from './adapters';
|
|
9
|
+
export * from './types';
|
|
10
|
+
export * from './utils';
|
|
11
|
+
export * from './styles';
|
|
12
|
+
export * from './constants';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,cAAc,CAAC;AAG7B,cAAc,YAAY,CAAC;AAG3B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,UAAU,CAAC;AAGzB,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zuljaman/banner-components - Main package exports
|
|
3
|
+
*
|
|
4
|
+
* Platform-agnostic banner components for Next.js and AWS Lambda
|
|
5
|
+
* Based on consolidated implementation from Next.js app with enhanced features
|
|
6
|
+
*/
|
|
7
|
+
// Core components
|
|
8
|
+
export * from './components';
|
|
9
|
+
// Platform adapters
|
|
10
|
+
export * from './adapters';
|
|
11
|
+
// Types and interfaces
|
|
12
|
+
export * from './types';
|
|
13
|
+
// Utilities
|
|
14
|
+
export * from './utils';
|
|
15
|
+
// Style utilities
|
|
16
|
+
export * from './styles';
|
|
17
|
+
// Constants and configurations
|
|
18
|
+
export * from './constants';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced shadow utilities for banner components
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
type ShadowDirection = "bottom" | "top" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
7
|
+
interface AbstractShadowOptions {
|
|
8
|
+
direction?: ShadowDirection;
|
|
9
|
+
size?: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
intensity?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates a style object for an abstract shadow element.
|
|
15
|
+
* This should be applied to a dedicated element (e.g., a div)
|
|
16
|
+
* positioned absolutely within a container. The container must
|
|
17
|
+
* have `position: 'relative'` and ideally `isolation: 'isolate'`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const createAbstractShadowStyle: ({ direction, size, color, intensity, }?: AbstractShadowOptions) => React.CSSProperties;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=shadowUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadowUtils.d.ts","sourceRoot":"","sources":["../../src/styles/shadowUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,KAAK,eAAe,GAChB,QAAQ,GACR,KAAK,GACL,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AAEnB,UAAU,qBAAqB;IAC7B,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GAAI,yCAKvC,qBAA0B,KAAG,KAAK,CAAC,aAgGrC,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced shadow utilities for banner components
|
|
3
|
+
* Extracted from Next.js app implementation
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates a style object for an abstract shadow element.
|
|
7
|
+
* This should be applied to a dedicated element (e.g., a div)
|
|
8
|
+
* positioned absolutely within a container. The container must
|
|
9
|
+
* have `position: 'relative'` and ideally `isolation: 'isolate'`.
|
|
10
|
+
*/
|
|
11
|
+
export const createAbstractShadowStyle = ({ direction = "bottom", size = "60%", // Default size for height/width/corner extent
|
|
12
|
+
color = "0, 0, 0", // Default black
|
|
13
|
+
intensity = 0.6, // Default 60% opacity at the edge
|
|
14
|
+
} = {}) => {
|
|
15
|
+
const safeIntensity = Math.max(0, Math.min(1, intensity));
|
|
16
|
+
const rgbaColor = `rgba(${color}, ${safeIntensity})`;
|
|
17
|
+
const transparent = "transparent";
|
|
18
|
+
let style = {
|
|
19
|
+
position: "absolute",
|
|
20
|
+
zIndex: -1,
|
|
21
|
+
pointerEvents: "none",
|
|
22
|
+
};
|
|
23
|
+
switch (direction) {
|
|
24
|
+
case "top":
|
|
25
|
+
style = {
|
|
26
|
+
...style,
|
|
27
|
+
top: 0,
|
|
28
|
+
left: 0,
|
|
29
|
+
width: "100%",
|
|
30
|
+
height: size,
|
|
31
|
+
background: `linear-gradient(to bottom, ${rgbaColor}, ${transparent})`,
|
|
32
|
+
};
|
|
33
|
+
break;
|
|
34
|
+
case "left":
|
|
35
|
+
style = {
|
|
36
|
+
...style,
|
|
37
|
+
top: 0,
|
|
38
|
+
left: 0,
|
|
39
|
+
width: size,
|
|
40
|
+
height: "100%",
|
|
41
|
+
background: `linear-gradient(to right, ${rgbaColor}, ${transparent})`,
|
|
42
|
+
};
|
|
43
|
+
break;
|
|
44
|
+
case "right":
|
|
45
|
+
style = {
|
|
46
|
+
...style,
|
|
47
|
+
top: 0,
|
|
48
|
+
right: 0,
|
|
49
|
+
width: size,
|
|
50
|
+
height: "100%",
|
|
51
|
+
background: `linear-gradient(to left, ${rgbaColor}, ${transparent})`,
|
|
52
|
+
};
|
|
53
|
+
break;
|
|
54
|
+
case "top-left":
|
|
55
|
+
style = {
|
|
56
|
+
...style,
|
|
57
|
+
top: 0,
|
|
58
|
+
left: 0,
|
|
59
|
+
width: size, // Use size for corner dimensions
|
|
60
|
+
height: size,
|
|
61
|
+
background: `radial-gradient(circle at top left, ${rgbaColor}, ${transparent} 70.71%)`, // Fade out by sqrt(2)/2
|
|
62
|
+
};
|
|
63
|
+
break;
|
|
64
|
+
case "top-right":
|
|
65
|
+
style = {
|
|
66
|
+
...style,
|
|
67
|
+
top: 0,
|
|
68
|
+
right: 0,
|
|
69
|
+
width: size,
|
|
70
|
+
height: size,
|
|
71
|
+
background: `radial-gradient(circle at top right, ${rgbaColor}, ${transparent} 70.71%)`,
|
|
72
|
+
};
|
|
73
|
+
break;
|
|
74
|
+
case "bottom-left":
|
|
75
|
+
style = {
|
|
76
|
+
...style,
|
|
77
|
+
bottom: 0,
|
|
78
|
+
left: 0,
|
|
79
|
+
width: size,
|
|
80
|
+
height: size,
|
|
81
|
+
background: `radial-gradient(circle at bottom left, ${rgbaColor}, ${transparent} 70.71%)`,
|
|
82
|
+
};
|
|
83
|
+
break;
|
|
84
|
+
case "bottom-right":
|
|
85
|
+
style = {
|
|
86
|
+
...style,
|
|
87
|
+
bottom: 0,
|
|
88
|
+
right: 0,
|
|
89
|
+
width: size,
|
|
90
|
+
height: size,
|
|
91
|
+
background: `radial-gradient(circle at bottom right, ${rgbaColor}, ${transparent} 70.71%)`,
|
|
92
|
+
};
|
|
93
|
+
break;
|
|
94
|
+
case "bottom": // Default case
|
|
95
|
+
default:
|
|
96
|
+
style = {
|
|
97
|
+
...style,
|
|
98
|
+
bottom: 0,
|
|
99
|
+
left: 0,
|
|
100
|
+
width: "100%",
|
|
101
|
+
height: size,
|
|
102
|
+
background: `linear-gradient(to top, ${rgbaColor}, ${transparent})`,
|
|
103
|
+
};
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
return style;
|
|
107
|
+
};
|