react-sharesheet 1.0.0 → 1.1.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.
Files changed (41) hide show
  1. package/README.md +40 -53
  2. package/dist/content.d.mts +3 -3
  3. package/dist/content.d.ts +3 -3
  4. package/dist/content.js +192 -268
  5. package/dist/content.js.map +1 -1
  6. package/dist/content.mjs +194 -270
  7. package/dist/content.mjs.map +1 -1
  8. package/dist/drawer.d.mts +3 -3
  9. package/dist/drawer.d.ts +3 -3
  10. package/dist/drawer.js +194 -272
  11. package/dist/drawer.js.map +1 -1
  12. package/dist/drawer.mjs +196 -274
  13. package/dist/drawer.mjs.map +1 -1
  14. package/dist/headless.d.mts +22 -3
  15. package/dist/headless.d.ts +22 -3
  16. package/dist/headless.js +72 -0
  17. package/dist/headless.js.map +1 -1
  18. package/dist/headless.mjs +70 -1
  19. package/dist/headless.mjs.map +1 -1
  20. package/dist/index.d.mts +2 -2
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +203 -272
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +202 -274
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/{platforms-DU1DVDFq.d.mts → platforms-CDJmSY8E.d.mts} +2 -19
  27. package/dist/{platforms-DU1DVDFq.d.ts → platforms-CDJmSY8E.d.ts} +2 -19
  28. package/package.json +12 -3
  29. package/src/ShareSheetContent.tsx +143 -306
  30. package/src/ShareSheetDrawer.tsx +2 -4
  31. package/src/__tests__/hooks.test.ts +213 -0
  32. package/src/__tests__/og-fetcher.test.ts +144 -0
  33. package/src/__tests__/platforms.test.ts +148 -0
  34. package/src/__tests__/setup.ts +22 -0
  35. package/src/__tests__/share-functions.test.ts +155 -0
  36. package/src/__tests__/utils.test.ts +64 -0
  37. package/src/headless.ts +4 -1
  38. package/src/hooks.ts +49 -1
  39. package/src/index.ts +4 -3
  40. package/src/og-fetcher.ts +64 -0
  41. package/src/types.ts +1 -20
package/dist/content.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/ShareSheetContent.tsx
2
2
  import { useMemo as useMemo2, useState as useState2, useCallback as useCallback2 } from "react";
3
- import { Image, FileText, Music, Film, Link2, Play } from "lucide-react";
3
+ import { Image, Link2 } from "lucide-react";
4
4
 
5
5
  // src/utils.ts
6
6
  import { clsx } from "clsx";
@@ -16,7 +16,39 @@ function getSafeUrl(shareUrl) {
16
16
  }
17
17
 
18
18
  // src/hooks.ts
19
- import { useMemo, useState, useCallback } from "react";
19
+ import { useMemo, useState, useCallback, useEffect } from "react";
20
+
21
+ // src/og-fetcher.ts
22
+ var ogCache = /* @__PURE__ */ new Map();
23
+ async function fetchOGData(url) {
24
+ if (ogCache.has(url)) {
25
+ return ogCache.get(url);
26
+ }
27
+ try {
28
+ const apiUrl = `https://api.microlink.io?url=${encodeURIComponent(url)}`;
29
+ const response = await fetch(apiUrl);
30
+ if (!response.ok) {
31
+ throw new Error(`Failed to fetch OG data: ${response.status}`);
32
+ }
33
+ const json = await response.json();
34
+ if (json.status !== "success" || !json.data) {
35
+ return null;
36
+ }
37
+ const { title, description, image, url: canonicalUrl, publisher } = json.data;
38
+ const ogData = {
39
+ title: title || void 0,
40
+ description: description || void 0,
41
+ image: image?.url || void 0,
42
+ url: canonicalUrl || url,
43
+ siteName: publisher || void 0
44
+ };
45
+ ogCache.set(url, ogData);
46
+ return ogData;
47
+ } catch (error) {
48
+ console.warn("[react-sharesheet] Failed to fetch OG data:", error);
49
+ return null;
50
+ }
51
+ }
20
52
 
21
53
  // src/share-functions.ts
22
54
  function shareToWhatsApp(url, text) {
@@ -194,6 +226,37 @@ function useShareSheet({
194
226
  shareReddit
195
227
  };
196
228
  }
229
+ function useOGData(url) {
230
+ const [ogData, setOgData] = useState(null);
231
+ const [loading, setLoading] = useState(false);
232
+ const [error, setError] = useState(null);
233
+ useEffect(() => {
234
+ if (!url) {
235
+ setOgData(null);
236
+ setLoading(false);
237
+ setError(null);
238
+ return;
239
+ }
240
+ let cancelled = false;
241
+ setLoading(true);
242
+ setError(null);
243
+ fetchOGData(url).then((data) => {
244
+ if (!cancelled) {
245
+ setOgData(data);
246
+ setLoading(false);
247
+ }
248
+ }).catch((err) => {
249
+ if (!cancelled) {
250
+ setError(err instanceof Error ? err.message : "Failed to fetch OG data");
251
+ setLoading(false);
252
+ }
253
+ });
254
+ return () => {
255
+ cancelled = true;
256
+ };
257
+ }, [url]);
258
+ return { ogData, loading, error };
259
+ }
197
260
 
198
261
  // src/platforms.tsx
199
262
  import {
@@ -345,32 +408,6 @@ var CSS_VAR_DEFAULTS = CSS_VAR_UI_DEFAULTS;
345
408
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
346
409
  var DEFAULT_BUTTON_SIZE = 45;
347
410
  var DEFAULT_ICON_SIZE = 22;
348
- var IMAGE_EXTENSIONS = ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp", "ico", "avif"];
349
- var VIDEO_EXTENSIONS = ["mp4", "webm", "mov", "avi", "mkv", "m4v", "ogv"];
350
- var AUDIO_EXTENSIONS = ["mp3", "wav", "ogg", "m4a", "aac", "flac", "wma"];
351
- function detectPreviewType(url) {
352
- try {
353
- const pathname = new URL(url, "http://localhost").pathname;
354
- const ext = pathname.split(".").pop()?.toLowerCase() || "";
355
- if (IMAGE_EXTENSIONS.includes(ext)) return "image";
356
- if (VIDEO_EXTENSIONS.includes(ext)) return "video";
357
- if (AUDIO_EXTENSIONS.includes(ext)) return "audio";
358
- if (url.includes("/api/og") || url.includes("og-image")) return "image";
359
- if (url.includes("youtube.com") || url.includes("vimeo.com")) return "video";
360
- return "link";
361
- } catch {
362
- return "link";
363
- }
364
- }
365
- function getFilenameFromUrl(url) {
366
- try {
367
- const pathname = new URL(url, "http://localhost").pathname;
368
- const filename = pathname.split("/").pop() || "";
369
- return decodeURIComponent(filename);
370
- } catch {
371
- return url;
372
- }
373
- }
374
411
  var defaultClasses = {
375
412
  root: "max-w-md mx-auto",
376
413
  header: "text-center mb-2",
@@ -379,12 +416,8 @@ var defaultClasses = {
379
416
  preview: "flex justify-center mb-4 px-4",
380
417
  previewSkeleton: "rounded-xl overflow-hidden",
381
418
  previewImage: "",
382
- previewVideo: "",
383
- previewFile: "",
384
- previewFileIcon: "",
385
- previewFilename: "truncate",
386
- previewLink: "",
387
- grid: "px-2 py-6 flex flex-row items-center gap-4 gap-y-6 flex-wrap justify-center",
419
+ previewMeta: "",
420
+ grid: "px-2 py-6 flex flex-row items-start gap-4 gap-y-6 flex-wrap justify-center",
388
421
  button: "flex flex-col items-center gap-0 text-xs w-[60px] outline-none cursor-pointer group",
389
422
  buttonIcon: "p-2 rounded-full transition-all flex items-center justify-center group-hover:scale-110 group-active:scale-95 mb-2",
390
423
  buttonLabel: ""
@@ -398,28 +431,10 @@ var shimmerKeyframes = `
398
431
  function cssVar(name, fallback) {
399
432
  return `var(${name}, ${fallback})`;
400
433
  }
401
- function normalizePreview(preview) {
402
- if (!preview) return null;
403
- if (typeof preview === "string") {
404
- const type2 = detectPreviewType(preview);
405
- return {
406
- url: preview,
407
- type: type2,
408
- filename: getFilenameFromUrl(preview)
409
- };
410
- }
411
- const type = preview.type === "auto" || !preview.type ? detectPreviewType(preview.url) : preview.type;
412
- return {
413
- ...preview,
414
- type,
415
- filename: preview.filename || getFilenameFromUrl(preview.url)
416
- };
417
- }
418
434
  function ShareSheetContent({
419
435
  title = "Share",
420
436
  shareUrl,
421
437
  shareText,
422
- preview,
423
438
  downloadUrl,
424
439
  downloadFilename,
425
440
  className,
@@ -434,15 +449,15 @@ function ShareSheetContent({
434
449
  labels = {},
435
450
  icons = {}
436
451
  }) {
437
- const [mediaLoaded, setMediaLoaded] = useState2(false);
438
- const [mediaError, setMediaError] = useState2(false);
439
- const handleMediaLoad = useCallback2(() => {
440
- setMediaLoaded(true);
452
+ const [imageLoaded, setImageLoaded] = useState2(false);
453
+ const [imageError, setImageError] = useState2(false);
454
+ const { ogData, loading: ogLoading } = useOGData(shareUrl);
455
+ const handleImageLoad = useCallback2(() => {
456
+ setImageLoaded(true);
441
457
  }, []);
442
- const handleMediaError = useCallback2(() => {
443
- setMediaError(true);
458
+ const handleImageError = useCallback2(() => {
459
+ setImageError(true);
444
460
  }, []);
445
- const previewConfig = useMemo2(() => normalizePreview(preview), [preview]);
446
461
  const shareSheet = useShareSheet({
447
462
  shareUrl,
448
463
  shareText,
@@ -499,49 +514,30 @@ function ShareSheetContent({
499
514
  return true;
500
515
  });
501
516
  }, [buttons, show, hide]);
502
- const showPreview = !!previewConfig;
517
+ const bgColor = cssVar(CSS_VARS_UI.previewBg, CSS_VAR_UI_DEFAULTS[CSS_VARS_UI.previewBg]);
518
+ const shimmerColor = cssVar(CSS_VARS_UI.previewShimmer, CSS_VAR_UI_DEFAULTS[CSS_VARS_UI.previewShimmer]);
519
+ const textColor = cssVar(CSS_VARS_UI.subtitleColor, CSS_VAR_UI_DEFAULTS[CSS_VARS_UI.subtitleColor]);
503
520
  const renderPreview = () => {
504
- if (!previewConfig) return null;
505
- const { type, url, filename, alt, poster } = previewConfig;
506
- const bgColor = cssVar(CSS_VARS_UI.previewBg, CSS_VAR_UI_DEFAULTS[CSS_VARS_UI.previewBg]);
507
- const shimmerColor = cssVar(CSS_VARS_UI.previewShimmer, CSS_VAR_UI_DEFAULTS[CSS_VARS_UI.previewShimmer]);
508
- const textColor = cssVar(CSS_VARS_UI.subtitleColor, CSS_VAR_UI_DEFAULTS[CSS_VARS_UI.subtitleColor]);
509
- const UrlLabel = ({ displayUrl = url }) => /* @__PURE__ */ jsx2(
510
- "div",
511
- {
512
- className: cn(defaultClasses.previewFilename, classNames.previewFilename),
513
- style: {
514
- color: textColor,
515
- fontSize: "10px",
516
- opacity: 0.5,
517
- textAlign: "center",
518
- marginTop: "6px"
519
- },
520
- children: displayUrl
521
- }
522
- );
523
- const PlaceholderCard = ({
524
- icon: IconComponent,
525
- isLoading = false,
526
- label,
527
- displayUrl
528
- }) => /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [
529
- /* @__PURE__ */ jsxs(
521
+ const ogImage = ogData?.image;
522
+ const hasImage = ogImage && !imageError;
523
+ if (ogLoading) {
524
+ return /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", width: "100%" }, children: /* @__PURE__ */ jsxs(
530
525
  "div",
531
526
  {
532
527
  className: cn(defaultClasses.previewSkeleton, classNames.previewSkeleton),
533
528
  style: {
534
529
  position: "relative",
535
530
  backgroundColor: bgColor,
536
- width: "200px",
537
- height: "120px",
531
+ width: "100%",
532
+ maxWidth: "320px",
533
+ aspectRatio: "1.91 / 1",
538
534
  overflow: "hidden",
539
535
  display: "flex",
540
536
  alignItems: "center",
541
537
  justifyContent: "center"
542
538
  },
543
539
  children: [
544
- isLoading && /* @__PURE__ */ jsx2("div", { style: { position: "absolute", inset: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx2(
540
+ /* @__PURE__ */ jsx2("div", { style: { position: "absolute", inset: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx2(
545
541
  "div",
546
542
  {
547
543
  style: {
@@ -552,197 +548,125 @@ function ShareSheetContent({
552
548
  }
553
549
  }
554
550
  ) }),
555
- /* @__PURE__ */ jsxs(
556
- "div",
557
- {
558
- style: {
559
- display: "flex",
560
- flexDirection: "column",
561
- alignItems: "center",
562
- justifyContent: "center",
563
- gap: "8px"
564
- },
565
- children: [
566
- /* @__PURE__ */ jsx2(IconComponent, { size: 32, style: { color: textColor, opacity: 0.4 } }),
567
- label && /* @__PURE__ */ jsx2("span", { style: { color: textColor, fontSize: "11px", opacity: 0.4 }, children: label })
568
- ]
569
- }
570
- )
551
+ /* @__PURE__ */ jsx2(Link2, { size: 32, style: { color: textColor, opacity: 0.4 } })
571
552
  ]
572
553
  }
573
- ),
574
- /* @__PURE__ */ jsx2(UrlLabel, { displayUrl })
575
- ] });
576
- if (mediaError && (type === "image" || type === "video")) {
577
- return /* @__PURE__ */ jsx2(PlaceholderCard, { icon: Link2, displayUrl: url });
554
+ ) });
578
555
  }
579
- switch (type) {
580
- case "image":
581
- if (!mediaLoaded) {
582
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [
583
- /* @__PURE__ */ jsxs(
584
- "div",
585
- {
586
- className: cn(defaultClasses.previewSkeleton, classNames.previewSkeleton),
587
- style: {
588
- position: "relative",
589
- backgroundColor: bgColor,
590
- width: "200px",
591
- height: "120px",
592
- overflow: "hidden",
593
- display: "flex",
594
- alignItems: "center",
595
- justifyContent: "center"
596
- },
597
- children: [
598
- /* @__PURE__ */ jsx2("div", { style: { position: "absolute", inset: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx2(
599
- "div",
600
- {
601
- style: {
602
- position: "absolute",
603
- inset: 0,
604
- background: `linear-gradient(90deg, transparent, ${shimmerColor}, transparent)`,
605
- animation: "sharesheet-shimmer 1.5s infinite"
606
- }
607
- }
608
- ) }),
609
- /* @__PURE__ */ jsx2(Image, { size: 32, style: { color: textColor, opacity: 0.4 } })
610
- ]
611
- }
612
- ),
613
- /* @__PURE__ */ jsx2(UrlLabel, {}),
614
- /* @__PURE__ */ jsx2(
615
- "img",
616
- {
617
- src: url,
618
- alt: alt || "Preview",
619
- onLoad: handleMediaLoad,
620
- onError: handleMediaError,
621
- style: { display: "none" }
622
- }
623
- )
624
- ] });
625
- }
626
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [
627
- /* @__PURE__ */ jsx2(
628
- "img",
556
+ if (!ogData || !hasImage) {
557
+ return /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", width: "100%" }, children: /* @__PURE__ */ jsx2(
558
+ "div",
559
+ {
560
+ className: cn(defaultClasses.previewSkeleton, classNames.previewSkeleton),
561
+ style: {
562
+ position: "relative",
563
+ backgroundColor: bgColor,
564
+ width: "100%",
565
+ maxWidth: "320px",
566
+ aspectRatio: "1.91 / 1",
567
+ overflow: "hidden",
568
+ display: "flex",
569
+ alignItems: "center",
570
+ justifyContent: "center"
571
+ },
572
+ children: /* @__PURE__ */ jsxs(
573
+ "div",
629
574
  {
630
- src: url,
631
- alt: alt || "Preview",
632
- className: cn(defaultClasses.previewImage, classNames.previewImage),
633
575
  style: {
634
- maxWidth: "100%",
635
- maxHeight: "180px",
636
- borderRadius: "12px",
637
- opacity: 1,
638
- transition: "opacity 0.3s ease-in-out"
639
- }
640
- }
641
- ),
642
- /* @__PURE__ */ jsx2(UrlLabel, {})
643
- ] });
644
- case "video":
645
- if (!mediaLoaded) {
646
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [
647
- /* @__PURE__ */ jsxs(
648
- "div",
649
- {
650
- className: cn(defaultClasses.previewSkeleton, classNames.previewSkeleton),
651
- style: {
652
- position: "relative",
653
- backgroundColor: bgColor,
654
- width: "200px",
655
- height: "120px",
656
- overflow: "hidden",
657
- display: "flex",
658
- alignItems: "center",
659
- justifyContent: "center"
660
- },
661
- children: [
662
- /* @__PURE__ */ jsx2("div", { style: { position: "absolute", inset: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx2(
663
- "div",
664
- {
665
- style: {
666
- position: "absolute",
667
- inset: 0,
668
- background: `linear-gradient(90deg, transparent, ${shimmerColor}, transparent)`,
669
- animation: "sharesheet-shimmer 1.5s infinite"
670
- }
671
- }
672
- ) }),
673
- /* @__PURE__ */ jsx2(Film, { size: 32, style: { color: textColor, opacity: 0.4 } })
674
- ]
675
- }
676
- ),
677
- /* @__PURE__ */ jsx2(UrlLabel, {}),
678
- /* @__PURE__ */ jsx2(
679
- "video",
680
- {
681
- src: url,
682
- poster,
683
- onLoadedData: handleMediaLoad,
684
- onError: handleMediaError,
685
- style: { display: "none" },
686
- muted: true,
687
- playsInline: true,
688
- preload: "metadata"
689
- }
690
- )
691
- ] });
692
- }
693
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [
694
- /* @__PURE__ */ jsxs("div", { style: { position: "relative", borderRadius: "12px", overflow: "hidden" }, children: [
695
- /* @__PURE__ */ jsx2(
696
- "video",
697
- {
698
- src: url,
699
- poster,
700
- className: cn(defaultClasses.previewVideo, classNames.previewVideo),
701
- style: {
702
- maxWidth: "100%",
703
- maxHeight: "180px",
704
- display: "block"
705
- },
706
- muted: true,
707
- playsInline: true,
708
- preload: "metadata"
709
- }
710
- ),
711
- /* @__PURE__ */ jsx2(
712
- "div",
713
- {
714
- style: {
715
- position: "absolute",
716
- inset: 0,
717
- display: "flex",
718
- alignItems: "center",
719
- justifyContent: "center",
720
- pointerEvents: "none"
721
- },
722
- children: /* @__PURE__ */ jsx2(
723
- "div",
576
+ display: "flex",
577
+ flexDirection: "column",
578
+ alignItems: "center",
579
+ justifyContent: "center",
580
+ gap: "8px",
581
+ padding: "16px"
582
+ },
583
+ children: [
584
+ /* @__PURE__ */ jsx2(Link2, { size: 32, style: { color: textColor, opacity: 0.4 } }),
585
+ ogData?.title && /* @__PURE__ */ jsx2(
586
+ "span",
724
587
  {
725
588
  style: {
726
- backgroundColor: "rgba(0, 0, 0, 0.5)",
727
- borderRadius: "50%",
728
- padding: "10px"
589
+ color: textColor,
590
+ fontSize: "12px",
591
+ opacity: 0.6,
592
+ textAlign: "center",
593
+ maxWidth: "280px",
594
+ overflow: "hidden",
595
+ textOverflow: "ellipsis",
596
+ display: "-webkit-box",
597
+ WebkitLineClamp: 2,
598
+ WebkitBoxOrient: "vertical"
729
599
  },
730
- children: /* @__PURE__ */ jsx2(Play, { size: 20, fill: "white", color: "white" })
600
+ children: ogData.title
731
601
  }
732
602
  )
733
- }
734
- )
735
- ] }),
736
- /* @__PURE__ */ jsx2(UrlLabel, {})
737
- ] });
738
- case "audio":
739
- return /* @__PURE__ */ jsx2(PlaceholderCard, { icon: Music, label: filename || "Audio", displayUrl: url });
740
- case "file":
741
- return /* @__PURE__ */ jsx2(PlaceholderCard, { icon: FileText, label: filename || "File", displayUrl: url });
742
- case "link":
743
- default:
744
- return /* @__PURE__ */ jsx2(PlaceholderCard, { icon: Link2, displayUrl: url });
603
+ ]
604
+ }
605
+ )
606
+ }
607
+ ) });
608
+ }
609
+ if (!imageLoaded) {
610
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", width: "100%" }, children: [
611
+ /* @__PURE__ */ jsxs(
612
+ "div",
613
+ {
614
+ className: cn(defaultClasses.previewSkeleton, classNames.previewSkeleton),
615
+ style: {
616
+ position: "relative",
617
+ backgroundColor: bgColor,
618
+ width: "100%",
619
+ maxWidth: "320px",
620
+ aspectRatio: "1.91 / 1",
621
+ overflow: "hidden",
622
+ display: "flex",
623
+ alignItems: "center",
624
+ justifyContent: "center"
625
+ },
626
+ children: [
627
+ /* @__PURE__ */ jsx2("div", { style: { position: "absolute", inset: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx2(
628
+ "div",
629
+ {
630
+ style: {
631
+ position: "absolute",
632
+ inset: 0,
633
+ background: `linear-gradient(90deg, transparent, ${shimmerColor}, transparent)`,
634
+ animation: "sharesheet-shimmer 1.5s infinite"
635
+ }
636
+ }
637
+ ) }),
638
+ /* @__PURE__ */ jsx2(Image, { size: 32, style: { color: textColor, opacity: 0.4 } })
639
+ ]
640
+ }
641
+ ),
642
+ /* @__PURE__ */ jsx2(
643
+ "img",
644
+ {
645
+ src: ogImage,
646
+ alt: ogData.title || "Preview",
647
+ onLoad: handleImageLoad,
648
+ onError: handleImageError,
649
+ style: { display: "none" }
650
+ }
651
+ )
652
+ ] });
745
653
  }
654
+ return /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", width: "100%" }, children: /* @__PURE__ */ jsx2(
655
+ "img",
656
+ {
657
+ src: ogImage,
658
+ alt: ogData.title || "Preview",
659
+ className: cn(defaultClasses.previewImage, classNames.previewImage),
660
+ style: {
661
+ width: "100%",
662
+ maxWidth: "320px",
663
+ height: "auto",
664
+ borderRadius: "12px",
665
+ opacity: 1,
666
+ transition: "opacity 0.3s ease-in-out"
667
+ }
668
+ }
669
+ ) });
746
670
  };
747
671
  return /* @__PURE__ */ jsxs("div", { className: cn(defaultClasses.root, classNames.root, className), children: [
748
672
  /* @__PURE__ */ jsx2("style", { dangerouslySetInnerHTML: { __html: shimmerKeyframes } }),
@@ -764,7 +688,7 @@ function ShareSheetContent({
764
688
  }
765
689
  )
766
690
  ] }),
767
- showPreview && /* @__PURE__ */ jsx2("div", { className: cn(defaultClasses.preview, classNames.preview), children: renderPreview() }),
691
+ /* @__PURE__ */ jsx2("div", { className: cn(defaultClasses.preview, classNames.preview), children: renderPreview() }),
768
692
  /* @__PURE__ */ jsx2("div", { className: cn(defaultClasses.grid, classNames.grid), children: visibleButtons.map((btn) => /* @__PURE__ */ jsxs(
769
693
  "button",
770
694
  {