@opensite/ui 2.3.3 → 2.3.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/footer-split-image-accordion.cjs +73 -85
- package/dist/footer-split-image-accordion.d.cts +25 -26
- package/dist/footer-split-image-accordion.d.ts +25 -26
- package/dist/footer-split-image-accordion.js +74 -86
- package/dist/link-page-bento-layout.cjs +98 -28
- package/dist/link-page-bento-layout.js +98 -28
- package/dist/link-page-grid-cards.cjs +98 -28
- package/dist/link-page-grid-cards.js +98 -28
- package/dist/link-page-minimal-profile.cjs +92 -27
- package/dist/link-page-minimal-profile.d.cts +2 -9
- package/dist/link-page-minimal-profile.d.ts +2 -9
- package/dist/link-page-minimal-profile.js +92 -27
- package/dist/link-page-newsletter-social.cjs +98 -28
- package/dist/link-page-newsletter-social.js +98 -28
- package/dist/link-tree-block.cjs +116 -46
- package/dist/link-tree-block.js +116 -46
- package/dist/registry.cjs +180 -253
- package/dist/registry.js +180 -253
- package/package.json +1 -1
package/dist/link-tree-block.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React6 = require('react');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var classVarianceAuthority = require('class-variance-authority');
|
|
@@ -9,6 +9,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
9
9
|
var icon = require('@page-speed/icon');
|
|
10
10
|
var reactSlot = require('@radix-ui/react-slot');
|
|
11
11
|
var img = require('@page-speed/img');
|
|
12
|
+
var usePlatformFromUrl = require('@opensite/hooks/usePlatformFromUrl');
|
|
12
13
|
var lightbox = require('@page-speed/lightbox');
|
|
13
14
|
|
|
14
15
|
function _interopNamespace(e) {
|
|
@@ -29,7 +30,7 @@ function _interopNamespace(e) {
|
|
|
29
30
|
return Object.freeze(n);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
var
|
|
33
|
+
var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
|
|
33
34
|
|
|
34
35
|
// components/blocks/link-page/link-tree-block.tsx
|
|
35
36
|
function cn(...inputs) {
|
|
@@ -110,7 +111,7 @@ function useNavigation({
|
|
|
110
111
|
href,
|
|
111
112
|
onClick
|
|
112
113
|
} = {}) {
|
|
113
|
-
const linkType =
|
|
114
|
+
const linkType = React6__namespace.useMemo(() => {
|
|
114
115
|
if (!href || href.trim() === "") {
|
|
115
116
|
return onClick ? "none" : "none";
|
|
116
117
|
}
|
|
@@ -131,7 +132,7 @@ function useNavigation({
|
|
|
131
132
|
return "internal";
|
|
132
133
|
}
|
|
133
134
|
}, [href, onClick]);
|
|
134
|
-
const normalizedHref =
|
|
135
|
+
const normalizedHref = React6__namespace.useMemo(() => {
|
|
135
136
|
if (!href || href.trim() === "") {
|
|
136
137
|
return void 0;
|
|
137
138
|
}
|
|
@@ -149,7 +150,7 @@ function useNavigation({
|
|
|
149
150
|
return trimmed;
|
|
150
151
|
}
|
|
151
152
|
}, [href, linkType]);
|
|
152
|
-
const target =
|
|
153
|
+
const target = React6__namespace.useMemo(() => {
|
|
153
154
|
switch (linkType) {
|
|
154
155
|
case "external":
|
|
155
156
|
return "_blank";
|
|
@@ -162,7 +163,7 @@ function useNavigation({
|
|
|
162
163
|
return void 0;
|
|
163
164
|
}
|
|
164
165
|
}, [linkType]);
|
|
165
|
-
const rel =
|
|
166
|
+
const rel = React6__namespace.useMemo(() => {
|
|
166
167
|
if (linkType === "external") {
|
|
167
168
|
return "noopener noreferrer";
|
|
168
169
|
}
|
|
@@ -171,7 +172,7 @@ function useNavigation({
|
|
|
171
172
|
const isExternal = linkType === "external";
|
|
172
173
|
const isInternal = linkType === "internal";
|
|
173
174
|
const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
|
|
174
|
-
const handleClick =
|
|
175
|
+
const handleClick = React6__namespace.useCallback(
|
|
175
176
|
(event) => {
|
|
176
177
|
if (onClick) {
|
|
177
178
|
try {
|
|
@@ -355,7 +356,7 @@ var buttonVariants = classVarianceAuthority.cva(baseStyles, {
|
|
|
355
356
|
size: "default"
|
|
356
357
|
}
|
|
357
358
|
});
|
|
358
|
-
var Pressable =
|
|
359
|
+
var Pressable = React6__namespace.forwardRef(
|
|
359
360
|
({
|
|
360
361
|
children,
|
|
361
362
|
className,
|
|
@@ -498,7 +499,7 @@ var maxWidthStyles = {
|
|
|
498
499
|
"4xl": "max-w-[1536px]",
|
|
499
500
|
full: "max-w-full"
|
|
500
501
|
};
|
|
501
|
-
var Container =
|
|
502
|
+
var Container = React6__namespace.default.forwardRef(
|
|
502
503
|
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
503
504
|
const Component = as;
|
|
504
505
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -803,7 +804,7 @@ var spacingStyles = {
|
|
|
803
804
|
};
|
|
804
805
|
var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
|
|
805
806
|
var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
|
|
806
|
-
var Section =
|
|
807
|
+
var Section = React6__namespace.default.forwardRef(
|
|
807
808
|
({
|
|
808
809
|
id,
|
|
809
810
|
title,
|
|
@@ -864,6 +865,87 @@ var Section = React5__namespace.default.forwardRef(
|
|
|
864
865
|
}
|
|
865
866
|
);
|
|
866
867
|
Section.displayName = "Section";
|
|
868
|
+
var platformIconMap = {
|
|
869
|
+
instagram: "cib/instagram",
|
|
870
|
+
linkedin: "cib/linkedin",
|
|
871
|
+
google: "cib/google",
|
|
872
|
+
facebook: "cib/facebook",
|
|
873
|
+
tiktok: "cib/tiktok",
|
|
874
|
+
youtube: "cib/youtube",
|
|
875
|
+
yelp: "cib/yelp",
|
|
876
|
+
spotify: "cib/spotify",
|
|
877
|
+
apple: "cib/apple",
|
|
878
|
+
x: "line-md/twitter-x-alt",
|
|
879
|
+
github: "cib/github",
|
|
880
|
+
snapchat: "cib/snapchat",
|
|
881
|
+
discord: "cib/discord",
|
|
882
|
+
dev: "simple-icons/devdotto",
|
|
883
|
+
substack: "simple-icons/substack",
|
|
884
|
+
reddit: "cib/reddit",
|
|
885
|
+
pinterest: "cib/pinterest",
|
|
886
|
+
threads: "simple-icons/threads",
|
|
887
|
+
twitch: "cib/twitch",
|
|
888
|
+
whatsapp: "cib/whatsapp",
|
|
889
|
+
telegram: "cib/telegram",
|
|
890
|
+
medium: "simple-icons/medium",
|
|
891
|
+
patreon: "cib/patreon",
|
|
892
|
+
onlyfans: "simple-icons/onlyfans",
|
|
893
|
+
eventbrite: "cib/eventbrite",
|
|
894
|
+
npmjs: "simple-icons/npm",
|
|
895
|
+
crates: "cib/rust",
|
|
896
|
+
rubygems: "cib/rubygems",
|
|
897
|
+
behance: "cib/behance",
|
|
898
|
+
dribbble: "cib/dribbble",
|
|
899
|
+
unknown: "icon-park-solid/circular-connection"
|
|
900
|
+
};
|
|
901
|
+
var SocialLinkIcon = React6__namespace.forwardRef(
|
|
902
|
+
({
|
|
903
|
+
platformName,
|
|
904
|
+
label,
|
|
905
|
+
iconSize = 20,
|
|
906
|
+
iconColor,
|
|
907
|
+
href,
|
|
908
|
+
iconClassName,
|
|
909
|
+
className,
|
|
910
|
+
iconNameOverride,
|
|
911
|
+
...pressableProps
|
|
912
|
+
}, ref) => {
|
|
913
|
+
const platform = usePlatformFromUrl.usePlatformFromUrl(href);
|
|
914
|
+
const smartPlatformName = React6__namespace.useMemo(() => {
|
|
915
|
+
return platform || platformName;
|
|
916
|
+
}, [platform, platformName]);
|
|
917
|
+
const iconName = React6__namespace.useMemo(() => {
|
|
918
|
+
return iconNameOverride || platformIconMap[smartPlatformName];
|
|
919
|
+
}, [iconNameOverride, smartPlatformName]);
|
|
920
|
+
const accessibleLabel = React6__namespace.useMemo(() => {
|
|
921
|
+
return label || platformName;
|
|
922
|
+
}, [label, platformName]);
|
|
923
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
924
|
+
Pressable,
|
|
925
|
+
{
|
|
926
|
+
ref,
|
|
927
|
+
href,
|
|
928
|
+
"aria-label": accessibleLabel,
|
|
929
|
+
className: cn(
|
|
930
|
+
"inline-flex items-center justify-center transition-colors",
|
|
931
|
+
className
|
|
932
|
+
),
|
|
933
|
+
...pressableProps,
|
|
934
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
935
|
+
DynamicIcon,
|
|
936
|
+
{
|
|
937
|
+
name: iconName,
|
|
938
|
+
size: iconSize,
|
|
939
|
+
color: iconColor,
|
|
940
|
+
className: iconClassName,
|
|
941
|
+
alt: accessibleLabel
|
|
942
|
+
}
|
|
943
|
+
)
|
|
944
|
+
}
|
|
945
|
+
);
|
|
946
|
+
}
|
|
947
|
+
);
|
|
948
|
+
SocialLinkIcon.displayName = "SocialLinkIcon";
|
|
867
949
|
function LinkTreeBlock({
|
|
868
950
|
brandName,
|
|
869
951
|
brandTagline,
|
|
@@ -920,9 +1002,9 @@ function LinkTreeBlock({
|
|
|
920
1002
|
}) {
|
|
921
1003
|
const resolvedBackground = background;
|
|
922
1004
|
const resolvedPattern = pattern ?? backgroundPattern;
|
|
923
|
-
const [lightboxOpen, setLightboxOpen] =
|
|
924
|
-
const [lightboxIndex, setLightboxIndex] =
|
|
925
|
-
const lightboxItems =
|
|
1005
|
+
const [lightboxOpen, setLightboxOpen] = React6__namespace.useState(false);
|
|
1006
|
+
const [lightboxIndex, setLightboxIndex] = React6__namespace.useState(0);
|
|
1007
|
+
const lightboxItems = React6__namespace.useMemo(() => {
|
|
926
1008
|
if (!mediaGallery || mediaGallery.length === 0) return [];
|
|
927
1009
|
return mediaGallery.slice(0, mediaGalleryLimit).map((item, index) => ({
|
|
928
1010
|
id: item.id ?? `media-${index}`,
|
|
@@ -934,11 +1016,11 @@ function LinkTreeBlock({
|
|
|
934
1016
|
share: true
|
|
935
1017
|
}));
|
|
936
1018
|
}, [mediaGallery, mediaGalleryLimit]);
|
|
937
|
-
const handleMediaClick =
|
|
1019
|
+
const handleMediaClick = React6__namespace.useCallback((index) => {
|
|
938
1020
|
setLightboxIndex(index);
|
|
939
1021
|
setLightboxOpen(true);
|
|
940
1022
|
}, []);
|
|
941
|
-
const handleLightboxClose =
|
|
1023
|
+
const handleLightboxClose = React6__namespace.useCallback(() => {
|
|
942
1024
|
setLightboxOpen(false);
|
|
943
1025
|
}, []);
|
|
944
1026
|
const resolveImage = (value, fallbackAlt) => {
|
|
@@ -950,7 +1032,7 @@ function LinkTreeBlock({
|
|
|
950
1032
|
};
|
|
951
1033
|
const nameForAlt = typeof brandName === "string" ? brandName : "Brand avatar";
|
|
952
1034
|
const resolvedAvatar = resolveImage(brandAvatar || brandLogo, nameForAlt);
|
|
953
|
-
const renderBrandHeader =
|
|
1035
|
+
const renderBrandHeader = React6__namespace.useMemo(() => {
|
|
954
1036
|
if (brandSlot) return brandSlot;
|
|
955
1037
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
956
1038
|
"div",
|
|
@@ -1037,7 +1119,7 @@ function LinkTreeBlock({
|
|
|
1037
1119
|
brandTagline,
|
|
1038
1120
|
taglineClassName
|
|
1039
1121
|
]);
|
|
1040
|
-
const renderLinks =
|
|
1122
|
+
const renderLinks = React6__namespace.useMemo(() => {
|
|
1041
1123
|
if (linksSlot) return linksSlot;
|
|
1042
1124
|
if (!links || links.length === 0) return null;
|
|
1043
1125
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("space-y-3", linksClassName), children: links.map((link, index) => {
|
|
@@ -1153,7 +1235,7 @@ function LinkTreeBlock({
|
|
|
1153
1235
|
linkBadgeClassName,
|
|
1154
1236
|
linkChevronClassName
|
|
1155
1237
|
]);
|
|
1156
|
-
const renderMediaGallery =
|
|
1238
|
+
const renderMediaGallery = React6__namespace.useMemo(() => {
|
|
1157
1239
|
if (mediaGallerySlot) return mediaGallerySlot;
|
|
1158
1240
|
if (!mediaGallery || mediaGallery.length === 0) return null;
|
|
1159
1241
|
const items = mediaGallery.slice(0, mediaGalleryLimit);
|
|
@@ -1266,7 +1348,7 @@ function LinkTreeBlock({
|
|
|
1266
1348
|
mediaGalleryOverlayClassName,
|
|
1267
1349
|
mediaGalleryPlayIconClassName
|
|
1268
1350
|
]);
|
|
1269
|
-
const renderSocialLinks =
|
|
1351
|
+
const renderSocialLinks = React6__namespace.useMemo(() => {
|
|
1270
1352
|
if (socialLinksSlot) return socialLinksSlot;
|
|
1271
1353
|
if (!socialLinks || socialLinks.length === 0) return null;
|
|
1272
1354
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1276,32 +1358,20 @@ function LinkTreeBlock({
|
|
|
1276
1358
|
"flex flex-wrap items-center justify-center gap-2",
|
|
1277
1359
|
socialLinksClassName
|
|
1278
1360
|
),
|
|
1279
|
-
children: socialLinks.map((social, index) =>
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
...socialPressableProps,
|
|
1294
|
-
"aria-label": ariaLabel,
|
|
1295
|
-
className: cn(
|
|
1296
|
-
"flex h-12 w-12 items-center justify-center rounded-full p-2.5 transition-all duration-200",
|
|
1297
|
-
socialLinkClassName,
|
|
1298
|
-
social.className
|
|
1299
|
-
),
|
|
1300
|
-
children: icon
|
|
1301
|
-
},
|
|
1302
|
-
social.id ?? index
|
|
1303
|
-
);
|
|
1304
|
-
})
|
|
1361
|
+
children: socialLinks.map((social, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1362
|
+
SocialLinkIcon,
|
|
1363
|
+
{
|
|
1364
|
+
href: social.href,
|
|
1365
|
+
label: social["aria-label"] || (typeof social.label === "string" ? social.label : void 0),
|
|
1366
|
+
className: cn(
|
|
1367
|
+
"flex h-12 w-12 items-center justify-center rounded-full p-2.5 transition-all duration-200",
|
|
1368
|
+
socialLinkClassName,
|
|
1369
|
+
social.className
|
|
1370
|
+
),
|
|
1371
|
+
iconClassName: socialIconClassName
|
|
1372
|
+
},
|
|
1373
|
+
social.id ?? social.href ?? index
|
|
1374
|
+
))
|
|
1305
1375
|
}
|
|
1306
1376
|
);
|
|
1307
1377
|
}, [
|
|
@@ -1311,7 +1381,7 @@ function LinkTreeBlock({
|
|
|
1311
1381
|
socialIconClassName,
|
|
1312
1382
|
socialLinkClassName
|
|
1313
1383
|
]);
|
|
1314
|
-
const renderFooter =
|
|
1384
|
+
const renderFooter = React6__namespace.useMemo(() => {
|
|
1315
1385
|
if (footerSlot) return footerSlot;
|
|
1316
1386
|
if (!footerAction) return null;
|
|
1317
1387
|
const resolvedFooterAction = footerAction;
|
package/dist/link-tree-block.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React6 from 'react';
|
|
3
|
+
import React6__default from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
@@ -8,6 +8,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
8
8
|
import { Icon } from '@page-speed/icon';
|
|
9
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
10
|
import { Img } from '@page-speed/img';
|
|
11
|
+
import { usePlatformFromUrl } from '@opensite/hooks/usePlatformFromUrl';
|
|
11
12
|
import { Lightbox } from '@page-speed/lightbox';
|
|
12
13
|
|
|
13
14
|
// components/blocks/link-page/link-tree-block.tsx
|
|
@@ -89,7 +90,7 @@ function useNavigation({
|
|
|
89
90
|
href,
|
|
90
91
|
onClick
|
|
91
92
|
} = {}) {
|
|
92
|
-
const linkType =
|
|
93
|
+
const linkType = React6.useMemo(() => {
|
|
93
94
|
if (!href || href.trim() === "") {
|
|
94
95
|
return onClick ? "none" : "none";
|
|
95
96
|
}
|
|
@@ -110,7 +111,7 @@ function useNavigation({
|
|
|
110
111
|
return "internal";
|
|
111
112
|
}
|
|
112
113
|
}, [href, onClick]);
|
|
113
|
-
const normalizedHref =
|
|
114
|
+
const normalizedHref = React6.useMemo(() => {
|
|
114
115
|
if (!href || href.trim() === "") {
|
|
115
116
|
return void 0;
|
|
116
117
|
}
|
|
@@ -128,7 +129,7 @@ function useNavigation({
|
|
|
128
129
|
return trimmed;
|
|
129
130
|
}
|
|
130
131
|
}, [href, linkType]);
|
|
131
|
-
const target =
|
|
132
|
+
const target = React6.useMemo(() => {
|
|
132
133
|
switch (linkType) {
|
|
133
134
|
case "external":
|
|
134
135
|
return "_blank";
|
|
@@ -141,7 +142,7 @@ function useNavigation({
|
|
|
141
142
|
return void 0;
|
|
142
143
|
}
|
|
143
144
|
}, [linkType]);
|
|
144
|
-
const rel =
|
|
145
|
+
const rel = React6.useMemo(() => {
|
|
145
146
|
if (linkType === "external") {
|
|
146
147
|
return "noopener noreferrer";
|
|
147
148
|
}
|
|
@@ -150,7 +151,7 @@ function useNavigation({
|
|
|
150
151
|
const isExternal = linkType === "external";
|
|
151
152
|
const isInternal = linkType === "internal";
|
|
152
153
|
const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
|
|
153
|
-
const handleClick =
|
|
154
|
+
const handleClick = React6.useCallback(
|
|
154
155
|
(event) => {
|
|
155
156
|
if (onClick) {
|
|
156
157
|
try {
|
|
@@ -334,7 +335,7 @@ var buttonVariants = cva(baseStyles, {
|
|
|
334
335
|
size: "default"
|
|
335
336
|
}
|
|
336
337
|
});
|
|
337
|
-
var Pressable =
|
|
338
|
+
var Pressable = React6.forwardRef(
|
|
338
339
|
({
|
|
339
340
|
children,
|
|
340
341
|
className,
|
|
@@ -477,7 +478,7 @@ var maxWidthStyles = {
|
|
|
477
478
|
"4xl": "max-w-[1536px]",
|
|
478
479
|
full: "max-w-full"
|
|
479
480
|
};
|
|
480
|
-
var Container =
|
|
481
|
+
var Container = React6__default.forwardRef(
|
|
481
482
|
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
482
483
|
const Component = as;
|
|
483
484
|
return /* @__PURE__ */ jsx(
|
|
@@ -782,7 +783,7 @@ var spacingStyles = {
|
|
|
782
783
|
};
|
|
783
784
|
var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
|
|
784
785
|
var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
|
|
785
|
-
var Section =
|
|
786
|
+
var Section = React6__default.forwardRef(
|
|
786
787
|
({
|
|
787
788
|
id,
|
|
788
789
|
title,
|
|
@@ -843,6 +844,87 @@ var Section = React5__default.forwardRef(
|
|
|
843
844
|
}
|
|
844
845
|
);
|
|
845
846
|
Section.displayName = "Section";
|
|
847
|
+
var platformIconMap = {
|
|
848
|
+
instagram: "cib/instagram",
|
|
849
|
+
linkedin: "cib/linkedin",
|
|
850
|
+
google: "cib/google",
|
|
851
|
+
facebook: "cib/facebook",
|
|
852
|
+
tiktok: "cib/tiktok",
|
|
853
|
+
youtube: "cib/youtube",
|
|
854
|
+
yelp: "cib/yelp",
|
|
855
|
+
spotify: "cib/spotify",
|
|
856
|
+
apple: "cib/apple",
|
|
857
|
+
x: "line-md/twitter-x-alt",
|
|
858
|
+
github: "cib/github",
|
|
859
|
+
snapchat: "cib/snapchat",
|
|
860
|
+
discord: "cib/discord",
|
|
861
|
+
dev: "simple-icons/devdotto",
|
|
862
|
+
substack: "simple-icons/substack",
|
|
863
|
+
reddit: "cib/reddit",
|
|
864
|
+
pinterest: "cib/pinterest",
|
|
865
|
+
threads: "simple-icons/threads",
|
|
866
|
+
twitch: "cib/twitch",
|
|
867
|
+
whatsapp: "cib/whatsapp",
|
|
868
|
+
telegram: "cib/telegram",
|
|
869
|
+
medium: "simple-icons/medium",
|
|
870
|
+
patreon: "cib/patreon",
|
|
871
|
+
onlyfans: "simple-icons/onlyfans",
|
|
872
|
+
eventbrite: "cib/eventbrite",
|
|
873
|
+
npmjs: "simple-icons/npm",
|
|
874
|
+
crates: "cib/rust",
|
|
875
|
+
rubygems: "cib/rubygems",
|
|
876
|
+
behance: "cib/behance",
|
|
877
|
+
dribbble: "cib/dribbble",
|
|
878
|
+
unknown: "icon-park-solid/circular-connection"
|
|
879
|
+
};
|
|
880
|
+
var SocialLinkIcon = React6.forwardRef(
|
|
881
|
+
({
|
|
882
|
+
platformName,
|
|
883
|
+
label,
|
|
884
|
+
iconSize = 20,
|
|
885
|
+
iconColor,
|
|
886
|
+
href,
|
|
887
|
+
iconClassName,
|
|
888
|
+
className,
|
|
889
|
+
iconNameOverride,
|
|
890
|
+
...pressableProps
|
|
891
|
+
}, ref) => {
|
|
892
|
+
const platform = usePlatformFromUrl(href);
|
|
893
|
+
const smartPlatformName = React6.useMemo(() => {
|
|
894
|
+
return platform || platformName;
|
|
895
|
+
}, [platform, platformName]);
|
|
896
|
+
const iconName = React6.useMemo(() => {
|
|
897
|
+
return iconNameOverride || platformIconMap[smartPlatformName];
|
|
898
|
+
}, [iconNameOverride, smartPlatformName]);
|
|
899
|
+
const accessibleLabel = React6.useMemo(() => {
|
|
900
|
+
return label || platformName;
|
|
901
|
+
}, [label, platformName]);
|
|
902
|
+
return /* @__PURE__ */ jsx(
|
|
903
|
+
Pressable,
|
|
904
|
+
{
|
|
905
|
+
ref,
|
|
906
|
+
href,
|
|
907
|
+
"aria-label": accessibleLabel,
|
|
908
|
+
className: cn(
|
|
909
|
+
"inline-flex items-center justify-center transition-colors",
|
|
910
|
+
className
|
|
911
|
+
),
|
|
912
|
+
...pressableProps,
|
|
913
|
+
children: /* @__PURE__ */ jsx(
|
|
914
|
+
DynamicIcon,
|
|
915
|
+
{
|
|
916
|
+
name: iconName,
|
|
917
|
+
size: iconSize,
|
|
918
|
+
color: iconColor,
|
|
919
|
+
className: iconClassName,
|
|
920
|
+
alt: accessibleLabel
|
|
921
|
+
}
|
|
922
|
+
)
|
|
923
|
+
}
|
|
924
|
+
);
|
|
925
|
+
}
|
|
926
|
+
);
|
|
927
|
+
SocialLinkIcon.displayName = "SocialLinkIcon";
|
|
846
928
|
function LinkTreeBlock({
|
|
847
929
|
brandName,
|
|
848
930
|
brandTagline,
|
|
@@ -899,9 +981,9 @@ function LinkTreeBlock({
|
|
|
899
981
|
}) {
|
|
900
982
|
const resolvedBackground = background;
|
|
901
983
|
const resolvedPattern = pattern ?? backgroundPattern;
|
|
902
|
-
const [lightboxOpen, setLightboxOpen] =
|
|
903
|
-
const [lightboxIndex, setLightboxIndex] =
|
|
904
|
-
const lightboxItems =
|
|
984
|
+
const [lightboxOpen, setLightboxOpen] = React6.useState(false);
|
|
985
|
+
const [lightboxIndex, setLightboxIndex] = React6.useState(0);
|
|
986
|
+
const lightboxItems = React6.useMemo(() => {
|
|
905
987
|
if (!mediaGallery || mediaGallery.length === 0) return [];
|
|
906
988
|
return mediaGallery.slice(0, mediaGalleryLimit).map((item, index) => ({
|
|
907
989
|
id: item.id ?? `media-${index}`,
|
|
@@ -913,11 +995,11 @@ function LinkTreeBlock({
|
|
|
913
995
|
share: true
|
|
914
996
|
}));
|
|
915
997
|
}, [mediaGallery, mediaGalleryLimit]);
|
|
916
|
-
const handleMediaClick =
|
|
998
|
+
const handleMediaClick = React6.useCallback((index) => {
|
|
917
999
|
setLightboxIndex(index);
|
|
918
1000
|
setLightboxOpen(true);
|
|
919
1001
|
}, []);
|
|
920
|
-
const handleLightboxClose =
|
|
1002
|
+
const handleLightboxClose = React6.useCallback(() => {
|
|
921
1003
|
setLightboxOpen(false);
|
|
922
1004
|
}, []);
|
|
923
1005
|
const resolveImage = (value, fallbackAlt) => {
|
|
@@ -929,7 +1011,7 @@ function LinkTreeBlock({
|
|
|
929
1011
|
};
|
|
930
1012
|
const nameForAlt = typeof brandName === "string" ? brandName : "Brand avatar";
|
|
931
1013
|
const resolvedAvatar = resolveImage(brandAvatar || brandLogo, nameForAlt);
|
|
932
|
-
const renderBrandHeader =
|
|
1014
|
+
const renderBrandHeader = React6.useMemo(() => {
|
|
933
1015
|
if (brandSlot) return brandSlot;
|
|
934
1016
|
return /* @__PURE__ */ jsxs(
|
|
935
1017
|
"div",
|
|
@@ -1016,7 +1098,7 @@ function LinkTreeBlock({
|
|
|
1016
1098
|
brandTagline,
|
|
1017
1099
|
taglineClassName
|
|
1018
1100
|
]);
|
|
1019
|
-
const renderLinks =
|
|
1101
|
+
const renderLinks = React6.useMemo(() => {
|
|
1020
1102
|
if (linksSlot) return linksSlot;
|
|
1021
1103
|
if (!links || links.length === 0) return null;
|
|
1022
1104
|
return /* @__PURE__ */ jsx("div", { className: cn("space-y-3", linksClassName), children: links.map((link, index) => {
|
|
@@ -1132,7 +1214,7 @@ function LinkTreeBlock({
|
|
|
1132
1214
|
linkBadgeClassName,
|
|
1133
1215
|
linkChevronClassName
|
|
1134
1216
|
]);
|
|
1135
|
-
const renderMediaGallery =
|
|
1217
|
+
const renderMediaGallery = React6.useMemo(() => {
|
|
1136
1218
|
if (mediaGallerySlot) return mediaGallerySlot;
|
|
1137
1219
|
if (!mediaGallery || mediaGallery.length === 0) return null;
|
|
1138
1220
|
const items = mediaGallery.slice(0, mediaGalleryLimit);
|
|
@@ -1245,7 +1327,7 @@ function LinkTreeBlock({
|
|
|
1245
1327
|
mediaGalleryOverlayClassName,
|
|
1246
1328
|
mediaGalleryPlayIconClassName
|
|
1247
1329
|
]);
|
|
1248
|
-
const renderSocialLinks =
|
|
1330
|
+
const renderSocialLinks = React6.useMemo(() => {
|
|
1249
1331
|
if (socialLinksSlot) return socialLinksSlot;
|
|
1250
1332
|
if (!socialLinks || socialLinks.length === 0) return null;
|
|
1251
1333
|
return /* @__PURE__ */ jsx(
|
|
@@ -1255,32 +1337,20 @@ function LinkTreeBlock({
|
|
|
1255
1337
|
"flex flex-wrap items-center justify-center gap-2",
|
|
1256
1338
|
socialLinksClassName
|
|
1257
1339
|
),
|
|
1258
|
-
children: socialLinks.map((social, index) =>
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
...socialPressableProps,
|
|
1273
|
-
"aria-label": ariaLabel,
|
|
1274
|
-
className: cn(
|
|
1275
|
-
"flex h-12 w-12 items-center justify-center rounded-full p-2.5 transition-all duration-200",
|
|
1276
|
-
socialLinkClassName,
|
|
1277
|
-
social.className
|
|
1278
|
-
),
|
|
1279
|
-
children: icon
|
|
1280
|
-
},
|
|
1281
|
-
social.id ?? index
|
|
1282
|
-
);
|
|
1283
|
-
})
|
|
1340
|
+
children: socialLinks.map((social, index) => /* @__PURE__ */ jsx(
|
|
1341
|
+
SocialLinkIcon,
|
|
1342
|
+
{
|
|
1343
|
+
href: social.href,
|
|
1344
|
+
label: social["aria-label"] || (typeof social.label === "string" ? social.label : void 0),
|
|
1345
|
+
className: cn(
|
|
1346
|
+
"flex h-12 w-12 items-center justify-center rounded-full p-2.5 transition-all duration-200",
|
|
1347
|
+
socialLinkClassName,
|
|
1348
|
+
social.className
|
|
1349
|
+
),
|
|
1350
|
+
iconClassName: socialIconClassName
|
|
1351
|
+
},
|
|
1352
|
+
social.id ?? social.href ?? index
|
|
1353
|
+
))
|
|
1284
1354
|
}
|
|
1285
1355
|
);
|
|
1286
1356
|
}, [
|
|
@@ -1290,7 +1360,7 @@ function LinkTreeBlock({
|
|
|
1290
1360
|
socialIconClassName,
|
|
1291
1361
|
socialLinkClassName
|
|
1292
1362
|
]);
|
|
1293
|
-
const renderFooter =
|
|
1363
|
+
const renderFooter = React6.useMemo(() => {
|
|
1294
1364
|
if (footerSlot) return footerSlot;
|
|
1295
1365
|
if (!footerAction) return null;
|
|
1296
1366
|
const resolvedFooterAction = footerAction;
|