@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.
- package/CHANGELOG.md +4 -0
- package/README.md +3 -0
- package/dist/cjs/__mocks__/wpcom-proxy-request.js +17 -0
- package/dist/cjs/__mocks__/wpcom-proxy-request.js.map +1 -0
- package/dist/cjs/_media-queries.scss +14 -0
- package/dist/cjs/_mixins.scss +15 -0
- package/dist/cjs/_shared.scss +174 -0
- package/dist/cjs/components/comparison-grid/index.js +527 -0
- package/dist/cjs/components/comparison-grid/index.js.map +1 -0
- package/dist/cjs/components/comparison-grid/index.stories.js +74 -0
- package/dist/cjs/components/comparison-grid/index.stories.js.map +1 -0
- package/dist/cjs/components/comparison-grid/style.scss +318 -0
- package/dist/cjs/components/dropdown-option.js +33 -0
- package/dist/cjs/components/dropdown-option.js.map +1 -0
- package/dist/cjs/components/features-grid/billing-timeframes.js +15 -0
- package/dist/cjs/components/features-grid/billing-timeframes.js.map +1 -0
- package/dist/cjs/components/features-grid/client-logo-list/client-list.js +106 -0
- package/dist/cjs/components/features-grid/client-logo-list/client-list.js.map +1 -0
- package/dist/cjs/components/features-grid/client-logo-list/index.js +17 -0
- package/dist/cjs/components/features-grid/client-logo-list/index.js.map +1 -0
- package/dist/cjs/components/features-grid/client-logo-list/style.scss +52 -0
- package/dist/cjs/components/features-grid/enterprise-features.js +41 -0
- package/dist/cjs/components/features-grid/enterprise-features.js.map +1 -0
- package/dist/cjs/components/features-grid/index.js +130 -0
- package/dist/cjs/components/features-grid/index.js.map +1 -0
- package/dist/cjs/components/features-grid/index.stories.js +112 -0
- package/dist/cjs/components/features-grid/index.stories.js.map +1 -0
- package/dist/cjs/components/features-grid/mobile-free-domain.js +25 -0
- package/dist/cjs/components/features-grid/mobile-free-domain.js.map +1 -0
- package/dist/cjs/components/features-grid/plan-features-list.js +56 -0
- package/dist/cjs/components/features-grid/plan-features-list.js.map +1 -0
- package/dist/cjs/components/features-grid/plan-headers.js +15 -0
- package/dist/cjs/components/features-grid/plan-headers.js.map +1 -0
- package/dist/cjs/components/features-grid/plan-logos.js +12 -0
- package/dist/cjs/components/features-grid/plan-logos.js.map +1 -0
- package/dist/cjs/components/features-grid/plan-prices.js +14 -0
- package/dist/cjs/components/features-grid/plan-prices.js.map +1 -0
- package/dist/cjs/components/features-grid/plan-tagline.js +12 -0
- package/dist/cjs/components/features-grid/plan-tagline.js.map +1 -0
- package/dist/cjs/components/features-grid/previous-features-included-title.js +36 -0
- package/dist/cjs/components/features-grid/previous-features-included-title.js.map +1 -0
- package/dist/cjs/components/features-grid/spotlight-plan.js +24 -0
- package/dist/cjs/components/features-grid/spotlight-plan.js.map +1 -0
- package/dist/cjs/components/features-grid/spotlight-plan.scss +5 -0
- package/dist/cjs/components/features-grid/style.scss +630 -0
- package/dist/cjs/components/features-grid/table.js +38 -0
- package/dist/cjs/components/features-grid/table.js.map +1 -0
- package/dist/cjs/components/features-grid/top-buttons.js +15 -0
- package/dist/cjs/components/features-grid/top-buttons.js.map +1 -0
- package/dist/cjs/components/features.js +72 -0
- package/dist/cjs/components/features.js.map +1 -0
- package/dist/cjs/components/item.js +9 -0
- package/dist/cjs/components/item.js.map +1 -0
- package/dist/cjs/components/plan-button/index.js +21 -0
- package/dist/cjs/components/plan-button/index.js.map +1 -0
- package/dist/cjs/components/plan-button/style.scss +179 -0
- package/dist/cjs/components/plan-div-td-container.js +9 -0
- package/dist/cjs/components/plan-div-td-container.js.map +1 -0
- package/dist/cjs/components/plan-logo.js +45 -0
- package/dist/cjs/components/plan-logo.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-dropdown.js +39 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-dropdown.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-selector.js +12 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-selector.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-toggle.js +55 -0
- package/dist/cjs/components/plan-type-selector/components/interval-type-toggle.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/components/popup-messages.js +108 -0
- package/dist/cjs/components/plan-type-selector/components/popup-messages.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-interval-options.js +56 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-interval-options.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discount.js +45 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discount.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js +68 -0
- package/dist/cjs/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/index.js +27 -0
- package/dist/cjs/components/plan-type-selector/index.js.map +1 -0
- package/dist/cjs/components/plan-type-selector/style.scss +196 -0
- package/dist/cjs/components/plans-2023-tooltip.js +46 -0
- package/dist/cjs/components/plans-2023-tooltip.js.map +1 -0
- package/dist/cjs/components/popular-badge.js +16 -0
- package/dist/cjs/components/popular-badge.js.map +1 -0
- package/dist/cjs/components/shared/action-button/index.js +91 -0
- package/dist/cjs/components/shared/action-button/index.js.map +1 -0
- package/dist/cjs/components/shared/action-button/style.scss +12 -0
- package/dist/cjs/components/shared/billing-timeframe/index.js +58 -0
- package/dist/cjs/components/shared/billing-timeframe/index.js.map +1 -0
- package/dist/cjs/components/shared/header-price/header-price-context.js +14 -0
- package/dist/cjs/components/shared/header-price/header-price-context.js.map +1 -0
- package/dist/cjs/components/shared/header-price/index.js +102 -0
- package/dist/cjs/components/shared/header-price/index.js.map +1 -0
- package/dist/cjs/components/shared/header-price/style.scss +112 -0
- package/dist/cjs/components/shared/plan-pill/index.js +6 -0
- package/dist/cjs/components/shared/plan-pill/index.js.map +1 -0
- package/dist/cjs/components/shared/plan-pill/style.scss +30 -0
- package/dist/cjs/components/shared/storage/components/plan-storage.js +28 -0
- package/dist/cjs/components/shared/storage/components/plan-storage.js.map +1 -0
- package/dist/cjs/components/shared/storage/components/storage-dropdown.js +96 -0
- package/dist/cjs/components/shared/storage/components/storage-dropdown.js.map +1 -0
- package/dist/cjs/components/shared/storage/components/storage-feature-label.js +40 -0
- package/dist/cjs/components/shared/storage/components/storage-feature-label.js.map +1 -0
- package/dist/cjs/components/shared/storage/constants.js +6 -0
- package/dist/cjs/components/shared/storage/constants.js.map +1 -0
- package/dist/cjs/components/shared/storage/hooks/use-default-storage-option.js +26 -0
- package/dist/cjs/components/shared/storage/hooks/use-default-storage-option.js.map +1 -0
- package/dist/cjs/components/shared/storage/hooks/use-plan-storage.js +29 -0
- package/dist/cjs/components/shared/storage/hooks/use-plan-storage.js.map +1 -0
- package/dist/cjs/components/shared/storage/hooks/use-purchased-storage-add-on.js +51 -0
- package/dist/cjs/components/shared/storage/hooks/use-purchased-storage-add-on.js.map +1 -0
- package/dist/cjs/components/shared/storage/hooks/use-storage-string.js +13 -0
- package/dist/cjs/components/shared/storage/hooks/use-storage-string.js.map +1 -0
- package/dist/cjs/components/shared/storage/index.js +14 -0
- package/dist/cjs/components/shared/storage/index.js.map +1 -0
- package/dist/cjs/components/sticky-container.js +74 -0
- package/dist/cjs/components/sticky-container.js.map +1 -0
- package/dist/cjs/constants.js +11 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/css-mixins.js +14 -0
- package/dist/cjs/css-mixins.js.map +1 -0
- package/dist/cjs/fixtures/plans.js +1542 -0
- package/dist/cjs/fixtures/plans.js.map +1 -0
- package/dist/cjs/fixtures/sites-plans.js +458 -0
- package/dist/cjs/fixtures/sites-plans.js.map +1 -0
- package/dist/cjs/fixtures/sites-purchases.js +133 -0
- package/dist/cjs/fixtures/sites-purchases.js.map +1 -0
- package/dist/cjs/grid-context.js +40 -0
- package/dist/cjs/grid-context.js.map +1 -0
- package/dist/cjs/hooks/data-store/is-popular-plan.js +9 -0
- package/dist/cjs/hooks/data-store/is-popular-plan.js.map +1 -0
- package/dist/cjs/hooks/data-store/types.js +3 -0
- package/dist/cjs/hooks/data-store/types.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-grid-plan-for-spotlight.js +18 -0
- package/dist/cjs/hooks/data-store/use-grid-plan-for-spotlight.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-grid-plans-for-comparison-grid.js +55 -0
- package/dist/cjs/hooks/data-store/use-grid-plans-for-comparison-grid.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-grid-plans-for-features-grid.js +56 -0
- package/dist/cjs/hooks/data-store/use-grid-plans-for-features-grid.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-grid-plans.js +254 -0
- package/dist/cjs/hooks/data-store/use-grid-plans.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-highlight-labels.js +60 -0
- package/dist/cjs/hooks/data-store/use-highlight-labels.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-highlighted-features.js +35 -0
- package/dist/cjs/hooks/data-store/use-highlighted-features.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-plan-billing-description.js +216 -0
- package/dist/cjs/hooks/data-store/use-plan-billing-description.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-plan-features-for-grid-plans.js +133 -0
- package/dist/cjs/hooks/data-store/use-plan-features-for-grid-plans.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-plans-from-types.js +30 -0
- package/dist/cjs/hooks/data-store/use-plans-from-types.js.map +1 -0
- package/dist/cjs/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js +90 -0
- package/dist/cjs/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js.map +1 -0
- package/dist/cjs/hooks/use-grid-size.js +33 -0
- package/dist/cjs/hooks/use-grid-size.js.map +1 -0
- package/dist/cjs/hooks/use-highlight-adjacency-matrix.js +31 -0
- package/dist/cjs/hooks/use-highlight-adjacency-matrix.js.map +1 -0
- package/dist/cjs/hooks/use-is-large-currency.js +69 -0
- package/dist/cjs/hooks/use-is-large-currency.js.map +1 -0
- package/dist/cjs/hooks/use-manage-tooltip-toggle.js +29 -0
- package/dist/cjs/hooks/use-manage-tooltip-toggle.js.map +1 -0
- package/dist/cjs/hooks/use-plan-pricing-info-from-grid-plans.js +17 -0
- package/dist/cjs/hooks/use-plan-pricing-info-from-grid-plans.js.map +1 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/filter-unused-features-object.js +19 -0
- package/dist/cjs/lib/filter-unused-features-object.js.map +1 -0
- package/dist/cjs/lib/get-plan-features-object.js +11 -0
- package/dist/cjs/lib/get-plan-features-object.js.map +1 -0
- package/dist/cjs/lib/get-plan-pricing-info-from-grid-plans.js +16 -0
- package/dist/cjs/lib/get-plan-pricing-info-from-grid-plans.js.map +1 -0
- package/dist/cjs/lib/is-same-plan.js +12 -0
- package/dist/cjs/lib/is-same-plan.js.map +1 -0
- package/dist/cjs/lib/sort-plan-properties.js +39 -0
- package/dist/cjs/lib/sort-plan-properties.js.map +1 -0
- package/dist/cjs/lib/touch-detect/index.js +20 -0
- package/dist/cjs/lib/touch-detect/index.js.map +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/__mocks__/wpcom-proxy-request.js +11 -0
- package/dist/esm/__mocks__/wpcom-proxy-request.js.map +1 -0
- package/dist/esm/_media-queries.scss +14 -0
- package/dist/esm/_mixins.scss +15 -0
- package/dist/esm/_shared.scss +174 -0
- package/dist/esm/components/comparison-grid/index.js +524 -0
- package/dist/esm/components/comparison-grid/index.js.map +1 -0
- package/dist/esm/components/comparison-grid/index.stories.js +71 -0
- package/dist/esm/components/comparison-grid/index.stories.js.map +1 -0
- package/dist/esm/components/comparison-grid/style.scss +318 -0
- package/dist/esm/components/dropdown-option.js +30 -0
- package/dist/esm/components/dropdown-option.js.map +1 -0
- package/dist/esm/components/features-grid/billing-timeframes.js +12 -0
- package/dist/esm/components/features-grid/billing-timeframes.js.map +1 -0
- package/dist/esm/components/features-grid/client-logo-list/client-list.js +104 -0
- package/dist/esm/components/features-grid/client-logo-list/client-list.js.map +1 -0
- package/dist/esm/components/features-grid/client-logo-list/index.js +14 -0
- package/dist/esm/components/features-grid/client-logo-list/index.js.map +1 -0
- package/dist/esm/components/features-grid/client-logo-list/style.scss +52 -0
- package/dist/esm/components/features-grid/enterprise-features.js +38 -0
- package/dist/esm/components/features-grid/enterprise-features.js.map +1 -0
- package/dist/esm/components/features-grid/index.js +127 -0
- package/dist/esm/components/features-grid/index.js.map +1 -0
- package/dist/esm/components/features-grid/index.stories.js +109 -0
- package/dist/esm/components/features-grid/index.stories.js.map +1 -0
- package/dist/esm/components/features-grid/mobile-free-domain.js +23 -0
- package/dist/esm/components/features-grid/mobile-free-domain.js.map +1 -0
- package/dist/esm/components/features-grid/plan-features-list.js +53 -0
- package/dist/esm/components/features-grid/plan-features-list.js.map +1 -0
- package/dist/esm/components/features-grid/plan-headers.js +12 -0
- package/dist/esm/components/features-grid/plan-headers.js.map +1 -0
- package/dist/esm/components/features-grid/plan-logos.js +9 -0
- package/dist/esm/components/features-grid/plan-logos.js.map +1 -0
- package/dist/esm/components/features-grid/plan-prices.js +11 -0
- package/dist/esm/components/features-grid/plan-prices.js.map +1 -0
- package/dist/esm/components/features-grid/plan-tagline.js +9 -0
- package/dist/esm/components/features-grid/plan-tagline.js.map +1 -0
- package/dist/esm/components/features-grid/previous-features-included-title.js +33 -0
- package/dist/esm/components/features-grid/previous-features-included-title.js.map +1 -0
- package/dist/esm/components/features-grid/spotlight-plan.js +21 -0
- package/dist/esm/components/features-grid/spotlight-plan.js.map +1 -0
- package/dist/esm/components/features-grid/spotlight-plan.scss +5 -0
- package/dist/esm/components/features-grid/style.scss +630 -0
- package/dist/esm/components/features-grid/table.js +35 -0
- package/dist/esm/components/features-grid/table.js.map +1 -0
- package/dist/esm/components/features-grid/top-buttons.js +12 -0
- package/dist/esm/components/features-grid/top-buttons.js.map +1 -0
- package/dist/esm/components/features.js +69 -0
- package/dist/esm/components/features.js.map +1 -0
- package/dist/esm/components/item.js +5 -0
- package/dist/esm/components/item.js.map +1 -0
- package/dist/esm/components/plan-button/index.js +18 -0
- package/dist/esm/components/plan-button/index.js.map +1 -0
- package/dist/esm/components/plan-button/style.scss +179 -0
- package/dist/esm/components/plan-div-td-container.js +7 -0
- package/dist/esm/components/plan-div-td-container.js.map +1 -0
- package/dist/esm/components/plan-logo.js +42 -0
- package/dist/esm/components/plan-logo.js.map +1 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-dropdown.js +34 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-dropdown.js.map +1 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-selector.js +8 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-selector.js.map +1 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-toggle.js +50 -0
- package/dist/esm/components/plan-type-selector/components/interval-type-toggle.js.map +1 -0
- package/dist/esm/components/plan-type-selector/components/popup-messages.js +105 -0
- package/dist/esm/components/plan-type-selector/components/popup-messages.js.map +1 -0
- package/dist/esm/components/plan-type-selector/hooks/use-interval-options.js +52 -0
- package/dist/esm/components/plan-type-selector/hooks/use-interval-options.js.map +1 -0
- package/dist/esm/components/plan-type-selector/hooks/use-max-discount.js +42 -0
- package/dist/esm/components/plan-type-selector/hooks/use-max-discount.js.map +1 -0
- package/dist/esm/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js +65 -0
- package/dist/esm/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.js.map +1 -0
- package/dist/esm/components/plan-type-selector/index.js +24 -0
- package/dist/esm/components/plan-type-selector/index.js.map +1 -0
- package/dist/esm/components/plan-type-selector/style.scss +196 -0
- package/dist/esm/components/plans-2023-tooltip.js +41 -0
- package/dist/esm/components/plans-2023-tooltip.js.map +1 -0
- package/dist/esm/components/popular-badge.js +13 -0
- package/dist/esm/components/popular-badge.js.map +1 -0
- package/dist/esm/components/shared/action-button/index.js +88 -0
- package/dist/esm/components/shared/action-button/index.js.map +1 -0
- package/dist/esm/components/shared/action-button/style.scss +12 -0
- package/dist/esm/components/shared/billing-timeframe/index.js +55 -0
- package/dist/esm/components/shared/billing-timeframe/index.js.map +1 -0
- package/dist/esm/components/shared/header-price/header-price-context.js +10 -0
- package/dist/esm/components/shared/header-price/header-price-context.js.map +1 -0
- package/dist/esm/components/shared/header-price/index.js +99 -0
- package/dist/esm/components/shared/header-price/index.js.map +1 -0
- package/dist/esm/components/shared/header-price/style.scss +112 -0
- package/dist/esm/components/shared/plan-pill/index.js +4 -0
- package/dist/esm/components/shared/plan-pill/index.js.map +1 -0
- package/dist/esm/components/shared/plan-pill/style.scss +30 -0
- package/dist/esm/components/shared/storage/components/plan-storage.js +25 -0
- package/dist/esm/components/shared/storage/components/plan-storage.js.map +1 -0
- package/dist/esm/components/shared/storage/components/storage-dropdown.js +93 -0
- package/dist/esm/components/shared/storage/components/storage-dropdown.js.map +1 -0
- package/dist/esm/components/shared/storage/components/storage-feature-label.js +37 -0
- package/dist/esm/components/shared/storage/components/storage-feature-label.js.map +1 -0
- package/dist/esm/components/shared/storage/constants.js +3 -0
- package/dist/esm/components/shared/storage/constants.js.map +1 -0
- package/dist/esm/components/shared/storage/hooks/use-default-storage-option.js +22 -0
- package/dist/esm/components/shared/storage/hooks/use-default-storage-option.js.map +1 -0
- package/dist/esm/components/shared/storage/hooks/use-plan-storage.js +27 -0
- package/dist/esm/components/shared/storage/hooks/use-plan-storage.js.map +1 -0
- package/dist/esm/components/shared/storage/hooks/use-purchased-storage-add-on.js +48 -0
- package/dist/esm/components/shared/storage/hooks/use-purchased-storage-add-on.js.map +1 -0
- package/dist/esm/components/shared/storage/hooks/use-storage-string.js +11 -0
- package/dist/esm/components/shared/storage/hooks/use-storage-string.js.map +1 -0
- package/dist/esm/components/shared/storage/index.js +9 -0
- package/dist/esm/components/shared/storage/index.js.map +1 -0
- package/dist/esm/components/sticky-container.js +69 -0
- package/dist/esm/components/sticky-container.js.map +1 -0
- package/dist/esm/constants.js +8 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/css-mixins.js +10 -0
- package/dist/esm/css-mixins.js.map +1 -0
- package/dist/esm/fixtures/plans.js +1540 -0
- package/dist/esm/fixtures/plans.js.map +1 -0
- package/dist/esm/fixtures/sites-plans.js +456 -0
- package/dist/esm/fixtures/sites-plans.js.map +1 -0
- package/dist/esm/fixtures/sites-purchases.js +131 -0
- package/dist/esm/fixtures/sites-purchases.js.map +1 -0
- package/dist/esm/grid-context.js +36 -0
- package/dist/esm/grid-context.js.map +1 -0
- package/dist/esm/hooks/data-store/is-popular-plan.js +5 -0
- package/dist/esm/hooks/data-store/is-popular-plan.js.map +1 -0
- package/dist/esm/hooks/data-store/types.js +2 -0
- package/dist/esm/hooks/data-store/types.js.map +1 -0
- package/dist/esm/hooks/data-store/use-grid-plan-for-spotlight.js +16 -0
- package/dist/esm/hooks/data-store/use-grid-plan-for-spotlight.js.map +1 -0
- package/dist/esm/hooks/data-store/use-grid-plans-for-comparison-grid.js +52 -0
- package/dist/esm/hooks/data-store/use-grid-plans-for-comparison-grid.js.map +1 -0
- package/dist/esm/hooks/data-store/use-grid-plans-for-features-grid.js +53 -0
- package/dist/esm/hooks/data-store/use-grid-plans-for-features-grid.js.map +1 -0
- package/dist/esm/hooks/data-store/use-grid-plans.js +249 -0
- package/dist/esm/hooks/data-store/use-grid-plans.js.map +1 -0
- package/dist/esm/hooks/data-store/use-highlight-labels.js +58 -0
- package/dist/esm/hooks/data-store/use-highlight-labels.js.map +1 -0
- package/dist/esm/hooks/data-store/use-highlighted-features.js +33 -0
- package/dist/esm/hooks/data-store/use-highlighted-features.js.map +1 -0
- package/dist/esm/hooks/data-store/use-plan-billing-description.js +213 -0
- package/dist/esm/hooks/data-store/use-plan-billing-description.js.map +1 -0
- package/dist/esm/hooks/data-store/use-plan-features-for-grid-plans.js +130 -0
- package/dist/esm/hooks/data-store/use-plan-features-for-grid-plans.js.map +1 -0
- package/dist/esm/hooks/data-store/use-plans-from-types.js +27 -0
- package/dist/esm/hooks/data-store/use-plans-from-types.js.map +1 -0
- package/dist/esm/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js +87 -0
- package/dist/esm/hooks/data-store/use-restructured-plan-features-for-comparison-grid.js.map +1 -0
- package/dist/esm/hooks/use-grid-size.js +29 -0
- package/dist/esm/hooks/use-grid-size.js.map +1 -0
- package/dist/esm/hooks/use-highlight-adjacency-matrix.js +29 -0
- package/dist/esm/hooks/use-highlight-adjacency-matrix.js.map +1 -0
- package/dist/esm/hooks/use-is-large-currency.js +66 -0
- package/dist/esm/hooks/use-is-large-currency.js.map +1 -0
- package/dist/esm/hooks/use-manage-tooltip-toggle.js +25 -0
- package/dist/esm/hooks/use-manage-tooltip-toggle.js.map +1 -0
- package/dist/esm/hooks/use-plan-pricing-info-from-grid-plans.js +13 -0
- package/dist/esm/hooks/use-plan-pricing-info-from-grid-plans.js.map +1 -0
- package/dist/esm/index.js +28 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/filter-unused-features-object.js +17 -0
- package/dist/esm/lib/filter-unused-features-object.js.map +1 -0
- package/dist/esm/lib/get-plan-features-object.js +9 -0
- package/dist/esm/lib/get-plan-features-object.js.map +1 -0
- package/dist/esm/lib/get-plan-pricing-info-from-grid-plans.js +12 -0
- package/dist/esm/lib/get-plan-pricing-info-from-grid-plans.js.map +1 -0
- package/dist/esm/lib/is-same-plan.js +8 -0
- package/dist/esm/lib/is-same-plan.js.map +1 -0
- package/dist/esm/lib/sort-plan-properties.js +35 -0
- package/dist/esm/lib/sort-plan-properties.js.map +1 -0
- package/dist/esm/lib/touch-detect/index.js +16 -0
- package/dist/esm/lib/touch-detect/index.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/tsconfig-cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/__mocks__/wpcom-proxy-request.d.ts +8 -0
- package/dist/types/__mocks__/wpcom-proxy-request.d.ts.map +1 -0
- package/dist/types/components/comparison-grid/index.d.ts +5 -0
- package/dist/types/components/comparison-grid/index.d.ts.map +1 -0
- package/dist/types/components/comparison-grid/index.stories.d.ts +66 -0
- package/dist/types/components/comparison-grid/index.stories.d.ts.map +1 -0
- package/dist/types/components/dropdown-option.d.ts +10 -0
- package/dist/types/components/dropdown-option.d.ts.map +1 -0
- package/dist/types/components/features-grid/billing-timeframes.d.ts +11 -0
- package/dist/types/components/features-grid/billing-timeframes.d.ts.map +1 -0
- package/dist/types/components/features-grid/client-logo-list/client-list.d.ts +11 -0
- package/dist/types/components/features-grid/client-logo-list/client-list.d.ts.map +1 -0
- package/dist/types/components/features-grid/client-logo-list/index.d.ts +4 -0
- package/dist/types/components/features-grid/client-logo-list/index.d.ts.map +1 -0
- package/dist/types/components/features-grid/enterprise-features.d.ts +11 -0
- package/dist/types/components/features-grid/enterprise-features.d.ts.map +1 -0
- package/dist/types/components/features-grid/index.d.ts +5 -0
- package/dist/types/components/features-grid/index.d.ts.map +1 -0
- package/dist/types/components/features-grid/index.stories.d.ts +173 -0
- package/dist/types/components/features-grid/index.stories.d.ts.map +1 -0
- package/dist/types/components/features-grid/mobile-free-domain.d.ts +8 -0
- package/dist/types/components/features-grid/mobile-free-domain.d.ts.map +1 -0
- package/dist/types/components/features-grid/plan-features-list.d.ts +31 -0
- package/dist/types/components/features-grid/plan-features-list.d.ts.map +1 -0
- package/dist/types/components/features-grid/plan-headers.d.ts +10 -0
- package/dist/types/components/features-grid/plan-headers.d.ts.map +1 -0
- package/dist/types/components/features-grid/plan-logos.d.ts +11 -0
- package/dist/types/components/features-grid/plan-logos.d.ts.map +1 -0
- package/dist/types/components/features-grid/plan-prices.d.ts +11 -0
- package/dist/types/components/features-grid/plan-prices.d.ts.map +1 -0
- package/dist/types/components/features-grid/plan-tagline.d.ts +10 -0
- package/dist/types/components/features-grid/plan-tagline.d.ts.map +1 -0
- package/dist/types/components/features-grid/previous-features-included-title.d.ts +10 -0
- package/dist/types/components/features-grid/previous-features-included-title.d.ts.map +1 -0
- package/dist/types/components/features-grid/spotlight-plan.d.ts +17 -0
- package/dist/types/components/features-grid/spotlight-plan.d.ts.map +1 -0
- package/dist/types/components/features-grid/table.d.ts +26 -0
- package/dist/types/components/features-grid/table.d.ts.map +1 -0
- package/dist/types/components/features-grid/top-buttons.d.ts +14 -0
- package/dist/types/components/features-grid/top-buttons.d.ts.map +1 -0
- package/dist/types/components/features.d.ts +17 -0
- package/dist/types/components/features.d.ts.map +1 -0
- package/dist/types/components/item.d.ts +5 -0
- package/dist/types/components/item.d.ts.map +1 -0
- package/dist/types/components/plan-button/index.d.ts +17 -0
- package/dist/types/components/plan-button/index.d.ts.map +1 -0
- package/dist/types/components/plan-div-td-container.d.ts +7 -0
- package/dist/types/components/plan-div-td-container.d.ts.map +1 -0
- package/dist/types/components/plan-logo.d.ts +12 -0
- package/dist/types/components/plan-logo.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/components/interval-type-dropdown.d.ts +4 -0
- package/dist/types/components/plan-type-selector/components/interval-type-dropdown.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/components/interval-type-selector.d.ts +4 -0
- package/dist/types/components/plan-type-selector/components/interval-type-selector.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/components/interval-type-toggle.d.ts +4 -0
- package/dist/types/components/plan-type-selector/components/interval-type-toggle.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/components/popup-messages.d.ts +9 -0
- package/dist/types/components/plan-type-selector/components/popup-messages.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/hooks/use-interval-options.d.ts +11 -0
- package/dist/types/components/plan-type-selector/hooks/use-interval-options.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/hooks/use-max-discount.d.ts +4 -0
- package/dist/types/components/plan-type-selector/hooks/use-max-discount.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.d.ts +10 -0
- package/dist/types/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.d.ts.map +1 -0
- package/dist/types/components/plan-type-selector/index.d.ts +6 -0
- package/dist/types/components/plan-type-selector/index.d.ts.map +1 -0
- package/dist/types/components/plans-2023-tooltip.d.ts +11 -0
- package/dist/types/components/plans-2023-tooltip.d.ts.map +1 -0
- package/dist/types/components/popular-badge.d.ts +9 -0
- package/dist/types/components/popular-badge.d.ts.map +1 -0
- package/dist/types/components/shared/action-button/index.d.ts +19 -0
- package/dist/types/components/shared/action-button/index.d.ts.map +1 -0
- package/dist/types/components/shared/billing-timeframe/index.d.ts +8 -0
- package/dist/types/components/shared/billing-timeframe/index.d.ts.map +1 -0
- package/dist/types/components/shared/header-price/header-price-context.d.ts +12 -0
- package/dist/types/components/shared/header-price/header-price-context.d.ts.map +1 -0
- package/dist/types/components/shared/header-price/index.d.ts +11 -0
- package/dist/types/components/shared/header-price/index.d.ts.map +1 -0
- package/dist/types/components/shared/plan-pill/index.d.ts +3 -0
- package/dist/types/components/shared/plan-pill/index.d.ts.map +1 -0
- package/dist/types/components/shared/storage/components/plan-storage.d.ts +13 -0
- package/dist/types/components/shared/storage/components/plan-storage.d.ts.map +1 -0
- package/dist/types/components/shared/storage/components/storage-dropdown.d.ts +9 -0
- package/dist/types/components/shared/storage/components/storage-dropdown.d.ts.map +1 -0
- package/dist/types/components/shared/storage/components/storage-feature-label.d.ts +7 -0
- package/dist/types/components/shared/storage/components/storage-feature-label.d.ts.map +1 -0
- package/dist/types/components/shared/storage/constants.d.ts +2 -0
- package/dist/types/components/shared/storage/constants.d.ts.map +1 -0
- package/dist/types/components/shared/storage/hooks/use-default-storage-option.d.ts +14 -0
- package/dist/types/components/shared/storage/hooks/use-default-storage-option.d.ts.map +1 -0
- package/dist/types/components/shared/storage/hooks/use-plan-storage.d.ts +4 -0
- package/dist/types/components/shared/storage/hooks/use-plan-storage.d.ts.map +1 -0
- package/dist/types/components/shared/storage/hooks/use-purchased-storage-add-on.d.ts +3 -0
- package/dist/types/components/shared/storage/hooks/use-purchased-storage-add-on.d.ts.map +1 -0
- package/dist/types/components/shared/storage/hooks/use-storage-string.d.ts +4 -0
- package/dist/types/components/shared/storage/hooks/use-storage-string.d.ts.map +1 -0
- package/dist/types/components/shared/storage/index.d.ts +9 -0
- package/dist/types/components/shared/storage/index.d.ts.map +1 -0
- package/dist/types/components/sticky-container.d.ts +33 -0
- package/dist/types/components/sticky-container.d.ts.map +1 -0
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/css-mixins.d.ts +3 -0
- package/dist/types/css-mixins.d.ts.map +1 -0
- package/dist/types/fixtures/plans.d.ts +201 -0
- package/dist/types/fixtures/plans.d.ts.map +1 -0
- package/dist/types/fixtures/sites-plans.d.ts +457 -0
- package/dist/types/fixtures/sites-plans.d.ts.map +1 -0
- package/dist/types/fixtures/sites-purchases.d.ts +96 -0
- package/dist/types/fixtures/sites-purchases.d.ts.map +1 -0
- package/dist/types/grid-context.d.ts +40 -0
- package/dist/types/grid-context.d.ts.map +1 -0
- package/dist/types/hooks/data-store/is-popular-plan.d.ts +2 -0
- package/dist/types/hooks/data-store/is-popular-plan.d.ts.map +1 -0
- package/dist/types/hooks/data-store/types.d.ts +40 -0
- package/dist/types/hooks/data-store/types.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-grid-plan-for-spotlight.d.ts +10 -0
- package/dist/types/hooks/data-store/use-grid-plan-for-spotlight.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-grid-plans-for-comparison-grid.d.ts +5 -0
- package/dist/types/hooks/data-store/use-grid-plans-for-comparison-grid.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-grid-plans-for-features-grid.d.ts +5 -0
- package/dist/types/hooks/data-store/use-grid-plans-for-features-grid.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-grid-plans.d.ts +13 -0
- package/dist/types/hooks/data-store/use-grid-plans.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-highlight-labels.d.ts +20 -0
- package/dist/types/hooks/data-store/use-highlight-labels.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-highlighted-features.d.ts +22 -0
- package/dist/types/hooks/data-store/use-highlighted-features.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-plan-billing-description.d.ts +16 -0
- package/dist/types/hooks/data-store/use-plan-billing-description.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-plan-features-for-grid-plans.d.ts +21 -0
- package/dist/types/hooks/data-store/use-plan-features-for-grid-plans.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-plans-from-types.d.ts +10 -0
- package/dist/types/hooks/data-store/use-plans-from-types.d.ts.map +1 -0
- package/dist/types/hooks/data-store/use-restructured-plan-features-for-comparison-grid.d.ts +15 -0
- package/dist/types/hooks/data-store/use-restructured-plan-features-for-comparison-grid.d.ts.map +1 -0
- package/dist/types/hooks/use-grid-size.d.ts +18 -0
- package/dist/types/hooks/use-grid-size.d.ts.map +1 -0
- package/dist/types/hooks/use-highlight-adjacency-matrix.d.ts +15 -0
- package/dist/types/hooks/use-highlight-adjacency-matrix.d.ts.map +1 -0
- package/dist/types/hooks/use-is-large-currency.d.ts +16 -0
- package/dist/types/hooks/use-is-large-currency.d.ts.map +1 -0
- package/dist/types/hooks/use-manage-tooltip-toggle.d.ts +3 -0
- package/dist/types/hooks/use-manage-tooltip-toggle.d.ts.map +1 -0
- package/dist/types/hooks/use-plan-pricing-info-from-grid-plans.d.ts +11 -0
- package/dist/types/hooks/use-plan-pricing-info-from-grid-plans.d.ts.map +1 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/filter-unused-features-object.d.ts +8 -0
- package/dist/types/lib/filter-unused-features-object.d.ts.map +1 -0
- package/dist/types/lib/get-plan-features-object.d.ts +4 -0
- package/dist/types/lib/get-plan-features-object.d.ts.map +1 -0
- package/dist/types/lib/get-plan-pricing-info-from-grid-plans.d.ts +9 -0
- package/dist/types/lib/get-plan-pricing-info-from-grid-plans.d.ts.map +1 -0
- package/dist/types/lib/is-same-plan.d.ts +3 -0
- package/dist/types/lib/is-same-plan.d.ts.map +1 -0
- package/dist/types/lib/sort-plan-properties.d.ts +3 -0
- package/dist/types/lib/sort-plan-properties.d.ts.map +1 -0
- package/dist/types/lib/touch-detect/index.d.ts +11 -0
- package/dist/types/lib/touch-detect/index.d.ts.map +1 -0
- package/dist/types/types.d.ts +225 -0
- package/dist/types/types.d.ts.map +1 -0
- package/package.json +83 -0
- package/src/__mocks__/wpcom-proxy-request.js +13 -0
- package/src/_media-queries.scss +14 -0
- package/src/_mixins.scss +15 -0
- package/src/_shared.scss +174 -0
- package/src/components/comparison-grid/README.md +3 -0
- package/src/components/comparison-grid/index.stories.tsx +91 -0
- package/src/components/comparison-grid/index.tsx +1215 -0
- package/src/components/comparison-grid/style.scss +318 -0
- package/src/components/dropdown-option.tsx +44 -0
- package/src/components/features-grid/README.md +3 -0
- package/src/components/features-grid/billing-timeframes.tsx +37 -0
- package/src/components/features-grid/client-logo-list/client-list.tsx +199 -0
- package/src/components/features-grid/client-logo-list/index.tsx +24 -0
- package/src/components/features-grid/client-logo-list/style.scss +52 -0
- package/src/components/features-grid/enterprise-features.tsx +101 -0
- package/src/components/features-grid/index.stories.tsx +143 -0
- package/src/components/features-grid/index.tsx +442 -0
- package/src/components/features-grid/mobile-free-domain.tsx +51 -0
- package/src/components/features-grid/plan-features-list.tsx +187 -0
- package/src/components/features-grid/plan-headers.tsx +31 -0
- package/src/components/features-grid/plan-logos.tsx +27 -0
- package/src/components/features-grid/plan-prices.tsx +37 -0
- package/src/components/features-grid/plan-tagline.tsx +25 -0
- package/src/components/features-grid/previous-features-included-title.tsx +66 -0
- package/src/components/features-grid/spotlight-plan.scss +5 -0
- package/src/components/features-grid/spotlight-plan.tsx +77 -0
- package/src/components/features-grid/style.scss +630 -0
- package/src/components/features-grid/table.tsx +185 -0
- package/src/components/features-grid/top-buttons.tsx +49 -0
- package/src/components/features.tsx +168 -0
- package/src/components/item.tsx +9 -0
- package/src/components/plan-button/index.tsx +59 -0
- package/src/components/plan-button/style.scss +179 -0
- package/src/components/plan-div-td-container.tsx +15 -0
- package/src/components/plan-logo.tsx +111 -0
- package/src/components/plan-type-selector/components/interval-type-dropdown.tsx +70 -0
- package/src/components/plan-type-selector/components/interval-type-selector.tsx +13 -0
- package/src/components/plan-type-selector/components/interval-type-toggle.tsx +100 -0
- package/src/components/plan-type-selector/components/popup-messages.tsx +128 -0
- package/src/components/plan-type-selector/hooks/use-interval-options.tsx +89 -0
- package/src/components/plan-type-selector/hooks/use-max-discount.ts +64 -0
- package/src/components/plan-type-selector/hooks/use-max-discounts-for-plan-terms.ts +99 -0
- package/src/components/plan-type-selector/index.tsx +50 -0
- package/src/components/plan-type-selector/style.scss +196 -0
- package/src/components/plans-2023-tooltip.tsx +85 -0
- package/src/components/popular-badge.tsx +30 -0
- package/src/components/shared/README.md +1 -0
- package/src/components/shared/action-button/index.tsx +205 -0
- package/src/components/shared/action-button/style.scss +12 -0
- package/src/components/shared/billing-timeframe/index.tsx +106 -0
- package/src/components/shared/header-price/header-price-context.tsx +24 -0
- package/src/components/shared/header-price/index.tsx +278 -0
- package/src/components/shared/header-price/style.scss +112 -0
- package/src/components/shared/plan-pill/index.jsx +7 -0
- package/src/components/shared/plan-pill/style.scss +30 -0
- package/src/components/shared/storage/components/plan-storage.tsx +51 -0
- package/src/components/shared/storage/components/storage-dropdown.tsx +187 -0
- package/src/components/shared/storage/components/storage-feature-label.tsx +68 -0
- package/src/components/shared/storage/constants.ts +3 -0
- package/src/components/shared/storage/hooks/use-default-storage-option.ts +34 -0
- package/src/components/shared/storage/hooks/use-plan-storage.ts +41 -0
- package/src/components/shared/storage/hooks/use-purchased-storage-add-on.ts +53 -0
- package/src/components/shared/storage/hooks/use-storage-string.ts +13 -0
- package/src/components/shared/storage/index.ts +9 -0
- package/src/components/sticky-container.tsx +146 -0
- package/src/components/test/actions-button.tsx +397 -0
- package/src/components/test/billing-timeframe.tsx +341 -0
- package/src/components/test/header-price.tsx +189 -0
- package/src/components/test/plan-type-selector.tsx +44 -0
- package/src/constants.ts +13 -0
- package/src/css-mixins.tsx +11 -0
- package/src/fixtures/plans.ts +1539 -0
- package/src/fixtures/sites-plans.ts +455 -0
- package/src/fixtures/sites-purchases.ts +130 -0
- package/src/grid-context.tsx +104 -0
- package/src/hooks/data-store/is-popular-plan.ts +5 -0
- package/src/hooks/data-store/types.ts +41 -0
- package/src/hooks/data-store/use-grid-plan-for-spotlight.ts +35 -0
- package/src/hooks/data-store/use-grid-plans-for-comparison-grid.ts +81 -0
- package/src/hooks/data-store/use-grid-plans-for-features-grid.ts +79 -0
- package/src/hooks/data-store/use-grid-plans.tsx +360 -0
- package/src/hooks/data-store/use-highlight-labels.ts +88 -0
- package/src/hooks/data-store/use-highlighted-features.ts +51 -0
- package/src/hooks/data-store/use-plan-billing-description.tsx +309 -0
- package/src/hooks/data-store/use-plan-features-for-grid-plans.ts +219 -0
- package/src/hooks/data-store/use-plans-from-types.ts +51 -0
- package/src/hooks/data-store/use-restructured-plan-features-for-comparison-grid.ts +158 -0
- package/src/hooks/test/use-is-large-currency.ts +69 -0
- package/src/hooks/use-grid-size.ts +46 -0
- package/src/hooks/use-highlight-adjacency-matrix.ts +48 -0
- package/src/hooks/use-is-large-currency.ts +91 -0
- package/src/hooks/use-manage-tooltip-toggle.ts +30 -0
- package/src/hooks/use-plan-pricing-info-from-grid-plans.ts +36 -0
- package/src/index.tsx +46 -0
- package/src/lib/filter-unused-features-object.ts +31 -0
- package/src/lib/get-plan-features-object.ts +12 -0
- package/src/lib/get-plan-pricing-info-from-grid-plans.ts +31 -0
- package/src/lib/is-same-plan.ts +8 -0
- package/src/lib/sort-plan-properties.ts +46 -0
- package/src/lib/test/filter-plan-features-object.ts +65 -0
- package/src/lib/test/sort-plan-properties.ts +104 -0
- package/src/lib/touch-detect/README.md +11 -0
- package/src/lib/touch-detect/index.js +17 -0
- package/src/types.ts +340 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getPlanClass,
|
|
3
|
+
isWpcomEnterpriseGridPlan,
|
|
4
|
+
isFreePlan,
|
|
5
|
+
type FeatureGroupSlug,
|
|
6
|
+
FEATURE_GROUP_STORAGE,
|
|
7
|
+
} from '@automattic/calypso-products';
|
|
8
|
+
import { FoldableCard } from '@automattic/components';
|
|
9
|
+
import { AddOns } from '@automattic/data-stores';
|
|
10
|
+
import { useRef, useMemo } from '@wordpress/element';
|
|
11
|
+
import clsx from 'clsx';
|
|
12
|
+
import { useTranslate } from 'i18n-calypso';
|
|
13
|
+
import PlansGridContextProvider, { usePlansGridContext } from '../../grid-context';
|
|
14
|
+
import useGridSize from '../../hooks/use-grid-size';
|
|
15
|
+
import { PlanFeaturesItem } from '../item';
|
|
16
|
+
import { PlanStorage } from '../shared/storage';
|
|
17
|
+
import BillingTimeframes from './billing-timeframes';
|
|
18
|
+
import EnterpriseFeatures from './enterprise-features';
|
|
19
|
+
import MobileFreeDomain from './mobile-free-domain';
|
|
20
|
+
import PlanFeaturesList from './plan-features-list';
|
|
21
|
+
import PlanHeaders from './plan-headers';
|
|
22
|
+
import PlanLogos from './plan-logos';
|
|
23
|
+
import PlanPrices from './plan-prices';
|
|
24
|
+
import PlanTagline from './plan-tagline';
|
|
25
|
+
import PreviousFeaturesIncludedTitle from './previous-features-included-title';
|
|
26
|
+
import SpotlightPlan from './spotlight-plan';
|
|
27
|
+
import Table from './table';
|
|
28
|
+
import TopButtons from './top-buttons';
|
|
29
|
+
import type {
|
|
30
|
+
DataResponse,
|
|
31
|
+
FeaturesGridExternalProps,
|
|
32
|
+
FeaturesGridProps,
|
|
33
|
+
GridPlan,
|
|
34
|
+
PlanActionOverrides,
|
|
35
|
+
} from '../../types';
|
|
36
|
+
|
|
37
|
+
import './style.scss';
|
|
38
|
+
|
|
39
|
+
type MobileViewProps = {
|
|
40
|
+
currentSitePlanSlug?: string | null;
|
|
41
|
+
generatedWPComSubdomain: DataResponse< { domain_name: string } >;
|
|
42
|
+
gridPlanForSpotlight?: GridPlan;
|
|
43
|
+
hideUnavailableFeatures?: boolean;
|
|
44
|
+
isCustomDomainAllowedOnFreePlan: boolean;
|
|
45
|
+
isInSignup: boolean;
|
|
46
|
+
onStorageAddOnClick?: ( addOnSlug: AddOns.StorageAddOnSlug ) => void;
|
|
47
|
+
paidDomainName?: string;
|
|
48
|
+
planActionOverrides?: PlanActionOverrides;
|
|
49
|
+
renderedGridPlans: GridPlan[];
|
|
50
|
+
selectedFeature?: string;
|
|
51
|
+
showUpgradeableStorage: boolean;
|
|
52
|
+
enableShowAllFeaturesButton?: boolean;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const CardContainer = (
|
|
56
|
+
props: React.ComponentProps< typeof FoldableCard > & { planSlug: string }
|
|
57
|
+
) => {
|
|
58
|
+
const { children, planSlug, ...otherProps } = props;
|
|
59
|
+
|
|
60
|
+
return isWpcomEnterpriseGridPlan( planSlug ) ? (
|
|
61
|
+
<div { ...otherProps }>{ children }</div>
|
|
62
|
+
) : (
|
|
63
|
+
<FoldableCard { ...otherProps } compact clickableHeader>
|
|
64
|
+
{ children }
|
|
65
|
+
</FoldableCard>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const FeaturesContainer = ( props: {
|
|
70
|
+
children: ( featureGroupSlug: FeatureGroupSlug ) => JSX.Element;
|
|
71
|
+
featureGroups: FeatureGroupSlug[];
|
|
72
|
+
gridPlan: GridPlan;
|
|
73
|
+
} ) => {
|
|
74
|
+
const { children, gridPlan, featureGroups } = props;
|
|
75
|
+
const {
|
|
76
|
+
enableCategorisedFeatures,
|
|
77
|
+
enableLogosOnlyForEnterprisePlan,
|
|
78
|
+
enableReducedFeatureGroupSpacing,
|
|
79
|
+
} = usePlansGridContext();
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<>
|
|
83
|
+
<EnterpriseFeatures
|
|
84
|
+
renderedGridPlans={ [ gridPlan ] }
|
|
85
|
+
options={ { isLogosOnly: enableLogosOnlyForEnterprisePlan } }
|
|
86
|
+
/>
|
|
87
|
+
{ ! enableCategorisedFeatures && (
|
|
88
|
+
<PreviousFeaturesIncludedTitle renderedGridPlans={ [ gridPlan ] } />
|
|
89
|
+
) }
|
|
90
|
+
{ featureGroups.map( ( featureGroupSlug: FeatureGroupSlug ) => (
|
|
91
|
+
<div
|
|
92
|
+
className={ clsx( 'plans-grid-next-features-grid__feature-group-row', {
|
|
93
|
+
'is-reduced-feature-group-spacing': enableReducedFeatureGroupSpacing,
|
|
94
|
+
} ) }
|
|
95
|
+
key={ featureGroupSlug }
|
|
96
|
+
>
|
|
97
|
+
{ children( featureGroupSlug ) }
|
|
98
|
+
</div>
|
|
99
|
+
) ) }
|
|
100
|
+
</>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const MobileView = ( {
|
|
105
|
+
currentSitePlanSlug,
|
|
106
|
+
generatedWPComSubdomain,
|
|
107
|
+
gridPlanForSpotlight,
|
|
108
|
+
renderedGridPlans,
|
|
109
|
+
hideUnavailableFeatures,
|
|
110
|
+
isCustomDomainAllowedOnFreePlan,
|
|
111
|
+
isInSignup,
|
|
112
|
+
onStorageAddOnClick,
|
|
113
|
+
paidDomainName,
|
|
114
|
+
planActionOverrides,
|
|
115
|
+
selectedFeature,
|
|
116
|
+
showUpgradeableStorage,
|
|
117
|
+
enableShowAllFeaturesButton,
|
|
118
|
+
}: MobileViewProps ) => {
|
|
119
|
+
const translate = useTranslate();
|
|
120
|
+
const { featureGroupMap } = usePlansGridContext();
|
|
121
|
+
const featureGroups = useMemo(
|
|
122
|
+
() =>
|
|
123
|
+
Object.keys( featureGroupMap ).filter(
|
|
124
|
+
( key ) => FEATURE_GROUP_STORAGE !== key
|
|
125
|
+
) as FeatureGroupSlug[],
|
|
126
|
+
[ featureGroupMap ]
|
|
127
|
+
);
|
|
128
|
+
const storageFeatureGroup = featureGroupMap[ FEATURE_GROUP_STORAGE ];
|
|
129
|
+
|
|
130
|
+
return renderedGridPlans
|
|
131
|
+
.reduce( ( acc, gridPlan ) => {
|
|
132
|
+
// Bring the spotlight plan to the top
|
|
133
|
+
if ( gridPlanForSpotlight?.planSlug === gridPlan.planSlug ) {
|
|
134
|
+
return [ gridPlan ].concat( acc );
|
|
135
|
+
}
|
|
136
|
+
return acc.concat( gridPlan );
|
|
137
|
+
}, [] as GridPlan[] )
|
|
138
|
+
.map( ( gridPlan, index ) => {
|
|
139
|
+
const planCardClasses = clsx(
|
|
140
|
+
'plans-grid-next-features-grid__mobile-plan-card',
|
|
141
|
+
getPlanClass( gridPlan.planSlug )
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
const isNotFreePlan = ! isFreePlan( gridPlan.planSlug );
|
|
145
|
+
const isEnterprisePlan = isWpcomEnterpriseGridPlan( gridPlan.planSlug );
|
|
146
|
+
const featuresEl = (
|
|
147
|
+
<FeaturesContainer gridPlan={ gridPlan } featureGroups={ featureGroups }>
|
|
148
|
+
{ ( featureGroupSlug: FeatureGroupSlug ) => (
|
|
149
|
+
<PlanFeaturesList
|
|
150
|
+
renderedGridPlans={ [ gridPlan ] }
|
|
151
|
+
selectedFeature={ selectedFeature }
|
|
152
|
+
paidDomainName={ paidDomainName }
|
|
153
|
+
hideUnavailableFeatures={ hideUnavailableFeatures }
|
|
154
|
+
generatedWPComSubdomain={ generatedWPComSubdomain }
|
|
155
|
+
isCustomDomainAllowedOnFreePlan={ isCustomDomainAllowedOnFreePlan }
|
|
156
|
+
featureGroupSlug={ featureGroupSlug }
|
|
157
|
+
onStorageAddOnClick={ onStorageAddOnClick }
|
|
158
|
+
showUpgradeableStorage={ showUpgradeableStorage }
|
|
159
|
+
/>
|
|
160
|
+
) }
|
|
161
|
+
</FeaturesContainer>
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
const planCardJsx = (
|
|
165
|
+
<div className={ planCardClasses } key={ `${ gridPlan.planSlug }-${ index }` }>
|
|
166
|
+
<PlanLogos renderedGridPlans={ [ gridPlan ] } isInSignup={ false } />
|
|
167
|
+
<PlanHeaders renderedGridPlans={ [ gridPlan ] } />
|
|
168
|
+
{ isNotFreePlan && isInSignup && <PlanTagline renderedGridPlans={ [ gridPlan ] } /> }
|
|
169
|
+
{ isNotFreePlan && (
|
|
170
|
+
<PlanPrices
|
|
171
|
+
renderedGridPlans={ [ gridPlan ] }
|
|
172
|
+
currentSitePlanSlug={ currentSitePlanSlug }
|
|
173
|
+
/>
|
|
174
|
+
) }
|
|
175
|
+
{ isNotFreePlan && <BillingTimeframes renderedGridPlans={ [ gridPlan ] } /> }
|
|
176
|
+
<MobileFreeDomain gridPlan={ gridPlan } paidDomainName={ paidDomainName } />
|
|
177
|
+
{ storageFeatureGroup && ! isEnterprisePlan && (
|
|
178
|
+
<>
|
|
179
|
+
<PlanFeaturesItem>
|
|
180
|
+
<h2 className="plans-grid-next-features-grid__feature-group-title">
|
|
181
|
+
{ storageFeatureGroup?.getTitle() }
|
|
182
|
+
</h2>
|
|
183
|
+
</PlanFeaturesItem>
|
|
184
|
+
<div className="plan-features-2023-grid__highlighted-feature">
|
|
185
|
+
<PlanFeaturesItem>
|
|
186
|
+
<PlanStorage
|
|
187
|
+
planSlug={ gridPlan.planSlug }
|
|
188
|
+
onStorageAddOnClick={ onStorageAddOnClick }
|
|
189
|
+
showUpgradeableStorage={ showUpgradeableStorage }
|
|
190
|
+
/>
|
|
191
|
+
</PlanFeaturesItem>
|
|
192
|
+
</div>
|
|
193
|
+
</>
|
|
194
|
+
) }
|
|
195
|
+
<TopButtons
|
|
196
|
+
renderedGridPlans={ [ gridPlan ] }
|
|
197
|
+
isInSignup={ isInSignup }
|
|
198
|
+
currentSitePlanSlug={ currentSitePlanSlug }
|
|
199
|
+
planActionOverrides={ planActionOverrides }
|
|
200
|
+
/>
|
|
201
|
+
{ enableShowAllFeaturesButton ? (
|
|
202
|
+
<CardContainer
|
|
203
|
+
header={ translate( 'Show all features' ) }
|
|
204
|
+
planSlug={ gridPlan.planSlug }
|
|
205
|
+
key={ `${ gridPlan.planSlug }-${ index }` }
|
|
206
|
+
className="plans-grid-next-features-grid__mobile-plan-card-foldable-container"
|
|
207
|
+
expanded={
|
|
208
|
+
selectedFeature &&
|
|
209
|
+
gridPlan.features.wpcomFeatures.some(
|
|
210
|
+
( feature ) => feature.getSlug() === selectedFeature
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
>
|
|
214
|
+
{ featuresEl }
|
|
215
|
+
</CardContainer>
|
|
216
|
+
) : (
|
|
217
|
+
<div className="plans-grid-next-features-grid__mobile-plan-card-no-foldable-container">
|
|
218
|
+
{ featuresEl }
|
|
219
|
+
</div>
|
|
220
|
+
) }
|
|
221
|
+
</div>
|
|
222
|
+
);
|
|
223
|
+
return planCardJsx;
|
|
224
|
+
} );
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
type TabletViewProps = {
|
|
228
|
+
currentSitePlanSlug?: string | null;
|
|
229
|
+
generatedWPComSubdomain: DataResponse< { domain_name: string } >;
|
|
230
|
+
gridPlanForSpotlight?: GridPlan;
|
|
231
|
+
hideUnavailableFeatures?: boolean;
|
|
232
|
+
isCustomDomainAllowedOnFreePlan: boolean;
|
|
233
|
+
isInSignup: boolean;
|
|
234
|
+
onStorageAddOnClick?: ( addOnSlug: AddOns.StorageAddOnSlug ) => void;
|
|
235
|
+
paidDomainName?: string;
|
|
236
|
+
planActionOverrides?: PlanActionOverrides;
|
|
237
|
+
renderedGridPlans: GridPlan[];
|
|
238
|
+
selectedFeature?: string;
|
|
239
|
+
showRefundPeriod?: boolean;
|
|
240
|
+
showUpgradeableStorage: boolean;
|
|
241
|
+
stickyRowOffset: number;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
const TabletView = ( {
|
|
245
|
+
currentSitePlanSlug,
|
|
246
|
+
generatedWPComSubdomain,
|
|
247
|
+
gridPlanForSpotlight,
|
|
248
|
+
hideUnavailableFeatures,
|
|
249
|
+
isCustomDomainAllowedOnFreePlan,
|
|
250
|
+
isInSignup,
|
|
251
|
+
onStorageAddOnClick,
|
|
252
|
+
paidDomainName,
|
|
253
|
+
planActionOverrides,
|
|
254
|
+
renderedGridPlans,
|
|
255
|
+
selectedFeature,
|
|
256
|
+
showRefundPeriod,
|
|
257
|
+
showUpgradeableStorage,
|
|
258
|
+
stickyRowOffset,
|
|
259
|
+
}: TabletViewProps ) => {
|
|
260
|
+
const gridPlansWithoutSpotlight = ! gridPlanForSpotlight
|
|
261
|
+
? renderedGridPlans
|
|
262
|
+
: renderedGridPlans.filter( ( { planSlug } ) => gridPlanForSpotlight.planSlug !== planSlug );
|
|
263
|
+
const numberOfPlansToShowOnTop = 4 === gridPlansWithoutSpotlight.length ? 4 : 3;
|
|
264
|
+
const plansForTopRow = gridPlansWithoutSpotlight.slice( 0, numberOfPlansToShowOnTop );
|
|
265
|
+
const plansForBottomRow = gridPlansWithoutSpotlight.slice( numberOfPlansToShowOnTop );
|
|
266
|
+
const tableProps = {
|
|
267
|
+
currentSitePlanSlug,
|
|
268
|
+
generatedWPComSubdomain,
|
|
269
|
+
gridPlanForSpotlight,
|
|
270
|
+
hideUnavailableFeatures,
|
|
271
|
+
isCustomDomainAllowedOnFreePlan,
|
|
272
|
+
isInSignup,
|
|
273
|
+
onStorageAddOnClick,
|
|
274
|
+
paidDomainName,
|
|
275
|
+
planActionOverrides,
|
|
276
|
+
selectedFeature,
|
|
277
|
+
showRefundPeriod,
|
|
278
|
+
showUpgradeableStorage,
|
|
279
|
+
stickyRowOffset,
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
return (
|
|
283
|
+
<>
|
|
284
|
+
<div className="plan-features-2023-grid__table-top">
|
|
285
|
+
<Table renderedGridPlans={ plansForTopRow } { ...tableProps } />
|
|
286
|
+
</div>
|
|
287
|
+
{ plansForBottomRow.length > 0 && (
|
|
288
|
+
<div className="plan-features-2023-grid__table-bottom">
|
|
289
|
+
<Table renderedGridPlans={ plansForBottomRow } { ...tableProps } />
|
|
290
|
+
</div>
|
|
291
|
+
) }
|
|
292
|
+
</>
|
|
293
|
+
);
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
// TODO
|
|
297
|
+
// Now that everything under is functional component, we can deprecate this wrapper and only keep ComparisonGrid instead.
|
|
298
|
+
// More details can be found in https://github.com/Automattic/wp-calypso/issues/87047
|
|
299
|
+
const FeaturesGrid = ( {
|
|
300
|
+
currentSitePlanSlug,
|
|
301
|
+
generatedWPComSubdomain,
|
|
302
|
+
gridPlanForSpotlight,
|
|
303
|
+
gridPlans,
|
|
304
|
+
gridSize,
|
|
305
|
+
hideUnavailableFeatures,
|
|
306
|
+
isCustomDomainAllowedOnFreePlan,
|
|
307
|
+
isInSignup,
|
|
308
|
+
onStorageAddOnClick,
|
|
309
|
+
paidDomainName,
|
|
310
|
+
planActionOverrides,
|
|
311
|
+
selectedFeature,
|
|
312
|
+
showRefundPeriod,
|
|
313
|
+
showUpgradeableStorage,
|
|
314
|
+
stickyRowOffset,
|
|
315
|
+
enableShowAllFeaturesButton,
|
|
316
|
+
}: FeaturesGridProps ) => {
|
|
317
|
+
const spotlightPlanProps = {
|
|
318
|
+
currentSitePlanSlug,
|
|
319
|
+
gridPlanForSpotlight,
|
|
320
|
+
isInSignup,
|
|
321
|
+
onStorageAddOnClick,
|
|
322
|
+
planActionOverrides,
|
|
323
|
+
selectedFeature,
|
|
324
|
+
showUpgradeableStorage,
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
const planFeaturesProps = {
|
|
328
|
+
...spotlightPlanProps,
|
|
329
|
+
generatedWPComSubdomain,
|
|
330
|
+
hideUnavailableFeatures,
|
|
331
|
+
isCustomDomainAllowedOnFreePlan,
|
|
332
|
+
paidDomainName,
|
|
333
|
+
renderedGridPlans: gridPlans,
|
|
334
|
+
showRefundPeriod,
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
return (
|
|
338
|
+
<div className="plans-grid-next-features-grid">
|
|
339
|
+
{ 'small' !== gridSize && <SpotlightPlan { ...spotlightPlanProps } /> }
|
|
340
|
+
<div className="plan-features">
|
|
341
|
+
<div className="plan-features-2023-grid__content">
|
|
342
|
+
<div>
|
|
343
|
+
{ 'large' === gridSize && (
|
|
344
|
+
<div className="plan-features-2023-grid__desktop-view">
|
|
345
|
+
<Table { ...planFeaturesProps } stickyRowOffset={ stickyRowOffset } />
|
|
346
|
+
</div>
|
|
347
|
+
) }
|
|
348
|
+
{ 'medium' === gridSize && (
|
|
349
|
+
<div className="plan-features-2023-grid__tablet-view">
|
|
350
|
+
<TabletView { ...planFeaturesProps } stickyRowOffset={ stickyRowOffset } />
|
|
351
|
+
</div>
|
|
352
|
+
) }
|
|
353
|
+
{ 'small' === gridSize && (
|
|
354
|
+
<div className="plan-features-2023-grid__mobile-view">
|
|
355
|
+
<MobileView
|
|
356
|
+
{ ...planFeaturesProps }
|
|
357
|
+
enableShowAllFeaturesButton={ enableShowAllFeaturesButton }
|
|
358
|
+
/>
|
|
359
|
+
</div>
|
|
360
|
+
) }
|
|
361
|
+
</div>
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
);
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
const WrappedFeaturesGrid = ( props: FeaturesGridExternalProps ) => {
|
|
369
|
+
const {
|
|
370
|
+
siteId,
|
|
371
|
+
intent,
|
|
372
|
+
gridPlans,
|
|
373
|
+
useCheckPlanAvailabilityForPurchase,
|
|
374
|
+
useAction,
|
|
375
|
+
recordTracksEvent,
|
|
376
|
+
allFeaturesList,
|
|
377
|
+
coupon,
|
|
378
|
+
isInAdmin,
|
|
379
|
+
className,
|
|
380
|
+
enableFeatureTooltips,
|
|
381
|
+
enableCategorisedFeatures,
|
|
382
|
+
enableStorageAsBadge,
|
|
383
|
+
enableReducedFeatureGroupSpacing,
|
|
384
|
+
enableLogosOnlyForEnterprisePlan,
|
|
385
|
+
featureGroupMap = {},
|
|
386
|
+
hideFeatureGroupTitles,
|
|
387
|
+
enterpriseFeaturesList,
|
|
388
|
+
enableTermSavingsPriceDisplay,
|
|
389
|
+
} = props;
|
|
390
|
+
|
|
391
|
+
const gridContainerRef = useRef< HTMLDivElement >( null );
|
|
392
|
+
|
|
393
|
+
const gridBreakpoints = useMemo(
|
|
394
|
+
() =>
|
|
395
|
+
new Map( [
|
|
396
|
+
[ 'small', 0 ],
|
|
397
|
+
[ 'medium', 740 ],
|
|
398
|
+
[ 'large', isInAdmin ? 1180 : 1320 ], // 1320 to fit Enterpreneur plan, 1180 to work in admin
|
|
399
|
+
] ),
|
|
400
|
+
[ isInAdmin ]
|
|
401
|
+
);
|
|
402
|
+
|
|
403
|
+
// TODO: this will be deprecated along side removing the wrapper component
|
|
404
|
+
const gridSize = useGridSize( {
|
|
405
|
+
containerRef: gridContainerRef,
|
|
406
|
+
containerBreakpoints: gridBreakpoints,
|
|
407
|
+
} );
|
|
408
|
+
|
|
409
|
+
const classNames = clsx( 'plans-grid-next', className, {
|
|
410
|
+
'is-small': 'small' === gridSize,
|
|
411
|
+
'is-medium': 'medium' === gridSize,
|
|
412
|
+
'is-large': 'large' === gridSize,
|
|
413
|
+
} );
|
|
414
|
+
|
|
415
|
+
return (
|
|
416
|
+
<div ref={ gridContainerRef } className={ classNames }>
|
|
417
|
+
<PlansGridContextProvider
|
|
418
|
+
intent={ intent }
|
|
419
|
+
siteId={ siteId }
|
|
420
|
+
gridPlans={ gridPlans }
|
|
421
|
+
coupon={ coupon }
|
|
422
|
+
useCheckPlanAvailabilityForPurchase={ useCheckPlanAvailabilityForPurchase }
|
|
423
|
+
useAction={ useAction }
|
|
424
|
+
recordTracksEvent={ recordTracksEvent }
|
|
425
|
+
allFeaturesList={ allFeaturesList }
|
|
426
|
+
enableFeatureTooltips={ enableFeatureTooltips }
|
|
427
|
+
enableCategorisedFeatures={ enableCategorisedFeatures }
|
|
428
|
+
enableStorageAsBadge={ enableStorageAsBadge }
|
|
429
|
+
enableReducedFeatureGroupSpacing={ enableReducedFeatureGroupSpacing }
|
|
430
|
+
enableLogosOnlyForEnterprisePlan={ enableLogosOnlyForEnterprisePlan }
|
|
431
|
+
hideFeatureGroupTitles={ hideFeatureGroupTitles }
|
|
432
|
+
featureGroupMap={ featureGroupMap }
|
|
433
|
+
enterpriseFeaturesList={ enterpriseFeaturesList }
|
|
434
|
+
enableTermSavingsPriceDisplay={ enableTermSavingsPriceDisplay }
|
|
435
|
+
>
|
|
436
|
+
<FeaturesGrid { ...props } gridSize={ gridSize ?? undefined } />
|
|
437
|
+
</PlansGridContextProvider>
|
|
438
|
+
</div>
|
|
439
|
+
);
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
export default WrappedFeaturesGrid;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FEATURE_CUSTOM_DOMAIN,
|
|
3
|
+
isWooExpressPlan,
|
|
4
|
+
isWpComFreePlan,
|
|
5
|
+
isWpcomEnterpriseGridPlan,
|
|
6
|
+
} from '@automattic/calypso-products';
|
|
7
|
+
import { useTranslate } from 'i18n-calypso';
|
|
8
|
+
import { GridPlan } from '../../types';
|
|
9
|
+
import { PlanFeaturesItem } from '../item';
|
|
10
|
+
|
|
11
|
+
type MobileFreeDomainProps = {
|
|
12
|
+
gridPlan: GridPlan;
|
|
13
|
+
paidDomainName?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const MobileFreeDomain = ( {
|
|
17
|
+
gridPlan: { planSlug, isMonthlyPlan, features },
|
|
18
|
+
paidDomainName,
|
|
19
|
+
}: MobileFreeDomainProps ) => {
|
|
20
|
+
const translate = useTranslate();
|
|
21
|
+
|
|
22
|
+
if ( isMonthlyPlan || isWpComFreePlan( planSlug ) || isWpcomEnterpriseGridPlan( planSlug ) ) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Remove the custom domain feature for Woo Express plans with introductory offer.
|
|
27
|
+
if (
|
|
28
|
+
isWooExpressPlan( planSlug ) &&
|
|
29
|
+
! features.wpcomFeatures.some( ( feature ) => feature.getSlug() === FEATURE_CUSTOM_DOMAIN )
|
|
30
|
+
) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const displayText = paidDomainName
|
|
35
|
+
? translate( '%(paidDomainName)s is included', {
|
|
36
|
+
args: { paidDomainName },
|
|
37
|
+
} )
|
|
38
|
+
: translate( 'Free domain for one year' );
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div className="plan-features-2023-grid__highlighted-feature">
|
|
42
|
+
<PlanFeaturesItem>
|
|
43
|
+
<span className="plan-features-2023-grid__item-info is-annual-plan-feature is-available">
|
|
44
|
+
<span className="plan-features-2023-grid__item-title is-bold">{ displayText }</span>
|
|
45
|
+
</span>
|
|
46
|
+
</PlanFeaturesItem>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default MobileFreeDomain;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type FeatureGroupSlug,
|
|
3
|
+
isWpcomEnterpriseGridPlan,
|
|
4
|
+
FEATURE_GROUP_STORAGE,
|
|
5
|
+
FEATURE_GROUP_ALL_FEATURES,
|
|
6
|
+
} from '@automattic/calypso-products';
|
|
7
|
+
import { JetpackLogo } from '@automattic/components';
|
|
8
|
+
import { AddOns } from '@automattic/data-stores';
|
|
9
|
+
import { useTranslate } from 'i18n-calypso';
|
|
10
|
+
import { useMemo } from 'react';
|
|
11
|
+
import { usePlansGridContext } from '../../grid-context';
|
|
12
|
+
import { useManageTooltipToggle } from '../../hooks/use-manage-tooltip-toggle';
|
|
13
|
+
import PlanFeatures2023GridFeatures from '../features';
|
|
14
|
+
import { PlanFeaturesItem } from '../item';
|
|
15
|
+
import PlanDivOrTdContainer from '../plan-div-td-container';
|
|
16
|
+
import { Plans2023Tooltip } from '../plans-2023-tooltip';
|
|
17
|
+
import { PlanStorage } from '../shared/storage';
|
|
18
|
+
import type { DataResponse, GridPlan } from '../../types';
|
|
19
|
+
|
|
20
|
+
type PlanFeaturesListProps = {
|
|
21
|
+
/**
|
|
22
|
+
* Used to show a wpcom free domain in the Free plan column when a paid domain is picked.
|
|
23
|
+
*/
|
|
24
|
+
generatedWPComSubdomain?: DataResponse< { domain_name: string } >;
|
|
25
|
+
/**
|
|
26
|
+
* Used to hide features that are not available, instead of strike-through as explained in #76206
|
|
27
|
+
*/
|
|
28
|
+
hideUnavailableFeatures?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Indicates when a custom domain is allowed to be used with the Free plan.
|
|
31
|
+
*/
|
|
32
|
+
isCustomDomainAllowedOnFreePlan?: boolean;
|
|
33
|
+
paidDomainName?: string;
|
|
34
|
+
renderedGridPlans: GridPlan[];
|
|
35
|
+
selectedFeature?: string;
|
|
36
|
+
options?: {
|
|
37
|
+
isTableCell?: boolean;
|
|
38
|
+
};
|
|
39
|
+
featureGroupSlug?: FeatureGroupSlug;
|
|
40
|
+
onStorageAddOnClick?: ( addOnSlug: AddOns.StorageAddOnSlug ) => void;
|
|
41
|
+
showUpgradeableStorage: boolean;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const PlanFeaturesList = ( {
|
|
45
|
+
generatedWPComSubdomain,
|
|
46
|
+
hideUnavailableFeatures,
|
|
47
|
+
isCustomDomainAllowedOnFreePlan,
|
|
48
|
+
options,
|
|
49
|
+
paidDomainName,
|
|
50
|
+
renderedGridPlans,
|
|
51
|
+
selectedFeature,
|
|
52
|
+
featureGroupSlug,
|
|
53
|
+
onStorageAddOnClick,
|
|
54
|
+
showUpgradeableStorage = false,
|
|
55
|
+
}: PlanFeaturesListProps ) => {
|
|
56
|
+
const [ activeTooltipId, setActiveTooltipId ] = useManageTooltipToggle();
|
|
57
|
+
const translate = useTranslate();
|
|
58
|
+
const { featureGroupMap, hideFeatureGroupTitles } = usePlansGridContext();
|
|
59
|
+
const featureGroup = featureGroupSlug && featureGroupMap[ featureGroupSlug ];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* This is a pretty critical and fragile, as it filters out the enterprise plan.
|
|
63
|
+
* If the plan sits anywhere else but the tail/end, it will most likely break the grid (render wrong parts at wrong places).
|
|
64
|
+
*/
|
|
65
|
+
const plansWithFeatures = useMemo( () => {
|
|
66
|
+
return renderedGridPlans.filter(
|
|
67
|
+
( gridPlan ) => ! isWpcomEnterpriseGridPlan( gridPlan.planSlug )
|
|
68
|
+
);
|
|
69
|
+
}, [ renderedGridPlans ] );
|
|
70
|
+
|
|
71
|
+
return plansWithFeatures.map(
|
|
72
|
+
( { planSlug, features: { wpcomFeatures, jetpackFeatures } }, mapIndex ) => {
|
|
73
|
+
// This is temporary. Ideally all feature-groups will include the included features.
|
|
74
|
+
const filteredWpcomFeatures =
|
|
75
|
+
featureGroup?.slug === FEATURE_GROUP_ALL_FEATURES
|
|
76
|
+
? wpcomFeatures
|
|
77
|
+
: wpcomFeatures.filter(
|
|
78
|
+
( feature ) => featureGroup?.getFeatures().includes( feature.getSlug() )
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 1. Storage group is still it's own thing, with no actual features associated. It will join the rest in a follow-up.
|
|
83
|
+
*/
|
|
84
|
+
if ( FEATURE_GROUP_STORAGE === featureGroup?.slug ) {
|
|
85
|
+
return (
|
|
86
|
+
<PlanDivOrTdContainer
|
|
87
|
+
key={ `${ planSlug }-${ mapIndex }` }
|
|
88
|
+
isTableCell={ options?.isTableCell }
|
|
89
|
+
className="plan-features-2023-grid__table-item"
|
|
90
|
+
>
|
|
91
|
+
{ ! hideFeatureGroupTitles && (
|
|
92
|
+
<PlanFeaturesItem>
|
|
93
|
+
<h2 className="plans-grid-next-features-grid__feature-group-title">
|
|
94
|
+
{ featureGroup?.getTitle() }
|
|
95
|
+
</h2>
|
|
96
|
+
</PlanFeaturesItem>
|
|
97
|
+
) }
|
|
98
|
+
<PlanFeaturesItem>
|
|
99
|
+
<PlanStorage
|
|
100
|
+
planSlug={ planSlug }
|
|
101
|
+
options={ { isTableCell: true } }
|
|
102
|
+
onStorageAddOnClick={ onStorageAddOnClick }
|
|
103
|
+
showUpgradeableStorage={ showUpgradeableStorage }
|
|
104
|
+
/>
|
|
105
|
+
</PlanFeaturesItem>
|
|
106
|
+
</PlanDivOrTdContainer>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* 2. Render a placeholder to keep the grid (table) aligned.
|
|
112
|
+
*/
|
|
113
|
+
if ( ! filteredWpcomFeatures.length ) {
|
|
114
|
+
if ( options?.isTableCell ) {
|
|
115
|
+
return (
|
|
116
|
+
<PlanDivOrTdContainer
|
|
117
|
+
key={ `${ planSlug }-${ mapIndex }` }
|
|
118
|
+
isTableCell
|
|
119
|
+
className="plan-features-2023-grid__table-item"
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// No placeholder required if the element is not a part of the table.
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* 3. Everything else gets rendered as usual.
|
|
130
|
+
*/
|
|
131
|
+
return (
|
|
132
|
+
<PlanDivOrTdContainer
|
|
133
|
+
key={ `${ planSlug }-${ mapIndex }` }
|
|
134
|
+
isTableCell={ options?.isTableCell }
|
|
135
|
+
className="plan-features-2023-grid__table-item"
|
|
136
|
+
>
|
|
137
|
+
{ ! hideFeatureGroupTitles && featureGroup?.getTitle() && (
|
|
138
|
+
<PlanFeaturesItem>
|
|
139
|
+
<h2 className="plans-grid-next-features-grid__feature-group-title">
|
|
140
|
+
{ featureGroup.getTitle() }
|
|
141
|
+
</h2>
|
|
142
|
+
</PlanFeaturesItem>
|
|
143
|
+
) }
|
|
144
|
+
<PlanFeatures2023GridFeatures
|
|
145
|
+
features={ filteredWpcomFeatures }
|
|
146
|
+
planSlug={ planSlug }
|
|
147
|
+
paidDomainName={ paidDomainName }
|
|
148
|
+
generatedWPComSubdomain={ generatedWPComSubdomain }
|
|
149
|
+
hideUnavailableFeatures={ hideUnavailableFeatures }
|
|
150
|
+
selectedFeature={ selectedFeature }
|
|
151
|
+
isCustomDomainAllowedOnFreePlan={ isCustomDomainAllowedOnFreePlan }
|
|
152
|
+
setActiveTooltipId={ setActiveTooltipId }
|
|
153
|
+
activeTooltipId={ activeTooltipId }
|
|
154
|
+
/>
|
|
155
|
+
{ jetpackFeatures.length !== 0 && (
|
|
156
|
+
<>
|
|
157
|
+
<div className="plan-features-2023-grid__jp-logo" key="jp-logo">
|
|
158
|
+
<Plans2023Tooltip
|
|
159
|
+
text={ translate(
|
|
160
|
+
'Security, performance, and growth tools—powered by Jetpack.'
|
|
161
|
+
) }
|
|
162
|
+
setActiveTooltipId={ setActiveTooltipId }
|
|
163
|
+
activeTooltipId={ activeTooltipId }
|
|
164
|
+
id={ `${ planSlug }-jp-logo-${ mapIndex }` }
|
|
165
|
+
>
|
|
166
|
+
<JetpackLogo size={ 16 } />
|
|
167
|
+
</Plans2023Tooltip>
|
|
168
|
+
</div>
|
|
169
|
+
<PlanFeatures2023GridFeatures
|
|
170
|
+
features={ jetpackFeatures }
|
|
171
|
+
planSlug={ planSlug }
|
|
172
|
+
paidDomainName={ paidDomainName }
|
|
173
|
+
generatedWPComSubdomain={ generatedWPComSubdomain }
|
|
174
|
+
hideUnavailableFeatures={ hideUnavailableFeatures }
|
|
175
|
+
isCustomDomainAllowedOnFreePlan={ isCustomDomainAllowedOnFreePlan }
|
|
176
|
+
setActiveTooltipId={ setActiveTooltipId }
|
|
177
|
+
activeTooltipId={ activeTooltipId }
|
|
178
|
+
/>
|
|
179
|
+
</>
|
|
180
|
+
) }
|
|
181
|
+
</PlanDivOrTdContainer>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export default PlanFeaturesList;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { getPlanClass } from '@automattic/calypso-products';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { GridPlan } from '../../types';
|
|
4
|
+
import PlanDivOrTdContainer from '../plan-div-td-container';
|
|
5
|
+
|
|
6
|
+
type PlanHeadersProps = {
|
|
7
|
+
renderedGridPlans: GridPlan[];
|
|
8
|
+
options?: {
|
|
9
|
+
isTableCell?: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const PlanHeaders = ( { options, renderedGridPlans }: PlanHeadersProps ) => {
|
|
14
|
+
return renderedGridPlans.map( ( { planSlug, planTitle } ) => {
|
|
15
|
+
const headerClasses = clsx( 'plan-features-2023-grid__header', getPlanClass( planSlug ) );
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<PlanDivOrTdContainer
|
|
19
|
+
key={ planSlug }
|
|
20
|
+
className="plan-features-2023-grid__table-item"
|
|
21
|
+
isTableCell={ options?.isTableCell }
|
|
22
|
+
>
|
|
23
|
+
<header className={ headerClasses }>
|
|
24
|
+
<h4 className="plan-features-2023-grid__header-title">{ planTitle }</h4>
|
|
25
|
+
</header>
|
|
26
|
+
</PlanDivOrTdContainer>
|
|
27
|
+
);
|
|
28
|
+
} );
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default PlanHeaders;
|