@opensite/ui 0.1.2 → 0.1.4
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/components.cjs +1511 -3
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +13 -0
- package/dist/components.d.ts +13 -0
- package/dist/components.js +1499 -4
- package/dist/components.js.map +1 -1
- package/dist/footer-animated-social.cjs +272 -0
- package/dist/footer-animated-social.cjs.map +1 -0
- package/dist/footer-animated-social.d.cts +41 -0
- package/dist/footer-animated-social.d.ts +41 -0
- package/dist/footer-animated-social.js +250 -0
- package/dist/footer-animated-social.js.map +1 -0
- package/dist/footer-background-card.cjs +149 -0
- package/dist/footer-background-card.cjs.map +1 -0
- package/dist/footer-background-card.d.cts +74 -0
- package/dist/footer-background-card.d.ts +74 -0
- package/dist/footer-background-card.js +147 -0
- package/dist/footer-background-card.js.map +1 -0
- package/dist/footer-brand-description.cjs +244 -0
- package/dist/footer-brand-description.cjs.map +1 -0
- package/dist/footer-brand-description.d.cts +65 -0
- package/dist/footer-brand-description.d.ts +65 -0
- package/dist/footer-brand-description.js +222 -0
- package/dist/footer-brand-description.js.map +1 -0
- package/dist/footer-contact-card.cjs +238 -0
- package/dist/footer-contact-card.cjs.map +1 -0
- package/dist/footer-contact-card.d.cts +65 -0
- package/dist/footer-contact-card.d.ts +65 -0
- package/dist/footer-contact-card.js +216 -0
- package/dist/footer-contact-card.js.map +1 -0
- package/dist/footer-cta-banner.cjs +282 -0
- package/dist/footer-cta-banner.cjs.map +1 -0
- package/dist/footer-cta-banner.d.cts +77 -0
- package/dist/footer-cta-banner.d.ts +77 -0
- package/dist/footer-cta-banner.js +260 -0
- package/dist/footer-cta-banner.js.map +1 -0
- package/dist/footer-cta-social.cjs +221 -0
- package/dist/footer-cta-social.cjs.map +1 -0
- package/dist/footer-cta-social.d.cts +45 -0
- package/dist/footer-cta-social.d.ts +45 -0
- package/dist/footer-cta-social.js +199 -0
- package/dist/footer-cta-social.js.map +1 -0
- package/dist/footer-links-grid.cjs +119 -0
- package/dist/footer-links-grid.cjs.map +1 -0
- package/dist/footer-links-grid.d.cts +54 -0
- package/dist/footer-links-grid.d.ts +54 -0
- package/dist/footer-links-grid.js +117 -0
- package/dist/footer-links-grid.js.map +1 -0
- package/dist/footer-nav-social.cjs +273 -0
- package/dist/footer-nav-social.cjs.map +1 -0
- package/dist/footer-nav-social.d.cts +72 -0
- package/dist/footer-nav-social.d.ts +72 -0
- package/dist/footer-nav-social.js +251 -0
- package/dist/footer-nav-social.js.map +1 -0
- package/dist/footer-newsletter-grid.cjs +271 -0
- package/dist/footer-newsletter-grid.cjs.map +1 -0
- package/dist/footer-newsletter-grid.d.cts +74 -0
- package/dist/footer-newsletter-grid.d.ts +74 -0
- package/dist/footer-newsletter-grid.js +249 -0
- package/dist/footer-newsletter-grid.js.map +1 -0
- package/dist/footer-newsletter-minimal.cjs +271 -0
- package/dist/footer-newsletter-minimal.cjs.map +1 -0
- package/dist/footer-newsletter-minimal.d.cts +57 -0
- package/dist/footer-newsletter-minimal.d.ts +57 -0
- package/dist/footer-newsletter-minimal.js +249 -0
- package/dist/footer-newsletter-minimal.js.map +1 -0
- package/dist/footer-simple-centered.cjs +101 -0
- package/dist/footer-simple-centered.cjs.map +1 -0
- package/dist/footer-simple-centered.d.cts +52 -0
- package/dist/footer-simple-centered.d.ts +52 -0
- package/dist/footer-simple-centered.js +99 -0
- package/dist/footer-simple-centered.js.map +1 -0
- package/dist/footer-social-apps.cjs +247 -0
- package/dist/footer-social-apps.cjs.map +1 -0
- package/dist/footer-social-apps.d.cts +75 -0
- package/dist/footer-social-apps.d.ts +75 -0
- package/dist/footer-social-apps.js +225 -0
- package/dist/footer-social-apps.js.map +1 -0
- package/dist/footer-social-newsletter.cjs +267 -0
- package/dist/footer-social-newsletter.cjs.map +1 -0
- package/dist/footer-social-newsletter.d.cts +68 -0
- package/dist/footer-social-newsletter.d.ts +68 -0
- package/dist/footer-social-newsletter.js +245 -0
- package/dist/footer-social-newsletter.js.map +1 -0
- package/dist/index.cjs +1511 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +1499 -4
- package/dist/index.js.map +1 -1
- package/dist/pressable.cjs +10 -3
- package/dist/pressable.cjs.map +1 -1
- package/dist/pressable.js +10 -3
- package/dist/pressable.js.map +1 -1
- package/dist/registry.cjs +1971 -1
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +1971 -1
- package/dist/registry.js.map +1 -1
- package/dist/team-media-showcase.cjs +182 -0
- package/dist/team-media-showcase.cjs.map +1 -0
- package/dist/team-media-showcase.d.cts +145 -0
- package/dist/team-media-showcase.d.ts +145 -0
- package/dist/team-media-showcase.js +160 -0
- package/dist/team-media-showcase.js.map +1 -0
- package/package.json +71 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Social link configuration
|
|
5
|
+
*/
|
|
6
|
+
interface FooterSocialNewsletterSocialLink {
|
|
7
|
+
/** Icon name in format: prefix/name (e.g., "simple-icons/discord") */
|
|
8
|
+
icon: string;
|
|
9
|
+
/** Link URL */
|
|
10
|
+
href: string;
|
|
11
|
+
/** Accessible label */
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Navigation section configuration
|
|
16
|
+
*/
|
|
17
|
+
interface FooterSocialNewsletterSection {
|
|
18
|
+
title: string;
|
|
19
|
+
links: {
|
|
20
|
+
name: string;
|
|
21
|
+
href: string;
|
|
22
|
+
}[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Props for the FooterSocialNewsletter component
|
|
26
|
+
*/
|
|
27
|
+
interface FooterSocialNewsletterProps {
|
|
28
|
+
/** Logo configuration */
|
|
29
|
+
logo?: {
|
|
30
|
+
url: string;
|
|
31
|
+
src: string;
|
|
32
|
+
alt: string;
|
|
33
|
+
title: string;
|
|
34
|
+
};
|
|
35
|
+
/** Additional CSS classes */
|
|
36
|
+
className?: string;
|
|
37
|
+
/** Navigation sections */
|
|
38
|
+
sections?: FooterSocialNewsletterSection[];
|
|
39
|
+
/** Social media links */
|
|
40
|
+
socialLinks?: FooterSocialNewsletterSocialLink[];
|
|
41
|
+
/** Newsletter label text */
|
|
42
|
+
newsletterLabel?: string;
|
|
43
|
+
/** Newsletter placeholder text */
|
|
44
|
+
newsletterPlaceholder?: string;
|
|
45
|
+
/** Newsletter button text */
|
|
46
|
+
newsletterButtonText?: string;
|
|
47
|
+
/** Privacy policy link text */
|
|
48
|
+
privacyLinkText?: string;
|
|
49
|
+
/** Privacy policy URL */
|
|
50
|
+
privacyLinkUrl?: string;
|
|
51
|
+
/** Copyright text */
|
|
52
|
+
copyright?: string;
|
|
53
|
+
/** Optional Optix Flow configuration for @page-speed/img */
|
|
54
|
+
optixFlowConfig?: {
|
|
55
|
+
apiKey: string;
|
|
56
|
+
compression?: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* FooterSocialNewsletter - A footer with social icons, navigation links, and newsletter signup.
|
|
61
|
+
*
|
|
62
|
+
* Features prominent social media icons in circular buttons, multi-column navigation,
|
|
63
|
+
* and an email newsletter subscription form. Ideal for community-focused products,
|
|
64
|
+
* SaaS platforms, and businesses that prioritize social engagement and email marketing.
|
|
65
|
+
*/
|
|
66
|
+
declare function FooterSocialNewsletter({ logo, className, sections, socialLinks, newsletterLabel, newsletterPlaceholder, newsletterButtonText, privacyLinkText, privacyLinkUrl, copyright, optixFlowConfig, }: FooterSocialNewsletterProps): React.JSX.Element;
|
|
67
|
+
|
|
68
|
+
export { FooterSocialNewsletter, type FooterSocialNewsletterProps, type FooterSocialNewsletterSection, type FooterSocialNewsletterSocialLink };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Social link configuration
|
|
5
|
+
*/
|
|
6
|
+
interface FooterSocialNewsletterSocialLink {
|
|
7
|
+
/** Icon name in format: prefix/name (e.g., "simple-icons/discord") */
|
|
8
|
+
icon: string;
|
|
9
|
+
/** Link URL */
|
|
10
|
+
href: string;
|
|
11
|
+
/** Accessible label */
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Navigation section configuration
|
|
16
|
+
*/
|
|
17
|
+
interface FooterSocialNewsletterSection {
|
|
18
|
+
title: string;
|
|
19
|
+
links: {
|
|
20
|
+
name: string;
|
|
21
|
+
href: string;
|
|
22
|
+
}[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Props for the FooterSocialNewsletter component
|
|
26
|
+
*/
|
|
27
|
+
interface FooterSocialNewsletterProps {
|
|
28
|
+
/** Logo configuration */
|
|
29
|
+
logo?: {
|
|
30
|
+
url: string;
|
|
31
|
+
src: string;
|
|
32
|
+
alt: string;
|
|
33
|
+
title: string;
|
|
34
|
+
};
|
|
35
|
+
/** Additional CSS classes */
|
|
36
|
+
className?: string;
|
|
37
|
+
/** Navigation sections */
|
|
38
|
+
sections?: FooterSocialNewsletterSection[];
|
|
39
|
+
/** Social media links */
|
|
40
|
+
socialLinks?: FooterSocialNewsletterSocialLink[];
|
|
41
|
+
/** Newsletter label text */
|
|
42
|
+
newsletterLabel?: string;
|
|
43
|
+
/** Newsletter placeholder text */
|
|
44
|
+
newsletterPlaceholder?: string;
|
|
45
|
+
/** Newsletter button text */
|
|
46
|
+
newsletterButtonText?: string;
|
|
47
|
+
/** Privacy policy link text */
|
|
48
|
+
privacyLinkText?: string;
|
|
49
|
+
/** Privacy policy URL */
|
|
50
|
+
privacyLinkUrl?: string;
|
|
51
|
+
/** Copyright text */
|
|
52
|
+
copyright?: string;
|
|
53
|
+
/** Optional Optix Flow configuration for @page-speed/img */
|
|
54
|
+
optixFlowConfig?: {
|
|
55
|
+
apiKey: string;
|
|
56
|
+
compression?: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* FooterSocialNewsletter - A footer with social icons, navigation links, and newsletter signup.
|
|
61
|
+
*
|
|
62
|
+
* Features prominent social media icons in circular buttons, multi-column navigation,
|
|
63
|
+
* and an email newsletter subscription form. Ideal for community-focused products,
|
|
64
|
+
* SaaS platforms, and businesses that prioritize social engagement and email marketing.
|
|
65
|
+
*/
|
|
66
|
+
declare function FooterSocialNewsletter({ logo, className, sections, socialLinks, newsletterLabel, newsletterPlaceholder, newsletterButtonText, privacyLinkText, privacyLinkUrl, copyright, optixFlowConfig, }: FooterSocialNewsletterProps): React.JSX.Element;
|
|
67
|
+
|
|
68
|
+
export { FooterSocialNewsletter, type FooterSocialNewsletterProps, type FooterSocialNewsletterSection, type FooterSocialNewsletterSocialLink };
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { Img } from '@page-speed/img';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
// lib/utils.ts
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
var svgCache = /* @__PURE__ */ new Map();
|
|
13
|
+
function DynamicIcon({
|
|
14
|
+
name,
|
|
15
|
+
size = 28,
|
|
16
|
+
color,
|
|
17
|
+
className,
|
|
18
|
+
alt
|
|
19
|
+
}) {
|
|
20
|
+
const [svgContent, setSvgContent] = React.useState(null);
|
|
21
|
+
const [isLoading, setIsLoading] = React.useState(true);
|
|
22
|
+
const [error, setError] = React.useState(null);
|
|
23
|
+
const { url, iconName } = React.useMemo(() => {
|
|
24
|
+
const separator = name.includes("/") ? "/" : ":";
|
|
25
|
+
const [prefix, iconName2] = name.split(separator);
|
|
26
|
+
const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
|
|
27
|
+
return {
|
|
28
|
+
url: baseUrl,
|
|
29
|
+
iconName: iconName2
|
|
30
|
+
};
|
|
31
|
+
}, [name, size]);
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
let isMounted = true;
|
|
34
|
+
const fetchSvg = async () => {
|
|
35
|
+
const cached = svgCache.get(url);
|
|
36
|
+
if (cached) {
|
|
37
|
+
if (isMounted) {
|
|
38
|
+
setSvgContent(cached);
|
|
39
|
+
setIsLoading(false);
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
setIsLoading(true);
|
|
45
|
+
setError(null);
|
|
46
|
+
const response = await fetch(url);
|
|
47
|
+
if (!response.ok) {
|
|
48
|
+
throw new Error(`Failed to fetch icon: ${response.status}`);
|
|
49
|
+
}
|
|
50
|
+
let svg = await response.text();
|
|
51
|
+
svg = processSvgForCurrentColor(svg);
|
|
52
|
+
svgCache.set(url, svg);
|
|
53
|
+
if (isMounted) {
|
|
54
|
+
setSvgContent(svg);
|
|
55
|
+
setIsLoading(false);
|
|
56
|
+
}
|
|
57
|
+
} catch (err) {
|
|
58
|
+
if (isMounted) {
|
|
59
|
+
setError(err instanceof Error ? err.message : "Failed to load icon");
|
|
60
|
+
setIsLoading(false);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
fetchSvg();
|
|
65
|
+
return () => {
|
|
66
|
+
isMounted = false;
|
|
67
|
+
};
|
|
68
|
+
}, [url]);
|
|
69
|
+
if (isLoading) {
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
"span",
|
|
72
|
+
{
|
|
73
|
+
className: cn("inline-block", className),
|
|
74
|
+
style: { width: size, height: size },
|
|
75
|
+
"aria-hidden": "true"
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
if (error || !svgContent) {
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
"span",
|
|
82
|
+
{
|
|
83
|
+
className: cn("inline-block", className),
|
|
84
|
+
style: { width: size, height: size },
|
|
85
|
+
role: "img",
|
|
86
|
+
"aria-label": alt || iconName
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
91
|
+
"span",
|
|
92
|
+
{
|
|
93
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
94
|
+
style: {
|
|
95
|
+
width: size,
|
|
96
|
+
height: size,
|
|
97
|
+
color: color || "inherit"
|
|
98
|
+
},
|
|
99
|
+
role: "img",
|
|
100
|
+
"aria-label": alt || iconName,
|
|
101
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function processSvgForCurrentColor(svg) {
|
|
106
|
+
let processed = svg;
|
|
107
|
+
processed = processed.replace(
|
|
108
|
+
/stroke=["'](#000000|#000|black)["']/gi,
|
|
109
|
+
'stroke="currentColor"'
|
|
110
|
+
);
|
|
111
|
+
processed = processed.replace(
|
|
112
|
+
/fill=["'](#000000|#000|black)["']/gi,
|
|
113
|
+
'fill="currentColor"'
|
|
114
|
+
);
|
|
115
|
+
return processed;
|
|
116
|
+
}
|
|
117
|
+
var defaultSections = [
|
|
118
|
+
{
|
|
119
|
+
title: "Product",
|
|
120
|
+
links: [
|
|
121
|
+
{ name: "Overview", href: "#" },
|
|
122
|
+
{ name: "Pricing", href: "#" },
|
|
123
|
+
{ name: "Marketplace", href: "#" },
|
|
124
|
+
{ name: "Features", href: "#" },
|
|
125
|
+
{ name: "Integrations", href: "#" }
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
title: "Company",
|
|
130
|
+
links: [
|
|
131
|
+
{ name: "About", href: "#" },
|
|
132
|
+
{ name: "Team", href: "#" },
|
|
133
|
+
{ name: "Blog", href: "#" },
|
|
134
|
+
{ name: "Careers", href: "#" },
|
|
135
|
+
{ name: "Contact", href: "#" }
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
title: "Resources",
|
|
140
|
+
links: [
|
|
141
|
+
{ name: "Help", href: "#" },
|
|
142
|
+
{ name: "Sales", href: "#" },
|
|
143
|
+
{ name: "Advertise", href: "#" }
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
];
|
|
147
|
+
var defaultSocialLinks = [
|
|
148
|
+
{ icon: "simple-icons/discord", href: "#", label: "Discord" },
|
|
149
|
+
{ icon: "simple-icons/reddit", href: "#", label: "Reddit" },
|
|
150
|
+
{ icon: "simple-icons/x", href: "#", label: "X (Twitter)" },
|
|
151
|
+
{ icon: "simple-icons/telegram", href: "#", label: "Telegram" },
|
|
152
|
+
{ icon: "simple-icons/linkedin", href: "#", label: "LinkedIn" }
|
|
153
|
+
];
|
|
154
|
+
function FooterSocialNewsletter({
|
|
155
|
+
logo = {
|
|
156
|
+
url: "https://opensite.ai",
|
|
157
|
+
src: "https://cdn.ing/assets/i/r/285975/eud79qeya11q5w6ueyhklueardyx/os-suircle-black-white.png",
|
|
158
|
+
alt: "Opensite AI",
|
|
159
|
+
title: "Opensite AI"
|
|
160
|
+
},
|
|
161
|
+
className,
|
|
162
|
+
sections = defaultSections,
|
|
163
|
+
socialLinks = defaultSocialLinks,
|
|
164
|
+
newsletterLabel = "Subscribe to our newsletter",
|
|
165
|
+
newsletterPlaceholder = "Email",
|
|
166
|
+
newsletterButtonText = "Subscribe",
|
|
167
|
+
privacyLinkText = "Privacy Policy",
|
|
168
|
+
privacyLinkUrl = "#",
|
|
169
|
+
copyright = `\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} Opensite AI. All rights reserved.`,
|
|
170
|
+
optixFlowConfig
|
|
171
|
+
}) {
|
|
172
|
+
return /* @__PURE__ */ jsx("section", { className: cn("py-32", className), children: /* @__PURE__ */ jsx("div", { className: "container", children: /* @__PURE__ */ jsxs("footer", { children: [
|
|
173
|
+
/* @__PURE__ */ jsxs("a", { href: logo.url, className: "flex items-center gap-2", children: [
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
Img,
|
|
176
|
+
{
|
|
177
|
+
src: logo.src,
|
|
178
|
+
alt: logo.alt,
|
|
179
|
+
className: "h-10",
|
|
180
|
+
optixFlowConfig
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ jsx("span", { className: "text-xl font-semibold", children: logo.title })
|
|
184
|
+
] }),
|
|
185
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-14 grid gap-8 md:grid-cols-2 lg:grid-cols-5 xl:grid-cols-4", children: [
|
|
186
|
+
sections.map((section, sectionIdx) => /* @__PURE__ */ jsxs("div", { children: [
|
|
187
|
+
/* @__PURE__ */ jsx("h3", { className: "mb-4 font-bold", children: section.title }),
|
|
188
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-4 text-muted-foreground", children: section.links.map((link, linkIdx) => /* @__PURE__ */ jsx(
|
|
189
|
+
"li",
|
|
190
|
+
{
|
|
191
|
+
className: "font-medium hover:text-primary",
|
|
192
|
+
children: /* @__PURE__ */ jsx("a", { href: link.href, children: link.name })
|
|
193
|
+
},
|
|
194
|
+
linkIdx
|
|
195
|
+
)) })
|
|
196
|
+
] }, sectionIdx)),
|
|
197
|
+
/* @__PURE__ */ jsxs("div", { className: "lg:col-span-2 xl:col-span-1", children: [
|
|
198
|
+
/* @__PURE__ */ jsx("ul", { className: "mb-10 flex items-center gap-2 text-muted-foreground", children: socialLinks.map((social, idx) => /* @__PURE__ */ jsx("li", { className: "font-medium", children: /* @__PURE__ */ jsx("a", { href: social.href, "aria-label": social.label, children: /* @__PURE__ */ jsx("span", { className: "flex size-12 items-center justify-center rounded-full bg-muted transition-colors hover:text-primary", children: /* @__PURE__ */ jsx(DynamicIcon, { name: social.icon, size: 24 }) }) }) }, idx)) }),
|
|
199
|
+
/* @__PURE__ */ jsxs("div", { className: "grid w-full max-w-sm items-center gap-1.5", children: [
|
|
200
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "newsletter-email", className: "text-sm font-medium", children: newsletterLabel }),
|
|
201
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-sm items-center space-x-2", children: [
|
|
202
|
+
/* @__PURE__ */ jsx(
|
|
203
|
+
"input",
|
|
204
|
+
{
|
|
205
|
+
type: "email",
|
|
206
|
+
id: "newsletter-email",
|
|
207
|
+
placeholder: newsletterPlaceholder,
|
|
208
|
+
className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ jsx(
|
|
212
|
+
"button",
|
|
213
|
+
{
|
|
214
|
+
type: "submit",
|
|
215
|
+
className: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2",
|
|
216
|
+
children: newsletterButtonText
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
] }),
|
|
220
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
221
|
+
"By submitting, you agree to our",
|
|
222
|
+
/* @__PURE__ */ jsx("a", { href: privacyLinkUrl, className: "ml-1 text-primary hover:underline", children: privacyLinkText })
|
|
223
|
+
] })
|
|
224
|
+
] })
|
|
225
|
+
] })
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ jsx("div", { className: "mt-20 flex flex-col justify-between gap-4 border-t pt-8 text-sm font-medium text-muted-foreground md:flex-row md:items-center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 md:flex-row md:items-center md:gap-4", children: [
|
|
228
|
+
/* @__PURE__ */ jsx("p", { children: copyright }),
|
|
229
|
+
/* @__PURE__ */ jsx(
|
|
230
|
+
"a",
|
|
231
|
+
{
|
|
232
|
+
href: "https://opensite.ai",
|
|
233
|
+
className: "hover:text-primary",
|
|
234
|
+
target: "_blank",
|
|
235
|
+
rel: "noopener noreferrer",
|
|
236
|
+
children: "AI Website and Automation Platform by Opensite"
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
] }) })
|
|
240
|
+
] }) }) });
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export { FooterSocialNewsletter };
|
|
244
|
+
//# sourceMappingURL=footer-social-newsletter.js.map
|
|
245
|
+
//# sourceMappingURL=footer-social-newsletter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/utils.ts","../components/ui/dynamic-icon.tsx","../components/blocks/footers/footer-social-newsletter.tsx"],"names":["iconName","jsx"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;AC4BA,IAAM,QAAA,uBAAe,GAAA,EAAoB;AAuBlC,SAAS,WAAA,CAAY;AAAA,EAC1B,IAAA;AAAA,EACA,IAAA,GAAO,EAAA;AAAA,EACP,KAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,EAAqB;AACnB,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAU,eAAwB,IAAI,CAAA;AACtE,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAU,eAAS,IAAI,CAAA;AACrD,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAU,eAAwB,IAAI,CAAA;AAE5D,EAAA,MAAM,EAAE,GAAA,EAAK,QAAA,EAAS,GAAU,c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AA,4BACAA,GAAAA;AAAA,cAAC,QAAA;AAAA,cAAA;AAAA,gBACC,IAAA,EAAK,QAAA;AAAA,gBACL,SAAA,EAAU,8VAAA;AAAA,gBAET,QAAA,EAAA;AAAA;AAAA;AACH,WAAA,EACF,CAAA;AAAA,0BACA,IAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,oCAAA,EAAqC,QAAA,EAAA;AAAA,YAAA,iCAAA;AAAA,4BAEhDA,GAAAA,CAAC,GAAA,EAAA,EAAE,MAAM,cAAA,EAAgB,SAAA,EAAU,qCAChC,QAAA,EAAA,eAAA,EACH;AAAA,WAAA,EACF;AAAA,SAAA,EACF;AAAA,OAAA,EACF;AAAA,KAAA,EACF,CAAA;AAAA,oBACAA,IAAC,KAAA,EAAA,EAAI,SAAA,EAAU,iIACb,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAU,0DAAA,EACb,QAAA,EAAA;AAAA,sBAAAA,GAAAA,CAAC,OAAG,QAAA,EAAA,SAAA,EAAU,CAAA;AAAA,sBACdA,GAAAA;AAAA,QAAC,GAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,qBAAA;AAAA,UACL,SAAA,EAAU,oBAAA;AAAA,UACV,MAAA,EAAO,QAAA;AAAA,UACP,GAAA,EAAI,qBAAA;AAAA,UACL,QAAA,EAAA;AAAA;AAAA;AAED,KAAA,EACF,CAAA,EACF;AAAA,GAAA,EACF,GACF,CAAA,EACF,CAAA;AAEJ","file":"footer-social-newsletter.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\ninterface DynamicIconProps {\n /**\n * Icon name in format: prefix/name or prefix:name\n * Examples: \"lucide/home\", \"mdi:account\", \"heroicons/check\"\n */\n name: string;\n /**\n * Icon size in pixels\n * @default 28\n */\n size?: number;\n /**\n * Icon color - accepts any valid CSS color\n * Note: When not specified, the icon inherits color from parent via CSS currentColor\n */\n color?: string;\n /**\n * Additional CSS classes\n */\n className?: string;\n /**\n * Alt text for accessibility\n */\n alt?: string;\n}\n\n// Simple in-memory cache for fetched SVGs\nconst svgCache = new Map<string, string>();\n\n/**\n * Lightweight icon component that dynamically loads SVG icons from icons.opensite.ai API.\n *\n * Features:\n * - Pulls SVGs from https://icons.opensite.ai API and inlines them for CSS color inheritance\n * - Supports currentColor - icons inherit color from parent element\n * - Accepts prefix/name or prefix:name format\n * - Customizable size and explicit color via props\n * - In-memory caching to prevent duplicate fetches\n *\n * @example\n * ```tsx\n * // Icon inherits color from parent (recommended for hover states, etc.)\n * <span className=\"text-white hover:text-red-500\">\n * <DynamicIcon name=\"lucide/home\" size={24} />\n * </span>\n *\n * // Icon with explicit color\n * <DynamicIcon name=\"mdi:account\" size={32} color=\"#ff0000\" />\n * ```\n */\nexport function DynamicIcon({\n name,\n size = 28,\n color,\n className,\n alt,\n}: DynamicIconProps) {\n const [svgContent, setSvgContent] = React.useState<string | null>(null);\n const [isLoading, setIsLoading] = React.useState(true);\n const [error, setError] = React.useState<string | null>(null);\n\n const { url, iconName } = React.useMemo(() => {\n const separator = name.includes(\"/\") ? \"/\" : \":\";\n const [prefix, iconName] = name.split(separator);\n // Don't pass color to API - we'll handle it via CSS\n const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName}?format=svg&width=${size}&height=${size}`;\n\n return {\n url: baseUrl,\n iconName,\n };\n }, [name, size]);\n\n React.useEffect(() => {\n let isMounted = true;\n\n const fetchSvg = async () => {\n // Check cache first\n const cached = svgCache.get(url);\n if (cached) {\n if (isMounted) {\n setSvgContent(cached);\n setIsLoading(false);\n }\n return;\n }\n\n try {\n setIsLoading(true);\n setError(null);\n\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Failed to fetch icon: ${response.status}`);\n }\n\n let svg = await response.text();\n\n // Process SVG to ensure currentColor works:\n // 1. Replace any hardcoded colors with currentColor\n // 2. Ensure stroke/fill use currentColor where appropriate\n svg = processSvgForCurrentColor(svg);\n\n // Cache the processed SVG\n svgCache.set(url, svg);\n\n if (isMounted) {\n setSvgContent(svg);\n setIsLoading(false);\n }\n } catch (err) {\n if (isMounted) {\n setError(err instanceof Error ? err.message : \"Failed to load icon\");\n setIsLoading(false);\n }\n }\n };\n\n fetchSvg();\n\n return () => {\n isMounted = false;\n };\n }, [url]);\n\n // Loading state - show placeholder with same dimensions\n if (isLoading) {\n return (\n <span\n className={cn(\"inline-block\", className)}\n style={{ width: size, height: size }}\n aria-hidden=\"true\"\n />\n );\n }\n\n // Error state - show nothing or fallback\n if (error || !svgContent) {\n return (\n <span\n className={cn(\"inline-block\", className)}\n style={{ width: size, height: size }}\n role=\"img\"\n aria-label={alt || iconName}\n />\n );\n }\n\n // Render inline SVG\n // The color prop applies an explicit color, otherwise inherits from parent via currentColor\n return (\n <span\n className={cn(\"inline-flex items-center justify-center\", className)}\n style={{\n width: size,\n height: size,\n color: color || \"inherit\",\n }}\n role=\"img\"\n aria-label={alt || iconName}\n dangerouslySetInnerHTML={{ __html: svgContent }}\n />\n );\n}\n\n/**\n * Process SVG to ensure it uses currentColor for proper CSS inheritance.\n * This handles various icon libraries that may use different color approaches.\n */\nfunction processSvgForCurrentColor(svg: string): string {\n // Replace stroke=\"currentColor\" is already correct, but ensure fill also works\n // Some icons use fill=\"none\" with stroke, others use fill with no stroke\n\n // Ensure the SVG doesn't have hardcoded colors that should be currentColor\n // Common patterns to replace:\n // - stroke=\"#000\" or stroke=\"#000000\" or stroke=\"black\" -> stroke=\"currentColor\"\n // - fill=\"#000\" or fill=\"#000000\" or fill=\"black\" -> fill=\"currentColor\"\n\n let processed = svg;\n\n // Replace common black color values with currentColor for stroke\n processed = processed.replace(\n /stroke=[\"'](#000000|#000|black)[\"']/gi,\n 'stroke=\"currentColor\"'\n );\n\n // Replace common black color values with currentColor for fill\n // But be careful not to replace fill=\"none\"\n processed = processed.replace(\n /fill=[\"'](#000000|#000|black)[\"']/gi,\n 'fill=\"currentColor\"'\n );\n\n return processed;\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../../lib/utils\";\nimport { Img } from \"@page-speed/img\";\nimport { DynamicIcon } from \"../../ui/dynamic-icon\";\n\n/**\n * Social link configuration\n */\nexport interface FooterSocialNewsletterSocialLink {\n /** Icon name in format: prefix/name (e.g., \"simple-icons/discord\") */\n icon: string;\n /** Link URL */\n href: string;\n /** Accessible label */\n label: string;\n}\n\n/**\n * Navigation section configuration\n */\nexport interface FooterSocialNewsletterSection {\n title: string;\n links: {\n name: string;\n href: string;\n }[];\n}\n\n/**\n * Props for the FooterSocialNewsletter component\n */\nexport interface FooterSocialNewsletterProps {\n /** Logo configuration */\n logo?: {\n url: string;\n src: string;\n alt: string;\n title: string;\n };\n /** Additional CSS classes */\n className?: string;\n /** Navigation sections */\n sections?: FooterSocialNewsletterSection[];\n /** Social media links */\n socialLinks?: FooterSocialNewsletterSocialLink[];\n /** Newsletter label text */\n newsletterLabel?: string;\n /** Newsletter placeholder text */\n newsletterPlaceholder?: string;\n /** Newsletter button text */\n newsletterButtonText?: string;\n /** Privacy policy link text */\n privacyLinkText?: string;\n /** Privacy policy URL */\n privacyLinkUrl?: string;\n /** Copyright text */\n copyright?: string;\n /** Optional Optix Flow configuration for @page-speed/img */\n optixFlowConfig?: {\n apiKey: string;\n compression?: number;\n };\n}\n\nconst defaultSections: FooterSocialNewsletterSection[] = [\n {\n title: \"Product\",\n links: [\n { name: \"Overview\", href: \"#\" },\n { name: \"Pricing\", href: \"#\" },\n { name: \"Marketplace\", href: \"#\" },\n { name: \"Features\", href: \"#\" },\n { name: \"Integrations\", href: \"#\" },\n ],\n },\n {\n title: \"Company\",\n links: [\n { name: \"About\", href: \"#\" },\n { name: \"Team\", href: \"#\" },\n { name: \"Blog\", href: \"#\" },\n { name: \"Careers\", href: \"#\" },\n { name: \"Contact\", href: \"#\" },\n ],\n },\n {\n title: \"Resources\",\n links: [\n { name: \"Help\", href: \"#\" },\n { name: \"Sales\", href: \"#\" },\n { name: \"Advertise\", href: \"#\" },\n ],\n },\n];\n\nconst defaultSocialLinks: FooterSocialNewsletterSocialLink[] = [\n { icon: \"simple-icons/discord\", href: \"#\", label: \"Discord\" },\n { icon: \"simple-icons/reddit\", href: \"#\", label: \"Reddit\" },\n { icon: \"simple-icons/x\", href: \"#\", label: \"X (Twitter)\" },\n { icon: \"simple-icons/telegram\", href: \"#\", label: \"Telegram\" },\n { icon: \"simple-icons/linkedin\", href: \"#\", label: \"LinkedIn\" },\n];\n\n/**\n * FooterSocialNewsletter - A footer with social icons, navigation links, and newsletter signup.\n *\n * Features prominent social media icons in circular buttons, multi-column navigation,\n * and an email newsletter subscription form. Ideal for community-focused products,\n * SaaS platforms, and businesses that prioritize social engagement and email marketing.\n */\nexport function FooterSocialNewsletter({\n logo = {\n url: \"https://opensite.ai\",\n src: \"https://cdn.ing/assets/i/r/285975/eud79qeya11q5w6ueyhklueardyx/os-suircle-black-white.png\",\n alt: \"Opensite AI\",\n title: \"Opensite AI\",\n },\n className,\n sections = defaultSections,\n socialLinks = defaultSocialLinks,\n newsletterLabel = \"Subscribe to our newsletter\",\n newsletterPlaceholder = \"Email\",\n newsletterButtonText = \"Subscribe\",\n privacyLinkText = \"Privacy Policy\",\n privacyLinkUrl = \"#\",\n copyright = `© ${new Date().getFullYear()} Opensite AI. All rights reserved.`,\n optixFlowConfig,\n}: FooterSocialNewsletterProps): React.JSX.Element {\n return (\n <section className={cn(\"py-32\", className)}>\n <div className=\"container\">\n <footer>\n <a href={logo.url} className=\"flex items-center gap-2\">\n <Img\n src={logo.src}\n alt={logo.alt}\n className=\"h-10\"\n optixFlowConfig={optixFlowConfig}\n />\n <span className=\"text-xl font-semibold\">{logo.title}</span>\n </a>\n <div className=\"mt-14 grid gap-8 md:grid-cols-2 lg:grid-cols-5 xl:grid-cols-4\">\n {sections.map((section, sectionIdx) => (\n <div key={sectionIdx}>\n <h3 className=\"mb-4 font-bold\">{section.title}</h3>\n <ul className=\"space-y-4 text-muted-foreground\">\n {section.links.map((link, linkIdx) => (\n <li\n key={linkIdx}\n className=\"font-medium hover:text-primary\"\n >\n <a href={link.href}>{link.name}</a>\n </li>\n ))}\n </ul>\n </div>\n ))}\n <div className=\"lg:col-span-2 xl:col-span-1\">\n <ul className=\"mb-10 flex items-center gap-2 text-muted-foreground\">\n {socialLinks.map((social, idx) => (\n <li key={idx} className=\"font-medium\">\n <a href={social.href} aria-label={social.label}>\n <span className=\"flex size-12 items-center justify-center rounded-full bg-muted transition-colors hover:text-primary\">\n <DynamicIcon name={social.icon} size={24} />\n </span>\n </a>\n </li>\n ))}\n </ul>\n <div className=\"grid w-full max-w-sm items-center gap-1.5\">\n <label htmlFor=\"newsletter-email\" className=\"text-sm font-medium\">\n {newsletterLabel}\n </label>\n <div className=\"flex w-full max-w-sm items-center space-x-2\">\n <input\n type=\"email\"\n id=\"newsletter-email\"\n placeholder={newsletterPlaceholder}\n className=\"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\"\n />\n <button\n type=\"submit\"\n className=\"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2\"\n >\n {newsletterButtonText}\n </button>\n </div>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n By submitting, you agree to our\n <a href={privacyLinkUrl} className=\"ml-1 text-primary hover:underline\">\n {privacyLinkText}\n </a>\n </p>\n </div>\n </div>\n </div>\n <div className=\"mt-20 flex flex-col justify-between gap-4 border-t pt-8 text-sm font-medium text-muted-foreground md:flex-row md:items-center\">\n <div className=\"flex flex-col gap-2 md:flex-row md:items-center md:gap-4\">\n <p>{copyright}</p>\n <a\n href=\"https://opensite.ai\"\n className=\"hover:text-primary\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n AI Website and Automation Platform by Opensite\n </a>\n </div>\n </div>\n </footer>\n </div>\n </section>\n );\n}\n"]}
|