@automattic/plans-grid-next 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (619) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +3 -0
  3. package/dist/cjs/__mocks__/wpcom-proxy-request.js +17 -0
  4. package/dist/cjs/__mocks__/wpcom-proxy-request.js.map +1 -0
  5. package/dist/cjs/_media-queries.scss +14 -0
  6. package/dist/cjs/_mixins.scss +15 -0
  7. package/dist/cjs/_shared.scss +174 -0
  8. package/dist/cjs/components/comparison-grid/index.js +527 -0
  9. package/dist/cjs/components/comparison-grid/index.js.map +1 -0
  10. package/dist/cjs/components/comparison-grid/index.stories.js +74 -0
  11. package/dist/cjs/components/comparison-grid/index.stories.js.map +1 -0
  12. package/dist/cjs/components/comparison-grid/style.scss +318 -0
  13. package/dist/cjs/components/dropdown-option.js +33 -0
  14. package/dist/cjs/components/dropdown-option.js.map +1 -0
  15. package/dist/cjs/components/features-grid/billing-timeframes.js +15 -0
  16. package/dist/cjs/components/features-grid/billing-timeframes.js.map +1 -0
  17. package/dist/cjs/components/features-grid/client-logo-list/client-list.js +106 -0
  18. package/dist/cjs/components/features-grid/client-logo-list/client-list.js.map +1 -0
  19. package/dist/cjs/components/features-grid/client-logo-list/index.js +17 -0
  20. package/dist/cjs/components/features-grid/client-logo-list/index.js.map +1 -0
  21. package/dist/cjs/components/features-grid/client-logo-list/style.scss +52 -0
  22. package/dist/cjs/components/features-grid/enterprise-features.js +41 -0
  23. package/dist/cjs/components/features-grid/enterprise-features.js.map +1 -0
  24. package/dist/cjs/components/features-grid/index.js +130 -0
  25. package/dist/cjs/components/features-grid/index.js.map +1 -0
  26. package/dist/cjs/components/features-grid/index.stories.js +112 -0
  27. package/dist/cjs/components/features-grid/index.stories.js.map +1 -0
  28. package/dist/cjs/components/features-grid/mobile-free-domain.js +25 -0
  29. package/dist/cjs/components/features-grid/mobile-free-domain.js.map +1 -0
  30. package/dist/cjs/components/features-grid/plan-features-list.js +56 -0
  31. package/dist/cjs/components/features-grid/plan-features-list.js.map +1 -0
  32. package/dist/cjs/components/features-grid/plan-headers.js +15 -0
  33. package/dist/cjs/components/features-grid/plan-headers.js.map +1 -0
  34. package/dist/cjs/components/features-grid/plan-logos.js +12 -0
  35. package/dist/cjs/components/features-grid/plan-logos.js.map +1 -0
  36. package/dist/cjs/components/features-grid/plan-prices.js +14 -0
  37. package/dist/cjs/components/features-grid/plan-prices.js.map +1 -0
  38. package/dist/cjs/components/features-grid/plan-tagline.js +12 -0
  39. package/dist/cjs/components/features-grid/plan-tagline.js.map +1 -0
  40. package/dist/cjs/components/features-grid/previous-features-included-title.js +36 -0
  41. package/dist/cjs/components/features-grid/previous-features-included-title.js.map +1 -0
  42. package/dist/cjs/components/features-grid/spotlight-plan.js +24 -0
  43. package/dist/cjs/components/features-grid/spotlight-plan.js.map +1 -0
  44. package/dist/cjs/components/features-grid/spotlight-plan.scss +5 -0
  45. package/dist/cjs/components/features-grid/style.scss +630 -0
  46. package/dist/cjs/components/features-grid/table.js +38 -0
  47. package/dist/cjs/components/features-grid/table.js.map +1 -0
  48. package/dist/cjs/components/features-grid/top-buttons.js +15 -0
  49. package/dist/cjs/components/features-grid/top-buttons.js.map +1 -0
  50. package/dist/cjs/components/features.js +72 -0
  51. package/dist/cjs/components/features.js.map +1 -0
  52. package/dist/cjs/components/item.js +9 -0
  53. package/dist/cjs/components/item.js.map +1 -0
  54. package/dist/cjs/components/plan-button/index.js +21 -0
  55. package/dist/cjs/components/plan-button/index.js.map +1 -0
  56. package/dist/cjs/components/plan-button/style.scss +179 -0
  57. package/dist/cjs/components/plan-div-td-container.js +9 -0
  58. package/dist/cjs/components/plan-div-td-container.js.map +1 -0
  59. package/dist/cjs/components/plan-logo.js +45 -0
  60. package/dist/cjs/components/plan-logo.js.map +1 -0
  61. package/dist/cjs/components/plan-type-selector/components/interval-type-dropdown.js +39 -0
  62. package/dist/cjs/components/plan-type-selector/components/interval-type-dropdown.js.map +1 -0
  63. package/dist/cjs/components/plan-type-selector/components/interval-type-selector.js +12 -0
  64. package/dist/cjs/components/plan-type-selector/components/interval-type-selector.js.map +1 -0
  65. package/dist/cjs/components/plan-type-selector/components/interval-type-toggle.js +55 -0
  66. package/dist/cjs/components/plan-type-selector/components/interval-type-toggle.js.map +1 -0
  67. package/dist/cjs/components/plan-type-selector/components/popup-messages.js +108 -0
  68. package/dist/cjs/components/plan-type-selector/components/popup-messages.js.map +1 -0
  69. package/dist/cjs/components/plan-type-selector/hooks/use-interval-options.js +56 -0
  70. package/dist/cjs/components/plan-type-selector/hooks/use-interval-options.js.map +1 -0
  71. package/dist/cjs/components/plan-type-selector/hooks/use-max-discount.js +45 -0
  72. package/dist/cjs/components/plan-type-selector/hooks/use-max-discount.js.map +1 -0
  73. package/dist/cjs/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js +68 -0
  74. package/dist/cjs/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js.map +1 -0
  75. package/dist/cjs/components/plan-type-selector/index.js +27 -0
  76. package/dist/cjs/components/plan-type-selector/index.js.map +1 -0
  77. package/dist/cjs/components/plan-type-selector/style.scss +196 -0
  78. package/dist/cjs/components/plans-2023-tooltip.js +46 -0
  79. package/dist/cjs/components/plans-2023-tooltip.js.map +1 -0
  80. package/dist/cjs/components/popular-badge.js +16 -0
  81. package/dist/cjs/components/popular-badge.js.map +1 -0
  82. package/dist/cjs/components/shared/action-button/index.js +91 -0
  83. package/dist/cjs/components/shared/action-button/index.js.map +1 -0
  84. package/dist/cjs/components/shared/action-button/style.scss +12 -0
  85. package/dist/cjs/components/shared/billing-timeframe/index.js +58 -0
  86. package/dist/cjs/components/shared/billing-timeframe/index.js.map +1 -0
  87. package/dist/cjs/components/shared/header-price/header-price-context.js +14 -0
  88. package/dist/cjs/components/shared/header-price/header-price-context.js.map +1 -0
  89. package/dist/cjs/components/shared/header-price/index.js +102 -0
  90. package/dist/cjs/components/shared/header-price/index.js.map +1 -0
  91. package/dist/cjs/components/shared/header-price/style.scss +112 -0
  92. package/dist/cjs/components/shared/plan-pill/index.js +6 -0
  93. package/dist/cjs/components/shared/plan-pill/index.js.map +1 -0
  94. package/dist/cjs/components/shared/plan-pill/style.scss +30 -0
  95. package/dist/cjs/components/shared/storage/components/plan-storage.js +28 -0
  96. package/dist/cjs/components/shared/storage/components/plan-storage.js.map +1 -0
  97. package/dist/cjs/components/shared/storage/components/storage-dropdown.js +96 -0
  98. package/dist/cjs/components/shared/storage/components/storage-dropdown.js.map +1 -0
  99. package/dist/cjs/components/shared/storage/components/storage-feature-label.js +40 -0
  100. package/dist/cjs/components/shared/storage/components/storage-feature-label.js.map +1 -0
  101. package/dist/cjs/components/shared/storage/constants.js +6 -0
  102. package/dist/cjs/components/shared/storage/constants.js.map +1 -0
  103. package/dist/cjs/components/shared/storage/hooks/use-default-storage-option.js +26 -0
  104. package/dist/cjs/components/shared/storage/hooks/use-default-storage-option.js.map +1 -0
  105. package/dist/cjs/components/shared/storage/hooks/use-plan-storage.js +29 -0
  106. package/dist/cjs/components/shared/storage/hooks/use-plan-storage.js.map +1 -0
  107. package/dist/cjs/components/shared/storage/hooks/use-purchased-storage-add-on.js +51 -0
  108. package/dist/cjs/components/shared/storage/hooks/use-purchased-storage-add-on.js.map +1 -0
  109. package/dist/cjs/components/shared/storage/hooks/use-storage-string.js +13 -0
  110. package/dist/cjs/components/shared/storage/hooks/use-storage-string.js.map +1 -0
  111. package/dist/cjs/components/shared/storage/index.js +14 -0
  112. package/dist/cjs/components/shared/storage/index.js.map +1 -0
  113. package/dist/cjs/components/sticky-container.js +74 -0
  114. package/dist/cjs/components/sticky-container.js.map +1 -0
  115. package/dist/cjs/constants.js +11 -0
  116. package/dist/cjs/constants.js.map +1 -0
  117. package/dist/cjs/css-mixins.js +14 -0
  118. package/dist/cjs/css-mixins.js.map +1 -0
  119. package/dist/cjs/fixtures/plans.js +1542 -0
  120. package/dist/cjs/fixtures/plans.js.map +1 -0
  121. package/dist/cjs/fixtures/sites-plans.js +458 -0
  122. package/dist/cjs/fixtures/sites-plans.js.map +1 -0
  123. package/dist/cjs/fixtures/sites-purchases.js +133 -0
  124. package/dist/cjs/fixtures/sites-purchases.js.map +1 -0
  125. package/dist/cjs/grid-context.js +40 -0
  126. package/dist/cjs/grid-context.js.map +1 -0
  127. package/dist/cjs/hooks/data-store/is-popular-plan.js +9 -0
  128. package/dist/cjs/hooks/data-store/is-popular-plan.js.map +1 -0
  129. package/dist/cjs/hooks/data-store/types.js +3 -0
  130. package/dist/cjs/hooks/data-store/types.js.map +1 -0
  131. package/dist/cjs/hooks/data-store/use-grid-plan-for-spotlight.js +18 -0
  132. package/dist/cjs/hooks/data-store/use-grid-plan-for-spotlight.js.map +1 -0
  133. package/dist/cjs/hooks/data-store/use-grid-plans-for-comparison-grid.js +55 -0
  134. package/dist/cjs/hooks/data-store/use-grid-plans-for-comparison-grid.js.map +1 -0
  135. package/dist/cjs/hooks/data-store/use-grid-plans-for-features-grid.js +56 -0
  136. package/dist/cjs/hooks/data-store/use-grid-plans-for-features-grid.js.map +1 -0
  137. package/dist/cjs/hooks/data-store/use-grid-plans.js +254 -0
  138. package/dist/cjs/hooks/data-store/use-grid-plans.js.map +1 -0
  139. package/dist/cjs/hooks/data-store/use-highlight-labels.js +60 -0
  140. package/dist/cjs/hooks/data-store/use-highlight-labels.js.map +1 -0
  141. package/dist/cjs/hooks/data-store/use-highlighted-features.js +35 -0
  142. package/dist/cjs/hooks/data-store/use-highlighted-features.js.map +1 -0
  143. package/dist/cjs/hooks/data-store/use-plan-billing-description.js +216 -0
  144. package/dist/cjs/hooks/data-store/use-plan-billing-description.js.map +1 -0
  145. package/dist/cjs/hooks/data-store/use-plan-features-for-grid-plans.js +133 -0
  146. package/dist/cjs/hooks/data-store/use-plan-features-for-grid-plans.js.map +1 -0
  147. package/dist/cjs/hooks/data-store/use-plans-from-types.js +30 -0
  148. package/dist/cjs/hooks/data-store/use-plans-from-types.js.map +1 -0
  149. package/dist/cjs/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js +90 -0
  150. package/dist/cjs/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js.map +1 -0
  151. package/dist/cjs/hooks/use-grid-size.js +33 -0
  152. package/dist/cjs/hooks/use-grid-size.js.map +1 -0
  153. package/dist/cjs/hooks/use-highlight-adjacency-matrix.js +31 -0
  154. package/dist/cjs/hooks/use-highlight-adjacency-matrix.js.map +1 -0
  155. package/dist/cjs/hooks/use-is-large-currency.js +69 -0
  156. package/dist/cjs/hooks/use-is-large-currency.js.map +1 -0
  157. package/dist/cjs/hooks/use-manage-tooltip-toggle.js +29 -0
  158. package/dist/cjs/hooks/use-manage-tooltip-toggle.js.map +1 -0
  159. package/dist/cjs/hooks/use-plan-pricing-info-from-grid-plans.js +17 -0
  160. package/dist/cjs/hooks/use-plan-pricing-info-from-grid-plans.js.map +1 -0
  161. package/dist/cjs/index.js +36 -0
  162. package/dist/cjs/index.js.map +1 -0
  163. package/dist/cjs/lib/filter-unused-features-object.js +19 -0
  164. package/dist/cjs/lib/filter-unused-features-object.js.map +1 -0
  165. package/dist/cjs/lib/get-plan-features-object.js +11 -0
  166. package/dist/cjs/lib/get-plan-features-object.js.map +1 -0
  167. package/dist/cjs/lib/get-plan-pricing-info-from-grid-plans.js +16 -0
  168. package/dist/cjs/lib/get-plan-pricing-info-from-grid-plans.js.map +1 -0
  169. package/dist/cjs/lib/is-same-plan.js +12 -0
  170. package/dist/cjs/lib/is-same-plan.js.map +1 -0
  171. package/dist/cjs/lib/sort-plan-properties.js +39 -0
  172. package/dist/cjs/lib/sort-plan-properties.js.map +1 -0
  173. package/dist/cjs/lib/touch-detect/index.js +20 -0
  174. package/dist/cjs/lib/touch-detect/index.js.map +1 -0
  175. package/dist/cjs/types.js +3 -0
  176. package/dist/cjs/types.js.map +1 -0
  177. package/dist/esm/__mocks__/wpcom-proxy-request.js +11 -0
  178. package/dist/esm/__mocks__/wpcom-proxy-request.js.map +1 -0
  179. package/dist/esm/_media-queries.scss +14 -0
  180. package/dist/esm/_mixins.scss +15 -0
  181. package/dist/esm/_shared.scss +174 -0
  182. package/dist/esm/components/comparison-grid/index.js +524 -0
  183. package/dist/esm/components/comparison-grid/index.js.map +1 -0
  184. package/dist/esm/components/comparison-grid/index.stories.js +71 -0
  185. package/dist/esm/components/comparison-grid/index.stories.js.map +1 -0
  186. package/dist/esm/components/comparison-grid/style.scss +318 -0
  187. package/dist/esm/components/dropdown-option.js +30 -0
  188. package/dist/esm/components/dropdown-option.js.map +1 -0
  189. package/dist/esm/components/features-grid/billing-timeframes.js +12 -0
  190. package/dist/esm/components/features-grid/billing-timeframes.js.map +1 -0
  191. package/dist/esm/components/features-grid/client-logo-list/client-list.js +104 -0
  192. package/dist/esm/components/features-grid/client-logo-list/client-list.js.map +1 -0
  193. package/dist/esm/components/features-grid/client-logo-list/index.js +14 -0
  194. package/dist/esm/components/features-grid/client-logo-list/index.js.map +1 -0
  195. package/dist/esm/components/features-grid/client-logo-list/style.scss +52 -0
  196. package/dist/esm/components/features-grid/enterprise-features.js +38 -0
  197. package/dist/esm/components/features-grid/enterprise-features.js.map +1 -0
  198. package/dist/esm/components/features-grid/index.js +127 -0
  199. package/dist/esm/components/features-grid/index.js.map +1 -0
  200. package/dist/esm/components/features-grid/index.stories.js +109 -0
  201. package/dist/esm/components/features-grid/index.stories.js.map +1 -0
  202. package/dist/esm/components/features-grid/mobile-free-domain.js +23 -0
  203. package/dist/esm/components/features-grid/mobile-free-domain.js.map +1 -0
  204. package/dist/esm/components/features-grid/plan-features-list.js +53 -0
  205. package/dist/esm/components/features-grid/plan-features-list.js.map +1 -0
  206. package/dist/esm/components/features-grid/plan-headers.js +12 -0
  207. package/dist/esm/components/features-grid/plan-headers.js.map +1 -0
  208. package/dist/esm/components/features-grid/plan-logos.js +9 -0
  209. package/dist/esm/components/features-grid/plan-logos.js.map +1 -0
  210. package/dist/esm/components/features-grid/plan-prices.js +11 -0
  211. package/dist/esm/components/features-grid/plan-prices.js.map +1 -0
  212. package/dist/esm/components/features-grid/plan-tagline.js +9 -0
  213. package/dist/esm/components/features-grid/plan-tagline.js.map +1 -0
  214. package/dist/esm/components/features-grid/previous-features-included-title.js +33 -0
  215. package/dist/esm/components/features-grid/previous-features-included-title.js.map +1 -0
  216. package/dist/esm/components/features-grid/spotlight-plan.js +21 -0
  217. package/dist/esm/components/features-grid/spotlight-plan.js.map +1 -0
  218. package/dist/esm/components/features-grid/spotlight-plan.scss +5 -0
  219. package/dist/esm/components/features-grid/style.scss +630 -0
  220. package/dist/esm/components/features-grid/table.js +35 -0
  221. package/dist/esm/components/features-grid/table.js.map +1 -0
  222. package/dist/esm/components/features-grid/top-buttons.js +12 -0
  223. package/dist/esm/components/features-grid/top-buttons.js.map +1 -0
  224. package/dist/esm/components/features.js +69 -0
  225. package/dist/esm/components/features.js.map +1 -0
  226. package/dist/esm/components/item.js +5 -0
  227. package/dist/esm/components/item.js.map +1 -0
  228. package/dist/esm/components/plan-button/index.js +18 -0
  229. package/dist/esm/components/plan-button/index.js.map +1 -0
  230. package/dist/esm/components/plan-button/style.scss +179 -0
  231. package/dist/esm/components/plan-div-td-container.js +7 -0
  232. package/dist/esm/components/plan-div-td-container.js.map +1 -0
  233. package/dist/esm/components/plan-logo.js +42 -0
  234. package/dist/esm/components/plan-logo.js.map +1 -0
  235. package/dist/esm/components/plan-type-selector/components/interval-type-dropdown.js +34 -0
  236. package/dist/esm/components/plan-type-selector/components/interval-type-dropdown.js.map +1 -0
  237. package/dist/esm/components/plan-type-selector/components/interval-type-selector.js +8 -0
  238. package/dist/esm/components/plan-type-selector/components/interval-type-selector.js.map +1 -0
  239. package/dist/esm/components/plan-type-selector/components/interval-type-toggle.js +50 -0
  240. package/dist/esm/components/plan-type-selector/components/interval-type-toggle.js.map +1 -0
  241. package/dist/esm/components/plan-type-selector/components/popup-messages.js +105 -0
  242. package/dist/esm/components/plan-type-selector/components/popup-messages.js.map +1 -0
  243. package/dist/esm/components/plan-type-selector/hooks/use-interval-options.js +52 -0
  244. package/dist/esm/components/plan-type-selector/hooks/use-interval-options.js.map +1 -0
  245. package/dist/esm/components/plan-type-selector/hooks/use-max-discount.js +42 -0
  246. package/dist/esm/components/plan-type-selector/hooks/use-max-discount.js.map +1 -0
  247. package/dist/esm/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js +65 -0
  248. package/dist/esm/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js.map +1 -0
  249. package/dist/esm/components/plan-type-selector/index.js +24 -0
  250. package/dist/esm/components/plan-type-selector/index.js.map +1 -0
  251. package/dist/esm/components/plan-type-selector/style.scss +196 -0
  252. package/dist/esm/components/plans-2023-tooltip.js +41 -0
  253. package/dist/esm/components/plans-2023-tooltip.js.map +1 -0
  254. package/dist/esm/components/popular-badge.js +13 -0
  255. package/dist/esm/components/popular-badge.js.map +1 -0
  256. package/dist/esm/components/shared/action-button/index.js +88 -0
  257. package/dist/esm/components/shared/action-button/index.js.map +1 -0
  258. package/dist/esm/components/shared/action-button/style.scss +12 -0
  259. package/dist/esm/components/shared/billing-timeframe/index.js +55 -0
  260. package/dist/esm/components/shared/billing-timeframe/index.js.map +1 -0
  261. package/dist/esm/components/shared/header-price/header-price-context.js +10 -0
  262. package/dist/esm/components/shared/header-price/header-price-context.js.map +1 -0
  263. package/dist/esm/components/shared/header-price/index.js +99 -0
  264. package/dist/esm/components/shared/header-price/index.js.map +1 -0
  265. package/dist/esm/components/shared/header-price/style.scss +112 -0
  266. package/dist/esm/components/shared/plan-pill/index.js +4 -0
  267. package/dist/esm/components/shared/plan-pill/index.js.map +1 -0
  268. package/dist/esm/components/shared/plan-pill/style.scss +30 -0
  269. package/dist/esm/components/shared/storage/components/plan-storage.js +25 -0
  270. package/dist/esm/components/shared/storage/components/plan-storage.js.map +1 -0
  271. package/dist/esm/components/shared/storage/components/storage-dropdown.js +93 -0
  272. package/dist/esm/components/shared/storage/components/storage-dropdown.js.map +1 -0
  273. package/dist/esm/components/shared/storage/components/storage-feature-label.js +37 -0
  274. package/dist/esm/components/shared/storage/components/storage-feature-label.js.map +1 -0
  275. package/dist/esm/components/shared/storage/constants.js +3 -0
  276. package/dist/esm/components/shared/storage/constants.js.map +1 -0
  277. package/dist/esm/components/shared/storage/hooks/use-default-storage-option.js +22 -0
  278. package/dist/esm/components/shared/storage/hooks/use-default-storage-option.js.map +1 -0
  279. package/dist/esm/components/shared/storage/hooks/use-plan-storage.js +27 -0
  280. package/dist/esm/components/shared/storage/hooks/use-plan-storage.js.map +1 -0
  281. package/dist/esm/components/shared/storage/hooks/use-purchased-storage-add-on.js +48 -0
  282. package/dist/esm/components/shared/storage/hooks/use-purchased-storage-add-on.js.map +1 -0
  283. package/dist/esm/components/shared/storage/hooks/use-storage-string.js +11 -0
  284. package/dist/esm/components/shared/storage/hooks/use-storage-string.js.map +1 -0
  285. package/dist/esm/components/shared/storage/index.js +9 -0
  286. package/dist/esm/components/shared/storage/index.js.map +1 -0
  287. package/dist/esm/components/sticky-container.js +69 -0
  288. package/dist/esm/components/sticky-container.js.map +1 -0
  289. package/dist/esm/constants.js +8 -0
  290. package/dist/esm/constants.js.map +1 -0
  291. package/dist/esm/css-mixins.js +10 -0
  292. package/dist/esm/css-mixins.js.map +1 -0
  293. package/dist/esm/fixtures/plans.js +1540 -0
  294. package/dist/esm/fixtures/plans.js.map +1 -0
  295. package/dist/esm/fixtures/sites-plans.js +456 -0
  296. package/dist/esm/fixtures/sites-plans.js.map +1 -0
  297. package/dist/esm/fixtures/sites-purchases.js +131 -0
  298. package/dist/esm/fixtures/sites-purchases.js.map +1 -0
  299. package/dist/esm/grid-context.js +36 -0
  300. package/dist/esm/grid-context.js.map +1 -0
  301. package/dist/esm/hooks/data-store/is-popular-plan.js +5 -0
  302. package/dist/esm/hooks/data-store/is-popular-plan.js.map +1 -0
  303. package/dist/esm/hooks/data-store/types.js +2 -0
  304. package/dist/esm/hooks/data-store/types.js.map +1 -0
  305. package/dist/esm/hooks/data-store/use-grid-plan-for-spotlight.js +16 -0
  306. package/dist/esm/hooks/data-store/use-grid-plan-for-spotlight.js.map +1 -0
  307. package/dist/esm/hooks/data-store/use-grid-plans-for-comparison-grid.js +52 -0
  308. package/dist/esm/hooks/data-store/use-grid-plans-for-comparison-grid.js.map +1 -0
  309. package/dist/esm/hooks/data-store/use-grid-plans-for-features-grid.js +53 -0
  310. package/dist/esm/hooks/data-store/use-grid-plans-for-features-grid.js.map +1 -0
  311. package/dist/esm/hooks/data-store/use-grid-plans.js +249 -0
  312. package/dist/esm/hooks/data-store/use-grid-plans.js.map +1 -0
  313. package/dist/esm/hooks/data-store/use-highlight-labels.js +58 -0
  314. package/dist/esm/hooks/data-store/use-highlight-labels.js.map +1 -0
  315. package/dist/esm/hooks/data-store/use-highlighted-features.js +33 -0
  316. package/dist/esm/hooks/data-store/use-highlighted-features.js.map +1 -0
  317. package/dist/esm/hooks/data-store/use-plan-billing-description.js +213 -0
  318. package/dist/esm/hooks/data-store/use-plan-billing-description.js.map +1 -0
  319. package/dist/esm/hooks/data-store/use-plan-features-for-grid-plans.js +130 -0
  320. package/dist/esm/hooks/data-store/use-plan-features-for-grid-plans.js.map +1 -0
  321. package/dist/esm/hooks/data-store/use-plans-from-types.js +27 -0
  322. package/dist/esm/hooks/data-store/use-plans-from-types.js.map +1 -0
  323. package/dist/esm/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js +87 -0
  324. package/dist/esm/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js.map +1 -0
  325. package/dist/esm/hooks/use-grid-size.js +29 -0
  326. package/dist/esm/hooks/use-grid-size.js.map +1 -0
  327. package/dist/esm/hooks/use-highlight-adjacency-matrix.js +29 -0
  328. package/dist/esm/hooks/use-highlight-adjacency-matrix.js.map +1 -0
  329. package/dist/esm/hooks/use-is-large-currency.js +66 -0
  330. package/dist/esm/hooks/use-is-large-currency.js.map +1 -0
  331. package/dist/esm/hooks/use-manage-tooltip-toggle.js +25 -0
  332. package/dist/esm/hooks/use-manage-tooltip-toggle.js.map +1 -0
  333. package/dist/esm/hooks/use-plan-pricing-info-from-grid-plans.js +13 -0
  334. package/dist/esm/hooks/use-plan-pricing-info-from-grid-plans.js.map +1 -0
  335. package/dist/esm/index.js +28 -0
  336. package/dist/esm/index.js.map +1 -0
  337. package/dist/esm/lib/filter-unused-features-object.js +17 -0
  338. package/dist/esm/lib/filter-unused-features-object.js.map +1 -0
  339. package/dist/esm/lib/get-plan-features-object.js +9 -0
  340. package/dist/esm/lib/get-plan-features-object.js.map +1 -0
  341. package/dist/esm/lib/get-plan-pricing-info-from-grid-plans.js +12 -0
  342. package/dist/esm/lib/get-plan-pricing-info-from-grid-plans.js.map +1 -0
  343. package/dist/esm/lib/is-same-plan.js +8 -0
  344. package/dist/esm/lib/is-same-plan.js.map +1 -0
  345. package/dist/esm/lib/sort-plan-properties.js +35 -0
  346. package/dist/esm/lib/sort-plan-properties.js.map +1 -0
  347. package/dist/esm/lib/touch-detect/index.js +16 -0
  348. package/dist/esm/lib/touch-detect/index.js.map +1 -0
  349. package/dist/esm/types.js +2 -0
  350. package/dist/esm/types.js.map +1 -0
  351. package/dist/tsconfig-cjs.tsbuildinfo +1 -0
  352. package/dist/tsconfig.tsbuildinfo +1 -0
  353. package/dist/types/__mocks__/wpcom-proxy-request.d.ts +8 -0
  354. package/dist/types/__mocks__/wpcom-proxy-request.d.ts.map +1 -0
  355. package/dist/types/components/comparison-grid/index.d.ts +5 -0
  356. package/dist/types/components/comparison-grid/index.d.ts.map +1 -0
  357. package/dist/types/components/comparison-grid/index.stories.d.ts +66 -0
  358. package/dist/types/components/comparison-grid/index.stories.d.ts.map +1 -0
  359. package/dist/types/components/dropdown-option.d.ts +10 -0
  360. package/dist/types/components/dropdown-option.d.ts.map +1 -0
  361. package/dist/types/components/features-grid/billing-timeframes.d.ts +11 -0
  362. package/dist/types/components/features-grid/billing-timeframes.d.ts.map +1 -0
  363. package/dist/types/components/features-grid/client-logo-list/client-list.d.ts +11 -0
  364. package/dist/types/components/features-grid/client-logo-list/client-list.d.ts.map +1 -0
  365. package/dist/types/components/features-grid/client-logo-list/index.d.ts +4 -0
  366. package/dist/types/components/features-grid/client-logo-list/index.d.ts.map +1 -0
  367. package/dist/types/components/features-grid/enterprise-features.d.ts +11 -0
  368. package/dist/types/components/features-grid/enterprise-features.d.ts.map +1 -0
  369. package/dist/types/components/features-grid/index.d.ts +5 -0
  370. package/dist/types/components/features-grid/index.d.ts.map +1 -0
  371. package/dist/types/components/features-grid/index.stories.d.ts +173 -0
  372. package/dist/types/components/features-grid/index.stories.d.ts.map +1 -0
  373. package/dist/types/components/features-grid/mobile-free-domain.d.ts +8 -0
  374. package/dist/types/components/features-grid/mobile-free-domain.d.ts.map +1 -0
  375. package/dist/types/components/features-grid/plan-features-list.d.ts +31 -0
  376. package/dist/types/components/features-grid/plan-features-list.d.ts.map +1 -0
  377. package/dist/types/components/features-grid/plan-headers.d.ts +10 -0
  378. package/dist/types/components/features-grid/plan-headers.d.ts.map +1 -0
  379. package/dist/types/components/features-grid/plan-logos.d.ts +11 -0
  380. package/dist/types/components/features-grid/plan-logos.d.ts.map +1 -0
  381. package/dist/types/components/features-grid/plan-prices.d.ts +11 -0
  382. package/dist/types/components/features-grid/plan-prices.d.ts.map +1 -0
  383. package/dist/types/components/features-grid/plan-tagline.d.ts +10 -0
  384. package/dist/types/components/features-grid/plan-tagline.d.ts.map +1 -0
  385. package/dist/types/components/features-grid/previous-features-included-title.d.ts +10 -0
  386. package/dist/types/components/features-grid/previous-features-included-title.d.ts.map +1 -0
  387. package/dist/types/components/features-grid/spotlight-plan.d.ts +17 -0
  388. package/dist/types/components/features-grid/spotlight-plan.d.ts.map +1 -0
  389. package/dist/types/components/features-grid/table.d.ts +26 -0
  390. package/dist/types/components/features-grid/table.d.ts.map +1 -0
  391. package/dist/types/components/features-grid/top-buttons.d.ts +14 -0
  392. package/dist/types/components/features-grid/top-buttons.d.ts.map +1 -0
  393. package/dist/types/components/features.d.ts +17 -0
  394. package/dist/types/components/features.d.ts.map +1 -0
  395. package/dist/types/components/item.d.ts +5 -0
  396. package/dist/types/components/item.d.ts.map +1 -0
  397. package/dist/types/components/plan-button/index.d.ts +17 -0
  398. package/dist/types/components/plan-button/index.d.ts.map +1 -0
  399. package/dist/types/components/plan-div-td-container.d.ts +7 -0
  400. package/dist/types/components/plan-div-td-container.d.ts.map +1 -0
  401. package/dist/types/components/plan-logo.d.ts +12 -0
  402. package/dist/types/components/plan-logo.d.ts.map +1 -0
  403. package/dist/types/components/plan-type-selector/components/interval-type-dropdown.d.ts +4 -0
  404. package/dist/types/components/plan-type-selector/components/interval-type-dropdown.d.ts.map +1 -0
  405. package/dist/types/components/plan-type-selector/components/interval-type-selector.d.ts +4 -0
  406. package/dist/types/components/plan-type-selector/components/interval-type-selector.d.ts.map +1 -0
  407. package/dist/types/components/plan-type-selector/components/interval-type-toggle.d.ts +4 -0
  408. package/dist/types/components/plan-type-selector/components/interval-type-toggle.d.ts.map +1 -0
  409. package/dist/types/components/plan-type-selector/components/popup-messages.d.ts +9 -0
  410. package/dist/types/components/plan-type-selector/components/popup-messages.d.ts.map +1 -0
  411. package/dist/types/components/plan-type-selector/hooks/use-interval-options.d.ts +11 -0
  412. package/dist/types/components/plan-type-selector/hooks/use-interval-options.d.ts.map +1 -0
  413. package/dist/types/components/plan-type-selector/hooks/use-max-discount.d.ts +4 -0
  414. package/dist/types/components/plan-type-selector/hooks/use-max-discount.d.ts.map +1 -0
  415. package/dist/types/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.d.ts +10 -0
  416. package/dist/types/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.d.ts.map +1 -0
  417. package/dist/types/components/plan-type-selector/index.d.ts +6 -0
  418. package/dist/types/components/plan-type-selector/index.d.ts.map +1 -0
  419. package/dist/types/components/plans-2023-tooltip.d.ts +11 -0
  420. package/dist/types/components/plans-2023-tooltip.d.ts.map +1 -0
  421. package/dist/types/components/popular-badge.d.ts +9 -0
  422. package/dist/types/components/popular-badge.d.ts.map +1 -0
  423. package/dist/types/components/shared/action-button/index.d.ts +19 -0
  424. package/dist/types/components/shared/action-button/index.d.ts.map +1 -0
  425. package/dist/types/components/shared/billing-timeframe/index.d.ts +8 -0
  426. package/dist/types/components/shared/billing-timeframe/index.d.ts.map +1 -0
  427. package/dist/types/components/shared/header-price/header-price-context.d.ts +12 -0
  428. package/dist/types/components/shared/header-price/header-price-context.d.ts.map +1 -0
  429. package/dist/types/components/shared/header-price/index.d.ts +11 -0
  430. package/dist/types/components/shared/header-price/index.d.ts.map +1 -0
  431. package/dist/types/components/shared/plan-pill/index.d.ts +3 -0
  432. package/dist/types/components/shared/plan-pill/index.d.ts.map +1 -0
  433. package/dist/types/components/shared/storage/components/plan-storage.d.ts +13 -0
  434. package/dist/types/components/shared/storage/components/plan-storage.d.ts.map +1 -0
  435. package/dist/types/components/shared/storage/components/storage-dropdown.d.ts +9 -0
  436. package/dist/types/components/shared/storage/components/storage-dropdown.d.ts.map +1 -0
  437. package/dist/types/components/shared/storage/components/storage-feature-label.d.ts +7 -0
  438. package/dist/types/components/shared/storage/components/storage-feature-label.d.ts.map +1 -0
  439. package/dist/types/components/shared/storage/constants.d.ts +2 -0
  440. package/dist/types/components/shared/storage/constants.d.ts.map +1 -0
  441. package/dist/types/components/shared/storage/hooks/use-default-storage-option.d.ts +14 -0
  442. package/dist/types/components/shared/storage/hooks/use-default-storage-option.d.ts.map +1 -0
  443. package/dist/types/components/shared/storage/hooks/use-plan-storage.d.ts +4 -0
  444. package/dist/types/components/shared/storage/hooks/use-plan-storage.d.ts.map +1 -0
  445. package/dist/types/components/shared/storage/hooks/use-purchased-storage-add-on.d.ts +3 -0
  446. package/dist/types/components/shared/storage/hooks/use-purchased-storage-add-on.d.ts.map +1 -0
  447. package/dist/types/components/shared/storage/hooks/use-storage-string.d.ts +4 -0
  448. package/dist/types/components/shared/storage/hooks/use-storage-string.d.ts.map +1 -0
  449. package/dist/types/components/shared/storage/index.d.ts +9 -0
  450. package/dist/types/components/shared/storage/index.d.ts.map +1 -0
  451. package/dist/types/components/sticky-container.d.ts +33 -0
  452. package/dist/types/components/sticky-container.d.ts.map +1 -0
  453. package/dist/types/constants.d.ts +2 -0
  454. package/dist/types/constants.d.ts.map +1 -0
  455. package/dist/types/css-mixins.d.ts +3 -0
  456. package/dist/types/css-mixins.d.ts.map +1 -0
  457. package/dist/types/fixtures/plans.d.ts +201 -0
  458. package/dist/types/fixtures/plans.d.ts.map +1 -0
  459. package/dist/types/fixtures/sites-plans.d.ts +457 -0
  460. package/dist/types/fixtures/sites-plans.d.ts.map +1 -0
  461. package/dist/types/fixtures/sites-purchases.d.ts +96 -0
  462. package/dist/types/fixtures/sites-purchases.d.ts.map +1 -0
  463. package/dist/types/grid-context.d.ts +40 -0
  464. package/dist/types/grid-context.d.ts.map +1 -0
  465. package/dist/types/hooks/data-store/is-popular-plan.d.ts +2 -0
  466. package/dist/types/hooks/data-store/is-popular-plan.d.ts.map +1 -0
  467. package/dist/types/hooks/data-store/types.d.ts +40 -0
  468. package/dist/types/hooks/data-store/types.d.ts.map +1 -0
  469. package/dist/types/hooks/data-store/use-grid-plan-for-spotlight.d.ts +10 -0
  470. package/dist/types/hooks/data-store/use-grid-plan-for-spotlight.d.ts.map +1 -0
  471. package/dist/types/hooks/data-store/use-grid-plans-for-comparison-grid.d.ts +5 -0
  472. package/dist/types/hooks/data-store/use-grid-plans-for-comparison-grid.d.ts.map +1 -0
  473. package/dist/types/hooks/data-store/use-grid-plans-for-features-grid.d.ts +5 -0
  474. package/dist/types/hooks/data-store/use-grid-plans-for-features-grid.d.ts.map +1 -0
  475. package/dist/types/hooks/data-store/use-grid-plans.d.ts +13 -0
  476. package/dist/types/hooks/data-store/use-grid-plans.d.ts.map +1 -0
  477. package/dist/types/hooks/data-store/use-highlight-labels.d.ts +20 -0
  478. package/dist/types/hooks/data-store/use-highlight-labels.d.ts.map +1 -0
  479. package/dist/types/hooks/data-store/use-highlighted-features.d.ts +22 -0
  480. package/dist/types/hooks/data-store/use-highlighted-features.d.ts.map +1 -0
  481. package/dist/types/hooks/data-store/use-plan-billing-description.d.ts +16 -0
  482. package/dist/types/hooks/data-store/use-plan-billing-description.d.ts.map +1 -0
  483. package/dist/types/hooks/data-store/use-plan-features-for-grid-plans.d.ts +21 -0
  484. package/dist/types/hooks/data-store/use-plan-features-for-grid-plans.d.ts.map +1 -0
  485. package/dist/types/hooks/data-store/use-plans-from-types.d.ts +10 -0
  486. package/dist/types/hooks/data-store/use-plans-from-types.d.ts.map +1 -0
  487. package/dist/types/hooks/data-store/use-restructured-plan-features-for-comparison-grid.d.ts +15 -0
  488. package/dist/types/hooks/data-store/use-restructured-plan-features-for-comparison-grid.d.ts.map +1 -0
  489. package/dist/types/hooks/use-grid-size.d.ts +18 -0
  490. package/dist/types/hooks/use-grid-size.d.ts.map +1 -0
  491. package/dist/types/hooks/use-highlight-adjacency-matrix.d.ts +15 -0
  492. package/dist/types/hooks/use-highlight-adjacency-matrix.d.ts.map +1 -0
  493. package/dist/types/hooks/use-is-large-currency.d.ts +16 -0
  494. package/dist/types/hooks/use-is-large-currency.d.ts.map +1 -0
  495. package/dist/types/hooks/use-manage-tooltip-toggle.d.ts +3 -0
  496. package/dist/types/hooks/use-manage-tooltip-toggle.d.ts.map +1 -0
  497. package/dist/types/hooks/use-plan-pricing-info-from-grid-plans.d.ts +11 -0
  498. package/dist/types/hooks/use-plan-pricing-info-from-grid-plans.d.ts.map +1 -0
  499. package/dist/types/index.d.ts +32 -0
  500. package/dist/types/index.d.ts.map +1 -0
  501. package/dist/types/lib/filter-unused-features-object.d.ts +8 -0
  502. package/dist/types/lib/filter-unused-features-object.d.ts.map +1 -0
  503. package/dist/types/lib/get-plan-features-object.d.ts +4 -0
  504. package/dist/types/lib/get-plan-features-object.d.ts.map +1 -0
  505. package/dist/types/lib/get-plan-pricing-info-from-grid-plans.d.ts +9 -0
  506. package/dist/types/lib/get-plan-pricing-info-from-grid-plans.d.ts.map +1 -0
  507. package/dist/types/lib/is-same-plan.d.ts +3 -0
  508. package/dist/types/lib/is-same-plan.d.ts.map +1 -0
  509. package/dist/types/lib/sort-plan-properties.d.ts +3 -0
  510. package/dist/types/lib/sort-plan-properties.d.ts.map +1 -0
  511. package/dist/types/lib/touch-detect/index.d.ts +11 -0
  512. package/dist/types/lib/touch-detect/index.d.ts.map +1 -0
  513. package/dist/types/types.d.ts +225 -0
  514. package/dist/types/types.d.ts.map +1 -0
  515. package/package.json +83 -0
  516. package/src/__mocks__/wpcom-proxy-request.js +13 -0
  517. package/src/_media-queries.scss +14 -0
  518. package/src/_mixins.scss +15 -0
  519. package/src/_shared.scss +174 -0
  520. package/src/components/comparison-grid/README.md +3 -0
  521. package/src/components/comparison-grid/index.stories.tsx +91 -0
  522. package/src/components/comparison-grid/index.tsx +1215 -0
  523. package/src/components/comparison-grid/style.scss +318 -0
  524. package/src/components/dropdown-option.tsx +44 -0
  525. package/src/components/features-grid/README.md +3 -0
  526. package/src/components/features-grid/billing-timeframes.tsx +37 -0
  527. package/src/components/features-grid/client-logo-list/client-list.tsx +199 -0
  528. package/src/components/features-grid/client-logo-list/index.tsx +24 -0
  529. package/src/components/features-grid/client-logo-list/style.scss +52 -0
  530. package/src/components/features-grid/enterprise-features.tsx +101 -0
  531. package/src/components/features-grid/index.stories.tsx +143 -0
  532. package/src/components/features-grid/index.tsx +442 -0
  533. package/src/components/features-grid/mobile-free-domain.tsx +51 -0
  534. package/src/components/features-grid/plan-features-list.tsx +187 -0
  535. package/src/components/features-grid/plan-headers.tsx +31 -0
  536. package/src/components/features-grid/plan-logos.tsx +27 -0
  537. package/src/components/features-grid/plan-prices.tsx +37 -0
  538. package/src/components/features-grid/plan-tagline.tsx +25 -0
  539. package/src/components/features-grid/previous-features-included-title.tsx +66 -0
  540. package/src/components/features-grid/spotlight-plan.scss +5 -0
  541. package/src/components/features-grid/spotlight-plan.tsx +77 -0
  542. package/src/components/features-grid/style.scss +630 -0
  543. package/src/components/features-grid/table.tsx +185 -0
  544. package/src/components/features-grid/top-buttons.tsx +49 -0
  545. package/src/components/features.tsx +168 -0
  546. package/src/components/item.tsx +9 -0
  547. package/src/components/plan-button/index.tsx +59 -0
  548. package/src/components/plan-button/style.scss +179 -0
  549. package/src/components/plan-div-td-container.tsx +15 -0
  550. package/src/components/plan-logo.tsx +111 -0
  551. package/src/components/plan-type-selector/components/interval-type-dropdown.tsx +70 -0
  552. package/src/components/plan-type-selector/components/interval-type-selector.tsx +13 -0
  553. package/src/components/plan-type-selector/components/interval-type-toggle.tsx +100 -0
  554. package/src/components/plan-type-selector/components/popup-messages.tsx +128 -0
  555. package/src/components/plan-type-selector/hooks/use-interval-options.tsx +89 -0
  556. package/src/components/plan-type-selector/hooks/use-max-discount.ts +64 -0
  557. package/src/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.ts +99 -0
  558. package/src/components/plan-type-selector/index.tsx +50 -0
  559. package/src/components/plan-type-selector/style.scss +196 -0
  560. package/src/components/plans-2023-tooltip.tsx +85 -0
  561. package/src/components/popular-badge.tsx +30 -0
  562. package/src/components/shared/README.md +1 -0
  563. package/src/components/shared/action-button/index.tsx +205 -0
  564. package/src/components/shared/action-button/style.scss +12 -0
  565. package/src/components/shared/billing-timeframe/index.tsx +106 -0
  566. package/src/components/shared/header-price/header-price-context.tsx +24 -0
  567. package/src/components/shared/header-price/index.tsx +278 -0
  568. package/src/components/shared/header-price/style.scss +112 -0
  569. package/src/components/shared/plan-pill/index.jsx +7 -0
  570. package/src/components/shared/plan-pill/style.scss +30 -0
  571. package/src/components/shared/storage/components/plan-storage.tsx +51 -0
  572. package/src/components/shared/storage/components/storage-dropdown.tsx +187 -0
  573. package/src/components/shared/storage/components/storage-feature-label.tsx +68 -0
  574. package/src/components/shared/storage/constants.ts +3 -0
  575. package/src/components/shared/storage/hooks/use-default-storage-option.ts +34 -0
  576. package/src/components/shared/storage/hooks/use-plan-storage.ts +41 -0
  577. package/src/components/shared/storage/hooks/use-purchased-storage-add-on.ts +53 -0
  578. package/src/components/shared/storage/hooks/use-storage-string.ts +13 -0
  579. package/src/components/shared/storage/index.ts +9 -0
  580. package/src/components/sticky-container.tsx +146 -0
  581. package/src/components/test/actions-button.tsx +397 -0
  582. package/src/components/test/billing-timeframe.tsx +341 -0
  583. package/src/components/test/header-price.tsx +189 -0
  584. package/src/components/test/plan-type-selector.tsx +44 -0
  585. package/src/constants.ts +13 -0
  586. package/src/css-mixins.tsx +11 -0
  587. package/src/fixtures/plans.ts +1539 -0
  588. package/src/fixtures/sites-plans.ts +455 -0
  589. package/src/fixtures/sites-purchases.ts +130 -0
  590. package/src/grid-context.tsx +104 -0
  591. package/src/hooks/data-store/is-popular-plan.ts +5 -0
  592. package/src/hooks/data-store/types.ts +41 -0
  593. package/src/hooks/data-store/use-grid-plan-for-spotlight.ts +35 -0
  594. package/src/hooks/data-store/use-grid-plans-for-comparison-grid.ts +81 -0
  595. package/src/hooks/data-store/use-grid-plans-for-features-grid.ts +79 -0
  596. package/src/hooks/data-store/use-grid-plans.tsx +360 -0
  597. package/src/hooks/data-store/use-highlight-labels.ts +88 -0
  598. package/src/hooks/data-store/use-highlighted-features.ts +51 -0
  599. package/src/hooks/data-store/use-plan-billing-description.tsx +309 -0
  600. package/src/hooks/data-store/use-plan-features-for-grid-plans.ts +219 -0
  601. package/src/hooks/data-store/use-plans-from-types.ts +51 -0
  602. package/src/hooks/data-store/use-restructured-plan-features-for-comparison-grid.ts +158 -0
  603. package/src/hooks/test/use-is-large-currency.ts +69 -0
  604. package/src/hooks/use-grid-size.ts +46 -0
  605. package/src/hooks/use-highlight-adjacency-matrix.ts +48 -0
  606. package/src/hooks/use-is-large-currency.ts +91 -0
  607. package/src/hooks/use-manage-tooltip-toggle.ts +30 -0
  608. package/src/hooks/use-plan-pricing-info-from-grid-plans.ts +36 -0
  609. package/src/index.tsx +46 -0
  610. package/src/lib/filter-unused-features-object.ts +31 -0
  611. package/src/lib/get-plan-features-object.ts +12 -0
  612. package/src/lib/get-plan-pricing-info-from-grid-plans.ts +31 -0
  613. package/src/lib/is-same-plan.ts +8 -0
  614. package/src/lib/sort-plan-properties.ts +46 -0
  615. package/src/lib/test/filter-plan-features-object.ts +65 -0
  616. package/src/lib/test/sort-plan-properties.ts +104 -0
  617. package/src/lib/touch-detect/README.md +11 -0
  618. package/src/lib/touch-detect/index.js +17 -0
  619. package/src/types.ts +340 -0
@@ -0,0 +1,213 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isWpComFreePlan, isWpcomEnterpriseGridPlan, PLAN_BIENNIAL_PERIOD, PLAN_ANNUAL_PERIOD, PLAN_TRIENNIAL_PERIOD, getPlanSlugForTermVariant, TERM_ANNUALLY, PLAN_HOSTING_TRIAL_MONTHLY, } from '@automattic/calypso-products';
3
+ import { Plans } from '@automattic/data-stores';
4
+ import { useTranslate, formatCurrency } from 'i18n-calypso';
5
+ import { usePlansGridContext } from '../../grid-context';
6
+ export default function usePlanBillingDescription({ siteId, planSlug, pricing, isMonthlyPlan, coupon, useCheckPlanAvailabilityForPurchase, }) {
7
+ const translate = useTranslate();
8
+ const { currencyCode, originalPrice, discountedPrice, billingPeriod, introOffer } = pricing || {};
9
+ const { reflectStorageSelectionInPlanPrices } = usePlansGridContext();
10
+ const yearlyVariantPlanSlug = getPlanSlugForTermVariant(planSlug, TERM_ANNUALLY);
11
+ const yearlyVariantPricing = Plans.usePricingMetaForGridPlans({
12
+ planSlugs: yearlyVariantPlanSlug ? [yearlyVariantPlanSlug] : [],
13
+ coupon,
14
+ siteId,
15
+ useCheckPlanAvailabilityForPurchase,
16
+ reflectStorageSelectionInPlanPrices,
17
+ })?.[yearlyVariantPlanSlug ?? ''];
18
+ if (!pricing) {
19
+ return null;
20
+ }
21
+ if (isWpComFreePlan(planSlug) ||
22
+ isWpcomEnterpriseGridPlan(planSlug) ||
23
+ planSlug === PLAN_HOSTING_TRIAL_MONTHLY) {
24
+ return null;
25
+ }
26
+ if (isMonthlyPlan &&
27
+ originalPrice?.monthly &&
28
+ yearlyVariantPricing &&
29
+ (!introOffer || introOffer.isOfferComplete)) {
30
+ const yearlyVariantMaybeDiscountedPrice = Number.isFinite(yearlyVariantPricing.discountedPrice?.monthly)
31
+ ? yearlyVariantPricing.discountedPrice?.monthly
32
+ : yearlyVariantPricing.originalPrice?.monthly;
33
+ if (yearlyVariantMaybeDiscountedPrice &&
34
+ yearlyVariantMaybeDiscountedPrice < originalPrice.monthly) {
35
+ return translate(`Save %(discountRate)s%% by paying annually`, {
36
+ args: {
37
+ discountRate: Math.floor((100 * (originalPrice.monthly - yearlyVariantMaybeDiscountedPrice)) /
38
+ originalPrice.monthly),
39
+ },
40
+ });
41
+ }
42
+ return null;
43
+ }
44
+ const discountedPriceFullTermText = currencyCode && typeof discountedPrice?.full === 'number'
45
+ ? formatCurrency(discountedPrice.full, currencyCode, {
46
+ stripZeros: true,
47
+ isSmallestUnit: true,
48
+ })
49
+ : null;
50
+ const originalPriceFullTermText = currencyCode && originalPrice?.full
51
+ ? formatCurrency(originalPrice.full, currencyCode, {
52
+ stripZeros: true,
53
+ isSmallestUnit: true,
54
+ })
55
+ : null;
56
+ /*
57
+ * The introOffer billing should fall below into the next block once experiment with Woo plans is finalized.
58
+ * 1. We only expose introOffers to monthly & yearly plans for now (so no need to introduce more translations just yet)
59
+ * 2. We only expose month & year based intervals for now (so no need to introduce more translations just yet)
60
+ */
61
+ if (introOffer?.intervalCount && introOffer.intervalUnit && !introOffer.isOfferComplete) {
62
+ const discountedPriceFull = typeof discountedPrice?.full === 'number' ? discountedPrice.full : introOffer?.rawPrice?.full;
63
+ const introOfferFullTermText = currencyCode && typeof discountedPriceFull === 'number'
64
+ ? formatCurrency(discountedPriceFull, currencyCode, {
65
+ stripZeros: true,
66
+ isSmallestUnit: true,
67
+ })
68
+ : null;
69
+ if (originalPriceFullTermText && introOfferFullTermText) {
70
+ /* Introductory offers for monthly plans */
71
+ if (isMonthlyPlan) {
72
+ /* If the offer is for X months */
73
+ if ('month' === introOffer.intervalUnit) {
74
+ if (1 === introOffer.intervalCount) {
75
+ return translate('for your first month,{{br/}}' + 'then %(rawPrice)s billed monthly, excl. taxes', {
76
+ args: {
77
+ rawPrice: originalPriceFullTermText,
78
+ },
79
+ components: { br: _jsx("br", {}) },
80
+ comment: 'excl. taxes is short for excluding taxes',
81
+ });
82
+ }
83
+ return translate('for your first %(introOfferIntervalCount)s months,{{br/}}' +
84
+ 'then %(rawPrice)s billed monthly, excl. taxes', {
85
+ args: {
86
+ rawPrice: originalPriceFullTermText,
87
+ introOfferIntervalCount: introOffer.intervalCount,
88
+ },
89
+ components: { br: _jsx("br", {}) },
90
+ comment: 'excl. taxes is short for excluding taxes',
91
+ });
92
+ }
93
+ /* If the offer is for X years of monthly intervals */
94
+ if ('year' === introOffer.intervalUnit) {
95
+ if (1 === introOffer.intervalCount) {
96
+ return translate('for your first year,{{br/}}' + 'then %(rawPrice)s billed monthly, excl. taxes', {
97
+ args: {
98
+ rawPrice: originalPriceFullTermText,
99
+ },
100
+ components: { br: _jsx("br", {}) },
101
+ comment: 'excl. taxes is short for excluding taxes',
102
+ });
103
+ }
104
+ return translate('per month, for your first %(introOfferIntervalCount)s years,{{br/}}' +
105
+ 'then %(rawPrice)s billed monthly, excl. taxes', {
106
+ args: {
107
+ rawPrice: originalPriceFullTermText,
108
+ introOfferIntervalCount: introOffer.intervalCount,
109
+ },
110
+ components: { br: _jsx("br", {}) },
111
+ comment: 'excl. taxes is short for excluding taxes',
112
+ });
113
+ }
114
+ }
115
+ /* Introductory offers for yearly plans */
116
+ if (PLAN_ANNUAL_PERIOD === billingPeriod) {
117
+ /* If the offer is for X months of a yearly plan */
118
+ if ('month' === introOffer.intervalUnit) {
119
+ if (1 === introOffer.intervalCount) {
120
+ return translate('for your first month,{{br/}}' + 'then %(rawPrice)s billed annually, excl. taxes', {
121
+ args: {
122
+ rawPrice: originalPriceFullTermText,
123
+ introOfferIntervalUnit: introOffer.intervalUnit,
124
+ },
125
+ components: { br: _jsx("br", {}) },
126
+ comment: 'excl. taxes is short for excluding taxes',
127
+ });
128
+ }
129
+ return translate('for your first %(introOfferIntervalCount)s months,{{br/}}' +
130
+ 'then %(rawPrice)s billed annually, excl. taxes', {
131
+ args: {
132
+ rawPrice: originalPriceFullTermText,
133
+ introOfferIntervalCount: introOffer.intervalCount,
134
+ },
135
+ components: { br: _jsx("br", {}) },
136
+ comment: 'excl. taxes is short for excluding taxes',
137
+ });
138
+ }
139
+ /* If the offer is for X years of a yearly plan */
140
+ if ('year' === introOffer.intervalUnit) {
141
+ if (1 === introOffer.intervalCount) {
142
+ return translate('per month, %(introOfferFormattedPrice)s for your first year,{{br/}}' +
143
+ 'then %(rawPrice)s billed annually, excl. taxes', {
144
+ args: {
145
+ introOfferFormattedPrice: introOfferFullTermText,
146
+ rawPrice: originalPriceFullTermText,
147
+ },
148
+ components: { br: _jsx("br", {}) },
149
+ comment: 'excl. taxes is short for excluding taxes',
150
+ });
151
+ }
152
+ return translate('per month, %(introOfferFormattedPrice)s for your first %(introOfferIntervalCount)s years,{{br/}}' +
153
+ 'then %(rawPrice)s billed annually, excl. taxes', {
154
+ args: {
155
+ introOfferFormattedPrice: introOfferFullTermText,
156
+ rawPrice: originalPriceFullTermText,
157
+ introOfferIntervalCount: introOffer.intervalCount,
158
+ },
159
+ components: { br: _jsx("br", {}) },
160
+ comment: 'excl. taxes is short for excluding taxes',
161
+ });
162
+ }
163
+ }
164
+ }
165
+ /*
166
+ * Early return here is for sanity. We don't want to show regular billing descriptions
167
+ * if there is an introOffer (despite that will not be the case, unless some API-level bug happens)
168
+ */
169
+ return null;
170
+ }
171
+ if (discountedPriceFullTermText) {
172
+ if (PLAN_ANNUAL_PERIOD === billingPeriod) {
173
+ return translate('per month, %(fullTermDiscountedPriceText)s for the first year, excl. taxes', {
174
+ args: { fullTermDiscountedPriceText: discountedPriceFullTermText },
175
+ comment: 'Excl. Taxes is short for excluding taxes',
176
+ });
177
+ }
178
+ if (PLAN_BIENNIAL_PERIOD === billingPeriod) {
179
+ return translate('per month, %(fullTermDiscountedPriceText)s for the first two years, excl. taxes', {
180
+ args: { fullTermDiscountedPriceText: discountedPriceFullTermText },
181
+ comment: 'Excl. Taxes is short for excluding taxes',
182
+ });
183
+ }
184
+ if (PLAN_TRIENNIAL_PERIOD === billingPeriod) {
185
+ return translate('per month, %(fullTermDiscountedPriceText)s for the first three years, excl. taxes', {
186
+ args: { fullTermDiscountedPriceText: discountedPriceFullTermText },
187
+ comment: 'Excl. Taxes is short for excluding taxes',
188
+ });
189
+ }
190
+ }
191
+ else if (originalPriceFullTermText) {
192
+ if (PLAN_ANNUAL_PERIOD === billingPeriod) {
193
+ return translate('per month, %(rawPrice)s billed annually, excl. taxes', {
194
+ args: { rawPrice: originalPriceFullTermText },
195
+ comment: 'Excl. Taxes is short for excluding taxes',
196
+ });
197
+ }
198
+ if (PLAN_BIENNIAL_PERIOD === billingPeriod) {
199
+ return translate('per month, %(rawPrice)s billed every two years, excl. taxes', {
200
+ args: { rawPrice: originalPriceFullTermText },
201
+ comment: 'Excl. Taxes is short for excluding taxes',
202
+ });
203
+ }
204
+ if (PLAN_TRIENNIAL_PERIOD === billingPeriod) {
205
+ return translate('per month, %(rawPrice)s billed every three years, excl. taxes', {
206
+ args: { rawPrice: originalPriceFullTermText },
207
+ comment: 'Excl. Taxes is short for excluding taxes',
208
+ });
209
+ }
210
+ }
211
+ return null;
212
+ }
213
+ //# sourceMappingURL=use-plan-billing-description.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-plan-billing-description.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-plan-billing-description.tsx"],"names":[],"mappings":";AAAA,OAAO,EACN,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EAErB,yBAAyB,EACzB,aAAa,EACb,0BAA0B,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAA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AE,6DAA6D,EAAE;gBAChF,IAAI,EAAE,EAAE,QAAQ,EAAE,yBAAyB,EAAE;gBAC7C,OAAO,EAAE,0CAA0C;aACnD,CAAE,CAAC;QACL,CAAC;QAED,IAAK,qBAAqB,KAAK,aAAa,EAAG,CAAC;YAC/C,OAAO,SAAS,CAAE,+DAA+D,EAAE;gBAClF,IAAI,EAAE,EAAE,QAAQ,EAAE,yBAAyB,EAAE;gBAC7C,OAAO,EAAE,0CAA0C;aACnD,CAAE,CAAC;QACL,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -0,0 +1,130 @@
1
+ import { FEATURE_CUSTOM_DOMAIN, applyTestFiltersToPlansList, isMonthly, } from '@automattic/calypso-products';
2
+ import { useMemo } from '@wordpress/element';
3
+ import getPlanFeaturesObject from '../../lib/get-plan-features-object';
4
+ import useHighlightedFeatures from './use-highlighted-features';
5
+ /**
6
+ * usePlanFeaturesForGridPlans:
7
+ * - these plan features are mainly relevant to FeaturesGrid and Spotlight components
8
+ * - this hook can migrate to data store once features definitions migrate to calypso-products
9
+ */
10
+ const usePlanFeaturesForGridPlans = ({ gridPlans, allFeaturesList, hasRedeemedDomainCredit, intent, selectedFeature, showLegacyStorageFeature, isInSignup, }) => {
11
+ const highlightedFeatures = useHighlightedFeatures({ intent: intent ?? null, isInSignup });
12
+ return useMemo(() => {
13
+ return gridPlans.reduce((acc, gridPlan) => {
14
+ const planSlug = gridPlan.planSlug;
15
+ const planConstantObj = applyTestFiltersToPlansList(planSlug, undefined);
16
+ const isMonthlyPlan = isMonthly(planSlug);
17
+ let wpcomFeatures = [];
18
+ let jetpackFeatures = [];
19
+ if ('plans-newsletter' === intent) {
20
+ wpcomFeatures = getPlanFeaturesObject(allFeaturesList, planConstantObj?.getNewsletterSignupFeatures?.() ?? []);
21
+ }
22
+ else if ('plans-p2' === intent) {
23
+ wpcomFeatures = getPlanFeaturesObject(allFeaturesList, planConstantObj?.get2023PricingGridSignupWpcomFeatures?.() ?? []);
24
+ }
25
+ else if ('plans-blog-onboarding' === intent) {
26
+ wpcomFeatures = getPlanFeaturesObject(allFeaturesList, planConstantObj?.getBlogOnboardingSignupFeatures?.() ?? []);
27
+ jetpackFeatures = getPlanFeaturesObject(allFeaturesList, planConstantObj.getBlogOnboardingSignupJetpackFeatures?.() ?? []);
28
+ }
29
+ else if ('plans-woocommerce' === intent) {
30
+ wpcomFeatures = getPlanFeaturesObject(allFeaturesList, planConstantObj?.get2023PricingGridSignupWpcomFeatures?.() ?? []);
31
+ jetpackFeatures = getPlanFeaturesObject(allFeaturesList, planConstantObj.get2023PricingGridSignupJetpackFeatures?.() ?? []);
32
+ /*
33
+ * Woo Express plans with an introductory offer need some features removed:
34
+ * - custom domain feature removed for all Woo Express plans
35
+ */
36
+ if (gridPlan.pricing.introOffer) {
37
+ wpcomFeatures = wpcomFeatures.filter((feature) => {
38
+ // Remove the custom domain feature for Woo Express plans with an introductory offer.
39
+ if (FEATURE_CUSTOM_DOMAIN === feature.getSlug()) {
40
+ return false;
41
+ }
42
+ return true;
43
+ });
44
+ }
45
+ }
46
+ else {
47
+ wpcomFeatures = getPlanFeaturesObject(allFeaturesList, planConstantObj?.get2023PricingGridSignupWpcomFeatures?.() ?? []);
48
+ jetpackFeatures = getPlanFeaturesObject(allFeaturesList, planConstantObj.get2023PricingGridSignupJetpackFeatures?.() ?? []);
49
+ }
50
+ const annualPlansOnlyFeatures = planConstantObj.getAnnualPlansOnlyFeatures?.() || [];
51
+ const wpcomFeaturesTransformed = [];
52
+ const jetpackFeaturesTransformed = jetpackFeatures.map((feature) => {
53
+ const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(feature.getSlug());
54
+ return {
55
+ ...feature,
56
+ availableOnlyForAnnualPlans,
57
+ availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
58
+ };
59
+ });
60
+ if (highlightedFeatures) {
61
+ // slice() and reverse() are needed to the preserve order of features
62
+ highlightedFeatures
63
+ .slice()
64
+ .reverse()
65
+ .forEach((slug) => {
66
+ const feature = wpcomFeatures.find((feature) => feature.getSlug() === slug);
67
+ if (feature) {
68
+ const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(feature.getSlug());
69
+ wpcomFeaturesTransformed.unshift({
70
+ ...feature,
71
+ availableOnlyForAnnualPlans,
72
+ availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
73
+ isHighlighted: true,
74
+ });
75
+ }
76
+ });
77
+ }
78
+ const topFeature = selectedFeature
79
+ ? wpcomFeatures.find((feature) => feature.getSlug() === selectedFeature)
80
+ : undefined;
81
+ if (topFeature) {
82
+ const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(topFeature.getSlug());
83
+ wpcomFeaturesTransformed.unshift({
84
+ ...topFeature,
85
+ availableOnlyForAnnualPlans,
86
+ availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
87
+ });
88
+ }
89
+ if (annualPlansOnlyFeatures.length > 0) {
90
+ wpcomFeatures.forEach((feature) => {
91
+ // topFeature and highlightedFeatures are already added to the list above
92
+ const isHighlightedFeature = highlightedFeatures && highlightedFeatures.includes(feature.getSlug());
93
+ if (feature === topFeature || isHighlightedFeature) {
94
+ return;
95
+ }
96
+ if (hasRedeemedDomainCredit && feature.getSlug() === FEATURE_CUSTOM_DOMAIN) {
97
+ return;
98
+ }
99
+ const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(feature.getSlug());
100
+ wpcomFeaturesTransformed.push({
101
+ ...feature,
102
+ availableOnlyForAnnualPlans,
103
+ availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
104
+ });
105
+ });
106
+ }
107
+ const storageFeature = planConstantObj.getStorageFeature?.(showLegacyStorageFeature, gridPlan.current);
108
+ return {
109
+ ...acc,
110
+ [planSlug]: {
111
+ wpcomFeatures: wpcomFeaturesTransformed,
112
+ jetpackFeatures: jetpackFeaturesTransformed,
113
+ ...(storageFeature && {
114
+ storageFeature: getPlanFeaturesObject(allFeaturesList, [storageFeature])?.[0],
115
+ }),
116
+ },
117
+ };
118
+ }, {});
119
+ }, [
120
+ gridPlans,
121
+ intent,
122
+ highlightedFeatures,
123
+ selectedFeature,
124
+ showLegacyStorageFeature,
125
+ allFeaturesList,
126
+ hasRedeemedDomainCredit,
127
+ ]);
128
+ };
129
+ export default usePlanFeaturesForGridPlans;
130
+ //# sourceMappingURL=use-plan-features-for-grid-plans.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-plan-features-for-grid-plans.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-plan-features-for-grid-plans.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,2BAA2B,EAC3B,SAAS,GACT,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AACvE,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AA4BhE;;;;GAIG;AACH,MAAM,2BAA2B,GAAgC,CAAE,EAClE,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,MAAM,EACN,eAAe,EACf,wBAAwB,EACxB,UAAU,GACV,EAAG,EAAE;IACL,MAAM,mBAAmB,GAAG,sBAAsB,CAAE,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI,EAAE,UAAU,EAAE,CAAE,CAAC;IAC7F,OAAO,OAAO,CAAE,GAAG,EAAE;QACpB,OAAO,SAAS,CAAC,MAAM,CACtB,CAAE,GAAG,EAAE,QAAQ,EAAG,EAAE;YACnB,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;YACnC,MAAM,eAAe,GAAG,2BAA2B,CAAE,QAAQ,EAAE,SAAS,CAAE,CAAC;YAC3E,MAAM,aAAa,GAAG,SAAS,CAAE,QAAQ,CAAE,CAAC;YAE5C,IAAI,aAAa,GAAoB,EAAE,CAAC;YACxC,IAAI,eAAe,GAA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AE,QAAQ,CAAE,EAAE;oBACb,aAAa,EAAE,wBAAwB;oBACvC,eAAe,EAAE,0BAA0B;oBAC3C,GAAG,CAAE,cAAc,IAAI;wBACtB,cAAc,EAAE,qBAAqB,CAAE,eAAe,EAAE,CAAE,cAAc,CAAE,CAAE,EAAE,CAAE,CAAC,CAAE;qBACnF,CAAE;iBACH;aACD,CAAC;QACH,CAAC,EACD,EAAuD,CACvD,CAAC;IACH,CAAC,EAAE;QACF,SAAS;QACT,MAAM;QACN,mBAAmB;QACnB,eAAe;QACf,wBAAwB;QACxB,eAAe;QACf,uBAAuB;KACvB,CAAE,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { TYPE_ENTERPRISE_GRID_WPCOM, TYPE_FREE, TYPE_WOO_EXPRESS_PLUS, findPlansKeys, TYPE_P2_PLUS, GROUP_P2, } from '@automattic/calypso-products';
2
+ import warn from '@wordpress/warning';
3
+ const usePlansFromTypes = ({ planTypes, term, intent }) => {
4
+ const plans = planTypes.reduce((accum, type) => {
5
+ // These plans don't have a term.
6
+ // We may consider to move this logic into the underlying `planMatches` function, but that would have wider implication so it's TBD
7
+ const planQuery = [
8
+ TYPE_FREE,
9
+ TYPE_ENTERPRISE_GRID_WPCOM,
10
+ TYPE_WOO_EXPRESS_PLUS,
11
+ TYPE_P2_PLUS,
12
+ ].includes(type)
13
+ ? { type }
14
+ : { type, term };
15
+ if (intent === 'plans-p2') {
16
+ planQuery['group'] = GROUP_P2;
17
+ }
18
+ const plan = findPlansKeys(planQuery)[0];
19
+ if (!plan) {
20
+ warn(`Invalid plan type, \`${type}\`, provided to \`PlansFeaturesMain\` component. See plans constants for valid plan types.`);
21
+ }
22
+ return plan ? [...accum, plan] : accum;
23
+ }, []);
24
+ return plans;
25
+ };
26
+ export default usePlansFromTypes;
27
+ //# sourceMappingURL=use-plans-from-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-plans-from-types.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-plans-from-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,0BAA0B,EAC1B,SAAS,EACT,qBAAqB,EACrB,aAAa,EAEb,YAAY,EACZ,QAAQ,GACR,MAAM,8BAA8B,CAAC;AACtC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAStC,MAAM,iBAAiB,GAAG,CAAE,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAS,EAAe,EAAE;IAC9E,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAE,CAAE,KAAiB,EAAE,IAAI,EAAG,EAAE;QAC7D,iCAAiC;QACjC,mIAAmI;QACnI,MAAM,SAAS,GAAoD;YAClE,SAAS;YACT,0BAA0B;YAC1B,qBAAqB;YACrB,YAAY;SACZ,CAAC,QAAQ,CAAE,IAAI,CAAE;YACjB,CAAC,CAAC,EAAE,IAAI,EAAE;YACV,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAElB,IAAK,MAAM,KAAK,UAAU,EAAG,CAAC;YAC7B,SAAS,CAAE,OAAO,CAAE,GAAG,QAAQ,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,GAAG,aAAa,CAAE,SAAS,CAAE,CAAE,CAAC,CAAE,CAAC;QAE7C,IAAK,CAAE,IAAI,EAAG,CAAC;YACd,IAAI,CACH,wBAAyB,IAAK,4FAA4F,CAC1H,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC,CAAC,CAAC,CAAE,GAAG,KAAK,EAAE,IAAgB,CAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACtD,CAAC,EAAE,EAAE,CAAE,CAAC;IAER,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,87 @@
1
+ import { applyTestFiltersToPlansList, isMonthly, isWooExpressPlan, FEATURE_CUSTOM_DOMAIN, } from '@automattic/calypso-products';
2
+ import { useMemo } from 'react';
3
+ import getPlanFeaturesObject from '../../lib/get-plan-features-object';
4
+ import usePlanFeaturesForGridPlans from './use-plan-features-for-grid-plans';
5
+ const useRestructuredPlanFeaturesForComparisonGrid = ({ gridPlans, allFeaturesList, hasRedeemedDomainCredit, intent, selectedFeature, showLegacyStorageFeature, }) => {
6
+ const planFeaturesForGridPlans = usePlanFeaturesForGridPlans({
7
+ gridPlans,
8
+ allFeaturesList,
9
+ intent,
10
+ selectedFeature,
11
+ showLegacyStorageFeature,
12
+ });
13
+ return useMemo(() => {
14
+ let previousPlan = null;
15
+ const planFeatureMap = {};
16
+ for (const gridPlan of gridPlans) {
17
+ const planSlug = gridPlan.planSlug;
18
+ const planConstantObj = applyTestFiltersToPlansList(planSlug, undefined);
19
+ const annualPlansOnlyFeatures = planConstantObj.getAnnualPlansOnlyFeatures?.();
20
+ const isMonthlyPlan = isMonthly(planSlug);
21
+ const wpcomFeatures = planConstantObj.get2023PlanComparisonFeatureOverride?.().length
22
+ ? getPlanFeaturesObject(allFeaturesList, planConstantObj.get2023PlanComparisonFeatureOverride().slice())
23
+ : getPlanFeaturesObject(allFeaturesList, planConstantObj.get2023PricingGridSignupWpcomFeatures?.().slice());
24
+ const jetpackFeatures = planConstantObj.get2023PlanComparisonJetpackFeatureOverride?.()
25
+ .length
26
+ ? getPlanFeaturesObject(allFeaturesList, planConstantObj.get2023PlanComparisonJetpackFeatureOverride().slice())
27
+ : getPlanFeaturesObject(allFeaturesList, planConstantObj.get2023PricingGridSignupJetpackFeatures?.().slice());
28
+ const wpcomFeaturesTransformed = annualPlansOnlyFeatures
29
+ ? wpcomFeatures?.map((feature) => {
30
+ const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(feature.getSlug());
31
+ return {
32
+ ...feature,
33
+ availableOnlyForAnnualPlans,
34
+ availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
35
+ };
36
+ })
37
+ : null;
38
+ const jetpackFeaturesTransformed = annualPlansOnlyFeatures
39
+ ? jetpackFeatures?.map((feature) => {
40
+ const availableOnlyForAnnualPlans = annualPlansOnlyFeatures.includes(feature.getSlug());
41
+ return {
42
+ ...feature,
43
+ availableOnlyForAnnualPlans,
44
+ availableForCurrentPlan: !isMonthlyPlan || !availableOnlyForAnnualPlans,
45
+ };
46
+ })
47
+ : null;
48
+ const featuresAvailable = isWooExpressPlan(planSlug)
49
+ ? {
50
+ wpcomFeatures: wpcomFeaturesTransformed ?? [],
51
+ jetpackFeatures: [],
52
+ }
53
+ : {
54
+ wpcomFeatures: wpcomFeaturesTransformed ?? [],
55
+ jetpackFeatures: jetpackFeaturesTransformed ?? [],
56
+ };
57
+ const previousPlanFeatures = {
58
+ wpcomFeatures: previousPlan !== null ? planFeatureMap[previousPlan].wpcomFeatures : [],
59
+ jetpackFeatures: previousPlan !== null ? planFeatureMap[previousPlan].jetpackFeatures : [],
60
+ };
61
+ planFeatureMap[planSlug] = {
62
+ wpcomFeatures: [
63
+ ...featuresAvailable.wpcomFeatures,
64
+ ...previousPlanFeatures.wpcomFeatures,
65
+ ].filter((feature) => {
66
+ // Remove the custom domain feature if custom domain has been redeemed or for Woo Express plans with an introductory offer.
67
+ if ((('plans-woocommerce' === intent && gridPlan.pricing.introOffer) ||
68
+ hasRedeemedDomainCredit) &&
69
+ FEATURE_CUSTOM_DOMAIN === feature.getSlug()) {
70
+ return false;
71
+ }
72
+ return true;
73
+ }),
74
+ jetpackFeatures: [
75
+ ...featuresAvailable.jetpackFeatures,
76
+ ...previousPlanFeatures.jetpackFeatures,
77
+ ],
78
+ storageFeature: planFeaturesForGridPlans[planSlug].storageFeature,
79
+ comparisonGridFeatureLabels: planConstantObj.getPlanComparisonFeatureLabels?.(),
80
+ };
81
+ previousPlan = planSlug;
82
+ }
83
+ return planFeatureMap;
84
+ }, [gridPlans, allFeaturesList, planFeaturesForGridPlans, intent, hasRedeemedDomainCredit]);
85
+ };
86
+ export default useRestructuredPlanFeaturesForComparisonGrid;
87
+ //# sourceMappingURL=use-restructured-plan-features-for-comparison-grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-restructured-plan-features-for-comparison-grid.js","sourceRoot":"","sources":["../../../../src/hooks/data-store/use-restructured-plan-features-for-comparison-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,2BAA2B,EAC3B,SAAS,EACT,gBAAgB,EAEhB,qBAAqB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AACvE,OAAO,2BAA2B,MAAM,oCAAoC,CAAC;AAwB7E,MAAM,4CAA4C,GACjD,CAAE,EACD,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,MAAM,EACN,eAAe,EACf,wBAAwB,GACxB,EAAG,EAAE;IACL,MAAM,wBAAwB,GAAG,2BAA2B,CAAE;QAC7D,SAAS;QACT,eAAe;QACf,MAAM;QACN,eAAe;QACf,wBAAwB;KACxB,CAAE,CAAC;IAEJ,OAAO,OAAO,CAAE,GAAG,EAAE;QACpB,IAAI,YAAY,GAAG,IAAI,CAAC;QACxB,MAAM,cAAc,GAA8C,EAAE,CAAC;QAErE,KAAM,MAAM,QAAQ,IAAI,SAAS,EAAG,CAAC;YACpC,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;YACnC,MAAM,eAAe,GAAG,2BAA2B,CAAE,QAAQ,EAAE,SAAS,CAAE,CAAC;YAC3E,MAAM,uBAAuB,GAAG,eAAe,CAAC,0BAA0B,EAAE,EAAE,CAAC;YAC/E,MAAM,aAAa,GAAG,SAAS,CAAE,QAAQ,CAAE,CAAC;YAE5C,MAAM,aAAa,GAAG,eAAe,CAAC,oCAAoC,EAAE,EAAE,CAAC,MAAM;gBACpF,CAAC,CAAC,qBAAqB,CACrB,eAAe,EACf,eAAe,CAAC,oCAAoC,EAAE,CAAC,KAAK,EAAE,CAC7D;gBACH,CAAC,CAAC,qBAAqB,CACrB,eAAe,EACf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+ import { useLayoutEffect, useState } from '@wordpress/element';
2
+ import ResizeObserver from 'resize-observer-polyfill';
3
+ /**
4
+ * useGridSize returns the current grid size based on the width of the container
5
+ * and the breakpoints passed through as props.
6
+ */
7
+ export default function useGridSize({ containerRef, containerBreakpoints }) {
8
+ const [gridSize, setGridSize] = useState(null);
9
+ useLayoutEffect(() => {
10
+ if (!containerRef.current) {
11
+ return;
12
+ }
13
+ const observer = new ResizeObserver(([entry]) => {
14
+ const { width } = entry.contentRect;
15
+ if (width) {
16
+ for (const [key, value] of [...containerBreakpoints].reverse()) {
17
+ if (width >= value) {
18
+ setGridSize(key);
19
+ break;
20
+ }
21
+ }
22
+ }
23
+ });
24
+ observer.observe(containerRef.current);
25
+ return () => observer.disconnect();
26
+ }, [containerRef, containerBreakpoints]);
27
+ return gridSize;
28
+ }
29
+ //# sourceMappingURL=use-grid-size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-grid-size.js","sourceRoot":"","sources":["../../../src/hooks/use-grid-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,cAAc,MAAM,0BAA0B,CAAC;AAatD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,EAAE,YAAY,EAAE,oBAAoB,EAAS;IACjF,MAAM,CAAE,QAAQ,EAAE,WAAW,CAAE,GAAG,QAAQ,CAAmB,IAAI,CAAE,CAAC;IAEpE,eAAe,CAAE,GAAG,EAAE;QACrB,IAAK,CAAE,YAAY,CAAC,OAAO,EAAG,CAAC;YAC9B,OAAO;QACR,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAE,CAAE,CAAE,KAAK,CAAE,EAAG,EAAE;YACpD,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC;YAEpC,IAAK,KAAK,EAAG,CAAC;gBACb,KAAM,MAAM,CAAE,GAAG,EAAE,KAAK,CAAE,IAAI,CAAE,GAAG,oBAAoB,CAAE,CAAC,OAAO,EAAE,EAAG,CAAC;oBACtE,IAAK,KAAK,IAAI,KAAK,EAAG,CAAC;wBACtB,WAAW,CAAE,GAAG,CAAE,CAAC;wBACnB,MAAM;oBACP,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC,CAAE,CAAC;QAEJ,QAAQ,CAAC,OAAO,CAAE,YAAY,CAAC,OAAO,CAAE,CAAC;QAEzC,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC,EAAE,CAAE,YAAY,EAAE,oBAAoB,CAAE,CAAE,CAAC;IAE5C,OAAO,QAAQ,CAAC;AACjB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { useMemo } from '@wordpress/element';
2
+ const useHighlightAdjacencyMatrix = ({ renderedGridPlans }) => {
3
+ return useMemo(() => {
4
+ const adjacencyMatrix = {};
5
+ const highlightIndices = renderedGridPlans.reduce((acc, gridPlan, index) => {
6
+ if (gridPlan.highlightLabel) {
7
+ acc.push(index);
8
+ }
9
+ return acc;
10
+ }, []);
11
+ renderedGridPlans.forEach(({ planSlug }, index) => {
12
+ adjacencyMatrix[planSlug] = { leftOfHighlight: false, rightOfHighlight: false };
13
+ highlightIndices.forEach((highlightIndex) => {
14
+ if (highlightIndex === index - 1) {
15
+ adjacencyMatrix[planSlug].rightOfHighlight = true;
16
+ }
17
+ if (highlightIndex === index + 1) {
18
+ adjacencyMatrix[planSlug].leftOfHighlight = true;
19
+ }
20
+ });
21
+ });
22
+ if (highlightIndices.length === 1) {
23
+ adjacencyMatrix[renderedGridPlans[highlightIndices[0]].planSlug].isOnlyHighlight = true;
24
+ }
25
+ return adjacencyMatrix;
26
+ }, [renderedGridPlans]);
27
+ };
28
+ export default useHighlightAdjacencyMatrix;
29
+ //# sourceMappingURL=use-highlight-adjacency-matrix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-highlight-adjacency-matrix.js","sourceRo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CAAC;QAC/F,CAAC;QAED,OAAO,eAAe,CAAC;IACxB,CAAC,EAAE,CAAE,iBAAiB,CAAE,CAAE,CAAC;AAC5B,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { useMemo } from '@wordpress/element';
2
+ import { formatCurrency } from 'i18n-calypso';
3
+ const LARGE_ADD_ON_CURRENCY_CHAR_THRESHOLD = 7;
4
+ const LARGE_CURRENCY_CHAR_THRESHOLD = 6;
5
+ const LARGE_CURRENCY_COMBINED_CHAR_THRESHOLD = 9;
6
+ function useDisplayPrices(currencyCode, prices, ignoreWhitespace = false) {
7
+ /**
8
+ * Prices are represented in smallest units for a currency, and not as prices that
9
+ * are actually displayed. Ex. $20 is the integer 2000, and not 20. To determine if
10
+ * the display price is too long, we convert the integer to a display string.
11
+ */
12
+ return useMemo(() => prices?.map((price) => {
13
+ const displayPrice = formatCurrency(price, currencyCode, {
14
+ stripZeros: true,
15
+ isSmallestUnit: true,
16
+ });
17
+ return ignoreWhitespace ? displayPrice.replace(/\s/g, '') : displayPrice;
18
+ }), [currencyCode, prices, ignoreWhitespace]);
19
+ }
20
+ function hasExceededPriceThreshold(displayPrices, isAddOn = false) {
21
+ const threshold = isAddOn ? LARGE_ADD_ON_CURRENCY_CHAR_THRESHOLD : LARGE_CURRENCY_CHAR_THRESHOLD;
22
+ return !!displayPrices?.some((price) => price.length > threshold);
23
+ }
24
+ /**
25
+ * Returns true if the combined length of the display prices exceeds the threshold.
26
+ * Checks the adjacent pairs in the displayPrices array,
27
+ * which correspnd to the original-price and discounted-price for each plan.
28
+ */
29
+ function hasExceededCombinedPriceThreshold(displayPrices) {
30
+ if (!displayPrices || displayPrices.length < 2) {
31
+ return false;
32
+ }
33
+ for (let i = 0; i < displayPrices.length - 1; i++) {
34
+ const originalPrice = displayPrices[i];
35
+ const discountedPrice = displayPrices[i + 1];
36
+ if (originalPrice.length + discountedPrice.length > LARGE_CURRENCY_COMBINED_CHAR_THRESHOLD) {
37
+ return true;
38
+ }
39
+ }
40
+ return false;
41
+ }
42
+ /**
43
+ * Hook that returns true if the string representation of any price (discounted/undiscounted)
44
+ * of any of the plan slugs exceeds 6 characters. For example, $4,000 would be 6 characters.
45
+ * Additionally, also returns true if the combined discounted / undiscounted prices exceed
46
+ * 9 characters. For example, $4,000 undiscounted and $30 discounted would be 9 characters.
47
+ * This is primarily used for lowering the font-size of "large" display prices.
48
+ */
49
+ export default function useIsLargeCurrency({ prices, isAddOn = false, currencyCode, ignoreWhitespace = false, }) {
50
+ /**
51
+ * Because this hook is primarily used for lowering font-sizes of "large" display prices,
52
+ * this implementation is non-ideal. It assumes that each character in the display price,
53
+ * including currency symbols, comma separators, decimal points, etc. are all the same width.
54
+ *
55
+ * For the time being, however, this is a good enough approximation and works with our existing
56
+ * currencies. We'll need to update this in the near future, especially to prevent issues with
57
+ * newly introduced currencies.
58
+ *
59
+ * https://github.com/Automattic/wp-calypso/pull/81537#discussion_r1323182287
60
+ */
61
+ const displayPrices = useDisplayPrices(currencyCode, prices, ignoreWhitespace);
62
+ const exceedsPriceThreshold = hasExceededPriceThreshold(displayPrices, isAddOn);
63
+ const exceedsCombinedPriceThreshold = hasExceededCombinedPriceThreshold(displayPrices);
64
+ return isAddOn ? exceedsPriceThreshold : exceedsPriceThreshold || exceedsCombinedPriceThreshold;
65
+ }
66
+ //# sourceMappingURL=use-is-large-currency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-is-large-currency.js","sourceRoot":"","sources":["../../../src/hooks/use-is-large-currency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,MAAM,oCAAoC,GAAG,CAAC,CAAC;AAC/C,MAAM,6BAA6B,GAAG,CAAC,CAAC;AACxC,MAAM,sCAAsC,GAAG,CAAC,CAAC;AASjD,SAAS,gBAAgB,CAAE,YAAoB,EA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