@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.
- package/dist/Tailwind.d.ts +201 -0
- package/dist/Tailwind.js +282 -0
- package/dist/client/app/AppContainer.d.ts +10 -0
- package/dist/client/app/AppContainer.js +22 -0
- package/dist/client/app/AppContext.d.ts +11 -0
- package/dist/client/app/AppContext.js +6 -0
- package/dist/client/app/AppPreview.d.ts +7 -0
- package/dist/client/app/AppPreview.js +51 -0
- package/dist/client/app/PageContainer.d.ts +8 -0
- package/dist/client/app/PageContainer.js +22 -0
- package/dist/client/app/index.d.ts +9 -0
- package/dist/client/app/index.js +25 -0
- package/dist/client/app/useAppConfig.d.ts +2 -0
- package/dist/client/app/useAppConfig.js +9 -0
- package/dist/client/app/useBrand.d.ts +9 -0
- package/dist/client/app/useBrand.js +17 -0
- package/dist/client/app/useLanguage.d.ts +2 -0
- package/dist/client/app/useLanguage.js +11 -0
- package/dist/client/app/usePageData.d.ts +2 -0
- package/dist/client/app/usePageData.js +25 -0
- package/dist/client/app/usePageUrl.d.ts +1 -0
- package/dist/client/app/usePageUrl.js +12 -0
- package/dist/client/app/useRegion.d.ts +1 -0
- package/dist/client/app/useRegion.js +10 -0
- package/dist/client/app/useSite.d.ts +2 -0
- package/dist/client/app/useSite.js +13 -0
- package/dist/client/atomic/AnimatedText.d.ts +12 -0
- package/dist/client/atomic/AnimatedText.js +90 -0
- package/dist/client/atomic/MaskedInput.d.ts +20 -0
- package/dist/client/atomic/MaskedInput.js +63 -0
- package/dist/client/atomic/index.d.ts +2 -0
- package/dist/client/atomic/index.js +18 -0
- package/dist/client/fields/EmbeddedVideo/EmbeddedPlayer.d.ts +36 -0
- package/dist/client/fields/EmbeddedVideo/EmbeddedPlayer.js +2 -0
- package/dist/client/fields/EmbeddedVideo/EmbeddedVideo.d.ts +13 -0
- package/dist/client/fields/EmbeddedVideo/EmbeddedVideo.js +22 -0
- package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContainer.d.ts +7 -0
- package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContainer.js +24 -0
- package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContext.d.ts +8 -0
- package/dist/client/fields/EmbeddedVideo/EmbeddedVideoContext.js +11 -0
- package/dist/client/fields/EmbeddedVideo/index.d.ts +4 -0
- package/dist/client/fields/EmbeddedVideo/index.js +20 -0
- package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerProgress.d.ts +10 -0
- package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerProgress.js +66 -0
- package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerRef.d.ts +9 -0
- package/dist/client/fields/EmbeddedVideo/useEmbeddedPlayerRef.js +29 -0
- package/dist/client/fields/EmbeddedVideo/vimeo/VimeoPlayer.d.ts +63 -0
- package/dist/client/fields/EmbeddedVideo/vimeo/VimeoPlayer.js +326 -0
- package/dist/client/fields/EmbeddedVideo/vimeo/VimeoVideo.d.ts +13 -0
- package/dist/client/fields/EmbeddedVideo/vimeo/VimeoVideo.js +60 -0
- package/dist/client/fields/EmbeddedVideo/vimeo/index.d.ts +1 -0
- package/dist/client/fields/EmbeddedVideo/vimeo/index.js +17 -0
- package/dist/client/fields/EmbeddedVideo/youtube/YTApi.d.ts +92 -0
- package/dist/client/fields/EmbeddedVideo/youtube/YTApi.js +24 -0
- package/dist/client/fields/EmbeddedVideo/youtube/YoutubePlayer.d.ts +56 -0
- package/dist/client/fields/EmbeddedVideo/youtube/YoutubePlayer.js +288 -0
- package/dist/client/fields/EmbeddedVideo/youtube/YoutubeVideo.d.ts +13 -0
- package/dist/client/fields/EmbeddedVideo/youtube/YoutubeVideo.js +71 -0
- package/dist/client/fields/EmbeddedVideo/youtube/index.d.ts +3 -0
- package/dist/client/fields/EmbeddedVideo/youtube/index.js +19 -0
- package/dist/client/fields/LazyVideo.d.ts +8 -0
- package/dist/client/fields/LazyVideo.js +100 -0
- package/dist/client/fields/index.d.ts +2 -0
- package/dist/client/fields/index.js +18 -0
- package/dist/client/forms/Form.d.ts +13 -0
- package/dist/client/forms/Form.js +68 -0
- package/dist/client/forms/FormContext.d.ts +5 -0
- package/dist/client/forms/FormContext.js +6 -0
- package/dist/client/forms/fields/BooleanField.d.ts +16 -0
- package/dist/client/forms/fields/BooleanField.js +47 -0
- package/dist/client/forms/fields/EnumField.d.ts +20 -0
- package/dist/client/forms/fields/EnumField.js +65 -0
- package/dist/client/forms/fields/Field.d.ts +15 -0
- package/dist/client/forms/fields/Field.js +39 -0
- package/dist/client/forms/fields/FieldErrorController.d.ts +12 -0
- package/dist/client/forms/fields/FieldErrorController.js +13 -0
- package/dist/client/forms/fields/FieldLayout.d.ts +16 -0
- package/dist/client/forms/fields/FieldLayout.js +32 -0
- package/dist/client/forms/fields/TextField.d.ts +25 -0
- package/dist/client/forms/fields/TextField.js +178 -0
- package/dist/client/forms/fields/index.d.ts +2 -0
- package/dist/client/forms/fields/index.js +18 -0
- package/dist/client/forms/fields/useField.d.ts +2 -0
- package/dist/client/forms/fields/useField.js +26 -0
- package/dist/client/forms/index.d.ts +4 -0
- package/dist/client/forms/index.js +20 -0
- package/dist/client/forms/interactive/CheckboxField.d.ts +14 -0
- package/dist/client/forms/interactive/CheckboxField.js +19 -0
- package/dist/client/forms/interactive/RadioField.d.ts +12 -0
- package/dist/client/forms/interactive/RadioField.js +16 -0
- package/dist/client/forms/interactive/RadioGroupField.d.ts +12 -0
- package/dist/client/forms/interactive/RadioGroupField.js +10 -0
- package/dist/client/forms/interactive/SelectField.d.ts +17 -0
- package/dist/client/forms/interactive/SelectField.js +16 -0
- package/dist/client/forms/interactive/index.d.ts +4 -0
- package/dist/client/forms/interactive/index.js +20 -0
- package/dist/client/forms/useForm.d.ts +2 -0
- package/dist/client/forms/useForm.js +17 -0
- package/dist/client/forms/useTempFields.d.ts +7 -0
- package/dist/client/forms/useTempFields.js +54 -0
- package/dist/client/hooks/assets/index.d.ts +2 -0
- package/dist/client/hooks/assets/index.js +18 -0
- package/dist/client/hooks/assets/useImageProxy.d.ts +2 -0
- package/dist/client/hooks/assets/useImageProxy.js +43 -0
- package/dist/client/hooks/assets/useVideoProxy.d.ts +2 -0
- package/dist/client/hooks/assets/useVideoProxy.js +43 -0
- package/dist/client/hooks/breakpoint/BreakpointContainer.d.ts +9 -0
- package/dist/client/hooks/breakpoint/BreakpointContainer.js +39 -0
- package/dist/client/hooks/breakpoint/BreakpointContext.d.ts +7 -0
- package/dist/client/hooks/breakpoint/BreakpointContext.js +9 -0
- package/dist/client/hooks/breakpoint/index.d.ts +3 -0
- package/dist/client/hooks/breakpoint/index.js +19 -0
- package/dist/client/hooks/breakpoint/useCurrentBreakpoint.d.ts +2 -0
- package/dist/client/hooks/breakpoint/useCurrentBreakpoint.js +10 -0
- package/dist/client/hooks/index.d.ts +26 -0
- package/dist/client/hooks/index.js +42 -0
- package/dist/client/hooks/ui-lock/UILockContainer.d.ts +5 -0
- package/dist/client/hooks/ui-lock/UILockContainer.js +57 -0
- package/dist/client/hooks/ui-lock/UILockContext.d.ts +9 -0
- package/dist/client/hooks/ui-lock/UILockContext.js +6 -0
- package/dist/client/hooks/ui-lock/UILockRef.d.ts +36 -0
- package/dist/client/hooks/ui-lock/UILockRef.js +32 -0
- package/dist/client/hooks/ui-lock/index.d.ts +3 -0
- package/dist/client/hooks/ui-lock/index.js +19 -0
- package/dist/client/hooks/ui-lock/useUILock.d.ts +16 -0
- package/dist/client/hooks/ui-lock/useUILock.js +121 -0
- package/dist/client/hooks/useCounter.d.ts +11 -0
- package/dist/client/hooks/useCounter.js +57 -0
- package/dist/client/hooks/useCycle.d.ts +5 -0
- package/dist/client/hooks/useCycle.js +15 -0
- package/dist/client/hooks/useElementRect.d.ts +2 -0
- package/dist/client/hooks/useElementRect.js +63 -0
- package/dist/client/hooks/useElementScrolled.d.ts +17 -0
- package/dist/client/hooks/useElementScrolled.js +51 -0
- package/dist/client/hooks/useElementSelector.d.ts +2 -0
- package/dist/client/hooks/useElementSelector.js +160 -0
- package/dist/client/hooks/useElementSize.d.ts +2 -0
- package/dist/client/hooks/useElementSize.js +64 -0
- package/dist/client/hooks/useFindElements.d.ts +9 -0
- package/dist/client/hooks/useFindElements.js +147 -0
- package/dist/client/hooks/useInViewport.d.ts +16 -0
- package/dist/client/hooks/useInViewport.js +46 -0
- package/dist/client/hooks/useIsDesktop.d.ts +1 -0
- package/dist/client/hooks/useIsDesktop.js +22 -0
- package/dist/client/hooks/useKeyboardFocus.d.ts +7 -0
- package/dist/client/hooks/useKeyboardFocus.js +40 -0
- package/dist/client/hooks/useLatestValue.d.ts +1 -0
- package/dist/client/hooks/useLatestValue.js +21 -0
- package/dist/client/hooks/useLock.d.ts +13 -0
- package/dist/client/hooks/useLock.js +161 -0
- package/dist/client/hooks/useMixedResponsiveValue.d.ts +2 -0
- package/dist/client/hooks/useMixedResponsiveValue.js +20 -0
- package/dist/client/hooks/usePathname.d.ts +9 -0
- package/dist/client/hooks/usePathname.js +25 -0
- package/dist/client/hooks/useRefElement.d.ts +8 -0
- package/dist/client/hooks/useRefElement.js +34 -0
- package/dist/client/hooks/useRefresh.d.ts +2 -0
- package/dist/client/hooks/useRefresh.js +25 -0
- package/dist/client/hooks/useResizeObserver.d.ts +5 -0
- package/dist/client/hooks/useResizeObserver.js +179 -0
- package/dist/client/hooks/useResponsiveValue.d.ts +2 -0
- package/dist/client/hooks/useResponsiveValue.js +16 -0
- package/dist/client/hooks/useRouter.d.ts +20 -0
- package/dist/client/hooks/useRouter.js +49 -0
- package/dist/client/hooks/useSafeLayoutEffect.d.ts +2 -0
- package/dist/client/hooks/useSafeLayoutEffect.js +9 -0
- package/dist/client/hooks/useTouch.d.ts +2 -0
- package/dist/client/hooks/useTouch.js +10 -0
- package/dist/client/hooks/useViewportSize.d.ts +7 -0
- package/dist/client/hooks/useViewportSize.js +66 -0
- package/dist/client/hooks/useWindowScrolled.d.ts +8 -0
- package/dist/client/hooks/useWindowScrolled.js +52 -0
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.js +25 -0
- package/dist/client/interaction/Carousel.d.ts +48 -0
- package/dist/client/interaction/Carousel.js +498 -0
- package/dist/client/interaction/ClickObserver.d.ts +19 -0
- package/dist/client/interaction/ClickObserver.js +76 -0
- package/dist/client/interaction/InfiniteScroller.d.ts +9 -0
- package/dist/client/interaction/InfiniteScroller.js +47 -0
- package/dist/client/interaction/Loader.d.ts +14 -0
- package/dist/client/interaction/Loader.js +74 -0
- package/dist/client/interaction/Marquee.d.ts +5 -0
- package/dist/client/interaction/Marquee.js +26 -0
- package/dist/client/interaction/Popup.d.ts +36 -0
- package/dist/client/interaction/Popup.js +244 -0
- package/dist/client/interaction/Tooltip.d.ts +16 -0
- package/dist/client/interaction/Tooltip.js +122 -0
- package/dist/client/interaction/UILevel.d.ts +1 -0
- package/dist/client/interaction/UILevel.js +2 -0
- package/dist/client/interaction/backdrop/BackdropContainer.d.ts +5 -0
- package/dist/client/interaction/backdrop/BackdropContainer.js +114 -0
- package/dist/client/interaction/backdrop/BackdropContext.d.ts +8 -0
- package/dist/client/interaction/backdrop/BackdropContext.js +6 -0
- package/dist/client/interaction/backdrop/BackdropEvent.d.ts +64 -0
- package/dist/client/interaction/backdrop/BackdropEvent.js +92 -0
- package/dist/client/interaction/backdrop/index.d.ts +4 -0
- package/dist/client/interaction/backdrop/index.js +20 -0
- package/dist/client/interaction/backdrop/useBackdrop.d.ts +13 -0
- package/dist/client/interaction/backdrop/useBackdrop.js +58 -0
- package/dist/client/interaction/backdrop/useBackdropClick.d.ts +2 -0
- package/dist/client/interaction/backdrop/useBackdropClick.js +21 -0
- package/dist/client/interaction/backdrop/useBackdropVisible.d.ts +1 -0
- package/dist/client/interaction/backdrop/useBackdropVisible.js +30 -0
- package/dist/client/interaction/focus/FocusArea.d.ts +10 -0
- package/dist/client/interaction/focus/FocusArea.js +38 -0
- package/dist/client/interaction/focus/FocusContext.d.ts +7 -0
- package/dist/client/interaction/focus/FocusContext.js +7 -0
- package/dist/client/interaction/focus/FocusController.d.ts +9 -0
- package/dist/client/interaction/focus/FocusController.js +40 -0
- package/dist/client/interaction/focus/FocusService.d.ts +20 -0
- package/dist/client/interaction/focus/FocusService.js +204 -0
- package/dist/client/interaction/focus/LinkedList.d.ts +18 -0
- package/dist/client/interaction/focus/LinkedList.js +122 -0
- package/dist/client/interaction/focus/index.d.ts +2 -0
- package/dist/client/interaction/focus/index.js +18 -0
- package/dist/client/interaction/focus/useFocusService.d.ts +2 -0
- package/dist/client/interaction/focus/useFocusService.js +14 -0
- package/dist/client/interaction/index.d.ts +12 -0
- package/dist/client/interaction/index.js +28 -0
- package/dist/client/interaction/modal/Modal.d.ts +29 -0
- package/dist/client/interaction/modal/Modal.js +136 -0
- package/dist/client/interaction/modal/ModalContainer.d.ts +5 -0
- package/dist/client/interaction/modal/ModalContainer.js +104 -0
- package/dist/client/interaction/modal/ModalContext.d.ts +8 -0
- package/dist/client/interaction/modal/ModalContext.js +6 -0
- package/dist/client/interaction/modal/ModalEvent.d.ts +39 -0
- package/dist/client/interaction/modal/ModalEvent.js +53 -0
- package/dist/client/interaction/modal/index.d.ts +2 -0
- package/dist/client/interaction/modal/index.js +18 -0
- package/dist/client/interaction/paginator/Paginator.d.ts +33 -0
- package/dist/client/interaction/paginator/Paginator.js +67 -0
- package/dist/client/interaction/paginator/index.d.ts +1 -0
- package/dist/client/interaction/paginator/index.js +17 -0
- package/dist/client/layouts/MasonaryLayout.d.ts +7 -0
- package/dist/client/layouts/MasonaryLayout.js +53 -0
- package/dist/client/layouts/index.d.ts +1 -0
- package/dist/client/layouts/index.js +17 -0
- package/dist/client/refs.d.ts +2 -0
- package/dist/client/refs.js +13 -0
- package/dist/client/transitions/Revelator.d.ts +42 -0
- package/dist/client/transitions/Revelator.js +60 -0
- package/dist/client/transitions/SideScroll.d.ts +14 -0
- package/dist/client/transitions/SideScroll.js +51 -0
- package/dist/client/transitions/StyleInViewport.d.ts +20 -0
- package/dist/client/transitions/StyleInViewport.js +66 -0
- package/dist/client/transitions/StyleSwitch.d.ts +297 -0
- package/dist/client/transitions/StyleSwitch.js +78 -0
- package/dist/client/transitions/index.d.ts +6 -0
- package/dist/client/transitions/index.js +22 -0
- package/dist/client/transitions/parallax/Parallax.d.ts +20 -0
- package/dist/client/transitions/parallax/Parallax.js +72 -0
- package/dist/client/transitions/parallax/ParallaxContext.d.ts +11 -0
- package/dist/client/transitions/parallax/ParallaxContext.js +6 -0
- package/dist/client/transitions/parallax/ParallaxItem.d.ts +14 -0
- package/dist/client/transitions/parallax/ParallaxItem.js +37 -0
- package/dist/client/transitions/parallax/ParallaxRemote.d.ts +29 -0
- package/dist/client/transitions/parallax/ParallaxRemote.js +136 -0
- package/dist/client/transitions/parallax/ParallaxUtils.d.ts +5 -0
- package/dist/client/transitions/parallax/ParallaxUtils.js +19 -0
- package/dist/client/transitions/parallax/index.d.ts +2 -0
- package/dist/client/transitions/parallax/index.js +18 -0
- package/dist/client/transitions/parallax/useDisableParallax.d.ts +4 -0
- package/dist/client/transitions/parallax/useDisableParallax.js +13 -0
- package/dist/client/transitions/parallax/useParallax.d.ts +2 -0
- package/dist/client/transitions/parallax/useParallax.js +18 -0
- package/dist/client/transitions/parallax/useTransforms.d.ts +34 -0
- package/dist/client/transitions/parallax/useTransforms.js +176 -0
- package/dist/client/transitions/reveal/Reveal.d.ts +14 -0
- package/dist/client/transitions/reveal/Reveal.js +75 -0
- package/dist/client/transitions/reveal/RevealAnimation.d.ts +17 -0
- package/dist/client/transitions/reveal/RevealAnimation.js +2 -0
- package/dist/client/transitions/reveal/RevealAnimator.d.ts +13 -0
- package/dist/client/transitions/reveal/RevealAnimator.js +41 -0
- package/dist/client/transitions/reveal/RevealController.d.ts +13 -0
- package/dist/client/transitions/reveal/RevealController.js +114 -0
- package/dist/client/transitions/reveal/RevealElementAnimator.d.ts +13 -0
- package/dist/client/transitions/reveal/RevealElementAnimator.js +65 -0
- package/dist/client/transitions/reveal/index.d.ts +2 -0
- package/dist/client/transitions/reveal/index.js +18 -0
- package/dist/client/utils/OnKey.d.ts +20 -0
- package/dist/client/utils/OnKey.js +33 -0
- package/dist/client/utils/SharedMutationObserver.d.ts +20 -0
- package/dist/client/utils/SharedMutationObserver.js +202 -0
- package/dist/client/utils/index.d.ts +2 -0
- package/dist/client/utils/index.js +18 -0
- package/dist/server/atomic/Markup.d.ts +14 -0
- package/dist/server/atomic/Markup.js +34 -0
- package/dist/server/atomic/NascentLogo.d.ts +6 -0
- package/dist/server/atomic/NascentLogo.js +9 -0
- package/dist/server/atomic/index.d.ts +2 -0
- package/dist/server/atomic/index.js +18 -0
- package/dist/server/blocks/Block.d.ts +16 -0
- package/dist/server/blocks/Block.js +92 -0
- package/dist/server/blocks/Clients.d.ts +33 -0
- package/dist/server/blocks/Clients.js +82 -0
- package/dist/server/blocks/Editorial.d.ts +33 -0
- package/dist/server/blocks/Editorial.js +80 -0
- package/dist/server/blocks/Form.d.ts +46 -0
- package/dist/server/blocks/Form.js +74 -0
- package/dist/server/blocks/FormMessage.d.ts +15 -0
- package/dist/server/blocks/FormMessage.js +37 -0
- package/dist/server/blocks/MediaLayout.d.ts +309 -0
- package/dist/server/blocks/MediaLayout.js +105 -0
- package/dist/server/blocks/Message.d.ts +76 -0
- package/dist/server/blocks/Message.js +352 -0
- package/dist/server/blocks/Outcome.d.ts +84 -0
- package/dist/server/blocks/Outcome.js +489 -0
- package/dist/server/blocks/OutcomeDetail.d.ts +303 -0
- package/dist/server/blocks/OutcomeDetail.js +63 -0
- package/dist/server/blocks/Projects.d.ts +43 -0
- package/dist/server/blocks/Projects.js +109 -0
- package/dist/server/blocks/Stat.d.ts +325 -0
- package/dist/server/blocks/Stat.js +107 -0
- package/dist/server/blocks/Stats.d.ts +36 -0
- package/dist/server/blocks/Stats.js +79 -0
- package/dist/server/blocks/Testimonial.d.ts +30 -0
- package/dist/server/blocks/Testimonial.js +68 -0
- package/dist/server/blocks/ValueProp.d.ts +43 -0
- package/dist/server/blocks/ValueProp.js +125 -0
- package/dist/server/blocks/index.d.ts +13 -0
- package/dist/server/blocks/index.js +29 -0
- package/dist/server/data/PrePaginator.d.ts +8 -0
- package/dist/server/data/PrePaginator.js +30 -0
- package/dist/server/data/index.d.ts +1 -0
- package/dist/server/data/index.js +17 -0
- package/dist/server/entities/Client.d.ts +327 -0
- package/dist/server/entities/Client.js +118 -0
- package/dist/server/entities/ClientBadge.d.ts +293 -0
- package/dist/server/entities/ClientBadge.js +37 -0
- package/dist/server/entities/Person.d.ts +314 -0
- package/dist/server/entities/Person.js +98 -0
- package/dist/server/entities/Project.d.ts +329 -0
- package/dist/server/entities/Project.js +112 -0
- package/dist/server/entities/UniqueSellingPoint.d.ts +327 -0
- package/dist/server/entities/UniqueSellingPoint.js +119 -0
- package/dist/server/entities/index.d.ts +6 -0
- package/dist/server/entities/index.js +22 -0
- package/dist/server/entities/previews/MessagePreview.d.ts +299 -0
- package/dist/server/entities/previews/MessagePreview.js +41 -0
- package/dist/server/entities/previews/PagePreview.d.ts +10 -0
- package/dist/server/entities/previews/PagePreview.js +42 -0
- package/dist/server/entities/previews/index.d.ts +2 -0
- package/dist/server/entities/previews/index.js +18 -0
- package/dist/server/fields/Caption.d.ts +13 -0
- package/dist/server/fields/Caption.js +45 -0
- package/dist/server/fields/Description.d.ts +13 -0
- package/dist/server/fields/Description.js +46 -0
- package/dist/server/fields/FreeFormContent.d.ts +17 -0
- package/dist/server/fields/FreeFormContent.js +43 -0
- package/dist/server/fields/Headline.d.ts +13 -0
- package/dist/server/fields/Headline.js +46 -0
- package/dist/server/fields/Icon.d.ts +10 -0
- package/dist/server/fields/Icon.js +39 -0
- package/dist/server/fields/Link.d.ts +16 -0
- package/dist/server/fields/Link.js +61 -0
- package/dist/server/fields/Quote.d.ts +13 -0
- package/dist/server/fields/Quote.js +46 -0
- package/dist/server/fields/RichText.d.ts +296 -0
- package/dist/server/fields/RichText.js +217 -0
- package/dist/server/fields/Title.d.ts +292 -0
- package/dist/server/fields/Title.js +38 -0
- package/dist/server/fields/Visual.d.ts +12 -0
- package/dist/server/fields/Visual.js +66 -0
- package/dist/server/fields/index.d.ts +10 -0
- package/dist/server/fields/index.js +26 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +25 -0
- package/dist/server/panels/BlockPanel.d.ts +14 -0
- package/dist/server/panels/BlockPanel.js +56 -0
- package/dist/server/panels/MessagePanel.d.ts +31 -0
- package/dist/server/panels/MessagePanel.js +81 -0
- package/dist/server/panels/VisualPanel.d.ts +36 -0
- package/dist/server/panels/VisualPanel.js +143 -0
- package/dist/server/panels/index.d.ts +3 -0
- package/dist/server/panels/index.js +19 -0
- package/dist/server/schema/Anchor.d.ts +7 -0
- package/dist/server/schema/Anchor.js +24 -0
- package/dist/server/schema/AspectRatio.d.ts +9 -0
- package/dist/server/schema/AspectRatio.js +43 -0
- package/dist/server/schema/BlockConfig.d.ts +56 -0
- package/dist/server/schema/BlockConfig.js +192 -0
- package/dist/server/schema/CollectionSchema.d.ts +4 -0
- package/dist/server/schema/CollectionSchema.js +15 -0
- package/dist/server/schema/ItemAlignment.d.ts +12 -0
- package/dist/server/schema/ItemAlignment.js +42 -0
- package/dist/server/schema/ItemPosition.d.ts +6 -0
- package/dist/server/schema/ItemPosition.js +25 -0
- package/dist/server/schema/ItemSize.d.ts +6 -0
- package/dist/server/schema/ItemSize.js +24 -0
- package/dist/server/schema/TextAlignment.d.ts +6 -0
- package/dist/server/schema/TextAlignment.js +22 -0
- package/dist/server/schema/index.d.ts +8 -0
- package/dist/server/schema/index.js +24 -0
- package/dist/server/sections/index.d.ts +1 -0
- package/dist/server/sections/index.js +17 -0
- package/dist/server/sections/renderSection.d.ts +6 -0
- package/dist/server/sections/renderSection.js +19 -0
- package/dist/server/transitions/Slide.d.ts +293 -0
- package/dist/server/transitions/Slide.js +31 -0
- package/dist/server/transitions/index.d.ts +3 -0
- package/dist/server/transitions/index.js +19 -0
- package/dist/styles/app/AppPreview.css +49 -0
- package/dist/styles/app/_index.css +1 -0
- package/dist/styles/base/_index.css +2 -0
- package/dist/styles/base/global.css +9 -0
- package/dist/styles/base/tailwind.css +3 -0
- package/dist/styles/blocks/Block-layout.css +244 -0
- package/dist/styles/blocks/Block-spacing.css +150 -0
- package/dist/styles/blocks/Block-theming.css +14 -0
- package/dist/styles/blocks/Clients.css +10 -0
- package/dist/styles/blocks/Editorial.css +133 -0
- package/dist/styles/blocks/Form.css +13 -0
- package/dist/styles/blocks/MediaLayout.css +215 -0
- package/dist/styles/blocks/Message.css +353 -0
- package/dist/styles/blocks/Outcome.css +83 -0
- package/dist/styles/blocks/Projects.css +18 -0
- package/dist/styles/blocks/Stat.css +45 -0
- package/dist/styles/blocks/Stats.css +38 -0
- package/dist/styles/blocks/Testimonial.css +323 -0
- package/dist/styles/blocks/ValueProp.css +135 -0
- package/dist/styles/blocks/_index.css +14 -0
- package/dist/styles/components/_index.css +3 -0
- package/dist/styles/components/container.css +58 -0
- package/dist/styles/components/divider.css +6 -0
- package/dist/styles/components/embed/VimeoPlayer.css +49 -0
- package/dist/styles/components/embed/YoutubePlayer.css +72 -0
- package/dist/styles/components/embed/_index.css +2 -0
- package/dist/styles/entities/Client.css +5 -0
- package/dist/styles/entities/ClientBadge.css +14 -0
- package/dist/styles/entities/Person.css +76 -0
- package/dist/styles/entities/Project.css +44 -0
- package/dist/styles/entities/UniqueSellingPoint.css +54 -0
- package/dist/styles/entities/_index.css +5 -0
- package/dist/styles/fields/Caption.css +23 -0
- package/dist/styles/fields/Description.css +23 -0
- package/dist/styles/fields/FreeFormContent.css +24 -0
- package/dist/styles/fields/Headline.css +38 -0
- package/dist/styles/fields/Icon.css +20 -0
- package/dist/styles/fields/LazyVideo.css +12 -0
- package/dist/styles/fields/Link.css +16 -0
- package/dist/styles/fields/Quote.css +48 -0
- package/dist/styles/fields/RichText.css +243 -0
- package/dist/styles/fields/Title.css +17 -0
- package/dist/styles/fields/Visual.css +27 -0
- package/dist/styles/fields/_index.css +11 -0
- package/dist/styles/index.css +9 -0
- package/dist/styles/layouts/MasonryLayout.css +24 -0
- package/dist/styles/layouts/_index.css +1 -0
- package/dist/styles/panels/MessagePanel.css +56 -0
- package/dist/styles/panels/VisualPanel.css +58 -0
- package/dist/styles/panels/_index.css +2 -0
- package/dist/styles/utilities/_index.css +7 -0
- package/dist/styles/utilities/ellipsis.css +7 -0
- package/dist/styles/utilities/fade.css +16 -0
- package/dist/styles/utilities/glass.css +8 -0
- package/dist/styles/utilities/interpolate.css +22 -0
- package/dist/styles/utilities/masks.css +18 -0
- package/dist/styles/utilities/stacked.css +24 -0
- package/dist/styles/utilities/text-gradient.css +37 -0
- package/dist/types/HTMLBlockElement.d.ts +6 -0
- package/dist/types/HTMLBlockElement.js +2 -0
- package/dist/types/HTMLElements.d.ts +129 -0
- package/dist/types/HTMLElements.js +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +18 -0
- package/package.json +73 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Transform } from '@nascentdigital/funnel-core';
|
|
2
|
+
export declare class SortedLinkedList<T extends SortedLinkedList.Node<T>> {
|
|
3
|
+
constructor(list?: SortedLinkedList<T>);
|
|
4
|
+
private _head?;
|
|
5
|
+
get head(): T | undefined;
|
|
6
|
+
private _tail?;
|
|
7
|
+
get tail(): T | undefined;
|
|
8
|
+
find(matches: Transform<T, boolean>): T | undefined;
|
|
9
|
+
insert(node: T): void;
|
|
10
|
+
remove(node: T): void;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace SortedLinkedList {
|
|
13
|
+
interface Node<T> {
|
|
14
|
+
prev?: Node<T>;
|
|
15
|
+
next?: Node<T>;
|
|
16
|
+
compareTo(that: Node<T>): number;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SortedLinkedList = void 0;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
// class
|
|
6
|
+
class SortedLinkedList {
|
|
7
|
+
constructor(list) {
|
|
8
|
+
// initialize instance variables
|
|
9
|
+
this._head = list === null || list === void 0 ? void 0 : list._head;
|
|
10
|
+
this._tail = list === null || list === void 0 ? void 0 : list._tail;
|
|
11
|
+
}
|
|
12
|
+
get head() {
|
|
13
|
+
return this._head;
|
|
14
|
+
}
|
|
15
|
+
get tail() {
|
|
16
|
+
return this._tail;
|
|
17
|
+
}
|
|
18
|
+
find(matches) {
|
|
19
|
+
// find the closest match
|
|
20
|
+
let node = this._head;
|
|
21
|
+
while (node && !matches(node)) {
|
|
22
|
+
node = node.next;
|
|
23
|
+
}
|
|
24
|
+
// return result
|
|
25
|
+
return node;
|
|
26
|
+
}
|
|
27
|
+
insert(node) {
|
|
28
|
+
// blow up if node is already connected
|
|
29
|
+
if (node.prev || node.next) {
|
|
30
|
+
throw new funnel_core_1.InvalidOperationError('Cannot connect node that is already bound to a list - call remove() first');
|
|
31
|
+
}
|
|
32
|
+
// find insertion target (node that comes AFTER the new node)
|
|
33
|
+
const { _head, _tail } = this;
|
|
34
|
+
let target = _head;
|
|
35
|
+
while (target && node.compareTo(target) > 0) {
|
|
36
|
+
target = target.next;
|
|
37
|
+
}
|
|
38
|
+
// handle case if we're at an extremity
|
|
39
|
+
if (!target) {
|
|
40
|
+
// make root if there's no head
|
|
41
|
+
if (!_head) {
|
|
42
|
+
this._head = node;
|
|
43
|
+
this._tail = node;
|
|
44
|
+
}
|
|
45
|
+
// or make the new tail
|
|
46
|
+
else if (_tail) {
|
|
47
|
+
_tail.next = node;
|
|
48
|
+
node.prev = _tail;
|
|
49
|
+
this._tail = node;
|
|
50
|
+
}
|
|
51
|
+
// or fail if the list is broken
|
|
52
|
+
else {
|
|
53
|
+
throw new funnel_core_1.IllegalStateError('[LinkedList.ts] list is broken');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// add before the first node if this is the new root
|
|
57
|
+
else if (!target.prev) {
|
|
58
|
+
target.prev = node;
|
|
59
|
+
node.next = target;
|
|
60
|
+
this._head = node;
|
|
61
|
+
}
|
|
62
|
+
// or add in between the list
|
|
63
|
+
else {
|
|
64
|
+
target.prev.next = node;
|
|
65
|
+
node.prev = target.prev;
|
|
66
|
+
target.prev = node;
|
|
67
|
+
node.next = target;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
remove(node) {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
const { _head, _tail } = this;
|
|
73
|
+
// blow up if the list is empty
|
|
74
|
+
if (!_head || !_tail) {
|
|
75
|
+
throw new funnel_core_1.InvalidOperationError('Cannot delete node from an empty list - call insert() first');
|
|
76
|
+
}
|
|
77
|
+
// handle if there is only one item in the list
|
|
78
|
+
if (_head === _tail) {
|
|
79
|
+
if (node === _head) {
|
|
80
|
+
delete this._head;
|
|
81
|
+
delete this._tail;
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// find deletion target
|
|
86
|
+
let target = this._head;
|
|
87
|
+
// traverse the list
|
|
88
|
+
while (target) {
|
|
89
|
+
if (target === node) {
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
target = target.next;
|
|
93
|
+
}
|
|
94
|
+
if (!target) {
|
|
95
|
+
console.warn('[LinkedList]: Unable to find the node');
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
// handle case if we're at an extremity
|
|
99
|
+
if (target === _head) {
|
|
100
|
+
this._head = (_a = this.head) === null || _a === void 0 ? void 0 : _a.next;
|
|
101
|
+
// if head is a node set the previous to undefined
|
|
102
|
+
if (this._head) {
|
|
103
|
+
delete this._head.prev;
|
|
104
|
+
}
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (target === _tail) {
|
|
108
|
+
this._tail = (_b = this.tail) === null || _b === void 0 ? void 0 : _b.prev;
|
|
109
|
+
delete this._tail.next;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
// or remove from in between the list
|
|
113
|
+
if (!target.prev || !target.next) {
|
|
114
|
+
throw new funnel_core_1.IllegalStateError('Node is not in between the list');
|
|
115
|
+
}
|
|
116
|
+
target.prev.next = target.next;
|
|
117
|
+
target.next.prev = target.prev;
|
|
118
|
+
delete target.next;
|
|
119
|
+
delete target.prev;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.SortedLinkedList = SortedLinkedList;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./FocusController"), exports);
|
|
18
|
+
__exportStar(require("./FocusArea"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFocusService = useFocusService;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const FocusContext_1 = require("./FocusContext");
|
|
7
|
+
function useFocusService() {
|
|
8
|
+
const focusContext = (0, react_1.useContext)(FocusContext_1.FocusContext);
|
|
9
|
+
// throw if trying to access focus service outside the focus context
|
|
10
|
+
if (!focusContext.focusService) {
|
|
11
|
+
throw new funnel_core_1.IllegalStateError('[useFocusService] FocusService must be accessed within focus context');
|
|
12
|
+
}
|
|
13
|
+
return focusContext.focusService;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './Carousel';
|
|
2
|
+
export * from './ClickObserver';
|
|
3
|
+
export * from './InfiniteScroller';
|
|
4
|
+
export * from './Loader';
|
|
5
|
+
export * from './Marquee';
|
|
6
|
+
export * from './Popup';
|
|
7
|
+
export * from './Tooltip';
|
|
8
|
+
export * from './UILevel';
|
|
9
|
+
export * from './backdrop';
|
|
10
|
+
export * from './focus';
|
|
11
|
+
export * from './modal/index';
|
|
12
|
+
export * from './paginator/index';
|
|
@@ -0,0 +1,28 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Carousel"), exports);
|
|
18
|
+
__exportStar(require("./ClickObserver"), exports);
|
|
19
|
+
__exportStar(require("./InfiniteScroller"), exports);
|
|
20
|
+
__exportStar(require("./Loader"), exports);
|
|
21
|
+
__exportStar(require("./Marquee"), exports);
|
|
22
|
+
__exportStar(require("./Popup"), exports);
|
|
23
|
+
__exportStar(require("./Tooltip"), exports);
|
|
24
|
+
__exportStar(require("./UILevel"), exports);
|
|
25
|
+
__exportStar(require("./backdrop"), exports);
|
|
26
|
+
__exportStar(require("./focus"), exports);
|
|
27
|
+
__exportStar(require("./modal/index"), exports);
|
|
28
|
+
__exportStar(require("./paginator/index"), exports);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Callback } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { Variant } from 'framer-motion';
|
|
3
|
+
import { PropsWithChildren } from 'react';
|
|
4
|
+
import { BackdropEvent } from '../backdrop/BackdropEvent';
|
|
5
|
+
import { UILevel } from '../UILevel';
|
|
6
|
+
export declare function Modal({ className, level, animation, open, onOpened: onOpenedRaw, onActiveChanged: onActiveChangedRaw, onClose, onClosed: onClosedRaw, disableDismiss, children }: Modal.Props): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare namespace Modal {
|
|
8
|
+
type Id = BackdropEvent.DependantId;
|
|
9
|
+
type Props = PropsWithChildren & {
|
|
10
|
+
className?: string;
|
|
11
|
+
level?: UILevel;
|
|
12
|
+
animation?: Animation;
|
|
13
|
+
open?: boolean;
|
|
14
|
+
onOpened?: Callback.Void;
|
|
15
|
+
onActiveChanged?: Callback<boolean>;
|
|
16
|
+
onClose?: Callback.Void;
|
|
17
|
+
onClosed?: Callback.Void;
|
|
18
|
+
disableDismiss?: boolean;
|
|
19
|
+
};
|
|
20
|
+
type Animation = {
|
|
21
|
+
initial: Variant;
|
|
22
|
+
open: Variant;
|
|
23
|
+
close: Variant;
|
|
24
|
+
};
|
|
25
|
+
namespace Animation {
|
|
26
|
+
type Variant = keyof Animation;
|
|
27
|
+
const slideUp: Animation;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
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.Modal = Modal;
|
|
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 framer_motion_1 = require("framer-motion");
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const react_dom_1 = require("react-dom");
|
|
13
|
+
const rxjs_1 = require("rxjs");
|
|
14
|
+
const backdrop_1 = require("../backdrop");
|
|
15
|
+
const ClickObserver_1 = require("../ClickObserver");
|
|
16
|
+
const ModalContext_1 = require("./ModalContext");
|
|
17
|
+
const ModalEvent_1 = require("./ModalEvent");
|
|
18
|
+
// component
|
|
19
|
+
function Modal({ className, level = 'l1', animation = Modal.Animation.slideUp, open = false, onOpened: onOpenedRaw = funnel_core_1.Fn.NoOp, onActiveChanged: onActiveChangedRaw = funnel_core_1.Fn.NoOp, onClose = funnel_core_1.Fn.NoOp, onClosed: onClosedRaw = funnel_core_1.Fn.NoOp, disableDismiss = false, children }) {
|
|
20
|
+
// bind context
|
|
21
|
+
const [active, setActive] = (0, react_1.useState)(false);
|
|
22
|
+
const { eventBus } = (0, react_1.useContext)(ModalContext_1.ModalContext);
|
|
23
|
+
const backdrop = (0, backdrop_1.useBackdrop)();
|
|
24
|
+
const openRef = (0, react_1.useRef)(false);
|
|
25
|
+
const onOpenedRef = (0, react_1.useRef)(onOpenedRaw);
|
|
26
|
+
onOpenedRef.current = onOpenedRaw;
|
|
27
|
+
const onActiveChangedRef = (0, react_1.useRef)(onActiveChangedRaw);
|
|
28
|
+
onActiveChangedRef.current = onActiveChangedRaw;
|
|
29
|
+
const onClosedRef = (0, react_1.useRef)(onClosedRaw);
|
|
30
|
+
onClosedRef.current = onClosedRaw;
|
|
31
|
+
// show/hide based on open change
|
|
32
|
+
(0, react_1.useEffect)(() => {
|
|
33
|
+
// raise open event
|
|
34
|
+
const { id } = backdrop;
|
|
35
|
+
if (open) {
|
|
36
|
+
// update ref
|
|
37
|
+
openRef.current = true;
|
|
38
|
+
// raise event
|
|
39
|
+
eventBus.next(ModalEvent_1.ModalEvent.Open.create(id, disableDismiss));
|
|
40
|
+
// raise backdrop event
|
|
41
|
+
backdrop.show({ level });
|
|
42
|
+
// activate
|
|
43
|
+
setActive(true);
|
|
44
|
+
}
|
|
45
|
+
// raise or close event (if it was actually opened)
|
|
46
|
+
else if (openRef.current) {
|
|
47
|
+
// deactivate
|
|
48
|
+
setActive(false);
|
|
49
|
+
// update ref
|
|
50
|
+
openRef.current = false;
|
|
51
|
+
// raise event
|
|
52
|
+
eventBus.next({
|
|
53
|
+
id,
|
|
54
|
+
action: 'close'
|
|
55
|
+
});
|
|
56
|
+
// raise backdrop event
|
|
57
|
+
backdrop.hide();
|
|
58
|
+
}
|
|
59
|
+
}, [eventBus, backdrop, level, open, disableDismiss]);
|
|
60
|
+
// listen to activations or dismiss
|
|
61
|
+
(0, react_1.useEffect)(() => {
|
|
62
|
+
// listen for events
|
|
63
|
+
const subscription = eventBus
|
|
64
|
+
// filter only relevant events
|
|
65
|
+
.pipe((0, rxjs_1.filter)(({ id, action }) => id === backdrop.id
|
|
66
|
+
&& (action === 'activate' || action === 'deactivate' || action === 'dismiss')))
|
|
67
|
+
.subscribe(({ action }) => {
|
|
68
|
+
// close on dismiss
|
|
69
|
+
if (action === 'dismiss') {
|
|
70
|
+
onClose();
|
|
71
|
+
}
|
|
72
|
+
// or activate/deactivate
|
|
73
|
+
else {
|
|
74
|
+
setActive(action === 'activate');
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
// unsubscribe on unmount
|
|
78
|
+
return () => subscription.unsubscribe();
|
|
79
|
+
}, [eventBus, backdrop, onClose]);
|
|
80
|
+
// raise activated event
|
|
81
|
+
(0, react_1.useEffect)(() => {
|
|
82
|
+
onActiveChangedRef.current(active);
|
|
83
|
+
}, [active]);
|
|
84
|
+
// skip for SSR
|
|
85
|
+
if (!funnel_core_1.Browser.available) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
// helpers
|
|
89
|
+
const onAnimationComplete = (definition) => {
|
|
90
|
+
if (definition === 'open') {
|
|
91
|
+
onOpenedRef.current();
|
|
92
|
+
}
|
|
93
|
+
else if (definition === 'close') {
|
|
94
|
+
onClosedRef.current();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
// render
|
|
98
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { mode: "wait", children: open &&
|
|
99
|
+
(0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { id: backdrop.id, className: (0, classnames_1.default)('Modal-wrap', {
|
|
100
|
+
'Modal-l1': level === 'l1',
|
|
101
|
+
'Modal-l2': level === 'l2',
|
|
102
|
+
'Modal-l3': level === 'l3',
|
|
103
|
+
}), variants: animation, initial: "initial", animate: "open", exit: "close", onAnimationComplete: definition => onAnimationComplete(definition), children: (0, jsx_runtime_1.jsx)(ClickObserver_1.ClickObserver, { disabled: disableDismiss, onClickOutside: onClose, children: (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(className, 'Modal-root'), children: children }) }) }, backdrop.id) }), document.body) }));
|
|
104
|
+
}
|
|
105
|
+
// extension
|
|
106
|
+
(function (Modal) {
|
|
107
|
+
let Animation;
|
|
108
|
+
(function (Animation) {
|
|
109
|
+
// slide up
|
|
110
|
+
Animation.slideUp = {
|
|
111
|
+
initial: {
|
|
112
|
+
opacity: 0,
|
|
113
|
+
y: 100
|
|
114
|
+
},
|
|
115
|
+
open: {
|
|
116
|
+
opacity: 1,
|
|
117
|
+
y: 0,
|
|
118
|
+
transition: {
|
|
119
|
+
ease: 'easeIn',
|
|
120
|
+
duration: 0.3,
|
|
121
|
+
when: 'beforeChildren'
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
close: {
|
|
125
|
+
opacity: 0,
|
|
126
|
+
y: 50,
|
|
127
|
+
transition: {
|
|
128
|
+
ease: 'easeOut',
|
|
129
|
+
duration: 0.15,
|
|
130
|
+
bounce: 0,
|
|
131
|
+
when: 'afterChildren'
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
})(Animation = Modal.Animation || (Modal.Animation = {}));
|
|
136
|
+
})(Modal || (exports.Modal = Modal = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export declare function ModalContainer({ children }: ModalContainer.Props): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
3
|
+
export declare namespace ModalContainer {
|
|
4
|
+
type Props = PropsWithChildren;
|
|
5
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModalContainer = ModalContainer;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const react_hotkeys_hook_1 = require("react-hotkeys-hook");
|
|
8
|
+
const rxjs_1 = require("rxjs");
|
|
9
|
+
const ModalContext_1 = require("./ModalContext");
|
|
10
|
+
const ModalEvent_1 = require("./ModalEvent");
|
|
11
|
+
// component
|
|
12
|
+
function ModalContainer({ children }) {
|
|
13
|
+
// bind context
|
|
14
|
+
const [modal, setModal] = (0, react_1.useState)();
|
|
15
|
+
const context = (0, react_1.useMemo)(() => ({
|
|
16
|
+
eventBus: new rxjs_1.Subject()
|
|
17
|
+
}), []);
|
|
18
|
+
const modalsRef = (0, react_1.useRef)([]);
|
|
19
|
+
// update modal state based on show/hide
|
|
20
|
+
(0, react_1.useEffect)(() => {
|
|
21
|
+
// subscribe to open/close events
|
|
22
|
+
const { eventBus } = context;
|
|
23
|
+
const subscription = eventBus
|
|
24
|
+
.pipe((0, rxjs_1.filter)(({ action }) => action === 'open' || action === 'close'))
|
|
25
|
+
.subscribe(event => {
|
|
26
|
+
// handle open
|
|
27
|
+
const { id: modalId, action } = event;
|
|
28
|
+
const modals = modalsRef.current;
|
|
29
|
+
if (ModalEvent_1.ModalEvent.Open.guard(event)) {
|
|
30
|
+
// deactivate current modal (if any)
|
|
31
|
+
const activeModal = getActiveModal(modals);
|
|
32
|
+
if (activeModal) {
|
|
33
|
+
eventBus.next(ModalEvent_1.ModalEvent.Deactivate.create(activeModal.id));
|
|
34
|
+
}
|
|
35
|
+
// track new modal
|
|
36
|
+
const config = {
|
|
37
|
+
id: modalId,
|
|
38
|
+
dismissible: !event.disableDismiss
|
|
39
|
+
};
|
|
40
|
+
modals.push(config);
|
|
41
|
+
// activate modal
|
|
42
|
+
setModal(config);
|
|
43
|
+
}
|
|
44
|
+
// handle close
|
|
45
|
+
else if (action === 'close') {
|
|
46
|
+
// find modal (fail if it's not tracked)
|
|
47
|
+
const modalIndex = modals.findIndex(({ id }) => id === modalId);
|
|
48
|
+
if (modalIndex < 0) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// untrack modal
|
|
52
|
+
modals.splice(modalIndex, 1);
|
|
53
|
+
// reactivate previous modal (if any)
|
|
54
|
+
const activeModal = getActiveModal(modals);
|
|
55
|
+
if (activeModal) {
|
|
56
|
+
// update state
|
|
57
|
+
setModal(activeModal);
|
|
58
|
+
// reactivate
|
|
59
|
+
eventBus.next(ModalEvent_1.ModalEvent.Activate.create(activeModal.id));
|
|
60
|
+
}
|
|
61
|
+
// or unlock ui
|
|
62
|
+
else {
|
|
63
|
+
setModal(undefined);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
// unmount
|
|
68
|
+
return () => subscription.unsubscribe();
|
|
69
|
+
}, [context]);
|
|
70
|
+
// handle lock/unlock of ui
|
|
71
|
+
(0, react_1.useEffect)(() => {
|
|
72
|
+
// handle ui lock
|
|
73
|
+
let unlock = undefined;
|
|
74
|
+
if (modal) {
|
|
75
|
+
unlock = funnel_core_1.Browser.lockFocus(`#${CSS.escape(modal.id)}`);
|
|
76
|
+
}
|
|
77
|
+
// unlock on unmount (if locked)
|
|
78
|
+
return () => unlock && unlock();
|
|
79
|
+
}, [modal]);
|
|
80
|
+
// close on escape
|
|
81
|
+
(0, react_hotkeys_hook_1.useHotkeys)('esc', () => {
|
|
82
|
+
// ignore if not dismissible
|
|
83
|
+
if (!modal || !modal.dismissible) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
// send dismiss event (modal should dismiss via 'close' event)
|
|
87
|
+
context.eventBus.next(ModalEvent_1.ModalEvent.Dismiss.create(modal.id));
|
|
88
|
+
}, {
|
|
89
|
+
enabled: (modal === null || modal === void 0 ? void 0 : modal.dismissible) === true,
|
|
90
|
+
enableOnFormTags: ['input', 'textarea']
|
|
91
|
+
}, [modal]);
|
|
92
|
+
// skip for SSR
|
|
93
|
+
if (!funnel_core_1.Browser.available) {
|
|
94
|
+
return children;
|
|
95
|
+
}
|
|
96
|
+
// render
|
|
97
|
+
return ((0, jsx_runtime_1.jsx)(ModalContext_1.ModalContext.Provider, { value: context, children: children }));
|
|
98
|
+
}
|
|
99
|
+
function getActiveModal(modals) {
|
|
100
|
+
const modalCount = modals.length;
|
|
101
|
+
return modalCount > 0
|
|
102
|
+
? modals[modalCount - 1]
|
|
103
|
+
: undefined;
|
|
104
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Modal } from './Modal';
|
|
2
|
+
export type ModalEvent = ModalEvent.Open | ModalEvent.Activate | ModalEvent.Deactivate | ModalEvent.Dismiss | ModalEvent.Close;
|
|
3
|
+
export declare namespace ModalEvent {
|
|
4
|
+
export type Action = 'open' | 'activate' | 'deactivate' | 'dismiss' | 'close';
|
|
5
|
+
interface Base {
|
|
6
|
+
id: Modal.Id;
|
|
7
|
+
action: ModalEvent.Action;
|
|
8
|
+
}
|
|
9
|
+
export interface Open extends Base {
|
|
10
|
+
action: 'open';
|
|
11
|
+
disableDismiss: boolean;
|
|
12
|
+
}
|
|
13
|
+
export namespace Open {
|
|
14
|
+
function guard(event: ModalEvent): event is Open;
|
|
15
|
+
function create(id: Modal.Id, disableDismiss?: boolean): Open;
|
|
16
|
+
}
|
|
17
|
+
export interface Activate extends Base {
|
|
18
|
+
action: 'activate';
|
|
19
|
+
}
|
|
20
|
+
export namespace Activate {
|
|
21
|
+
function create(id: Modal.Id): Activate;
|
|
22
|
+
}
|
|
23
|
+
export interface Deactivate extends Base {
|
|
24
|
+
action: 'deactivate';
|
|
25
|
+
}
|
|
26
|
+
export namespace Deactivate {
|
|
27
|
+
function create(id: Modal.Id): Deactivate;
|
|
28
|
+
}
|
|
29
|
+
export interface Dismiss extends Base {
|
|
30
|
+
action: 'dismiss';
|
|
31
|
+
}
|
|
32
|
+
export namespace Dismiss {
|
|
33
|
+
function create(id: Modal.Id): Dismiss;
|
|
34
|
+
}
|
|
35
|
+
export interface Close extends Base {
|
|
36
|
+
action: 'close';
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
39
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModalEvent = void 0;
|
|
4
|
+
// extension
|
|
5
|
+
var ModalEvent;
|
|
6
|
+
(function (ModalEvent) {
|
|
7
|
+
let Open;
|
|
8
|
+
(function (Open) {
|
|
9
|
+
// helpers
|
|
10
|
+
function guard(event) {
|
|
11
|
+
return event.action === 'open';
|
|
12
|
+
}
|
|
13
|
+
Open.guard = guard;
|
|
14
|
+
function create(id, disableDismiss = false) {
|
|
15
|
+
return {
|
|
16
|
+
id,
|
|
17
|
+
action: 'open',
|
|
18
|
+
disableDismiss
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
Open.create = create;
|
|
22
|
+
})(Open = ModalEvent.Open || (ModalEvent.Open = {}));
|
|
23
|
+
let Activate;
|
|
24
|
+
(function (Activate) {
|
|
25
|
+
function create(id) {
|
|
26
|
+
return {
|
|
27
|
+
id,
|
|
28
|
+
action: 'activate'
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
Activate.create = create;
|
|
32
|
+
})(Activate = ModalEvent.Activate || (ModalEvent.Activate = {}));
|
|
33
|
+
let Deactivate;
|
|
34
|
+
(function (Deactivate) {
|
|
35
|
+
function create(id) {
|
|
36
|
+
return {
|
|
37
|
+
id,
|
|
38
|
+
action: 'deactivate'
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
Deactivate.create = create;
|
|
42
|
+
})(Deactivate = ModalEvent.Deactivate || (ModalEvent.Deactivate = {}));
|
|
43
|
+
let Dismiss;
|
|
44
|
+
(function (Dismiss) {
|
|
45
|
+
function create(id) {
|
|
46
|
+
return {
|
|
47
|
+
id,
|
|
48
|
+
action: 'dismiss'
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
Dismiss.create = create;
|
|
52
|
+
})(Dismiss = ModalEvent.Dismiss || (ModalEvent.Dismiss = {}));
|
|
53
|
+
})(ModalEvent || (exports.ModalEvent = ModalEvent = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Modal"), exports);
|
|
18
|
+
__exportStar(require("./ModalContainer"), exports);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Transform } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { JSXElementConstructor, ReactNode } from 'react';
|
|
3
|
+
export declare function Paginator<TArgs, TResult extends Paginator.Page>({ manualLoad, loadOffset, query, pageSize, pageOffset, queryId, onQuery, ItemElement, emptyElement }: Paginator.Props<TArgs, TResult>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare namespace Paginator {
|
|
5
|
+
type State = 'ready' | 'loading' | 'complete' | 'error';
|
|
6
|
+
type QueryFn<TArgs, TResult extends Page> = Transform.Async<TArgs & Pagination, TResult>;
|
|
7
|
+
type Pagination = {
|
|
8
|
+
page: number;
|
|
9
|
+
pageSize: number;
|
|
10
|
+
};
|
|
11
|
+
type Page<TItem = any> = {
|
|
12
|
+
items: TItem[];
|
|
13
|
+
hasMore: boolean;
|
|
14
|
+
};
|
|
15
|
+
type PageItem<TResult extends Page> = TResult['items'][number];
|
|
16
|
+
type RenderFn<TResult> = Transform<TResult, ReactNode>;
|
|
17
|
+
type ItemElement<TItem> = JSXElementConstructor<ItemProps<TItem>>;
|
|
18
|
+
type ItemProps<TItem> = {
|
|
19
|
+
className?: string;
|
|
20
|
+
item: TItem;
|
|
21
|
+
};
|
|
22
|
+
type Props<TArgs, TResult extends Page> = {
|
|
23
|
+
manualLoad?: boolean;
|
|
24
|
+
loadOffset?: number;
|
|
25
|
+
pageSize: number;
|
|
26
|
+
pageOffset?: number;
|
|
27
|
+
query: TArgs;
|
|
28
|
+
queryId?: string;
|
|
29
|
+
onQuery: QueryFn<TArgs, TResult>;
|
|
30
|
+
ItemElement: ItemElement<PageItem<TResult>>;
|
|
31
|
+
emptyElement?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
}
|