@opensite/ui 3.8.2 → 3.10.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/dist/instagram-post-grid.cjs +614 -0
- package/dist/instagram-post-grid.d.cts +174 -0
- package/dist/instagram-post-grid.d.ts +174 -0
- package/dist/instagram-post-grid.js +593 -0
- package/dist/registry.cjs +323 -2
- package/dist/registry.d.cts +11 -1
- package/dist/registry.d.ts +11 -1
- package/dist/registry.js +323 -2
- package/package.json +6 -1
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { useMemo } from 'react';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { Img } from '@page-speed/img';
|
|
7
|
+
import { Video } from '@page-speed/video';
|
|
8
|
+
import { Pressable } from '@page-speed/pressable';
|
|
9
|
+
import { Icon } from '@page-speed/icon';
|
|
10
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
// components/blocks/gallery/instagram-post-grid.tsx
|
|
13
|
+
function cn(...inputs) {
|
|
14
|
+
return twMerge(clsx(inputs));
|
|
15
|
+
}
|
|
16
|
+
var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
|
|
17
|
+
var DynamicIcon = React.memo(function DynamicIcon2({
|
|
18
|
+
apiKey,
|
|
19
|
+
name,
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
if (name == null) return null;
|
|
23
|
+
if (typeof name !== "string") {
|
|
24
|
+
return /* @__PURE__ */ jsx(Fragment, { children: name });
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx(Icon, { ...props, name, apiKey: apiKey ?? DEFAULT_ICON_API_KEY });
|
|
27
|
+
});
|
|
28
|
+
DynamicIcon.displayName = "DynamicIcon";
|
|
29
|
+
var maxWidthStyles = {
|
|
30
|
+
sm: "max-w-screen-sm",
|
|
31
|
+
md: "max-w-screen-md",
|
|
32
|
+
lg: "max-w-screen-lg",
|
|
33
|
+
xl: "max-w-7xl",
|
|
34
|
+
"2xl": "max-w-screen-2xl",
|
|
35
|
+
"4xl": "max-w-[1536px]",
|
|
36
|
+
full: "max-w-full"
|
|
37
|
+
};
|
|
38
|
+
var Container = React__default.forwardRef(
|
|
39
|
+
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
40
|
+
const Component = as;
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
Component,
|
|
43
|
+
{
|
|
44
|
+
ref,
|
|
45
|
+
className: cn(
|
|
46
|
+
"mx-auto w-full px-2 sm:px-4 lg:px-8",
|
|
47
|
+
maxWidthStyles[maxWidth],
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props,
|
|
51
|
+
children
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
Container.displayName = "Container";
|
|
57
|
+
|
|
58
|
+
// lib/patternSvgs.ts
|
|
59
|
+
var patternSvgs = {
|
|
60
|
+
squareAltGrid: "https://cdn.ing/assets/files/record/286187/4gpn0yq2ptra8iwlvmwwv860ggwv",
|
|
61
|
+
grid1: "https://cdn.ing/assets/files/record/286186/nbdflpgp4ostrno079hygibsflp3",
|
|
62
|
+
noise: "https://cdn.ing/assets/i/r/286188/zrqcp9hynh3j7p2laihwzfbujgrl/noise.png",
|
|
63
|
+
dots: "https://cdn.ing/assets/files/record/286198/yfsjx9thvtxzhl2qtshxyhkrm524",
|
|
64
|
+
dotPattern: "https://cdn.ing/assets/files/record/286192/7ig0cku8aqbboiza8nuk6hw0nnsr",
|
|
65
|
+
dotPattern2: "https://cdn.ing/assets/files/record/286189/arez6gd2s7isn9i1o6c7sexdq7bl",
|
|
66
|
+
circles: "https://cdn.ing/assets/files/record/286190/gtmia3sncjtzetdshc20zf1d3c17",
|
|
67
|
+
waves: "https://cdn.ing/assets/files/record/286191/mqlb33fzxz9cdth1bx7if0wmpkp1",
|
|
68
|
+
crossPattern: "https://cdn.ing/assets/files/record/286193/9yfqwdbnqaipbp7fsb3wbzzmq472",
|
|
69
|
+
architect: "https://cdn.ing/assets/files/record/286194/vgs88ugpvyhxu13wqgy0acvae6re",
|
|
70
|
+
tinyCheckers: "https://cdn.ing/assets/files/record/286195/65efaknsw8kcpf9o3c2gybytsl5b",
|
|
71
|
+
p6: "https://cdn.ing/assets/i/r/286196/6kl0rqnd6mjk8j7e525fo8fo0vkc/p6.webp"
|
|
72
|
+
};
|
|
73
|
+
var maskTop = "radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%)";
|
|
74
|
+
var maskBottom = "radial-gradient(ellipse 100% 80% at 50% 100%, #000 50%, transparent 90%)";
|
|
75
|
+
var maskCenter = "radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 70%)";
|
|
76
|
+
var maskTopLeft = "radial-gradient(ellipse 80% 80% at 0% 0%, #000 50%, transparent 90%)";
|
|
77
|
+
var maskTopRight = "radial-gradient(ellipse 80% 80% at 100% 0%, #000 50%, transparent 90%)";
|
|
78
|
+
var maskBottomLeft = "radial-gradient(ellipse 80% 80% at 0% 100%, #000 50%, transparent 90%)";
|
|
79
|
+
var maskBottomRight = "radial-gradient(ellipse 80% 80% at 100% 100%, #000 50%, transparent 90%)";
|
|
80
|
+
var circuitBoardPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
81
|
+
"svg",
|
|
82
|
+
{
|
|
83
|
+
className: "h-full w-full",
|
|
84
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
85
|
+
style: mask ? {
|
|
86
|
+
maskImage: mask,
|
|
87
|
+
WebkitMaskImage: mask
|
|
88
|
+
} : void 0,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
91
|
+
"pattern",
|
|
92
|
+
{
|
|
93
|
+
id,
|
|
94
|
+
x: "0",
|
|
95
|
+
y: "0",
|
|
96
|
+
width: "100",
|
|
97
|
+
height: "100",
|
|
98
|
+
patternUnits: "userSpaceOnUse",
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
101
|
+
"path",
|
|
102
|
+
{
|
|
103
|
+
d: "M0 50h40M60 50h40M50 0v40M50 60v40",
|
|
104
|
+
stroke: "hsl(var(--muted))",
|
|
105
|
+
strokeWidth: "1",
|
|
106
|
+
fill: "none"
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "3", fill: "hsl(var(--muted))" }),
|
|
110
|
+
/* @__PURE__ */ jsx("circle", { cx: "0", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
111
|
+
/* @__PURE__ */ jsx("circle", { cx: "100", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
112
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "0", r: "2", fill: "hsl(var(--muted))" }),
|
|
113
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "100", r: "2", fill: "hsl(var(--muted))" })
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
) }),
|
|
117
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
var gridDotsPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
122
|
+
"svg",
|
|
123
|
+
{
|
|
124
|
+
className: "h-full w-full",
|
|
125
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
126
|
+
style: mask ? {
|
|
127
|
+
maskImage: mask,
|
|
128
|
+
WebkitMaskImage: mask
|
|
129
|
+
} : void 0,
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
132
|
+
"pattern",
|
|
133
|
+
{
|
|
134
|
+
id,
|
|
135
|
+
x: "0",
|
|
136
|
+
y: "0",
|
|
137
|
+
width: "40",
|
|
138
|
+
height: "40",
|
|
139
|
+
patternUnits: "userSpaceOnUse",
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ jsx(
|
|
142
|
+
"path",
|
|
143
|
+
{
|
|
144
|
+
d: "M0 20h40M20 0v40",
|
|
145
|
+
stroke: "hsl(var(--muted))",
|
|
146
|
+
strokeWidth: "0.5",
|
|
147
|
+
fill: "none"
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
/* @__PURE__ */ jsx("circle", { cx: "20", cy: "20", r: "2", fill: "hsl(var(--muted))" })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
) }),
|
|
154
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
var gridPattern = (size, mask) => /* @__PURE__ */ jsx(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
className: "h-full w-full bg-[linear-gradient(to_right,_hsl(var(--muted))_1px,_transparent_1px),linear-gradient(to_bottom,_hsl(var(--muted))_1px,_transparent_1px)]",
|
|
162
|
+
style: {
|
|
163
|
+
backgroundSize: `${size}px ${size}px`,
|
|
164
|
+
...mask ? {
|
|
165
|
+
maskImage: mask,
|
|
166
|
+
WebkitMaskImage: mask
|
|
167
|
+
} : {}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
var diagonalCrossPattern = (mask) => /* @__PURE__ */ jsx(
|
|
172
|
+
"div",
|
|
173
|
+
{
|
|
174
|
+
className: "h-full w-full",
|
|
175
|
+
style: {
|
|
176
|
+
backgroundImage: "repeating-linear-gradient(45deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px), repeating-linear-gradient(135deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px)",
|
|
177
|
+
...mask ? {
|
|
178
|
+
maskImage: mask,
|
|
179
|
+
WebkitMaskImage: mask
|
|
180
|
+
} : {}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
var dashedGridMaskBase = "repeating-linear-gradient(to right, black 0px, black 3px, transparent 3px, transparent 8px), repeating-linear-gradient(to bottom, black 0px, black 3px, transparent 3px, transparent 8px)";
|
|
185
|
+
var dashedGridPattern = (fadeMask) => {
|
|
186
|
+
const mask = fadeMask ? `${dashedGridMaskBase}, ${fadeMask}` : dashedGridMaskBase;
|
|
187
|
+
return /* @__PURE__ */ jsx(
|
|
188
|
+
"div",
|
|
189
|
+
{
|
|
190
|
+
className: "h-full w-full",
|
|
191
|
+
style: {
|
|
192
|
+
backgroundImage: "linear-gradient(to right, hsl(var(--muted)) 1px, transparent 1px), linear-gradient(to bottom, hsl(var(--muted)) 1px, transparent 1px)",
|
|
193
|
+
backgroundSize: "20px 20px",
|
|
194
|
+
backgroundPosition: "0 0, 0 0",
|
|
195
|
+
maskImage: mask,
|
|
196
|
+
WebkitMaskImage: mask,
|
|
197
|
+
maskComposite: "intersect",
|
|
198
|
+
WebkitMaskComposite: "source-in"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
var gradientGlow = (position) => /* @__PURE__ */ jsx(
|
|
204
|
+
"div",
|
|
205
|
+
{
|
|
206
|
+
className: cn(
|
|
207
|
+
"pointer-events-none absolute left-1/2 z-0 aspect-square w-3/4 -translate-x-1/2 rounded-full opacity-50 blur-3xl",
|
|
208
|
+
position === "top" ? "-top-1/4" : "-bottom-1/4"
|
|
209
|
+
),
|
|
210
|
+
style: {
|
|
211
|
+
background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
var spotlight = (position) => /* @__PURE__ */ jsx(
|
|
216
|
+
"div",
|
|
217
|
+
{
|
|
218
|
+
className: cn(
|
|
219
|
+
"pointer-events-none absolute top-1/2 z-0 aspect-square w-3/4 -translate-y-1/2 rounded-full opacity-40 blur-3xl",
|
|
220
|
+
position === "left" ? "-left-1/4" : "-right-1/4"
|
|
221
|
+
),
|
|
222
|
+
style: {
|
|
223
|
+
background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
var patternOverlays = {
|
|
228
|
+
circuitBoardBasic: () => circuitBoardPattern("circuit-board-basic"),
|
|
229
|
+
circuitBoardFadeTop: () => circuitBoardPattern("circuit-board-fade-top", maskTop),
|
|
230
|
+
circuitBoardFadeBottom: () => circuitBoardPattern("circuit-board-fade-bottom", maskBottom),
|
|
231
|
+
circuitBoardFadeCenter: () => circuitBoardPattern("circuit-board-fade-center", maskCenter),
|
|
232
|
+
circuitBoardFadeTopLeft: () => circuitBoardPattern("circuit-board-fade-top-left", maskTopLeft),
|
|
233
|
+
circuitBoardFadeTopRight: () => circuitBoardPattern("circuit-board-fade-top-right", maskTopRight),
|
|
234
|
+
circuitBoardFadeBottomLeft: () => circuitBoardPattern("circuit-board-fade-bottom-left", maskBottomLeft),
|
|
235
|
+
circuitBoardFadeBottomRight: () => circuitBoardPattern("circuit-board-fade-bottom-right", maskBottomRight),
|
|
236
|
+
dashedGridBasic: () => dashedGridPattern(),
|
|
237
|
+
dashedGridFadeTop: () => dashedGridPattern(maskTop),
|
|
238
|
+
dashedGridFadeBottom: () => dashedGridPattern(maskBottom),
|
|
239
|
+
dashedGridFadeCenter: () => dashedGridPattern(maskCenter),
|
|
240
|
+
dashedGridFadeTopLeft: () => dashedGridPattern(maskTopLeft),
|
|
241
|
+
dashedGridFadeTopRight: () => dashedGridPattern(maskTopRight),
|
|
242
|
+
dashedGridFadeBottomLeft: () => dashedGridPattern(maskBottomLeft),
|
|
243
|
+
dashedGridFadeBottomRight: () => dashedGridPattern(maskBottomRight),
|
|
244
|
+
diagonalCrossBasic: () => diagonalCrossPattern(),
|
|
245
|
+
diagonalCrossFadeTop: () => diagonalCrossPattern(maskTop),
|
|
246
|
+
diagonalCrossFadeBottom: () => diagonalCrossPattern(maskBottom),
|
|
247
|
+
diagonalCrossFadeCenter: () => diagonalCrossPattern(maskCenter),
|
|
248
|
+
diagonalCrossFadeTopLeft: () => diagonalCrossPattern(maskTopLeft),
|
|
249
|
+
diagonalCrossFadeTopRight: () => diagonalCrossPattern(maskTopRight),
|
|
250
|
+
diagonalCrossFadeBottomLeft: () => diagonalCrossPattern(maskBottomLeft),
|
|
251
|
+
diagonalCrossFadeBottomRight: () => diagonalCrossPattern(maskBottomRight),
|
|
252
|
+
gridBasic: () => gridPattern(40),
|
|
253
|
+
gridFadeTop: () => gridPattern(32, maskTop),
|
|
254
|
+
gridFadeBottom: () => gridPattern(32, maskBottom),
|
|
255
|
+
gridFadeCenter: () => gridPattern(40, maskCenter),
|
|
256
|
+
gridFadeTopLeft: () => gridPattern(32, maskTopLeft),
|
|
257
|
+
gridFadeTopRight: () => gridPattern(32, maskTopRight),
|
|
258
|
+
gridFadeBottomLeft: () => gridPattern(32, maskBottomLeft),
|
|
259
|
+
gridFadeBottomRight: () => gridPattern(32, maskBottomRight),
|
|
260
|
+
gridDotsBasic: () => gridDotsPattern("grid-dots-basic"),
|
|
261
|
+
gridDotsFadeCenter: () => gridDotsPattern("grid-dots-fade-center", maskCenter),
|
|
262
|
+
gradientGlowTop: () => gradientGlow("top"),
|
|
263
|
+
gradientGlowBottom: () => gradientGlow("bottom"),
|
|
264
|
+
spotlightLeft: () => spotlight("left"),
|
|
265
|
+
spotlightRight: () => spotlight("right")
|
|
266
|
+
};
|
|
267
|
+
var inlinePatternStyles = {
|
|
268
|
+
radialGradientTop: {
|
|
269
|
+
background: "radial-gradient(125% 125% at 50% 10%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
270
|
+
},
|
|
271
|
+
radialGradientBottom: {
|
|
272
|
+
background: "radial-gradient(125% 125% at 50% 90%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
function PatternBackground({
|
|
276
|
+
pattern,
|
|
277
|
+
opacity = 0.08,
|
|
278
|
+
className,
|
|
279
|
+
style
|
|
280
|
+
}) {
|
|
281
|
+
if (!pattern) {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
if (pattern in inlinePatternStyles) {
|
|
285
|
+
const inlineStyle = inlinePatternStyles[pattern];
|
|
286
|
+
return /* @__PURE__ */ jsx(
|
|
287
|
+
"div",
|
|
288
|
+
{
|
|
289
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
290
|
+
style: { ...inlineStyle, opacity, ...style },
|
|
291
|
+
"aria-hidden": "true"
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
if (pattern in patternOverlays) {
|
|
296
|
+
const Overlay = patternOverlays[pattern];
|
|
297
|
+
return /* @__PURE__ */ jsx(
|
|
298
|
+
"div",
|
|
299
|
+
{
|
|
300
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
301
|
+
style: { opacity, ...style },
|
|
302
|
+
"aria-hidden": "true",
|
|
303
|
+
children: Overlay()
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
const patternUrl = pattern in patternSvgs ? patternSvgs[pattern] : pattern;
|
|
308
|
+
return /* @__PURE__ */ jsx(
|
|
309
|
+
"div",
|
|
310
|
+
{
|
|
311
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
312
|
+
style: {
|
|
313
|
+
backgroundImage: `url(${patternUrl})`,
|
|
314
|
+
backgroundRepeat: "repeat",
|
|
315
|
+
backgroundSize: "auto",
|
|
316
|
+
opacity,
|
|
317
|
+
...style
|
|
318
|
+
},
|
|
319
|
+
"aria-hidden": "true"
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
var backgroundStyles = {
|
|
324
|
+
default: "bg-background text-foreground",
|
|
325
|
+
white: "bg-white text-dark",
|
|
326
|
+
gray: "bg-muted/30 text-foreground",
|
|
327
|
+
dark: "bg-foreground text-background",
|
|
328
|
+
transparent: "bg-transparent text-foreground",
|
|
329
|
+
gradient: "bg-linear-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
|
|
330
|
+
primary: "bg-primary text-primary-foreground",
|
|
331
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
332
|
+
muted: "bg-muted text-muted-foreground"
|
|
333
|
+
};
|
|
334
|
+
var spacingStyles = {
|
|
335
|
+
none: "py-0 md:py-0",
|
|
336
|
+
sm: "py-12 md:py-16",
|
|
337
|
+
md: "py-16 md:py-24",
|
|
338
|
+
lg: "py-20 md:py-32",
|
|
339
|
+
xl: "py-24 md:py-40",
|
|
340
|
+
hero: "pt-32 pb-12 md:pt-40 md:pb-40"
|
|
341
|
+
};
|
|
342
|
+
var predefinedSpacings = ["none", "sm", "md", "lg", "xl", "hero"];
|
|
343
|
+
var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
|
|
344
|
+
var Section = React__default.forwardRef(
|
|
345
|
+
({
|
|
346
|
+
id,
|
|
347
|
+
title,
|
|
348
|
+
subtitle,
|
|
349
|
+
children,
|
|
350
|
+
className,
|
|
351
|
+
style,
|
|
352
|
+
background = "default",
|
|
353
|
+
spacing = "lg",
|
|
354
|
+
pattern,
|
|
355
|
+
patternOpacity,
|
|
356
|
+
patternClassName,
|
|
357
|
+
containerClassName,
|
|
358
|
+
containerMaxWidth = "xl",
|
|
359
|
+
...props
|
|
360
|
+
}, ref) => {
|
|
361
|
+
const effectivePatternOpacity = patternOpacity !== void 0 ? patternOpacity : pattern ? 1 : 0;
|
|
362
|
+
return /* @__PURE__ */ jsxs(
|
|
363
|
+
"section",
|
|
364
|
+
{
|
|
365
|
+
ref,
|
|
366
|
+
id,
|
|
367
|
+
className: cn(
|
|
368
|
+
"relative",
|
|
369
|
+
pattern ? "overflow-hidden" : null,
|
|
370
|
+
backgroundStyles[background],
|
|
371
|
+
isPredefinedSpacing(spacing) ? spacingStyles[spacing] : spacing,
|
|
372
|
+
className
|
|
373
|
+
),
|
|
374
|
+
style,
|
|
375
|
+
...props,
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ jsx(
|
|
378
|
+
PatternBackground,
|
|
379
|
+
{
|
|
380
|
+
pattern,
|
|
381
|
+
opacity: effectivePatternOpacity,
|
|
382
|
+
className: patternClassName
|
|
383
|
+
}
|
|
384
|
+
),
|
|
385
|
+
/* @__PURE__ */ jsxs(
|
|
386
|
+
Container,
|
|
387
|
+
{
|
|
388
|
+
maxWidth: containerMaxWidth,
|
|
389
|
+
className: cn("relative z-10", containerClassName),
|
|
390
|
+
children: [
|
|
391
|
+
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "mb-6 text-center md:mb-16", children: [
|
|
392
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "mb-2 text-sm font-semibold uppercase tracking-wider", children: subtitle }),
|
|
393
|
+
title && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold tracking-tight md:text-4xl lg:text-5xl", children: title })
|
|
394
|
+
] }),
|
|
395
|
+
children
|
|
396
|
+
]
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
Section.displayName = "Section";
|
|
405
|
+
function EngagementBadge({
|
|
406
|
+
iconName,
|
|
407
|
+
count,
|
|
408
|
+
label
|
|
409
|
+
}) {
|
|
410
|
+
return /* @__PURE__ */ jsxs(
|
|
411
|
+
"span",
|
|
412
|
+
{
|
|
413
|
+
className: "inline-flex items-center gap-1",
|
|
414
|
+
"aria-label": `${count.toLocaleString()} ${label}`,
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ jsx(DynamicIcon, { name: iconName, size: 16, "aria-hidden": "true" }),
|
|
417
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: count.toLocaleString() })
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
function InstagramPostGrid({
|
|
423
|
+
sectionId = "instagram-post-grid",
|
|
424
|
+
heading,
|
|
425
|
+
subheading,
|
|
426
|
+
items,
|
|
427
|
+
itemsSlot,
|
|
428
|
+
className,
|
|
429
|
+
containerClassName,
|
|
430
|
+
headerClassName,
|
|
431
|
+
headingClassName,
|
|
432
|
+
subheadingClassName,
|
|
433
|
+
gridClassName,
|
|
434
|
+
itemClassName,
|
|
435
|
+
imageClassName,
|
|
436
|
+
background,
|
|
437
|
+
spacing,
|
|
438
|
+
pattern,
|
|
439
|
+
patternOpacity,
|
|
440
|
+
patternClassName,
|
|
441
|
+
optixFlowConfig
|
|
442
|
+
}) {
|
|
443
|
+
const tiles = useMemo(() => {
|
|
444
|
+
if (itemsSlot) return itemsSlot;
|
|
445
|
+
if (!items || items.length === 0) return null;
|
|
446
|
+
const visibleItems = items.filter((item) => Boolean(item.image));
|
|
447
|
+
return visibleItems.map((item) => {
|
|
448
|
+
const altText = item.imageAlt || (typeof item.caption === "string" ? item.caption : "") || "Instagram post";
|
|
449
|
+
const showVideo = Boolean(item.isVideo && item.videoUrl);
|
|
450
|
+
return /* @__PURE__ */ jsxs(
|
|
451
|
+
Pressable,
|
|
452
|
+
{
|
|
453
|
+
href: item.href,
|
|
454
|
+
"aria-label": typeof item.caption === "string" && item.caption.length > 0 ? item.caption : "View Instagram post",
|
|
455
|
+
className: cn(
|
|
456
|
+
"group relative block aspect-square overflow-hidden rounded-md bg-muted",
|
|
457
|
+
item.className,
|
|
458
|
+
itemClassName
|
|
459
|
+
),
|
|
460
|
+
children: [
|
|
461
|
+
/* @__PURE__ */ jsx(
|
|
462
|
+
Img,
|
|
463
|
+
{
|
|
464
|
+
src: item.image,
|
|
465
|
+
alt: altText,
|
|
466
|
+
loading: "lazy",
|
|
467
|
+
className: cn(
|
|
468
|
+
"h-full w-full object-cover object-center transition-transform duration-300 group-hover:scale-105 motion-reduce:transform-none motion-reduce:transition-none",
|
|
469
|
+
imageClassName
|
|
470
|
+
),
|
|
471
|
+
optixFlowConfig
|
|
472
|
+
}
|
|
473
|
+
),
|
|
474
|
+
showVideo && /* @__PURE__ */ jsx(
|
|
475
|
+
Video,
|
|
476
|
+
{
|
|
477
|
+
src: item.videoUrl,
|
|
478
|
+
poster: item.image,
|
|
479
|
+
controls: false,
|
|
480
|
+
muted: true,
|
|
481
|
+
loop: true,
|
|
482
|
+
playsInline: true,
|
|
483
|
+
preload: "metadata",
|
|
484
|
+
onMouseEnter: (e) => {
|
|
485
|
+
void e.currentTarget.play().catch(() => void 0);
|
|
486
|
+
},
|
|
487
|
+
onMouseLeave: (e) => {
|
|
488
|
+
e.currentTarget.pause();
|
|
489
|
+
e.currentTarget.currentTime = 0;
|
|
490
|
+
},
|
|
491
|
+
className: cn(
|
|
492
|
+
"absolute inset-0 h-full w-full object-cover object-center opacity-0 transition-opacity duration-300 group-hover:opacity-100 motion-reduce:transition-none",
|
|
493
|
+
imageClassName
|
|
494
|
+
)
|
|
495
|
+
}
|
|
496
|
+
),
|
|
497
|
+
item.isVideo && /* @__PURE__ */ jsx(
|
|
498
|
+
"span",
|
|
499
|
+
{
|
|
500
|
+
className: "absolute right-2 top-2 text-white drop-shadow-md",
|
|
501
|
+
"aria-hidden": "true",
|
|
502
|
+
children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/play", size: 18 })
|
|
503
|
+
}
|
|
504
|
+
),
|
|
505
|
+
(item.caption || item.date || typeof item.likeCount === "number" || typeof item.commentCount === "number" || typeof item.viewCount === "number") && /* @__PURE__ */ jsxs("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 flex flex-col gap-1 bg-linear-to-t from-black/70 to-transparent p-3 text-left text-white opacity-0 transition-opacity duration-300 group-hover:opacity-100 motion-reduce:transition-none", children: [
|
|
506
|
+
item.caption && (typeof item.caption === "string" ? /* @__PURE__ */ jsx("p", { className: "line-clamp-2 text-xs leading-snug wrap-break-word", children: item.caption }) : /* @__PURE__ */ jsx("div", { className: "line-clamp-2 text-xs leading-snug", children: item.caption })),
|
|
507
|
+
(typeof item.likeCount === "number" || typeof item.commentCount === "number" || typeof item.viewCount === "number" || item.date) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-xs font-medium", children: [
|
|
508
|
+
typeof item.likeCount === "number" && /* @__PURE__ */ jsx(
|
|
509
|
+
EngagementBadge,
|
|
510
|
+
{
|
|
511
|
+
iconName: "lucide/heart",
|
|
512
|
+
count: item.likeCount,
|
|
513
|
+
label: "likes"
|
|
514
|
+
}
|
|
515
|
+
),
|
|
516
|
+
typeof item.commentCount === "number" && /* @__PURE__ */ jsx(
|
|
517
|
+
EngagementBadge,
|
|
518
|
+
{
|
|
519
|
+
iconName: "lucide/message-circle",
|
|
520
|
+
count: item.commentCount,
|
|
521
|
+
label: "comments"
|
|
522
|
+
}
|
|
523
|
+
),
|
|
524
|
+
typeof item.viewCount === "number" && /* @__PURE__ */ jsx(
|
|
525
|
+
EngagementBadge,
|
|
526
|
+
{
|
|
527
|
+
iconName: "lucide/eye",
|
|
528
|
+
count: item.viewCount,
|
|
529
|
+
label: "views"
|
|
530
|
+
}
|
|
531
|
+
),
|
|
532
|
+
item.date && /* @__PURE__ */ jsx("span", { className: "ml-auto opacity-80", children: item.date })
|
|
533
|
+
] })
|
|
534
|
+
] })
|
|
535
|
+
]
|
|
536
|
+
},
|
|
537
|
+
item.id
|
|
538
|
+
);
|
|
539
|
+
});
|
|
540
|
+
}, [itemsSlot, items, itemClassName, imageClassName, optixFlowConfig]);
|
|
541
|
+
if (!itemsSlot && (!items || items.length === 0)) {
|
|
542
|
+
return null;
|
|
543
|
+
}
|
|
544
|
+
return /* @__PURE__ */ jsxs(
|
|
545
|
+
Section,
|
|
546
|
+
{
|
|
547
|
+
id: sectionId,
|
|
548
|
+
background,
|
|
549
|
+
spacing,
|
|
550
|
+
pattern,
|
|
551
|
+
patternOpacity,
|
|
552
|
+
patternClassName,
|
|
553
|
+
className,
|
|
554
|
+
containerClassName,
|
|
555
|
+
children: [
|
|
556
|
+
(heading || subheading) && /* @__PURE__ */ jsxs("div", { className: cn("mb-8 flex flex-col gap-2", headerClassName), children: [
|
|
557
|
+
heading && (typeof heading === "string" ? /* @__PURE__ */ jsx(
|
|
558
|
+
"h2",
|
|
559
|
+
{
|
|
560
|
+
className: cn(
|
|
561
|
+
"text-xl font-medium tracking-tight md:text-2xl lg:text-3xl text-balance",
|
|
562
|
+
headingClassName
|
|
563
|
+
),
|
|
564
|
+
children: heading
|
|
565
|
+
}
|
|
566
|
+
) : /* @__PURE__ */ jsx("div", { className: headingClassName, children: heading })),
|
|
567
|
+
subheading && (typeof subheading === "string" ? /* @__PURE__ */ jsx(
|
|
568
|
+
"p",
|
|
569
|
+
{
|
|
570
|
+
className: cn(
|
|
571
|
+
"max-w-2xl text-balance text-muted-foreground",
|
|
572
|
+
subheadingClassName
|
|
573
|
+
),
|
|
574
|
+
children: subheading
|
|
575
|
+
}
|
|
576
|
+
) : /* @__PURE__ */ jsx("div", { className: subheadingClassName, children: subheading }))
|
|
577
|
+
] }),
|
|
578
|
+
/* @__PURE__ */ jsx(
|
|
579
|
+
"div",
|
|
580
|
+
{
|
|
581
|
+
className: cn(
|
|
582
|
+
"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
|
|
583
|
+
gridClassName
|
|
584
|
+
),
|
|
585
|
+
children: tiles
|
|
586
|
+
}
|
|
587
|
+
)
|
|
588
|
+
]
|
|
589
|
+
}
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
export { InstagramPostGrid };
|