@automattic/onboarding 1.0.0 → 1.0.1
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/.storybook/index.scss +16 -0
- package/.storybook/main.ts +15 -0
- package/.storybook/preview.ts +5 -0
- package/CHANGELOG.md +5 -0
- package/dist/cjs/action-buttons/index.js +1 -13
- package/dist/cjs/action-buttons/index.js.map +1 -1
- package/dist/cjs/action-buttons/style.scss +4 -40
- package/dist/cjs/cart/create-cart-manager-client.js +3 -3
- package/dist/cjs/cart/create-cart-manager-client.js.map +1 -1
- package/dist/cjs/cart/index.js +45 -67
- package/dist/cjs/cart/index.js.map +1 -1
- package/dist/cjs/confetti/index.js +1 -1
- package/dist/cjs/confetti/index.js.map +1 -1
- package/dist/cjs/flow-progress/use-flow-progress.js +0 -57
- package/dist/cjs/flow-progress/use-flow-progress.js.map +1 -1
- package/dist/cjs/hooks/use-persisted-state.js +61 -0
- package/dist/cjs/hooks/use-persisted-state.js.map +1 -0
- package/dist/cjs/hooray/index.js +1 -1
- package/dist/cjs/index.js +11 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mshots-image/index.js +34 -15
- package/dist/cjs/mshots-image/index.js.map +1 -1
- package/dist/cjs/mshots-image/style.scss +1 -0
- package/dist/cjs/navigator/hooks/index.js +2 -1
- package/dist/cjs/navigator/hooks/index.js.map +1 -1
- package/dist/cjs/navigator/navigator-buttons/index.js +2 -2
- package/dist/cjs/navigator/navigator-buttons/index.js.map +1 -1
- package/dist/cjs/navigator/navigator-header/index.js.map +1 -1
- package/dist/cjs/navigator/navigator-screens/hooks/index.js +3 -2
- package/dist/cjs/navigator/navigator-screens/hooks/index.js.map +1 -1
- package/dist/cjs/navigator/navigator-screens/hooks/use-navigator-screens.js +1 -1
- package/dist/cjs/navigator/navigator-screens/hooks/use-navigator-screens.js.map +1 -1
- package/dist/cjs/navigator/navigator-screens/navigator-screens.js +7 -2
- package/dist/cjs/navigator/navigator-screens/navigator-screens.js.map +1 -1
- package/dist/cjs/select-card-checkbox/index.js +4 -3
- package/dist/cjs/select-card-checkbox/index.js.map +1 -1
- package/dist/cjs/select-card-checkbox/style.scss +11 -14
- package/dist/cjs/select-card-checkbox-v2/index.js +15 -0
- package/dist/cjs/select-card-checkbox-v2/index.js.map +1 -0
- package/dist/cjs/select-card-checkbox-v2/style.scss +25 -0
- package/dist/cjs/select-items/index.js +2 -1
- package/dist/cjs/select-items/index.js.map +1 -1
- package/dist/cjs/select-items/style.scss +2 -1
- package/dist/cjs/setup-tailored-site-after-creation.js +9 -37
- package/dist/cjs/setup-tailored-site-after-creation.js.map +1 -1
- package/dist/cjs/step-container/index.js +10 -12
- package/dist/cjs/step-container/index.js.map +1 -1
- package/dist/cjs/step-container/style.scss +35 -77
- package/dist/cjs/step-container-v2/components/ContentRow/ContentRow.js +14 -0
- package/dist/cjs/step-container-v2/components/ContentRow/ContentRow.js.map +1 -0
- package/dist/cjs/step-container-v2/components/ContentRow/style.scss +26 -0
- package/dist/cjs/step-container-v2/components/ContentWrapper/ContentWrapper.js +19 -0
- package/dist/cjs/step-container-v2/components/ContentWrapper/ContentWrapper.js.map +1 -0
- package/dist/cjs/step-container-v2/components/ContentWrapper/style.scss +70 -0
- package/dist/cjs/step-container-v2/components/Heading/Heading.js +17 -0
- package/dist/cjs/step-container-v2/components/Heading/Heading.js.map +1 -0
- package/dist/cjs/step-container-v2/components/Heading/style.scss +47 -0
- package/dist/cjs/step-container-v2/components/StepContainerV2/StepContainerV2.js +36 -0
- package/dist/cjs/step-container-v2/components/StepContainerV2/StepContainerV2.js.map +1 -0
- package/dist/cjs/step-container-v2/components/StepContainerV2/context.js +13 -0
- package/dist/cjs/step-container-v2/components/StepContainerV2/context.js.map +1 -0
- package/dist/cjs/step-container-v2/components/StepContainerV2/style.scss +21 -0
- package/dist/cjs/step-container-v2/components/StepCounter/StepCounter.js +17 -0
- package/dist/cjs/step-container-v2/components/StepCounter/StepCounter.js.map +1 -0
- package/dist/cjs/step-container-v2/components/StepCounter/style.scss +4 -0
- package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBar.js +17 -0
- package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBar.js.map +1 -0
- package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js +31 -0
- package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js.map +1 -0
- package/dist/cjs/step-container-v2/components/StickyBottomBar/style.scss +56 -0
- package/dist/cjs/step-container-v2/components/TopBar/TopBar.js +55 -0
- package/dist/cjs/step-container-v2/components/TopBar/TopBar.js.map +1 -0
- package/dist/cjs/step-container-v2/components/TopBar/TopBarRenderer.js +32 -0
- package/dist/cjs/step-container-v2/components/TopBar/TopBarRenderer.js.map +1 -0
- package/dist/cjs/step-container-v2/components/TopBar/style.scss +75 -0
- package/dist/cjs/step-container-v2/components/buttons/BackButton/BackButton.js +29 -0
- package/dist/cjs/step-container-v2/components/buttons/BackButton/BackButton.js.map +1 -0
- package/dist/cjs/step-container-v2/components/buttons/BackButton/style.scss +16 -0
- package/dist/cjs/step-container-v2/components/buttons/LinkButton/LinkButton.js +18 -0
- package/dist/cjs/step-container-v2/components/buttons/LinkButton/LinkButton.js.map +1 -0
- package/dist/cjs/step-container-v2/components/buttons/LinkButton/style.scss +6 -0
- package/dist/cjs/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js +18 -0
- package/dist/cjs/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js.map +1 -0
- package/dist/cjs/step-container-v2/components/buttons/PrimaryButton/style.scss +6 -0
- package/dist/cjs/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js +18 -0
- package/dist/cjs/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js.map +1 -0
- package/dist/cjs/step-container-v2/components/buttons/SecondaryButton/style.scss +6 -0
- package/dist/cjs/step-container-v2/components/buttons/SkipButton/SkipButton.js +28 -0
- package/dist/cjs/step-container-v2/components/buttons/SkipButton/SkipButton.js.map +1 -0
- package/dist/cjs/step-container-v2/contexts/StepContainerV2Context.js +17 -0
- package/dist/cjs/step-container-v2/contexts/StepContainerV2Context.js.map +1 -0
- package/dist/cjs/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js +18 -0
- package/dist/cjs/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js.map +1 -0
- package/dist/cjs/step-container-v2/helpers/normalizeButtonProps.js +13 -0
- package/dist/cjs/step-container-v2/helpers/normalizeButtonProps.js.map +1 -0
- package/dist/cjs/step-container-v2/helpers/wireframe-placeholder.js +18 -0
- package/dist/cjs/step-container-v2/helpers/wireframe-placeholder.js.map +1 -0
- package/dist/cjs/step-container-v2/helpers/withStepContainerV2ContextDecorator.js +15 -0
- package/dist/cjs/step-container-v2/helpers/withStepContainerV2ContextDecorator.js.map +1 -0
- package/dist/cjs/step-container-v2/index.js +41 -0
- package/dist/cjs/step-container-v2/index.js.map +1 -0
- package/dist/cjs/step-container-v2/types.js +3 -0
- package/dist/cjs/step-container-v2/types.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js +26 -0
- package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js +52 -0
- package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js +26 -0
- package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js +25 -0
- package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/style.scss +14 -0
- package/dist/cjs/step-container-v2/wireframes/Loading/Loading.js +30 -0
- package/dist/cjs/step-container-v2/wireframes/Loading/Loading.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/Loading/Loading.stories.js +29 -0
- package/dist/cjs/step-container-v2/wireframes/Loading/Loading.stories.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/Loading/style.scss +22 -0
- package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js +17 -0
- package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js +17 -0
- package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/style.scss +5 -0
- package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js +38 -0
- package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js +28 -0
- package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/style.scss +15 -0
- package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.js +17 -0
- package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.js.map +1 -0
- package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.stories.js +41 -0
- package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.stories.js.map +1 -0
- package/dist/cjs/step-navigation-link/index.js +2 -2
- package/dist/cjs/step-navigation-link/index.js.map +1 -1
- package/dist/cjs/step-navigation-link/style.scss +5 -3
- package/dist/cjs/titles/styles.scss +2 -2
- package/dist/cjs/upload-and-set-site-logo.js +4 -5
- package/dist/cjs/upload-and-set-site-logo.js.map +1 -1
- package/dist/cjs/utils/contrastChecker.js +1 -22
- package/dist/cjs/utils/contrastChecker.js.map +1 -1
- package/dist/cjs/utils/flows.js +73 -117
- package/dist/cjs/utils/flows.js.map +1 -1
- package/dist/cjs/utils/is-domain.js +1 -2
- package/dist/cjs/utils/is-domain.js.map +1 -1
- package/dist/cjs/utils/use-data-loss-warning.js +1 -2
- package/dist/cjs/utils/use-data-loss-warning.js.map +1 -1
- package/dist/cjs/wpcom-request.js +24 -0
- package/dist/cjs/wpcom-request.js.map +1 -0
- package/dist/esm/action-buttons/index.js +1 -11
- package/dist/esm/action-buttons/index.js.map +1 -1
- package/dist/esm/action-buttons/style.scss +4 -40
- package/dist/esm/cart/create-cart-manager-client.js +1 -1
- package/dist/esm/cart/create-cart-manager-client.js.map +1 -1
- package/dist/esm/cart/index.js +40 -61
- package/dist/esm/cart/index.js.map +1 -1
- package/dist/esm/confetti/index.js +1 -1
- package/dist/esm/confetti/index.js.map +1 -1
- package/dist/esm/flow-progress/use-flow-progress.js +1 -58
- package/dist/esm/flow-progress/use-flow-progress.js.map +1 -1
- package/dist/esm/hooks/use-persisted-state.js +57 -0
- package/dist/esm/hooks/use-persisted-state.js.map +1 -0
- package/dist/esm/hooray/index.js +1 -1
- package/dist/esm/index.js +6 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/mshots-image/index.js +33 -13
- package/dist/esm/mshots-image/index.js.map +1 -1
- package/dist/esm/mshots-image/style.scss +1 -0
- package/dist/esm/navigator/navigator-buttons/index.js.map +1 -1
- package/dist/esm/navigator/navigator-header/index.js.map +1 -1
- package/dist/esm/navigator/navigator-screens/hooks/use-navigator-screens.js +1 -1
- package/dist/esm/navigator/navigator-screens/hooks/use-navigator-screens.js.map +1 -1
- package/dist/esm/navigator/navigator-screens/navigator-screens.js +8 -3
- package/dist/esm/navigator/navigator-screens/navigator-screens.js.map +1 -1
- package/dist/esm/select-card-checkbox/index.js +4 -3
- package/dist/esm/select-card-checkbox/index.js.map +1 -1
- package/dist/esm/select-card-checkbox/style.scss +11 -14
- package/dist/esm/select-card-checkbox-v2/index.js +12 -0
- package/dist/esm/select-card-checkbox-v2/index.js.map +1 -0
- package/dist/esm/select-card-checkbox-v2/style.scss +25 -0
- package/dist/esm/select-items/index.js +3 -2
- package/dist/esm/select-items/index.js.map +1 -1
- package/dist/esm/select-items/style.scss +2 -1
- package/dist/esm/setup-tailored-site-after-creation.js +9 -37
- package/dist/esm/setup-tailored-site-after-creation.js.map +1 -1
- package/dist/esm/step-container/index.js +11 -13
- package/dist/esm/step-container/index.js.map +1 -1
- package/dist/esm/step-container/style.scss +35 -77
- package/dist/esm/step-container-v2/components/ContentRow/ContentRow.js +9 -0
- package/dist/esm/step-container-v2/components/ContentRow/ContentRow.js.map +1 -0
- package/dist/esm/step-container-v2/components/ContentRow/style.scss +26 -0
- package/dist/esm/step-container-v2/components/ContentWrapper/ContentWrapper.js +14 -0
- package/dist/esm/step-container-v2/components/ContentWrapper/ContentWrapper.js.map +1 -0
- package/dist/esm/step-container-v2/components/ContentWrapper/style.scss +70 -0
- package/dist/esm/step-container-v2/components/Heading/Heading.js +12 -0
- package/dist/esm/step-container-v2/components/Heading/Heading.js.map +1 -0
- package/dist/esm/step-container-v2/components/Heading/style.scss +47 -0
- package/dist/esm/step-container-v2/components/StepContainerV2/StepContainerV2.js +32 -0
- package/dist/esm/step-container-v2/components/StepContainerV2/StepContainerV2.js.map +1 -0
- package/dist/esm/step-container-v2/components/StepContainerV2/context.js +10 -0
- package/dist/esm/step-container-v2/components/StepContainerV2/context.js.map +1 -0
- package/dist/esm/step-container-v2/components/StepContainerV2/style.scss +21 -0
- package/dist/esm/step-container-v2/components/StepCounter/StepCounter.js +13 -0
- package/dist/esm/step-container-v2/components/StepCounter/StepCounter.js.map +1 -0
- package/dist/esm/step-container-v2/components/StepCounter/style.scss +4 -0
- package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBar.js +12 -0
- package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBar.js.map +1 -0
- package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js +27 -0
- package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js.map +1 -0
- package/dist/esm/step-container-v2/components/StickyBottomBar/style.scss +56 -0
- package/dist/esm/step-container-v2/components/TopBar/TopBar.js +49 -0
- package/dist/esm/step-container-v2/components/TopBar/TopBar.js.map +1 -0
- package/dist/esm/step-container-v2/components/TopBar/TopBarRenderer.js +27 -0
- package/dist/esm/step-container-v2/components/TopBar/TopBarRenderer.js.map +1 -0
- package/dist/esm/step-container-v2/components/TopBar/style.scss +75 -0
- package/dist/esm/step-container-v2/components/buttons/BackButton/BackButton.js +25 -0
- package/dist/esm/step-container-v2/components/buttons/BackButton/BackButton.js.map +1 -0
- package/dist/esm/step-container-v2/components/buttons/BackButton/style.scss +16 -0
- package/dist/esm/step-container-v2/components/buttons/LinkButton/LinkButton.js +14 -0
- package/dist/esm/step-container-v2/components/buttons/LinkButton/LinkButton.js.map +1 -0
- package/dist/esm/step-container-v2/components/buttons/LinkButton/style.scss +6 -0
- package/dist/esm/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js +14 -0
- package/dist/esm/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js.map +1 -0
- package/dist/esm/step-container-v2/components/buttons/PrimaryButton/style.scss +6 -0
- package/dist/esm/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js +14 -0
- package/dist/esm/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js.map +1 -0
- package/dist/esm/step-container-v2/components/buttons/SecondaryButton/style.scss +6 -0
- package/dist/esm/step-container-v2/components/buttons/SkipButton/SkipButton.js +24 -0
- package/dist/esm/step-container-v2/components/buttons/SkipButton/SkipButton.js.map +1 -0
- package/dist/esm/step-container-v2/contexts/StepContainerV2Context.js +13 -0
- package/dist/esm/step-container-v2/contexts/StepContainerV2Context.js.map +1 -0
- package/dist/esm/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js +14 -0
- package/dist/esm/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js.map +1 -0
- package/dist/esm/step-container-v2/helpers/normalizeButtonProps.js +8 -0
- package/dist/esm/step-container-v2/helpers/normalizeButtonProps.js.map +1 -0
- package/dist/esm/step-container-v2/helpers/wireframe-placeholder.js +15 -0
- package/dist/esm/step-container-v2/helpers/wireframe-placeholder.js.map +1 -0
- package/dist/esm/step-container-v2/helpers/withStepContainerV2ContextDecorator.js +11 -0
- package/dist/esm/step-container-v2/helpers/withStepContainerV2ContextDecorator.js.map +1 -0
- package/dist/esm/step-container-v2/index.js +22 -0
- package/dist/esm/step-container-v2/index.js.map +1 -0
- package/dist/esm/step-container-v2/types.js +2 -0
- package/dist/esm/step-container-v2/types.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js +22 -0
- package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js +45 -0
- package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js +23 -0
- package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js +21 -0
- package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/style.scss +14 -0
- package/dist/esm/step-container-v2/wireframes/Loading/Loading.js +26 -0
- package/dist/esm/step-container-v2/wireframes/Loading/Loading.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/Loading/Loading.stories.js +22 -0
- package/dist/esm/step-container-v2/wireframes/Loading/Loading.stories.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/Loading/style.scss +22 -0
- package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js +12 -0
- package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js +13 -0
- package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/style.scss +5 -0
- package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js +33 -0
- package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js +22 -0
- package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/style.scss +15 -0
- package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.js +13 -0
- package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.js.map +1 -0
- package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.stories.js +36 -0
- package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.stories.js.map +1 -0
- package/dist/esm/step-navigation-link/index.js +2 -2
- package/dist/esm/step-navigation-link/index.js.map +1 -1
- package/dist/esm/step-navigation-link/style.scss +5 -3
- package/dist/esm/titles/styles.scss +2 -2
- package/dist/esm/upload-and-set-site-logo.js +1 -1
- package/dist/esm/upload-and-set-site-logo.js.map +1 -1
- package/dist/esm/utils/contrastChecker.js +0 -20
- package/dist/esm/utils/contrastChecker.js.map +1 -1
- package/dist/esm/utils/flows.js +57 -96
- package/dist/esm/utils/flows.js.map +1 -1
- package/dist/esm/wpcom-request.js +18 -0
- package/dist/esm/wpcom-request.js.map +1 -0
- package/dist/styles/mixins.scss +4 -4
- package/dist/styles/variables.scss +2 -2
- package/dist/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/action-buttons/index.d.ts +0 -4
- package/dist/types/action-buttons/index.d.ts.map +1 -1
- package/dist/types/cart/index.d.ts +7 -4
- package/dist/types/cart/index.d.ts.map +1 -1
- package/dist/types/flow-progress/use-flow-progress.d.ts.map +1 -1
- package/dist/types/hooks/use-persisted-state.d.ts +26 -0
- package/dist/types/hooks/use-persisted-state.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/intent-screen/index.d.ts.map +1 -1
- package/dist/types/mshots-image/index.d.ts +2 -1
- package/dist/types/mshots-image/index.d.ts.map +1 -1
- package/dist/types/navigator/hooks/use-navigator-listener.d.ts.map +1 -1
- package/dist/types/navigator/navigator-buttons/index.d.ts +1 -1
- package/dist/types/navigator/navigator-buttons/index.d.ts.map +1 -1
- package/dist/types/navigator/navigator-header/index.d.ts +1 -1
- package/dist/types/navigator/navigator-header/index.d.ts.map +1 -1
- package/dist/types/navigator/navigator-item-group/index.d.ts +0 -1
- package/dist/types/navigator/navigator-item-group/index.d.ts.map +1 -1
- package/dist/types/navigator/navigator-listener/index.d.ts.map +1 -1
- package/dist/types/navigator/navigator-screen/index.d.ts.map +1 -1
- package/dist/types/navigator/navigator-screens/hooks/use-navigator-buttons.d.ts.map +1 -1
- package/dist/types/navigator/navigator-screens/hooks/use-navigator-screens.d.ts.map +1 -1
- package/dist/types/navigator/navigator-screens/navigator-screens.d.ts +4 -2
- package/dist/types/navigator/navigator-screens/navigator-screens.d.ts.map +1 -1
- package/dist/types/navigator/navigator-screens/types.d.ts +1 -1
- package/dist/types/navigator/navigator-screens/types.d.ts.map +1 -1
- package/dist/types/progress/index.d.ts.map +1 -1
- package/dist/types/select-card-checkbox/index.d.ts +3 -1
- package/dist/types/select-card-checkbox/index.d.ts.map +1 -1
- package/dist/types/select-card-checkbox-v2/index.d.ts +12 -0
- package/dist/types/select-card-checkbox-v2/index.d.ts.map +1 -0
- package/dist/types/select-items/index.d.ts +1 -1
- package/dist/types/select-items/index.d.ts.map +1 -1
- package/dist/types/setup-tailored-site-after-creation.d.ts +1 -1
- package/dist/types/setup-tailored-site-after-creation.d.ts.map +1 -1
- package/dist/types/step-container/index.d.ts +3 -4
- package/dist/types/step-container/index.d.ts.map +1 -1
- package/dist/types/step-container-v2/components/ContentRow/ContentRow.d.ts +9 -0
- package/dist/types/step-container-v2/components/ContentRow/ContentRow.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/ContentWrapper/ContentWrapper.d.ts +15 -0
- package/dist/types/step-container-v2/components/ContentWrapper/ContentWrapper.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/Heading/Heading.d.ts +11 -0
- package/dist/types/step-container-v2/components/Heading/Heading.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/StepContainerV2/StepContainerV2.d.ts +7 -0
- package/dist/types/step-container-v2/components/StepContainerV2/StepContainerV2.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/StepContainerV2/context.d.ts +12 -0
- package/dist/types/step-container-v2/components/StepContainerV2/context.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/StepCounter/StepCounter.d.ts +7 -0
- package/dist/types/step-container-v2/components/StepCounter/StepCounter.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBar.d.ts +14 -0
- package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBar.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.d.ts +5 -0
- package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/TopBar/TopBar.d.ts +25 -0
- package/dist/types/step-container-v2/components/TopBar/TopBar.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/TopBar/TopBarRenderer.d.ts +6 -0
- package/dist/types/step-container-v2/components/TopBar/TopBarRenderer.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/buttons/BackButton/BackButton.d.ts +6 -0
- package/dist/types/step-container-v2/components/buttons/BackButton/BackButton.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/buttons/LinkButton/LinkButton.d.ts +4 -0
- package/dist/types/step-container-v2/components/buttons/LinkButton/LinkButton.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.d.ts +4 -0
- package/dist/types/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.d.ts +4 -0
- package/dist/types/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.d.ts.map +1 -0
- package/dist/types/step-container-v2/components/buttons/SkipButton/SkipButton.d.ts +9 -0
- package/dist/types/step-container-v2/components/buttons/SkipButton/SkipButton.d.ts.map +1 -0
- package/dist/types/step-container-v2/contexts/StepContainerV2Context.d.ts +10 -0
- package/dist/types/step-container-v2/contexts/StepContainerV2Context.d.ts.map +1 -0
- package/dist/types/step-container-v2/helpers/decorateButtonWithTracksEventRecording.d.ts +8 -0
- package/dist/types/step-container-v2/helpers/decorateButtonWithTracksEventRecording.d.ts.map +1 -0
- package/dist/types/step-container-v2/helpers/normalizeButtonProps.d.ts +5 -0
- package/dist/types/step-container-v2/helpers/normalizeButtonProps.d.ts.map +1 -0
- package/dist/types/step-container-v2/helpers/wireframe-placeholder.d.ts +7 -0
- package/dist/types/step-container-v2/helpers/wireframe-placeholder.d.ts.map +1 -0
- package/dist/types/step-container-v2/helpers/withStepContainerV2ContextDecorator.d.ts +2 -0
- package/dist/types/step-container-v2/helpers/withStepContainerV2ContextDecorator.d.ts.map +1 -0
- package/dist/types/step-container-v2/index.d.ts +22 -0
- package/dist/types/step-container-v2/index.d.ts.map +1 -0
- package/dist/types/step-container-v2/types.d.ts +4 -0
- package/dist/types/step-container-v2/types.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.d.ts +16 -0
- package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.d.ts +9 -0
- package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.d.ts +18 -0
- package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.d.ts +6 -0
- package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/Loading/Loading.d.ts +12 -0
- package/dist/types/step-container-v2/wireframes/Loading/Loading.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/Loading/Loading.stories.d.ts +9 -0
- package/dist/types/step-container-v2/wireframes/Loading/Loading.stories.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.d.ts +10 -0
- package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.d.ts +6 -0
- package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.d.ts +20 -0
- package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.d.ts +8 -0
- package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.d.ts +13 -0
- package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.d.ts.map +1 -0
- package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.stories.d.ts +9 -0
- package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.stories.d.ts.map +1 -0
- package/dist/types/step-navigation-link/index.d.ts +1 -1
- package/dist/types/step-navigation-link/index.d.ts.map +1 -1
- package/dist/types/upload-and-set-site-logo.d.ts +1 -1
- package/dist/types/upload-and-set-site-logo.d.ts.map +1 -1
- package/dist/types/utils/contrastChecker.d.ts +0 -10
- package/dist/types/utils/contrastChecker.d.ts.map +1 -1
- package/dist/types/utils/domain-suggester.d.ts.map +1 -1
- package/dist/types/utils/flows.d.ts +37 -46
- package/dist/types/utils/flows.d.ts.map +1 -1
- package/dist/types/wpcom-request.d.ts +7 -0
- package/dist/types/wpcom-request.d.ts.map +1 -0
- package/jest.config.js +0 -1
- package/package.json +44 -23
- package/src/action-buttons/index.tsx +0 -40
- package/src/action-buttons/style.scss +4 -40
- package/src/cart/create-cart-manager-client.ts +1 -1
- package/src/cart/index.tsx +60 -103
- package/src/cart/test/index.ts +14 -14
- package/src/confetti/index.tsx +1 -1
- package/src/flow-progress/use-flow-progress.ts +1 -66
- package/src/hooks/test/index.ts +54 -0
- package/src/hooks/use-persisted-state.ts +85 -0
- package/src/hooray/index.tsx +1 -1
- package/src/index.ts +7 -12
- package/src/intent-screen/test/index.tsx +10 -7
- package/src/mshots-image/index.tsx +52 -21
- package/src/mshots-image/style.scss +1 -0
- package/src/navigator/navigator-buttons/index.tsx +1 -0
- package/src/navigator/navigator-header/index.tsx +1 -0
- package/src/navigator/navigator-screens/hooks/use-navigator-screens.tsx +5 -1
- package/src/navigator/navigator-screens/navigator-screens.tsx +17 -0
- package/src/navigator/navigator-screens/types.ts +1 -0
- package/src/select-card-checkbox/index.tsx +10 -4
- package/src/select-card-checkbox/style.scss +11 -14
- package/src/select-card-checkbox-v2/index.tsx +51 -0
- package/src/select-card-checkbox-v2/style.scss +25 -0
- package/src/select-card-checkbox-v2/test/index.test.tsx +49 -0
- package/src/select-items/index.tsx +10 -4
- package/src/select-items/style.scss +2 -1
- package/src/setup-tailored-site-after-creation.ts +16 -60
- package/src/step-container/index.tsx +21 -42
- package/src/step-container/style.scss +35 -77
- package/src/step-container-v2/README.md +235 -0
- package/src/step-container-v2/components/ContentRow/ContentRow.tsx +27 -0
- package/src/step-container-v2/components/ContentRow/style.scss +26 -0
- package/src/step-container-v2/components/ContentWrapper/ContentWrapper.tsx +41 -0
- package/src/step-container-v2/components/ContentWrapper/style.scss +70 -0
- package/src/step-container-v2/components/Heading/Heading.tsx +31 -0
- package/src/step-container-v2/components/Heading/style.scss +47 -0
- package/src/step-container-v2/components/StepContainerV2/StepContainerV2.tsx +55 -0
- package/src/step-container-v2/components/StepContainerV2/context.ts +25 -0
- package/src/step-container-v2/components/StepContainerV2/style.scss +21 -0
- package/src/step-container-v2/components/StepCounter/StepCounter.tsx +32 -0
- package/src/step-container-v2/components/StepCounter/style.scss +4 -0
- package/src/step-container-v2/components/StickyBottomBar/StickyBottomBar.tsx +46 -0
- package/src/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.tsx +41 -0
- package/src/step-container-v2/components/StickyBottomBar/style.scss +56 -0
- package/src/step-container-v2/components/TopBar/TopBar.tsx +116 -0
- package/src/step-container-v2/components/TopBar/TopBarRenderer.tsx +43 -0
- package/src/step-container-v2/components/TopBar/style.scss +75 -0
- package/src/step-container-v2/components/buttons/BackButton/BackButton.tsx +32 -0
- package/src/step-container-v2/components/buttons/BackButton/style.scss +16 -0
- package/src/step-container-v2/components/buttons/LinkButton/LinkButton.tsx +17 -0
- package/src/step-container-v2/components/buttons/LinkButton/style.scss +6 -0
- package/src/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.tsx +17 -0
- package/src/step-container-v2/components/buttons/PrimaryButton/style.scss +6 -0
- package/src/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.tsx +17 -0
- package/src/step-container-v2/components/buttons/SecondaryButton/style.scss +6 -0
- package/src/step-container-v2/components/buttons/SkipButton/SkipButton.tsx +30 -0
- package/src/step-container-v2/contexts/StepContainerV2Context.ts +23 -0
- package/src/step-container-v2/helpers/decorateButtonWithTracksEventRecording.ts +28 -0
- package/src/step-container-v2/helpers/normalizeButtonProps.ts +14 -0
- package/src/step-container-v2/helpers/wireframe-placeholder.tsx +28 -0
- package/src/step-container-v2/helpers/withStepContainerV2ContextDecorator.tsx +16 -0
- package/src/step-container-v2/index.tsx +24 -0
- package/src/step-container-v2/types.ts +4 -0
- package/src/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.tsx +122 -0
- package/src/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.tsx +66 -0
- package/src/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.tsx +51 -0
- package/src/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.tsx +69 -0
- package/src/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/style.scss +14 -0
- package/src/step-container-v2/wireframes/Loading/Loading.stories.tsx +27 -0
- package/src/step-container-v2/wireframes/Loading/Loading.tsx +52 -0
- package/src/step-container-v2/wireframes/Loading/style.scss +22 -0
- package/src/step-container-v2/wireframes/Loading/test/Loading.test.tsx +42 -0
- package/src/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.tsx +21 -0
- package/src/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.tsx +31 -0
- package/src/step-container-v2/wireframes/PlaygroundLayout/style.scss +5 -0
- package/src/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.tsx +93 -0
- package/src/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.tsx +93 -0
- package/src/step-container-v2/wireframes/TwoColumnLayout/style.scss +15 -0
- package/src/step-container-v2/wireframes/WideLayout/WideLayout.stories.tsx +83 -0
- package/src/step-container-v2/wireframes/WideLayout/WideLayout.tsx +44 -0
- package/src/step-navigation-link/index.tsx +3 -0
- package/src/step-navigation-link/style.scss +5 -3
- package/src/style-imports.d.ts +3 -0
- package/src/titles/styles.scss +2 -2
- package/src/upload-and-set-site-logo.ts +1 -1
- package/src/utils/contrastChecker.ts +0 -35
- package/src/utils/flows.ts +67 -123
- package/src/wpcom-request.ts +26 -0
- package/styles/mixins.scss +4 -4
- package/styles/variables.scss +2 -2
- package/tsconfig.json +1 -0
- package/dist/cjs/feature-icon/index.js +0 -19
- package/dist/cjs/feature-icon/index.js.map +0 -1
- package/dist/cjs/flow-progress/index.js +0 -14
- package/dist/cjs/flow-progress/index.js.map +0 -1
- package/dist/cjs/flow-progress/style.scss +0 -5
- package/dist/cjs/notice/index.js +0 -12
- package/dist/cjs/notice/index.js.map +0 -1
- package/dist/cjs/notice/style.scss +0 -19
- package/dist/cjs/select-card-radio/index.js +0 -21
- package/dist/cjs/select-card-radio/index.js.map +0 -1
- package/dist/cjs/select-card-radio/style.scss +0 -44
- package/dist/cjs/sensei-logo/index.js +0 -8
- package/dist/cjs/sensei-logo/index.js.map +0 -1
- package/dist/cjs/videopress-logo/index.js +0 -8
- package/dist/cjs/videopress-logo/index.js.map +0 -1
- package/dist/esm/feature-icon/index.js +0 -16
- package/dist/esm/feature-icon/index.js.map +0 -1
- package/dist/esm/flow-progress/index.js +0 -12
- package/dist/esm/flow-progress/index.js.map +0 -1
- package/dist/esm/flow-progress/style.scss +0 -5
- package/dist/esm/notice/index.js +0 -9
- package/dist/esm/notice/index.js.map +0 -1
- package/dist/esm/notice/style.scss +0 -19
- package/dist/esm/select-card-radio/index.js +0 -15
- package/dist/esm/select-card-radio/index.js.map +0 -1
- package/dist/esm/select-card-radio/style.scss +0 -44
- package/dist/esm/sensei-logo/index.js +0 -6
- package/dist/esm/sensei-logo/index.js.map +0 -1
- package/dist/esm/videopress-logo/index.js +0 -6
- package/dist/esm/videopress-logo/index.js.map +0 -1
- package/dist/types/feature-icon/index.d.ts +0 -9
- package/dist/types/feature-icon/index.d.ts.map +0 -1
- package/dist/types/flow-progress/index.d.ts +0 -9
- package/dist/types/flow-progress/index.d.ts.map +0 -1
- package/dist/types/notice/index.d.ts +0 -7
- package/dist/types/notice/index.d.ts.map +0 -1
- package/dist/types/select-card-radio/index.d.ts +0 -22
- package/dist/types/select-card-radio/index.d.ts.map +0 -1
- package/dist/types/sensei-logo/index.d.ts +0 -8
- package/dist/types/sensei-logo/index.d.ts.map +0 -1
- package/dist/types/videopress-logo/index.d.ts +0 -8
- package/dist/types/videopress-logo/index.d.ts.map +0 -1
- package/src/feature-icon/index.tsx +0 -102
- package/src/flow-progress/index.tsx +0 -22
- package/src/flow-progress/style.scss +0 -5
- package/src/notice/index.tsx +0 -16
- package/src/notice/style.scss +0 -19
- package/src/select-card-radio/index.tsx +0 -64
- package/src/select-card-radio/style.scss +0 -44
- package/src/select-card-radio/test/index.tsx +0 -50
- package/src/sensei-logo/index.tsx +0 -30
- package/src/videopress-logo/index.tsx +0 -36
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useContext, useRef, useLayoutEffect } from 'react';
|
|
2
|
+
import { StepContainerV2Context, ContentProp } from '../StepContainerV2/context';
|
|
3
|
+
|
|
4
|
+
export const StickyBottomBarRenderer = ( {
|
|
5
|
+
stickyBottomBar,
|
|
6
|
+
}: {
|
|
7
|
+
stickyBottomBar?: ContentProp;
|
|
8
|
+
} ) => {
|
|
9
|
+
const context = useContext( StepContainerV2Context );
|
|
10
|
+
const { setStickyBottomBarHeight } = context;
|
|
11
|
+
|
|
12
|
+
const stickyBottomBarRef = useRef< HTMLDivElement >( null );
|
|
13
|
+
|
|
14
|
+
useLayoutEffect( () => {
|
|
15
|
+
const resizeObserver = new ResizeObserver( ( [ entry ] ) => {
|
|
16
|
+
if ( entry ) {
|
|
17
|
+
setStickyBottomBarHeight( entry.contentRect.height );
|
|
18
|
+
}
|
|
19
|
+
} );
|
|
20
|
+
|
|
21
|
+
if ( stickyBottomBarRef.current ) {
|
|
22
|
+
setStickyBottomBarHeight( stickyBottomBarRef.current.clientHeight );
|
|
23
|
+
resizeObserver.observe( stickyBottomBarRef.current );
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return () => {
|
|
27
|
+
resizeObserver.disconnect();
|
|
28
|
+
};
|
|
29
|
+
}, [ setStickyBottomBarHeight ] );
|
|
30
|
+
|
|
31
|
+
const content =
|
|
32
|
+
typeof stickyBottomBar === 'function'
|
|
33
|
+
? stickyBottomBar( context )
|
|
34
|
+
: ! context.isSmallViewport && stickyBottomBar;
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div className="step-container-v2__sticky-bottom-bar-wrapper" ref={ stickyBottomBarRef }>
|
|
38
|
+
{ content }
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.step-container-v2__sticky-bottom-bar {
|
|
2
|
+
&-wrapper {
|
|
3
|
+
position: sticky;
|
|
4
|
+
bottom: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
width: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
align-items: center;
|
|
13
|
+
box-shadow: var( --color-border-subtle ) 0 1px 0 inset;
|
|
14
|
+
background-color: var( --color-surface );
|
|
15
|
+
|
|
16
|
+
&--no-box-shadow {
|
|
17
|
+
box-shadow: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&--has-transparent-background {
|
|
21
|
+
background-color: transparent;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&--center-text {
|
|
25
|
+
text-align: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-left-element,
|
|
29
|
+
&-center-element,
|
|
30
|
+
&-right-element {
|
|
31
|
+
margin-block: 1rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-left-element {
|
|
35
|
+
margin-left: 1rem;
|
|
36
|
+
margin-right: auto;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-center-element {
|
|
40
|
+
margin-inline: 2rem;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-right-element {
|
|
45
|
+
margin-left: auto;
|
|
46
|
+
margin-right: 1rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&--full-width {
|
|
50
|
+
.step-container-v2__sticky-bottom-bar-left-element,
|
|
51
|
+
.step-container-v2__sticky-bottom-bar-center-element,
|
|
52
|
+
.step-container-v2__sticky-bottom-bar-right-element {
|
|
53
|
+
flex-grow: 1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { WordPressLogo, WordPressWordmark } from '@automattic/components';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { isValidElement, useLayoutEffect, useRef, type ReactElement, type ReactNode } from 'react';
|
|
4
|
+
import { useStepContainerV2Context } from '../../contexts/StepContainerV2Context';
|
|
5
|
+
|
|
6
|
+
import './style.scss';
|
|
7
|
+
|
|
8
|
+
export interface TopBarProps {
|
|
9
|
+
leftElement?: ReactNode;
|
|
10
|
+
rightElement?: ReactNode;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Customize the TopBar logo. If this is not passed, the default logo will
|
|
14
|
+
* be used unless `hideLogo` is set.
|
|
15
|
+
*/
|
|
16
|
+
logo?: ReactNode;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Hide the WordPress wordmark when `compactLogo` is set.
|
|
20
|
+
* Always show the WordPress logo instead.
|
|
21
|
+
* - This is critical for current Login views, where the logo (WordPressLogo) is always visible
|
|
22
|
+
* - Confirm with Design before changing functionality around this
|
|
23
|
+
*/
|
|
24
|
+
compactLogo?: 'always';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Hide the logo entirely.
|
|
28
|
+
*/
|
|
29
|
+
hideLogo?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const TopBar = ( {
|
|
33
|
+
leftElement,
|
|
34
|
+
rightElement,
|
|
35
|
+
logo,
|
|
36
|
+
compactLogo,
|
|
37
|
+
hideLogo = false,
|
|
38
|
+
}: TopBarProps ) => {
|
|
39
|
+
const context = useStepContainerV2Context();
|
|
40
|
+
const topBarRef = useRef< HTMLDivElement >( null );
|
|
41
|
+
|
|
42
|
+
// Publish the rendered height to `:root --masterbar-height` so consumers that
|
|
43
|
+
// expect "the current route's top bar height" (e.g. the Help Center mobile
|
|
44
|
+
// sheet, layout sidebars) get the right value. Without this, routes that
|
|
45
|
+
// render `Step.TopBar` but also force `<EmptyMasterbar />` (e.g. checkout
|
|
46
|
+
// invoked from a stepper-v2 flow) report `--masterbar-height: 0`, leaving the
|
|
47
|
+
// overlay misaligned. Uses `!important` to beat EmptyMasterbar's stylesheet,
|
|
48
|
+
// and runs before paint so first-frame consumers don't see the stale value.
|
|
49
|
+
useLayoutEffect( () => {
|
|
50
|
+
const element = topBarRef.current;
|
|
51
|
+
|
|
52
|
+
if ( ! element ) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const root = document.documentElement;
|
|
57
|
+
|
|
58
|
+
const publishHeight = () => {
|
|
59
|
+
const height = Math.round( element.getBoundingClientRect().height );
|
|
60
|
+
root.style.setProperty( '--masterbar-height', `${ height }px`, 'important' );
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
publishHeight();
|
|
64
|
+
|
|
65
|
+
let observer: ResizeObserver | undefined;
|
|
66
|
+
if ( typeof ResizeObserver !== 'undefined' ) {
|
|
67
|
+
observer = new ResizeObserver( publishHeight );
|
|
68
|
+
observer.observe( element );
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return () => {
|
|
72
|
+
observer?.disconnect();
|
|
73
|
+
root.style.removeProperty( '--masterbar-height' );
|
|
74
|
+
};
|
|
75
|
+
}, [] );
|
|
76
|
+
|
|
77
|
+
// Context logo takes precedence over default WordPress logo.
|
|
78
|
+
// The `logo` prop provides an explicit override for both.
|
|
79
|
+
const defaultWordPressLogo = (
|
|
80
|
+
<div
|
|
81
|
+
className={ clsx( 'step-container-v2__top-bar-wordpress-logo-wrapper', {
|
|
82
|
+
'is-compact': compactLogo,
|
|
83
|
+
} ) }
|
|
84
|
+
>
|
|
85
|
+
{ ! compactLogo && (
|
|
86
|
+
<WordPressWordmark
|
|
87
|
+
className="step-container-v2__top-bar-wordpress-logo step-container-v2__top-bar-wordpress-logo--wordmark"
|
|
88
|
+
color="currentColor"
|
|
89
|
+
/>
|
|
90
|
+
) }
|
|
91
|
+
<WordPressLogo
|
|
92
|
+
size={ 21 }
|
|
93
|
+
className="step-container-v2__top-bar-wordpress-logo step-container-v2__top-bar-wordpress-logo--logo"
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
const resolvedLogo = logo ?? context.logo ?? defaultWordPressLogo;
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div ref={ topBarRef } className="step-container-v2__top-bar">
|
|
102
|
+
{ ! hideLogo && resolvedLogo }
|
|
103
|
+
|
|
104
|
+
{ leftElement && (
|
|
105
|
+
<div className="step-container-v2__top-bar-left-element">{ leftElement }</div>
|
|
106
|
+
) }
|
|
107
|
+
{ rightElement && (
|
|
108
|
+
<div className="step-container-v2__top-bar-right-element">{ rightElement }</div>
|
|
109
|
+
) }
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const isTopBar = ( element?: ReactNode ): element is ReactElement< TopBarProps > => {
|
|
115
|
+
return isValidElement( element ) && element.type === TopBar;
|
|
116
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useContext, useLayoutEffect, useRef } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
StepContainerV2Context,
|
|
4
|
+
type ContentProp,
|
|
5
|
+
type StepContainerV2InternalContextType,
|
|
6
|
+
} from '../StepContainerV2/context';
|
|
7
|
+
|
|
8
|
+
export const renderTopBar = (
|
|
9
|
+
topBar: ContentProp,
|
|
10
|
+
context: Pick< StepContainerV2InternalContextType, 'isSmallViewport' | 'isLargeViewport' >
|
|
11
|
+
) => {
|
|
12
|
+
return typeof topBar === 'function' ? topBar( context ) : topBar;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const TopBarRenderer = ( { topBar }: { topBar?: ContentProp } ) => {
|
|
16
|
+
const context = useContext( StepContainerV2Context );
|
|
17
|
+
const { setTopBarHeight } = context;
|
|
18
|
+
|
|
19
|
+
const topBarRef = useRef< HTMLDivElement >( null );
|
|
20
|
+
|
|
21
|
+
useLayoutEffect( () => {
|
|
22
|
+
const resizeObserver = new ResizeObserver( ( [ entry ] ) => {
|
|
23
|
+
if ( entry ) {
|
|
24
|
+
setTopBarHeight( `${ entry.contentRect.height }px` );
|
|
25
|
+
}
|
|
26
|
+
} );
|
|
27
|
+
|
|
28
|
+
if ( topBarRef.current ) {
|
|
29
|
+
setTopBarHeight( `${ topBarRef.current.clientHeight }px` );
|
|
30
|
+
resizeObserver.observe( topBarRef.current );
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return () => {
|
|
34
|
+
resizeObserver.disconnect();
|
|
35
|
+
};
|
|
36
|
+
}, [ setTopBarHeight ] );
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div ref={ topBarRef } className="step-container-v2__top-bar-wrapper">
|
|
40
|
+
{ renderTopBar( topBar, context ) }
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@import '@wordpress/base-styles/breakpoints';
|
|
2
|
+
@import '@wordpress/base-styles/mixins';
|
|
3
|
+
|
|
4
|
+
.step-container-v2__top-bar {
|
|
5
|
+
width: 100%;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: 1rem;
|
|
10
|
+
padding: var( --step-container-v2-top-bar-padding );
|
|
11
|
+
|
|
12
|
+
@include break-small {
|
|
13
|
+
padding-inline: 1.5rem;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.step-container-v2__top-bar-wrapper {
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.step-container-v2__top-bar-left-element,
|
|
22
|
+
.step-container-v2__top-bar-right-element,
|
|
23
|
+
.step-container-v2__top-bar-wordpress-logo {
|
|
24
|
+
height: var( --step-container-v2-top-bar-content-height );
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.step-container-v2__top-bar-left-element,
|
|
28
|
+
.step-container-v2__top-bar-right-element {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.step-container-v2__top-bar-wordpress-logo {
|
|
34
|
+
color: var( --color-text );
|
|
35
|
+
margin: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.step-container-v2__top-bar-wordpress-logo--wordmark {
|
|
39
|
+
display: none;
|
|
40
|
+
|
|
41
|
+
@include break-small {
|
|
42
|
+
display: block;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.step-container-v2__top-bar-wordpress-logo--logo {
|
|
47
|
+
display: block;
|
|
48
|
+
|
|
49
|
+
@include break-small {
|
|
50
|
+
/**
|
|
51
|
+
* Hide the logo only when the wrapper is not compact.
|
|
52
|
+
* This is important for current Login views, where the logo is always visible.
|
|
53
|
+
* -- Confirm with Design before changing this --
|
|
54
|
+
*/
|
|
55
|
+
.step-container-v2__top-bar-wordpress-logo-wrapper:not( .is-compact ) & {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.step-container-v2__top-bar-right-element {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 1rem;
|
|
65
|
+
margin-left: auto;
|
|
66
|
+
font-size: 0.875rem;
|
|
67
|
+
line-height: 1;
|
|
68
|
+
|
|
69
|
+
a,
|
|
70
|
+
button {
|
|
71
|
+
&.components-button:not( .is-destructive ).is-link {
|
|
72
|
+
--wp-components-color-accent: var( --color-neutral-100 );
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Button } from '@wordpress/components';
|
|
2
|
+
import { chevronLeft } from '@wordpress/icons';
|
|
3
|
+
import { useI18n } from '@wordpress/react-i18n';
|
|
4
|
+
import { useStepContainerV2Context } from '../../../contexts/StepContainerV2Context';
|
|
5
|
+
import { decorateButtonWithTracksEventRecording } from '../../../helpers/decorateButtonWithTracksEventRecording';
|
|
6
|
+
import { normalizeButtonProps } from '../../../helpers/normalizeButtonProps';
|
|
7
|
+
import { ButtonProps } from '../../../types';
|
|
8
|
+
|
|
9
|
+
import './style.scss';
|
|
10
|
+
|
|
11
|
+
export const BackButton = ( {
|
|
12
|
+
enableTracksEvent = true,
|
|
13
|
+
...originalProps
|
|
14
|
+
}: ButtonProps & { enableTracksEvent?: boolean } ) => {
|
|
15
|
+
const { __ } = useI18n();
|
|
16
|
+
const stepContext = useStepContainerV2Context();
|
|
17
|
+
|
|
18
|
+
const backButtonProps = normalizeButtonProps( originalProps, {
|
|
19
|
+
children: __( 'Back', __i18n_text_domain__ ),
|
|
20
|
+
className: 'step-container-v2__back-button',
|
|
21
|
+
icon: chevronLeft,
|
|
22
|
+
} );
|
|
23
|
+
|
|
24
|
+
const buttonProps = enableTracksEvent
|
|
25
|
+
? decorateButtonWithTracksEventRecording( backButtonProps, {
|
|
26
|
+
tracksEventName: 'calypso_signup_previous_step_button_click',
|
|
27
|
+
stepContext,
|
|
28
|
+
} )
|
|
29
|
+
: backButtonProps;
|
|
30
|
+
|
|
31
|
+
return <Button { ...buttonProps } />;
|
|
32
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.step-container-v2__back-button.components-button {
|
|
2
|
+
--wp-components-color-accent: var(--color-neutral-100);
|
|
3
|
+
--color-link: var(--color-neutral-100);
|
|
4
|
+
font-size: 0.875rem;
|
|
5
|
+
font-weight: 500;
|
|
6
|
+
line-height: 1;
|
|
7
|
+
text-decoration: underline;
|
|
8
|
+
gap: 4px;
|
|
9
|
+
padding: 0 !important;
|
|
10
|
+
min-width: 0;
|
|
11
|
+
height: auto;
|
|
12
|
+
|
|
13
|
+
svg {
|
|
14
|
+
margin-inline-end: 0;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Button } from '@wordpress/components';
|
|
2
|
+
import { useI18n } from '@wordpress/react-i18n';
|
|
3
|
+
import { normalizeButtonProps } from '../../../helpers/normalizeButtonProps';
|
|
4
|
+
import { ButtonProps } from '../../../types';
|
|
5
|
+
|
|
6
|
+
import './style.scss';
|
|
7
|
+
|
|
8
|
+
export const LinkButton = ( originalProps: ButtonProps ) => {
|
|
9
|
+
const { __ } = useI18n();
|
|
10
|
+
|
|
11
|
+
const linkButtonProps = normalizeButtonProps( originalProps, {
|
|
12
|
+
children: __( 'Link', __i18n_text_domain__ ),
|
|
13
|
+
className: 'step-container-v2__link-button',
|
|
14
|
+
} );
|
|
15
|
+
|
|
16
|
+
return <Button variant="link" { ...linkButtonProps } />;
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Button } from '@wordpress/components';
|
|
2
|
+
import { useI18n } from '@wordpress/react-i18n';
|
|
3
|
+
import { normalizeButtonProps } from '../../../helpers/normalizeButtonProps';
|
|
4
|
+
import { ButtonProps } from '../../../types';
|
|
5
|
+
|
|
6
|
+
import './style.scss';
|
|
7
|
+
|
|
8
|
+
export const PrimaryButton = ( originalProps: ButtonProps ) => {
|
|
9
|
+
const { __ } = useI18n();
|
|
10
|
+
|
|
11
|
+
const primaryButtonProps = normalizeButtonProps( originalProps, {
|
|
12
|
+
children: __( 'Next', __i18n_text_domain__ ),
|
|
13
|
+
className: 'step-container-v2__primary-button',
|
|
14
|
+
} );
|
|
15
|
+
|
|
16
|
+
return <Button __next40pxDefaultSize variant="primary" { ...primaryButtonProps } />;
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Button } from '@wordpress/components';
|
|
2
|
+
import { useI18n } from '@wordpress/react-i18n';
|
|
3
|
+
import { normalizeButtonProps } from '../../../helpers/normalizeButtonProps';
|
|
4
|
+
import { ButtonProps } from '../../../types';
|
|
5
|
+
|
|
6
|
+
import './style.scss';
|
|
7
|
+
|
|
8
|
+
export const SecondaryButton = ( originalProps: ButtonProps ) => {
|
|
9
|
+
const { __ } = useI18n();
|
|
10
|
+
|
|
11
|
+
const secondaryButtonProps = normalizeButtonProps( originalProps, {
|
|
12
|
+
children: __( 'Secondary', __i18n_text_domain__ ),
|
|
13
|
+
className: 'step-container-v2__secondary-button',
|
|
14
|
+
} );
|
|
15
|
+
|
|
16
|
+
return <Button __next40pxDefaultSize variant="secondary" { ...secondaryButtonProps } />;
|
|
17
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useI18n } from '@wordpress/react-i18n';
|
|
2
|
+
import { useStepContainerV2Context } from '../../../contexts/StepContainerV2Context';
|
|
3
|
+
import { decorateButtonWithTracksEventRecording } from '../../../helpers/decorateButtonWithTracksEventRecording';
|
|
4
|
+
import { normalizeButtonProps } from '../../../helpers/normalizeButtonProps';
|
|
5
|
+
import { ButtonProps } from '../../../types';
|
|
6
|
+
import { LinkButton } from '../LinkButton/LinkButton';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Do NOT use this button if you don't intend to skip the step.
|
|
10
|
+
*
|
|
11
|
+
* This button is visually identical to {@link LinkButton}.
|
|
12
|
+
* The difference between them is that this one fires a Tracks event when clicked.
|
|
13
|
+
*/
|
|
14
|
+
export const SkipButton = ( originalProps: ButtonProps ) => {
|
|
15
|
+
const { __ } = useI18n();
|
|
16
|
+
const stepContext = useStepContainerV2Context();
|
|
17
|
+
|
|
18
|
+
const skipButtonProps = normalizeButtonProps( originalProps, {
|
|
19
|
+
children: __( 'Skip', __i18n_text_domain__ ),
|
|
20
|
+
} );
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<LinkButton
|
|
24
|
+
{ ...decorateButtonWithTracksEventRecording( skipButtonProps, {
|
|
25
|
+
tracksEventName: 'calypso_signup_skip_step',
|
|
26
|
+
stepContext,
|
|
27
|
+
} ) }
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createContext, useContext, type ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type StepContainerV2ContextType = {
|
|
4
|
+
flowName: string;
|
|
5
|
+
stepName: string;
|
|
6
|
+
recordTracksEvent: ( eventName: string, eventProperties: Record< string, unknown > ) => void;
|
|
7
|
+
logo: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const defaultContextValue: StepContainerV2ContextType = {
|
|
11
|
+
flowName: '',
|
|
12
|
+
stepName: '',
|
|
13
|
+
recordTracksEvent: () => {},
|
|
14
|
+
logo: null,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const StepContainerV2Context = createContext< StepContainerV2ContextType >( defaultContextValue );
|
|
18
|
+
|
|
19
|
+
export const StepContainerV2Provider = StepContainerV2Context.Provider;
|
|
20
|
+
|
|
21
|
+
export const useStepContainerV2Context = () => {
|
|
22
|
+
return useContext( StepContainerV2Context );
|
|
23
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Onboard, OnboardSelect } from '@automattic/data-stores';
|
|
2
|
+
import { Button } from '@wordpress/components';
|
|
3
|
+
import { select } from '@wordpress/data';
|
|
4
|
+
import { ComponentProps } from 'react';
|
|
5
|
+
import { StepContainerV2ContextType } from '../contexts/StepContainerV2Context';
|
|
6
|
+
|
|
7
|
+
export const decorateButtonWithTracksEventRecording = (
|
|
8
|
+
{ onClick, ...props }: ComponentProps< typeof Button >,
|
|
9
|
+
{
|
|
10
|
+
tracksEventName,
|
|
11
|
+
stepContext,
|
|
12
|
+
}: { tracksEventName: string; stepContext: StepContainerV2ContextType }
|
|
13
|
+
): ComponentProps< typeof Button > => {
|
|
14
|
+
const onClickHandler = (
|
|
15
|
+
event: React.MouseEvent< HTMLAnchorElement, MouseEvent > &
|
|
16
|
+
React.MouseEvent< HTMLButtonElement, MouseEvent >
|
|
17
|
+
) => {
|
|
18
|
+
onClick?.( event );
|
|
19
|
+
|
|
20
|
+
stepContext?.recordTracksEvent?.( tracksEventName, {
|
|
21
|
+
flow: stepContext?.flowName,
|
|
22
|
+
step: stepContext?.stepName,
|
|
23
|
+
intent: ( select( Onboard.register() ) as unknown as OnboardSelect ).getIntent(),
|
|
24
|
+
} );
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return { ...props, onClick: onClickHandler };
|
|
28
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Button } from '@wordpress/components';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
import { ButtonProps } from '../types';
|
|
5
|
+
|
|
6
|
+
export const normalizeButtonProps = < T extends ComponentProps< typeof Button > >(
|
|
7
|
+
button: ButtonProps,
|
|
8
|
+
standardProps: T
|
|
9
|
+
): T => ( {
|
|
10
|
+
...standardProps,
|
|
11
|
+
...button,
|
|
12
|
+
children: button.children ?? standardProps.children,
|
|
13
|
+
className: clsx( standardProps.className, button.className ),
|
|
14
|
+
} );
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function WireframePlaceholder( {
|
|
2
|
+
height,
|
|
3
|
+
children,
|
|
4
|
+
className,
|
|
5
|
+
style: additionalStyle,
|
|
6
|
+
}: {
|
|
7
|
+
height?: React.CSSProperties[ 'height' ];
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
} ) {
|
|
12
|
+
const style = {
|
|
13
|
+
background: '#ff80ff',
|
|
14
|
+
borderRadius: 10,
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
...( height && { height } ),
|
|
20
|
+
...additionalStyle,
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className={ className } style={ style }>
|
|
25
|
+
{ children }
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StepContainerV2Provider } from '..';
|
|
2
|
+
|
|
3
|
+
export const withStepContainerV2ContextDecorator = ( Story: React.ComponentType ) => {
|
|
4
|
+
return (
|
|
5
|
+
<StepContainerV2Provider
|
|
6
|
+
value={ {
|
|
7
|
+
flowName: 'flowName',
|
|
8
|
+
stepName: 'stepName',
|
|
9
|
+
recordTracksEvent: () => {},
|
|
10
|
+
logo: null,
|
|
11
|
+
} }
|
|
12
|
+
>
|
|
13
|
+
<Story />
|
|
14
|
+
</StepContainerV2Provider>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEVER export StepContainerV2 directly.
|
|
3
|
+
*
|
|
4
|
+
* Export only components and wireframes.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { StepContainerV2Provider } from './contexts/StepContainerV2Context';
|
|
8
|
+
|
|
9
|
+
export { BackButton } from './components/buttons/BackButton/BackButton';
|
|
10
|
+
export { PrimaryButton } from './components/buttons/PrimaryButton/PrimaryButton';
|
|
11
|
+
export { SecondaryButton } from './components/buttons/SecondaryButton/SecondaryButton';
|
|
12
|
+
export { SkipButton } from './components/buttons/SkipButton/SkipButton';
|
|
13
|
+
export { LinkButton } from './components/buttons/LinkButton/LinkButton';
|
|
14
|
+
export { Heading } from './components/Heading/Heading';
|
|
15
|
+
export { StepCounter } from './components/StepCounter/StepCounter';
|
|
16
|
+
export { TopBar } from './components/TopBar/TopBar';
|
|
17
|
+
export { StickyBottomBar } from './components/StickyBottomBar/StickyBottomBar';
|
|
18
|
+
|
|
19
|
+
export { CenteredColumnLayout } from './wireframes/CenteredColumnLayout/CenteredColumnLayout';
|
|
20
|
+
export { TwoColumnLayout } from './wireframes/TwoColumnLayout/TwoColumnLayout';
|
|
21
|
+
export { WideLayout } from './wireframes/WideLayout/WideLayout';
|
|
22
|
+
export { Loading } from './wireframes/Loading/Loading';
|
|
23
|
+
export { PlaygroundLayout } from './wireframes/PlaygroundLayout/PlaygroundLayout';
|
|
24
|
+
export { FixedColumnOnTheLeftLayout } from './wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout';
|