@travel-match/ui 0.2.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.
Files changed (54) hide show
  1. package/dist/components/CtaSentence/CtaSentence.cjs +1 -1
  2. package/dist/components/CtaSentence/CtaSentence.cjs.map +1 -1
  3. package/dist/components/CtaSentence/CtaSentence.js +142 -69
  4. package/dist/components/CtaSentence/CtaSentence.js.map +1 -1
  5. package/dist/components/HeroColumns/heroMotion.cjs +1 -1
  6. package/dist/components/HeroColumns/heroMotion.cjs.map +1 -1
  7. package/dist/components/HeroColumns/heroMotion.js +7 -44
  8. package/dist/components/HeroColumns/heroMotion.js.map +1 -1
  9. package/dist/components/HeroMap/HeroMap.cjs +1 -1
  10. package/dist/components/HeroMap/HeroMap.cjs.map +1 -1
  11. package/dist/components/HeroMap/HeroMap.js +58 -67
  12. package/dist/components/HeroMap/HeroMap.js.map +1 -1
  13. package/dist/components/HeroSwitcher/HeroSwitcher.cjs +1 -1
  14. package/dist/components/HeroSwitcher/HeroSwitcher.cjs.map +1 -1
  15. package/dist/components/HeroSwitcher/HeroSwitcher.js +85 -92
  16. package/dist/components/HeroSwitcher/HeroSwitcher.js.map +1 -1
  17. package/dist/components/HowItWorksSteps/HowItWorksSteps.cjs +1 -1
  18. package/dist/components/HowItWorksSteps/HowItWorksSteps.cjs.map +1 -1
  19. package/dist/components/HowItWorksSteps/HowItWorksSteps.js +84 -102
  20. package/dist/components/HowItWorksSteps/HowItWorksSteps.js.map +1 -1
  21. package/dist/components/LogoAnimation/LogoAnimation.cjs +2 -0
  22. package/dist/components/LogoAnimation/LogoAnimation.cjs.map +1 -0
  23. package/dist/components/LogoAnimation/LogoAnimation.js +202 -0
  24. package/dist/components/LogoAnimation/LogoAnimation.js.map +1 -0
  25. package/dist/components/LogoAnimation/LogoAnimationArtwork.cjs +2 -0
  26. package/dist/components/LogoAnimation/LogoAnimationArtwork.cjs.map +1 -0
  27. package/dist/components/LogoAnimation/LogoAnimationArtwork.js +57 -0
  28. package/dist/components/LogoAnimation/LogoAnimationArtwork.js.map +1 -0
  29. package/dist/components/LogoAnimation/motion.cjs +2 -0
  30. package/dist/components/LogoAnimation/motion.cjs.map +1 -0
  31. package/dist/components/LogoAnimation/motion.js +180 -0
  32. package/dist/components/LogoAnimation/motion.js.map +1 -0
  33. package/dist/components/PackageAnimation/PackageAnimation.cjs +1 -1
  34. package/dist/components/PackageAnimation/PackageAnimation.cjs.map +1 -1
  35. package/dist/components/PackageAnimation/PackageAnimation.js +31 -40
  36. package/dist/components/PackageAnimation/PackageAnimation.js.map +1 -1
  37. package/dist/components/PartnerCarousel/PartnerCarousel.cjs +1 -1
  38. package/dist/components/PartnerCarousel/PartnerCarousel.cjs.map +1 -1
  39. package/dist/components/PartnerCarousel/PartnerCarousel.js +94 -101
  40. package/dist/components/PartnerCarousel/PartnerCarousel.js.map +1 -1
  41. package/dist/components/PartnerCarousel/autoplay.cjs +1 -1
  42. package/dist/components/PartnerCarousel/autoplay.cjs.map +1 -1
  43. package/dist/components/PartnerCarousel/autoplay.js +13 -9
  44. package/dist/components/PartnerCarousel/autoplay.js.map +1 -1
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.d.cts +62 -55
  47. package/dist/index.d.ts +62 -55
  48. package/dist/index.js +100 -99
  49. package/dist/styles.css +1 -1
  50. package/package.json +1 -1
  51. package/dist/components/PartnerCarousel/AutoplayToggle.cjs +0 -2
  52. package/dist/components/PartnerCarousel/AutoplayToggle.cjs.map +0 -1
  53. package/dist/components/PartnerCarousel/AutoplayToggle.js +0 -36
  54. package/dist/components/PartnerCarousel/AutoplayToggle.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"HeroMap.cjs","names":["useRef","useState","useOnScreen","usePrefersReducedMotion","useCallback","cn","getMapDotsPath","PlayGlyph","PauseGlyph","require_cn","require_heroMotion","require_mapDots","react","react_jsx_runtime","WIDTH","HEIGHT","routePath","x0","origin","y0","x1","destination","y1","lift","round","value","HeroMap","props","rootRef","internal","setInternal","defaultActiveIndex","count","destinations","current","activeIndex","stopped","setStopped","hovered","setHovered","onScreen","reducedMotion","canPlay","autoPlay","running","paused","advance","next","onActiveIndexChange","timer","interval","node","ref","className","onPointerEnter","event","onPointerLeave","index","playLabel","pauseLabel"],"sources":["../../../src/components/HeroMap/HeroMap.tsx"],"sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PauseGlyph, PlayGlyph, useOnScreen, usePrefersReducedMotion } from '../HeroColumns/heroMotion';\nimport { getMapDotsPath } from './mapDots';\nimport './HeroMap.css';\n\nexport interface HeroMapOrigin {\n /** Horizontal position, in percent of the frame width (Figma: 510.5 / 640 = 79.77). */\n x: number;\n /** Vertical position, in percent of the frame height (Figma: 278 / 480 = 57.92). */\n y: number;\n /** City name printed next to the point, e.g. \"Yerevan\". */\n label?: ReactNode;\n}\n\nexport interface HeroMapDestination {\n /** Horizontal position of the pin, in percent of the frame width. */\n x: number;\n /** Vertical position of the pin, in percent of the frame height. */\n y: number;\n /** First line of the tag, e.g. \"Paris, France\". */\n title: ReactNode;\n /** Second line of the tag, e.g. \"2 adults · 12–19 Jul\". */\n description?: ReactNode;\n /** Icon in the round badge of the tag, e.g. `<BedIcon />` for a package or `<PlaneIcon />` for a flight. */\n icon?: ReactNode;\n /** React key; defaults to the destination's index. */\n key?: string | number;\n}\n\nexport interface HeroMapProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** Where every route starts. */\n origin: HeroMapOrigin;\n /** Sample requests on the map, in the order they are highlighted (Figma \"Step\" 1…6). Any number. */\n destinations: HeroMapDestination[];\n /** Index of the highlighted destination (controlled). */\n activeIndex?: number;\n /** Initially highlighted destination when uncontrolled. */\n defaultActiveIndex?: number;\n /** Called with the new index when autoplay advances. */\n onActiveIndexChange?: (index: number) => void;\n /** Moves on to the next destination on its own. */\n autoPlay?: boolean;\n /** Milliseconds each destination stays highlighted (Figma prototype: 2.2s delay + 0.5s transition). */\n interval?: number;\n /** Holds autoplay from outside (the highlighted destination stays as it is). */\n paused?: boolean;\n /** Accessible name of the pause button shown while autoplay runs. */\n pauseLabel?: string;\n /** Accessible name of the same button once autoplay is stopped. */\n playLabel?: string;\n}\n\n/* The Figma frame; positions are percentages of it, the routes are drawn in its pixels. */\nconst WIDTH = 640;\nconst HEIGHT = 480;\n\n/** Figma draws every route as a quadratic arc whose control point sits 0.28 × the chord length above its middle. */\nfunction routePath(origin: HeroMapOrigin, destination: HeroMapDestination): string {\n const x0 = (origin.x / 100) * WIDTH;\n const y0 = (origin.y / 100) * HEIGHT;\n const x1 = (destination.x / 100) * WIDTH;\n const y1 = (destination.y / 100) * HEIGHT;\n const lift = 0.28 * Math.hypot(x1 - x0, y1 - y0);\n const round = (value: number) => Math.round(value * 100) / 100;\n return `M${round(x0)} ${round(y0)}Q${round((x0 + x1) / 2)} ${round((y0 + y1) / 2 - lift)} ${round(x1)} ${round(y1)}`;\n}\n\n/**\n * Dotted map with a route from the origin to one sample request at a time (Figma component set \"Join / Hero map\").\n * Every destination is a list item with its tag as real text, so the content does not depend on the animation;\n * autoplay can be paused with the built-in button, holds on hover, off-screen and in hidden tabs, and does not start\n * for users who prefer reduced motion.\n */\nexport const HeroMap = /* @__PURE__ */ forwardRef<HTMLDivElement, HeroMapProps>(function HeroMap(\n {\n origin,\n destinations,\n activeIndex,\n defaultActiveIndex = 0,\n onActiveIndexChange,\n autoPlay = true,\n interval = 2700,\n paused = false,\n pauseLabel = 'Pause',\n playLabel = 'Play',\n className,\n onPointerEnter,\n onPointerLeave,\n ...props\n },\n ref,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [internal, setInternal] = useState(defaultActiveIndex);\n const count = destinations.length;\n const requested = activeIndex !== undefined ? activeIndex : internal;\n const current = count ? Math.min(Math.max(Math.trunc(requested) || 0, 0), count - 1) : -1;\n\n const [stopped, setStopped] = useState(false);\n const [hovered, setHovered] = useState(false);\n const onScreen = useOnScreen(rootRef);\n const reducedMotion = usePrefersReducedMotion();\n const canPlay = autoPlay && !reducedMotion && count > 1;\n const running = canPlay && !paused && !stopped && !hovered && onScreen;\n\n const advance = useCallback(() => {\n const next = (current + 1) % count;\n if (activeIndex === undefined) setInternal(next);\n onActiveIndexChange?.(next);\n }, [current, count, activeIndex, onActiveIndexChange]);\n\n useEffect(() => {\n if (!running) return;\n const timer = window.setTimeout(advance, Math.max(interval, 0));\n return () => window.clearTimeout(timer);\n }, [running, advance, interval]);\n\n return (\n <div\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn('tm-hero-map', className)}\n data-playing={running ? '' : undefined}\n onPointerEnter={(event) => {\n onPointerEnter?.(event);\n if (event.pointerType === 'mouse') setHovered(true);\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n {...props}\n >\n <svg className=\"tm-hero-map__dots\" viewBox=\"0 0 620 420\" aria-hidden=\"true\" focusable=\"false\">\n <path d={getMapDotsPath()} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"3.2\" strokeLinecap=\"round\" />\n </svg>\n\n <svg className=\"tm-hero-map__routes\" viewBox={`0 0 ${WIDTH} ${HEIGHT}`} aria-hidden=\"true\" focusable=\"false\">\n {destinations.map((destination, index) => (\n <path\n key={destination.key ?? index}\n className=\"tm-hero-map__route\"\n data-active={index === current ? '' : undefined}\n d={routePath(origin, destination)}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeDasharray=\"4 4\"\n />\n ))}\n </svg>\n\n <div className=\"tm-hero-map__origin\" style={{ left: `${origin.x}%`, top: `${origin.y}%` }}>\n <span className=\"tm-hero-map__origin-halo\" aria-hidden=\"true\" />\n <span className=\"tm-hero-map__origin-dot\" aria-hidden=\"true\" />\n {origin.label != null ? <span className=\"tm-hero-map__origin-label\">{origin.label}</span> : null}\n </div>\n\n <ul className=\"tm-hero-map__destinations\">\n {destinations.map((destination, index) => (\n <li\n key={destination.key ?? index}\n className=\"tm-hero-map__destination\"\n data-active={index === current ? '' : undefined}\n data-side={destination.x > 50 ? 'end' : 'start'}\n style={{ left: `${destination.x}%`, top: `${destination.y}%`, '--_x': destination.x } as CSSProperties}\n >\n <span className=\"tm-hero-map__pin\" aria-hidden=\"true\">\n <span className=\"tm-hero-map__halo\" />\n <span className=\"tm-hero-map__dot\" />\n <span className=\"tm-hero-map__dot tm-hero-map__dot--active\" />\n </span>\n <div className=\"tm-hero-map__tag-box\">\n <div className=\"tm-hero-map__tag\">\n {destination.icon != null ? (\n <span className=\"tm-hero-map__tag-icon\" data-tm-icon-size=\"sm\" aria-hidden=\"true\">\n {destination.icon}\n </span>\n ) : null}\n <span className=\"tm-hero-map__tag-text\">\n <span className=\"tm-hero-map__tag-title\">{destination.title}</span>\n {destination.description != null ? (\n <span className=\"tm-hero-map__tag-description\">{destination.description}</span>\n ) : null}\n </span>\n </div>\n </div>\n </li>\n ))}\n </ul>\n\n {canPlay ? (\n <button\n type=\"button\"\n className=\"tm-hero-map__playback\"\n aria-label={stopped || paused ? playLabel : pauseLabel}\n title={stopped || paused ? playLabel : pauseLabel}\n disabled={paused}\n onClick={() => setStopped((value) => !value)}\n >\n {stopped || paused ? <PlayGlyph /> : <PauseGlyph />}\n </button>\n ) : null}\n </div>\n );\n});\n"],"mappings":"A,4MAsDA,IAAMc,EAAQ,IACRC,EAAS,IAGf,SAASC,EAAU,EAAuB,EAAyC,CACjF,IAAMC,EAAMC,EAAO,EAAI,IAAOJ,EACxBK,EAAMD,EAAO,EAAI,IAAOH,EACxBK,EAAMC,EAAY,EAAI,IAAOP,EAC7BQ,EAAMD,EAAY,EAAI,IAAON,EAC7BQ,EAAO,IAAO,KAAK,MAAMH,EAAKH,EAAIK,EAAKH,CAAE,EACzCK,EAAS,GAAkB,KAAK,MAAMC,EAAQ,G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,OAAD,CAAM,UAAU,wBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,yBAA0B,SAAAQ,EAAY,KAAY,CAAA,EACjEA,EAAY,aAAe,KAExB,MADF,EAAAR,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,+BAAgC,SAAAQ,EAAY,WAAkB,CAAA,CAE5E,CACH,CAAA,CAAA,C,EACF,CAAA,CACH,CA1BG,EAAAA,EAAY,KAAOoC,CA0BtB,CACL,CACC,CAAA,EAEHf,GACC,EAAA7B,EAAA,IAAA,CAAC,SAAD,CACE,KAAK,SACL,UAAU,wBACV,aAAYuB,GAAWS,EAASa,EAAYC,EAC5C,MAAOvB,GAAWS,EAASa,EAAYC,EACvC,SAAUd,EACV,YAAeR,EAAY,GAAU,CAACZ,CAAK,EAE1C,SAAAW,GAAWS,GAAS,EAAAhC,EAAA,IAAA,CAACN,EAAAA,UAAD,CAAY,CAAA,GAAI,EAAAM,EAAA,IAAA,CAACL,EAAAA,WAAD,CAAa,CAAA,CAC5C,CAAA,EACN,IACD,C,EAET,CAAC,E"}
1
+ {"version":3,"file":"HeroMap.cjs","names":["useRef","useState","useOnScreen","usePrefersReducedMotion","useCallback","cn","getMapDotsPath","require_cn","require_heroMotion","require_mapDots","react","react_jsx_runtime","WIDTH","HEIGHT","routePath","x0","origin","y0","x1","destination","y1","lift","round","value","HeroMap","props","rootRef","internal","setInternal","defaultActiveIndex","count","destinations","current","activeIndex","hovered","setHovered","onScreen","reducedMotion","running","autoPlay","paused","advance","next","onActiveIndexChange","timer","interval","node","ref","className","onPointerEnter","event","onPointerLeave","index"],"sources":["../../../src/components/HeroMap/HeroMap.tsx"],"sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useOnScreen, usePrefersReducedMotion } from '../HeroColumns/heroMotion';\nimport { getMapDotsPath } from './mapDots';\nimport './HeroMap.css';\n\nexport interface HeroMapOrigin {\n /** Horizontal position, in percent of the frame width (Figma: 510.5 / 640 = 79.77). */\n x: number;\n /** Vertical position, in percent of the frame height (Figma: 278 / 480 = 57.92). */\n y: number;\n /** City name printed next to the point, e.g. \"Yerevan\". */\n label?: ReactNode;\n}\n\nexport interface HeroMapDestination {\n /** Horizontal position of the pin, in percent of the frame width. */\n x: number;\n /** Vertical position of the pin, in percent of the frame height. */\n y: number;\n /** First line of the tag, e.g. \"Paris, France\". */\n title: ReactNode;\n /** Second line of the tag, e.g. \"2 adults · 12–19 Jul\". */\n description?: ReactNode;\n /** Icon in the round badge of the tag, e.g. `<BedIcon />` for a package or `<PlaneIcon />` for a flight. */\n icon?: ReactNode;\n /** React key; defaults to the destination's index. */\n key?: string | number;\n}\n\nexport interface HeroMapProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** Where every route starts. */\n origin: HeroMapOrigin;\n /** Sample requests on the map, in the order they are highlighted (Figma \"Step\" 1…6). Any number. */\n destinations: HeroMapDestination[];\n /** Index of the highlighted destination (controlled). */\n activeIndex?: number;\n /** Initially highlighted destination when uncontrolled. */\n defaultActiveIndex?: number;\n /** Called with the new index when autoplay advances. */\n onActiveIndexChange?: (index: number) => void;\n /** Moves on to the next destination on its own, in an endless loop. */\n autoPlay?: boolean;\n /** Milliseconds each destination stays highlighted (Figma prototype: 2.2s delay + 0.5s transition). */\n interval?: number;\n /** Holds autoplay from outside (the highlighted destination stays as it is); it carries on once this is `false` again. */\n paused?: boolean;\n}\n\n/* The Figma frame; positions are percentages of it, the routes are drawn in its pixels. */\nconst WIDTH = 640;\nconst HEIGHT = 480;\n\n/** Figma draws every route as a quadratic arc whose control point sits 0.28 × the chord length above its middle. */\nfunction routePath(origin: HeroMapOrigin, destination: HeroMapDestination): string {\n const x0 = (origin.x / 100) * WIDTH;\n const y0 = (origin.y / 100) * HEIGHT;\n const x1 = (destination.x / 100) * WIDTH;\n const y1 = (destination.y / 100) * HEIGHT;\n const lift = 0.28 * Math.hypot(x1 - x0, y1 - y0);\n const round = (value: number) => Math.round(value * 100) / 100;\n return `M${round(x0)} ${round(y0)}Q${round((x0 + x1) / 2)} ${round((y0 + y1) / 2 - lift)} ${round(x1)} ${round(y1)}`;\n}\n\n/**\n * Dotted map with a route from the origin to one sample request at a time (Figma component set \"Join / Hero map\").\n * Every destination is a list item with its tag as real text, so the content does not depend on the animation;\n * autoplay loops endlessly, holds on hover, off-screen and in hidden tabs, and does not start for users who prefer\n * reduced motion.\n */\nexport const HeroMap = /* @__PURE__ */ forwardRef<HTMLDivElement, HeroMapProps>(function HeroMap(\n {\n origin,\n destinations,\n activeIndex,\n defaultActiveIndex = 0,\n onActiveIndexChange,\n autoPlay = true,\n interval = 2700,\n paused = false,\n className,\n onPointerEnter,\n onPointerLeave,\n ...props\n },\n ref,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [internal, setInternal] = useState(defaultActiveIndex);\n const count = destinations.length;\n const requested = activeIndex !== undefined ? activeIndex : internal;\n const current = count ? Math.min(Math.max(Math.trunc(requested) || 0, 0), count - 1) : -1;\n\n const [hovered, setHovered] = useState(false);\n const onScreen = useOnScreen(rootRef);\n const reducedMotion = usePrefersReducedMotion();\n const running = autoPlay && !reducedMotion && count > 1 && !paused && !hovered && onScreen;\n\n const advance = useCallback(() => {\n const next = (current + 1) % count;\n if (activeIndex === undefined) setInternal(next);\n onActiveIndexChange?.(next);\n }, [current, count, activeIndex, onActiveIndexChange]);\n\n useEffect(() => {\n if (!running) return;\n const timer = window.setTimeout(advance, Math.max(interval, 0));\n return () => window.clearTimeout(timer);\n }, [running, advance, interval]);\n\n return (\n <div\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn('tm-hero-map', className)}\n data-playing={running ? '' : undefined}\n onPointerEnter={(event) => {\n onPointerEnter?.(event);\n if (event.pointerType === 'mouse') setHovered(true);\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n {...props}\n >\n <svg className=\"tm-hero-map__dots\" viewBox=\"0 0 620 420\" aria-hidden=\"true\" focusable=\"false\">\n <path d={getMapDotsPath()} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"3.2\" strokeLinecap=\"round\" />\n </svg>\n\n <svg className=\"tm-hero-map__routes\" viewBox={`0 0 ${WIDTH} ${HEIGHT}`} aria-hidden=\"true\" focusable=\"false\">\n {destinations.map((destination, index) => (\n <path\n key={destination.key ?? index}\n className=\"tm-hero-map__route\"\n data-active={index === current ? '' : undefined}\n d={routePath(origin, destination)}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeDasharray=\"4 4\"\n />\n ))}\n </svg>\n\n <div className=\"tm-hero-map__origin\" style={{ left: `${origin.x}%`, top: `${origin.y}%` }}>\n <span className=\"tm-hero-map__origin-halo\" aria-hidden=\"true\" />\n <span className=\"tm-hero-map__origin-dot\" aria-hidden=\"true\" />\n {origin.label != null ? <span className=\"tm-hero-map__origin-label\">{origin.label}</span> : null}\n </div>\n\n <ul className=\"tm-hero-map__destinations\">\n {destinations.map((destination, index) => (\n <li\n key={destination.key ?? index}\n className=\"tm-hero-map__destination\"\n data-active={index === current ? '' : undefined}\n data-side={destination.x > 50 ? 'end' : 'start'}\n style={{ left: `${destination.x}%`, top: `${destination.y}%`, '--_x': destination.x } as CSSProperties}\n >\n <span className=\"tm-hero-map__pin\" aria-hidden=\"true\">\n <span className=\"tm-hero-map__halo\" />\n <span className=\"tm-hero-map__dot\" />\n <span className=\"tm-hero-map__dot tm-hero-map__dot--active\" />\n </span>\n <div className=\"tm-hero-map__tag-box\">\n <div className=\"tm-hero-map__tag\">\n {destination.icon != null ? (\n <span className=\"tm-hero-map__tag-icon\" data-tm-icon-size=\"sm\" aria-hidden=\"true\">\n {destination.icon}\n </span>\n ) : null}\n <span className=\"tm-hero-map__tag-text\">\n <span className=\"tm-hero-map__tag-title\">{destination.title}</span>\n {destination.description != null ? (\n <span className=\"tm-hero-map__tag-description\">{destination.description}</span>\n ) : null}\n </span>\n </div>\n </div>\n </li>\n ))}\n </ul>\n </div>\n );\n});\n"],"mappings":"A,4MAkDA,IAAMY,EAAQ,IACRC,EAAS,IAGf,SAASC,EAAU,EAAuB,EAAyC,CACjF,IAAMC,EAAMC,EAAO,EAAI,IAAOJ,EACxBK,EAAMD,EAAO,EAAI,IAAOH,EACxBK,EAAMC,EAAY,EAAI,IAAOP,EAC7BQ,EAAMD,EAAY,EAAI,IAAON,EAC7BQ,EAAO,IAAO,KAAK,MAAMH,EAAKH,EAAIK,EAAKH,CAAE,EACzCK,EAAS,GAAkB,KAAK,MAAMC,EAAQ,GAAG,EAAI,IAC3D,MAAO,IAAID,EAAMP,CAAE,EAAE,GAAGO,EAAML,CAAE,EAAE,GAAGK,GAAOP,EAAKG,GAAM,CAAC,EAAE,GAAGI,GAAOL,EAAKG,GAAM,EAAIC,CAAI,EAAE,GAAGC,EAAMJ,CAAE,EAAE,GAAGI,EAAMF,CAAE,GACnH,CAQA,IAAaI,GAA0B,EAAAd,EAAA,WAAA,CAAyC,SAC9E,CACE,SACA,eACA,cACA,qBAAqB,EACrB,sBACA,WAAW,GACX,WAAW,KACX,SAAS,GACT,YACA,iBACA,iBACA,GAAGe,GAEL,EACA,CACA,IAAMC,GAAA,EAAU1B,EAAAA,OAAAA,CAA8B,IAAI,EAC5C,CAAC2B,EAAUC,IAAA,EAAe3B,EAAAA,SAAAA,CAAS4B,CAAkB,EACrDC,EAAQC,EAAa,OAErBC,EAAUF,EAAQ,KAAK,IAAI,KAAK,IAAI,KAAK,MAD7BG,IAAgB,IAAA,GAA0BN,EAAdM,CACgB,GAAK,EAAG,CAAC,EAAGH,EAAQ,CAAC,EAAI,GAEjF,CAACI,EAASC,IAAA,EAAclC,EAAAA,SAAAA,CAAS,EAAK,EACtCmC,EAAWlC,EAAAA,YAAYwB,CAAO,EAC9BW,EAAgBlC,EAAA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AA,CAAC,OAAD,CAAM,UAAU,2CAA6C,CAAA,CACzD,CACN,CAAA,GAAA,EAAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,uBACb,UAAA,EAAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,mBAAf,SAAA,CACGQ,EAAY,MAAQ,KAIjB,MAHF,EAAAR,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,wBAAwB,oBAAkB,KAAK,cAAY,OACxE,SAAAQ,EAAY,IACT,CAAA,GAER,EAAAR,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,wBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,yBAA0B,SAAAQ,EAAY,KAAY,CAAA,EACjEA,EAAY,aAAe,KAExB,MADF,EAAAR,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,+BAAgC,SAAAQ,EAAY,WAAkB,CAAA,CAE5E,CACH,CAAA,CAAA,C,EACF,CAAA,CACH,CA1BG,EAAAA,EAAY,KAAOiC,CA0BtB,CACL,CACC,CAAA,CACD,C,EAET,CAAC,E"}
@@ -1,70 +1,70 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../utils/cn.js";
3
- import { PauseGlyph as t, PlayGlyph as n, useOnScreen as r, usePrefersReducedMotion as i } from "../HeroColumns/heroMotion.js";
4
- import { getMapDotsPath as a } from "./mapDots.js";
3
+ import { useOnScreen as t, usePrefersReducedMotion as n } from "../HeroColumns/heroMotion.js";
4
+ import { getMapDotsPath as r } from "./mapDots.js";
5
5
  /* empty css */
6
- import { forwardRef as o, useCallback as s, useEffect as c, useRef as l, useState as u } from "react";
7
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
6
+ import { forwardRef as i, useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
8
  // src/components/HeroMap/HeroMap.tsx
9
- var p = 640, m = 480;
10
- function h(e, t) {
11
- let n = e.x / 100 * p, r = e.y / 100 * m, i = t.x / 100 * p, a = t.y / 100 * m, o = .28 * Math.hypot(i - n, a - r), s = (e) => Math.round(e * 100) / 100;
9
+ var d = 640, f = 480;
10
+ function p(e, t) {
11
+ let n = e.x / 100 * d, r = e.y / 100 * f, i = t.x / 100 * d, a = t.y / 100 * f, o = .28 * Math.hypot(i - n, a - r), s = (e) => Math.round(e * 100) / 100;
12
12
  return `M${s(n)} ${s(r)}Q${s((n + i) / 2)} ${s((r + a) / 2 - o)} ${s(i)} ${s(a)}`;
13
13
  }
14
- var g = /* @__PURE__ */ o(function({ origin: o, destinations: g, activeIndex: _, defaultActiveIndex: v = 0, onActiveIndexChange: y, autoPlay: b = !0, interval: x = 2700, paused: S = !1, pauseLabel: C = "Pause", playLabel: w = "Play", className: T, onPointerEnter: E, onPointerLeave: D, ...O }, k) {
15
- let A = l(null), [j, M] = u(v), N = g.length, P = N ? Math.min(Math.max(Math.trunc(_ === void 0 ? j : _) || 0, 0), N - 1) : -1, [F, I] = u(!1), [L, R] = u(!1), z = r(A), B = i(), V = b && !B && N > 1, H = V && !S && !F && !L && z, U = s(() => {
16
- let e = (P + 1) % N;
17
- _ === void 0 && M(e), y?.(e);
14
+ var m = /* @__PURE__ */ i(function({ origin: i, destinations: m, activeIndex: h, defaultActiveIndex: g = 0, onActiveIndexChange: _, autoPlay: v = !0, interval: y = 2700, paused: b = !1, className: x, onPointerEnter: S, onPointerLeave: C, ...w }, T) {
15
+ let E = s(null), [D, O] = c(g), k = m.length, A = k ? Math.min(Math.max(Math.trunc(h === void 0 ? D : h) || 0, 0), k - 1) : -1, [j, M] = c(!1), N = t(E), P = n(), F = v && !P && k > 1 && !b && !j && N, I = a(() => {
16
+ let e = (A + 1) % k;
17
+ h === void 0 && O(e), _?.(e);
18
18
  }, [
19
- P,
20
- N,
21
- _,
22
- y
19
+ A,
20
+ k,
21
+ h,
22
+ _
23
23
  ]);
24
- return c(() => {
25
- if (!H) return;
26
- let e = window.setTimeout(U, Math.max(x, 0));
24
+ return o(() => {
25
+ if (!F) return;
26
+ let e = window.setTimeout(I, Math.max(y, 0));
27
27
  return () => window.clearTimeout(e);
28
28
  }, [
29
- H,
30
- U,
31
- x
32
- ]), /* @__PURE__ */ f("div", {
29
+ F,
30
+ I,
31
+ y
32
+ ]), /* @__PURE__ */ u("div", {
33
33
  ref: (e) => {
34
- A.current = e, typeof k == "function" ? k(e) : k && (k.current = e);
34
+ E.current = e, typeof T == "function" ? T(e) : T && (T.current = e);
35
35
  },
36
- className: e("tm-hero-map", T),
37
- "data-playing": H ? "" : void 0,
36
+ className: e("tm-hero-map", x),
37
+ "data-playing": F ? "" : void 0,
38
38
  onPointerEnter: (e) => {
39
- E?.(e), e.pointerType === "mouse" && R(!0);
39
+ S?.(e), e.pointerType === "mouse" && M(!0);
40
40
  },
41
41
  onPointerLeave: (e) => {
42
- D?.(e), R(!1);
42
+ C?.(e), M(!1);
43
43
  },
44
- ...O,
44
+ ...w,
45
45
  children: [
46
- /* @__PURE__ */ d("svg", {
46
+ /* @__PURE__ */ l("svg", {
47
47
  className: "tm-hero-map__dots",
48
48
  viewBox: "0 0 620 420",
49
49
  "aria-hidden": "true",
50
50
  focusable: "false",
51
- children: /* @__PURE__ */ d("path", {
52
- d: a(),
51
+ children: /* @__PURE__ */ l("path", {
52
+ d: r(),
53
53
  fill: "none",
54
54
  stroke: "currentColor",
55
55
  strokeWidth: "3.2",
56
56
  strokeLinecap: "round"
57
57
  })
58
58
  }),
59
- /* @__PURE__ */ d("svg", {
59
+ /* @__PURE__ */ l("svg", {
60
60
  className: "tm-hero-map__routes",
61
- viewBox: `0 0 ${p} ${m}`,
61
+ viewBox: `0 0 ${d} ${f}`,
62
62
  "aria-hidden": "true",
63
63
  focusable: "false",
64
- children: g.map((e, t) => /* @__PURE__ */ d("path", {
64
+ children: m.map((e, t) => /* @__PURE__ */ l("path", {
65
65
  className: "tm-hero-map__route",
66
- "data-active": t === P ? "" : void 0,
67
- d: h(o, e),
66
+ "data-active": t === A ? "" : void 0,
67
+ d: p(i, e),
68
68
  fill: "none",
69
69
  stroke: "currentColor",
70
70
  strokeWidth: "1.5",
@@ -72,61 +72,61 @@ var g = /* @__PURE__ */ o(function({ origin: o, destinations: g, activeIndex: _,
72
72
  strokeDasharray: "4 4"
73
73
  }, e.key ?? t))
74
74
  }),
75
- /* @__PURE__ */ f("div", {
75
+ /* @__PURE__ */ u("div", {
76
76
  className: "tm-hero-map__origin",
77
77
  style: {
78
- left: `${o.x}%`,
79
- top: `${o.y}%`
78
+ left: `${i.x}%`,
79
+ top: `${i.y}%`
80
80
  },
81
81
  children: [
82
- /* @__PURE__ */ d("span", {
82
+ /* @__PURE__ */ l("span", {
83
83
  className: "tm-hero-map__origin-halo",
84
84
  "aria-hidden": "true"
85
85
  }),
86
- /* @__PURE__ */ d("span", {
86
+ /* @__PURE__ */ l("span", {
87
87
  className: "tm-hero-map__origin-dot",
88
88
  "aria-hidden": "true"
89
89
  }),
90
- o.label == null ? null : /* @__PURE__ */ d("span", {
90
+ i.label == null ? null : /* @__PURE__ */ l("span", {
91
91
  className: "tm-hero-map__origin-label",
92
- children: o.label
92
+ children: i.label
93
93
  })
94
94
  ]
95
95
  }),
96
- /* @__PURE__ */ d("ul", {
96
+ /* @__PURE__ */ l("ul", {
97
97
  className: "tm-hero-map__destinations",
98
- children: g.map((e, t) => /* @__PURE__ */ f("li", {
98
+ children: m.map((e, t) => /* @__PURE__ */ u("li", {
99
99
  className: "tm-hero-map__destination",
100
- "data-active": t === P ? "" : void 0,
100
+ "data-active": t === A ? "" : void 0,
101
101
  "data-side": e.x > 50 ? "end" : "start",
102
102
  style: {
103
103
  left: `${e.x}%`,
104
104
  top: `${e.y}%`,
105
105
  "--_x": e.x
106
106
  },
107
- children: [/* @__PURE__ */ f("span", {
107
+ children: [/* @__PURE__ */ u("span", {
108
108
  className: "tm-hero-map__pin",
109
109
  "aria-hidden": "true",
110
110
  children: [
111
- /* @__PURE__ */ d("span", { className: "tm-hero-map__halo" }),
112
- /* @__PURE__ */ d("span", { className: "tm-hero-map__dot" }),
113
- /* @__PURE__ */ d("span", { className: "tm-hero-map__dot tm-hero-map__dot--active" })
111
+ /* @__PURE__ */ l("span", { className: "tm-hero-map__halo" }),
112
+ /* @__PURE__ */ l("span", { className: "tm-hero-map__dot" }),
113
+ /* @__PURE__ */ l("span", { className: "tm-hero-map__dot tm-hero-map__dot--active" })
114
114
  ]
115
- }), /* @__PURE__ */ d("div", {
115
+ }), /* @__PURE__ */ l("div", {
116
116
  className: "tm-hero-map__tag-box",
117
- children: /* @__PURE__ */ f("div", {
117
+ children: /* @__PURE__ */ u("div", {
118
118
  className: "tm-hero-map__tag",
119
- children: [e.icon == null ? null : /* @__PURE__ */ d("span", {
119
+ children: [e.icon == null ? null : /* @__PURE__ */ l("span", {
120
120
  className: "tm-hero-map__tag-icon",
121
121
  "data-tm-icon-size": "sm",
122
122
  "aria-hidden": "true",
123
123
  children: e.icon
124
- }), /* @__PURE__ */ f("span", {
124
+ }), /* @__PURE__ */ u("span", {
125
125
  className: "tm-hero-map__tag-text",
126
- children: [/* @__PURE__ */ d("span", {
126
+ children: [/* @__PURE__ */ l("span", {
127
127
  className: "tm-hero-map__tag-title",
128
128
  children: e.title
129
- }), e.description == null ? null : /* @__PURE__ */ d("span", {
129
+ }), e.description == null ? null : /* @__PURE__ */ l("span", {
130
130
  className: "tm-hero-map__tag-description",
131
131
  children: e.description
132
132
  })]
@@ -134,19 +134,10 @@ var g = /* @__PURE__ */ o(function({ origin: o, destinations: g, activeIndex: _,
134
134
  })
135
135
  })]
136
136
  }, e.key ?? t))
137
- }),
138
- V ? /* @__PURE__ */ d("button", {
139
- type: "button",
140
- className: "tm-hero-map__playback",
141
- "aria-label": F || S ? w : C,
142
- title: F || S ? w : C,
143
- disabled: S,
144
- onClick: () => I((e) => !e),
145
- children: d(F || S ? n : t, {})
146
- }) : null
137
+ })
147
138
  ]
148
139
  });
149
140
  });
150
- export { g as HeroMap };
141
+ export { m as HeroMap };
151
142
 
152
143
  //# sourceMappingURL=HeroMap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeroMap.js","names":["WIDTH","HEIGHT","routePath","x0","origin","y0","x1","destination","y1","lift","round","value","HeroMap","props","rootRef","useRef","internal","setInternal","useState","defaultActiveIndex","count","destinations","current","activeIndex","stopped","setStopped","hovered","setHovered","onScreen","useOnScreen","reducedMotion","usePrefersReducedMotion","canPlay","autoPlay","running","paused","advance","useCallback","next","onActiveIndexChange","useEffect","timer","interval","node","ref","cn","className","onPointerEnter","event","onPointerLeave","getMapDotsPath","index","playLabel","pauseLabel","jsx","PlayGlyph","PauseGlyph"],"sources":["../../../src/components/HeroMap/HeroMap.tsx"],"sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PauseGlyph, PlayGlyph, useOnScreen, usePrefersReducedMotion } from '../HeroColumns/heroMotion';\nimport { getMapDotsPath } from './mapDots';\nimport './HeroMap.css';\n\nexport interface HeroMapOrigin {\n /** Horizontal position, in percent of the frame width (Figma: 510.5 / 640 = 79.77). */\n x: number;\n /** Vertical position, in percent of the frame height (Figma: 278 / 480 = 57.92). */\n y: number;\n /** City name printed next to the point, e.g. \"Yerevan\". */\n label?: ReactNode;\n}\n\nexport interface HeroMapDestination {\n /** Horizontal position of the pin, in percent of the frame width. */\n x: number;\n /** Vertical position of the pin, in percent of the frame height. */\n y: number;\n /** First line of the tag, e.g. \"Paris, France\". */\n title: ReactNode;\n /** Second line of the tag, e.g. \"2 adults · 12–19 Jul\". */\n description?: ReactNode;\n /** Icon in the round badge of the tag, e.g. `<BedIcon />` for a package or `<PlaneIcon />` for a flight. */\n icon?: ReactNode;\n /** React key; defaults to the destination's index. */\n key?: string | number;\n}\n\nexport interface HeroMapProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** Where every route starts. */\n origin: HeroMapOrigin;\n /** Sample requests on the map, in the order they are highlighted (Figma \"Step\" 1…6). Any number. */\n destinations: HeroMapDestination[];\n /** Index of the highlighted destination (controlled). */\n activeIndex?: number;\n /** Initially highlighted destination when uncontrolled. */\n defaultActiveIndex?: number;\n /** Called with the new index when autoplay advances. */\n onActiveIndexChange?: (index: number) => void;\n /** Moves on to the next destination on its own. */\n autoPlay?: boolean;\n /** Milliseconds each destination stays highlighted (Figma prototype: 2.2s delay + 0.5s transition). */\n interval?: number;\n /** Holds autoplay from outside (the highlighted destination stays as it is). */\n paused?: boolean;\n /** Accessible name of the pause button shown while autoplay runs. */\n pauseLabel?: string;\n /** Accessible name of the same button once autoplay is stopped. */\n playLabel?: string;\n}\n\n/* The Figma frame; positions are percentages of it, the routes are drawn in its pixels. */\nconst WIDTH = 640;\nconst HEIGHT = 480;\n\n/** Figma draws every route as a quadratic arc whose control point sits 0.28 × the chord length above its middle. */\nfunction routePath(origin: HeroMapOrigin, destination: HeroMapDestination): string {\n const x0 = (origin.x / 100) * WIDTH;\n const y0 = (origin.y / 100) * HEIGHT;\n const x1 = (destination.x / 100) * WIDTH;\n const y1 = (destination.y / 100) * HEIGHT;\n const lift = 0.28 * Math.hypot(x1 - x0, y1 - y0);\n const round = (value: number) => Math.round(value * 100) / 100;\n return `M${round(x0)} ${round(y0)}Q${round((x0 + x1) / 2)} ${round((y0 + y1) / 2 - lift)} ${round(x1)} ${round(y1)}`;\n}\n\n/**\n * Dotted map with a route from the origin to one sample request at a time (Figma component set \"Join / Hero map\").\n * Every destination is a list item with its tag as real text, so the content does not depend on the animation;\n * autoplay can be paused with the built-in button, holds on hover, off-screen and in hidden tabs, and does not start\n * for users who prefer reduced motion.\n */\nexport const HeroMap = /* @__PURE__ */ forwardRef<HTMLDivElement, HeroMapProps>(function HeroMap(\n {\n origin,\n destinations,\n activeIndex,\n defaultActiveIndex = 0,\n onActiveIndexChange,\n autoPlay = true,\n interval = 2700,\n paused = false,\n pauseLabel = 'Pause',\n playLabel = 'Play',\n className,\n onPointerEnter,\n onPointerLeave,\n ...props\n },\n ref,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [internal, setInternal] = useState(defaultActiveIndex);\n const count = destinations.length;\n const requested = activeIndex !== undefined ? activeIndex : internal;\n const current = count ? Math.min(Math.max(Math.trunc(requested) || 0, 0), count - 1) : -1;\n\n const [stopped, setStopped] = useState(false);\n const [hovered, setHovered] = useState(false);\n const onScreen = useOnScreen(rootRef);\n const reducedMotion = usePrefersReducedMotion();\n const canPlay = autoPlay && !reducedMotion && count > 1;\n const running = canPlay && !paused && !stopped && !hovered && onScreen;\n\n const advance = useCallback(() => {\n const next = (current + 1) % count;\n if (activeIndex === undefined) setInternal(next);\n onActiveIndexChange?.(next);\n }, [current, count, activeIndex, onActiveIndexChange]);\n\n useEffect(() => {\n if (!running) return;\n const timer = window.setTimeout(advance, Math.max(interval, 0));\n return () => window.clearTimeout(timer);\n }, [running, advance, interval]);\n\n return (\n <div\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn('tm-hero-map', className)}\n data-playing={running ? '' : undefined}\n onPointerEnter={(event) => {\n onPointerEnter?.(event);\n if (event.pointerType === 'mouse') setHovered(true);\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n {...props}\n >\n <svg className=\"tm-hero-map__dots\" viewBox=\"0 0 620 420\" aria-hidden=\"true\" focusable=\"false\">\n <path d={getMapDotsPath()} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"3.2\" strokeLinecap=\"round\" />\n </svg>\n\n <svg className=\"tm-hero-map__routes\" viewBox={`0 0 ${WIDTH} ${HEIGHT}`} aria-hidden=\"true\" focusable=\"false\">\n {destinations.map((destination, index) => (\n <path\n key={destination.key ?? index}\n className=\"tm-hero-map__route\"\n data-active={index === current ? '' : undefined}\n d={routePath(origin, destination)}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeDasharray=\"4 4\"\n />\n ))}\n </svg>\n\n <div className=\"tm-hero-map__origin\" style={{ left: `${origin.x}%`, top: `${origin.y}%` }}>\n <span className=\"tm-hero-map__origin-halo\" aria-hidden=\"true\" />\n <span className=\"tm-hero-map__origin-dot\" aria-hidden=\"true\" />\n {origin.label != null ? <span className=\"tm-hero-map__origin-label\">{origin.label}</span> : null}\n </div>\n\n <ul className=\"tm-hero-map__destinations\">\n {destinations.map((destination, index) => (\n <li\n key={destination.key ?? index}\n className=\"tm-hero-map__destination\"\n data-active={index === current ? '' : undefined}\n data-side={destination.x > 50 ? 'end' : 'start'}\n style={{ left: `${destination.x}%`, top: `${destination.y}%`, '--_x': destination.x } as CSSProperties}\n >\n <span className=\"tm-hero-map__pin\" aria-hidden=\"true\">\n <span className=\"tm-hero-map__halo\" />\n <span className=\"tm-hero-map__dot\" />\n <span className=\"tm-hero-map__dot tm-hero-map__dot--active\" />\n </span>\n <div className=\"tm-hero-map__tag-box\">\n <div className=\"tm-hero-map__tag\">\n {destination.icon != null ? (\n <span className=\"tm-hero-map__tag-icon\" data-tm-icon-size=\"sm\" aria-hidden=\"true\">\n {destination.icon}\n </span>\n ) : null}\n <span className=\"tm-hero-map__tag-text\">\n <span className=\"tm-hero-map__tag-title\">{destination.title}</span>\n {destination.description != null ? (\n <span className=\"tm-hero-map__tag-description\">{destination.description}</span>\n ) : null}\n </span>\n </div>\n </div>\n </li>\n ))}\n </ul>\n\n {canPlay ? (\n <button\n type=\"button\"\n className=\"tm-hero-map__playback\"\n aria-label={stopped || paused ? playLabel : pauseLabel}\n title={stopped || paused ? playLabel : pauseLabel}\n disabled={paused}\n onClick={() => setStopped((value) => !value)}\n >\n {stopped || paused ? <PlayGlyph /> : <PauseGlyph />}\n </button>\n ) : null}\n </div>\n );\n});\n"],"mappings":";;;;;;;;AAsDA,IAAMA,IAAQ,KACRC,IAAS;AAGf,SAASC,EAAU,GAAuB,GAAyC;CACjF,IAAMC,IAAMC,EAAO,IAAI,MAA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AAD;IACE,MAAK;IACL,WAAU;IACV,cAAYR,KAAWW,IAASiB,IAAYC;IAC5C,OAAO7B,KAAWW,IAASiB,IAAYC;IACvC,UAAUlB;IACV,eAAeV,GAAY,MAAU,CAACd,CAAK;IAE1C,UAAoB2C,EAApB9B,KAAWW,IAAUoB,IAAgBC,GAAjB,CAAY,CAAiB;GAC5C,CAAA,IACN;EACD;;AAET,CAAC"}
1
+ {"version":3,"file":"HeroMap.js","names":["WIDTH","HEIGHT","routePath","x0","origin","y0","x1","destination","y1","lift","round","value","HeroMap","props","rootRef","useRef","internal","setInternal","useState","defaultActiveIndex","count","destinations","current","activeIndex","hovered","setHovered","onScreen","useOnScreen","reducedMotion","usePrefersReducedMotion","running","autoPlay","paused","advance","useCallback","next","onActiveIndexChange","useEffect","timer","interval","node","ref","cn","className","onPointerEnter","event","onPointerLeave","getMapDotsPath","index"],"sources":["../../../src/components/HeroMap/HeroMap.tsx"],"sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useOnScreen, usePrefersReducedMotion } from '../HeroColumns/heroMotion';\nimport { getMapDotsPath } from './mapDots';\nimport './HeroMap.css';\n\nexport interface HeroMapOrigin {\n /** Horizontal position, in percent of the frame width (Figma: 510.5 / 640 = 79.77). */\n x: number;\n /** Vertical position, in percent of the frame height (Figma: 278 / 480 = 57.92). */\n y: number;\n /** City name printed next to the point, e.g. \"Yerevan\". */\n label?: ReactNode;\n}\n\nexport interface HeroMapDestination {\n /** Horizontal position of the pin, in percent of the frame width. */\n x: number;\n /** Vertical position of the pin, in percent of the frame height. */\n y: number;\n /** First line of the tag, e.g. \"Paris, France\". */\n title: ReactNode;\n /** Second line of the tag, e.g. \"2 adults · 12–19 Jul\". */\n description?: ReactNode;\n /** Icon in the round badge of the tag, e.g. `<BedIcon />` for a package or `<PlaneIcon />` for a flight. */\n icon?: ReactNode;\n /** React key; defaults to the destination's index. */\n key?: string | number;\n}\n\nexport interface HeroMapProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** Where every route starts. */\n origin: HeroMapOrigin;\n /** Sample requests on the map, in the order they are highlighted (Figma \"Step\" 1…6). Any number. */\n destinations: HeroMapDestination[];\n /** Index of the highlighted destination (controlled). */\n activeIndex?: number;\n /** Initially highlighted destination when uncontrolled. */\n defaultActiveIndex?: number;\n /** Called with the new index when autoplay advances. */\n onActiveIndexChange?: (index: number) => void;\n /** Moves on to the next destination on its own, in an endless loop. */\n autoPlay?: boolean;\n /** Milliseconds each destination stays highlighted (Figma prototype: 2.2s delay + 0.5s transition). */\n interval?: number;\n /** Holds autoplay from outside (the highlighted destination stays as it is); it carries on once this is `false` again. */\n paused?: boolean;\n}\n\n/* The Figma frame; positions are percentages of it, the routes are drawn in its pixels. */\nconst WIDTH = 640;\nconst HEIGHT = 480;\n\n/** Figma draws every route as a quadratic arc whose control point sits 0.28 × the chord length above its middle. */\nfunction routePath(origin: HeroMapOrigin, destination: HeroMapDestination): string {\n const x0 = (origin.x / 100) * WIDTH;\n const y0 = (origin.y / 100) * HEIGHT;\n const x1 = (destination.x / 100) * WIDTH;\n const y1 = (destination.y / 100) * HEIGHT;\n const lift = 0.28 * Math.hypot(x1 - x0, y1 - y0);\n const round = (value: number) => Math.round(value * 100) / 100;\n return `M${round(x0)} ${round(y0)}Q${round((x0 + x1) / 2)} ${round((y0 + y1) / 2 - lift)} ${round(x1)} ${round(y1)}`;\n}\n\n/**\n * Dotted map with a route from the origin to one sample request at a time (Figma component set \"Join / Hero map\").\n * Every destination is a list item with its tag as real text, so the content does not depend on the animation;\n * autoplay loops endlessly, holds on hover, off-screen and in hidden tabs, and does not start for users who prefer\n * reduced motion.\n */\nexport const HeroMap = /* @__PURE__ */ forwardRef<HTMLDivElement, HeroMapProps>(function HeroMap(\n {\n origin,\n destinations,\n activeIndex,\n defaultActiveIndex = 0,\n onActiveIndexChange,\n autoPlay = true,\n interval = 2700,\n paused = false,\n className,\n onPointerEnter,\n onPointerLeave,\n ...props\n },\n ref,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [internal, setInternal] = useState(defaultActiveIndex);\n const count = destinations.length;\n const requested = activeIndex !== undefined ? activeIndex : internal;\n const current = count ? Math.min(Math.max(Math.trunc(requested) || 0, 0), count - 1) : -1;\n\n const [hovered, setHovered] = useState(false);\n const onScreen = useOnScreen(rootRef);\n const reducedMotion = usePrefersReducedMotion();\n const running = autoPlay && !reducedMotion && count > 1 && !paused && !hovered && onScreen;\n\n const advance = useCallback(() => {\n const next = (current + 1) % count;\n if (activeIndex === undefined) setInternal(next);\n onActiveIndexChange?.(next);\n }, [current, count, activeIndex, onActiveIndexChange]);\n\n useEffect(() => {\n if (!running) return;\n const timer = window.setTimeout(advance, Math.max(interval, 0));\n return () => window.clearTimeout(timer);\n }, [running, advance, interval]);\n\n return (\n <div\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn('tm-hero-map', className)}\n data-playing={running ? '' : undefined}\n onPointerEnter={(event) => {\n onPointerEnter?.(event);\n if (event.pointerType === 'mouse') setHovered(true);\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n {...props}\n >\n <svg className=\"tm-hero-map__dots\" viewBox=\"0 0 620 420\" aria-hidden=\"true\" focusable=\"false\">\n <path d={getMapDotsPath()} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"3.2\" strokeLinecap=\"round\" />\n </svg>\n\n <svg className=\"tm-hero-map__routes\" viewBox={`0 0 ${WIDTH} ${HEIGHT}`} aria-hidden=\"true\" focusable=\"false\">\n {destinations.map((destination, index) => (\n <path\n key={destination.key ?? index}\n className=\"tm-hero-map__route\"\n data-active={index === current ? '' : undefined}\n d={routePath(origin, destination)}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeDasharray=\"4 4\"\n />\n ))}\n </svg>\n\n <div className=\"tm-hero-map__origin\" style={{ left: `${origin.x}%`, top: `${origin.y}%` }}>\n <span className=\"tm-hero-map__origin-halo\" aria-hidden=\"true\" />\n <span className=\"tm-hero-map__origin-dot\" aria-hidden=\"true\" />\n {origin.label != null ? <span className=\"tm-hero-map__origin-label\">{origin.label}</span> : null}\n </div>\n\n <ul className=\"tm-hero-map__destinations\">\n {destinations.map((destination, index) => (\n <li\n key={destination.key ?? index}\n className=\"tm-hero-map__destination\"\n data-active={index === current ? '' : undefined}\n data-side={destination.x > 50 ? 'end' : 'start'}\n style={{ left: `${destination.x}%`, top: `${destination.y}%`, '--_x': destination.x } as CSSProperties}\n >\n <span className=\"tm-hero-map__pin\" aria-hidden=\"true\">\n <span className=\"tm-hero-map__halo\" />\n <span className=\"tm-hero-map__dot\" />\n <span className=\"tm-hero-map__dot tm-hero-map__dot--active\" />\n </span>\n <div className=\"tm-hero-map__tag-box\">\n <div className=\"tm-hero-map__tag\">\n {destination.icon != null ? (\n <span className=\"tm-hero-map__tag-icon\" data-tm-icon-size=\"sm\" aria-hidden=\"true\">\n {destination.icon}\n </span>\n ) : null}\n <span className=\"tm-hero-map__tag-text\">\n <span className=\"tm-hero-map__tag-title\">{destination.title}</span>\n {destination.description != null ? (\n <span className=\"tm-hero-map__tag-description\">{destination.description}</span>\n ) : null}\n </span>\n </div>\n </div>\n </li>\n ))}\n </ul>\n </div>\n );\n});\n"],"mappings":";;;;;;;;AAkDA,IAAMA,IAAQ,KACRC,IAAS;AAGf,SAASC,EAAU,GAAuB,GAAyC;CACjF,IAAMC,IAAMC,EAAO,IAAI,MAAOJ,GACxBK,IAAMD,EAAO,IAAI,MAAOH,GACxBK,IAAMC,EAAY,IAAI,MAAOP,GAC7BQ,IAAMD,EAAY,IAAI,MAAON,GAC7BQ,IAAO,MAAO,KAAK,MAAMH,IAAKH,GAAIK,IAAKH,CAAE,GACzCK,KAAS,MAAkB,KAAK,MAAMC,IAAQ,GAAG,IA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,MAAD;KAEE,WAAU;KACV,eAAa2B,MAAU1B,IAAU,KAAK,KAAA;KACtC,aAAWf,EAAY,IAAI,KAAK,QAAQ;KACxC,OAAO;MAAE,MAAM,GAAGA,EAAY,EAAE;MAAI,KAAK,GAAGA,EAAY,EAAE;MAAI,QAAQA,EAAY;KAAE;KALtF,UAAA,CAOE,kBAAC,QAAD;MAAM,WAAU;MAAmB,eAAY;MAA/C,UAAA;OACE,kBAAC,QAAD,EAAM,WAAU,oBAAqB,CAAA;OACrC,kBAAC,QAAD,EAAM,WAAU,mBAAoB,CAAA;OACpC,kBAAC,QAAD,EAAM,WAAU,4CAA6C,CAAA;MACzD;KACN,CAAA,GAAA,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACGA,EAAY,QAAQ,OAIjB,OAHF,kBAAC,QAAD;QAAM,WAAU;QAAwB,qBAAkB;QAAK,eAAY;QACxE,UAAAA,EAAY;OACT,CAAA,GAER,kBAAC,QAAD;QAAM,WAAU;QAAhB,UAAA,CACE,kBAAC,QAAD;SAAM,WAAU;SAA0B,UAAAA,EAAY;QAAY,CAAA,GACjEA,EAAY,eAAe,OAExB,OADF,kBAAC,QAAD;SAAM,WAAU;SAAgC,UAAAA,EAAY;QAAkB,CAAA,CAE5E;OACH,CAAA,CAAA;;KACF,CAAA,CACH;IA1BG,GAAAA,EAAY,OAAOyC,CA0BtB,CACL;GACC,CAAA;EACD;;AAET,CAAC"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../icons/generated/CheckmarkIcon.cjs"),t=require("../../utils/cn.cjs"),n=require("../HeroColumns/heroMotion.cjs");;/* empty css */let r=require("react"),i=require("react/jsx-runtime");var a=typeof window>`u`?r.useEffect:r.useLayoutEffect,o=(0,r.forwardRef)(function({items:o,value:s,defaultValue:c,onValueChange:l,autoPlay:u=!0,interval:d=3600,paused:f=!1,"aria-label":p,headingLevel:m=3,pauseLabel:h=`Pause`,playLabel:g=`Play`,className:_,onPointerEnter:v,onPointerLeave:y,onFocus:b,onBlur:x,...S},C){let w=(0,r.useId)(),T=(0,r.useRef)(null),E=(0,r.useRef)(null),D=(0,r.useRef)([]),[O,k]=(0,r.useState)(c),A=s===void 0?O:s,j=o.findIndex(e=>e.value===A),M=j===-1?0:j,[N,P]=(0,r.useState)(!1),[F,I]=(0,r.useState)(!1),[L,R]=(0,r.useState)(!1),[z,B]=(0,r.useState)(!1),V=n.useOnScreen(T),H=n.usePrefersReducedMotion(),U=u&&!H&&o.length>1,W=U&&!f&&!N&&!L&&!z&&V,G=(0,r.useCallback)(e=>{let t=o[e];t&&(s===void 0&&k(t.value),t.value!==o[M]?.value&&l?.(t.value))},[o,s,M,l]);(0,r.useEffect)(()=>{if(!W)return;let e=window.setTimeout(()=>G((M+1)%o.length),Math.max(d,0));return()=>window.clearTimeout(e)},[W,M,d,o.length,G]);let[K,q]=(0,r.useState)(null);a(()=>{let e=E.current;if(!e)return;let t=()=>{let e=D.current[M];e&&e.offsetWidth!==0&&q(t=>t&&t.x===e.offsetLeft&&t.width===e.offsetWidth?t:{x:e.offsetLeft,width:e.offsetWidth})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[M,o.length]);let J=e=>{P(!0),I(!0),G(e)},Y=(e,t)=>{let n=o.length-1,r=typeof getComputedStyle==`function`&&getComputedStyle(e.currentTarget).direction===`rtl`,i;if(e.key===`ArrowRight`)i=r?t-1:t+1;else if(e.key===`ArrowLeft`)i=r?t+1:t-1;else if(e.key===`Home`)i=0;else if(e.key===`End`)i=n;else return;e.preventDefault(),i=i<0?n:i>n?0:i,J(i),D.current[i]?.focus()},X=`h${m}`;return(0,i.jsxs)(`div`,{ref:e=>{T.current=e,typeof C==`function`?C(e):C&&(C.current=e)},className:t.cn(`tm-hero-switcher`,_),"data-playing":W?``:void 0,"data-picked":F?``:void 0,onPointerEnter:e=>{v?.(e),e.pointerType===`mouse`&&R(!0)},onPointerLeave:e=>{y?.(e),R(!1)},onFocus:e=>{b?.(e);let t=!0;try{t=e.target.matches(`:focus-visible`)}catch{}t&&B(!0)},onBlur:e=>{x?.(e),e.currentTarget.contains(e.relatedTarget)||B(!1)},...S,children:[(0,i.jsx)(`div`,{className:`tm-hero-switcher__photo`,children:o.map((e,t)=>{let n=t===M;return(0,i.jsx)(`div`,{className:`tm-hero-switcher__slide`,"data-active":n?``:void 0,"aria-hidden":!n||void 0,children:e.image??(e.imageSrc?(0,i.jsx)(`img`,{className:`tm-hero-switcher__image`,src:e.imageSrc,alt:e.imageAlt??``,draggable:!1}):null)},e.value)})}),(0,i.jsxs)(`div`,{ref:E,className:`tm-hero-switcher__switch`,role:`tablist`,"aria-label":p,"data-measured":K?``:void 0,children:[(0,i.jsx)(`span`,{className:`tm-hero-switcher__indicator`,"aria-hidden":`true`,style:K?{width:K.width,transform:`translateX(${K.x}px)`}:void 0}),o.map((e,t)=>{let n=t===M;return(0,i.jsxs)(`button`,{ref:e=>{D.current[t]=e},type:`button`,role:`tab`,id:`${w}-tab-${t}`,className:`tm-hero-switcher__tab`,"data-tm-icon-size":`sm`,"aria-selected":n,"aria-controls":`${w}-panel-${t}`,tabIndex:n?0:-1,onClick:()=>J(t),onKeyDown:e=>Y(e,t),children:[e.icon,(0,i.jsx)(`span`,{className:`tm-hero-switcher__tab-label`,children:e.label})]},e.value)})]}),(0,i.jsx)(`div`,{className:`tm-hero-switcher__card`,children:o.map((t,n)=>{let r=n===M;return(0,i.jsxs)(`div`,{role:`tabpanel`,id:`${w}-panel-${n}`,"aria-labelledby":`${w}-tab-${n}`,className:`tm-hero-switcher__panel`,"data-active":r?``:void 0,"aria-hidden":!r||void 0,children:[t.overline==null?null:(0,i.jsx)(`p`,{className:`tm-hero-switcher__overline`,children:t.overline}),(0,i.jsx)(X,{className:`tm-hero-switcher__title`,children:t.title}),t.details?.length?(0,i.jsx)(`ul`,{className:`tm-hero-switcher__details`,"data-tm-icon-size":`sm`,children:t.details.map((e,t)=>(0,i.jsxs)(`li`,{className:`tm-hero-switcher__detail`,children:[e.icon,(0,i.jsx)(`span`,{children:e.label})]},e.key??t))}):null,t.status==null?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`hr`,{className:`tm-hero-switcher__divider`}),(0,i.jsxs)(`p`,{className:`tm-hero-switcher__status`,"data-tm-icon-size":`sm`,children:[t.statusIcon??(0,i.jsx)(e.CheckmarkIcon,{}),(0,i.jsx)(`span`,{children:t.status})]})]})]},t.value)})}),U?(0,i.jsx)(`button`,{type:`button`,className:`tm-hero-switcher__playback`,"aria-label":N||f?g:h,title:N||f?g:h,disabled:f,onClick:()=>P(e=>!e),children:N||f?(0,i.jsx)(n.PlayGlyph,{}):(0,i.jsx)(n.PauseGlyph,{})}):null]})});exports.HeroSwitcher=o;
1
+ "use client";const e=require("../../icons/generated/CheckmarkIcon.cjs"),t=require("../../utils/cn.cjs"),n=require("../HeroColumns/heroMotion.cjs");;/* empty css */let r=require("react"),i=require("react/jsx-runtime");var a=typeof window>`u`?r.useEffect:r.useLayoutEffect,o=(0,r.forwardRef)(function({items:o,value:s,defaultValue:c,onValueChange:l,autoPlay:u=!0,interval:d=3600,paused:f=!1,"aria-label":p,headingLevel:m=3,className:h,onPointerEnter:g,onPointerLeave:_,onFocus:v,onBlur:y,...b},x){let S=(0,r.useId)(),C=(0,r.useRef)(null),w=(0,r.useRef)(null),T=(0,r.useRef)([]),[E,D]=(0,r.useState)(c),O=s===void 0?E:s,k=o.findIndex(e=>e.value===O),A=k===-1?0:k,[j,M]=(0,r.useState)(!1),[N,P]=(0,r.useState)(!1),[F,I]=(0,r.useState)(!1),L=n.useOnScreen(C),R=n.usePrefersReducedMotion(),z=u&&!R&&o.length>1&&!f&&!N&&!F&&L,B=(0,r.useCallback)(e=>{let t=o[e];t&&(s===void 0&&D(t.value),t.value!==o[A]?.value&&l?.(t.value))},[o,s,A,l]);(0,r.useEffect)(()=>{if(!z)return;let e=window.setTimeout(()=>{M(!1),B((A+1)%o.length)},Math.max(d,0));return()=>window.clearTimeout(e)},[z,A,d,o.length,B]);let[V,H]=(0,r.useState)(null);a(()=>{let e=w.current;if(!e)return;let t=()=>{let e=T.current[A];e&&e.offsetWidth!==0&&H(t=>t&&t.x===e.offsetLeft&&t.width===e.offsetWidth?t:{x:e.offsetLeft,width:e.offsetWidth})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[A,o.length]);let U=e=>{M(!0),B(e)},W=(e,t)=>{let n=o.length-1,r=typeof getComputedStyle==`function`&&getComputedStyle(e.currentTarget).direction===`rtl`,i;if(e.key===`ArrowRight`)i=r?t-1:t+1;else if(e.key===`ArrowLeft`)i=r?t+1:t-1;else if(e.key===`Home`)i=0;else if(e.key===`End`)i=n;else return;e.preventDefault(),i=i<0?n:i>n?0:i,U(i),T.current[i]?.focus()},G=`h${m}`;return(0,i.jsxs)(`div`,{ref:e=>{C.current=e,typeof x==`function`?x(e):x&&(x.current=e)},className:t.cn(`tm-hero-switcher`,h),"data-playing":z?``:void 0,"data-picked":j?``:void 0,onPointerEnter:e=>{g?.(e),e.pointerType===`mouse`&&P(!0)},onPointerLeave:e=>{_?.(e),P(!1)},onFocus:e=>{v?.(e);let t=!0;try{t=e.target.matches(`:focus-visible`)}catch{}t&&I(!0)},onBlur:e=>{y?.(e),e.currentTarget.contains(e.relatedTarget)||I(!1)},...b,children:[(0,i.jsx)(`div`,{className:`tm-hero-switcher__photo`,children:o.map((e,t)=>{let n=t===A;return(0,i.jsx)(`div`,{className:`tm-hero-switcher__slide`,"data-active":n?``:void 0,"aria-hidden":!n||void 0,children:e.image??(e.imageSrc?(0,i.jsx)(`img`,{className:`tm-hero-switcher__image`,src:e.imageSrc,alt:e.imageAlt??``,draggable:!1}):null)},e.value)})}),(0,i.jsxs)(`div`,{ref:w,className:`tm-hero-switcher__switch`,role:`tablist`,"aria-label":p,"data-measured":V?``:void 0,children:[(0,i.jsx)(`span`,{className:`tm-hero-switcher__indicator`,"aria-hidden":`true`,style:V?{width:V.width,transform:`translateX(${V.x}px)`}:void 0}),o.map((e,t)=>{let n=t===A;return(0,i.jsxs)(`button`,{ref:e=>{T.current[t]=e},type:`button`,role:`tab`,id:`${S}-tab-${t}`,className:`tm-hero-switcher__tab`,"data-tm-icon-size":`sm`,"aria-selected":n,"aria-controls":`${S}-panel-${t}`,tabIndex:n?0:-1,onClick:()=>U(t),onKeyDown:e=>W(e,t),children:[e.icon,(0,i.jsx)(`span`,{className:`tm-hero-switcher__tab-label`,children:e.label})]},e.value)})]}),(0,i.jsx)(`div`,{className:`tm-hero-switcher__card`,children:o.map((t,n)=>{let r=n===A;return(0,i.jsxs)(`div`,{role:`tabpanel`,id:`${S}-panel-${n}`,"aria-labelledby":`${S}-tab-${n}`,className:`tm-hero-switcher__panel`,"data-active":r?``:void 0,"aria-hidden":!r||void 0,children:[t.overline==null?null:(0,i.jsx)(`p`,{className:`tm-hero-switcher__overline`,children:t.overline}),(0,i.jsx)(G,{className:`tm-hero-switcher__title`,children:t.title}),t.details?.length?(0,i.jsx)(`ul`,{className:`tm-hero-switcher__details`,"data-tm-icon-size":`sm`,children:t.details.map((e,t)=>(0,i.jsxs)(`li`,{className:`tm-hero-switcher__detail`,children:[e.icon,(0,i.jsx)(`span`,{children:e.label})]},e.key??t))}):null,t.status==null?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`hr`,{className:`tm-hero-switcher__divider`}),(0,i.jsxs)(`p`,{className:`tm-hero-switcher__status`,"data-tm-icon-size":`sm`,children:[t.statusIcon??(0,i.jsx)(e.CheckmarkIcon,{}),(0,i.jsx)(`span`,{children:t.status})]})]})]},t.value)})})]})});exports.HeroSwitcher=o;
2
2
  //# sourceMappingURL=HeroSwitcher.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeroSwitcher.cjs","names":["useEffect","useLayoutEffect","useId","useRef","useState","useOnScreen","usePrefersReducedMotion","useCallback","cn","_Fragment","CheckmarkIcon","PlayGlyph","PauseGlyph","require_CheckmarkIcon","require_cn","require_heroMotion","react","react_jsx_runtime","useIsomorphicLayoutEffect","HeroSwitcher","ariaLabel","props","id","rootRef","listRef","tabRefs","internal","setInternal","defaultValue","requested","value","found","items","item","activeIndex","stopped","setStopped","picked","setPicked","hovered","setHovered","focused","setFocused","onScreen","reducedMotion","canPlay","autoPlay","running","paused","select","next","index","onValueChange","timer","interval","indicator","setIndicator","list","measure","tab","previous","observer","pick","handleKeyDown","last","rtl","event","Heading","headingLevel","node","ref","className","onPointerEnter","onPointerLeave","onFocus","keyboard","onBlur","active","detail","row","playLabel","pauseLabel","current"],"sources":["../../../src/components/HeroSwitcher/HeroSwitcher.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport { PauseGlyph, PlayGlyph, useOnScreen, usePrefersReducedMotion } from '../HeroColumns/heroMotion';\nimport './HeroSwitcher.css';\n\nexport interface HeroSwitcherDetail {\n /** Icon in front of the text, e.g. `<CalendarIcon />`; drawn at 16px. */\n icon?: ReactNode;\n /** Already formatted, translated text: dates, travelers, what is included… */\n label: ReactNode;\n /** React key; defaults to the row's index. */\n key?: string | number;\n}\n\nexport interface HeroSwitcherItem {\n /** Identifier of the state (Figma \"Type\": `package`, `flight`). */\n value: string;\n /** Text of the segment in the switch, e.g. \"Travel Package\". */\n label: ReactNode;\n /** Icon of the segment, e.g. `<RoadmapIcon />`; drawn at 16px. */\n icon?: ReactNode;\n /** Photo URL. Without it (and without `image`) a neutral tile is shown. */\n imageSrc?: string;\n /** Alternative text of the photo; leave empty when it is decorative. */\n imageAlt?: string;\n /** Custom photo element (e.g. a framework `<Image>`); it fills the frame and replaces `imageSrc`. */\n image?: ReactNode;\n /** Small caps line above the title (Figma \"Overline\"), e.g. \"Your request\". */\n overline?: ReactNode;\n /** Title of the sample request, e.g. \"Weekend at Lake Sevan\". */\n title: ReactNode;\n /** Icon + text rows under the title. */\n details?: HeroSwitcherDetail[];\n /** Text of the green pill at the bottom of the card (Figma \"Status\"), e.g. \"3 offers to compare\". */\n status?: ReactNode;\n /** Icon of the status pill. Defaults to a check mark. */\n statusIcon?: ReactNode;\n}\n\nexport interface HeroSwitcherProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n /** The states to switch between (Figma: Package and Flight), in the order of the switch. */\n items: HeroSwitcherItem[];\n /** Selected item (controlled). */\n value?: string;\n /** Initially selected item when uncontrolled; defaults to the first one. */\n defaultValue?: string;\n /** Called with the new value when the user picks a segment or autoplay advances. */\n onValueChange?: (value: string) => void;\n /** Advances to the next item on its own until the user picks a segment or presses pause. */\n autoPlay?: boolean;\n /** Milliseconds each item stays before autoplay moves on (Figma prototype: 3s delay + 0.6s transition). */\n interval?: number;\n /** Holds autoplay from outside (the selected item stays as it is). */\n paused?: boolean;\n /** Accessible name of the switch (tab list). */\n 'aria-label'?: string;\n /** Heading level of the card title; pick the one that fits the page outline. */\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n /** Accessible name of the pause button shown while autoplay runs. */\n pauseLabel?: string;\n /** Accessible name of the same button once autoplay is stopped. */\n playLabel?: string;\n}\n\nconst useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\n/**\n * Photo, segmented switch and a sample request card that change together (Figma component set\n * \"Travel Requests / Hero switcher\"). The switch is a real tab list — click or use the arrow keys — and autoplay\n * stops for good once the user takes over, pauses on hover and focus, off-screen, in hidden tabs and never starts\n * for users who prefer reduced motion.\n */\nexport const HeroSwitcher = /* @__PURE__ */ forwardRef<HTMLDivElement, HeroSwitcherProps>(function HeroSwitcher(\n {\n items,\n value,\n defaultValue,\n onValueChange,\n autoPlay = true,\n interval = 3600,\n paused = false,\n 'aria-label': ariaLabel,\n headingLevel = 3,\n pauseLabel = 'Pause',\n playLabel = 'Play',\n className,\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n) {\n const id = useId();\n const rootRef = useRef<HTMLDivElement | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const tabRefs = useRef<Array<HTMLButtonElement | null>>([]);\n\n const [internal, setInternal] = useState(defaultValue);\n const requested = value !== undefined ? value : internal;\n const found = items.findIndex((item) => item.value === requested);\n const activeIndex = found === -1 ? 0 : found;\n\n const [stopped, setStopped] = useState(false);\n // The last change came from the user picking a segment (Figma: those switches animate in 0.4s, autoplay in 0.6s).\n const [picked, setPicked] = useState(false);\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n const onScreen = useOnScreen(rootRef);\n const reducedMotion = usePrefersReducedMotion();\n const canPlay = autoPlay && !reducedMotion && items.length > 1;\n const running = canPlay && !paused && !stopped && !hovered && !focused && onScreen;\n\n const select = useCallback(\n (index: number) => {\n const next = items[index];\n if (!next) return;\n if (value === undefined) setInternal(next.value);\n if (next.value !== items[activeIndex]?.value) onValueChange?.(next.value);\n },\n [items, value, activeIndex, onValueChange],\n );\n\n useEffect(() => {\n if (!running) return;\n const timer = window.setTimeout(() => select((activeIndex + 1) % items.length), Math.max(interval, 0));\n return () => window.clearTimeout(timer);\n }, [running, activeIndex, interval, items.length, select]);\n\n // The sliding pill (Figma \"Indicator\") takes the position and width of the selected segment.\n const [indicator, setIndicator] = useState<{ x: number; width: number } | null>(null);\n useIsomorphicLayoutEffect(() => {\n const list = listRef.current;\n if (!list) return;\n const measure = () => {\n const tab = tabRefs.current[activeIndex];\n if (!tab || tab.offsetWidth === 0) return;\n setIndicator((previous) =>\n previous && previous.x === tab.offsetLeft && previous.width === tab.offsetWidth\n ? previous\n : { x: tab.offsetLeft, width: tab.offsetWidth },\n );\n };\n measure();\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(measure);\n observer.observe(list);\n return () => observer.disconnect();\n }, [activeIndex, items.length]);\n\n const pick = (index: number) => {\n setStopped(true);\n setPicked(true);\n select(index);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>, index: number) => {\n const last = items.length - 1;\n const rtl = typeof getComputedStyle === 'function' && getComputedStyle(event.currentTarget).direction === 'rtl';\n let next: number;\n if (event.key === 'ArrowRight') next = rtl ? index - 1 : index + 1;\n else if (event.key === 'ArrowLeft') next = rtl ? index + 1 : index - 1;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = last;\n else return;\n event.preventDefault();\n next = next < 0 ? last : next > last ? 0 : next;\n pick(next);\n tabRefs.current[next]?.focus();\n };\n\n const Heading = `h${headingLevel}` as const;\n\n return (\n <div\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn('tm-hero-switcher', className)}\n data-playing={running ? '' : undefined}\n data-picked={picked ? '' : undefined}\n onPointerEnter={(event) => {\n onPointerEnter?.(event);\n if (event.pointerType === 'mouse') setHovered(true);\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n // Keyboard focus only: a mouse click on the pause button must not hold autoplay until the next blur.\n let keyboard = true;\n try {\n keyboard = event.target.matches(':focus-visible');\n } catch {\n /* :focus-visible unsupported — treat every focus as keyboard focus */\n }\n if (keyboard) setFocused(true);\n }}\n onBlur={(event) => {\n onBlur?.(event);\n if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);\n }}\n {...props}\n >\n <div className=\"tm-hero-switcher__photo\">\n {items.map((item, index) => {\n const active = index === activeIndex;\n return (\n <div key={item.value} className=\"tm-hero-switcher__slide\" data-active={active ? '' : undefined} aria-hidden={active ? undefined : true}>\n {item.image ??\n (item.imageSrc ? (\n <img className=\"tm-hero-switcher__image\" src={item.imageSrc} alt={item.imageAlt ?? ''} draggable={false} />\n ) : null)}\n </div>\n );\n })}\n </div>\n\n <div ref={listRef} className=\"tm-hero-switcher__switch\" role=\"tablist\" aria-label={ariaLabel} data-measured={indicator ? '' : undefined}>\n <span\n className=\"tm-hero-switcher__indicator\"\n aria-hidden=\"true\"\n style={indicator ? ({ width: indicator.width, transform: `translateX(${indicator.x}px)` } as CSSProperties) : undefined}\n />\n {items.map((item, index) => {\n const active = index === activeIndex;\n return (\n <button\n key={item.value}\n ref={(node) => {\n tabRefs.current[index] = node;\n }}\n type=\"button\"\n role=\"tab\"\n id={`${id}-tab-${index}`}\n className=\"tm-hero-switcher__tab\"\n data-tm-icon-size=\"sm\"\n aria-selected={active}\n aria-controls={`${id}-panel-${index}`}\n tabIndex={active ? 0 : -1}\n onClick={() => pick(index)}\n onKeyDown={(event) => handleKeyDown(event, index)}\n >\n {item.icon}\n <span className=\"tm-hero-switcher__tab-label\">{item.label}</span>\n </button>\n );\n })}\n </div>\n\n <div className=\"tm-hero-switcher__card\">\n {items.map((item, index) => {\n const active = index === activeIndex;\n return (\n <div\n key={item.value}\n role=\"tabpanel\"\n id={`${id}-panel-${index}`}\n aria-labelledby={`${id}-tab-${index}`}\n className=\"tm-hero-switcher__panel\"\n data-active={active ? '' : undefined}\n aria-hidden={active ? undefined : true}\n >\n {item.overline != null ? <p className=\"tm-hero-switcher__overline\">{item.overline}</p> : null}\n <Heading className=\"tm-hero-switcher__title\">{item.title}</Heading>\n {item.details?.length ? (\n <ul className=\"tm-hero-switcher__details\" data-tm-icon-size=\"sm\">\n {item.details.map((detail, row) => (\n <li key={detail.key ?? row} className=\"tm-hero-switcher__detail\">\n {detail.icon}\n <span>{detail.label}</span>\n </li>\n ))}\n </ul>\n ) : null}\n {item.status != null ? (\n <>\n <hr className=\"tm-hero-switcher__divider\" />\n <p className=\"tm-hero-switcher__status\" data-tm-icon-size=\"sm\">\n {item.statusIcon ?? <CheckmarkIcon />}\n <span>{item.status}</span>\n </p>\n </>\n ) : null}\n </div>\n );\n })}\n </div>\n\n {canPlay ? (\n <button\n type=\"button\"\n className=\"tm-hero-switcher__playback\"\n aria-label={stopped || paused ? playLabel : pauseLabel}\n title={stopped || paused ? playLabel : pauseLabel}\n disabled={paused}\n onClick={() => setStopped((current) => !current)}\n >\n {stopped || paused ? <PlayGlyph /> : <PauseGlyph />}\n </button>\n ) : null}\n </div>\n );\n});\n"],"mappings":"A,2OA6EA,IAAMkB,EAA4B,OAAO,OAAW,IAAclB,EAAAA,UAAYC,EAAAA,gBAQjEkB,GAA+B,EAAAH,EAAA,WAAA,CAA8C,SACxF,CACE,QACA,QACA,eACA,gBACA,WAAW,GACX,WAAW,KACX,SAAS,GACT,aAAcI,EACd,eAAe,EACf,aAAa,QACb,YAAY,OACZ,YACA,iBACA,iBACA,UACA,SACA,GAAGC,GAEL,EACA,CACA,IAAMC,GAAA,EAAKpB,EAAAA,MAAAA,CAAM,EACXqB,GAAA,EAAUpB,EAAAA,OAAAA,CAA8B,IAAI,EAC5CqB,GAAA,EAAUrB,EAAAA,OAAAA,CAA8B,IAAI,EAC5CsB,GAAA,EAAUtB,EAAAA,OAAAA,CAAwC,CAAC,CAAC,EAEpD,CAACuB,EAAUC,IAAA,EAAevB,EAAAA,SAAAA,CAASwB,CAAY,EAC/CC,EAAYC,IAAU,IAAA,GAAoBJ,EAARI,EAClCC,EAAQC,EAAM,UAAW,GAASC,EAAK,QAAUJ,CAAS,EAC1DK,EAAcH,IAAU,GAAK,EAAIA,EAEjC,CAACI,EAASC,IAAA,EAAchC,EAAAA,SAAAA,CAAS,EAAK,EAEtC,CAACiC,EAAQC,IAAA,EAAalC,EAAAA,SAAAA,CAAS,EAAK,EACpC,CAACmC,EAASC,IAAA,EAAcpC,EAAAA,SAAAA,CAAS,EAAK,EACtC,CAACqC,EAASC,IAAA,EAActC,EAAAA,SAAAA,CAAS,EAAK,EACtCuC,EAAWtC,EAAAA,YAAYkB,CAAO,EAC9BqB,EAAgBtC,EAAAA,wBAAwB,EACxCuC,EAAUC,GAAY,CAACF,GAAiBZ,EAAM,OAAS,EAC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,CAAgB,CAAA,GACpC,EAAAO,EAAA,IAAA,CAAC,OAAD,CAAA,SAAOgB,EAAK,MAAa,CAAA,CACxB,CACH,CAAA,CAAA,CAAA,CAAA,CAED,CA7BE,EAAAA,EAAK,KA6BP,CAET,CAAC,CACE,CAAA,EAEJY,GACC,EAAA5B,EAAA,IAAA,CAAC,SAAD,CACE,KAAK,SACL,UAAU,6BACV,aAAYkB,GAAWa,EAASgC,EAAYC,EAC5C,MAAO9C,GAAWa,EAASgC,EAAYC,EACvC,SAAUjC,EACV,YAAeZ,EAAY,GAAY,CAAC8C,CAAO,EAE9C,SAAA/C,GAAWa,GAAS,EAAA/B,EAAA,IAAA,CAACN,EAAAA,UAAD,CAAY,CAAA,GAAI,EAAAM,EAAA,IAAA,CAACL,EAAAA,WAAD,CAAa,CAAA,CAC5C,CAAA,EACN,IACD,C,EAET,CAAC,E"}
1
+ {"version":3,"file":"HeroSwitcher.cjs","names":["useEffect","useLayoutEffect","useId","useRef","useState","useOnScreen","usePrefersReducedMotion","useCallback","cn","_Fragment","CheckmarkIcon","require_CheckmarkIcon","require_cn","require_heroMotion","react","react_jsx_runtime","useIsomorphicLayoutEffect","HeroSwitcher","ariaLabel","props","id","rootRef","listRef","tabRefs","internal","setInternal","defaultValue","requested","value","found","items","item","activeIndex","picked","setPicked","hovered","setHovered","focused","setFocused","onScreen","reducedMotion","running","autoPlay","paused","select","next","index","onValueChange","timer","interval","indicator","setIndicator","list","measure","tab","previous","observer","pick","handleKeyDown","last","rtl","event","Heading","headingLevel","node","ref","className","onPointerEnter","onPointerLeave","onFocus","keyboard","onBlur","active","detail","row"],"sources":["../../../src/components/HeroSwitcher/HeroSwitcher.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport { useOnScreen, usePrefersReducedMotion } from '../HeroColumns/heroMotion';\nimport './HeroSwitcher.css';\n\nexport interface HeroSwitcherDetail {\n /** Icon in front of the text, e.g. `<CalendarIcon />`; drawn at 16px. */\n icon?: ReactNode;\n /** Already formatted, translated text: dates, travelers, what is included… */\n label: ReactNode;\n /** React key; defaults to the row's index. */\n key?: string | number;\n}\n\nexport interface HeroSwitcherItem {\n /** Identifier of the state (Figma \"Type\": `package`, `flight`). */\n value: string;\n /** Text of the segment in the switch, e.g. \"Travel Package\". */\n label: ReactNode;\n /** Icon of the segment, e.g. `<RoadmapIcon />`; drawn at 16px. */\n icon?: ReactNode;\n /** Photo URL. Without it (and without `image`) a neutral tile is shown. */\n imageSrc?: string;\n /** Alternative text of the photo; leave empty when it is decorative. */\n imageAlt?: string;\n /** Custom photo element (e.g. a framework `<Image>`); it fills the frame and replaces `imageSrc`. */\n image?: ReactNode;\n /** Small caps line above the title (Figma \"Overline\"), e.g. \"Your request\". */\n overline?: ReactNode;\n /** Title of the sample request, e.g. \"Weekend at Lake Sevan\". */\n title: ReactNode;\n /** Icon + text rows under the title. */\n details?: HeroSwitcherDetail[];\n /** Text of the green pill at the bottom of the card (Figma \"Status\"), e.g. \"3 offers to compare\". */\n status?: ReactNode;\n /** Icon of the status pill. Defaults to a check mark. */\n statusIcon?: ReactNode;\n}\n\nexport interface HeroSwitcherProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n /** The states to switch between (Figma: Package and Flight), in the order of the switch. */\n items: HeroSwitcherItem[];\n /** Selected item (controlled). */\n value?: string;\n /** Initially selected item when uncontrolled; defaults to the first one. */\n defaultValue?: string;\n /** Called with the new value when the user picks a segment or autoplay advances. */\n onValueChange?: (value: string) => void;\n /** Advances to the next item on its own, in an endless loop; after the user picks a segment it carries on from that item. */\n autoPlay?: boolean;\n /** Milliseconds each item stays before autoplay moves on (Figma prototype: 3s delay + 0.6s transition). */\n interval?: number;\n /** Holds autoplay from outside (the selected item stays as it is); it carries on once this is `false` again. */\n paused?: boolean;\n /** Accessible name of the switch (tab list). */\n 'aria-label'?: string;\n /** Heading level of the card title; pick the one that fits the page outline. */\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n}\n\nconst useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\n/**\n * Photo, segmented switch and a sample request card that change together (Figma component set\n * \"Travel Requests / Hero switcher\"). The switch is a real tab list — click or use the arrow keys — and autoplay\n * is an endless loop: it carries on from the segment the user picked, holds on hover and keyboard focus, off-screen\n * and in hidden tabs, and never starts for users who prefer reduced motion.\n */\nexport const HeroSwitcher = /* @__PURE__ */ forwardRef<HTMLDivElement, HeroSwitcherProps>(function HeroSwitcher(\n {\n items,\n value,\n defaultValue,\n onValueChange,\n autoPlay = true,\n interval = 3600,\n paused = false,\n 'aria-label': ariaLabel,\n headingLevel = 3,\n className,\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n) {\n const id = useId();\n const rootRef = useRef<HTMLDivElement | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const tabRefs = useRef<Array<HTMLButtonElement | null>>([]);\n\n const [internal, setInternal] = useState(defaultValue);\n const requested = value !== undefined ? value : internal;\n const found = items.findIndex((item) => item.value === requested);\n const activeIndex = found === -1 ? 0 : found;\n\n // The last change came from the user picking a segment (Figma: those switches animate in 0.4s, autoplay in 0.6s).\n const [picked, setPicked] = useState(false);\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n const onScreen = useOnScreen(rootRef);\n const reducedMotion = usePrefersReducedMotion();\n const running = autoPlay && !reducedMotion && items.length > 1 && !paused && !hovered && !focused && onScreen;\n\n const select = useCallback(\n (index: number) => {\n const next = items[index];\n if (!next) return;\n if (value === undefined) setInternal(next.value);\n if (next.value !== items[activeIndex]?.value) onValueChange?.(next.value);\n },\n [items, value, activeIndex, onValueChange],\n );\n\n useEffect(() => {\n if (!running) return;\n const timer = window.setTimeout(() => {\n setPicked(false);\n select((activeIndex + 1) % items.length);\n }, Math.max(interval, 0));\n return () => window.clearTimeout(timer);\n }, [running, activeIndex, interval, items.length, select]);\n\n // The sliding pill (Figma \"Indicator\") takes the position and width of the selected segment.\n const [indicator, setIndicator] = useState<{ x: number; width: number } | null>(null);\n useIsomorphicLayoutEffect(() => {\n const list = listRef.current;\n if (!list) return;\n const measure = () => {\n const tab = tabRefs.current[activeIndex];\n if (!tab || tab.offsetWidth === 0) return;\n setIndicator((previous) =>\n previous && previous.x === tab.offsetLeft && previous.width === tab.offsetWidth\n ? previous\n : { x: tab.offsetLeft, width: tab.offsetWidth },\n );\n };\n measure();\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(measure);\n observer.observe(list);\n return () => observer.disconnect();\n }, [activeIndex, items.length]);\n\n // Shows the segment the user chose; the loop carries on from it once the pointer and keyboard focus have left.\n const pick = (index: number) => {\n setPicked(true);\n select(index);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>, index: number) => {\n const last = items.length - 1;\n const rtl = typeof getComputedStyle === 'function' && getComputedStyle(event.currentTarget).direction === 'rtl';\n let next: number;\n if (event.key === 'ArrowRight') next = rtl ? index - 1 : index + 1;\n else if (event.key === 'ArrowLeft') next = rtl ? index + 1 : index - 1;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = last;\n else return;\n event.preventDefault();\n next = next < 0 ? last : next > last ? 0 : next;\n pick(next);\n tabRefs.current[next]?.focus();\n };\n\n const Heading = `h${headingLevel}` as const;\n\n return (\n <div\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn('tm-hero-switcher', className)}\n data-playing={running ? '' : undefined}\n data-picked={picked ? '' : undefined}\n onPointerEnter={(event) => {\n onPointerEnter?.(event);\n if (event.pointerType === 'mouse') setHovered(true);\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n // Keyboard focus only: the focus a mouse click or a tap leaves on a segment must not hold autoplay until the next blur.\n let keyboard = true;\n try {\n keyboard = event.target.matches(':focus-visible');\n } catch {\n /* :focus-visible unsupported — treat every focus as keyboard focus */\n }\n if (keyboard) setFocused(true);\n }}\n onBlur={(event) => {\n onBlur?.(event);\n if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);\n }}\n {...props}\n >\n <div className=\"tm-hero-switcher__photo\">\n {items.map((item, index) => {\n const active = index === activeIndex;\n return (\n <div key={item.value} className=\"tm-hero-switcher__slide\" data-active={active ? '' : undefined} aria-hidden={active ? undefined : true}>\n {item.image ??\n (item.imageSrc ? (\n <img className=\"tm-hero-switcher__image\" src={item.imageSrc} alt={item.imageAlt ?? ''} draggable={false} />\n ) : null)}\n </div>\n );\n })}\n </div>\n\n <div ref={listRef} className=\"tm-hero-switcher__switch\" role=\"tablist\" aria-label={ariaLabel} data-measured={indicator ? '' : undefined}>\n <span\n className=\"tm-hero-switcher__indicator\"\n aria-hidden=\"true\"\n style={indicator ? ({ width: indicator.width, transform: `translateX(${indicator.x}px)` } as CSSProperties) : undefined}\n />\n {items.map((item, index) => {\n const active = index === activeIndex;\n return (\n <button\n key={item.value}\n ref={(node) => {\n tabRefs.current[index] = node;\n }}\n type=\"button\"\n role=\"tab\"\n id={`${id}-tab-${index}`}\n className=\"tm-hero-switcher__tab\"\n data-tm-icon-size=\"sm\"\n aria-selected={active}\n aria-controls={`${id}-panel-${index}`}\n tabIndex={active ? 0 : -1}\n onClick={() => pick(index)}\n onKeyDown={(event) => handleKeyDown(event, index)}\n >\n {item.icon}\n <span className=\"tm-hero-switcher__tab-label\">{item.label}</span>\n </button>\n );\n })}\n </div>\n\n <div className=\"tm-hero-switcher__card\">\n {items.map((item, index) => {\n const active = index === activeIndex;\n return (\n <div\n key={item.value}\n role=\"tabpanel\"\n id={`${id}-panel-${index}`}\n aria-labelledby={`${id}-tab-${index}`}\n className=\"tm-hero-switcher__panel\"\n data-active={active ? '' : undefined}\n aria-hidden={active ? undefined : true}\n >\n {item.overline != null ? <p className=\"tm-hero-switcher__overline\">{item.overline}</p> : null}\n <Heading className=\"tm-hero-switcher__title\">{item.title}</Heading>\n {item.details?.length ? (\n <ul className=\"tm-hero-switcher__details\" data-tm-icon-size=\"sm\">\n {item.details.map((detail, row) => (\n <li key={detail.key ?? row} className=\"tm-hero-switcher__detail\">\n {detail.icon}\n <span>{detail.label}</span>\n </li>\n ))}\n </ul>\n ) : null}\n {item.status != null ? (\n <>\n <hr className=\"tm-hero-switcher__divider\" />\n <p className=\"tm-hero-switcher__status\" data-tm-icon-size=\"sm\">\n {item.statusIcon ?? <CheckmarkIcon />}\n <span>{item.status}</span>\n </p>\n </>\n ) : null}\n </div>\n );\n })}\n </div>\n </div>\n );\n});\n"],"mappings":"A,2OAyEA,IAAMgB,EAA4B,OAAO,OAAW,IAAchB,EAAAA,UAAYC,EAAAA,gBAQjEgB,GAA+B,EAAAH,EAAA,WAAA,CAA8C,SACxF,CACE,QACA,QACA,eACA,gBACA,WAAW,GACX,WAAW,KACX,SAAS,GACT,aAAcI,EACd,eAAe,EACf,YACA,iBACA,iBACA,UACA,SACA,GAAGC,GAEL,EACA,CACA,IAAMC,GAAA,EAAKlB,EAAAA,MAAAA,CAAM,EACXmB,GAAA,EAAUlB,EAAAA,OAAAA,CAA8B,IAAI,EAC5CmB,GAAA,EAAUnB,EAAAA,OAAAA,CAA8B,IAAI,EAC5CoB,GAAA,EAAUpB,EAAAA,OAAAA,CAAwC,CAAC,CAAC,EAEpD,CAACqB,EAAUC,IAAA,EAAerB,EAAAA,SAAAA,CAASsB,CAAY,EAC/CC,EAAYC,IAAU,IAAA,GAAoBJ,EAARI,EAClCC,EAAQC,EAAM,UAAW,GAASC,EAAK,QAAUJ,CAAS,EAC1DK,EAAcH,IAAU,GAAK,EAAIA,EAGjC,CAACI,EAAQC,IAAA,EAAa9B,EAAAA,SAAAA,CAAS,EAAK,EACpC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