@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.
Files changed (547) hide show
  1. package/.storybook/index.scss +16 -0
  2. package/.storybook/main.ts +15 -0
  3. package/.storybook/preview.ts +5 -0
  4. package/CHANGELOG.md +5 -0
  5. package/dist/cjs/action-buttons/index.js +1 -13
  6. package/dist/cjs/action-buttons/index.js.map +1 -1
  7. package/dist/cjs/action-buttons/style.scss +4 -40
  8. package/dist/cjs/cart/create-cart-manager-client.js +3 -3
  9. package/dist/cjs/cart/create-cart-manager-client.js.map +1 -1
  10. package/dist/cjs/cart/index.js +45 -67
  11. package/dist/cjs/cart/index.js.map +1 -1
  12. package/dist/cjs/confetti/index.js +1 -1
  13. package/dist/cjs/confetti/index.js.map +1 -1
  14. package/dist/cjs/flow-progress/use-flow-progress.js +0 -57
  15. package/dist/cjs/flow-progress/use-flow-progress.js.map +1 -1
  16. package/dist/cjs/hooks/use-persisted-state.js +61 -0
  17. package/dist/cjs/hooks/use-persisted-state.js.map +1 -0
  18. package/dist/cjs/hooray/index.js +1 -1
  19. package/dist/cjs/index.js +11 -10
  20. package/dist/cjs/index.js.map +1 -1
  21. package/dist/cjs/mshots-image/index.js +34 -15
  22. package/dist/cjs/mshots-image/index.js.map +1 -1
  23. package/dist/cjs/mshots-image/style.scss +1 -0
  24. package/dist/cjs/navigator/hooks/index.js +2 -1
  25. package/dist/cjs/navigator/hooks/index.js.map +1 -1
  26. package/dist/cjs/navigator/navigator-buttons/index.js +2 -2
  27. package/dist/cjs/navigator/navigator-buttons/index.js.map +1 -1
  28. package/dist/cjs/navigator/navigator-header/index.js.map +1 -1
  29. package/dist/cjs/navigator/navigator-screens/hooks/index.js +3 -2
  30. package/dist/cjs/navigator/navigator-screens/hooks/index.js.map +1 -1
  31. package/dist/cjs/navigator/navigator-screens/hooks/use-navigator-screens.js +1 -1
  32. package/dist/cjs/navigator/navigator-screens/hooks/use-navigator-screens.js.map +1 -1
  33. package/dist/cjs/navigator/navigator-screens/navigator-screens.js +7 -2
  34. package/dist/cjs/navigator/navigator-screens/navigator-screens.js.map +1 -1
  35. package/dist/cjs/select-card-checkbox/index.js +4 -3
  36. package/dist/cjs/select-card-checkbox/index.js.map +1 -1
  37. package/dist/cjs/select-card-checkbox/style.scss +11 -14
  38. package/dist/cjs/select-card-checkbox-v2/index.js +15 -0
  39. package/dist/cjs/select-card-checkbox-v2/index.js.map +1 -0
  40. package/dist/cjs/select-card-checkbox-v2/style.scss +25 -0
  41. package/dist/cjs/select-items/index.js +2 -1
  42. package/dist/cjs/select-items/index.js.map +1 -1
  43. package/dist/cjs/select-items/style.scss +2 -1
  44. package/dist/cjs/setup-tailored-site-after-creation.js +9 -37
  45. package/dist/cjs/setup-tailored-site-after-creation.js.map +1 -1
  46. package/dist/cjs/step-container/index.js +10 -12
  47. package/dist/cjs/step-container/index.js.map +1 -1
  48. package/dist/cjs/step-container/style.scss +35 -77
  49. package/dist/cjs/step-container-v2/components/ContentRow/ContentRow.js +14 -0
  50. package/dist/cjs/step-container-v2/components/ContentRow/ContentRow.js.map +1 -0
  51. package/dist/cjs/step-container-v2/components/ContentRow/style.scss +26 -0
  52. package/dist/cjs/step-container-v2/components/ContentWrapper/ContentWrapper.js +19 -0
  53. package/dist/cjs/step-container-v2/components/ContentWrapper/ContentWrapper.js.map +1 -0
  54. package/dist/cjs/step-container-v2/components/ContentWrapper/style.scss +70 -0
  55. package/dist/cjs/step-container-v2/components/Heading/Heading.js +17 -0
  56. package/dist/cjs/step-container-v2/components/Heading/Heading.js.map +1 -0
  57. package/dist/cjs/step-container-v2/components/Heading/style.scss +47 -0
  58. package/dist/cjs/step-container-v2/components/StepContainerV2/StepContainerV2.js +36 -0
  59. package/dist/cjs/step-container-v2/components/StepContainerV2/StepContainerV2.js.map +1 -0
  60. package/dist/cjs/step-container-v2/components/StepContainerV2/context.js +13 -0
  61. package/dist/cjs/step-container-v2/components/StepContainerV2/context.js.map +1 -0
  62. package/dist/cjs/step-container-v2/components/StepContainerV2/style.scss +21 -0
  63. package/dist/cjs/step-container-v2/components/StepCounter/StepCounter.js +17 -0
  64. package/dist/cjs/step-container-v2/components/StepCounter/StepCounter.js.map +1 -0
  65. package/dist/cjs/step-container-v2/components/StepCounter/style.scss +4 -0
  66. package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBar.js +17 -0
  67. package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBar.js.map +1 -0
  68. package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js +31 -0
  69. package/dist/cjs/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js.map +1 -0
  70. package/dist/cjs/step-container-v2/components/StickyBottomBar/style.scss +56 -0
  71. package/dist/cjs/step-container-v2/components/TopBar/TopBar.js +55 -0
  72. package/dist/cjs/step-container-v2/components/TopBar/TopBar.js.map +1 -0
  73. package/dist/cjs/step-container-v2/components/TopBar/TopBarRenderer.js +32 -0
  74. package/dist/cjs/step-container-v2/components/TopBar/TopBarRenderer.js.map +1 -0
  75. package/dist/cjs/step-container-v2/components/TopBar/style.scss +75 -0
  76. package/dist/cjs/step-container-v2/components/buttons/BackButton/BackButton.js +29 -0
  77. package/dist/cjs/step-container-v2/components/buttons/BackButton/BackButton.js.map +1 -0
  78. package/dist/cjs/step-container-v2/components/buttons/BackButton/style.scss +16 -0
  79. package/dist/cjs/step-container-v2/components/buttons/LinkButton/LinkButton.js +18 -0
  80. package/dist/cjs/step-container-v2/components/buttons/LinkButton/LinkButton.js.map +1 -0
  81. package/dist/cjs/step-container-v2/components/buttons/LinkButton/style.scss +6 -0
  82. package/dist/cjs/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js +18 -0
  83. package/dist/cjs/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js.map +1 -0
  84. package/dist/cjs/step-container-v2/components/buttons/PrimaryButton/style.scss +6 -0
  85. package/dist/cjs/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js +18 -0
  86. package/dist/cjs/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js.map +1 -0
  87. package/dist/cjs/step-container-v2/components/buttons/SecondaryButton/style.scss +6 -0
  88. package/dist/cjs/step-container-v2/components/buttons/SkipButton/SkipButton.js +28 -0
  89. package/dist/cjs/step-container-v2/components/buttons/SkipButton/SkipButton.js.map +1 -0
  90. package/dist/cjs/step-container-v2/contexts/StepContainerV2Context.js +17 -0
  91. package/dist/cjs/step-container-v2/contexts/StepContainerV2Context.js.map +1 -0
  92. package/dist/cjs/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js +18 -0
  93. package/dist/cjs/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js.map +1 -0
  94. package/dist/cjs/step-container-v2/helpers/normalizeButtonProps.js +13 -0
  95. package/dist/cjs/step-container-v2/helpers/normalizeButtonProps.js.map +1 -0
  96. package/dist/cjs/step-container-v2/helpers/wireframe-placeholder.js +18 -0
  97. package/dist/cjs/step-container-v2/helpers/wireframe-placeholder.js.map +1 -0
  98. package/dist/cjs/step-container-v2/helpers/withStepContainerV2ContextDecorator.js +15 -0
  99. package/dist/cjs/step-container-v2/helpers/withStepContainerV2ContextDecorator.js.map +1 -0
  100. package/dist/cjs/step-container-v2/index.js +41 -0
  101. package/dist/cjs/step-container-v2/index.js.map +1 -0
  102. package/dist/cjs/step-container-v2/types.js +3 -0
  103. package/dist/cjs/step-container-v2/types.js.map +1 -0
  104. package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js +26 -0
  105. package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js.map +1 -0
  106. package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js +52 -0
  107. package/dist/cjs/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js.map +1 -0
  108. package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js +26 -0
  109. package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js.map +1 -0
  110. package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js +25 -0
  111. package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js.map +1 -0
  112. package/dist/cjs/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/style.scss +14 -0
  113. package/dist/cjs/step-container-v2/wireframes/Loading/Loading.js +30 -0
  114. package/dist/cjs/step-container-v2/wireframes/Loading/Loading.js.map +1 -0
  115. package/dist/cjs/step-container-v2/wireframes/Loading/Loading.stories.js +29 -0
  116. package/dist/cjs/step-container-v2/wireframes/Loading/Loading.stories.js.map +1 -0
  117. package/dist/cjs/step-container-v2/wireframes/Loading/style.scss +22 -0
  118. package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js +17 -0
  119. package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js.map +1 -0
  120. package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js +17 -0
  121. package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js.map +1 -0
  122. package/dist/cjs/step-container-v2/wireframes/PlaygroundLayout/style.scss +5 -0
  123. package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js +38 -0
  124. package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js.map +1 -0
  125. package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js +28 -0
  126. package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js.map +1 -0
  127. package/dist/cjs/step-container-v2/wireframes/TwoColumnLayout/style.scss +15 -0
  128. package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.js +17 -0
  129. package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.js.map +1 -0
  130. package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.stories.js +41 -0
  131. package/dist/cjs/step-container-v2/wireframes/WideLayout/WideLayout.stories.js.map +1 -0
  132. package/dist/cjs/step-navigation-link/index.js +2 -2
  133. package/dist/cjs/step-navigation-link/index.js.map +1 -1
  134. package/dist/cjs/step-navigation-link/style.scss +5 -3
  135. package/dist/cjs/titles/styles.scss +2 -2
  136. package/dist/cjs/upload-and-set-site-logo.js +4 -5
  137. package/dist/cjs/upload-and-set-site-logo.js.map +1 -1
  138. package/dist/cjs/utils/contrastChecker.js +1 -22
  139. package/dist/cjs/utils/contrastChecker.js.map +1 -1
  140. package/dist/cjs/utils/flows.js +73 -117
  141. package/dist/cjs/utils/flows.js.map +1 -1
  142. package/dist/cjs/utils/is-domain.js +1 -2
  143. package/dist/cjs/utils/is-domain.js.map +1 -1
  144. package/dist/cjs/utils/use-data-loss-warning.js +1 -2
  145. package/dist/cjs/utils/use-data-loss-warning.js.map +1 -1
  146. package/dist/cjs/wpcom-request.js +24 -0
  147. package/dist/cjs/wpcom-request.js.map +1 -0
  148. package/dist/esm/action-buttons/index.js +1 -11
  149. package/dist/esm/action-buttons/index.js.map +1 -1
  150. package/dist/esm/action-buttons/style.scss +4 -40
  151. package/dist/esm/cart/create-cart-manager-client.js +1 -1
  152. package/dist/esm/cart/create-cart-manager-client.js.map +1 -1
  153. package/dist/esm/cart/index.js +40 -61
  154. package/dist/esm/cart/index.js.map +1 -1
  155. package/dist/esm/confetti/index.js +1 -1
  156. package/dist/esm/confetti/index.js.map +1 -1
  157. package/dist/esm/flow-progress/use-flow-progress.js +1 -58
  158. package/dist/esm/flow-progress/use-flow-progress.js.map +1 -1
  159. package/dist/esm/hooks/use-persisted-state.js +57 -0
  160. package/dist/esm/hooks/use-persisted-state.js.map +1 -0
  161. package/dist/esm/hooray/index.js +1 -1
  162. package/dist/esm/index.js +6 -5
  163. package/dist/esm/index.js.map +1 -1
  164. package/dist/esm/mshots-image/index.js +33 -13
  165. package/dist/esm/mshots-image/index.js.map +1 -1
  166. package/dist/esm/mshots-image/style.scss +1 -0
  167. package/dist/esm/navigator/navigator-buttons/index.js.map +1 -1
  168. package/dist/esm/navigator/navigator-header/index.js.map +1 -1
  169. package/dist/esm/navigator/navigator-screens/hooks/use-navigator-screens.js +1 -1
  170. package/dist/esm/navigator/navigator-screens/hooks/use-navigator-screens.js.map +1 -1
  171. package/dist/esm/navigator/navigator-screens/navigator-screens.js +8 -3
  172. package/dist/esm/navigator/navigator-screens/navigator-screens.js.map +1 -1
  173. package/dist/esm/select-card-checkbox/index.js +4 -3
  174. package/dist/esm/select-card-checkbox/index.js.map +1 -1
  175. package/dist/esm/select-card-checkbox/style.scss +11 -14
  176. package/dist/esm/select-card-checkbox-v2/index.js +12 -0
  177. package/dist/esm/select-card-checkbox-v2/index.js.map +1 -0
  178. package/dist/esm/select-card-checkbox-v2/style.scss +25 -0
  179. package/dist/esm/select-items/index.js +3 -2
  180. package/dist/esm/select-items/index.js.map +1 -1
  181. package/dist/esm/select-items/style.scss +2 -1
  182. package/dist/esm/setup-tailored-site-after-creation.js +9 -37
  183. package/dist/esm/setup-tailored-site-after-creation.js.map +1 -1
  184. package/dist/esm/step-container/index.js +11 -13
  185. package/dist/esm/step-container/index.js.map +1 -1
  186. package/dist/esm/step-container/style.scss +35 -77
  187. package/dist/esm/step-container-v2/components/ContentRow/ContentRow.js +9 -0
  188. package/dist/esm/step-container-v2/components/ContentRow/ContentRow.js.map +1 -0
  189. package/dist/esm/step-container-v2/components/ContentRow/style.scss +26 -0
  190. package/dist/esm/step-container-v2/components/ContentWrapper/ContentWrapper.js +14 -0
  191. package/dist/esm/step-container-v2/components/ContentWrapper/ContentWrapper.js.map +1 -0
  192. package/dist/esm/step-container-v2/components/ContentWrapper/style.scss +70 -0
  193. package/dist/esm/step-container-v2/components/Heading/Heading.js +12 -0
  194. package/dist/esm/step-container-v2/components/Heading/Heading.js.map +1 -0
  195. package/dist/esm/step-container-v2/components/Heading/style.scss +47 -0
  196. package/dist/esm/step-container-v2/components/StepContainerV2/StepContainerV2.js +32 -0
  197. package/dist/esm/step-container-v2/components/StepContainerV2/StepContainerV2.js.map +1 -0
  198. package/dist/esm/step-container-v2/components/StepContainerV2/context.js +10 -0
  199. package/dist/esm/step-container-v2/components/StepContainerV2/context.js.map +1 -0
  200. package/dist/esm/step-container-v2/components/StepContainerV2/style.scss +21 -0
  201. package/dist/esm/step-container-v2/components/StepCounter/StepCounter.js +13 -0
  202. package/dist/esm/step-container-v2/components/StepCounter/StepCounter.js.map +1 -0
  203. package/dist/esm/step-container-v2/components/StepCounter/style.scss +4 -0
  204. package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBar.js +12 -0
  205. package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBar.js.map +1 -0
  206. package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js +27 -0
  207. package/dist/esm/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.js.map +1 -0
  208. package/dist/esm/step-container-v2/components/StickyBottomBar/style.scss +56 -0
  209. package/dist/esm/step-container-v2/components/TopBar/TopBar.js +49 -0
  210. package/dist/esm/step-container-v2/components/TopBar/TopBar.js.map +1 -0
  211. package/dist/esm/step-container-v2/components/TopBar/TopBarRenderer.js +27 -0
  212. package/dist/esm/step-container-v2/components/TopBar/TopBarRenderer.js.map +1 -0
  213. package/dist/esm/step-container-v2/components/TopBar/style.scss +75 -0
  214. package/dist/esm/step-container-v2/components/buttons/BackButton/BackButton.js +25 -0
  215. package/dist/esm/step-container-v2/components/buttons/BackButton/BackButton.js.map +1 -0
  216. package/dist/esm/step-container-v2/components/buttons/BackButton/style.scss +16 -0
  217. package/dist/esm/step-container-v2/components/buttons/LinkButton/LinkButton.js +14 -0
  218. package/dist/esm/step-container-v2/components/buttons/LinkButton/LinkButton.js.map +1 -0
  219. package/dist/esm/step-container-v2/components/buttons/LinkButton/style.scss +6 -0
  220. package/dist/esm/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js +14 -0
  221. package/dist/esm/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.js.map +1 -0
  222. package/dist/esm/step-container-v2/components/buttons/PrimaryButton/style.scss +6 -0
  223. package/dist/esm/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js +14 -0
  224. package/dist/esm/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.js.map +1 -0
  225. package/dist/esm/step-container-v2/components/buttons/SecondaryButton/style.scss +6 -0
  226. package/dist/esm/step-container-v2/components/buttons/SkipButton/SkipButton.js +24 -0
  227. package/dist/esm/step-container-v2/components/buttons/SkipButton/SkipButton.js.map +1 -0
  228. package/dist/esm/step-container-v2/contexts/StepContainerV2Context.js +13 -0
  229. package/dist/esm/step-container-v2/contexts/StepContainerV2Context.js.map +1 -0
  230. package/dist/esm/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js +14 -0
  231. package/dist/esm/step-container-v2/helpers/decorateButtonWithTracksEventRecording.js.map +1 -0
  232. package/dist/esm/step-container-v2/helpers/normalizeButtonProps.js +8 -0
  233. package/dist/esm/step-container-v2/helpers/normalizeButtonProps.js.map +1 -0
  234. package/dist/esm/step-container-v2/helpers/wireframe-placeholder.js +15 -0
  235. package/dist/esm/step-container-v2/helpers/wireframe-placeholder.js.map +1 -0
  236. package/dist/esm/step-container-v2/helpers/withStepContainerV2ContextDecorator.js +11 -0
  237. package/dist/esm/step-container-v2/helpers/withStepContainerV2ContextDecorator.js.map +1 -0
  238. package/dist/esm/step-container-v2/index.js +22 -0
  239. package/dist/esm/step-container-v2/index.js.map +1 -0
  240. package/dist/esm/step-container-v2/types.js +2 -0
  241. package/dist/esm/step-container-v2/types.js.map +1 -0
  242. package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js +22 -0
  243. package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.js.map +1 -0
  244. package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js +45 -0
  245. package/dist/esm/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.js.map +1 -0
  246. package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js +23 -0
  247. package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.js.map +1 -0
  248. package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js +21 -0
  249. package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.js.map +1 -0
  250. package/dist/esm/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/style.scss +14 -0
  251. package/dist/esm/step-container-v2/wireframes/Loading/Loading.js +26 -0
  252. package/dist/esm/step-container-v2/wireframes/Loading/Loading.js.map +1 -0
  253. package/dist/esm/step-container-v2/wireframes/Loading/Loading.stories.js +22 -0
  254. package/dist/esm/step-container-v2/wireframes/Loading/Loading.stories.js.map +1 -0
  255. package/dist/esm/step-container-v2/wireframes/Loading/style.scss +22 -0
  256. package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js +12 -0
  257. package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.js.map +1 -0
  258. package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js +13 -0
  259. package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.js.map +1 -0
  260. package/dist/esm/step-container-v2/wireframes/PlaygroundLayout/style.scss +5 -0
  261. package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js +33 -0
  262. package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.js.map +1 -0
  263. package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js +22 -0
  264. package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.js.map +1 -0
  265. package/dist/esm/step-container-v2/wireframes/TwoColumnLayout/style.scss +15 -0
  266. package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.js +13 -0
  267. package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.js.map +1 -0
  268. package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.stories.js +36 -0
  269. package/dist/esm/step-container-v2/wireframes/WideLayout/WideLayout.stories.js.map +1 -0
  270. package/dist/esm/step-navigation-link/index.js +2 -2
  271. package/dist/esm/step-navigation-link/index.js.map +1 -1
  272. package/dist/esm/step-navigation-link/style.scss +5 -3
  273. package/dist/esm/titles/styles.scss +2 -2
  274. package/dist/esm/upload-and-set-site-logo.js +1 -1
  275. package/dist/esm/upload-and-set-site-logo.js.map +1 -1
  276. package/dist/esm/utils/contrastChecker.js +0 -20
  277. package/dist/esm/utils/contrastChecker.js.map +1 -1
  278. package/dist/esm/utils/flows.js +57 -96
  279. package/dist/esm/utils/flows.js.map +1 -1
  280. package/dist/esm/wpcom-request.js +18 -0
  281. package/dist/esm/wpcom-request.js.map +1 -0
  282. package/dist/styles/mixins.scss +4 -4
  283. package/dist/styles/variables.scss +2 -2
  284. package/dist/tsconfig-cjs.tsbuildinfo +1 -1
  285. package/dist/tsconfig.tsbuildinfo +1 -1
  286. package/dist/types/action-buttons/index.d.ts +0 -4
  287. package/dist/types/action-buttons/index.d.ts.map +1 -1
  288. package/dist/types/cart/index.d.ts +7 -4
  289. package/dist/types/cart/index.d.ts.map +1 -1
  290. package/dist/types/flow-progress/use-flow-progress.d.ts.map +1 -1
  291. package/dist/types/hooks/use-persisted-state.d.ts +26 -0
  292. package/dist/types/hooks/use-persisted-state.d.ts.map +1 -0
  293. package/dist/types/index.d.ts +6 -5
  294. package/dist/types/index.d.ts.map +1 -1
  295. package/dist/types/intent-screen/index.d.ts.map +1 -1
  296. package/dist/types/mshots-image/index.d.ts +2 -1
  297. package/dist/types/mshots-image/index.d.ts.map +1 -1
  298. package/dist/types/navigator/hooks/use-navigator-listener.d.ts.map +1 -1
  299. package/dist/types/navigator/navigator-buttons/index.d.ts +1 -1
  300. package/dist/types/navigator/navigator-buttons/index.d.ts.map +1 -1
  301. package/dist/types/navigator/navigator-header/index.d.ts +1 -1
  302. package/dist/types/navigator/navigator-header/index.d.ts.map +1 -1
  303. package/dist/types/navigator/navigator-item-group/index.d.ts +0 -1
  304. package/dist/types/navigator/navigator-item-group/index.d.ts.map +1 -1
  305. package/dist/types/navigator/navigator-listener/index.d.ts.map +1 -1
  306. package/dist/types/navigator/navigator-screen/index.d.ts.map +1 -1
  307. package/dist/types/navigator/navigator-screens/hooks/use-navigator-buttons.d.ts.map +1 -1
  308. package/dist/types/navigator/navigator-screens/hooks/use-navigator-screens.d.ts.map +1 -1
  309. package/dist/types/navigator/navigator-screens/navigator-screens.d.ts +4 -2
  310. package/dist/types/navigator/navigator-screens/navigator-screens.d.ts.map +1 -1
  311. package/dist/types/navigator/navigator-screens/types.d.ts +1 -1
  312. package/dist/types/navigator/navigator-screens/types.d.ts.map +1 -1
  313. package/dist/types/progress/index.d.ts.map +1 -1
  314. package/dist/types/select-card-checkbox/index.d.ts +3 -1
  315. package/dist/types/select-card-checkbox/index.d.ts.map +1 -1
  316. package/dist/types/select-card-checkbox-v2/index.d.ts +12 -0
  317. package/dist/types/select-card-checkbox-v2/index.d.ts.map +1 -0
  318. package/dist/types/select-items/index.d.ts +1 -1
  319. package/dist/types/select-items/index.d.ts.map +1 -1
  320. package/dist/types/setup-tailored-site-after-creation.d.ts +1 -1
  321. package/dist/types/setup-tailored-site-after-creation.d.ts.map +1 -1
  322. package/dist/types/step-container/index.d.ts +3 -4
  323. package/dist/types/step-container/index.d.ts.map +1 -1
  324. package/dist/types/step-container-v2/components/ContentRow/ContentRow.d.ts +9 -0
  325. package/dist/types/step-container-v2/components/ContentRow/ContentRow.d.ts.map +1 -0
  326. package/dist/types/step-container-v2/components/ContentWrapper/ContentWrapper.d.ts +15 -0
  327. package/dist/types/step-container-v2/components/ContentWrapper/ContentWrapper.d.ts.map +1 -0
  328. package/dist/types/step-container-v2/components/Heading/Heading.d.ts +11 -0
  329. package/dist/types/step-container-v2/components/Heading/Heading.d.ts.map +1 -0
  330. package/dist/types/step-container-v2/components/StepContainerV2/StepContainerV2.d.ts +7 -0
  331. package/dist/types/step-container-v2/components/StepContainerV2/StepContainerV2.d.ts.map +1 -0
  332. package/dist/types/step-container-v2/components/StepContainerV2/context.d.ts +12 -0
  333. package/dist/types/step-container-v2/components/StepContainerV2/context.d.ts.map +1 -0
  334. package/dist/types/step-container-v2/components/StepCounter/StepCounter.d.ts +7 -0
  335. package/dist/types/step-container-v2/components/StepCounter/StepCounter.d.ts.map +1 -0
  336. package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBar.d.ts +14 -0
  337. package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBar.d.ts.map +1 -0
  338. package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.d.ts +5 -0
  339. package/dist/types/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.d.ts.map +1 -0
  340. package/dist/types/step-container-v2/components/TopBar/TopBar.d.ts +25 -0
  341. package/dist/types/step-container-v2/components/TopBar/TopBar.d.ts.map +1 -0
  342. package/dist/types/step-container-v2/components/TopBar/TopBarRenderer.d.ts +6 -0
  343. package/dist/types/step-container-v2/components/TopBar/TopBarRenderer.d.ts.map +1 -0
  344. package/dist/types/step-container-v2/components/buttons/BackButton/BackButton.d.ts +6 -0
  345. package/dist/types/step-container-v2/components/buttons/BackButton/BackButton.d.ts.map +1 -0
  346. package/dist/types/step-container-v2/components/buttons/LinkButton/LinkButton.d.ts +4 -0
  347. package/dist/types/step-container-v2/components/buttons/LinkButton/LinkButton.d.ts.map +1 -0
  348. package/dist/types/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.d.ts +4 -0
  349. package/dist/types/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.d.ts.map +1 -0
  350. package/dist/types/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.d.ts +4 -0
  351. package/dist/types/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.d.ts.map +1 -0
  352. package/dist/types/step-container-v2/components/buttons/SkipButton/SkipButton.d.ts +9 -0
  353. package/dist/types/step-container-v2/components/buttons/SkipButton/SkipButton.d.ts.map +1 -0
  354. package/dist/types/step-container-v2/contexts/StepContainerV2Context.d.ts +10 -0
  355. package/dist/types/step-container-v2/contexts/StepContainerV2Context.d.ts.map +1 -0
  356. package/dist/types/step-container-v2/helpers/decorateButtonWithTracksEventRecording.d.ts +8 -0
  357. package/dist/types/step-container-v2/helpers/decorateButtonWithTracksEventRecording.d.ts.map +1 -0
  358. package/dist/types/step-container-v2/helpers/normalizeButtonProps.d.ts +5 -0
  359. package/dist/types/step-container-v2/helpers/normalizeButtonProps.d.ts.map +1 -0
  360. package/dist/types/step-container-v2/helpers/wireframe-placeholder.d.ts +7 -0
  361. package/dist/types/step-container-v2/helpers/wireframe-placeholder.d.ts.map +1 -0
  362. package/dist/types/step-container-v2/helpers/withStepContainerV2ContextDecorator.d.ts +2 -0
  363. package/dist/types/step-container-v2/helpers/withStepContainerV2ContextDecorator.d.ts.map +1 -0
  364. package/dist/types/step-container-v2/index.d.ts +22 -0
  365. package/dist/types/step-container-v2/index.d.ts.map +1 -0
  366. package/dist/types/step-container-v2/types.d.ts +4 -0
  367. package/dist/types/step-container-v2/types.d.ts.map +1 -0
  368. package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.d.ts +16 -0
  369. package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.d.ts.map +1 -0
  370. package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.d.ts +9 -0
  371. package/dist/types/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.d.ts.map +1 -0
  372. package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.d.ts +18 -0
  373. package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.d.ts.map +1 -0
  374. package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.d.ts +6 -0
  375. package/dist/types/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.d.ts.map +1 -0
  376. package/dist/types/step-container-v2/wireframes/Loading/Loading.d.ts +12 -0
  377. package/dist/types/step-container-v2/wireframes/Loading/Loading.d.ts.map +1 -0
  378. package/dist/types/step-container-v2/wireframes/Loading/Loading.stories.d.ts +9 -0
  379. package/dist/types/step-container-v2/wireframes/Loading/Loading.stories.d.ts.map +1 -0
  380. package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.d.ts +10 -0
  381. package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.d.ts.map +1 -0
  382. package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.d.ts +6 -0
  383. package/dist/types/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.d.ts.map +1 -0
  384. package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.d.ts +20 -0
  385. package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.d.ts.map +1 -0
  386. package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.d.ts +8 -0
  387. package/dist/types/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.d.ts.map +1 -0
  388. package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.d.ts +13 -0
  389. package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.d.ts.map +1 -0
  390. package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.stories.d.ts +9 -0
  391. package/dist/types/step-container-v2/wireframes/WideLayout/WideLayout.stories.d.ts.map +1 -0
  392. package/dist/types/step-navigation-link/index.d.ts +1 -1
  393. package/dist/types/step-navigation-link/index.d.ts.map +1 -1
  394. package/dist/types/upload-and-set-site-logo.d.ts +1 -1
  395. package/dist/types/upload-and-set-site-logo.d.ts.map +1 -1
  396. package/dist/types/utils/contrastChecker.d.ts +0 -10
  397. package/dist/types/utils/contrastChecker.d.ts.map +1 -1
  398. package/dist/types/utils/domain-suggester.d.ts.map +1 -1
  399. package/dist/types/utils/flows.d.ts +37 -46
  400. package/dist/types/utils/flows.d.ts.map +1 -1
  401. package/dist/types/wpcom-request.d.ts +7 -0
  402. package/dist/types/wpcom-request.d.ts.map +1 -0
  403. package/jest.config.js +0 -1
  404. package/package.json +44 -23
  405. package/src/action-buttons/index.tsx +0 -40
  406. package/src/action-buttons/style.scss +4 -40
  407. package/src/cart/create-cart-manager-client.ts +1 -1
  408. package/src/cart/index.tsx +60 -103
  409. package/src/cart/test/index.ts +14 -14
  410. package/src/confetti/index.tsx +1 -1
  411. package/src/flow-progress/use-flow-progress.ts +1 -66
  412. package/src/hooks/test/index.ts +54 -0
  413. package/src/hooks/use-persisted-state.ts +85 -0
  414. package/src/hooray/index.tsx +1 -1
  415. package/src/index.ts +7 -12
  416. package/src/intent-screen/test/index.tsx +10 -7
  417. package/src/mshots-image/index.tsx +52 -21
  418. package/src/mshots-image/style.scss +1 -0
  419. package/src/navigator/navigator-buttons/index.tsx +1 -0
  420. package/src/navigator/navigator-header/index.tsx +1 -0
  421. package/src/navigator/navigator-screens/hooks/use-navigator-screens.tsx +5 -1
  422. package/src/navigator/navigator-screens/navigator-screens.tsx +17 -0
  423. package/src/navigator/navigator-screens/types.ts +1 -0
  424. package/src/select-card-checkbox/index.tsx +10 -4
  425. package/src/select-card-checkbox/style.scss +11 -14
  426. package/src/select-card-checkbox-v2/index.tsx +51 -0
  427. package/src/select-card-checkbox-v2/style.scss +25 -0
  428. package/src/select-card-checkbox-v2/test/index.test.tsx +49 -0
  429. package/src/select-items/index.tsx +10 -4
  430. package/src/select-items/style.scss +2 -1
  431. package/src/setup-tailored-site-after-creation.ts +16 -60
  432. package/src/step-container/index.tsx +21 -42
  433. package/src/step-container/style.scss +35 -77
  434. package/src/step-container-v2/README.md +235 -0
  435. package/src/step-container-v2/components/ContentRow/ContentRow.tsx +27 -0
  436. package/src/step-container-v2/components/ContentRow/style.scss +26 -0
  437. package/src/step-container-v2/components/ContentWrapper/ContentWrapper.tsx +41 -0
  438. package/src/step-container-v2/components/ContentWrapper/style.scss +70 -0
  439. package/src/step-container-v2/components/Heading/Heading.tsx +31 -0
  440. package/src/step-container-v2/components/Heading/style.scss +47 -0
  441. package/src/step-container-v2/components/StepContainerV2/StepContainerV2.tsx +55 -0
  442. package/src/step-container-v2/components/StepContainerV2/context.ts +25 -0
  443. package/src/step-container-v2/components/StepContainerV2/style.scss +21 -0
  444. package/src/step-container-v2/components/StepCounter/StepCounter.tsx +32 -0
  445. package/src/step-container-v2/components/StepCounter/style.scss +4 -0
  446. package/src/step-container-v2/components/StickyBottomBar/StickyBottomBar.tsx +46 -0
  447. package/src/step-container-v2/components/StickyBottomBar/StickyBottomBarRenderer.tsx +41 -0
  448. package/src/step-container-v2/components/StickyBottomBar/style.scss +56 -0
  449. package/src/step-container-v2/components/TopBar/TopBar.tsx +116 -0
  450. package/src/step-container-v2/components/TopBar/TopBarRenderer.tsx +43 -0
  451. package/src/step-container-v2/components/TopBar/style.scss +75 -0
  452. package/src/step-container-v2/components/buttons/BackButton/BackButton.tsx +32 -0
  453. package/src/step-container-v2/components/buttons/BackButton/style.scss +16 -0
  454. package/src/step-container-v2/components/buttons/LinkButton/LinkButton.tsx +17 -0
  455. package/src/step-container-v2/components/buttons/LinkButton/style.scss +6 -0
  456. package/src/step-container-v2/components/buttons/PrimaryButton/PrimaryButton.tsx +17 -0
  457. package/src/step-container-v2/components/buttons/PrimaryButton/style.scss +6 -0
  458. package/src/step-container-v2/components/buttons/SecondaryButton/SecondaryButton.tsx +17 -0
  459. package/src/step-container-v2/components/buttons/SecondaryButton/style.scss +6 -0
  460. package/src/step-container-v2/components/buttons/SkipButton/SkipButton.tsx +30 -0
  461. package/src/step-container-v2/contexts/StepContainerV2Context.ts +23 -0
  462. package/src/step-container-v2/helpers/decorateButtonWithTracksEventRecording.ts +28 -0
  463. package/src/step-container-v2/helpers/normalizeButtonProps.ts +14 -0
  464. package/src/step-container-v2/helpers/wireframe-placeholder.tsx +28 -0
  465. package/src/step-container-v2/helpers/withStepContainerV2ContextDecorator.tsx +16 -0
  466. package/src/step-container-v2/index.tsx +24 -0
  467. package/src/step-container-v2/types.ts +4 -0
  468. package/src/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.stories.tsx +122 -0
  469. package/src/step-container-v2/wireframes/CenteredColumnLayout/CenteredColumnLayout.tsx +66 -0
  470. package/src/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.stories.tsx +51 -0
  471. package/src/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/FixedColumnOnTheLeftLayout.tsx +69 -0
  472. package/src/step-container-v2/wireframes/FixedColumnOnTheLeftLayout/style.scss +14 -0
  473. package/src/step-container-v2/wireframes/Loading/Loading.stories.tsx +27 -0
  474. package/src/step-container-v2/wireframes/Loading/Loading.tsx +52 -0
  475. package/src/step-container-v2/wireframes/Loading/style.scss +22 -0
  476. package/src/step-container-v2/wireframes/Loading/test/Loading.test.tsx +42 -0
  477. package/src/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.stories.tsx +21 -0
  478. package/src/step-container-v2/wireframes/PlaygroundLayout/PlaygroundLayout.tsx +31 -0
  479. package/src/step-container-v2/wireframes/PlaygroundLayout/style.scss +5 -0
  480. package/src/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.stories.tsx +93 -0
  481. package/src/step-container-v2/wireframes/TwoColumnLayout/TwoColumnLayout.tsx +93 -0
  482. package/src/step-container-v2/wireframes/TwoColumnLayout/style.scss +15 -0
  483. package/src/step-container-v2/wireframes/WideLayout/WideLayout.stories.tsx +83 -0
  484. package/src/step-container-v2/wireframes/WideLayout/WideLayout.tsx +44 -0
  485. package/src/step-navigation-link/index.tsx +3 -0
  486. package/src/step-navigation-link/style.scss +5 -3
  487. package/src/style-imports.d.ts +3 -0
  488. package/src/titles/styles.scss +2 -2
  489. package/src/upload-and-set-site-logo.ts +1 -1
  490. package/src/utils/contrastChecker.ts +0 -35
  491. package/src/utils/flows.ts +67 -123
  492. package/src/wpcom-request.ts +26 -0
  493. package/styles/mixins.scss +4 -4
  494. package/styles/variables.scss +2 -2
  495. package/tsconfig.json +1 -0
  496. package/dist/cjs/feature-icon/index.js +0 -19
  497. package/dist/cjs/feature-icon/index.js.map +0 -1
  498. package/dist/cjs/flow-progress/index.js +0 -14
  499. package/dist/cjs/flow-progress/index.js.map +0 -1
  500. package/dist/cjs/flow-progress/style.scss +0 -5
  501. package/dist/cjs/notice/index.js +0 -12
  502. package/dist/cjs/notice/index.js.map +0 -1
  503. package/dist/cjs/notice/style.scss +0 -19
  504. package/dist/cjs/select-card-radio/index.js +0 -21
  505. package/dist/cjs/select-card-radio/index.js.map +0 -1
  506. package/dist/cjs/select-card-radio/style.scss +0 -44
  507. package/dist/cjs/sensei-logo/index.js +0 -8
  508. package/dist/cjs/sensei-logo/index.js.map +0 -1
  509. package/dist/cjs/videopress-logo/index.js +0 -8
  510. package/dist/cjs/videopress-logo/index.js.map +0 -1
  511. package/dist/esm/feature-icon/index.js +0 -16
  512. package/dist/esm/feature-icon/index.js.map +0 -1
  513. package/dist/esm/flow-progress/index.js +0 -12
  514. package/dist/esm/flow-progress/index.js.map +0 -1
  515. package/dist/esm/flow-progress/style.scss +0 -5
  516. package/dist/esm/notice/index.js +0 -9
  517. package/dist/esm/notice/index.js.map +0 -1
  518. package/dist/esm/notice/style.scss +0 -19
  519. package/dist/esm/select-card-radio/index.js +0 -15
  520. package/dist/esm/select-card-radio/index.js.map +0 -1
  521. package/dist/esm/select-card-radio/style.scss +0 -44
  522. package/dist/esm/sensei-logo/index.js +0 -6
  523. package/dist/esm/sensei-logo/index.js.map +0 -1
  524. package/dist/esm/videopress-logo/index.js +0 -6
  525. package/dist/esm/videopress-logo/index.js.map +0 -1
  526. package/dist/types/feature-icon/index.d.ts +0 -9
  527. package/dist/types/feature-icon/index.d.ts.map +0 -1
  528. package/dist/types/flow-progress/index.d.ts +0 -9
  529. package/dist/types/flow-progress/index.d.ts.map +0 -1
  530. package/dist/types/notice/index.d.ts +0 -7
  531. package/dist/types/notice/index.d.ts.map +0 -1
  532. package/dist/types/select-card-radio/index.d.ts +0 -22
  533. package/dist/types/select-card-radio/index.d.ts.map +0 -1
  534. package/dist/types/sensei-logo/index.d.ts +0 -8
  535. package/dist/types/sensei-logo/index.d.ts.map +0 -1
  536. package/dist/types/videopress-logo/index.d.ts +0 -8
  537. package/dist/types/videopress-logo/index.d.ts.map +0 -1
  538. package/src/feature-icon/index.tsx +0 -102
  539. package/src/flow-progress/index.tsx +0 -22
  540. package/src/flow-progress/style.scss +0 -5
  541. package/src/notice/index.tsx +0 -16
  542. package/src/notice/style.scss +0 -19
  543. package/src/select-card-radio/index.tsx +0 -64
  544. package/src/select-card-radio/style.scss +0 -44
  545. package/src/select-card-radio/test/index.tsx +0 -50
  546. package/src/sensei-logo/index.tsx +0 -30
  547. 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,6 @@
1
+ .step-container-v2__link-button.components-button {
2
+ font-size: inherit;
3
+ line-height: inherit;
4
+ font-weight: 500;
5
+ text-decoration: underline;
6
+ }
@@ -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,6 @@
1
+ .step-container-v2__content-wrapper .step-container-v2__primary-button {
2
+ padding: 0.5rem 3rem;
3
+ font-size: 0.875rem;
4
+ line-height: 1;
5
+ justify-content: center;
6
+ }
@@ -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,6 @@
1
+ .step-container-v2__content-wrapper .step-container-v2__secondary-button {
2
+ padding: 0.5rem 3rem;
3
+ font-size: 0.875rem;
4
+ line-height: 1;
5
+ justify-content: center;
6
+ }
@@ -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';
@@ -0,0 +1,4 @@
1
+ import { Button } from '@wordpress/components';
2
+ import { ComponentProps } from 'react';
3
+
4
+ export type ButtonProps = ComponentProps< typeof Button >;