@nascentdigital/funnel-ui 4.4.18

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 (467) hide show
  1. package/dist/Tailwind.d.ts +201 -0
  2. package/dist/Tailwind.js +282 -0
  3. package/dist/client/app/AppContainer.d.ts +10 -0
  4. package/dist/client/app/AppContainer.js +22 -0
  5. package/dist/client/app/AppContext.d.ts +11 -0
  6. package/dist/client/app/AppContext.js +6 -0
  7. package/dist/client/app/AppPreview.d.ts +7 -0
  8. package/dist/client/app/AppPreview.js +51 -0
  9. package/dist/client/app/PageContainer.d.ts +8 -0
  10. package/dist/client/app/PageContainer.js +22 -0
  11. package/dist/client/app/index.d.ts +9 -0
  12. package/dist/client/app/index.js +25 -0
  13. package/dist/client/app/useAppConfig.d.ts +2 -0
  14. package/dist/client/app/useAppConfig.js +9 -0
  15. package/dist/client/app/useBrand.d.ts +9 -0
  16. package/dist/client/app/useBrand.js +17 -0
  17. package/dist/client/app/useLanguage.d.ts +2 -0
  18. package/dist/client/app/useLanguage.js +11 -0
  19. package/dist/client/app/usePageData.d.ts +2 -0
  20. package/dist/client/app/usePageData.js +25 -0
  21. package/dist/client/app/usePageUrl.d.ts +1 -0
  22. package/dist/client/app/usePageUrl.js +12 -0
  23. package/dist/client/app/useRegion.d.ts +1 -0
  24. package/dist/client/app/useRegion.js +10 -0
  25. package/dist/client/app/useSite.d.ts +2 -0
  26. package/dist/client/app/useSite.js +13 -0
  27. package/dist/client/atomic/AnimatedText.d.ts +12 -0
  28. package/dist/client/atomic/AnimatedText.js +90 -0
  29. package/dist/client/atomic/MaskedInput.d.ts +20 -0
  30. package/dist/client/atomic/MaskedInput.js +63 -0
  31. package/dist/client/atomic/index.d.ts +2 -0
  32. package/dist/client/atomic/index.js +18 -0
  33. package/dist/client/fields/EmbeddedVideo/EmbeddedPlayer.d.ts +36 -0
  34. package/dist/client/fields/EmbeddedVideo/EmbeddedPlayer.js +2 -0
  35. package/dist/client/fields/EmbeddedVideo/EmbeddedVideo.d.ts +13 -0
  36. package/dist/client/fields/EmbeddedVideo/EmbeddedVideo.js +22 -0
  37. package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContainer.d.ts +7 -0
  38. package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContainer.js +24 -0
  39. package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContext.d.ts +8 -0
  40. package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContext.js +11 -0
  41. package/dist/client/fields/EmbeddedVideo/index.d.ts +4 -0
  42. package/dist/client/fields/EmbeddedVideo/index.js +20 -0
  43. package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerProgress.d.ts +10 -0
  44. package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerProgress.js +66 -0
  45. package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerRef.d.ts +9 -0
  46. package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerRef.js +29 -0
  47. package/dist/client/fields/EmbeddedVideo/vimeo/VimeoPlayer.d.ts +63 -0
  48. package/dist/client/fields/EmbeddedVideo/vimeo/VimeoPlayer.js +326 -0
  49. package/dist/client/fields/EmbeddedVideo/vimeo/VimeoVideo.d.ts +13 -0
  50. package/dist/client/fields/EmbeddedVideo/vimeo/VimeoVideo.js +60 -0
  51. package/dist/client/fields/EmbeddedVideo/vimeo/index.d.ts +1 -0
  52. package/dist/client/fields/EmbeddedVideo/vimeo/index.js +17 -0
  53. package/dist/client/fields/EmbeddedVideo/youtube/YTApi.d.ts +92 -0
  54. package/dist/client/fields/EmbeddedVideo/youtube/YTApi.js +24 -0
  55. package/dist/client/fields/EmbeddedVideo/youtube/YoutubePlayer.d.ts +56 -0
  56. package/dist/client/fields/EmbeddedVideo/youtube/YoutubePlayer.js +288 -0
  57. package/dist/client/fields/EmbeddedVideo/youtube/YoutubeVideo.d.ts +13 -0
  58. package/dist/client/fields/EmbeddedVideo/youtube/YoutubeVideo.js +71 -0
  59. package/dist/client/fields/EmbeddedVideo/youtube/index.d.ts +3 -0
  60. package/dist/client/fields/EmbeddedVideo/youtube/index.js +19 -0
  61. package/dist/client/fields/LazyVideo.d.ts +8 -0
  62. package/dist/client/fields/LazyVideo.js +100 -0
  63. package/dist/client/fields/index.d.ts +2 -0
  64. package/dist/client/fields/index.js +18 -0
  65. package/dist/client/forms/Form.d.ts +13 -0
  66. package/dist/client/forms/Form.js +68 -0
  67. package/dist/client/forms/FormContext.d.ts +5 -0
  68. package/dist/client/forms/FormContext.js +6 -0
  69. package/dist/client/forms/fields/BooleanField.d.ts +16 -0
  70. package/dist/client/forms/fields/BooleanField.js +47 -0
  71. package/dist/client/forms/fields/EnumField.d.ts +20 -0
  72. package/dist/client/forms/fields/EnumField.js +65 -0
  73. package/dist/client/forms/fields/Field.d.ts +15 -0
  74. package/dist/client/forms/fields/Field.js +39 -0
  75. package/dist/client/forms/fields/FieldErrorController.d.ts +12 -0
  76. package/dist/client/forms/fields/FieldErrorController.js +13 -0
  77. package/dist/client/forms/fields/FieldLayout.d.ts +16 -0
  78. package/dist/client/forms/fields/FieldLayout.js +32 -0
  79. package/dist/client/forms/fields/TextField.d.ts +25 -0
  80. package/dist/client/forms/fields/TextField.js +178 -0
  81. package/dist/client/forms/fields/index.d.ts +2 -0
  82. package/dist/client/forms/fields/index.js +18 -0
  83. package/dist/client/forms/fields/useField.d.ts +2 -0
  84. package/dist/client/forms/fields/useField.js +26 -0
  85. package/dist/client/forms/index.d.ts +4 -0
  86. package/dist/client/forms/index.js +20 -0
  87. package/dist/client/forms/interactive/CheckboxField.d.ts +14 -0
  88. package/dist/client/forms/interactive/CheckboxField.js +19 -0
  89. package/dist/client/forms/interactive/RadioField.d.ts +12 -0
  90. package/dist/client/forms/interactive/RadioField.js +16 -0
  91. package/dist/client/forms/interactive/RadioGroupField.d.ts +12 -0
  92. package/dist/client/forms/interactive/RadioGroupField.js +10 -0
  93. package/dist/client/forms/interactive/SelectField.d.ts +17 -0
  94. package/dist/client/forms/interactive/SelectField.js +16 -0
  95. package/dist/client/forms/interactive/index.d.ts +4 -0
  96. package/dist/client/forms/interactive/index.js +20 -0
  97. package/dist/client/forms/useForm.d.ts +2 -0
  98. package/dist/client/forms/useForm.js +17 -0
  99. package/dist/client/forms/useTempFields.d.ts +7 -0
  100. package/dist/client/forms/useTempFields.js +54 -0
  101. package/dist/client/hooks/assets/index.d.ts +2 -0
  102. package/dist/client/hooks/assets/index.js +18 -0
  103. package/dist/client/hooks/assets/useImageProxy.d.ts +2 -0
  104. package/dist/client/hooks/assets/useImageProxy.js +43 -0
  105. package/dist/client/hooks/assets/useVideoProxy.d.ts +2 -0
  106. package/dist/client/hooks/assets/useVideoProxy.js +43 -0
  107. package/dist/client/hooks/breakpoint/BreakpointContainer.d.ts +9 -0
  108. package/dist/client/hooks/breakpoint/BreakpointContainer.js +39 -0
  109. package/dist/client/hooks/breakpoint/BreakpointContext.d.ts +7 -0
  110. package/dist/client/hooks/breakpoint/BreakpointContext.js +9 -0
  111. package/dist/client/hooks/breakpoint/index.d.ts +3 -0
  112. package/dist/client/hooks/breakpoint/index.js +19 -0
  113. package/dist/client/hooks/breakpoint/useCurrentBreakpoint.d.ts +2 -0
  114. package/dist/client/hooks/breakpoint/useCurrentBreakpoint.js +10 -0
  115. package/dist/client/hooks/index.d.ts +26 -0
  116. package/dist/client/hooks/index.js +42 -0
  117. package/dist/client/hooks/ui-lock/UILockContainer.d.ts +5 -0
  118. package/dist/client/hooks/ui-lock/UILockContainer.js +57 -0
  119. package/dist/client/hooks/ui-lock/UILockContext.d.ts +9 -0
  120. package/dist/client/hooks/ui-lock/UILockContext.js +6 -0
  121. package/dist/client/hooks/ui-lock/UILockRef.d.ts +36 -0
  122. package/dist/client/hooks/ui-lock/UILockRef.js +32 -0
  123. package/dist/client/hooks/ui-lock/index.d.ts +3 -0
  124. package/dist/client/hooks/ui-lock/index.js +19 -0
  125. package/dist/client/hooks/ui-lock/useUILock.d.ts +16 -0
  126. package/dist/client/hooks/ui-lock/useUILock.js +121 -0
  127. package/dist/client/hooks/useCounter.d.ts +11 -0
  128. package/dist/client/hooks/useCounter.js +57 -0
  129. package/dist/client/hooks/useCycle.d.ts +5 -0
  130. package/dist/client/hooks/useCycle.js +15 -0
  131. package/dist/client/hooks/useElementRect.d.ts +2 -0
  132. package/dist/client/hooks/useElementRect.js +63 -0
  133. package/dist/client/hooks/useElementScrolled.d.ts +17 -0
  134. package/dist/client/hooks/useElementScrolled.js +51 -0
  135. package/dist/client/hooks/useElementSelector.d.ts +2 -0
  136. package/dist/client/hooks/useElementSelector.js +160 -0
  137. package/dist/client/hooks/useElementSize.d.ts +2 -0
  138. package/dist/client/hooks/useElementSize.js +64 -0
  139. package/dist/client/hooks/useFindElements.d.ts +9 -0
  140. package/dist/client/hooks/useFindElements.js +147 -0
  141. package/dist/client/hooks/useInViewport.d.ts +16 -0
  142. package/dist/client/hooks/useInViewport.js +46 -0
  143. package/dist/client/hooks/useIsDesktop.d.ts +1 -0
  144. package/dist/client/hooks/useIsDesktop.js +22 -0
  145. package/dist/client/hooks/useKeyboardFocus.d.ts +7 -0
  146. package/dist/client/hooks/useKeyboardFocus.js +40 -0
  147. package/dist/client/hooks/useLatestValue.d.ts +1 -0
  148. package/dist/client/hooks/useLatestValue.js +21 -0
  149. package/dist/client/hooks/useLock.d.ts +13 -0
  150. package/dist/client/hooks/useLock.js +161 -0
  151. package/dist/client/hooks/useMixedResponsiveValue.d.ts +2 -0
  152. package/dist/client/hooks/useMixedResponsiveValue.js +20 -0
  153. package/dist/client/hooks/usePathname.d.ts +9 -0
  154. package/dist/client/hooks/usePathname.js +25 -0
  155. package/dist/client/hooks/useRefElement.d.ts +8 -0
  156. package/dist/client/hooks/useRefElement.js +34 -0
  157. package/dist/client/hooks/useRefresh.d.ts +2 -0
  158. package/dist/client/hooks/useRefresh.js +25 -0
  159. package/dist/client/hooks/useResizeObserver.d.ts +5 -0
  160. package/dist/client/hooks/useResizeObserver.js +179 -0
  161. package/dist/client/hooks/useResponsiveValue.d.ts +2 -0
  162. package/dist/client/hooks/useResponsiveValue.js +16 -0
  163. package/dist/client/hooks/useRouter.d.ts +20 -0
  164. package/dist/client/hooks/useRouter.js +49 -0
  165. package/dist/client/hooks/useSafeLayoutEffect.d.ts +2 -0
  166. package/dist/client/hooks/useSafeLayoutEffect.js +9 -0
  167. package/dist/client/hooks/useTouch.d.ts +2 -0
  168. package/dist/client/hooks/useTouch.js +10 -0
  169. package/dist/client/hooks/useViewportSize.d.ts +7 -0
  170. package/dist/client/hooks/useViewportSize.js +66 -0
  171. package/dist/client/hooks/useWindowScrolled.d.ts +8 -0
  172. package/dist/client/hooks/useWindowScrolled.js +52 -0
  173. package/dist/client/index.d.ts +9 -0
  174. package/dist/client/index.js +25 -0
  175. package/dist/client/interaction/Carousel.d.ts +48 -0
  176. package/dist/client/interaction/Carousel.js +498 -0
  177. package/dist/client/interaction/ClickObserver.d.ts +19 -0
  178. package/dist/client/interaction/ClickObserver.js +76 -0
  179. package/dist/client/interaction/InfiniteScroller.d.ts +9 -0
  180. package/dist/client/interaction/InfiniteScroller.js +47 -0
  181. package/dist/client/interaction/Loader.d.ts +14 -0
  182. package/dist/client/interaction/Loader.js +74 -0
  183. package/dist/client/interaction/Marquee.d.ts +5 -0
  184. package/dist/client/interaction/Marquee.js +26 -0
  185. package/dist/client/interaction/Popup.d.ts +36 -0
  186. package/dist/client/interaction/Popup.js +244 -0
  187. package/dist/client/interaction/Tooltip.d.ts +16 -0
  188. package/dist/client/interaction/Tooltip.js +122 -0
  189. package/dist/client/interaction/UILevel.d.ts +1 -0
  190. package/dist/client/interaction/UILevel.js +2 -0
  191. package/dist/client/interaction/backdrop/BackdropContainer.d.ts +5 -0
  192. package/dist/client/interaction/backdrop/BackdropContainer.js +114 -0
  193. package/dist/client/interaction/backdrop/BackdropContext.d.ts +8 -0
  194. package/dist/client/interaction/backdrop/BackdropContext.js +6 -0
  195. package/dist/client/interaction/backdrop/BackdropEvent.d.ts +64 -0
  196. package/dist/client/interaction/backdrop/BackdropEvent.js +92 -0
  197. package/dist/client/interaction/backdrop/index.d.ts +4 -0
  198. package/dist/client/interaction/backdrop/index.js +20 -0
  199. package/dist/client/interaction/backdrop/useBackdrop.d.ts +13 -0
  200. package/dist/client/interaction/backdrop/useBackdrop.js +58 -0
  201. package/dist/client/interaction/backdrop/useBackdropClick.d.ts +2 -0
  202. package/dist/client/interaction/backdrop/useBackdropClick.js +21 -0
  203. package/dist/client/interaction/backdrop/useBackdropVisible.d.ts +1 -0
  204. package/dist/client/interaction/backdrop/useBackdropVisible.js +30 -0
  205. package/dist/client/interaction/focus/FocusArea.d.ts +10 -0
  206. package/dist/client/interaction/focus/FocusArea.js +38 -0
  207. package/dist/client/interaction/focus/FocusContext.d.ts +7 -0
  208. package/dist/client/interaction/focus/FocusContext.js +7 -0
  209. package/dist/client/interaction/focus/FocusController.d.ts +9 -0
  210. package/dist/client/interaction/focus/FocusController.js +40 -0
  211. package/dist/client/interaction/focus/FocusService.d.ts +20 -0
  212. package/dist/client/interaction/focus/FocusService.js +204 -0
  213. package/dist/client/interaction/focus/LinkedList.d.ts +18 -0
  214. package/dist/client/interaction/focus/LinkedList.js +122 -0
  215. package/dist/client/interaction/focus/index.d.ts +2 -0
  216. package/dist/client/interaction/focus/index.js +18 -0
  217. package/dist/client/interaction/focus/useFocusService.d.ts +2 -0
  218. package/dist/client/interaction/focus/useFocusService.js +14 -0
  219. package/dist/client/interaction/index.d.ts +12 -0
  220. package/dist/client/interaction/index.js +28 -0
  221. package/dist/client/interaction/modal/Modal.d.ts +29 -0
  222. package/dist/client/interaction/modal/Modal.js +136 -0
  223. package/dist/client/interaction/modal/ModalContainer.d.ts +5 -0
  224. package/dist/client/interaction/modal/ModalContainer.js +104 -0
  225. package/dist/client/interaction/modal/ModalContext.d.ts +8 -0
  226. package/dist/client/interaction/modal/ModalContext.js +6 -0
  227. package/dist/client/interaction/modal/ModalEvent.d.ts +39 -0
  228. package/dist/client/interaction/modal/ModalEvent.js +53 -0
  229. package/dist/client/interaction/modal/index.d.ts +2 -0
  230. package/dist/client/interaction/modal/index.js +18 -0
  231. package/dist/client/interaction/paginator/Paginator.d.ts +33 -0
  232. package/dist/client/interaction/paginator/Paginator.js +67 -0
  233. package/dist/client/interaction/paginator/index.d.ts +1 -0
  234. package/dist/client/interaction/paginator/index.js +17 -0
  235. package/dist/client/layouts/MasonaryLayout.d.ts +7 -0
  236. package/dist/client/layouts/MasonaryLayout.js +53 -0
  237. package/dist/client/layouts/index.d.ts +1 -0
  238. package/dist/client/layouts/index.js +17 -0
  239. package/dist/client/refs.d.ts +2 -0
  240. package/dist/client/refs.js +13 -0
  241. package/dist/client/transitions/Revelator.d.ts +42 -0
  242. package/dist/client/transitions/Revelator.js +60 -0
  243. package/dist/client/transitions/SideScroll.d.ts +14 -0
  244. package/dist/client/transitions/SideScroll.js +51 -0
  245. package/dist/client/transitions/StyleInViewport.d.ts +20 -0
  246. package/dist/client/transitions/StyleInViewport.js +66 -0
  247. package/dist/client/transitions/StyleSwitch.d.ts +297 -0
  248. package/dist/client/transitions/StyleSwitch.js +78 -0
  249. package/dist/client/transitions/index.d.ts +6 -0
  250. package/dist/client/transitions/index.js +22 -0
  251. package/dist/client/transitions/parallax/Parallax.d.ts +20 -0
  252. package/dist/client/transitions/parallax/Parallax.js +72 -0
  253. package/dist/client/transitions/parallax/ParallaxContext.d.ts +11 -0
  254. package/dist/client/transitions/parallax/ParallaxContext.js +6 -0
  255. package/dist/client/transitions/parallax/ParallaxItem.d.ts +14 -0
  256. package/dist/client/transitions/parallax/ParallaxItem.js +37 -0
  257. package/dist/client/transitions/parallax/ParallaxRemote.d.ts +29 -0
  258. package/dist/client/transitions/parallax/ParallaxRemote.js +136 -0
  259. package/dist/client/transitions/parallax/ParallaxUtils.d.ts +5 -0
  260. package/dist/client/transitions/parallax/ParallaxUtils.js +19 -0
  261. package/dist/client/transitions/parallax/index.d.ts +2 -0
  262. package/dist/client/transitions/parallax/index.js +18 -0
  263. package/dist/client/transitions/parallax/useDisableParallax.d.ts +4 -0
  264. package/dist/client/transitions/parallax/useDisableParallax.js +13 -0
  265. package/dist/client/transitions/parallax/useParallax.d.ts +2 -0
  266. package/dist/client/transitions/parallax/useParallax.js +18 -0
  267. package/dist/client/transitions/parallax/useTransforms.d.ts +34 -0
  268. package/dist/client/transitions/parallax/useTransforms.js +176 -0
  269. package/dist/client/transitions/reveal/Reveal.d.ts +14 -0
  270. package/dist/client/transitions/reveal/Reveal.js +75 -0
  271. package/dist/client/transitions/reveal/RevealAnimation.d.ts +17 -0
  272. package/dist/client/transitions/reveal/RevealAnimation.js +2 -0
  273. package/dist/client/transitions/reveal/RevealAnimator.d.ts +13 -0
  274. package/dist/client/transitions/reveal/RevealAnimator.js +41 -0
  275. package/dist/client/transitions/reveal/RevealController.d.ts +13 -0
  276. package/dist/client/transitions/reveal/RevealController.js +114 -0
  277. package/dist/client/transitions/reveal/RevealElementAnimator.d.ts +13 -0
  278. package/dist/client/transitions/reveal/RevealElementAnimator.js +65 -0
  279. package/dist/client/transitions/reveal/index.d.ts +2 -0
  280. package/dist/client/transitions/reveal/index.js +18 -0
  281. package/dist/client/utils/OnKey.d.ts +20 -0
  282. package/dist/client/utils/OnKey.js +33 -0
  283. package/dist/client/utils/SharedMutationObserver.d.ts +20 -0
  284. package/dist/client/utils/SharedMutationObserver.js +202 -0
  285. package/dist/client/utils/index.d.ts +2 -0
  286. package/dist/client/utils/index.js +18 -0
  287. package/dist/server/atomic/Markup.d.ts +14 -0
  288. package/dist/server/atomic/Markup.js +34 -0
  289. package/dist/server/atomic/NascentLogo.d.ts +6 -0
  290. package/dist/server/atomic/NascentLogo.js +9 -0
  291. package/dist/server/atomic/index.d.ts +2 -0
  292. package/dist/server/atomic/index.js +18 -0
  293. package/dist/server/blocks/Block.d.ts +16 -0
  294. package/dist/server/blocks/Block.js +92 -0
  295. package/dist/server/blocks/Clients.d.ts +33 -0
  296. package/dist/server/blocks/Clients.js +82 -0
  297. package/dist/server/blocks/Editorial.d.ts +33 -0
  298. package/dist/server/blocks/Editorial.js +80 -0
  299. package/dist/server/blocks/Form.d.ts +46 -0
  300. package/dist/server/blocks/Form.js +74 -0
  301. package/dist/server/blocks/FormMessage.d.ts +15 -0
  302. package/dist/server/blocks/FormMessage.js +37 -0
  303. package/dist/server/blocks/MediaLayout.d.ts +309 -0
  304. package/dist/server/blocks/MediaLayout.js +105 -0
  305. package/dist/server/blocks/Message.d.ts +76 -0
  306. package/dist/server/blocks/Message.js +352 -0
  307. package/dist/server/blocks/Outcome.d.ts +84 -0
  308. package/dist/server/blocks/Outcome.js +489 -0
  309. package/dist/server/blocks/OutcomeDetail.d.ts +303 -0
  310. package/dist/server/blocks/OutcomeDetail.js +63 -0
  311. package/dist/server/blocks/Projects.d.ts +43 -0
  312. package/dist/server/blocks/Projects.js +109 -0
  313. package/dist/server/blocks/Stat.d.ts +325 -0
  314. package/dist/server/blocks/Stat.js +107 -0
  315. package/dist/server/blocks/Stats.d.ts +36 -0
  316. package/dist/server/blocks/Stats.js +79 -0
  317. package/dist/server/blocks/Testimonial.d.ts +30 -0
  318. package/dist/server/blocks/Testimonial.js +68 -0
  319. package/dist/server/blocks/ValueProp.d.ts +43 -0
  320. package/dist/server/blocks/ValueProp.js +125 -0
  321. package/dist/server/blocks/index.d.ts +13 -0
  322. package/dist/server/blocks/index.js +29 -0
  323. package/dist/server/data/PrePaginator.d.ts +8 -0
  324. package/dist/server/data/PrePaginator.js +30 -0
  325. package/dist/server/data/index.d.ts +1 -0
  326. package/dist/server/data/index.js +17 -0
  327. package/dist/server/entities/Client.d.ts +327 -0
  328. package/dist/server/entities/Client.js +118 -0
  329. package/dist/server/entities/ClientBadge.d.ts +293 -0
  330. package/dist/server/entities/ClientBadge.js +37 -0
  331. package/dist/server/entities/Person.d.ts +314 -0
  332. package/dist/server/entities/Person.js +98 -0
  333. package/dist/server/entities/Project.d.ts +329 -0
  334. package/dist/server/entities/Project.js +112 -0
  335. package/dist/server/entities/UniqueSellingPoint.d.ts +327 -0
  336. package/dist/server/entities/UniqueSellingPoint.js +119 -0
  337. package/dist/server/entities/index.d.ts +6 -0
  338. package/dist/server/entities/index.js +22 -0
  339. package/dist/server/entities/previews/MessagePreview.d.ts +299 -0
  340. package/dist/server/entities/previews/MessagePreview.js +41 -0
  341. package/dist/server/entities/previews/PagePreview.d.ts +10 -0
  342. package/dist/server/entities/previews/PagePreview.js +42 -0
  343. package/dist/server/entities/previews/index.d.ts +2 -0
  344. package/dist/server/entities/previews/index.js +18 -0
  345. package/dist/server/fields/Caption.d.ts +13 -0
  346. package/dist/server/fields/Caption.js +45 -0
  347. package/dist/server/fields/Description.d.ts +13 -0
  348. package/dist/server/fields/Description.js +46 -0
  349. package/dist/server/fields/FreeFormContent.d.ts +17 -0
  350. package/dist/server/fields/FreeFormContent.js +43 -0
  351. package/dist/server/fields/Headline.d.ts +13 -0
  352. package/dist/server/fields/Headline.js +46 -0
  353. package/dist/server/fields/Icon.d.ts +10 -0
  354. package/dist/server/fields/Icon.js +39 -0
  355. package/dist/server/fields/Link.d.ts +16 -0
  356. package/dist/server/fields/Link.js +61 -0
  357. package/dist/server/fields/Quote.d.ts +13 -0
  358. package/dist/server/fields/Quote.js +46 -0
  359. package/dist/server/fields/RichText.d.ts +296 -0
  360. package/dist/server/fields/RichText.js +217 -0
  361. package/dist/server/fields/Title.d.ts +292 -0
  362. package/dist/server/fields/Title.js +38 -0
  363. package/dist/server/fields/Visual.d.ts +12 -0
  364. package/dist/server/fields/Visual.js +66 -0
  365. package/dist/server/fields/index.d.ts +10 -0
  366. package/dist/server/fields/index.js +26 -0
  367. package/dist/server/index.d.ts +9 -0
  368. package/dist/server/index.js +25 -0
  369. package/dist/server/panels/BlockPanel.d.ts +14 -0
  370. package/dist/server/panels/BlockPanel.js +56 -0
  371. package/dist/server/panels/MessagePanel.d.ts +31 -0
  372. package/dist/server/panels/MessagePanel.js +81 -0
  373. package/dist/server/panels/VisualPanel.d.ts +36 -0
  374. package/dist/server/panels/VisualPanel.js +143 -0
  375. package/dist/server/panels/index.d.ts +3 -0
  376. package/dist/server/panels/index.js +19 -0
  377. package/dist/server/schema/Anchor.d.ts +7 -0
  378. package/dist/server/schema/Anchor.js +24 -0
  379. package/dist/server/schema/AspectRatio.d.ts +9 -0
  380. package/dist/server/schema/AspectRatio.js +43 -0
  381. package/dist/server/schema/BlockConfig.d.ts +56 -0
  382. package/dist/server/schema/BlockConfig.js +192 -0
  383. package/dist/server/schema/CollectionSchema.d.ts +4 -0
  384. package/dist/server/schema/CollectionSchema.js +15 -0
  385. package/dist/server/schema/ItemAlignment.d.ts +12 -0
  386. package/dist/server/schema/ItemAlignment.js +42 -0
  387. package/dist/server/schema/ItemPosition.d.ts +6 -0
  388. package/dist/server/schema/ItemPosition.js +25 -0
  389. package/dist/server/schema/ItemSize.d.ts +6 -0
  390. package/dist/server/schema/ItemSize.js +24 -0
  391. package/dist/server/schema/TextAlignment.d.ts +6 -0
  392. package/dist/server/schema/TextAlignment.js +22 -0
  393. package/dist/server/schema/index.d.ts +8 -0
  394. package/dist/server/schema/index.js +24 -0
  395. package/dist/server/sections/index.d.ts +1 -0
  396. package/dist/server/sections/index.js +17 -0
  397. package/dist/server/sections/renderSection.d.ts +6 -0
  398. package/dist/server/sections/renderSection.js +19 -0
  399. package/dist/server/transitions/Slide.d.ts +293 -0
  400. package/dist/server/transitions/Slide.js +31 -0
  401. package/dist/server/transitions/index.d.ts +3 -0
  402. package/dist/server/transitions/index.js +19 -0
  403. package/dist/styles/app/AppPreview.css +49 -0
  404. package/dist/styles/app/_index.css +1 -0
  405. package/dist/styles/base/_index.css +2 -0
  406. package/dist/styles/base/global.css +9 -0
  407. package/dist/styles/base/tailwind.css +3 -0
  408. package/dist/styles/blocks/Block-layout.css +244 -0
  409. package/dist/styles/blocks/Block-spacing.css +150 -0
  410. package/dist/styles/blocks/Block-theming.css +14 -0
  411. package/dist/styles/blocks/Clients.css +10 -0
  412. package/dist/styles/blocks/Editorial.css +133 -0
  413. package/dist/styles/blocks/Form.css +13 -0
  414. package/dist/styles/blocks/MediaLayout.css +215 -0
  415. package/dist/styles/blocks/Message.css +353 -0
  416. package/dist/styles/blocks/Outcome.css +83 -0
  417. package/dist/styles/blocks/Projects.css +18 -0
  418. package/dist/styles/blocks/Stat.css +45 -0
  419. package/dist/styles/blocks/Stats.css +38 -0
  420. package/dist/styles/blocks/Testimonial.css +323 -0
  421. package/dist/styles/blocks/ValueProp.css +135 -0
  422. package/dist/styles/blocks/_index.css +14 -0
  423. package/dist/styles/components/_index.css +3 -0
  424. package/dist/styles/components/container.css +58 -0
  425. package/dist/styles/components/divider.css +6 -0
  426. package/dist/styles/components/embed/VimeoPlayer.css +49 -0
  427. package/dist/styles/components/embed/YoutubePlayer.css +72 -0
  428. package/dist/styles/components/embed/_index.css +2 -0
  429. package/dist/styles/entities/Client.css +5 -0
  430. package/dist/styles/entities/ClientBadge.css +14 -0
  431. package/dist/styles/entities/Person.css +76 -0
  432. package/dist/styles/entities/Project.css +44 -0
  433. package/dist/styles/entities/UniqueSellingPoint.css +54 -0
  434. package/dist/styles/entities/_index.css +5 -0
  435. package/dist/styles/fields/Caption.css +23 -0
  436. package/dist/styles/fields/Description.css +23 -0
  437. package/dist/styles/fields/FreeFormContent.css +24 -0
  438. package/dist/styles/fields/Headline.css +38 -0
  439. package/dist/styles/fields/Icon.css +20 -0
  440. package/dist/styles/fields/LazyVideo.css +12 -0
  441. package/dist/styles/fields/Link.css +16 -0
  442. package/dist/styles/fields/Quote.css +48 -0
  443. package/dist/styles/fields/RichText.css +243 -0
  444. package/dist/styles/fields/Title.css +17 -0
  445. package/dist/styles/fields/Visual.css +27 -0
  446. package/dist/styles/fields/_index.css +11 -0
  447. package/dist/styles/index.css +9 -0
  448. package/dist/styles/layouts/MasonryLayout.css +24 -0
  449. package/dist/styles/layouts/_index.css +1 -0
  450. package/dist/styles/panels/MessagePanel.css +56 -0
  451. package/dist/styles/panels/VisualPanel.css +58 -0
  452. package/dist/styles/panels/_index.css +2 -0
  453. package/dist/styles/utilities/_index.css +7 -0
  454. package/dist/styles/utilities/ellipsis.css +7 -0
  455. package/dist/styles/utilities/fade.css +16 -0
  456. package/dist/styles/utilities/glass.css +8 -0
  457. package/dist/styles/utilities/interpolate.css +22 -0
  458. package/dist/styles/utilities/masks.css +18 -0
  459. package/dist/styles/utilities/stacked.css +24 -0
  460. package/dist/styles/utilities/text-gradient.css +37 -0
  461. package/dist/types/HTMLBlockElement.d.ts +6 -0
  462. package/dist/types/HTMLBlockElement.js +2 -0
  463. package/dist/types/HTMLElements.d.ts +129 -0
  464. package/dist/types/HTMLElements.js +2 -0
  465. package/dist/types/index.d.ts +2 -0
  466. package/dist/types/index.js +18 -0
  467. package/package.json +73 -0
@@ -0,0 +1,498 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Carousel = Carousel;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const funnel_core_1 = require("@nascentdigital/funnel-core");
9
+ const classnames_1 = __importDefault(require("classnames"));
10
+ const react_1 = require("motion/react");
11
+ const react_2 = require("react");
12
+ const react_hotkeys_hook_1 = require("react-hotkeys-hook");
13
+ const rxjs_1 = require("rxjs");
14
+ const app_1 = require("../app");
15
+ const hooks_1 = require("../hooks");
16
+ // component
17
+ function Carousel({ className, spacing = 0, infinite = false, autoplay = false, autoplayInterval: autoplayIntervalRaw, disableClipping = false, renderIndicator, renderNavButton, renderPlayButton, onPageDrag = funnel_core_1.Fn.NoOp, onPageChange = funnel_core_1.Fn.NoOp, children = [] }) {
18
+ var _a;
19
+ // bind props + state + hooks
20
+ const [state, setState] = (0, react_2.useState)('initializing');
21
+ const [interacting, setInteracting] = (0, react_2.useState)(false);
22
+ const [play, setPlay] = (0, react_2.useState)(autoplay && infinite);
23
+ const [activeIndex, setActiveIndex] = (0, react_2.useState)(0);
24
+ const [dragIndex, setDragIndex] = (0, react_2.useState)();
25
+ const [containerRef, container] = (0, hooks_1.useRefElement)();
26
+ const [pagerRef, pager] = (0, hooks_1.useRefElement)();
27
+ const [indicatorsRef, indicators] = (0, hooks_1.useRefElement)();
28
+ const [playButtonRef, playButton] = (0, hooks_1.useRefElement)();
29
+ const deferredNavigationRef = (0, react_2.useRef)(undefined);
30
+ const pageDragRef = (0, react_2.useRef)(dragIndex);
31
+ const pageChangeRef = (0, react_2.useRef)(activeIndex);
32
+ const pagerSize = (0, hooks_1.useElementSize)(pager);
33
+ const pagerWidth = (_a = pagerSize === null || pagerSize === void 0 ? void 0 : pagerSize.width) !== null && _a !== void 0 ? _a : 0;
34
+ const pagerTranslate = (0, react_1.useMotionValue)(0);
35
+ const { hasKeyboardFocus, keyboardFocusElement } = (0, hooks_1.useKeyboardFocus)(container);
36
+ const uiLock = (0, hooks_1.useUILock)(container);
37
+ const playButtonFocused = !!playButton && keyboardFocusElement === playButton;
38
+ const childCount = children.length;
39
+ const appConfig = (0, app_1.useAppConfig)();
40
+ const autoplayInterval = (0, react_2.useMemo)(() => { var _a; return funnel_core_1.Duration.toMilliseconds((_a = autoplayIntervalRaw !== null && autoplayIntervalRaw !== void 0 ? autoplayIntervalRaw : appConfig.ui.carouselInterval) !== null && _a !== void 0 ? _a : '1s'); }, [autoplayIntervalRaw, appConfig]);
41
+ const reduceMotion = (0, react_1.useReducedMotion)();
42
+ const specs = (0, react_2.useMemo)(() => getCarouselSpecs({ spacing, infinite, children, activeIndex: activeIndex, pagerWidth }), [spacing, infinite, children, activeIndex, pagerWidth]);
43
+ const animateTo = (0, react_2.useCallback)(async (target) => onAnimateTo({
44
+ target, childCount, offset: activeIndex, spacing, infinite, pagerWidth, pagerTranslate, specs, setState, setActiveIndex, setDragIndex
45
+ }), [childCount, activeIndex, spacing, infinite, pagerWidth, pagerTranslate, specs]);
46
+ const goPrev = (0, react_2.useCallback)(async () => {
47
+ // stop autoplay (if running)
48
+ setPlay(false);
49
+ // set deferral if not ready
50
+ if (state !== 'ready') {
51
+ deferredNavigationRef.current = 'prev';
52
+ }
53
+ // or action immediately
54
+ else {
55
+ await animateTo('prev');
56
+ }
57
+ }, [state, animateTo]);
58
+ const goNext = (0, react_2.useCallback)(async () => {
59
+ // stop autoplay (if running)
60
+ setPlay(false);
61
+ // set deferral if not ready
62
+ if (state !== 'ready') {
63
+ deferredNavigationRef.current = 'next';
64
+ }
65
+ // or action immediately
66
+ else {
67
+ await animateTo('next');
68
+ }
69
+ }, [state, animateTo]);
70
+ const { pages, pagerTranslation, prevIndex, nextIndex } = specs;
71
+ const canAutoplay = autoplay && !uiLock.isLocked && reduceMotion !== true;
72
+ // constants
73
+ const carouselId = 'nd-Carousel-item';
74
+ // mount
75
+ (0, react_2.useEffect)(() => {
76
+ // disable if there are not enough children
77
+ if (childCount < 2) {
78
+ setState('disabled');
79
+ }
80
+ // or mark ready if the pager is bound (otherwise, ignore)
81
+ else if (pager) {
82
+ setState('ready');
83
+ }
84
+ }, [pager, childCount]);
85
+ // fix translation on layout change
86
+ (0, react_2.useEffect)(() => {
87
+ pagerTranslate.set(pagerTranslation);
88
+ }, [pagerTranslate, pagerTranslation]);
89
+ // autoplay
90
+ (0, react_2.useEffect)(() => {
91
+ // skip if not ready OR interacting
92
+ if (!infinite || !canAutoplay || !play || interacting || (hasKeyboardFocus && !playButtonFocused) || state !== 'ready') {
93
+ return;
94
+ }
95
+ // queue up page flip
96
+ const subscription = (0, rxjs_1.timer)(autoplayInterval)
97
+ .subscribe(() => animateTo('next').catch(console.error));
98
+ // cancel if unmounted
99
+ return () => subscription.unsubscribe();
100
+ }, [state, infinite, canAutoplay, play, autoplayInterval, interacting, hasKeyboardFocus, playButtonFocused, animateTo]);
101
+ // fix: safari had keyboard focus on container when clicking on play/pause
102
+ (0, react_2.useEffect)(() => {
103
+ if (container && keyboardFocusElement === container) {
104
+ keyboardFocusElement.blur();
105
+ }
106
+ }, [container, keyboardFocusElement]);
107
+ // handle deferred navigation
108
+ (0, react_2.useEffect)(() => {
109
+ const navigation = deferredNavigationRef.current;
110
+ if (state === 'ready' && navigation) {
111
+ // clear direction
112
+ deferredNavigationRef.current = undefined;
113
+ // animate
114
+ animateTo(navigation).catch(console.error);
115
+ }
116
+ }, [state, animateTo]);
117
+ // disable interaction/nav of offscreen pages
118
+ (0, react_2.useEffect)(() => {
119
+ // skip if we're no ready OR only have a single page (or less)
120
+ if (!pager || pages.length < 2) {
121
+ return;
122
+ }
123
+ // get active page element
124
+ const activePageElement = funnel_core_1.Browser.getElement(`.Carousel-pageActive`, pager);
125
+ if (!activePageElement) {
126
+ console.warn(`[Carousel/disablePages] unable to find active page element ".Carousel-pageActive"`);
127
+ return;
128
+ }
129
+ // disable tabbing from other slides
130
+ const restore = funnel_core_1.Browser.modifyElements({
131
+ container: pager,
132
+ targets: funnel_core_1.Selector.tabbable,
133
+ onModify: elements => elements.forEach(modifier => {
134
+ // only disable if not within active page
135
+ if (!activePageElement.contains(modifier.element)) {
136
+ modifier.setAttribute('tabindex', '-1');
137
+ }
138
+ }),
139
+ restoreKey: 'carouselDisabled'
140
+ });
141
+ // restore on unmount
142
+ return () => restore();
143
+ }, [pager, pages]);
144
+ // raise page drag callback
145
+ (0, react_2.useEffect)(() => {
146
+ // skip if page drag already notified current index (don't double up)
147
+ const pageIndex = pageDragRef.current;
148
+ if (pageIndex !== dragIndex) {
149
+ // track change
150
+ pageDragRef.current = dragIndex;
151
+ // raise change (if there's an index)
152
+ onPageDrag(dragIndex);
153
+ }
154
+ }, [onPageDrag, dragIndex]);
155
+ // raise page change callback
156
+ (0, react_2.useEffect)(() => {
157
+ // skip if page change already notified current index (don't double up)
158
+ const pageIndex = pageChangeRef.current;
159
+ if (pageIndex !== activeIndex) {
160
+ // track change
161
+ pageChangeRef.current = activeIndex;
162
+ // raise change
163
+ onPageChange(activeIndex);
164
+ }
165
+ }, [onPageChange, activeIndex]);
166
+ // setup hotkeys (for navigation)
167
+ const hotkeysRef = (0, react_hotkeys_hook_1.useHotkeys)('left, right', async (e, handler) => {
168
+ var _a;
169
+ // ignore if still animating
170
+ if (state !== 'ready') {
171
+ return;
172
+ }
173
+ // skip if not ready (not really possible)
174
+ const source = e.target;
175
+ const { keys } = handler;
176
+ if (!source || !container || !pager || !indicators || !keys) {
177
+ return;
178
+ }
179
+ // skip if not on slide or indicators
180
+ else if (!pager.contains(source) && !indicators.contains(source)) {
181
+ return;
182
+ }
183
+ // determine the indicator to focus on
184
+ const key = keys.join('');
185
+ const nextOffset = funnel_core_1.ArrayUtils.circularIndex(indicators.children, key === 'arrowleft'
186
+ ? activeIndex - 2
187
+ : activeIndex + 2);
188
+ // focus on indicator button
189
+ const nextButton = (_a = indicators.children.item(nextOffset)) === null || _a === void 0 ? void 0 : _a.querySelector('button');
190
+ if (nextButton) {
191
+ nextButton.disabled = false;
192
+ nextButton.focus();
193
+ }
194
+ // move slide
195
+ switch (key) {
196
+ case 'arrowleft':
197
+ await goPrev();
198
+ break;
199
+ case 'arrowright':
200
+ await goNext();
201
+ break;
202
+ }
203
+ }, { enabled: !!container }, [container, pager, indicators, goPrev, goNext, activeIndex]);
204
+ hotkeysRef.current = container;
205
+ // render nothing if there are no children
206
+ if (childCount === 0 || !children) {
207
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(className, 'Carousel-empty'), children: "No content" }));
208
+ }
209
+ // or render single child if there's nothing else
210
+ else if (childCount === 1) {
211
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(className, 'Carousel-single'), children: children }));
212
+ }
213
+ const onDragStart = () => {
214
+ // stop autoplay (if running)
215
+ setPlay(false);
216
+ // mark as dragging
217
+ setState('dragging');
218
+ };
219
+ const onDrag = async (e, info) => {
220
+ var _a, _b;
221
+ // determine paging outcome based on distance/direction
222
+ const distance = Math.abs(info.offset.x);
223
+ const percent = distance / pagerWidth;
224
+ const target = percent < 0.25
225
+ ? 'current'
226
+ : info.offset.x > 0
227
+ ? prevIndex !== undefined ? 'prev' : 'current'
228
+ : nextIndex !== undefined ? 'next' : 'current';
229
+ // track drag
230
+ setDragIndex(target === 'current'
231
+ ? activeIndex
232
+ : target === 'prev'
233
+ ? (_a = specs.prevIndex) !== null && _a !== void 0 ? _a : activeIndex
234
+ : (_b = specs.nextIndex) !== null && _b !== void 0 ? _b : activeIndex);
235
+ };
236
+ const onDragEnd = async (e, info) => {
237
+ // determine paging outcome based on distance/direction
238
+ const distance = Math.abs(info.offset.x);
239
+ const percent = distance / pagerWidth;
240
+ const target = percent < 0.25
241
+ ? 'current'
242
+ : info.offset.x > 0
243
+ ? prevIndex !== undefined ? 'prev' : 'current'
244
+ : nextIndex !== undefined ? 'next' : 'current';
245
+ // start paging
246
+ await animateTo(target);
247
+ // clear drag
248
+ setDragIndex(undefined);
249
+ };
250
+ const blurIfNotKeyboard = (e) => {
251
+ // drop focus (don't hold on) if it's NOT from the keyboard
252
+ if (!('pointerType' in e.nativeEvent) || e.nativeEvent.pointerType) {
253
+ // drop focus
254
+ const button = e.target;
255
+ button.blur();
256
+ // indicate that it was blurred
257
+ return true;
258
+ }
259
+ // or we actually got a keyboard event
260
+ return false;
261
+ };
262
+ const onJump = (e, index) => {
263
+ // stop autoplay (if running)
264
+ setPlay(false);
265
+ // jump to next element if moving via keyboard (but skip if the event isn't from the keyboard)
266
+ if (!blurIfNotKeyboard(e) && hasKeyboardFocus && indicators) {
267
+ // helper
268
+ const updateFocus = (indicatorIndex) => {
269
+ var _a, _b;
270
+ (_b = (_a = indicators.children.item(indicatorIndex)) === null || _a === void 0 ? void 0 : _a.querySelector('button')) === null || _b === void 0 ? void 0 : _b.focus();
271
+ };
272
+ // determine next index (need to go backward if next is offset)
273
+ let nextIndex = funnel_core_1.ArrayUtils.circularIndex(indicators.children, index + 1);
274
+ if (nextIndex === activeIndex) {
275
+ nextIndex = funnel_core_1.ArrayUtils.circularIndex(indicators.children, index - 1);
276
+ }
277
+ // force wait for move if we conflict (probably only 2 items)
278
+ if (nextIndex === activeIndex) {
279
+ setTimeout(() => updateFocus(nextIndex), 300);
280
+ }
281
+ // or do it immediately
282
+ else {
283
+ updateFocus(nextIndex);
284
+ }
285
+ }
286
+ // update offset
287
+ setActiveIndex(index);
288
+ };
289
+ const onPrev = async (e) => {
290
+ // ensure only keyboard events trap focus
291
+ blurIfNotKeyboard(e);
292
+ // try to navigate backwards (might deffer)
293
+ await goPrev();
294
+ };
295
+ const onNext = async (e) => {
296
+ // ensure only keyboard events trap focus
297
+ blurIfNotKeyboard(e);
298
+ // try to navigate forwards (might deffer)
299
+ await goNext();
300
+ };
301
+ const onTogglePlay = (e) => {
302
+ // drop keyboard focus
303
+ blurIfNotKeyboard(e);
304
+ // toggle play
305
+ setPlay(!play);
306
+ };
307
+ // otherwise, render carousel
308
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: containerRef, className: (0, classnames_1.default)(className, 'Carousel-root outline-none', {
309
+ 'Carousel-dragging': state === 'dragging',
310
+ 'Carousel-animating': state === 'animating'
311
+ }), tabIndex: -1, "aria-roledescription": "carousel", children: [(0, jsx_runtime_1.jsxs)("div", { ref: pagerRef, className: (0, classnames_1.default)('Carousel-pager', {
312
+ 'invisible': !pager,
313
+ 'overflow-visible': disableClipping,
314
+ 'overflow-hidden': !disableClipping,
315
+ 'pointer-events-none': state !== 'ready' && state !== 'dragging'
316
+ }), onPointerEnter: () => setInteracting(true), onPointerLeave: () => setInteracting(false), onPointerDown: () => setPlay(false), children: [(0, jsx_runtime_1.jsx)(react_1.motion.ol, { className: "Carousel-pages", style: { x: pagerTranslate }, drag: "x", dragMomentum: false, onDragStart: onDragStart, onDragEnd: onDragEnd, onDrag: onDrag, "aria-atomic": "false", "aria-live": canAutoplay && play && !interacting ? 'off' : 'polite', children: pages.map(({ id, order, page, index, active, virtual }) => (0, jsx_runtime_1.jsx)("li", Object.assign({ id: `${carouselId}-${id}`, className: (0, classnames_1.default)('Carousel-page', {
317
+ 'Carousel-pageActive': active,
318
+ 'Carousel-pagePrev': index === prevIndex,
319
+ 'Carousel-pageNext': index === nextIndex,
320
+ 'Carousel-pageDragActive': dragIndex !== undefined && dragIndex === index,
321
+ 'Carousel-pageDragPrev': dragIndex !== undefined && (dragIndex - 1) === index,
322
+ 'Carousel-pageDragNext': dragIndex !== undefined && (dragIndex + 1) === index,
323
+ 'Carousel-pageHidden': state !== 'animating' &&
324
+ ((!active && index !== prevIndex && index !== nextIndex && dragIndex === undefined)
325
+ || (dragIndex !== undefined && dragIndex !== index && (dragIndex - 1) !== index && (dragIndex + 1) !== index))
326
+ }), style: { margin: `0 ${spacing}px`, order } }, (!virtual && {
327
+ role: 'tabpanel',
328
+ 'aria-label': `${index + 1} of ${childCount}`,
329
+ 'aria-labelledby': `${carouselId}_${index}_ref`
330
+ }), { children: page }), id)) }), (0, jsx_runtime_1.jsx)("div", { className: "Carousel-pagesAlt", children: children.map((page, index) => (0, jsx_runtime_1.jsx)("div", { className: "Carousel-page", children: page }, index)) })] }), (0, jsx_runtime_1.jsxs)("nav", { className: "Carousel-controls", children: [renderNavButton
331
+ ?
332
+ renderNavButton({
333
+ type: 'prev',
334
+ enabling: dragIndex === undefined
335
+ ? undefined
336
+ : infinite || dragIndex > 0,
337
+ enabled: prevIndex !== undefined,
338
+ props: {
339
+ className: 'Carousel-prev',
340
+ onClick: onPrev,
341
+ onPointerEnter: () => setInteracting(true),
342
+ onPointerLeave: () => setInteracting(false),
343
+ 'aria-label': prevIndex === undefined ? 'No previous slide' : `Move to slide ${prevIndex + 1} of ${childCount}`,
344
+ 'aria-disabled': prevIndex === undefined
345
+ }
346
+ })
347
+ :
348
+ (0, jsx_runtime_1.jsx)("button", { className: "Carousel-prev", disabled: prevIndex === undefined, onClick: onPrev, onPointerEnter: () => setInteracting(true), onPointerLeave: () => setInteracting(false), "aria-label": prevIndex === undefined ? 'No previous slide' : `Move to slide ${prevIndex + 1} of ${childCount}`, "aria-disabled": prevIndex === undefined, children: "Prev" }), renderNavButton
349
+ ?
350
+ renderNavButton({
351
+ type: 'next',
352
+ enabling: dragIndex === undefined
353
+ ? undefined
354
+ : infinite || dragIndex < childCount - 1,
355
+ enabled: nextIndex !== undefined,
356
+ props: {
357
+ className: 'Carousel-next',
358
+ onClick: onNext,
359
+ onPointerEnter: () => setInteracting(true),
360
+ onPointerLeave: () => setInteracting(false),
361
+ 'aria-label': nextIndex === undefined ? 'No next slide' : `Move to slide ${nextIndex + 1} of ${childCount}`,
362
+ 'aria-disabled': nextIndex === undefined
363
+ }
364
+ })
365
+ :
366
+ (0, jsx_runtime_1.jsx)("button", { className: "Carousel-next", disabled: nextIndex === undefined, onClick: onNext, onPointerEnter: () => setInteracting(true), onPointerLeave: () => setInteracting(false), "aria-label": nextIndex === undefined ? 'No next slide' : `Move to slide ${nextIndex + 1} of ${childCount}`, "aria-disabled": nextIndex === undefined, children: "Next" }), canAutoplay && infinite &&
367
+ (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: renderPlayButton
368
+ ?
369
+ renderPlayButton({
370
+ props: {
371
+ ref: playButtonRef,
372
+ className: 'Carousel-play',
373
+ onClick: onTogglePlay,
374
+ 'aria-label': play ? 'Stop slide rotation' : 'Start slide rotation'
375
+ }
376
+ })
377
+ :
378
+ (0, jsx_runtime_1.jsx)("button", { ref: playButtonRef, className: "Carousel-play", onClick: onTogglePlay, "aria-label": play ? 'Stop slide rotation' : 'Start slide rotation', children: play ? 'Pause' : 'Play' }) })] }), (0, jsx_runtime_1.jsx)("nav", { className: "Carousel-indicatorsWrap", children: (0, jsx_runtime_1.jsx)("ol", { ref: indicatorsRef, className: "Carousel-indicators", onPointerEnter: () => setInteracting(true), onPointerLeave: () => setInteracting(false), role: "tablist", "aria-label": "Choose slide to display", children: children.map((_, index) => (0, jsx_runtime_1.jsx)("li", { className: (0, classnames_1.default)('Carousel-indicator', {
379
+ 'Carousel-indicatorActive': index === activeIndex
380
+ }), children: renderIndicator
381
+ ?
382
+ renderIndicator({
383
+ index,
384
+ active: index === activeIndex,
385
+ activating: dragIndex === undefined
386
+ ? undefined
387
+ : index === dragIndex,
388
+ props: {
389
+ id: `${carouselId}_${index}_ref`,
390
+ className: 'Carousel-indicatorBtn',
391
+ onClick: e => onJump(e, index),
392
+ role: 'tab',
393
+ 'aria-label': play ? 'Stop slide rotation' : 'Start slide rotation',
394
+ 'aria-controls': `${carouselId}_${activeIndex}`,
395
+ 'aria-selected': index === activeIndex
396
+ }
397
+ })
398
+ :
399
+ (0, jsx_runtime_1.jsx)("button", { id: `${carouselId}_${index}_ref`, className: "Carousel-indicatorBtn", disabled: index === activeIndex, onClick: e => onJump(e, index), role: "tab", "aria-label": `Slide ${index + 1}`, "aria-controls": `${carouselId}_${activeIndex}`, "aria-selected": index === activeIndex, children: index + 1 }) }, index)) }) })] }));
400
+ }
401
+ function getCarouselSpecs({ spacing, infinite, children, activeIndex, pagerWidth }) {
402
+ // setup for pager with boundaries (bookended)
403
+ const childCount = children.length;
404
+ if (!infinite) {
405
+ const lastOffset = childCount - 1;
406
+ return {
407
+ pages: children.map((page, index) => ({
408
+ id: `${index}`,
409
+ page,
410
+ index,
411
+ order: index,
412
+ active: index === activeIndex,
413
+ virtual: false
414
+ })),
415
+ pagerTranslation: -(activeIndex * (pagerWidth + spacing * 2)) - spacing,
416
+ prevIndex: activeIndex > 0 ? activeIndex - 1 : undefined,
417
+ nextIndex: activeIndex < lastOffset ? activeIndex + 1 : undefined
418
+ };
419
+ }
420
+ // or infinite scroll, should add enough to have 5 if not enough elements provided
421
+ else {
422
+ // minimum children must be 5 (2 in front / behind) OR double up to make sure we have clean repeats on virtual elements
423
+ const pageCount = childCount < 5 ? Math.max(childCount * 2, 6) : 5;
424
+ // visible page is always in 2nd position
425
+ const activePagePosition = 2;
426
+ // render pages
427
+ return {
428
+ pages: funnel_core_1.ArrayUtils.series(pageCount - 1).map(pageIndex => {
429
+ // determine mapping (lead with previous 2 pages, so current is at the center)
430
+ const index = funnel_core_1.ArrayUtils.circularIndex(children, pageIndex);
431
+ const iteration = Math.floor(pageIndex / childCount);
432
+ const virtualIndex = funnel_core_1.ArrayUtils.circularIndex(pageCount, activePagePosition + pageIndex - activeIndex);
433
+ const virtual = pageIndex >= childCount;
434
+ // create page
435
+ return {
436
+ id: `${index}${iteration > 0 ? `_${iteration}` : ''}`,
437
+ page: children[index],
438
+ index,
439
+ order: virtualIndex,
440
+ active: virtualIndex === activePagePosition,
441
+ virtual
442
+ };
443
+ }),
444
+ pagerTranslation: -(pagerWidth * 2 + spacing * 5),
445
+ prevIndex: funnel_core_1.ArrayUtils.circularIndex(children, activeIndex - 1),
446
+ nextIndex: funnel_core_1.ArrayUtils.circularIndex(children, activeIndex + 1)
447
+ };
448
+ }
449
+ }
450
+ async function onAnimateTo({ target, childCount, offset, spacing, infinite, pagerWidth, pagerTranslate, specs, setState, setActiveIndex, setDragIndex }) {
451
+ // ignore if target is invalid
452
+ if (!infinite && ((target === 'prev' && offset === 0)
453
+ || (target === 'next' && offset >= childCount - 1))) {
454
+ return;
455
+ }
456
+ // determine positioning
457
+ const { pagerTranslation, prevIndex, nextIndex } = specs;
458
+ const spacingAdjustment = target === 'prev'
459
+ ? spacing * 2
460
+ : target === 'next'
461
+ ? -spacing * 2
462
+ : 0;
463
+ const translation = (target === 'current' ? 0 : target === 'prev' ? pagerWidth : -pagerWidth)
464
+ + pagerTranslation
465
+ + spacingAdjustment;
466
+ // track drag
467
+ setDragIndex(target === 'current'
468
+ ? offset
469
+ : target === 'prev'
470
+ ? prevIndex !== null && prevIndex !== void 0 ? prevIndex : offset
471
+ : nextIndex !== null && nextIndex !== void 0 ? nextIndex : offset);
472
+ // start animation
473
+ const controls = (0, react_1.animate)(pagerTranslate, translation);
474
+ // mark as animating
475
+ setState('animating');
476
+ // wait for animation to end
477
+ await controls
478
+ .then(() => {
479
+ // then switch up offset (if moved)
480
+ if (target !== 'current') {
481
+ // and reset position back to center (only if infinite)
482
+ if (infinite) {
483
+ pagerTranslate.set(pagerTranslation);
484
+ }
485
+ // switch offset (officially)
486
+ setActiveIndex(target === 'prev'
487
+ ? prevIndex !== null && prevIndex !== void 0 ? prevIndex : offset
488
+ : nextIndex !== null && nextIndex !== void 0 ? nextIndex : offset);
489
+ }
490
+ })
491
+ // mark ready after animation
492
+ .finally(() => {
493
+ // reset drag
494
+ setDragIndex(undefined);
495
+ // reset state
496
+ setState('ready');
497
+ });
498
+ }
@@ -0,0 +1,19 @@
1
+ import { Callback } from '@nascentdigital/funnel-core';
2
+ import React, { ReactNode } from 'react';
3
+ import { HTMLElements } from '../../types';
4
+ export declare function ClickObserver({ className, tag, trigger, disabled, children, onClickInside, onClickOutside }: ClickObserver.Props): React.ReactElement<{
5
+ className: string | undefined;
6
+ ref: React.RefObject<HTMLDivElement | null>;
7
+ }, string | React.JSXElementConstructor<any>>;
8
+ export declare namespace ClickObserver {
9
+ type Props = {
10
+ className?: string;
11
+ tag?: keyof HTMLElements;
12
+ trigger?: Trigger;
13
+ disabled?: boolean;
14
+ children?: ReactNode;
15
+ onClickInside?: Callback<MouseEvent>;
16
+ onClickOutside?: Callback<MouseEvent>;
17
+ };
18
+ type Trigger = Extract<keyof GlobalEventHandlersEventMap, 'click' | 'mousedown' | 'mouseup' | 'pointerdown' | 'pointerup'>;
19
+ }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ClickObserver = ClickObserver;
37
+ const funnel_core_1 = require("@nascentdigital/funnel-core");
38
+ const react_1 = __importStar(require("react"));
39
+ // component
40
+ function ClickObserver({ className, tag = 'div', trigger = 'click', disabled = false, children, onClickInside = funnel_core_1.Fn.NoOp, onClickOutside = funnel_core_1.Fn.NoOp }) {
41
+ // bind refs
42
+ const containerRef = (0, react_1.useRef)(null);
43
+ // lifecycle
44
+ (0, react_1.useEffect)(() => {
45
+ // skip if disabled
46
+ if (disabled) {
47
+ return;
48
+ }
49
+ // helper (needs to be a constant so we can unregister)
50
+ const onWindowClick = (e) => {
51
+ // ignore if container isn't bound (shouldn't happen)
52
+ const container = containerRef.current;
53
+ if (!container) {
54
+ return;
55
+ }
56
+ // handle inside click
57
+ if (container.contains(e.target)) {
58
+ onClickInside(e);
59
+ }
60
+ // or outside click
61
+ else {
62
+ onClickOutside(e);
63
+ }
64
+ };
65
+ // constants
66
+ const listenerOptions = { capture: true };
67
+ window.addEventListener(trigger, onWindowClick, listenerOptions);
68
+ // unbind listener on unmount
69
+ return () => window.removeEventListener(trigger, onWindowClick, listenerOptions);
70
+ }, [trigger, disabled, onClickInside, onClickOutside]);
71
+ // render
72
+ return react_1.default.createElement(tag, {
73
+ className,
74
+ ref: containerRef
75
+ }, children);
76
+ }
@@ -0,0 +1,9 @@
1
+ import type { Callback, PixelSize } from '@nascentdigital/funnel-core';
2
+ import { HTMLAttributes } from 'react';
3
+ export declare function InfiniteScroller({ children, offset, onLoadMore, ...containerProps }: InfiniteScroller.Props): import("react/jsx-runtime").JSX.Element;
4
+ export declare namespace InfiniteScroller {
5
+ type Props = HTMLAttributes<HTMLDivElement> & {
6
+ onLoadMore: Callback.Void;
7
+ offset?: PixelSize;
8
+ };
9
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.InfiniteScroller = InfiniteScroller;
15
+ const jsx_runtime_1 = require("react/jsx-runtime");
16
+ const react_1 = require("react");
17
+ // component
18
+ function InfiniteScroller(_a) {
19
+ var { children, offset = '300px', onLoadMore } = _a, containerProps = __rest(_a, ["children", "offset", "onLoadMore"]);
20
+ // observer
21
+ const observer = (0, react_1.useRef)(null);
22
+ // setup observer with element at end of container
23
+ const endOfContainerRef = (0, react_1.useCallback)((endOfContainerNode) => {
24
+ // disconnect old observer if any
25
+ if (observer.current) {
26
+ observer.current.disconnect();
27
+ }
28
+ // if there is a node, observe it
29
+ if (endOfContainerNode) {
30
+ // create new observer
31
+ observer.current = new IntersectionObserver(entries => {
32
+ if (entries[0].isIntersecting) {
33
+ onLoadMore();
34
+ }
35
+ }, {
36
+ root: endOfContainerNode.parentElement,
37
+ // add bottom padding for buffer (call onLoadMore before end is fully in view)
38
+ rootMargin: `0px 0px ${offset} 0px`,
39
+ threshold: 0
40
+ });
41
+ // observe end of container node
42
+ observer.current.observe(endOfContainerNode);
43
+ }
44
+ }, [offset, onLoadMore]);
45
+ // render
46
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, containerProps, { children: [children, (0, jsx_runtime_1.jsx)("div", { ref: endOfContainerRef })] })));
47
+ }
@@ -0,0 +1,14 @@
1
+ import { Callback } from '@nascentdigital/funnel-core';
2
+ export declare function Loader({ className, state, title, action: actionLabel, triggerOffset, manual, onLoad }: Loader.Props): import("react/jsx-runtime").JSX.Element;
3
+ export declare namespace Loader {
4
+ type State = 'ready' | 'loading' | 'error' | 'complete';
5
+ type Props = {
6
+ className?: string;
7
+ state?: State;
8
+ title?: string;
9
+ action?: string;
10
+ manual?: boolean;
11
+ triggerOffset?: number;
12
+ onLoad?: Callback.Void;
13
+ };
14
+ }