@sonordev/agency-site-kit 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +302 -0
- package/bin/setup.mjs +79 -0
- package/dist/{chunk-RXBK2EOE.js → chunk-4IES23GV.js} +3 -3
- package/dist/{chunk-RXBK2EOE.js.map → chunk-4IES23GV.js.map} +1 -1
- package/dist/chunk-4N7ENJ7L.cjs +108 -0
- package/dist/chunk-4N7ENJ7L.cjs.map +1 -0
- package/dist/{chunk-WNR4KNG4.cjs → chunk-5MEZU3OG.cjs} +4 -4
- package/dist/{chunk-WNR4KNG4.cjs.map → chunk-5MEZU3OG.cjs.map} +1 -1
- package/dist/chunk-7ZHRMWJU.cjs +306 -0
- package/dist/chunk-7ZHRMWJU.cjs.map +1 -0
- package/dist/chunk-CVT7I5BQ.js +71 -0
- package/dist/chunk-CVT7I5BQ.js.map +1 -0
- package/dist/chunk-HQGAX2LI.cjs +8 -0
- package/dist/chunk-HQGAX2LI.cjs.map +1 -0
- package/dist/chunk-KXLROAO5.js +291 -0
- package/dist/chunk-KXLROAO5.js.map +1 -0
- package/dist/chunk-L4EOQVRJ.js +6 -0
- package/dist/chunk-L4EOQVRJ.js.map +1 -0
- package/dist/chunk-L7E3UHQC.cjs +535 -0
- package/dist/chunk-L7E3UHQC.cjs.map +1 -0
- package/dist/chunk-NI4FVCLS.cjs +32 -0
- package/dist/chunk-NI4FVCLS.cjs.map +1 -0
- package/dist/chunk-NIZJLONK.js +106 -0
- package/dist/chunk-NIZJLONK.js.map +1 -0
- package/dist/chunk-QDXZ27R7.js +33 -0
- package/dist/chunk-QDXZ27R7.js.map +1 -0
- package/dist/{chunk-TVFXN6W6.js → chunk-QL6KVIFR.js} +8 -4
- package/dist/chunk-QL6KVIFR.js.map +1 -0
- package/dist/chunk-UNTOEWQL.js +504 -0
- package/dist/chunk-UNTOEWQL.js.map +1 -0
- package/dist/chunk-XJ434N7I.js +30 -0
- package/dist/chunk-XJ434N7I.js.map +1 -0
- package/dist/chunk-XLK77USA.js +45 -0
- package/dist/chunk-XLK77USA.js.map +1 -0
- package/dist/{chunk-EE75WRCM.cjs → chunk-XOWSXZYW.cjs} +8 -4
- package/dist/chunk-XOWSXZYW.cjs.map +1 -0
- package/dist/chunk-ZINKVJQU.js +67 -0
- package/dist/chunk-ZINKVJQU.js.map +1 -0
- package/dist/index.cjs +29 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -9
- package/dist/index.d.ts +17 -9
- package/dist/index.js +7 -8
- package/dist/index.js.map +1 -1
- package/dist/layout/index.cjs +3 -3
- package/dist/layout/index.d.cts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +2 -2
- package/dist/portfolio/client.cjs +342 -12
- package/dist/portfolio/client.cjs.map +1 -1
- package/dist/portfolio/client.d.cts +11 -88
- package/dist/portfolio/client.d.ts +11 -88
- package/dist/portfolio/client.js +150 -4
- package/dist/portfolio/client.js.map +1 -1
- package/dist/portfolio/components/PortfolioAnalytics.cjs +87 -0
- package/dist/portfolio/components/PortfolioAnalytics.cjs.map +1 -0
- package/dist/portfolio/components/PortfolioAnalytics.d.cts +5 -0
- package/dist/portfolio/components/PortfolioAnalytics.d.ts +5 -0
- package/dist/portfolio/components/PortfolioAnalytics.js +9 -0
- package/dist/portfolio/components/PortfolioAnalytics.js.map +1 -0
- package/dist/portfolio/components/PortfolioErrorFallback.cjs +65 -0
- package/dist/portfolio/components/PortfolioErrorFallback.cjs.map +1 -0
- package/dist/portfolio/components/PortfolioErrorFallback.d.cts +22 -0
- package/dist/portfolio/components/PortfolioErrorFallback.d.ts +22 -0
- package/dist/portfolio/components/PortfolioErrorFallback.js +9 -0
- package/dist/portfolio/components/PortfolioErrorFallback.js.map +1 -0
- package/dist/portfolio/components/PortfolioLeadCTA.cjs +91 -0
- package/dist/portfolio/components/PortfolioLeadCTA.cjs.map +1 -0
- package/dist/portfolio/components/PortfolioLeadCTA.d.cts +34 -0
- package/dist/portfolio/components/PortfolioLeadCTA.d.ts +34 -0
- package/dist/portfolio/components/PortfolioLeadCTA.js +9 -0
- package/dist/portfolio/components/PortfolioLeadCTA.js.map +1 -0
- package/dist/portfolio/index.cjs +19 -19
- package/dist/portfolio/index.d.cts +133 -7
- package/dist/portfolio/index.d.ts +133 -7
- package/dist/portfolio/index.js +6 -6
- package/dist/portfolio/primitives/AnimatedCounter.cjs +88 -0
- package/dist/portfolio/primitives/AnimatedCounter.cjs.map +1 -0
- package/dist/portfolio/primitives/AnimatedCounter.d.cts +22 -0
- package/dist/portfolio/primitives/AnimatedCounter.d.ts +22 -0
- package/dist/portfolio/primitives/AnimatedCounter.js +68 -0
- package/dist/portfolio/primitives/AnimatedCounter.js.map +1 -0
- package/dist/portfolio/primitives/AnnotatedImage.cjs +320 -0
- package/dist/portfolio/primitives/AnnotatedImage.cjs.map +1 -0
- package/dist/portfolio/primitives/AnnotatedImage.d.cts +18 -0
- package/dist/portfolio/primitives/AnnotatedImage.d.ts +18 -0
- package/dist/portfolio/primitives/AnnotatedImage.js +264 -0
- package/dist/portfolio/primitives/AnnotatedImage.js.map +1 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.cjs +348 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.cjs.map +1 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.d.cts +13 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.d.ts +13 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.js +292 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.js.map +1 -0
- package/dist/portfolio/primitives/DeviceTrifolio.cjs +298 -0
- package/dist/portfolio/primitives/DeviceTrifolio.cjs.map +1 -0
- package/dist/portfolio/primitives/DeviceTrifolio.d.cts +14 -0
- package/dist/portfolio/primitives/DeviceTrifolio.d.ts +14 -0
- package/dist/portfolio/primitives/DeviceTrifolio.js +242 -0
- package/dist/portfolio/primitives/DeviceTrifolio.js.map +1 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.cjs +88 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.cjs.map +1 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.d.cts +10 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.d.ts +10 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.js +68 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.js.map +1 -0
- package/dist/portfolio/primitives/GlassCard.cjs +45 -0
- package/dist/portfolio/primitives/GlassCard.cjs.map +1 -0
- package/dist/portfolio/primitives/GlassCard.d.cts +11 -0
- package/dist/portfolio/primitives/GlassCard.d.ts +11 -0
- package/dist/portfolio/primitives/GlassCard.js +43 -0
- package/dist/portfolio/primitives/GlassCard.js.map +1 -0
- package/dist/portfolio/primitives/MetricBadge.cjs +74 -0
- package/dist/portfolio/primitives/MetricBadge.cjs.map +1 -0
- package/dist/portfolio/primitives/MetricBadge.d.cts +9 -0
- package/dist/portfolio/primitives/MetricBadge.d.ts +9 -0
- package/dist/portfolio/primitives/MetricBadge.js +54 -0
- package/dist/portfolio/primitives/MetricBadge.js.map +1 -0
- package/dist/portfolio/primitives/SVGChart.cjs +316 -0
- package/dist/portfolio/primitives/SVGChart.cjs.map +1 -0
- package/dist/portfolio/primitives/SVGChart.d.cts +18 -0
- package/dist/portfolio/primitives/SVGChart.d.ts +18 -0
- package/dist/portfolio/primitives/SVGChart.js +296 -0
- package/dist/portfolio/primitives/SVGChart.js.map +1 -0
- package/dist/portfolio/primitives/ScrollReveal.cjs +97 -0
- package/dist/portfolio/primitives/ScrollReveal.cjs.map +1 -0
- package/dist/portfolio/primitives/ScrollReveal.d.cts +27 -0
- package/dist/portfolio/primitives/ScrollReveal.d.ts +27 -0
- package/dist/portfolio/primitives/ScrollReveal.js +77 -0
- package/dist/portfolio/primitives/ScrollReveal.js.map +1 -0
- package/dist/portfolio/primitives/SplitHeadline.cjs +107 -0
- package/dist/portfolio/primitives/SplitHeadline.cjs.map +1 -0
- package/dist/portfolio/primitives/SplitHeadline.d.cts +24 -0
- package/dist/portfolio/primitives/SplitHeadline.d.ts +24 -0
- package/dist/portfolio/primitives/SplitHeadline.js +87 -0
- package/dist/portfolio/primitives/SplitHeadline.js.map +1 -0
- package/dist/portfolio/sections/BeforeAfterSection.cjs +271 -0
- package/dist/portfolio/sections/BeforeAfterSection.cjs.map +1 -0
- package/dist/portfolio/sections/BeforeAfterSection.d.cts +9 -0
- package/dist/portfolio/sections/BeforeAfterSection.d.ts +9 -0
- package/dist/{BeforeAfterSection-6BHFLY4Y.js → portfolio/sections/BeforeAfterSection.js} +66 -27
- package/dist/portfolio/sections/BeforeAfterSection.js.map +1 -0
- package/dist/portfolio/sections/CTASection.cjs +123 -0
- package/dist/portfolio/sections/CTASection.cjs.map +1 -0
- package/dist/portfolio/sections/CTASection.d.cts +9 -0
- package/dist/portfolio/sections/CTASection.d.ts +9 -0
- package/dist/portfolio/sections/CTASection.js +93 -0
- package/dist/portfolio/sections/CTASection.js.map +1 -0
- package/dist/{ChallengesSection-IZ3DHECS.cjs → portfolio/sections/ChallengesSection.cjs} +12 -6
- package/dist/portfolio/sections/ChallengesSection.cjs.map +1 -0
- package/dist/portfolio/sections/ChallengesSection.d.cts +9 -0
- package/dist/portfolio/sections/ChallengesSection.d.ts +9 -0
- package/dist/{ChallengesSection-GEQGVSJN.js → portfolio/sections/ChallengesSection.js} +5 -4
- package/dist/portfolio/sections/ChallengesSection.js.map +1 -0
- package/dist/portfolio/sections/ConversionFunnelSection.cjs +263 -0
- package/dist/portfolio/sections/ConversionFunnelSection.cjs.map +1 -0
- package/dist/portfolio/sections/ConversionFunnelSection.d.cts +9 -0
- package/dist/portfolio/sections/ConversionFunnelSection.d.ts +9 -0
- package/dist/{ConversionFunnelSection-D3GE4NKE.js → portfolio/sections/ConversionFunnelSection.js} +60 -56
- package/dist/portfolio/sections/ConversionFunnelSection.js.map +1 -0
- package/dist/{DesignSystemSection-KXIQXITF.cjs → portfolio/sections/DesignSystemSection.cjs} +13 -7
- package/dist/portfolio/sections/DesignSystemSection.cjs.map +1 -0
- package/dist/portfolio/sections/DesignSystemSection.d.cts +32 -0
- package/dist/portfolio/sections/DesignSystemSection.d.ts +32 -0
- package/dist/{DesignSystemSection-2R5BRBGO.js → portfolio/sections/DesignSystemSection.js} +5 -4
- package/dist/portfolio/sections/DesignSystemSection.js.map +1 -0
- package/dist/{DetailsSection-TTUZAPZZ.cjs → portfolio/sections/DetailsSection.cjs} +12 -6
- package/dist/portfolio/sections/DetailsSection.cjs.map +1 -0
- package/dist/portfolio/sections/DetailsSection.d.cts +9 -0
- package/dist/portfolio/sections/DetailsSection.d.ts +9 -0
- package/dist/{DetailsSection-A6PZQUQL.js → portfolio/sections/DetailsSection.js} +5 -4
- package/dist/portfolio/sections/DetailsSection.js.map +1 -0
- package/dist/portfolio/sections/FeatureSpotlightSection.cjs +267 -0
- package/dist/portfolio/sections/FeatureSpotlightSection.cjs.map +1 -0
- package/dist/portfolio/sections/FeatureSpotlightSection.d.cts +9 -0
- package/dist/portfolio/sections/FeatureSpotlightSection.d.ts +9 -0
- package/dist/{FeatureSpotlightSection-B7P3JGNL.js → portfolio/sections/FeatureSpotlightSection.js} +39 -33
- package/dist/portfolio/sections/FeatureSpotlightSection.js.map +1 -0
- package/dist/portfolio/sections/GallerySection.cjs +321 -0
- package/dist/portfolio/sections/GallerySection.cjs.map +1 -0
- package/dist/portfolio/sections/GallerySection.d.cts +9 -0
- package/dist/portfolio/sections/GallerySection.d.ts +9 -0
- package/dist/{GallerySection-VMKORC47.js → portfolio/sections/GallerySection.js} +65 -18
- package/dist/portfolio/sections/GallerySection.js.map +1 -0
- package/dist/portfolio/sections/HeroSection.cjs +180 -0
- package/dist/portfolio/sections/HeroSection.cjs.map +1 -0
- package/dist/portfolio/sections/HeroSection.d.cts +15 -0
- package/dist/portfolio/sections/HeroSection.d.ts +15 -0
- package/dist/portfolio/sections/HeroSection.js +171 -0
- package/dist/portfolio/sections/HeroSection.js.map +1 -0
- package/dist/{MetricsTimelineSection-4L6DUHJ5.cjs → portfolio/sections/MetricsTimelineSection.cjs} +102 -61
- package/dist/portfolio/sections/MetricsTimelineSection.cjs.map +1 -0
- package/dist/portfolio/sections/MetricsTimelineSection.d.cts +9 -0
- package/dist/portfolio/sections/MetricsTimelineSection.d.ts +9 -0
- package/dist/{MetricsTimelineSection-6BT5GNFV.js → portfolio/sections/MetricsTimelineSection.js} +45 -29
- package/dist/portfolio/sections/MetricsTimelineSection.js.map +1 -0
- package/dist/{PerformanceSection-24TVVFZA.cjs → portfolio/sections/PerformanceSection.cjs} +136 -93
- package/dist/portfolio/sections/PerformanceSection.cjs.map +1 -0
- package/dist/portfolio/sections/PerformanceSection.d.cts +22 -0
- package/dist/portfolio/sections/PerformanceSection.d.ts +22 -0
- package/dist/{PerformanceSection-MGCEIXDX.js → portfolio/sections/PerformanceSection.js} +58 -40
- package/dist/portfolio/sections/PerformanceSection.js.map +1 -0
- package/dist/{ResultsSection-XLGMMQKY.cjs → portfolio/sections/ResultsSection.cjs} +22 -10
- package/dist/portfolio/sections/ResultsSection.cjs.map +1 -0
- package/dist/portfolio/sections/ResultsSection.d.cts +13 -0
- package/dist/portfolio/sections/ResultsSection.d.ts +13 -0
- package/dist/{ResultsSection-DFUJ5U6M.js → portfolio/sections/ResultsSection.js} +13 -7
- package/dist/portfolio/sections/ResultsSection.js.map +1 -0
- package/dist/portfolio/sections/ServicesSection.cjs +129 -0
- package/dist/portfolio/sections/ServicesSection.cjs.map +1 -0
- package/dist/portfolio/sections/ServicesSection.d.cts +9 -0
- package/dist/portfolio/sections/ServicesSection.d.ts +9 -0
- package/dist/portfolio/sections/ServicesSection.js +122 -0
- package/dist/portfolio/sections/ServicesSection.js.map +1 -0
- package/dist/{SiteArchitectureSection-J7BPBERH.cjs → portfolio/sections/SiteArchitectureSection.cjs} +116 -92
- package/dist/portfolio/sections/SiteArchitectureSection.cjs.map +1 -0
- package/dist/portfolio/sections/SiteArchitectureSection.d.cts +21 -0
- package/dist/portfolio/sections/SiteArchitectureSection.d.ts +21 -0
- package/dist/{SiteArchitectureSection-TE22OAWV.js → portfolio/sections/SiteArchitectureSection.js} +46 -47
- package/dist/portfolio/sections/SiteArchitectureSection.js.map +1 -0
- package/dist/{SpeedComparisonSection-EZKFQVGW.cjs → portfolio/sections/SpeedComparisonSection.cjs} +12 -6
- package/dist/portfolio/sections/SpeedComparisonSection.cjs.map +1 -0
- package/dist/portfolio/sections/SpeedComparisonSection.d.cts +20 -0
- package/dist/portfolio/sections/SpeedComparisonSection.d.ts +20 -0
- package/dist/{SpeedComparisonSection-Y3K7OFZQ.js → portfolio/sections/SpeedComparisonSection.js} +5 -4
- package/dist/portfolio/sections/SpeedComparisonSection.js.map +1 -0
- package/dist/portfolio/sections/StrategySection.cjs +233 -0
- package/dist/portfolio/sections/StrategySection.cjs.map +1 -0
- package/dist/portfolio/sections/StrategySection.d.cts +9 -0
- package/dist/portfolio/sections/StrategySection.d.ts +9 -0
- package/dist/{StrategySection-DI5RSCJU.js → portfolio/sections/StrategySection.js} +60 -26
- package/dist/portfolio/sections/StrategySection.js.map +1 -0
- package/dist/portfolio/sections/TeamSection.cjs +162 -0
- package/dist/portfolio/sections/TeamSection.cjs.map +1 -0
- package/dist/portfolio/sections/TeamSection.d.cts +9 -0
- package/dist/portfolio/sections/TeamSection.d.ts +9 -0
- package/dist/portfolio/sections/TeamSection.js +106 -0
- package/dist/portfolio/sections/TeamSection.js.map +1 -0
- package/dist/portfolio/sections/TechStackSection.cjs +106 -0
- package/dist/portfolio/sections/TechStackSection.cjs.map +1 -0
- package/dist/portfolio/sections/TechStackSection.d.cts +9 -0
- package/dist/portfolio/sections/TechStackSection.d.ts +9 -0
- package/dist/portfolio/sections/TechStackSection.js +99 -0
- package/dist/portfolio/sections/TechStackSection.js.map +1 -0
- package/dist/{TestimonialSection-XPTFUQIN.cjs → portfolio/sections/TestimonialSection.cjs} +47 -28
- package/dist/portfolio/sections/TestimonialSection.cjs.map +1 -0
- package/dist/portfolio/sections/TestimonialSection.d.cts +9 -0
- package/dist/portfolio/sections/TestimonialSection.d.ts +9 -0
- package/dist/{TestimonialSection-6RGSMXQB.js → portfolio/sections/TestimonialSection.js} +40 -27
- package/dist/portfolio/sections/TestimonialSection.js.map +1 -0
- package/dist/portfolio/sections/VideoSection.cjs +181 -0
- package/dist/portfolio/sections/VideoSection.cjs.map +1 -0
- package/dist/portfolio/sections/VideoSection.d.cts +9 -0
- package/dist/portfolio/sections/VideoSection.d.ts +9 -0
- package/dist/{VideoSection-4A2HC6K6.js → portfolio/sections/VideoSection.js} +21 -13
- package/dist/portfolio/sections/VideoSection.js.map +1 -0
- package/dist/portfolio/server.cjs +56 -139
- package/dist/portfolio/server.cjs.map +1 -1
- package/dist/portfolio/server.d.cts +157 -7
- package/dist/portfolio/server.d.ts +157 -7
- package/dist/portfolio/server.js +3 -137
- package/dist/portfolio/server.js.map +1 -1
- package/dist/preview.cjs +56 -0
- package/dist/preview.cjs.map +1 -0
- package/dist/preview.d.cts +31 -0
- package/dist/preview.d.ts +31 -0
- package/dist/preview.js +54 -0
- package/dist/preview.js.map +1 -0
- package/dist/{types-DL4t_Cfa.d.ts → types-0tVPy4pU.d.cts} +7 -1
- package/dist/{types-DL4t_Cfa.d.cts → types-0tVPy4pU.d.ts} +7 -1
- package/dist/types-D0nb6KAx.d.cts +299 -0
- package/dist/types-D0nb6KAx.d.ts +299 -0
- package/package.json +38 -14
- package/templates/api-portfolio-preview.ts +6 -0
- package/templates/api-revalidate.ts +5 -0
- package/templates/work-category-page.tsx +40 -0
- package/templates/work-error.tsx +3 -0
- package/templates/work-loading.tsx +1 -0
- package/templates/work-page.tsx +37 -0
- package/templates/work-slug-loading.tsx +1 -0
- package/templates/work-slug-page.tsx +41 -0
- package/dist/BeforeAfterSection-6BHFLY4Y.js.map +0 -1
- package/dist/BeforeAfterSection-JTORBR3A.cjs +0 -181
- package/dist/BeforeAfterSection-JTORBR3A.cjs.map +0 -1
- package/dist/CTASection-4JKLXEUF.cjs +0 -111
- package/dist/CTASection-4JKLXEUF.cjs.map +0 -1
- package/dist/CTASection-BJA72XIL.js +0 -106
- package/dist/CTASection-BJA72XIL.js.map +0 -1
- package/dist/ChallengesSection-GEQGVSJN.js.map +0 -1
- package/dist/ChallengesSection-IZ3DHECS.cjs.map +0 -1
- package/dist/ConversionFunnelSection-AUUSJ5HQ.cjs +0 -209
- package/dist/ConversionFunnelSection-AUUSJ5HQ.cjs.map +0 -1
- package/dist/ConversionFunnelSection-D3GE4NKE.js.map +0 -1
- package/dist/DesignSystemSection-2R5BRBGO.js.map +0 -1
- package/dist/DesignSystemSection-KXIQXITF.cjs.map +0 -1
- package/dist/DetailsSection-A6PZQUQL.js.map +0 -1
- package/dist/DetailsSection-TTUZAPZZ.cjs.map +0 -1
- package/dist/FeatureSpotlightSection-B7P3JGNL.js.map +0 -1
- package/dist/FeatureSpotlightSection-WRHXS7TU.cjs +0 -210
- package/dist/FeatureSpotlightSection-WRHXS7TU.cjs.map +0 -1
- package/dist/GallerySection-VMKORC47.js.map +0 -1
- package/dist/GallerySection-WJ4PQDBI.cjs +0 -219
- package/dist/GallerySection-WJ4PQDBI.cjs.map +0 -1
- package/dist/MetricsTimelineSection-4L6DUHJ5.cjs.map +0 -1
- package/dist/MetricsTimelineSection-6BT5GNFV.js.map +0 -1
- package/dist/PerformanceSection-24TVVFZA.cjs.map +0 -1
- package/dist/PerformanceSection-MGCEIXDX.js.map +0 -1
- package/dist/ResultsSection-DFUJ5U6M.js.map +0 -1
- package/dist/ResultsSection-XLGMMQKY.cjs.map +0 -1
- package/dist/ServicesSection-D5V3Q4GR.js +0 -118
- package/dist/ServicesSection-D5V3Q4GR.js.map +0 -1
- package/dist/ServicesSection-WJMGK2MF.cjs +0 -120
- package/dist/ServicesSection-WJMGK2MF.cjs.map +0 -1
- package/dist/SiteArchitectureSection-J7BPBERH.cjs.map +0 -1
- package/dist/SiteArchitectureSection-TE22OAWV.js.map +0 -1
- package/dist/SpeedComparisonSection-EZKFQVGW.cjs.map +0 -1
- package/dist/SpeedComparisonSection-Y3K7OFZQ.js.map +0 -1
- package/dist/StrategySection-CJ7Y6OFQ.cjs +0 -174
- package/dist/StrategySection-CJ7Y6OFQ.cjs.map +0 -1
- package/dist/StrategySection-DI5RSCJU.js.map +0 -1
- package/dist/TeamSection-DZVSNZE6.cjs +0 -112
- package/dist/TeamSection-DZVSNZE6.cjs.map +0 -1
- package/dist/TeamSection-HGKFW6PQ.js +0 -107
- package/dist/TeamSection-HGKFW6PQ.js.map +0 -1
- package/dist/TechStackSection-2AQ7RGY3.js +0 -93
- package/dist/TechStackSection-2AQ7RGY3.js.map +0 -1
- package/dist/TechStackSection-VTNNZR5V.cjs +0 -95
- package/dist/TechStackSection-VTNNZR5V.cjs.map +0 -1
- package/dist/TestimonialSection-6RGSMXQB.js.map +0 -1
- package/dist/TestimonialSection-XPTFUQIN.cjs.map +0 -1
- package/dist/VideoSection-4A2HC6K6.js.map +0 -1
- package/dist/VideoSection-G3DFS7UH.cjs +0 -118
- package/dist/VideoSection-G3DFS7UH.cjs.map +0 -1
- package/dist/chunk-2UNKXWQM.js +0 -630
- package/dist/chunk-2UNKXWQM.js.map +0 -1
- package/dist/chunk-2Y4O3LWM.js +0 -53
- package/dist/chunk-2Y4O3LWM.js.map +0 -1
- package/dist/chunk-7CFFAKDM.js +0 -74
- package/dist/chunk-7CFFAKDM.js.map +0 -1
- package/dist/chunk-APG2QSMB.js +0 -131
- package/dist/chunk-APG2QSMB.js.map +0 -1
- package/dist/chunk-EE75WRCM.cjs.map +0 -1
- package/dist/chunk-FDFVLYAM.cjs +0 -637
- package/dist/chunk-FDFVLYAM.cjs.map +0 -1
- package/dist/chunk-IKBK7HYX.cjs +0 -79
- package/dist/chunk-IKBK7HYX.cjs.map +0 -1
- package/dist/chunk-KEOHORIH.cjs +0 -79
- package/dist/chunk-KEOHORIH.cjs.map +0 -1
- package/dist/chunk-OA5ZM4OA.cjs +0 -139
- package/dist/chunk-OA5ZM4OA.cjs.map +0 -1
- package/dist/chunk-TVFXN6W6.js.map +0 -1
- package/dist/chunk-XCKXHK44.js +0 -15
- package/dist/chunk-XCKXHK44.js.map +0 -1
- package/dist/chunk-XONXEFJY.cjs +0 -58
- package/dist/chunk-XONXEFJY.cjs.map +0 -1
- package/dist/chunk-XQNJED46.cjs +0 -19
- package/dist/chunk-XQNJED46.cjs.map +0 -1
- package/dist/chunk-YB4B3OMC.js +0 -74
- package/dist/chunk-YB4B3OMC.js.map +0 -1
- package/dist/portfolio/sections.cjs +0 -20
- package/dist/portfolio/sections.cjs.map +0 -1
- package/dist/portfolio/sections.d.cts +0 -42
- package/dist/portfolio/sections.d.ts +0 -42
- package/dist/portfolio/sections.js +0 -4
- package/dist/portfolio/sections.js.map +0 -1
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/portfolio/components/primitives/AnnotatedImage.tsx
|
|
33
|
+
var AnnotatedImage_exports = {};
|
|
34
|
+
__export(AnnotatedImage_exports, {
|
|
35
|
+
default: () => AnnotatedImage
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(AnnotatedImage_exports);
|
|
38
|
+
var import_react = require("react");
|
|
39
|
+
var import_image = __toESM(require("next/image"), 1);
|
|
40
|
+
|
|
41
|
+
// src/shared/images.ts
|
|
42
|
+
var SANITY_ASSET_REF = /^image-[A-Za-z0-9]+-\d+x\d+-[a-z0-9]+$/;
|
|
43
|
+
var FILENAME_DIMS = /-(\d{2,5})x(\d{2,5})\.[a-z0-9]+(?:\?.*)?$/i;
|
|
44
|
+
var warnedAboutRefs = false;
|
|
45
|
+
function resolvePortfolioImage(input) {
|
|
46
|
+
const raw = typeof input === "string" ? input : input?.asset?._ref ?? "";
|
|
47
|
+
const value = (raw || "").trim();
|
|
48
|
+
if (!value) return null;
|
|
49
|
+
if (SANITY_ASSET_REF.test(value)) {
|
|
50
|
+
if (!warnedAboutRefs && typeof console !== "undefined") {
|
|
51
|
+
warnedAboutRefs = true;
|
|
52
|
+
console.warn(
|
|
53
|
+
"[@sonordev/agency-site-kit] Received a raw Sanity asset ref instead of an image URL \u2014 skipping render. The Sonor API should resolve image refs to cdn.sanity.io URLs before returning portfolio sections."
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
if (!/^https?:\/\//i.test(value) && !value.startsWith("/")) return null;
|
|
59
|
+
const dims = value.match(FILENAME_DIMS);
|
|
60
|
+
if (dims) {
|
|
61
|
+
const width = parseInt(dims[1], 10);
|
|
62
|
+
const height = parseInt(dims[2], 10);
|
|
63
|
+
if (width > 0 && height > 0) return { url: value, width, height };
|
|
64
|
+
}
|
|
65
|
+
return { url: value };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/portfolio/components/primitives/AnnotatedImage.tsx
|
|
69
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
70
|
+
var EASE = "cubic-bezier(0.25, 0.46, 0.45, 0.94)";
|
|
71
|
+
var EASE_BACK = "cubic-bezier(0.34, 1.56, 0.64, 1)";
|
|
72
|
+
var PIN_PULSE_CSS = `
|
|
73
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
74
|
+
.sk-pin-pulse {
|
|
75
|
+
animation: sk-pin-pulse 1.5s ease-out infinite;
|
|
76
|
+
}
|
|
77
|
+
@keyframes sk-pin-pulse {
|
|
78
|
+
from { transform: scale(1); opacity: 0.6; }
|
|
79
|
+
to { transform: scale(1.6); opacity: 0; }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
83
|
+
function AnnotatedImage({
|
|
84
|
+
src,
|
|
85
|
+
alt = "",
|
|
86
|
+
annotations,
|
|
87
|
+
className = "",
|
|
88
|
+
layout = "full"
|
|
89
|
+
}) {
|
|
90
|
+
const containerRef = (0, import_react.useRef)(null);
|
|
91
|
+
const pinsRef = (0, import_react.useRef)([]);
|
|
92
|
+
const revealedRef = (0, import_react.useRef)(false);
|
|
93
|
+
const [activeIndex, setActiveIndex] = (0, import_react.useState)(null);
|
|
94
|
+
const [isMobile, setIsMobile] = (0, import_react.useState)(false);
|
|
95
|
+
(0, import_react.useEffect)(() => {
|
|
96
|
+
const checkMobile = () => setIsMobile(window.innerWidth < 768);
|
|
97
|
+
checkMobile();
|
|
98
|
+
window.addEventListener("resize", checkMobile);
|
|
99
|
+
return () => window.removeEventListener("resize", checkMobile);
|
|
100
|
+
}, []);
|
|
101
|
+
(0, import_react.useEffect)(() => {
|
|
102
|
+
const container = containerRef.current;
|
|
103
|
+
if (!container) return;
|
|
104
|
+
const pins = pinsRef.current.filter(Boolean);
|
|
105
|
+
const showFinal = () => {
|
|
106
|
+
for (const pin of pins) {
|
|
107
|
+
pin.style.opacity = "1";
|
|
108
|
+
pin.style.transform = "translate(-50%, -50%) scale(1)";
|
|
109
|
+
}
|
|
110
|
+
revealedRef.current = true;
|
|
111
|
+
};
|
|
112
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
113
|
+
showFinal();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const rect = container.getBoundingClientRect();
|
|
117
|
+
if (rect.top < window.innerHeight && rect.bottom > 0) {
|
|
118
|
+
showFinal();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
for (const pin of pins) {
|
|
122
|
+
pin.style.opacity = "0";
|
|
123
|
+
pin.style.transform = "translate(-50%, -50%) scale(0)";
|
|
124
|
+
}
|
|
125
|
+
const io = new IntersectionObserver(
|
|
126
|
+
([entry]) => {
|
|
127
|
+
if (!entry.isIntersecting) return;
|
|
128
|
+
pins.forEach((pin, i) => {
|
|
129
|
+
const pinDelay = i * 0.15;
|
|
130
|
+
pin.style.transition = `opacity 0.4s ${EASE_BACK} ${pinDelay}s, transform 0.4s ${EASE_BACK} ${pinDelay}s`;
|
|
131
|
+
pin.style.opacity = "1";
|
|
132
|
+
pin.style.transform = "translate(-50%, -50%) scale(1)";
|
|
133
|
+
});
|
|
134
|
+
revealedRef.current = true;
|
|
135
|
+
io.disconnect();
|
|
136
|
+
},
|
|
137
|
+
{ rootMargin: "0px 0px -25% 0px" }
|
|
138
|
+
// ≈ 'top 75%' trigger start
|
|
139
|
+
);
|
|
140
|
+
io.observe(container);
|
|
141
|
+
return () => {
|
|
142
|
+
io.disconnect();
|
|
143
|
+
for (const pin of pins) pin.style.transition = "";
|
|
144
|
+
};
|
|
145
|
+
}, [annotations.length]);
|
|
146
|
+
(0, import_react.useEffect)(() => {
|
|
147
|
+
if (!revealedRef.current) return;
|
|
148
|
+
pinsRef.current.forEach((pin, i) => {
|
|
149
|
+
if (!pin) return;
|
|
150
|
+
pin.style.transition = `transform 0.25s ${EASE}`;
|
|
151
|
+
pin.style.transform = `translate(-50%, -50%) scale(${i === activeIndex ? 1.3 : 1})`;
|
|
152
|
+
});
|
|
153
|
+
}, [activeIndex]);
|
|
154
|
+
const handlePinClick = (index) => {
|
|
155
|
+
setActiveIndex(activeIndex === index ? null : index);
|
|
156
|
+
};
|
|
157
|
+
const image = resolvePortfolioImage(src);
|
|
158
|
+
if (!image) return null;
|
|
159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: containerRef, className, children: [
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { href: "sk-annotated-pulse", precedence: "default", children: PIN_PULSE_CSS }),
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { position: "relative", display: "inline-block", width: "100%" }, children: [
|
|
162
|
+
image.width && image.height ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
|
+
import_image.default,
|
|
164
|
+
{
|
|
165
|
+
src: image.url,
|
|
166
|
+
alt,
|
|
167
|
+
width: image.width,
|
|
168
|
+
height: image.height,
|
|
169
|
+
sizes: "(max-width: 1024px) 100vw, 1024px",
|
|
170
|
+
style: { display: "block", width: "100%", height: "auto", borderRadius: "12px" }
|
|
171
|
+
}
|
|
172
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
173
|
+
"img",
|
|
174
|
+
{
|
|
175
|
+
src: image.url,
|
|
176
|
+
alt,
|
|
177
|
+
loading: "lazy",
|
|
178
|
+
decoding: "async",
|
|
179
|
+
style: { display: "block", width: "100%", height: "auto", borderRadius: "12px" }
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
!isMobile && annotations.map((ann, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
183
|
+
"button",
|
|
184
|
+
{
|
|
185
|
+
ref: (el) => {
|
|
186
|
+
pinsRef.current[i] = el;
|
|
187
|
+
},
|
|
188
|
+
onClick: () => handlePinClick(i),
|
|
189
|
+
style: {
|
|
190
|
+
position: "absolute",
|
|
191
|
+
left: `${ann.x}%`,
|
|
192
|
+
top: `${ann.y}%`,
|
|
193
|
+
transform: "translate(-50%, -50%)",
|
|
194
|
+
width: "32px",
|
|
195
|
+
height: "32px",
|
|
196
|
+
borderRadius: "50%",
|
|
197
|
+
background: "var(--sk-primary, #6366f1)",
|
|
198
|
+
border: "2px solid white",
|
|
199
|
+
color: "white",
|
|
200
|
+
fontSize: "13px",
|
|
201
|
+
fontWeight: 700,
|
|
202
|
+
display: "flex",
|
|
203
|
+
alignItems: "center",
|
|
204
|
+
justifyContent: "center",
|
|
205
|
+
cursor: "pointer",
|
|
206
|
+
zIndex: 10,
|
|
207
|
+
opacity: 0,
|
|
208
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.3)",
|
|
209
|
+
padding: 0
|
|
210
|
+
},
|
|
211
|
+
"aria-label": ann.label,
|
|
212
|
+
children: [
|
|
213
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
214
|
+
"span",
|
|
215
|
+
{
|
|
216
|
+
className: "sk-pin-pulse",
|
|
217
|
+
style: {
|
|
218
|
+
position: "absolute",
|
|
219
|
+
inset: "-2px",
|
|
220
|
+
borderRadius: "50%",
|
|
221
|
+
border: "2px solid var(--sk-primary, #6366f1)",
|
|
222
|
+
opacity: 0.6,
|
|
223
|
+
pointerEvents: "none"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
i + 1,
|
|
228
|
+
activeIndex === i && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
style: {
|
|
232
|
+
position: "absolute",
|
|
233
|
+
bottom: "calc(100% + 12px)",
|
|
234
|
+
left: "50%",
|
|
235
|
+
transform: "translateX(-50%)",
|
|
236
|
+
width: "220px",
|
|
237
|
+
padding: "12px 14px",
|
|
238
|
+
borderRadius: "10px",
|
|
239
|
+
background: "var(--sk-surface, rgba(20,20,30,0.95))",
|
|
240
|
+
backdropFilter: "blur(12px)",
|
|
241
|
+
border: "1px solid var(--sk-border, rgba(255,255,255,0.1))",
|
|
242
|
+
color: "white",
|
|
243
|
+
fontSize: "13px",
|
|
244
|
+
lineHeight: "1.45",
|
|
245
|
+
textAlign: "left",
|
|
246
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.4)",
|
|
247
|
+
zIndex: 20,
|
|
248
|
+
pointerEvents: "auto"
|
|
249
|
+
},
|
|
250
|
+
onClick: (e) => e.stopPropagation(),
|
|
251
|
+
children: [
|
|
252
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { fontWeight: 700, marginBottom: "4px", fontSize: "14px" }, children: ann.label }),
|
|
253
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { opacity: 0.8 }, children: ann.description }),
|
|
254
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
255
|
+
"div",
|
|
256
|
+
{
|
|
257
|
+
style: {
|
|
258
|
+
position: "absolute",
|
|
259
|
+
bottom: "-6px",
|
|
260
|
+
left: "50%",
|
|
261
|
+
transform: "translateX(-50%) rotate(45deg)",
|
|
262
|
+
width: "12px",
|
|
263
|
+
height: "12px",
|
|
264
|
+
background: "var(--sk-surface, rgba(20,20,30,0.95))",
|
|
265
|
+
borderRight: "1px solid var(--sk-border, rgba(255,255,255,0.1))",
|
|
266
|
+
borderBottom: "1px solid var(--sk-border, rgba(255,255,255,0.1))"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
i
|
|
276
|
+
))
|
|
277
|
+
] }),
|
|
278
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { marginTop: "16px", display: "flex", flexDirection: "column", gap: "12px" }, children: annotations.map((ann, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
279
|
+
"div",
|
|
280
|
+
{
|
|
281
|
+
style: {
|
|
282
|
+
display: "flex",
|
|
283
|
+
gap: "12px",
|
|
284
|
+
alignItems: "flex-start",
|
|
285
|
+
padding: "12px",
|
|
286
|
+
borderRadius: "10px",
|
|
287
|
+
background: "var(--sk-surface, rgba(255,255,255,0.05))",
|
|
288
|
+
border: "1px solid var(--sk-border, rgba(255,255,255,0.1))"
|
|
289
|
+
},
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
292
|
+
"span",
|
|
293
|
+
{
|
|
294
|
+
style: {
|
|
295
|
+
flexShrink: 0,
|
|
296
|
+
width: "28px",
|
|
297
|
+
height: "28px",
|
|
298
|
+
borderRadius: "50%",
|
|
299
|
+
background: "var(--sk-primary, #6366f1)",
|
|
300
|
+
color: "white",
|
|
301
|
+
fontSize: "13px",
|
|
302
|
+
fontWeight: 700,
|
|
303
|
+
display: "flex",
|
|
304
|
+
alignItems: "center",
|
|
305
|
+
justifyContent: "center"
|
|
306
|
+
},
|
|
307
|
+
children: i + 1
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
311
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { fontWeight: 600, marginBottom: "2px" }, children: ann.label }),
|
|
312
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { opacity: 0.7, fontSize: "14px", lineHeight: "1.45" }, children: ann.description })
|
|
313
|
+
] })
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
i
|
|
317
|
+
)) })
|
|
318
|
+
] });
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=AnnotatedImage.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/portfolio/components/primitives/AnnotatedImage.tsx","../../../src/shared/images.ts"],"sourcesContent":["'use client';\n\nimport React, { useRef, useEffect, useState } from 'react';\nimport Image from 'next/image';\nimport { resolvePortfolioImage } from '../../../shared/images';\n\ninterface Annotation {\n x: number;\n y: number;\n label: string;\n description: string;\n}\n\ninterface AnnotatedImageProps {\n src: string;\n alt?: string;\n annotations: Annotation[];\n className?: string;\n layout?: 'left' | 'right' | 'full';\n}\n\nconst EASE = 'cubic-bezier(0.25, 0.46, 0.45, 0.94)'; // ≈ power2.out\nconst EASE_BACK = 'cubic-bezier(0.34, 1.56, 0.64, 1)'; // ≈ back.out(1.7) — overshoot pop\n\n// Pulse ring loop — pure CSS (1.5s ease-out ≈ power1.out, infinite), gated\n// behind prefers-reduced-motion so it simply never runs for those users.\nconst PIN_PULSE_CSS = `\n@media (prefers-reduced-motion: no-preference) {\n .sk-pin-pulse {\n animation: sk-pin-pulse 1.5s ease-out infinite;\n }\n @keyframes sk-pin-pulse {\n from { transform: scale(1); opacity: 0.6; }\n to { transform: scale(1.6); opacity: 0; }\n }\n}\n`;\n\nexport default function AnnotatedImage({\n src,\n alt = '',\n annotations,\n className = '',\n layout = 'full',\n}: AnnotatedImageProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n const pinsRef = useRef<(HTMLButtonElement | null)[]>([]);\n const revealedRef = useRef(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n const [isMobile, setIsMobile] = useState(false);\n\n useEffect(() => {\n const checkMobile = () => setIsMobile(window.innerWidth < 768);\n checkMobile();\n window.addEventListener('resize', checkMobile);\n return () => window.removeEventListener('resize', checkMobile);\n }, []);\n\n // Pin entrance — IntersectionObserver + CSS transitions\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n const pins = pinsRef.current.filter(Boolean) as HTMLButtonElement[];\n\n // Final state — the markup ships pins transparent, so reduced motion and\n // containers already in the viewport at hydration show them immediately.\n const showFinal = () => {\n for (const pin of pins) {\n pin.style.opacity = '1';\n pin.style.transform = 'translate(-50%, -50%) scale(1)';\n }\n revealedRef.current = true;\n };\n\n if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {\n showFinal();\n return;\n }\n\n const rect = container.getBoundingClientRect();\n if (rect.top < window.innerHeight && rect.bottom > 0) {\n showFinal();\n return;\n }\n\n // Hidden state (scale collapses on top of the positioning translate).\n for (const pin of pins) {\n pin.style.opacity = '0';\n pin.style.transform = 'translate(-50%, -50%) scale(0)';\n }\n\n const io = new IntersectionObserver(\n ([entry]) => {\n if (!entry.isIntersecting) return;\n pins.forEach((pin, i) => {\n const pinDelay = i * 0.15;\n pin.style.transition = `opacity 0.4s ${EASE_BACK} ${pinDelay}s, transform 0.4s ${EASE_BACK} ${pinDelay}s`;\n pin.style.opacity = '1';\n pin.style.transform = 'translate(-50%, -50%) scale(1)';\n });\n revealedRef.current = true;\n io.disconnect();\n },\n { rootMargin: '0px 0px -25% 0px' }, // ≈ 'top 75%' trigger start\n );\n io.observe(container);\n\n return () => {\n io.disconnect();\n // Only the transitions are reset — clearing transform/opacity here\n // would strip the positioning translate the pins rely on.\n for (const pin of pins) pin.style.transition = '';\n };\n }, [annotations.length]);\n\n // Active pin scale\n useEffect(() => {\n // The entrance owns opacity/transform until the pins have revealed.\n if (!revealedRef.current) return;\n pinsRef.current.forEach((pin, i) => {\n if (!pin) return;\n pin.style.transition = `transform 0.25s ${EASE}`;\n pin.style.transform = `translate(-50%, -50%) scale(${i === activeIndex ? 1.3 : 1})`;\n });\n }, [activeIndex]);\n\n const handlePinClick = (index: number) => {\n setActiveIndex(activeIndex === index ? null : index);\n };\n\n const image = resolvePortfolioImage(src);\n if (!image) return null;\n\n return (\n <div ref={containerRef} className={className}>\n <style href=\"sk-annotated-pulse\" precedence=\"default\">\n {PIN_PULSE_CSS}\n </style>\n {/* Image with pins (hidden on mobile) */}\n <div style={{ position: 'relative', display: 'inline-block', width: '100%' }}>\n {image.width && image.height ? (\n <Image\n src={image.url}\n alt={alt}\n width={image.width}\n height={image.height}\n sizes=\"(max-width: 1024px) 100vw, 1024px\"\n style={{ display: 'block', width: '100%', height: 'auto', borderRadius: '12px' }}\n />\n ) : (\n <img\n src={image.url}\n alt={alt}\n loading=\"lazy\"\n decoding=\"async\"\n style={{ display: 'block', width: '100%', height: 'auto', borderRadius: '12px' }}\n />\n )}\n\n {/* Annotation pins (desktop) */}\n {!isMobile &&\n annotations.map((ann, i) => (\n <button\n key={i}\n ref={(el) => { pinsRef.current[i] = el; }}\n onClick={() => handlePinClick(i)}\n style={{\n position: 'absolute',\n left: `${ann.x}%`,\n top: `${ann.y}%`,\n transform: 'translate(-50%, -50%)',\n width: '32px',\n height: '32px',\n borderRadius: '50%',\n background: 'var(--sk-primary, #6366f1)',\n border: '2px solid white',\n color: 'white',\n fontSize: '13px',\n fontWeight: 700,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n cursor: 'pointer',\n zIndex: 10,\n opacity: 0,\n boxShadow: '0 2px 8px rgba(0,0,0,0.3)',\n padding: 0,\n }}\n aria-label={ann.label}\n >\n {/* Pulse ring */}\n <span\n className=\"sk-pin-pulse\"\n style={{\n position: 'absolute',\n inset: '-2px',\n borderRadius: '50%',\n border: '2px solid var(--sk-primary, #6366f1)',\n opacity: 0.6,\n pointerEvents: 'none',\n }}\n />\n {i + 1}\n\n {/* Tooltip (active) */}\n {activeIndex === i && (\n <div\n style={{\n position: 'absolute',\n bottom: 'calc(100% + 12px)',\n left: '50%',\n transform: 'translateX(-50%)',\n width: '220px',\n padding: '12px 14px',\n borderRadius: '10px',\n background: 'var(--sk-surface, rgba(20,20,30,0.95))',\n backdropFilter: 'blur(12px)',\n border: '1px solid var(--sk-border, rgba(255,255,255,0.1))',\n color: 'white',\n fontSize: '13px',\n lineHeight: '1.45',\n textAlign: 'left',\n boxShadow: '0 8px 24px rgba(0,0,0,0.4)',\n zIndex: 20,\n pointerEvents: 'auto',\n }}\n onClick={(e) => e.stopPropagation()}\n >\n <div style={{ fontWeight: 700, marginBottom: '4px', fontSize: '14px' }}>\n {ann.label}\n </div>\n <div style={{ opacity: 0.8 }}>{ann.description}</div>\n {/* Arrow */}\n <div\n style={{\n position: 'absolute',\n bottom: '-6px',\n left: '50%',\n transform: 'translateX(-50%) rotate(45deg)',\n width: '12px',\n height: '12px',\n background: 'var(--sk-surface, rgba(20,20,30,0.95))',\n borderRight: '1px solid var(--sk-border, rgba(255,255,255,0.1))',\n borderBottom: '1px solid var(--sk-border, rgba(255,255,255,0.1))',\n }}\n />\n </div>\n )}\n </button>\n ))}\n </div>\n\n {/* Mobile: numbered list below image */}\n {isMobile && (\n <div style={{ marginTop: '16px', display: 'flex', flexDirection: 'column', gap: '12px' }}>\n {annotations.map((ann, i) => (\n <div\n key={i}\n style={{\n display: 'flex',\n gap: '12px',\n alignItems: 'flex-start',\n padding: '12px',\n borderRadius: '10px',\n background: 'var(--sk-surface, rgba(255,255,255,0.05))',\n border: '1px solid var(--sk-border, rgba(255,255,255,0.1))',\n }}\n >\n <span\n style={{\n flexShrink: 0,\n width: '28px',\n height: '28px',\n borderRadius: '50%',\n background: 'var(--sk-primary, #6366f1)',\n color: 'white',\n fontSize: '13px',\n fontWeight: 700,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n {i + 1}\n </span>\n <div>\n <div style={{ fontWeight: 600, marginBottom: '2px' }}>{ann.label}</div>\n <div style={{ opacity: 0.7, fontSize: '14px', lineHeight: '1.45' }}>\n {ann.description}\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n","/**\n * Portfolio image resolution — single source of truth for turning the mixed\n * image shapes the API sends (plain URL strings, Supabase Storage URLs,\n * Sanity image objects) into something safe to render.\n *\n * IMPORTANT: a raw Sanity asset _ref (`image-{id}-{W}x{H}-{fmt}`) is an asset\n * ID, NOT a URL. Rendering it as `src` issues a garbage relative request\n * against the agency site's origin. Resolving refs to cdn.sanity.io URLs is\n * the API's job (it owns the Sanity project config); this helper refuses refs\n * so a broken image can never render, and warns once so the gap is visible.\n *\n * When a URL carries `-{W}x{H}.{ext}` dimensions (Sanity CDN URLs always do),\n * they're parsed out so callers can give next/image exact intrinsic sizes.\n */\n\nexport interface ResolvedPortfolioImage {\n url: string;\n width?: number;\n height?: number;\n}\n\n/** Raw Sanity asset reference — an ID, not a URL. */\nconst SANITY_ASSET_REF = /^image-[A-Za-z0-9]+-\\d+x\\d+-[a-z0-9]+$/;\n\n/** `…-1200x800.png` (optionally with a query string) → intrinsic dimensions. */\nconst FILENAME_DIMS = /-(\\d{2,5})x(\\d{2,5})\\.[a-z0-9]+(?:\\?.*)?$/i;\n\ninterface SanityImageLike {\n asset?: { _ref?: string };\n}\n\nlet warnedAboutRefs = false;\n\n/**\n * Resolve a portfolio image input into a renderable URL (+ intrinsic\n * dimensions when they can be derived). Returns null for empty values and\n * for unresolved Sanity refs — callers skip rendering in that case.\n */\nexport function resolvePortfolioImage(\n input: string | SanityImageLike | null | undefined,\n): ResolvedPortfolioImage | null {\n const raw =\n typeof input === 'string' ? input : input?.asset?._ref ?? '';\n const value = (raw || '').trim();\n if (!value) return null;\n\n if (SANITY_ASSET_REF.test(value)) {\n if (!warnedAboutRefs && typeof console !== 'undefined') {\n warnedAboutRefs = true;\n console.warn(\n '[@sonordev/agency-site-kit] Received a raw Sanity asset ref instead of an ' +\n 'image URL — skipping render. The Sonor API should resolve image refs to ' +\n 'cdn.sanity.io URLs before returning portfolio sections.',\n );\n }\n return null;\n }\n\n // Only absolute http(s) URLs or site-rooted paths are renderable.\n if (!/^https?:\\/\\//i.test(value) && !value.startsWith('/')) return null;\n\n const dims = value.match(FILENAME_DIMS);\n if (dims) {\n const width = parseInt(dims[1], 10);\n const height = parseInt(dims[2], 10);\n if (width > 0 && height > 0) return { url: value, width, height };\n }\n\n return { url: value };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAmD;AACnD,mBAAkB;;;ACmBlB,IAAM,mBAAmB;AAGzB,IAAM,gBAAgB;AAMtB,IAAI,kBAAkB;AAOf,SAAS,sBACd,OAC+B;AAC/B,QAAM,MACJ,OAAO,UAAU,WAAW,QAAQ,OAAO,OAAO,QAAQ;AAC5D,QAAM,SAAS,OAAO,IAAI,KAAK;AAC/B,MAAI,CAAC,MAAO,QAAO;AAEnB,MAAI,iBAAiB,KAAK,KAAK,GAAG;AAChC,QAAI,CAAC,mBAAmB,OAAO,YAAY,aAAa;AACtD,wBAAkB;AAClB,cAAQ;AAAA,QACN;AAAA,MAGF;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAGA,MAAI,CAAC,gBAAgB,KAAK,KAAK,KAAK,CAAC,MAAM,WAAW,GAAG,EAAG,QAAO;AAEnE,QAAM,OAAO,MAAM,MAAM,aAAa;AACtC,MAAI,MAAM;AACR,UAAM,QAAQ,SAAS,KAAK,CAAC,GAAG,EAAE;AAClC,UAAM,SAAS,SAAS,KAAK,CAAC,GAAG,EAAE;AACnC,QAAI,QAAQ,KAAK,SAAS,EAAG,QAAO,EAAE,KAAK,OAAO,OAAO,OAAO;AAAA,EAClE;AAEA,SAAO,EAAE,KAAK,MAAM;AACtB;;;ADmEM;AAnHN,IAAM,OAAO;AACb,IAAM,YAAY;AAIlB,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYP,SAAR,eAAgC;AAAA,EACrC;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,YAAY;AAAA,EACZ,SAAS;AACX,GAAwB;AACtB,QAAM,mBAAe,qBAAuB,IA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,cAAc,MAAM,GAAI,cAAI,OAAM;AAAA,YACjE,4CAAC,SAAI,OAAO,EAAE,SAAS,KAAK,UAAU,QAAQ,YAAY,OAAO,GAC9D,cAAI,aACP;AAAA,aACF;AAAA;AAAA;AAAA,MAjCK;AAAA,IAkCP,CACD,GACH;AAAA,KAEJ;AAEJ;","names":["Image"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface Annotation {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
interface AnnotatedImageProps {
|
|
10
|
+
src: string;
|
|
11
|
+
alt?: string;
|
|
12
|
+
annotations: Annotation[];
|
|
13
|
+
className?: string;
|
|
14
|
+
layout?: 'left' | 'right' | 'full';
|
|
15
|
+
}
|
|
16
|
+
declare function AnnotatedImage({ src, alt, annotations, className, layout, }: AnnotatedImageProps): React.JSX.Element | null;
|
|
17
|
+
|
|
18
|
+
export { AnnotatedImage as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface Annotation {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
interface AnnotatedImageProps {
|
|
10
|
+
src: string;
|
|
11
|
+
alt?: string;
|
|
12
|
+
annotations: Annotation[];
|
|
13
|
+
className?: string;
|
|
14
|
+
layout?: 'left' | 'right' | 'full';
|
|
15
|
+
}
|
|
16
|
+
declare function AnnotatedImage({ src, alt, annotations, className, layout, }: AnnotatedImageProps): React.JSX.Element | null;
|
|
17
|
+
|
|
18
|
+
export { AnnotatedImage as default };
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use client";
|
|
3
|
+
import {
|
|
4
|
+
resolvePortfolioImage
|
|
5
|
+
} from "../../chunk-QDXZ27R7.js";
|
|
6
|
+
|
|
7
|
+
// src/portfolio/components/primitives/AnnotatedImage.tsx
|
|
8
|
+
import { useRef, useEffect, useState } from "react";
|
|
9
|
+
import Image from "next/image";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
var EASE = "cubic-bezier(0.25, 0.46, 0.45, 0.94)";
|
|
12
|
+
var EASE_BACK = "cubic-bezier(0.34, 1.56, 0.64, 1)";
|
|
13
|
+
var PIN_PULSE_CSS = `
|
|
14
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
15
|
+
.sk-pin-pulse {
|
|
16
|
+
animation: sk-pin-pulse 1.5s ease-out infinite;
|
|
17
|
+
}
|
|
18
|
+
@keyframes sk-pin-pulse {
|
|
19
|
+
from { transform: scale(1); opacity: 0.6; }
|
|
20
|
+
to { transform: scale(1.6); opacity: 0; }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
function AnnotatedImage({
|
|
25
|
+
src,
|
|
26
|
+
alt = "",
|
|
27
|
+
annotations,
|
|
28
|
+
className = "",
|
|
29
|
+
layout = "full"
|
|
30
|
+
}) {
|
|
31
|
+
const containerRef = useRef(null);
|
|
32
|
+
const pinsRef = useRef([]);
|
|
33
|
+
const revealedRef = useRef(false);
|
|
34
|
+
const [activeIndex, setActiveIndex] = useState(null);
|
|
35
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const checkMobile = () => setIsMobile(window.innerWidth < 768);
|
|
38
|
+
checkMobile();
|
|
39
|
+
window.addEventListener("resize", checkMobile);
|
|
40
|
+
return () => window.removeEventListener("resize", checkMobile);
|
|
41
|
+
}, []);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const container = containerRef.current;
|
|
44
|
+
if (!container) return;
|
|
45
|
+
const pins = pinsRef.current.filter(Boolean);
|
|
46
|
+
const showFinal = () => {
|
|
47
|
+
for (const pin of pins) {
|
|
48
|
+
pin.style.opacity = "1";
|
|
49
|
+
pin.style.transform = "translate(-50%, -50%) scale(1)";
|
|
50
|
+
}
|
|
51
|
+
revealedRef.current = true;
|
|
52
|
+
};
|
|
53
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
54
|
+
showFinal();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const rect = container.getBoundingClientRect();
|
|
58
|
+
if (rect.top < window.innerHeight && rect.bottom > 0) {
|
|
59
|
+
showFinal();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
for (const pin of pins) {
|
|
63
|
+
pin.style.opacity = "0";
|
|
64
|
+
pin.style.transform = "translate(-50%, -50%) scale(0)";
|
|
65
|
+
}
|
|
66
|
+
const io = new IntersectionObserver(
|
|
67
|
+
([entry]) => {
|
|
68
|
+
if (!entry.isIntersecting) return;
|
|
69
|
+
pins.forEach((pin, i) => {
|
|
70
|
+
const pinDelay = i * 0.15;
|
|
71
|
+
pin.style.transition = `opacity 0.4s ${EASE_BACK} ${pinDelay}s, transform 0.4s ${EASE_BACK} ${pinDelay}s`;
|
|
72
|
+
pin.style.opacity = "1";
|
|
73
|
+
pin.style.transform = "translate(-50%, -50%) scale(1)";
|
|
74
|
+
});
|
|
75
|
+
revealedRef.current = true;
|
|
76
|
+
io.disconnect();
|
|
77
|
+
},
|
|
78
|
+
{ rootMargin: "0px 0px -25% 0px" }
|
|
79
|
+
// ≈ 'top 75%' trigger start
|
|
80
|
+
);
|
|
81
|
+
io.observe(container);
|
|
82
|
+
return () => {
|
|
83
|
+
io.disconnect();
|
|
84
|
+
for (const pin of pins) pin.style.transition = "";
|
|
85
|
+
};
|
|
86
|
+
}, [annotations.length]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!revealedRef.current) return;
|
|
89
|
+
pinsRef.current.forEach((pin, i) => {
|
|
90
|
+
if (!pin) return;
|
|
91
|
+
pin.style.transition = `transform 0.25s ${EASE}`;
|
|
92
|
+
pin.style.transform = `translate(-50%, -50%) scale(${i === activeIndex ? 1.3 : 1})`;
|
|
93
|
+
});
|
|
94
|
+
}, [activeIndex]);
|
|
95
|
+
const handlePinClick = (index) => {
|
|
96
|
+
setActiveIndex(activeIndex === index ? null : index);
|
|
97
|
+
};
|
|
98
|
+
const image = resolvePortfolioImage(src);
|
|
99
|
+
if (!image) return null;
|
|
100
|
+
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className, children: [
|
|
101
|
+
/* @__PURE__ */ jsx("style", { href: "sk-annotated-pulse", precedence: "default", children: PIN_PULSE_CSS }),
|
|
102
|
+
/* @__PURE__ */ jsxs("div", { style: { position: "relative", display: "inline-block", width: "100%" }, children: [
|
|
103
|
+
image.width && image.height ? /* @__PURE__ */ jsx(
|
|
104
|
+
Image,
|
|
105
|
+
{
|
|
106
|
+
src: image.url,
|
|
107
|
+
alt,
|
|
108
|
+
width: image.width,
|
|
109
|
+
height: image.height,
|
|
110
|
+
sizes: "(max-width: 1024px) 100vw, 1024px",
|
|
111
|
+
style: { display: "block", width: "100%", height: "auto", borderRadius: "12px" }
|
|
112
|
+
}
|
|
113
|
+
) : /* @__PURE__ */ jsx(
|
|
114
|
+
"img",
|
|
115
|
+
{
|
|
116
|
+
src: image.url,
|
|
117
|
+
alt,
|
|
118
|
+
loading: "lazy",
|
|
119
|
+
decoding: "async",
|
|
120
|
+
style: { display: "block", width: "100%", height: "auto", borderRadius: "12px" }
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
!isMobile && annotations.map((ann, i) => /* @__PURE__ */ jsxs(
|
|
124
|
+
"button",
|
|
125
|
+
{
|
|
126
|
+
ref: (el) => {
|
|
127
|
+
pinsRef.current[i] = el;
|
|
128
|
+
},
|
|
129
|
+
onClick: () => handlePinClick(i),
|
|
130
|
+
style: {
|
|
131
|
+
position: "absolute",
|
|
132
|
+
left: `${ann.x}%`,
|
|
133
|
+
top: `${ann.y}%`,
|
|
134
|
+
transform: "translate(-50%, -50%)",
|
|
135
|
+
width: "32px",
|
|
136
|
+
height: "32px",
|
|
137
|
+
borderRadius: "50%",
|
|
138
|
+
background: "var(--sk-primary, #6366f1)",
|
|
139
|
+
border: "2px solid white",
|
|
140
|
+
color: "white",
|
|
141
|
+
fontSize: "13px",
|
|
142
|
+
fontWeight: 700,
|
|
143
|
+
display: "flex",
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
justifyContent: "center",
|
|
146
|
+
cursor: "pointer",
|
|
147
|
+
zIndex: 10,
|
|
148
|
+
opacity: 0,
|
|
149
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.3)",
|
|
150
|
+
padding: 0
|
|
151
|
+
},
|
|
152
|
+
"aria-label": ann.label,
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ jsx(
|
|
155
|
+
"span",
|
|
156
|
+
{
|
|
157
|
+
className: "sk-pin-pulse",
|
|
158
|
+
style: {
|
|
159
|
+
position: "absolute",
|
|
160
|
+
inset: "-2px",
|
|
161
|
+
borderRadius: "50%",
|
|
162
|
+
border: "2px solid var(--sk-primary, #6366f1)",
|
|
163
|
+
opacity: 0.6,
|
|
164
|
+
pointerEvents: "none"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
i + 1,
|
|
169
|
+
activeIndex === i && /* @__PURE__ */ jsxs(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
style: {
|
|
173
|
+
position: "absolute",
|
|
174
|
+
bottom: "calc(100% + 12px)",
|
|
175
|
+
left: "50%",
|
|
176
|
+
transform: "translateX(-50%)",
|
|
177
|
+
width: "220px",
|
|
178
|
+
padding: "12px 14px",
|
|
179
|
+
borderRadius: "10px",
|
|
180
|
+
background: "var(--sk-surface, rgba(20,20,30,0.95))",
|
|
181
|
+
backdropFilter: "blur(12px)",
|
|
182
|
+
border: "1px solid var(--sk-border, rgba(255,255,255,0.1))",
|
|
183
|
+
color: "white",
|
|
184
|
+
fontSize: "13px",
|
|
185
|
+
lineHeight: "1.45",
|
|
186
|
+
textAlign: "left",
|
|
187
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.4)",
|
|
188
|
+
zIndex: 20,
|
|
189
|
+
pointerEvents: "auto"
|
|
190
|
+
},
|
|
191
|
+
onClick: (e) => e.stopPropagation(),
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ jsx("div", { style: { fontWeight: 700, marginBottom: "4px", fontSize: "14px" }, children: ann.label }),
|
|
194
|
+
/* @__PURE__ */ jsx("div", { style: { opacity: 0.8 }, children: ann.description }),
|
|
195
|
+
/* @__PURE__ */ jsx(
|
|
196
|
+
"div",
|
|
197
|
+
{
|
|
198
|
+
style: {
|
|
199
|
+
position: "absolute",
|
|
200
|
+
bottom: "-6px",
|
|
201
|
+
left: "50%",
|
|
202
|
+
transform: "translateX(-50%) rotate(45deg)",
|
|
203
|
+
width: "12px",
|
|
204
|
+
height: "12px",
|
|
205
|
+
background: "var(--sk-surface, rgba(20,20,30,0.95))",
|
|
206
|
+
borderRight: "1px solid var(--sk-border, rgba(255,255,255,0.1))",
|
|
207
|
+
borderBottom: "1px solid var(--sk-border, rgba(255,255,255,0.1))"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
i
|
|
217
|
+
))
|
|
218
|
+
] }),
|
|
219
|
+
isMobile && /* @__PURE__ */ jsx("div", { style: { marginTop: "16px", display: "flex", flexDirection: "column", gap: "12px" }, children: annotations.map((ann, i) => /* @__PURE__ */ jsxs(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
style: {
|
|
223
|
+
display: "flex",
|
|
224
|
+
gap: "12px",
|
|
225
|
+
alignItems: "flex-start",
|
|
226
|
+
padding: "12px",
|
|
227
|
+
borderRadius: "10px",
|
|
228
|
+
background: "var(--sk-surface, rgba(255,255,255,0.05))",
|
|
229
|
+
border: "1px solid var(--sk-border, rgba(255,255,255,0.1))"
|
|
230
|
+
},
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ jsx(
|
|
233
|
+
"span",
|
|
234
|
+
{
|
|
235
|
+
style: {
|
|
236
|
+
flexShrink: 0,
|
|
237
|
+
width: "28px",
|
|
238
|
+
height: "28px",
|
|
239
|
+
borderRadius: "50%",
|
|
240
|
+
background: "var(--sk-primary, #6366f1)",
|
|
241
|
+
color: "white",
|
|
242
|
+
fontSize: "13px",
|
|
243
|
+
fontWeight: 700,
|
|
244
|
+
display: "flex",
|
|
245
|
+
alignItems: "center",
|
|
246
|
+
justifyContent: "center"
|
|
247
|
+
},
|
|
248
|
+
children: i + 1
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
252
|
+
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600, marginBottom: "2px" }, children: ann.label }),
|
|
253
|
+
/* @__PURE__ */ jsx("div", { style: { opacity: 0.7, fontSize: "14px", lineHeight: "1.45" }, children: ann.description })
|
|
254
|
+
] })
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
i
|
|
258
|
+
)) })
|
|
259
|
+
] });
|
|
260
|
+
}
|
|
261
|
+
export {
|
|
262
|
+
AnnotatedImage as default
|
|
263
|
+
};
|
|
264
|
+
//# sourceMappingURL=AnnotatedImage.js.map
|