@astral/ui 4.82.0 → 4.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_mocks/LoggerMock/LoggerMock.d.ts +16 -0
- package/_mocks/LoggerMock/LoggerMock.js +18 -0
- package/_mocks/LoggerMock/index.d.ts +1 -0
- package/_mocks/LoggerMock/index.js +1 -0
- package/components/ConfigProvider/ConfigProvider.d.ts +7 -1
- package/components/ConfigProvider/ConfigProvider.js +14 -8
- package/components/ConfirmDialog/ConfirmDialog.js +3 -1
- package/components/ConfirmDialog/constants.d.ts +4 -0
- package/components/ConfirmDialog/constants.js +5 -0
- package/components/ConfirmDialog/index.d.ts +1 -0
- package/components/ConfirmDialog/index.js +1 -0
- package/components/ConfirmDialog/public.d.ts +1 -0
- package/components/ConfirmDialog/public.js +1 -0
- package/components/ConfirmDialog/types.d.ts +1 -1
- package/components/DashboardLayout/Header/useLogic/useLogic.d.ts +1 -1
- package/components/NewPopover/NewPopover.d.ts +1 -1
- package/components/NewPopover/NewPopover.js +14 -5
- package/components/NewPopover/constants.d.ts +7 -0
- package/components/NewPopover/constants.js +11 -0
- package/components/NewPopover/styles.d.ts +4 -0
- package/components/NewPopover/styles.js +100 -4
- package/components/NewPopover/types.d.ts +13 -0
- package/components/NewPopover/useLogic/useLogic.d.ts +7 -3
- package/components/NewPopover/useLogic/useLogic.js +15 -1
- package/components/Onboarding/Onboarding.d.ts +35 -0
- package/components/Onboarding/Onboarding.js +56 -0
- package/components/Onboarding/constants.d.ts +34 -0
- package/components/Onboarding/constants.js +34 -0
- package/components/Onboarding/core/ActiveStepStore/ActiveStepStore.d.ts +50 -0
- package/components/Onboarding/core/ActiveStepStore/ActiveStepStore.js +63 -0
- package/components/Onboarding/core/ActiveStepStore/index.d.ts +1 -0
- package/components/Onboarding/core/ActiveStepStore/index.js +1 -0
- package/components/Onboarding/core/ExitController/ExitController.d.ts +48 -0
- package/components/Onboarding/core/ExitController/ExitController.js +59 -0
- package/components/Onboarding/core/ExitController/index.d.ts +1 -0
- package/components/Onboarding/core/ExitController/index.js +1 -0
- package/components/Onboarding/core/OnboardingTour/OnboardingTour.d.ts +103 -0
- package/components/Onboarding/core/OnboardingTour/OnboardingTour.js +283 -0
- package/components/Onboarding/core/OnboardingTour/index.d.ts +1 -0
- package/components/Onboarding/core/OnboardingTour/index.js +1 -0
- package/components/Onboarding/core/ProgressStorage/ProgressStorage.d.ts +24 -0
- package/components/Onboarding/core/ProgressStorage/ProgressStorage.js +62 -0
- package/components/Onboarding/core/ProgressStorage/index.d.ts +1 -0
- package/components/Onboarding/core/ProgressStorage/index.js +1 -0
- package/components/Onboarding/core/StepNavigator/StepNavigator.d.ts +28 -0
- package/components/Onboarding/core/StepNavigator/StepNavigator.js +73 -0
- package/components/Onboarding/core/StepNavigator/index.d.ts +1 -0
- package/components/Onboarding/core/StepNavigator/index.js +1 -0
- package/components/Onboarding/core/StepResolver/StepResolver.d.ts +19 -0
- package/components/Onboarding/core/StepResolver/StepResolver.js +49 -0
- package/components/Onboarding/core/StepResolver/index.d.ts +1 -0
- package/components/Onboarding/core/StepResolver/index.js +1 -0
- package/components/Onboarding/core/StepsController/StepsController.d.ts +16 -0
- package/components/Onboarding/core/StepsController/StepsController.js +35 -0
- package/components/Onboarding/core/StepsController/index.d.ts +1 -0
- package/components/Onboarding/core/StepsController/index.js +1 -0
- package/components/Onboarding/faker.d.ts +27 -0
- package/components/Onboarding/faker.js +79 -0
- package/components/Onboarding/index.d.ts +5 -0
- package/components/Onboarding/index.js +3 -0
- package/components/Onboarding/public.d.ts +5 -0
- package/components/Onboarding/public.js +3 -0
- package/components/Onboarding/services/LocalStorageSaveStrategy/LocalStorageSaveStrategy.d.ts +20 -0
- package/components/Onboarding/services/LocalStorageSaveStrategy/LocalStorageSaveStrategy.js +24 -0
- package/components/Onboarding/services/LocalStorageSaveStrategy/index.d.ts +1 -0
- package/components/Onboarding/services/LocalStorageSaveStrategy/index.js +1 -0
- package/components/Onboarding/types/config.d.ts +18 -0
- package/components/Onboarding/types/config.js +1 -0
- package/components/Onboarding/types/index.d.ts +4 -0
- package/components/Onboarding/types/index.js +4 -0
- package/components/Onboarding/types/progress.d.ts +28 -0
- package/components/Onboarding/types/progress.js +1 -0
- package/components/Onboarding/types/step.d.ts +144 -0
- package/components/Onboarding/types/step.js +1 -0
- package/components/Onboarding/types/tour.d.ts +168 -0
- package/components/Onboarding/types/tour.js +1 -0
- package/components/Onboarding/ui/ConfirmExit/ConfirmExit.d.ts +10 -0
- package/components/Onboarding/ui/ConfirmExit/ConfirmExit.js +6 -0
- package/components/Onboarding/ui/ConfirmExit/index.d.ts +2 -0
- package/components/Onboarding/ui/ConfirmExit/index.js +1 -0
- package/components/Onboarding/ui/ConfirmExit/styles.d.ts +30 -0
- package/components/Onboarding/ui/ConfirmExit/styles.js +11 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingContainer.d.ts +12 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingContainer.js +15 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/OnboardingErrorBoundary.d.ts +22 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/OnboardingErrorBoundary.js +20 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/index.d.ts +2 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/index.js +1 -0
- package/components/Onboarding/ui/OnboardingContainer/index.d.ts +1 -0
- package/components/Onboarding/ui/OnboardingContainer/index.js +1 -0
- package/components/Onboarding/ui/OnboardingContainer/useLogic/index.d.ts +1 -0
- package/components/Onboarding/ui/OnboardingContainer/useLogic/index.js +1 -0
- package/components/Onboarding/ui/OnboardingContainer/useLogic/useLogic.d.ts +10 -0
- package/components/Onboarding/ui/OnboardingContainer/useLogic/useLogic.js +14 -0
- package/components/Onboarding/ui/Overlay/Overlay.d.ts +29 -0
- package/components/Onboarding/ui/Overlay/Overlay.js +24 -0
- package/components/Onboarding/ui/Overlay/constants.d.ts +7 -0
- package/components/Onboarding/ui/Overlay/constants.js +8 -0
- package/components/Onboarding/ui/Overlay/index.d.ts +2 -0
- package/components/Onboarding/ui/Overlay/index.js +1 -0
- package/components/Onboarding/ui/Overlay/styles.d.ts +22 -0
- package/components/Onboarding/ui/Overlay/styles.js +57 -0
- package/components/Onboarding/ui/Overlay/useLogic/index.d.ts +1 -0
- package/components/Onboarding/ui/Overlay/useLogic/index.js +1 -0
- package/components/Onboarding/ui/Overlay/useLogic/useLogic.d.ts +13 -0
- package/components/Onboarding/ui/Overlay/useLogic/useLogic.js +10 -0
- package/components/Onboarding/ui/StepStrategy/StepStrategy.d.ts +6 -0
- package/components/Onboarding/ui/StepStrategy/StepStrategy.js +17 -0
- package/components/Onboarding/ui/StepStrategy/index.d.ts +1 -0
- package/components/Onboarding/ui/StepStrategy/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/HighlightStep.d.ts +6 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/HighlightStep.js +19 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/index.d.ts +2 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +25 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.js +56 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/index.d.ts +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.d.ts +12 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.js +37 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.d.ts +6 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.js +11 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/index.d.ts +2 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.d.ts +13 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.js +9 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/ProgressDots.d.ts +6 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/ProgressDots.js +15 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/constants.d.ts +4 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/constants.js +5 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/index.d.ts +2 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/styles.d.ts +9 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/styles.js +34 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/StepFooter.d.ts +9 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/StepFooter.js +18 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/constants.d.ts +4 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/constants.js +4 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/index.d.ts +2 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/styles.d.ts +21 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/styles.js +28 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/index.d.ts +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/useLogic.d.ts +16 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/useLogic.js +22 -0
- package/components/Onboarding/ui/StepStrategy/steps/types.d.ts +16 -0
- package/components/Onboarding/ui/StepStrategy/steps/types.js +1 -0
- package/components/Onboarding/ui/StepStrategy/useLogic/index.d.ts +1 -0
- package/components/Onboarding/ui/StepStrategy/useLogic/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/useLogic/useLogic.d.ts +47 -0
- package/components/Onboarding/ui/StepStrategy/useLogic/useLogic.js +51 -0
- package/components/Onboarding/ui/hooks/useActiveStep/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useActiveStep/index.js +1 -0
- package/components/Onboarding/ui/hooks/useActiveStep/useActiveStep.d.ts +6 -0
- package/components/Onboarding/ui/hooks/useActiveStep/useActiveStep.js +7 -0
- package/components/Onboarding/ui/hooks/useDelayedActiveStep/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useDelayedActiveStep/index.js +1 -0
- package/components/Onboarding/ui/hooks/useDelayedActiveStep/useDelayedActiveStep.d.ts +15 -0
- package/components/Onboarding/ui/hooks/useDelayedActiveStep/useDelayedActiveStep.js +19 -0
- package/components/Onboarding/ui/hooks/useFocusTrap/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useFocusTrap/index.js +1 -0
- package/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.d.ts +6 -0
- package/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.js +33 -0
- package/components/Onboarding/ui/hooks/useKeyboardNav/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useKeyboardNav/index.js +1 -0
- package/components/Onboarding/ui/hooks/useKeyboardNav/useKeyboardNav.d.ts +11 -0
- package/components/Onboarding/ui/hooks/useKeyboardNav/useKeyboardNav.js +62 -0
- package/components/Onboarding/ui/hooks/useStepTransition/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useStepTransition/index.js +1 -0
- package/components/Onboarding/ui/hooks/useStepTransition/useStepTransition.d.ts +30 -0
- package/components/Onboarding/ui/hooks/useStepTransition/useStepTransition.js +46 -0
- package/components/Onboarding/ui/hooks/useTargetAnchor/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useTargetAnchor/index.js +1 -0
- package/components/Onboarding/ui/hooks/useTargetAnchor/useTargetAnchor.d.ts +37 -0
- package/components/Onboarding/ui/hooks/useTargetAnchor/useTargetAnchor.js +56 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/index.js +1 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.d.ts +5 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.js +43 -0
- package/components/Onboarding/ui/hooks/useViewportSize/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useViewportSize/index.js +1 -0
- package/components/Onboarding/ui/hooks/useViewportSize/useViewportSize.d.ts +5 -0
- package/components/Onboarding/ui/hooks/useViewportSize/useViewportSize.js +14 -0
- package/components/Onboarding/ui/styles.d.ts +5 -0
- package/components/Onboarding/ui/styles.js +15 -0
- package/components/Onboarding/utils/createVirtualAnchor/createVirtualAnchor.d.ts +12 -0
- package/components/Onboarding/utils/createVirtualAnchor/createVirtualAnchor.js +6 -0
- package/components/Onboarding/utils/createVirtualAnchor/index.d.ts +1 -0
- package/components/Onboarding/utils/createVirtualAnchor/index.js +1 -0
- package/components/Onboarding/utils/geometry/index.d.ts +4 -0
- package/components/Onboarding/utils/geometry/index.js +4 -0
- package/components/Onboarding/utils/geometry/overlayPath/index.d.ts +1 -0
- package/components/Onboarding/utils/geometry/overlayPath/index.js +1 -0
- package/components/Onboarding/utils/geometry/overlayPath/overlayPath.d.ts +6 -0
- package/components/Onboarding/utils/geometry/overlayPath/overlayPath.js +29 -0
- package/components/Onboarding/utils/geometry/parseOffset/index.d.ts +1 -0
- package/components/Onboarding/utils/geometry/parseOffset/index.js +1 -0
- package/components/Onboarding/utils/geometry/parseOffset/parseOffset.d.ts +4 -0
- package/components/Onboarding/utils/geometry/parseOffset/parseOffset.js +5 -0
- package/components/Onboarding/utils/geometry/rect/index.d.ts +2 -0
- package/components/Onboarding/utils/geometry/rect/index.js +1 -0
- package/components/Onboarding/utils/geometry/rect/rect.d.ts +34 -0
- package/components/Onboarding/utils/geometry/rect/rect.js +60 -0
- package/components/Onboarding/utils/geometry/viewport/index.d.ts +2 -0
- package/components/Onboarding/utils/geometry/viewport/index.js +1 -0
- package/components/Onboarding/utils/geometry/viewport/viewport.d.ts +14 -0
- package/components/Onboarding/utils/geometry/viewport/viewport.js +10 -0
- package/components/Onboarding/utils/getScrollParents/getScrollParents.d.ts +7 -0
- package/components/Onboarding/utils/getScrollParents/getScrollParents.js +24 -0
- package/components/Onboarding/utils/getScrollParents/index.d.ts +1 -0
- package/components/Onboarding/utils/getScrollParents/index.js +1 -0
- package/components/Onboarding/utils/getTargetElement/getTargetElement.d.ts +4 -0
- package/components/Onboarding/utils/getTargetElement/getTargetElement.js +9 -0
- package/components/Onboarding/utils/getTargetElement/index.d.ts +1 -0
- package/components/Onboarding/utils/getTargetElement/index.js +1 -0
- package/components/Onboarding/utils/observeRemoval/index.d.ts +1 -0
- package/components/Onboarding/utils/observeRemoval/index.js +1 -0
- package/components/Onboarding/utils/observeRemoval/observeRemoval.d.ts +4 -0
- package/components/Onboarding/utils/observeRemoval/observeRemoval.js +13 -0
- package/components/Onboarding/utils/scrollIntoView/index.d.ts +1 -0
- package/components/Onboarding/utils/scrollIntoView/index.js +1 -0
- package/components/Onboarding/utils/scrollIntoView/scrollIntoView.d.ts +13 -0
- package/components/Onboarding/utils/scrollIntoView/scrollIntoView.js +85 -0
- package/components/Onboarding/utils/waitForElement/index.d.ts +2 -0
- package/components/Onboarding/utils/waitForElement/index.js +1 -0
- package/components/Onboarding/utils/waitForElement/waitForElement.d.ts +21 -0
- package/components/Onboarding/utils/waitForElement/waitForElement.js +45 -0
- package/components/Onboarding/validation/index.d.ts +1 -0
- package/components/Onboarding/validation/index.js +1 -0
- package/components/Onboarding/validation/validateTourConfig/index.d.ts +1 -0
- package/components/Onboarding/validation/validateTourConfig/index.js +1 -0
- package/components/Onboarding/validation/validateTourConfig/validateTourConfig.d.ts +12 -0
- package/components/Onboarding/validation/validateTourConfig/validateTourConfig.js +52 -0
- package/node/_mocks/LoggerMock/LoggerMock.d.ts +16 -0
- package/node/_mocks/LoggerMock/LoggerMock.js +23 -0
- package/node/_mocks/LoggerMock/index.d.ts +1 -0
- package/node/_mocks/LoggerMock/index.js +17 -0
- package/node/components/ConfigProvider/ConfigProvider.d.ts +7 -1
- package/node/components/ConfigProvider/ConfigProvider.js +13 -7
- package/node/components/ConfirmDialog/ConfirmDialog.js +3 -1
- package/node/components/ConfirmDialog/constants.d.ts +4 -0
- package/node/components/ConfirmDialog/constants.js +8 -0
- package/node/components/ConfirmDialog/index.d.ts +1 -0
- package/node/components/ConfirmDialog/index.js +3 -0
- package/node/components/ConfirmDialog/public.d.ts +1 -0
- package/node/components/ConfirmDialog/public.js +3 -0
- package/node/components/ConfirmDialog/types.d.ts +1 -1
- package/node/components/DashboardLayout/Header/useLogic/useLogic.d.ts +1 -1
- package/node/components/NewPopover/NewPopover.d.ts +1 -1
- package/node/components/NewPopover/NewPopover.js +12 -3
- package/node/components/NewPopover/constants.d.ts +7 -0
- package/node/components/NewPopover/constants.js +12 -1
- package/node/components/NewPopover/styles.d.ts +4 -0
- package/node/components/NewPopover/styles.js +101 -5
- package/node/components/NewPopover/types.d.ts +13 -0
- package/node/components/NewPopover/useLogic/useLogic.d.ts +7 -3
- package/node/components/NewPopover/useLogic/useLogic.js +15 -1
- package/node/components/Onboarding/Onboarding.d.ts +35 -0
- package/node/components/Onboarding/Onboarding.js +61 -0
- package/node/components/Onboarding/constants.d.ts +34 -0
- package/node/components/Onboarding/constants.js +37 -0
- package/node/components/Onboarding/core/ActiveStepStore/ActiveStepStore.d.ts +50 -0
- package/node/components/Onboarding/core/ActiveStepStore/ActiveStepStore.js +67 -0
- package/node/components/Onboarding/core/ActiveStepStore/index.d.ts +1 -0
- package/node/components/Onboarding/core/ActiveStepStore/index.js +17 -0
- package/node/components/Onboarding/core/ExitController/ExitController.d.ts +48 -0
- package/node/components/Onboarding/core/ExitController/ExitController.js +63 -0
- package/node/components/Onboarding/core/ExitController/index.d.ts +1 -0
- package/node/components/Onboarding/core/ExitController/index.js +17 -0
- package/node/components/Onboarding/core/OnboardingTour/OnboardingTour.d.ts +103 -0
- package/node/components/Onboarding/core/OnboardingTour/OnboardingTour.js +287 -0
- package/node/components/Onboarding/core/OnboardingTour/index.d.ts +1 -0
- package/node/components/Onboarding/core/OnboardingTour/index.js +5 -0
- package/node/components/Onboarding/core/ProgressStorage/ProgressStorage.d.ts +24 -0
- package/node/components/Onboarding/core/ProgressStorage/ProgressStorage.js +66 -0
- package/node/components/Onboarding/core/ProgressStorage/index.d.ts +1 -0
- package/node/components/Onboarding/core/ProgressStorage/index.js +17 -0
- package/node/components/Onboarding/core/StepNavigator/StepNavigator.d.ts +28 -0
- package/node/components/Onboarding/core/StepNavigator/StepNavigator.js +77 -0
- package/node/components/Onboarding/core/StepNavigator/index.d.ts +1 -0
- package/node/components/Onboarding/core/StepNavigator/index.js +17 -0
- package/node/components/Onboarding/core/StepResolver/StepResolver.d.ts +19 -0
- package/node/components/Onboarding/core/StepResolver/StepResolver.js +53 -0
- package/node/components/Onboarding/core/StepResolver/index.d.ts +1 -0
- package/node/components/Onboarding/core/StepResolver/index.js +17 -0
- package/node/components/Onboarding/core/StepsController/StepsController.d.ts +16 -0
- package/node/components/Onboarding/core/StepsController/StepsController.js +39 -0
- package/node/components/Onboarding/core/StepsController/index.d.ts +1 -0
- package/node/components/Onboarding/core/StepsController/index.js +17 -0
- package/node/components/Onboarding/faker.d.ts +27 -0
- package/node/components/Onboarding/faker.js +88 -0
- package/node/components/Onboarding/index.d.ts +5 -0
- package/node/components/Onboarding/index.js +9 -0
- package/node/components/Onboarding/public.d.ts +5 -0
- package/node/components/Onboarding/public.js +9 -0
- package/node/components/Onboarding/services/LocalStorageSaveStrategy/LocalStorageSaveStrategy.d.ts +20 -0
- package/node/components/Onboarding/services/LocalStorageSaveStrategy/LocalStorageSaveStrategy.js +29 -0
- package/node/components/Onboarding/services/LocalStorageSaveStrategy/index.d.ts +1 -0
- package/node/components/Onboarding/services/LocalStorageSaveStrategy/index.js +17 -0
- package/node/components/Onboarding/types/config.d.ts +18 -0
- package/node/components/Onboarding/types/config.js +2 -0
- package/node/components/Onboarding/types/index.d.ts +4 -0
- package/node/components/Onboarding/types/index.js +20 -0
- package/node/components/Onboarding/types/progress.d.ts +28 -0
- package/node/components/Onboarding/types/progress.js +2 -0
- package/node/components/Onboarding/types/step.d.ts +144 -0
- package/node/components/Onboarding/types/step.js +2 -0
- package/node/components/Onboarding/types/tour.d.ts +168 -0
- package/node/components/Onboarding/types/tour.js +2 -0
- package/node/components/Onboarding/ui/ConfirmExit/ConfirmExit.d.ts +10 -0
- package/node/components/Onboarding/ui/ConfirmExit/ConfirmExit.js +10 -0
- package/node/components/Onboarding/ui/ConfirmExit/index.d.ts +2 -0
- package/node/components/Onboarding/ui/ConfirmExit/index.js +5 -0
- package/node/components/Onboarding/ui/ConfirmExit/styles.d.ts +30 -0
- package/node/components/Onboarding/ui/ConfirmExit/styles.js +14 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingContainer.d.ts +12 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingContainer.js +19 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/OnboardingErrorBoundary.d.ts +22 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/OnboardingErrorBoundary.js +24 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/index.d.ts +2 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/index.js +5 -0
- package/node/components/Onboarding/ui/OnboardingContainer/index.d.ts +1 -0
- package/node/components/Onboarding/ui/OnboardingContainer/index.js +5 -0
- package/node/components/Onboarding/ui/OnboardingContainer/useLogic/index.d.ts +1 -0
- package/node/components/Onboarding/ui/OnboardingContainer/useLogic/index.js +5 -0
- package/node/components/Onboarding/ui/OnboardingContainer/useLogic/useLogic.d.ts +10 -0
- package/node/components/Onboarding/ui/OnboardingContainer/useLogic/useLogic.js +18 -0
- package/node/components/Onboarding/ui/Overlay/Overlay.d.ts +29 -0
- package/node/components/Onboarding/ui/Overlay/Overlay.js +28 -0
- package/node/components/Onboarding/ui/Overlay/constants.d.ts +7 -0
- package/node/components/Onboarding/ui/Overlay/constants.js +11 -0
- package/node/components/Onboarding/ui/Overlay/index.d.ts +2 -0
- package/node/components/Onboarding/ui/Overlay/index.js +5 -0
- package/node/components/Onboarding/ui/Overlay/styles.d.ts +22 -0
- package/node/components/Onboarding/ui/Overlay/styles.js +60 -0
- package/node/components/Onboarding/ui/Overlay/useLogic/index.d.ts +1 -0
- package/node/components/Onboarding/ui/Overlay/useLogic/index.js +5 -0
- package/node/components/Onboarding/ui/Overlay/useLogic/useLogic.d.ts +13 -0
- package/node/components/Onboarding/ui/Overlay/useLogic/useLogic.js +14 -0
- package/node/components/Onboarding/ui/StepStrategy/StepStrategy.d.ts +6 -0
- package/node/components/Onboarding/ui/StepStrategy/StepStrategy.js +21 -0
- package/node/components/Onboarding/ui/StepStrategy/index.d.ts +1 -0
- package/node/components/Onboarding/ui/StepStrategy/index.js +17 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/HighlightStep.d.ts +6 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/HighlightStep.js +23 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/index.d.ts +2 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +25 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.js +59 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/index.d.ts +1 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.d.ts +12 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.js +41 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.d.ts +6 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.js +15 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/index.d.ts +2 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.d.ts +13 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.js +12 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/ProgressDots.d.ts +6 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/ProgressDots.js +19 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/constants.d.ts +4 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/constants.js +8 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/index.d.ts +2 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/styles.d.ts +9 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/styles.js +37 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/StepFooter.d.ts +9 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/StepFooter.js +22 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/constants.d.ts +4 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/constants.js +7 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/index.d.ts +2 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/styles.d.ts +21 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/styles.js +31 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/index.d.ts +1 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/useLogic.d.ts +16 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/useLogic.js +26 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/types.d.ts +16 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/types.js +2 -0
- package/node/components/Onboarding/ui/StepStrategy/useLogic/index.d.ts +1 -0
- package/node/components/Onboarding/ui/StepStrategy/useLogic/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/useLogic/useLogic.d.ts +47 -0
- package/node/components/Onboarding/ui/StepStrategy/useLogic/useLogic.js +55 -0
- package/node/components/Onboarding/ui/hooks/useActiveStep/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useActiveStep/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useActiveStep/useActiveStep.d.ts +6 -0
- package/node/components/Onboarding/ui/hooks/useActiveStep/useActiveStep.js +11 -0
- package/node/components/Onboarding/ui/hooks/useDelayedActiveStep/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useDelayedActiveStep/index.js +17 -0
- package/node/components/Onboarding/ui/hooks/useDelayedActiveStep/useDelayedActiveStep.d.ts +15 -0
- package/node/components/Onboarding/ui/hooks/useDelayedActiveStep/useDelayedActiveStep.js +23 -0
- package/node/components/Onboarding/ui/hooks/useFocusTrap/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useFocusTrap/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.d.ts +6 -0
- package/node/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.js +37 -0
- package/node/components/Onboarding/ui/hooks/useKeyboardNav/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useKeyboardNav/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useKeyboardNav/useKeyboardNav.d.ts +11 -0
- package/node/components/Onboarding/ui/hooks/useKeyboardNav/useKeyboardNav.js +66 -0
- package/node/components/Onboarding/ui/hooks/useStepTransition/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useStepTransition/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useStepTransition/useStepTransition.d.ts +30 -0
- package/node/components/Onboarding/ui/hooks/useStepTransition/useStepTransition.js +50 -0
- package/node/components/Onboarding/ui/hooks/useTargetAnchor/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useTargetAnchor/index.js +17 -0
- package/node/components/Onboarding/ui/hooks/useTargetAnchor/useTargetAnchor.d.ts +37 -0
- package/node/components/Onboarding/ui/hooks/useTargetAnchor/useTargetAnchor.js +60 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.d.ts +5 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.js +47 -0
- package/node/components/Onboarding/ui/hooks/useViewportSize/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useViewportSize/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useViewportSize/useViewportSize.d.ts +5 -0
- package/node/components/Onboarding/ui/hooks/useViewportSize/useViewportSize.js +18 -0
- package/node/components/Onboarding/ui/styles.d.ts +5 -0
- package/node/components/Onboarding/ui/styles.js +19 -0
- package/node/components/Onboarding/utils/createVirtualAnchor/createVirtualAnchor.d.ts +12 -0
- package/node/components/Onboarding/utils/createVirtualAnchor/createVirtualAnchor.js +10 -0
- package/node/components/Onboarding/utils/createVirtualAnchor/index.d.ts +1 -0
- package/node/components/Onboarding/utils/createVirtualAnchor/index.js +17 -0
- package/node/components/Onboarding/utils/geometry/index.d.ts +4 -0
- package/node/components/Onboarding/utils/geometry/index.js +20 -0
- package/node/components/Onboarding/utils/geometry/overlayPath/index.d.ts +1 -0
- package/node/components/Onboarding/utils/geometry/overlayPath/index.js +5 -0
- package/node/components/Onboarding/utils/geometry/overlayPath/overlayPath.d.ts +6 -0
- package/node/components/Onboarding/utils/geometry/overlayPath/overlayPath.js +33 -0
- package/node/components/Onboarding/utils/geometry/parseOffset/index.d.ts +1 -0
- package/node/components/Onboarding/utils/geometry/parseOffset/index.js +5 -0
- package/node/components/Onboarding/utils/geometry/parseOffset/parseOffset.d.ts +4 -0
- package/node/components/Onboarding/utils/geometry/parseOffset/parseOffset.js +9 -0
- package/node/components/Onboarding/utils/geometry/rect/index.d.ts +2 -0
- package/node/components/Onboarding/utils/geometry/rect/index.js +9 -0
- package/node/components/Onboarding/utils/geometry/rect/rect.d.ts +34 -0
- package/node/components/Onboarding/utils/geometry/rect/rect.js +69 -0
- package/node/components/Onboarding/utils/geometry/viewport/index.d.ts +2 -0
- package/node/components/Onboarding/utils/geometry/viewport/index.js +5 -0
- package/node/components/Onboarding/utils/geometry/viewport/viewport.d.ts +14 -0
- package/node/components/Onboarding/utils/geometry/viewport/viewport.js +14 -0
- package/node/components/Onboarding/utils/getScrollParents/getScrollParents.d.ts +7 -0
- package/node/components/Onboarding/utils/getScrollParents/getScrollParents.js +28 -0
- package/node/components/Onboarding/utils/getScrollParents/index.d.ts +1 -0
- package/node/components/Onboarding/utils/getScrollParents/index.js +5 -0
- package/node/components/Onboarding/utils/getTargetElement/getTargetElement.d.ts +4 -0
- package/node/components/Onboarding/utils/getTargetElement/getTargetElement.js +13 -0
- package/node/components/Onboarding/utils/getTargetElement/index.d.ts +1 -0
- package/node/components/Onboarding/utils/getTargetElement/index.js +5 -0
- package/node/components/Onboarding/utils/observeRemoval/index.d.ts +1 -0
- package/node/components/Onboarding/utils/observeRemoval/index.js +17 -0
- package/node/components/Onboarding/utils/observeRemoval/observeRemoval.d.ts +4 -0
- package/node/components/Onboarding/utils/observeRemoval/observeRemoval.js +17 -0
- package/node/components/Onboarding/utils/scrollIntoView/index.d.ts +1 -0
- package/node/components/Onboarding/utils/scrollIntoView/index.js +5 -0
- package/node/components/Onboarding/utils/scrollIntoView/scrollIntoView.d.ts +13 -0
- package/node/components/Onboarding/utils/scrollIntoView/scrollIntoView.js +89 -0
- package/node/components/Onboarding/utils/waitForElement/index.d.ts +2 -0
- package/node/components/Onboarding/utils/waitForElement/index.js +5 -0
- package/node/components/Onboarding/utils/waitForElement/waitForElement.d.ts +21 -0
- package/node/components/Onboarding/utils/waitForElement/waitForElement.js +49 -0
- package/node/components/Onboarding/validation/index.d.ts +1 -0
- package/node/components/Onboarding/validation/index.js +6 -0
- package/node/components/Onboarding/validation/validateTourConfig/index.d.ts +1 -0
- package/node/components/Onboarding/validation/validateTourConfig/index.js +6 -0
- package/node/components/Onboarding/validation/validateTourConfig/validateTourConfig.d.ts +12 -0
- package/node/components/Onboarding/validation/validateTourConfig/validateTourConfig.js +80 -0
- package/node/services/Logger/Logger.d.ts +45 -0
- package/node/services/Logger/Logger.js +72 -0
- package/node/services/Logger/index.d.ts +10 -0
- package/node/services/Logger/index.js +17 -0
- package/package.json +3 -2
- package/services/Logger/Logger.d.ts +45 -0
- package/services/Logger/Logger.js +68 -0
- package/services/Logger/index.d.ts +10 -0
- package/services/Logger/index.js +12 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { styled } from '../../../styled';
|
|
2
|
+
import { ONBOARDING_Z_INDEX_OFFSET } from '../../constants';
|
|
3
|
+
import { overlayClassnames } from './constants';
|
|
4
|
+
/**
|
|
5
|
+
* Контейнер overlay с затуханием при открытии/закрытии.
|
|
6
|
+
*/
|
|
7
|
+
export const OverlayRoot = styled.svg `
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
|
|
10
|
+
position: fixed;
|
|
11
|
+
z-index: ${({ theme }) => theme.zIndex.tooltip + ONBOARDING_Z_INDEX_OFFSET.base};
|
|
12
|
+
inset: 0;
|
|
13
|
+
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
|
|
17
|
+
opacity: 1;
|
|
18
|
+
|
|
19
|
+
transition: opacity ${({ theme }) => theme.transitions.duration.enteringScreen}ms
|
|
20
|
+
${({ theme }) => theme.transitions.easing.easeInOut};
|
|
21
|
+
|
|
22
|
+
&.${overlayClassnames.hidden} {
|
|
23
|
+
opacity: 0;
|
|
24
|
+
|
|
25
|
+
.${overlayClassnames.backdrop}, .${overlayClassnames.holeBlocker} {
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
/**
|
|
31
|
+
* Затемненная часть с hole, перехватывает клики.
|
|
32
|
+
*/
|
|
33
|
+
export const Backdrop = styled.path `
|
|
34
|
+
pointer-events: auto;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
|
|
37
|
+
fill: ${({ theme }) => theme.palette.background.modalShadow};
|
|
38
|
+
|
|
39
|
+
.${overlayClassnames.holeMoving} & {
|
|
40
|
+
transition: d ${({ theme }) => theme.transitions.duration.standard}ms
|
|
41
|
+
${({ theme }) => theme.transitions.easing.easeInOut};
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
/**
|
|
45
|
+
* Блокатор кликов для неинтерактивных шагов.
|
|
46
|
+
*/
|
|
47
|
+
export const HoleBlocker = styled.rect `
|
|
48
|
+
pointer-events: auto;
|
|
49
|
+
|
|
50
|
+
fill: transparent;
|
|
51
|
+
|
|
52
|
+
.${overlayClassnames.holeMoving} & {
|
|
53
|
+
transition-timing-function: ${({ theme }) => theme.transitions.easing.easeInOut};
|
|
54
|
+
transition-duration: ${({ theme }) => theme.transitions.duration.standard}ms;
|
|
55
|
+
transition-property: x, y, width, height, rx;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useLogic } from './useLogic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useLogic } from './useLogic';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Rect, type Viewport } from '../../../utils/geometry';
|
|
2
|
+
export type UseLogicResult = {
|
|
3
|
+
viewport: Viewport;
|
|
4
|
+
/**
|
|
5
|
+
* Hole, обрезанный по viewport (null для standalone-шага).
|
|
6
|
+
*/
|
|
7
|
+
clampedHole: Rect | null;
|
|
8
|
+
/**
|
|
9
|
+
* SVG-путь overlay.
|
|
10
|
+
*/
|
|
11
|
+
path: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const useLogic: (hole: Rect | null) => UseLogicResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DEFAULT_HIGHLIGHT_RADIUS } from '../../../constants';
|
|
2
|
+
import { buildOverlayPath, clampToViewport, } from '../../../utils/geometry';
|
|
3
|
+
import { useViewportSize } from '../../hooks/useViewportSize';
|
|
4
|
+
export const useLogic = (hole) => {
|
|
5
|
+
const viewport = useViewportSize();
|
|
6
|
+
const clampedHole = hole ? clampToViewport(hole, viewport) : null;
|
|
7
|
+
// Путь строится по необрезанной hole для скруглённых углов у края.
|
|
8
|
+
const path = buildOverlayPath(viewport, hole, DEFAULT_HIGHLIGHT_RADIUS);
|
|
9
|
+
return { viewport, clampedHole, path };
|
|
10
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type StepViewProps } from './steps/types';
|
|
2
|
+
export type StepStrategyProps = Omit<StepViewProps, 'geometry'>;
|
|
3
|
+
/**
|
|
4
|
+
* Стратегия отрисовки по типу шага, единый overlay для всего тура.
|
|
5
|
+
*/
|
|
6
|
+
export declare const StepStrategy: ({ activeStep, isClosing }: StepStrategyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Overlay } from '../Overlay';
|
|
3
|
+
import { HighlightStep } from './steps/HighlightStep';
|
|
4
|
+
import { StandaloneStep } from './steps/StandaloneStep';
|
|
5
|
+
import { useLogic } from './useLogic';
|
|
6
|
+
const STEP_VIEWS = {
|
|
7
|
+
standalone: StandaloneStep,
|
|
8
|
+
highlight: HighlightStep,
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Стратегия отрисовки по типу шага, единый overlay для всего тура.
|
|
12
|
+
*/
|
|
13
|
+
export const StepStrategy = ({ activeStep, isClosing }) => {
|
|
14
|
+
const { geometry, shouldShowOverlay, isVisible, isHoleMoving, onOverlayClose, } = useLogic(activeStep, isClosing);
|
|
15
|
+
const StepView = STEP_VIEWS[activeStep.step.type];
|
|
16
|
+
return (_jsxs(_Fragment, { children: [shouldShowOverlay && (_jsx(Overlay, { hole: geometry.hole, isInteractive: activeStep.isInteractive, isVisible: isVisible, isHoleMoving: isHoleMoving, onClose: onOverlayClose })), _jsx(StepView, { activeStep: activeStep, isClosing: isClosing, geometry: geometry })] }));
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StepStrategy';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StepStrategy';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type StepViewProps } from '../types';
|
|
2
|
+
export type HighlightStepProps = StepViewProps;
|
|
3
|
+
/**
|
|
4
|
+
* Шаг с подсветкой: popover рядом с hole.
|
|
5
|
+
*/
|
|
6
|
+
export declare const HighlightStep: ({ activeStep, isClosing, geometry, }: HighlightStepProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { CrossOutlineMd } from '../../../../../../icons/CrossOutlineMd';
|
|
3
|
+
import { Typography } from '../../../../../Typography';
|
|
4
|
+
import { StepFooter } from '../StepFooter';
|
|
5
|
+
import { CloseButton, Content, PopoverBody, StepPopover } from './styles';
|
|
6
|
+
import { useLogic } from './useLogic';
|
|
7
|
+
/**
|
|
8
|
+
* Шаг с подсветкой: popover рядом с hole.
|
|
9
|
+
*/
|
|
10
|
+
export const HighlightStep = ({ activeStep, isClosing, geometry, }) => {
|
|
11
|
+
const { step } = activeStep;
|
|
12
|
+
const { anchorEl } = geometry;
|
|
13
|
+
const { isOpen, shouldShowPopover, setPopoverNode, handleClose } = useLogic(activeStep, isClosing, geometry);
|
|
14
|
+
// Без якоря popover не рисуем.
|
|
15
|
+
if (!anchorEl) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return (_jsx(_Fragment, { children: shouldShowPopover && (_jsx(StepPopover, { isOpen: isOpen, disableAutoFocus: true, hasArrow: true, anchorEl: anchorEl, placement: step.position, children: _jsxs(PopoverBody, { ref: setPopoverNode, tabIndex: -1, children: [_jsx(CloseButton, { variant: "text", onClick: handleClose, "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", children: _jsx(CrossOutlineMd, {}) }), _jsxs(Content, { children: [step.title && (_jsx(Typography, { component: "div", variant: "h5", children: step.title })), step.content && (_jsx(Typography, { component: "div", variant: "body1", color: "grey", colorIntensity: "900", children: step.content }))] }), _jsx(StepFooter, { activeStep: activeStep })] }) })) }));
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HighlightStep } from './HighlightStep';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Popover шага, z-index над overlay, быстрое закрытие.
|
|
4
|
+
*/
|
|
5
|
+
export declare const StepPopover: import("../../../../../styled").StyledComponent<import("../../../../../NewPopover").NewPopoverProps & {
|
|
6
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
7
|
+
}, {}, {}>;
|
|
8
|
+
export declare const PopoverBody: import("../../../../../styled").StyledComponent<{
|
|
9
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
11
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export declare const CloseButton: import("../../../../../styled").StyledComponent<Omit<import("../../../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
13
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
14
|
+
loading?: boolean | undefined;
|
|
15
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
16
|
+
component?: import("react").ElementType | undefined;
|
|
17
|
+
selected?: boolean | undefined;
|
|
18
|
+
size?: "large" | "medium" | undefined;
|
|
19
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
20
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
export declare const Content: import("../../../../../styled").StyledComponent<{
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
25
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { IconButton } from '../../../../../IconButton';
|
|
2
|
+
import { NewPopover } from '../../../../../NewPopover';
|
|
3
|
+
import { popoverClassnames } from '../../../../../NewPopover/constants';
|
|
4
|
+
import { styled } from '../../../../../styled';
|
|
5
|
+
import { ONBOARDING_Z_INDEX_OFFSET } from '../../../../constants';
|
|
6
|
+
/**
|
|
7
|
+
* Popover шага, z-index над overlay, быстрое закрытие.
|
|
8
|
+
*/
|
|
9
|
+
export const StepPopover = styled(NewPopover) `
|
|
10
|
+
&& {
|
|
11
|
+
z-index: ${({ theme }) => theme.zIndex.tooltip + ONBOARDING_Z_INDEX_OFFSET.popover};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.${popoverClassnames.innerContainer} {
|
|
15
|
+
border-radius: calc(${({ theme }) => theme.shape.medium} * 2);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.${popoverClassnames.animatedWrapper}:not(.${popoverClassnames.animatedWrapperOpen}) {
|
|
19
|
+
animation-duration: ${({ theme }) => theme.transitions.duration.shortest}ms;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
export const PopoverBody = styled.div `
|
|
23
|
+
position: relative;
|
|
24
|
+
|
|
25
|
+
width: 400px;
|
|
26
|
+
padding: ${({ theme }) => theme.spacing(6)};
|
|
27
|
+
|
|
28
|
+
border-radius: calc(${({ theme }) => theme.shape.medium} * 2);
|
|
29
|
+
|
|
30
|
+
/* Фокус-трап ставит фокус на контейнер, браузерную рамку убираем. */
|
|
31
|
+
&:focus {
|
|
32
|
+
outline: none;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
export const CloseButton = styled(IconButton) `
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: ${({ theme }) => theme.spacing(6)};
|
|
38
|
+
right: ${({ theme }) => theme.spacing(6)};
|
|
39
|
+
`;
|
|
40
|
+
export const Content = styled.div `
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: ${({ theme }) => theme.spacing(4)};
|
|
44
|
+
|
|
45
|
+
margin-bottom: ${({ theme }) => theme.spacing(6)};
|
|
46
|
+
|
|
47
|
+
&:last-child {
|
|
48
|
+
margin-bottom: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Резерв справа под крестик — только у верхнего элемента (заголовок, а если
|
|
52
|
+
его нет — текст) */
|
|
53
|
+
& > *:first-of-type {
|
|
54
|
+
padding-right: ${({ theme }) => theme.spacing(10)};
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useLogic } from './useLogic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useLogic } from './useLogic';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ActiveStepState } from '../../../../../types';
|
|
2
|
+
import { type OverlayGeometry } from '../../../useLogic';
|
|
3
|
+
export type UseLogicResult = {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
shouldShowPopover: boolean;
|
|
6
|
+
setPopoverNode: (node: HTMLElement | null) => void;
|
|
7
|
+
handleClose: () => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Логика highlight-шага: задержка popover, фокус-трап, закрытие.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useLogic: (activeStep: ActiveStepState, isClosing: boolean, geometry: OverlayGeometry) => UseLogicResult;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { useTheme } from '../../../../../../theme/hooks/useTheme';
|
|
3
|
+
import { useFocusTrap } from '../../../../hooks/useFocusTrap';
|
|
4
|
+
/**
|
|
5
|
+
* Логика highlight-шага: задержка popover, фокус-трап, закрытие.
|
|
6
|
+
*/
|
|
7
|
+
export const useLogic = (activeStep, isClosing, geometry) => {
|
|
8
|
+
const { isInteractive, isConfirming } = activeStep;
|
|
9
|
+
const { anchorEl, element, isTransitioning } = geometry;
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const isOpen = !isClosing;
|
|
12
|
+
// Задержка до появления popover после готовности hole.
|
|
13
|
+
const isHoleReady = anchorEl !== null;
|
|
14
|
+
const [isEntered, setIsEntered] = useState(false);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (isEntered || !isHoleReady) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const timer = setTimeout(() => setIsEntered(true), theme.transitions.duration.shortest);
|
|
20
|
+
return () => clearTimeout(timer);
|
|
21
|
+
}, [isEntered, isHoleReady]);
|
|
22
|
+
const [popoverNode, setPopoverNode] = useState(null);
|
|
23
|
+
const trapNodes = useMemo(() => [popoverNode, isInteractive ? element : null], [popoverNode, isInteractive, element]);
|
|
24
|
+
// Трап выключен при закрытии/подтверждении.
|
|
25
|
+
useFocusTrap(trapNodes, isOpen && !isConfirming);
|
|
26
|
+
const handleClose = useCallback(() => {
|
|
27
|
+
activeStep.requestClose();
|
|
28
|
+
}, [activeStep]);
|
|
29
|
+
// При переходе popover размонтируется; при закрытии — grow-out.
|
|
30
|
+
const shouldShowPopover = !isConfirming && !isTransitioning && isEntered;
|
|
31
|
+
return {
|
|
32
|
+
isOpen,
|
|
33
|
+
shouldShowPopover,
|
|
34
|
+
setPopoverNode,
|
|
35
|
+
handleClose,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DialogContent } from '../../../../../DialogContent';
|
|
3
|
+
import { StepFooter } from '../StepFooter';
|
|
4
|
+
import { Footer, StepDialog } from './styles';
|
|
5
|
+
/**
|
|
6
|
+
* Standalone шаг-модалка.
|
|
7
|
+
*/
|
|
8
|
+
export const StandaloneStep = ({ activeStep, isClosing, }) => {
|
|
9
|
+
const { step, isConfirming, requestClose } = activeStep;
|
|
10
|
+
return (_jsxs(StepDialog, { open: !isConfirming && !isClosing, title: step.title, onClose: requestClose, size: step.dialogSize, disableAutoFocus: true, children: [_jsx(DialogContent, { children: step.content }), _jsx(Footer, { children: _jsx(StepFooter, { activeStep: activeStep }) })] }));
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StandaloneStep } from './StandaloneStep';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StepDialog: import("../../../../../styled").StyledComponent<import("../../../../..").WithoutEmotionSpecific<Omit<import("@mui/material").DialogProps, "title" | "maxWidth">> & {
|
|
3
|
+
title?: string | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>[] | undefined;
|
|
4
|
+
disableBackdropClick?: boolean | undefined;
|
|
5
|
+
size?: import("../../../../../Dialog").DialogSize | undefined;
|
|
6
|
+
headerContent?: import("react").ReactNode;
|
|
7
|
+
} & {
|
|
8
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export declare const Footer: import("../../../../../styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Dialog } from '../../../../../Dialog';
|
|
2
|
+
import { styled } from '../../../../../styled';
|
|
3
|
+
import { onboardingModalSurface } from '../../../styles';
|
|
4
|
+
export const StepDialog = styled(Dialog) `
|
|
5
|
+
${({ theme }) => onboardingModalSurface(theme)};
|
|
6
|
+
`;
|
|
7
|
+
export const Footer = styled.div `
|
|
8
|
+
padding: ${({ theme }) => theme.spacing(0, 6, 6)};
|
|
9
|
+
`;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ActiveStepState } from '../../../../../types';
|
|
2
|
+
export type ProgressDotsProps = Pick<ActiveStepState, 'position' | 'total' | 'onSelectStep'>;
|
|
3
|
+
/**
|
|
4
|
+
* Индикатор прогресса точками
|
|
5
|
+
*/
|
|
6
|
+
export declare const ProgressDots: ({ position, total, onSelectStep, }: ProgressDotsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from '../../../../../../utils/cva';
|
|
3
|
+
import { progressDotClassnames } from './constants';
|
|
4
|
+
import { Dot, Dots } from './styles';
|
|
5
|
+
const dotCva = cva(progressDotClassnames.root, {
|
|
6
|
+
variants: {
|
|
7
|
+
isActive: {
|
|
8
|
+
true: progressDotClassnames.active,
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Индикатор прогресса точками
|
|
14
|
+
*/
|
|
15
|
+
export const ProgressDots = ({ position, total, onSelectStep, }) => (_jsx(Dots, { children: Array.from({ length: total }, (_, index) => (_jsx(Dot, { type: "button", className: dotCva({ isActive: index === position }), "aria-label": `Перейти к шагу ${index + 1}`, "aria-current": index === position, onClick: () => onSelectStep(index) }, index))) }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProgressDots } from './ProgressDots';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Dots: import("../../../../../../styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Dot: import("../../../../../../styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { styled } from '../../../../../../styled';
|
|
2
|
+
import { progressDotClassnames } from './constants';
|
|
3
|
+
export const Dots = styled.div `
|
|
4
|
+
display: flex;
|
|
5
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
6
|
+
align-items: center;
|
|
7
|
+
`;
|
|
8
|
+
export const Dot = styled.button `
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
|
|
11
|
+
width: 8px;
|
|
12
|
+
height: 8px;
|
|
13
|
+
padding: 0;
|
|
14
|
+
|
|
15
|
+
background-color: ${({ theme }) => theme.palette.grey[200]};
|
|
16
|
+
border: none;
|
|
17
|
+
border-radius: 50%;
|
|
18
|
+
|
|
19
|
+
transition: background-color 0.2s;
|
|
20
|
+
|
|
21
|
+
&.${progressDotClassnames.active} {
|
|
22
|
+
background-color: ${({ theme }) => theme.palette.grey[600]};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Круглый фокус вместо браузерной рамки. */
|
|
26
|
+
&:focus {
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:focus-visible {
|
|
31
|
+
outline: 2px solid ${({ theme }) => theme.palette.components.focused};
|
|
32
|
+
outline-offset: 2px;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ActiveStepState } from '../../../../types';
|
|
2
|
+
export type StepFooterProps = {
|
|
3
|
+
activeStep: ActiveStepState;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Футер шага: индикатор прогресса и кнопки навигации.
|
|
7
|
+
* Общий для standalone и highlight.
|
|
8
|
+
*/
|
|
9
|
+
export declare const StepFooter: ({ activeStep }: StepFooterProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../../../../../Button';
|
|
3
|
+
import { Typography } from '../../../../../Typography';
|
|
4
|
+
import { ProgressDots } from './ProgressDots';
|
|
5
|
+
import { CenterSlot, LeftSlot, NavigationRow, RightSlot, Root } from './styles';
|
|
6
|
+
import { useLogic } from './useLogic';
|
|
7
|
+
/**
|
|
8
|
+
* Футер шага: индикатор прогресса и кнопки навигации.
|
|
9
|
+
* Общий для standalone и highlight.
|
|
10
|
+
*/
|
|
11
|
+
export const StepFooter = ({ activeStep }) => {
|
|
12
|
+
const { isPrevVisible, isNextVisible, isDotsVisible, isCounterVisible, position, total, prevButtonText, nextButtonText, nextButtonVariant, onNext, onPrev, onSelectStep, } = useLogic(activeStep);
|
|
13
|
+
// Нечего показывать — не отрисовываем пустой футер
|
|
14
|
+
if (!isPrevVisible && !isNextVisible && !isDotsVisible && !isCounterVisible) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return (_jsx(Root, { children: _jsxs(NavigationRow, { children: [_jsx(LeftSlot, { children: isPrevVisible && (_jsx(Button, { variant: "text", onClick: onPrev, children: prevButtonText })) }), _jsxs(CenterSlot, { children: [isDotsVisible && (_jsx(ProgressDots, { position: position, total: total, onSelectStep: onSelectStep })), isCounterVisible && (_jsxs(Typography, { variant: "caption", color: "grey", colorIntensity: "600", children: [position + 1, " / ", total] }))] }), _jsx(RightSlot, { children: isNextVisible && (_jsx(Button, { "data-focus": "next", variant: nextButtonVariant, onClick: onNext, children: nextButtonText }, nextButtonVariant)) })] }) }));
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StepFooter } from './StepFooter';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Root: import("../../../../../styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const NavigationRow: import("../../../../../styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const LeftSlot: import("../../../../../styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
+
export declare const CenterSlot: import("../../../../../styled").StyledComponent<{
|
|
15
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
|
+
export declare const RightSlot: import("../../../../../styled").StyledComponent<{
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { styled } from '../../../../../styled';
|
|
2
|
+
export const Root = styled.div `
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: ${({ theme }) => theme.spacing(2)};
|
|
6
|
+
|
|
7
|
+
width: 100%;
|
|
8
|
+
padding:0;
|
|
9
|
+
`;
|
|
10
|
+
export const NavigationRow = styled.div `
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-columns: 1fr auto 1fr;
|
|
13
|
+
align-items: center;
|
|
14
|
+
`;
|
|
15
|
+
export const LeftSlot = styled.div `
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: flex-start;
|
|
18
|
+
`;
|
|
19
|
+
export const CenterSlot = styled.div `
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
23
|
+
align-items: center;
|
|
24
|
+
`;
|
|
25
|
+
export const RightSlot = styled.div `
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: flex-end;
|
|
28
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useLogic } from './useLogic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useLogic } from './useLogic';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ActiveStepState } from '../../../../../types';
|
|
2
|
+
export type UseLogicResult = {
|
|
3
|
+
isPrevVisible: boolean;
|
|
4
|
+
isNextVisible: boolean;
|
|
5
|
+
isDotsVisible: boolean;
|
|
6
|
+
isCounterVisible: boolean;
|
|
7
|
+
position: number;
|
|
8
|
+
total: number;
|
|
9
|
+
prevButtonText: string;
|
|
10
|
+
nextButtonText: string;
|
|
11
|
+
nextButtonVariant: 'text' | 'contained';
|
|
12
|
+
onNext: () => void;
|
|
13
|
+
onPrev: () => void;
|
|
14
|
+
onSelectStep: (position: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const useLogic: (activeStep: ActiveStepState) => UseLogicResult;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MAX_PROGRESS_DOTS } from '../constants';
|
|
2
|
+
export const useLogic = (activeStep) => {
|
|
3
|
+
const { step, position, total, hasNext, hasPrev, isDotsVisible, isCounterVisible, buttons, onNext, onPrev, onSelectStep, } = activeStep;
|
|
4
|
+
// Прогресс имеет смысл только при total > 1.
|
|
5
|
+
const hasProgress = total > 1;
|
|
6
|
+
// Последний шаг: кнопка «вперёд» превращается в завершающую.
|
|
7
|
+
const isFinishStep = !hasNext;
|
|
8
|
+
return {
|
|
9
|
+
isPrevVisible: step.isPrevButtonVisible && hasPrev,
|
|
10
|
+
isNextVisible: step.isNextButtonVisible,
|
|
11
|
+
isDotsVisible: isDotsVisible && hasProgress && total <= MAX_PROGRESS_DOTS,
|
|
12
|
+
isCounterVisible: isCounterVisible && hasProgress,
|
|
13
|
+
position,
|
|
14
|
+
total,
|
|
15
|
+
prevButtonText: buttons.prevLabel,
|
|
16
|
+
nextButtonText: isFinishStep ? buttons.finishLabel : buttons.nextLabel,
|
|
17
|
+
nextButtonVariant: isFinishStep ? buttons.finishVariant : 'contained',
|
|
18
|
+
onNext,
|
|
19
|
+
onPrev,
|
|
20
|
+
onSelectStep,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ActiveStepState } from '../../../types';
|
|
2
|
+
import { type OverlayGeometry } from '../useLogic';
|
|
3
|
+
/**
|
|
4
|
+
* Контракт step-view, передаётся стратегией по типу шага.
|
|
5
|
+
*/
|
|
6
|
+
export type StepViewProps = {
|
|
7
|
+
activeStep: ActiveStepState;
|
|
8
|
+
/**
|
|
9
|
+
* Тур в процессе закрытия
|
|
10
|
+
*/
|
|
11
|
+
isClosing: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Геометрия подсветки (единый источник для overlay и popover).
|
|
14
|
+
*/
|
|
15
|
+
geometry: OverlayGeometry;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useLogic, type OverlayGeometry } from './useLogic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useLogic } from './useLogic';
|