@ubnt/store.core 11.0.4 → 11.0.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +840 -21
- package/lib/assets/ai-360.jpg +0 -0
- package/lib/assets/ai-3602.jpg +0 -0
- package/lib/assets/ai-dome.jpg +0 -0
- package/lib/assets/ai-dome2.jpg +0 -0
- package/lib/assets/ai-lpr.jpg +0 -0
- package/lib/assets/ai-lpr2.jpg +0 -0
- package/lib/assets/ai-theta.jpg +0 -0
- package/lib/assets/ai-theta2.jpg +0 -0
- package/lib/assets/ai-turret.jpg +0 -0
- package/lib/assets/ai-turret2.jpg +0 -0
- package/lib/assets/attention.svg +5 -5
- package/lib/assets/attention2.svg +5 -5
- package/lib/assets/bullet2.svg +4 -2
- package/lib/assets/bullet3.svg +2 -4
- package/lib/assets/express.jpg +0 -0
- package/lib/assets/express2.jpg +0 -0
- package/lib/assets/g3-reader-flex.jpg +0 -0
- package/lib/assets/g3-reader-flex2.jpg +0 -0
- package/lib/assets/g4-ptz.jpg +0 -0
- package/lib/assets/g4-ptz2.jpg +0 -0
- package/lib/assets/g5-flex.jpg +0 -0
- package/lib/assets/g5-flex2.jpg +0 -0
- package/lib/assets/intercom.jpg +0 -0
- package/lib/assets/intercom2.jpg +0 -0
- package/lib/assets/interior-design.svg +2 -2
- package/lib/assets/interior-design2.svg +2 -2
- package/lib/assets/minus4.svg +8 -8
- package/lib/assets/minus5.svg +8 -8
- package/lib/assets/plus4.svg +9 -9
- package/lib/assets/plus5.svg +9 -9
- package/lib/components/CategoryTabs/CategoryTabs.d.ts +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.js +18 -4
- package/lib/components/CategoryTabs/CategoryTabs.js.map +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.mjs +19 -5
- package/lib/components/CategoryTabs/CategoryTabs.mjs.map +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.stories.d.ts +5 -0
- package/lib/components/CategoryTabs/CategoryTabs.styles.d.ts +22 -4
- package/lib/components/CategoryTabs/CategoryTabs.styles.js +123 -22
- package/lib/components/CategoryTabs/CategoryTabs.styles.js.map +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs +122 -23
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs.map +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.types.d.ts +8 -0
- package/lib/components/Header/AccountFrame/AccountFrame.js +0 -1
- package/lib/components/Header/AccountFrame/AccountFrame.js.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.mjs +0 -1
- package/lib/components/Header/AccountFrame/AccountFrame.mjs.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.styles.d.ts +4 -8
- package/lib/components/Header/AccountFrame/AccountFrame.styles.js +7 -2
- package/lib/components/Header/AccountFrame/AccountFrame.styles.js.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.styles.mjs +7 -2
- package/lib/components/Header/AccountFrame/AccountFrame.styles.mjs.map +1 -1
- package/lib/components/Header/Header.stories.d.ts +2 -2
- package/lib/components/Header/Header.types.d.ts +2 -2
- package/lib/components/Header/Header.types.js.map +1 -1
- package/lib/components/Header/Header.types.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.js +19 -8
- package/lib/components/Header/LanguageFrame/LanguageFrame.js.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.mjs +20 -9
- package/lib/components/Header/LanguageFrame/LanguageFrame.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.d.ts +1 -0
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.js +8 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.js.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.mjs +8 -2
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.types.d.ts +1 -1
- package/lib/components/Header/MenuItem/MenuItem.js +8 -0
- package/lib/components/Header/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.mjs +8 -0
- package/lib/components/Header/MenuItem/MenuItem.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.types.d.ts +1 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.js +1 -0
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.mjs +1 -0
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.d.ts +1 -1
- package/lib/components/Header/ProHeader/ProHeader.js +2 -0
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +2 -0
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +4 -2
- package/lib/components/Header/ProHeader/ProHeader.styles.js +8 -0
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs +8 -0
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
- package/lib/components/MicrositeHeader/MicrositeHeader.types.d.ts +4 -2
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.js +24 -0
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.mjs +24 -0
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.js +13 -2
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.js.map +1 -1
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.mjs +13 -2
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.js +23 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.js.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.mjs +24 -2
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.js +20 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.js.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.mjs +20 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.d.ts +3 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.js +15 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.js.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.mjs +15 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.d.ts +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.js +11 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.js.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.mjs +11 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.styles.js +3 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.styles.js.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.styles.mjs +3 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.d.ts +8 -2
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.js +29 -0
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.mjs +29 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.js +28 -3
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.mjs +30 -5
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/helpers/RenderButton.js +13 -9
- package/lib/components/ModelCompareV4/CompareTable/helpers/RenderButton.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/helpers/RenderButton.mjs +13 -9
- package/lib/components/ModelCompareV4/CompareTable/helpers/RenderButton.mjs.map +1 -1
- package/lib/components/ModelCompareV4/ProductList/ProductList.styles.js +10 -0
- package/lib/components/ModelCompareV4/ProductList/ProductList.styles.js.map +1 -1
- package/lib/components/ModelCompareV4/ProductList/ProductList.styles.mjs +10 -0
- package/lib/components/ModelCompareV4/ProductList/ProductList.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Compact/g5-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Compact/g5-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/express.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/express.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/express.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/express.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-dome.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-turret.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-turret.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/interior-design.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/interior-design.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g5-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g5-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-dome.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-turret.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-turret.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g4-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g4-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/interior-design.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/interior-design.svg.mjs +2 -2
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.js +3 -3
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.mjs +2 -2
- package/lib/constants/modelCompareData/data/GatewaysCompact.js.map +1 -1
- package/lib/constants/modelCompareData/data/GatewaysCompact.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/GatewaysDreamRouters.js.map +1 -1
- package/lib/constants/modelCompareData/data/GatewaysDreamRouters.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/GatewaysExpress.js.map +1 -1
- package/lib/constants/modelCompareData/data/GatewaysExpress.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/PhysicalSecurityCompact.js.map +1 -1
- package/lib/constants/modelCompareData/data/PhysicalSecurityCompact.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/InteriorDesign.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/InteriorDesign.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/bullet.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/bullet.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/interiorDesign.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/interiorDesign.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/ai360.js +2 -2
- package/lib/constants/modelCompareData/data/products/ai360.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiDome.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiDome.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiLpr.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiLpr.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiTurret.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiTurret.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/express.js +1 -1
- package/lib/constants/modelCompareData/data/products/express.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/express.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/express.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/express7.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/express7.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/g3ReaderFlex.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderFlex.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g4Instant.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/g4Instant.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/g4Ptz.js +2 -2
- package/lib/constants/modelCompareData/data/products/g4Ptz.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Flex.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Flex.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/g5Flex.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Flex.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/g6Instant.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/g6Instant.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/intercom.js +2 -2
- package/lib/constants/modelCompareData/data/products/intercom.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/theta.js +2 -2
- package/lib/constants/modelCompareData/data/products/theta.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/ucCastLite.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/ucCastLite.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/products/udr.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/udr.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/ar.json.js +0 -2
- package/lib/constants/modelCompareData/translations/ar.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/ar.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/ar.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/de.json.js +0 -2
- package/lib/constants/modelCompareData/translations/de.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/de.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/de.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/el.json.js +0 -2
- package/lib/constants/modelCompareData/translations/el.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/el.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/el.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/es.json.js +0 -2
- package/lib/constants/modelCompareData/translations/es.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/es.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/es.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/fr.json.js +0 -2
- package/lib/constants/modelCompareData/translations/fr.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/fr.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/fr.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/it.json.js +0 -2
- package/lib/constants/modelCompareData/translations/it.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/it.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/it.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/ja.json.js +0 -2
- package/lib/constants/modelCompareData/translations/ja.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/ja.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/ja.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/pt-BR.json.js +0 -2
- package/lib/constants/modelCompareData/translations/pt-BR.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/pt-BR.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/pt-BR.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/zh-Hans.json.js +0 -2
- package/lib/constants/modelCompareData/translations/zh-Hans.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/zh-Hans.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/zh-Hant-TW.json.js +0 -2
- package/lib/constants/modelCompareData/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/zh-Hant-TW.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/types.js.map +1 -1
- package/lib/constants/modelCompareData/types.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.js +0 -1
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +0 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/contexts/MenuContext/utils.d.ts +10 -0
- package/lib/contexts/MenuContext/utils.js +29 -0
- package/lib/contexts/MenuContext/utils.js.map +1 -1
- package/lib/contexts/MenuContext/utils.mjs +28 -1
- package/lib/contexts/MenuContext/utils.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -23,6 +23,10 @@ export declare const HEADER_GRID_ITEM_Y_PADDING = 16;
|
|
|
23
23
|
export declare const HEADER_GRID_ITEM_GAP_DESKTOP = 24;
|
|
24
24
|
export declare const HEADER_GRID_ITEM_GAP_MOBILE = 12;
|
|
25
25
|
export declare const ProductHeaderTooltipStyles: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
26
|
+
export declare const ProductHeaderTooltipHoverArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
27
|
+
$width: number | undefined;
|
|
28
|
+
$tooltipIsPositionedTop: boolean;
|
|
29
|
+
}>> & string;
|
|
26
30
|
export declare const ProductHeaderTooltipLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
|
|
27
31
|
export declare const HeaderGridItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Pick<{
|
|
28
32
|
stickY?: boolean;
|
|
@@ -111,9 +115,11 @@ export declare const PropertyTooltip: import("styled-components/dist/types").ISt
|
|
|
111
115
|
export declare const PropertyTooltipContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
112
116
|
export declare const TooltipIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../../StyleableSvgImage").StyleableSvgImageProps, never>> & string & Omit<({ src, width, height, renderedHeight, className, $active, }: import("../../StyleableSvgImage").StyleableSvgImageProps) => JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
113
117
|
export declare const ButtonWrap: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
114
|
-
export declare const Button: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
118
|
+
export declare const Button: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../../Button/Button.types").ButtonProps & {
|
|
115
119
|
children?: import("react").ReactNode;
|
|
116
|
-
} & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement | null>,
|
|
120
|
+
} & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement | null>, {
|
|
121
|
+
$removePointerEvents: boolean;
|
|
122
|
+
}>> & string & Omit<import("react").ForwardRefExoticComponent<import("../../Button/Button.types").ButtonProps & {
|
|
117
123
|
children?: import("react").ReactNode;
|
|
118
124
|
} & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement | null>>, keyof import("react").Component<any, {}, any>>;
|
|
119
125
|
export declare const ComingSoon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../../Button/Button.types").ButtonProps & {
|
|
@@ -30,6 +30,7 @@ const HEADER_GRID_ITEM_Y_PADDING = 16;
|
|
|
30
30
|
const HEADER_GRID_ITEM_GAP_DESKTOP = 24;
|
|
31
31
|
const HEADER_GRID_ITEM_GAP_MOBILE = 12;
|
|
32
32
|
const ProductHeaderTooltipStyles = styled__default["default"].div`
|
|
33
|
+
position: relative;
|
|
33
34
|
.${PRODUCT_HEADER_TOOLTIP_CLASSNAME} {
|
|
34
35
|
box-shadow: 0 8px 24px 0 #00000014;
|
|
35
36
|
width: 175px;
|
|
@@ -46,8 +47,29 @@ const ProductHeaderTooltipStyles = styled__default["default"].div`
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
`;
|
|
50
|
+
const ProductHeaderTooltipHoverArea = styled__default["default"].div`
|
|
51
|
+
position: absolute;
|
|
52
|
+
${({
|
|
53
|
+
$tooltipIsPositionedTop
|
|
54
|
+
}) => $tooltipIsPositionedTop ? styled.css`
|
|
55
|
+
bottom: 0;
|
|
56
|
+
` : styled.css`
|
|
57
|
+
top: 0;
|
|
58
|
+
`}
|
|
59
|
+
bottom: 0;
|
|
60
|
+
right: 50%;
|
|
61
|
+
transform: translateX(50%);
|
|
62
|
+
width: ${({
|
|
63
|
+
$width
|
|
64
|
+
}) => $width ?? 175}px;
|
|
65
|
+
height: 35px;
|
|
66
|
+
`;
|
|
49
67
|
const ProductHeaderTooltipLink = styled__default["default"].a`
|
|
50
68
|
color: ${theme.theme.colors.primaryBlue};
|
|
69
|
+
|
|
70
|
+
&:hover {
|
|
71
|
+
color: ${theme.theme.colors.primaryBlue};
|
|
72
|
+
}
|
|
51
73
|
`;
|
|
52
74
|
const HeaderGridItem = styled__default["default"](StickyGridItem.StickyGridItem)`
|
|
53
75
|
background: ${theme.theme.colors.white};
|
|
@@ -301,6 +323,12 @@ const buttonStyles = styled.css`
|
|
|
301
323
|
`;
|
|
302
324
|
const Button = styled__default["default"](Button$1.Button)`
|
|
303
325
|
${buttonStyles};
|
|
326
|
+
|
|
327
|
+
${({
|
|
328
|
+
$removePointerEvents
|
|
329
|
+
}) => $removePointerEvents && styled.css`
|
|
330
|
+
pointer-events: none;
|
|
331
|
+
`}
|
|
304
332
|
`;
|
|
305
333
|
const ComingSoon = styled__default["default"](Button$1.Button)`
|
|
306
334
|
${buttonStyles};
|
|
@@ -385,6 +413,7 @@ exports.NotesWrap = NotesWrap;
|
|
|
385
413
|
exports.PRODUCT_HEADER_TOOLTIP_CLASSNAME = PRODUCT_HEADER_TOOLTIP_CLASSNAME;
|
|
386
414
|
exports.PlaceholderGridItem = PlaceholderGridItem;
|
|
387
415
|
exports.ProductDescription = ProductDescription;
|
|
416
|
+
exports.ProductHeaderTooltipHoverArea = ProductHeaderTooltipHoverArea;
|
|
388
417
|
exports.ProductHeaderTooltipLink = ProductHeaderTooltipLink;
|
|
389
418
|
exports.ProductHeaderTooltipStyles = ProductHeaderTooltipStyles;
|
|
390
419
|
exports.ProductImage = ProductImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompareTable.styles.js","sources":["../../../../src/components/ModelCompareV4/CompareTable/CompareTable.styles.tsx"],"sourcesContent":["import styled, { createGlobalStyle, css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../constants/layout\";\nimport { theme } from \"../../../constants/theme\";\nimport type { LanguageDirectionType } from \"../../../contexts/MenuContext/utils\";\nimport { Badge as BadgeBase } from \"../../Badge\";\nimport { Button as ButtonBase } from \"../../Button\";\nimport { StyleableSvgImage } from \"../../StyleableSvgImage\";\nimport { StickyGridItem } from \"./CompareTableMarkup/components/StickyGrid\";\n\nexport const MOBILE_BREAKPOINT = 650;\n\nexport const TOOLTIP_CLASS_NAME = `model-compare-tooltip`;\nexport const PRODUCT_HEADER_TOOLTIP_CLASSNAME =\n \"model-compare-product-header-tooltip\";\n\nexport const PlaceholderGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n z-index: 3;\n`;\n\nexport const CenterPlaceholderGridItem = styled(StickyGridItem)``;\n\nexport const HEADER_GRID_ITEM_Y_PADDING = 16;\n\nexport const HEADER_GRID_ITEM_GAP_DESKTOP = 24;\nexport const HEADER_GRID_ITEM_GAP_MOBILE = 12;\n\nexport const ProductHeaderTooltipStyles = styled.div`\n .${PRODUCT_HEADER_TOOLTIP_CLASSNAME} {\n box-shadow: 0 8px 24px 0 #00000014;\n width: 175px;\n font-size: 12px;\n line-height: 16px;\n font-weight: 700;\n padding: 10px 20px;\n margin-top: -1.5px;\n background: white;\n\n &::before {\n box-shadow: 0 8px 24px 0 #00000014;\n background: white;\n }\n }\n`;\nexport const ProductHeaderTooltipLink = styled.a`\n color: ${theme.colors.primaryBlue};\n`;\n\nexport const HeaderGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n text-align: center;\n padding: ${HEADER_GRID_ITEM_Y_PADDING}px 0;\n gap: ${HEADER_GRID_ITEM_GAP_DESKTOP}px;\n position: relative;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n gap: ${HEADER_GRID_ITEM_GAP_MOBILE}px;\n /* Need this padding-top so sticky offset looks good on mobile */\n padding: 25px 0 0;\n }\n`;\n\nexport const EmptyHeaderGridItem = styled(HeaderGridItem)`\n align-items: center;\n justify-content: center;\n`;\n\nexport const EmptyHeaderEmptyProductDescription = styled.div<{\n $headerItemsAreSticking: boolean;\n}>`\n width: 100%;\n height: 100%;\n\n ${({ $headerItemsAreSticking }) =>\n $headerItemsAreSticking &&\n css`\n display: none;\n `}\n`;\n\nexport const HeaderGridItemContainer = styled.div<{ $isStuck: boolean }>`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n`;\n\nexport const RemoveProductButton = styled.button<{ $isSmallScreen: boolean }>`\n position: absolute;\n top: 25px;\n right: 25px;\n background: transparent;\n border: none;\n padding: 5px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 30px;\n color: #c2c6cb;\n\n ${({ $isSmallScreen }) =>\n $isSmallScreen &&\n css`\n top: 0;\n right: 4%;\n `}\n`;\n\nexport const ProductMeta = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n width: 100%;\n padding: 0 10px;\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n &::before {\n display: none;\n }\n &::after {\n display: none;\n }\n }\n`;\n\nconst productTitleStyles = css`\n font-size: 16px;\n font-weight: 700;\n line-height: normal;\n letter-spacing: -0.32px;\n`;\n\nexport const ProductTitle = styled.div`\n ${productTitleStyles}\n\n color: ${theme.colors.black};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 14px;\n }\n`;\n\nexport const ProductTitleLink = styled(ButtonBase)`\n ${productTitleStyles}\n color: ${theme.colors.primaryBlue};\n\n :focus,\n :hover {\n text-decoration: none;\n }\n\n :focus {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const ProductDescription = styled.div<{\n $maxWidth?: number;\n $direction: LanguageDirectionType;\n}>`\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n margin-top: 6px;\n letter-spacing: -0.24px;\n color: ${theme.colors.black65};\n max-width: ${({ $maxWidth }) => ($maxWidth ? `${$maxWidth}px` : \"auto\")};\n direction: ${({ $direction }) => $direction && `${$direction}`};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n margin: 4px auto 12px;\n font-size: 12px;\n }\n`;\n\nexport const SelectFromAboveIsStuckContainer = styled.div<{\n $isStuck: boolean;\n}>`\n display: none;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n align-items: center;\n\n ${({ $isStuck }) =>\n $isStuck &&\n css`\n display: flex;\n `}\n`;\n\nexport const SelectFromAboveIsStuck = styled(ProductDescription)`\n margin: 0;\n`;\n\nexport const ProductNote = styled.div`\n color: ${theme.colors.black45};\n font-size: ${theme.font.size10};\n line-height: 16.8px;\n margin-top: 6px;\n text-align: center;\n`;\n\nexport const Badge = styled(BadgeBase)`\n margin: 10px 0 20px;\n`;\n\nexport const BadgeWrapper = styled.div`\n margin-top: auto;\n display: flex;\n gap: 10px;\n`;\n\nexport const PropertyTitleGridItem = styled(StickyGridItem)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n border-bottom: 1px solid ${theme.colors.athensGreyDark};\n background: ${theme.colors.white};\n z-index: 1;\n overflow: hidden;\n`;\n\nexport const EmptyPropertyTitleGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n`;\n\nexport const PropertyTitleGridItemContent = styled(StickyGridItem)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 16px 16px 16px 8px;\n width: 100%;\n gap: 8px;\n overflow: hidden;\n`;\n\nexport const PropertyTitle = styled.div`\n font-size: 14px;\n font-weight: ${theme.fontWeight.bold};\n color: ${theme.colors.black65};\n line-height: 16.8px;\n letter-spacing: -0.28px;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 12px;\n line-height: 14px;\n }\n`;\n\nexport const PropertyIcon = styled.div`\n width: 30px;\n height: 30px;\n color: ${theme.colors.shark};\n`;\n\nexport const SelectFromAboveIconCopyContainer = styled.div<{\n $isStuck: boolean;\n}>`\n display: flex;\n flex-direction: column;\n align-items: center;\n opacity: 1;\n\n ${({ $isStuck }) =>\n $isStuck &&\n css`\n opacity: 0;\n `}\n`;\n\nexport const ProductImage = styled.img`\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n -webkit-user-drag: none;\n`;\n\nexport const ProductImageWrap = styled.div<{ height: number }>`\n height: ${({ height }) => `${height}px`};\n display: flex;\n`;\n\nexport const PropertyTooltip = styled.div`\n height: 20px;\n`;\n\nexport const PropertyTooltipContent = styled.div`\n color: #fafafa;\n font-size: 12px;\n\n a {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const TooltipIcon = styled(StyleableSvgImage)`\n color: ${theme.colors.primaryBlue};\n`;\n\nexport const ButtonWrap = styled.div`\n padding: 16px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nconst buttonStyles = css`\n padding: 10px 15px;\n line-height: 20px;\n font-weight: ${theme.fontWeight.bold};\n margin: auto;\n :focus,\n :hover {\n text-decoration: none;\n }\n\n > * {\n position: static;\n }\n`;\n\nexport const Button = styled(ButtonBase)`\n ${buttonStyles};\n`;\n\n// TODO: remove if not used anywhere else in store.core\nexport const ComingSoon = styled(ButtonBase)`\n ${buttonStyles};\n\n cursor: default;\n color: #445178;\n\n :focus,\n :hover {\n color: #445178;\n }\n`;\n\nexport const NotesWrap = styled.div`\n padding: 16px 10px 10px;\n text-wrap: pretty;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const Note = styled.div`\n font-size: 10px;\n line-height: ${17 / 10};\n color: ${theme.colors.black45};\n text-align: center;\n`;\n\nexport const FootnotesWrap = styled.div`\n padding: 0 0 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const Footnote = styled.div`\n font-size: 10px;\n line-height: ${17 / 10};\n color: ${theme.colors.black45};\n text-align: center;\n`;\n\nexport const KitIncluded = styled.div`\n font-size: 14px;\n font-weight: 400;\n letter-spacing: -0.28px;\n line-height: 16.8px;\n color: ${theme.colors.black65};\n`;\n\nexport const TooltipStyles = createGlobalStyle<{ maxWidth?: number }>`\n .${TOOLTIP_CLASS_NAME} {\n box-shadow: 0 8px 24px 0 #00000014;\n max-width: ${({ maxWidth }) => maxWidth ?? 200}px;\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n padding: 8px 16px;\n margin-top: -1.5px;\n\n &::before {\n box-shadow: 0 8px 24px 0 #00000014;\n }\n }\n`;\n"],"names":["MOBILE_BREAKPOINT","TOOLTIP_CLASS_NAME","PRODUCT_HEADER_TOOLTIP_CLASSNAME","PlaceholderGridItem","styled","StickyGridItem","theme","colors","white","CenterPlaceholderGridItem","HEADER_GRID_ITEM_Y_PADDING","HEADER_GRID_ITEM_GAP_DESKTOP","HEADER_GRID_ITEM_GAP_MOBILE","ProductHeaderTooltipStyles","div","ProductHeaderTooltipLink","a","primaryBlue","HeaderGridItem","BREAKPOINTS","MOBILE_AND_DOWN","EmptyHeaderGridItem","EmptyHeaderEmptyProductDescription","$headerItemsAreSticking","css","HeaderGridItemContainer","RemoveProductButton","button","$isSmallScreen","ProductMeta","productTitleStyles","ProductTitle","black","ProductTitleLink","ButtonBase","ProductDescription","black65","$maxWidth","$direction","SelectFromAboveIsStuckContainer","$isStuck","SelectFromAboveIsStuck","ProductNote","black45","font","size10","Badge","BadgeBase","BadgeWrapper","PropertyTitleGridItem","athensGreyDark","EmptyPropertyTitleGridItem","PropertyTitleGridItemContent","PropertyTitle","fontWeight","bold","PropertyIcon","shark","SelectFromAboveIconCopyContainer","ProductImage","img","ProductImageWrap","height","PropertyTooltip","PropertyTooltipContent","TooltipIcon","StyleableSvgImage","ButtonWrap","buttonStyles","Button","ComingSoon","NotesWrap","Note","FootnotesWrap","Footnote","KitIncluded","TooltipStyles","createGlobalStyle","maxWidth"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUO,MAAMA,iBAAoB,GAAA,GAAA;AAE1B,MAAMC,kBAAqB,GAAA,uBAAA;AAC3B,MAAMC,gCACX,GAAA,sCAAA;AAEW,MAAAC,mBAAA,GAAsBC,2BAAOC,6BAAc,CAAA;AAAA,gBACxCC,KAAA,CAAAA,KAAA,CAAMC,OAAOC,KAAK;AAAA;AAAA,CAAA;AAIrB,MAAAC,yBAAA,GAA4BL,eAAAA,CAAAA,SA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x"],"sourcesContent":["import styled, { createGlobalStyle, css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../constants/layout\";\nimport { theme } from \"../../../constants/theme\";\nimport type { LanguageDirectionType } from \"../../../contexts/MenuContext/utils\";\nimport { Badge as BadgeBase } from \"../../Badge\";\nimport { Button as ButtonBase } from \"../../Button\";\nimport { StyleableSvgImage } from \"../../StyleableSvgImage\";\nimport { StickyGridItem } from \"./CompareTableMarkup/components/StickyGrid\";\n\nexport const MOBILE_BREAKPOINT = 650;\n\nexport const TOOLTIP_CLASS_NAME = `model-compare-tooltip`;\nexport const PRODUCT_HEADER_TOOLTIP_CLASSNAME =\n \"model-compare-product-header-tooltip\";\n\nexport const PlaceholderGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n z-index: 3;\n`;\n\nexport const CenterPlaceholderGridItem = styled(StickyGridItem)``;\n\nexport const HEADER_GRID_ITEM_Y_PADDING = 16;\n\nexport const HEADER_GRID_ITEM_GAP_DESKTOP = 24;\nexport const HEADER_GRID_ITEM_GAP_MOBILE = 12;\n\nexport const ProductHeaderTooltipStyles = styled.div`\n position: relative;\n .${PRODUCT_HEADER_TOOLTIP_CLASSNAME} {\n box-shadow: 0 8px 24px 0 #00000014;\n width: 175px;\n font-size: 12px;\n line-height: 16px;\n font-weight: 700;\n padding: 10px 20px;\n margin-top: -1.5px;\n background: white;\n\n &::before {\n box-shadow: 0 8px 24px 0 #00000014;\n background: white;\n }\n }\n`;\n\n// This expands the hoverable area of the tooltip so users can move their mouse casually to the tooltip\nexport const ProductHeaderTooltipHoverArea = styled.div<{\n $width: number | undefined;\n $tooltipIsPositionedTop: boolean;\n}>`\n position: absolute;\n ${({ $tooltipIsPositionedTop }) =>\n $tooltipIsPositionedTop\n ? css`\n bottom: 0;\n `\n : css`\n top: 0;\n `}\n bottom: 0;\n right: 50%;\n transform: translateX(50%);\n width: ${({ $width }) => $width ?? 175}px;\n height: 35px;\n`;\n\nexport const ProductHeaderTooltipLink = styled.a`\n color: ${theme.colors.primaryBlue};\n\n &:hover {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const HeaderGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n text-align: center;\n padding: ${HEADER_GRID_ITEM_Y_PADDING}px 0;\n gap: ${HEADER_GRID_ITEM_GAP_DESKTOP}px;\n position: relative;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n gap: ${HEADER_GRID_ITEM_GAP_MOBILE}px;\n /* Need this padding-top so sticky offset looks good on mobile */\n padding: 25px 0 0;\n }\n`;\n\nexport const EmptyHeaderGridItem = styled(HeaderGridItem)`\n align-items: center;\n justify-content: center;\n`;\n\nexport const EmptyHeaderEmptyProductDescription = styled.div<{\n $headerItemsAreSticking: boolean;\n}>`\n width: 100%;\n height: 100%;\n\n ${({ $headerItemsAreSticking }) =>\n $headerItemsAreSticking &&\n css`\n display: none;\n `}\n`;\n\nexport const HeaderGridItemContainer = styled.div<{ $isStuck: boolean }>`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n`;\n\nexport const RemoveProductButton = styled.button<{ $isSmallScreen: boolean }>`\n position: absolute;\n top: 25px;\n right: 25px;\n background: transparent;\n border: none;\n padding: 5px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 30px;\n color: #c2c6cb;\n\n ${({ $isSmallScreen }) =>\n $isSmallScreen &&\n css`\n top: 0;\n right: 4%;\n `}\n`;\n\nexport const ProductMeta = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n width: 100%;\n padding: 0 10px;\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n &::before {\n display: none;\n }\n &::after {\n display: none;\n }\n }\n`;\n\nconst productTitleStyles = css`\n font-size: 16px;\n font-weight: 700;\n line-height: normal;\n letter-spacing: -0.32px;\n`;\n\nexport const ProductTitle = styled.div`\n ${productTitleStyles}\n\n color: ${theme.colors.black};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 14px;\n }\n`;\n\nexport const ProductTitleLink = styled(ButtonBase)`\n ${productTitleStyles}\n color: ${theme.colors.primaryBlue};\n\n :focus,\n :hover {\n text-decoration: none;\n }\n\n :focus {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const ProductDescription = styled.div<{\n $maxWidth?: number;\n $direction: LanguageDirectionType;\n}>`\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n margin-top: 6px;\n letter-spacing: -0.24px;\n color: ${theme.colors.black65};\n max-width: ${({ $maxWidth }) => ($maxWidth ? `${$maxWidth}px` : \"auto\")};\n direction: ${({ $direction }) => $direction && `${$direction}`};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n margin: 4px auto 12px;\n font-size: 12px;\n }\n`;\n\nexport const SelectFromAboveIsStuckContainer = styled.div<{\n $isStuck: boolean;\n}>`\n display: none;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n align-items: center;\n\n ${({ $isStuck }) =>\n $isStuck &&\n css`\n display: flex;\n `}\n`;\n\nexport const SelectFromAboveIsStuck = styled(ProductDescription)`\n margin: 0;\n`;\n\nexport const ProductNote = styled.div`\n color: ${theme.colors.black45};\n font-size: ${theme.font.size10};\n line-height: 16.8px;\n margin-top: 6px;\n text-align: center;\n`;\n\nexport const Badge = styled(BadgeBase)`\n margin: 10px 0 20px;\n`;\n\nexport const BadgeWrapper = styled.div`\n margin-top: auto;\n display: flex;\n gap: 10px;\n`;\n\nexport const PropertyTitleGridItem = styled(StickyGridItem)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n border-bottom: 1px solid ${theme.colors.athensGreyDark};\n background: ${theme.colors.white};\n z-index: 1;\n overflow: hidden;\n`;\n\nexport const EmptyPropertyTitleGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n`;\n\nexport const PropertyTitleGridItemContent = styled(StickyGridItem)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 16px 16px 16px 8px;\n width: 100%;\n gap: 8px;\n overflow: hidden;\n`;\n\nexport const PropertyTitle = styled.div`\n font-size: 14px;\n font-weight: ${theme.fontWeight.bold};\n color: ${theme.colors.black65};\n line-height: 16.8px;\n letter-spacing: -0.28px;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 12px;\n line-height: 14px;\n }\n`;\n\nexport const PropertyIcon = styled.div`\n width: 30px;\n height: 30px;\n color: ${theme.colors.shark};\n`;\n\nexport const SelectFromAboveIconCopyContainer = styled.div<{\n $isStuck: boolean;\n}>`\n display: flex;\n flex-direction: column;\n align-items: center;\n opacity: 1;\n\n ${({ $isStuck }) =>\n $isStuck &&\n css`\n opacity: 0;\n `}\n`;\n\nexport const ProductImage = styled.img`\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n -webkit-user-drag: none;\n`;\n\nexport const ProductImageWrap = styled.div<{ height: number }>`\n height: ${({ height }) => `${height}px`};\n display: flex;\n`;\n\nexport const PropertyTooltip = styled.div`\n height: 20px;\n`;\n\nexport const PropertyTooltipContent = styled.div`\n color: #fafafa;\n font-size: 12px;\n\n a {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const TooltipIcon = styled(StyleableSvgImage)`\n color: ${theme.colors.primaryBlue};\n`;\n\nexport const ButtonWrap = styled.div`\n padding: 16px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nconst buttonStyles = css`\n padding: 10px 15px;\n line-height: 20px;\n font-weight: ${theme.fontWeight.bold};\n margin: auto;\n :focus,\n :hover {\n text-decoration: none;\n }\n\n > * {\n position: static;\n }\n`;\n\nexport const Button = styled(ButtonBase)<{ $removePointerEvents: boolean }>`\n ${buttonStyles};\n\n ${({ $removePointerEvents }) =>\n $removePointerEvents &&\n css`\n pointer-events: none;\n `}\n`;\n\n// TODO: remove if not used anywhere else in store.core\nexport const ComingSoon = styled(ButtonBase)`\n ${buttonStyles};\n\n cursor: default;\n color: #445178;\n\n :focus,\n :hover {\n color: #445178;\n }\n`;\n\nexport const NotesWrap = styled.div`\n padding: 16px 10px 10px;\n text-wrap: pretty;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const Note = styled.div`\n font-size: 10px;\n line-height: ${17 / 10};\n color: ${theme.colors.black45};\n text-align: center;\n`;\n\nexport const FootnotesWrap = styled.div`\n padding: 0 0 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const Footnote = styled.div`\n font-size: 10px;\n line-height: ${17 / 10};\n color: ${theme.colors.black45};\n text-align: center;\n`;\n\nexport const KitIncluded = styled.div`\n font-size: 14px;\n font-weight: 400;\n letter-spacing: -0.28px;\n line-height: 16.8px;\n color: ${theme.colors.black65};\n`;\n\nexport const TooltipStyles = createGlobalStyle<{ maxWidth?: number }>`\n .${TOOLTIP_CLASS_NAME} {\n box-shadow: 0 8px 24px 0 #00000014;\n max-width: ${({ maxWidth }) => maxWidth ?? 200}px;\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n padding: 8px 16px;\n margin-top: -1.5px;\n\n &::before {\n box-shadow: 0 8px 24px 0 #00000014;\n }\n }\n`;\n"],"names":["MOBILE_BREAKPOINT","TOOLTIP_CLASS_NAME","PRODUCT_HEADER_TOOLTIP_CLASSNAME","PlaceholderGridItem","styled","StickyGridItem","theme","colors","white","CenterPlaceholderGridItem","HEADER_GRID_ITEM_Y_PADDING","HEADER_GRID_ITEM_GAP_DESKTOP","HEADER_GRID_ITEM_GAP_MOBILE","ProductHeaderTooltipStyles","div","ProductHeaderTooltipHoverArea","$tooltipIsPositionedTop","css","$width","ProductHeaderTooltipLink","a","primaryBlue","HeaderGridItem","BREAKPOINTS","MOBILE_AND_DOWN","EmptyHeaderGridItem","EmptyHeaderEmptyProductDescription","$headerItemsAreSticking","HeaderGridItemContainer","RemoveProductButton","button","$isSmallScreen","ProductMeta","productTitleStyles","ProductTitle","black","ProductTitleLink","ButtonBase","ProductDescription","black65","$maxWidth","$direction","SelectFromAboveIsStuckContainer","$isStuck","SelectFromAboveIsStuck","ProductNote","black45","font","size10","Badge","BadgeBase","BadgeWrapper","PropertyTitleGridItem","athensGreyDark","EmptyPropertyTitleGridItem","PropertyTitleGridItemContent","PropertyTitle","fontWeight","bold","PropertyIcon","shark","SelectFromAboveIconCopyContainer","ProductImage","img","ProductImageWrap","height","PropertyTooltip","PropertyTooltipContent","TooltipIcon","StyleableSvgImage","ButtonWrap","buttonStyles","Button","$removePointerEvents","ComingSoon","NotesWrap","Note","FootnotesWrap","Footnote","KitIncluded","TooltipStyles","createGlobalStyle","maxWidth"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUO,MAAMA,iBAAoB,GAAA,GAAA;AAE1B,MAAMC,kBAAqB,GAAA,uBAAA;AAC3B,MAAMC,gCACX,GAAA,sCAAA;AAEW,MAAAC,mBAAA,GAAsBC,2BAAOC,6BAAc,CAAA;AAAA,gBACxCC,KAAA,CAAAA,KAAA,CAAMC,OAAOC,KAAK;AAAA;AAAA,CAAA;AAIrB,MAAAC,yBAAA,GAA4BL,eAAAA,CAAAA,SAAAA,EAAOC,cAAAA,CAAAA,cAAc,CAAA,EAAA;AAEvD,MAAMK,0BAA6B,GAAA,EAAA;AAEnC,MAAMC,4BAA+B,GAAA,EAAA;AACrC,MAAMC,2BAA8B,GAAA,EAAA;AAEpC,MAAMC,6BAA6BT,eAAO,CAAA,SAAA,CAAA,CAAAU,GAAA;AAAA;AAAA,KAE5CZ,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAkB9B,MAAMa,gCAAgCX,eAAO,CAAA,SAAA,CAAA,CAAAU,GAAA;AAAA;AAAA,IAKhD,CAAC;EAAEE;CAAwB,KAC3BA,uBACI,GAAAC,MAAA,CAAAA,GAAA;AAAA;AAAA,SAGA,GAAAA,MAAA,CAAAA,GAAA;AAAA;AAAA,SAEC;AAAA;AAAA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24
24
|
const ProductHeaderTooltipStyles = styled.div`
|
|
25
|
+
position: relative;
|
|
25
26
|
.${PRODUCT_HEADER_TOOLTIP_CLASSNAME} {
|
|
26
27
|
box-shadow: 0 8px 24px 0 #00000014;
|
|
27
28
|
width: 175px;
|
|
@@ -38,8 +39,29 @@ const ProductHeaderTooltipStyles = styled.div`
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
`;
|
|
42
|
+
const ProductHeaderTooltipHoverArea = styled.div`
|
|
43
|
+
position: absolute;
|
|
44
|
+
${({
|
|
45
|
+
$tooltipIsPositionedTop
|
|
46
|
+
}) => $tooltipIsPositionedTop ? css`
|
|
47
|
+
bottom: 0;
|
|
48
|
+
` : css`
|
|
49
|
+
top: 0;
|
|
50
|
+
`}
|
|
51
|
+
bottom: 0;
|
|
52
|
+
right: 50%;
|
|
53
|
+
transform: translateX(50%);
|
|
54
|
+
width: ${({
|
|
55
|
+
$width
|
|
56
|
+
}) => $width ?? 175}px;
|
|
57
|
+
height: 35px;
|
|
58
|
+
`;
|
|
41
59
|
const ProductHeaderTooltipLink = styled.a`
|
|
42
60
|
color: ${theme.colors.primaryBlue};
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
color: ${theme.colors.primaryBlue};
|
|
64
|
+
}
|
|
43
65
|
`;
|
|
44
66
|
const HeaderGridItem = styled(StickyGridItem)`
|
|
45
67
|
background: ${theme.colors.white};
|
|
@@ -293,6 +315,12 @@ const buttonStyles = css`
|
|
|
293
315
|
`;
|
|
294
316
|
const Button = styled(Button$1)`
|
|
295
317
|
${buttonStyles};
|
|
318
|
+
|
|
319
|
+
${({
|
|
320
|
+
$removePointerEvents
|
|
321
|
+
}) => $removePointerEvents && css`
|
|
322
|
+
pointer-events: none;
|
|
323
|
+
`}
|
|
296
324
|
`;
|
|
297
325
|
const ComingSoon = styled(Button$1)`
|
|
298
326
|
${buttonStyles};
|
|
@@ -354,5 +382,5 @@ const TooltipStyles = createGlobalStyle`
|
|
|
354
382
|
}
|
|
355
383
|
}
|
|
356
384
|
`;
|
|
357
|
-
export { Badge, BadgeWrapper, Button, ButtonWrap, CenterPlaceholderGridItem, ComingSoon, EmptyHeaderEmptyProductDescription, EmptyHeaderGridItem, EmptyPropertyTitleGridItem, Footnote, FootnotesWrap, HEADER_GRID_ITEM_GAP_DESKTOP, HEADER_GRID_ITEM_GAP_MOBILE, HEADER_GRID_ITEM_Y_PADDING, HeaderGridItem, HeaderGridItemContainer, KitIncluded, MOBILE_BREAKPOINT, Note, NotesWrap, PRODUCT_HEADER_TOOLTIP_CLASSNAME, PlaceholderGridItem, ProductDescription, ProductHeaderTooltipLink, ProductHeaderTooltipStyles, ProductImage, ProductImageWrap, ProductMeta, ProductNote, ProductTitle, ProductTitleLink, PropertyIcon, PropertyTitle, PropertyTitleGridItem, PropertyTitleGridItemContent, PropertyTooltip, PropertyTooltipContent, RemoveProductButton, SelectFromAboveIconCopyContainer, SelectFromAboveIsStuck, SelectFromAboveIsStuckContainer, TOOLTIP_CLASS_NAME, TooltipIcon, TooltipStyles };
|
|
385
|
+
export { Badge, BadgeWrapper, Button, ButtonWrap, CenterPlaceholderGridItem, ComingSoon, EmptyHeaderEmptyProductDescription, EmptyHeaderGridItem, EmptyPropertyTitleGridItem, Footnote, FootnotesWrap, HEADER_GRID_ITEM_GAP_DESKTOP, HEADER_GRID_ITEM_GAP_MOBILE, HEADER_GRID_ITEM_Y_PADDING, HeaderGridItem, HeaderGridItemContainer, KitIncluded, MOBILE_BREAKPOINT, Note, NotesWrap, PRODUCT_HEADER_TOOLTIP_CLASSNAME, PlaceholderGridItem, ProductDescription, ProductHeaderTooltipHoverArea, ProductHeaderTooltipLink, ProductHeaderTooltipStyles, ProductImage, ProductImageWrap, ProductMeta, ProductNote, ProductTitle, ProductTitleLink, PropertyIcon, PropertyTitle, PropertyTitleGridItem, PropertyTitleGridItemContent, PropertyTooltip, PropertyTooltipContent, RemoveProductButton, SelectFromAboveIconCopyContainer, SelectFromAboveIsStuck, SelectFromAboveIsStuckContainer, TOOLTIP_CLASS_NAME, TooltipIcon, TooltipStyles };
|
|
358
386
|
//# sourceMappingURL=CompareTable.styles.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompareTable.styles.mjs","sources":["../../../../src/components/ModelCompareV4/CompareTable/CompareTable.styles.tsx"],"sourcesContent":["import styled, { createGlobalStyle, css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../constants/layout\";\nimport { theme } from \"../../../constants/theme\";\nimport type { LanguageDirectionType } from \"../../../contexts/MenuContext/utils\";\nimport { Badge as BadgeBase } from \"../../Badge\";\nimport { Button as ButtonBase } from \"../../Button\";\nimport { StyleableSvgImage } from \"../../StyleableSvgImage\";\nimport { StickyGridItem } from \"./CompareTableMarkup/components/StickyGrid\";\n\nexport const MOBILE_BREAKPOINT = 650;\n\nexport const TOOLTIP_CLASS_NAME = `model-compare-tooltip`;\nexport const PRODUCT_HEADER_TOOLTIP_CLASSNAME =\n \"model-compare-product-header-tooltip\";\n\nexport const PlaceholderGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n z-index: 3;\n`;\n\nexport const CenterPlaceholderGridItem = styled(StickyGridItem)``;\n\nexport const HEADER_GRID_ITEM_Y_PADDING = 16;\n\nexport const HEADER_GRID_ITEM_GAP_DESKTOP = 24;\nexport const HEADER_GRID_ITEM_GAP_MOBILE = 12;\n\nexport const ProductHeaderTooltipStyles = styled.div`\n .${PRODUCT_HEADER_TOOLTIP_CLASSNAME} {\n box-shadow: 0 8px 24px 0 #00000014;\n width: 175px;\n font-size: 12px;\n line-height: 16px;\n font-weight: 700;\n padding: 10px 20px;\n margin-top: -1.5px;\n background: white;\n\n &::before {\n box-shadow: 0 8px 24px 0 #00000014;\n background: white;\n }\n }\n`;\nexport const ProductHeaderTooltipLink = styled.a`\n color: ${theme.colors.primaryBlue};\n`;\n\nexport const HeaderGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n text-align: center;\n padding: ${HEADER_GRID_ITEM_Y_PADDING}px 0;\n gap: ${HEADER_GRID_ITEM_GAP_DESKTOP}px;\n position: relative;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n gap: ${HEADER_GRID_ITEM_GAP_MOBILE}px;\n /* Need this padding-top so sticky offset looks good on mobile */\n padding: 25px 0 0;\n }\n`;\n\nexport const EmptyHeaderGridItem = styled(HeaderGridItem)`\n align-items: center;\n justify-content: center;\n`;\n\nexport const EmptyHeaderEmptyProductDescription = styled.div<{\n $headerItemsAreSticking: boolean;\n}>`\n width: 100%;\n height: 100%;\n\n ${({ $headerItemsAreSticking }) =>\n $headerItemsAreSticking &&\n css`\n display: none;\n `}\n`;\n\nexport const HeaderGridItemContainer = styled.div<{ $isStuck: boolean }>`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n`;\n\nexport const RemoveProductButton = styled.button<{ $isSmallScreen: boolean }>`\n position: absolute;\n top: 25px;\n right: 25px;\n background: transparent;\n border: none;\n padding: 5px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 30px;\n color: #c2c6cb;\n\n ${({ $isSmallScreen }) =>\n $isSmallScreen &&\n css`\n top: 0;\n right: 4%;\n `}\n`;\n\nexport const ProductMeta = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n width: 100%;\n padding: 0 10px;\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n &::before {\n display: none;\n }\n &::after {\n display: none;\n }\n }\n`;\n\nconst productTitleStyles = css`\n font-size: 16px;\n font-weight: 700;\n line-height: normal;\n letter-spacing: -0.32px;\n`;\n\nexport const ProductTitle = styled.div`\n ${productTitleStyles}\n\n color: ${theme.colors.black};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 14px;\n }\n`;\n\nexport const ProductTitleLink = styled(ButtonBase)`\n ${productTitleStyles}\n color: ${theme.colors.primaryBlue};\n\n :focus,\n :hover {\n text-decoration: none;\n }\n\n :focus {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const ProductDescription = styled.div<{\n $maxWidth?: number;\n $direction: LanguageDirectionType;\n}>`\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n margin-top: 6px;\n letter-spacing: -0.24px;\n color: ${theme.colors.black65};\n max-width: ${({ $maxWidth }) => ($maxWidth ? `${$maxWidth}px` : \"auto\")};\n direction: ${({ $direction }) => $direction && `${$direction}`};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n margin: 4px auto 12px;\n font-size: 12px;\n }\n`;\n\nexport const SelectFromAboveIsStuckContainer = styled.div<{\n $isStuck: boolean;\n}>`\n display: none;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n align-items: center;\n\n ${({ $isStuck }) =>\n $isStuck &&\n css`\n display: flex;\n `}\n`;\n\nexport const SelectFromAboveIsStuck = styled(ProductDescription)`\n margin: 0;\n`;\n\nexport const ProductNote = styled.div`\n color: ${theme.colors.black45};\n font-size: ${theme.font.size10};\n line-height: 16.8px;\n margin-top: 6px;\n text-align: center;\n`;\n\nexport const Badge = styled(BadgeBase)`\n margin: 10px 0 20px;\n`;\n\nexport const BadgeWrapper = styled.div`\n margin-top: auto;\n display: flex;\n gap: 10px;\n`;\n\nexport const PropertyTitleGridItem = styled(StickyGridItem)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n border-bottom: 1px solid ${theme.colors.athensGreyDark};\n background: ${theme.colors.white};\n z-index: 1;\n overflow: hidden;\n`;\n\nexport const EmptyPropertyTitleGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n`;\n\nexport const PropertyTitleGridItemContent = styled(StickyGridItem)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 16px 16px 16px 8px;\n width: 100%;\n gap: 8px;\n overflow: hidden;\n`;\n\nexport const PropertyTitle = styled.div`\n font-size: 14px;\n font-weight: ${theme.fontWeight.bold};\n color: ${theme.colors.black65};\n line-height: 16.8px;\n letter-spacing: -0.28px;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 12px;\n line-height: 14px;\n }\n`;\n\nexport const PropertyIcon = styled.div`\n width: 30px;\n height: 30px;\n color: ${theme.colors.shark};\n`;\n\nexport const SelectFromAboveIconCopyContainer = styled.div<{\n $isStuck: boolean;\n}>`\n display: flex;\n flex-direction: column;\n align-items: center;\n opacity: 1;\n\n ${({ $isStuck }) =>\n $isStuck &&\n css`\n opacity: 0;\n `}\n`;\n\nexport const ProductImage = styled.img`\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n -webkit-user-drag: none;\n`;\n\nexport const ProductImageWrap = styled.div<{ height: number }>`\n height: ${({ height }) => `${height}px`};\n display: flex;\n`;\n\nexport const PropertyTooltip = styled.div`\n height: 20px;\n`;\n\nexport const PropertyTooltipContent = styled.div`\n color: #fafafa;\n font-size: 12px;\n\n a {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const TooltipIcon = styled(StyleableSvgImage)`\n color: ${theme.colors.primaryBlue};\n`;\n\nexport const ButtonWrap = styled.div`\n padding: 16px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nconst buttonStyles = css`\n padding: 10px 15px;\n line-height: 20px;\n font-weight: ${theme.fontWeight.bold};\n margin: auto;\n :focus,\n :hover {\n text-decoration: none;\n }\n\n > * {\n position: static;\n }\n`;\n\nexport const Button = styled(ButtonBase)`\n ${buttonStyles};\n`;\n\n// TODO: remove if not used anywhere else in store.core\nexport const ComingSoon = styled(ButtonBase)`\n ${buttonStyles};\n\n cursor: default;\n color: #445178;\n\n :focus,\n :hover {\n color: #445178;\n }\n`;\n\nexport const NotesWrap = styled.div`\n padding: 16px 10px 10px;\n text-wrap: pretty;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const Note = styled.div`\n font-size: 10px;\n line-height: ${17 / 10};\n color: ${theme.colors.black45};\n text-align: center;\n`;\n\nexport const FootnotesWrap = styled.div`\n padding: 0 0 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const Footnote = styled.div`\n font-size: 10px;\n line-height: ${17 / 10};\n color: ${theme.colors.black45};\n text-align: center;\n`;\n\nexport const KitIncluded = styled.div`\n font-size: 14px;\n font-weight: 400;\n letter-spacing: -0.28px;\n line-height: 16.8px;\n color: ${theme.colors.black65};\n`;\n\nexport const TooltipStyles = createGlobalStyle<{ maxWidth?: number }>`\n .${TOOLTIP_CLASS_NAME} {\n box-shadow: 0 8px 24px 0 #00000014;\n max-width: ${({ maxWidth }) => maxWidth ?? 200}px;\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n padding: 8px 16px;\n margin-top: -1.5px;\n\n &::before {\n box-shadow: 0 8px 24px 0 #00000014;\n }\n }\n`;\n"],"names":["MOBILE_BREAKPOINT","TOOLTIP_CLASS_NAME","PRODUCT_HEADER_TOOLTIP_CLASSNAME","PlaceholderGridItem","styled","StickyGridItem","theme","colors","white","CenterPlaceholderGridItem","HEADER_GRID_ITEM_Y_PADDING","HEADER_GRID_ITEM_GAP_DESKTOP","HEADER_GRID_ITEM_GAP_MOBILE","ProductHeaderTooltipStyles","div","ProductHeaderTooltipLink","a","primaryBlue","HeaderGridItem","BREAKPOINTS","MOBILE_AND_DOWN","EmptyHeaderGridItem","EmptyHeaderEmptyProductDescription","$headerItemsAreSticking","css","HeaderGridItemContainer","RemoveProductButton","button","$isSmallScreen","ProductMeta","productTitleStyles","ProductTitle","black","ProductTitleLink","ButtonBase","ProductDescription","black65","$maxWidth","$direction","SelectFromAboveIsStuckContainer","$isStuck","SelectFromAboveIsStuck","ProductNote","black45","font","size10","Badge","BadgeBase","BadgeWrapper","PropertyTitleGridItem","athensGreyDark","EmptyPropertyTitleGridItem","PropertyTitleGridItemContent","PropertyTitle","fontWeight","bold","PropertyIcon","shark","SelectFromAboveIconCopyContainer","ProductImage","img","ProductImageWrap","height","PropertyTooltip","PropertyTooltipContent","TooltipIcon","StyleableSvgImage","ButtonWrap","buttonStyles","Button","ComingSoon","NotesWrap","Note","FootnotesWrap","Footnote","KitIncluded","TooltipStyles","createGlobalStyle","maxWidth"],"mappings":";;;;;;;;;;;;AAUO,MAAMA,iBAAoB,GAAA,GAAA;AAE1B,MAAMC,kBAAqB,GAAA,uBAAA;AAC3B,MAAMC,gCACX,GAAA,sCAAA;AAEW,MAAAC,mBAAA,GAAsBC,OAAOC,cAAc,CAAA;AAAA,gBACxCC,KAAA,CAAMC,OAAOC,KAAK;AAAA;AAAA,CAAA;AAIrB,MAAAC,yBAAA,GAA4BL,OAAOC,cAAc,CAAA,EAAA;AAEvD,MAAMK,0BAA6B,GAAA,EAAA;AAEnC,MAAMC,4BAA+B,GAAA,EAAA;AACrC,MAAMC,2BAA8B,GAAA,EAAA;AAEpC,MAAMC,6BAA6BT,MAAO,CAAAU,GAAA;AAAA,KAC5CZ,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAgB9B,MAAMa,2BAA2BX,MAAO,CAAAY,CAAA;AAAA,WACpCV,KAAA,CAAMC,OAAOU,WAAW;AAAA,CAAA;AAGtB,MAAAC,cAAA,GAAiBd,OAAOC,cAAc,CAAA;AAAA,gBACnCC,KAAA,CAAMC,OAAOC,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAMrBE,0BAA0B;AAAA,SAC9BC,4BAA4B;AAAA;;AAAA,WAG1BQ,YAAYC,eAAe;AAAA,WAC3BR,2BAA2B;AAAA;AAAA;AAAA;AAAA,CAAA;AAMzB,MAAAS,mBAAA,GAAsBjB,OAAOc,cAAc,CAAA;AAAA;AAAA;AAAA,CAAA;AAKjD,MAAMI,qCAAqClB,MAAO,CAAAU,GAAA;AAAA;AAAA;;AAAA,IAMrD,CAAC;EAAES;CAAwB,KAC3BA,uBACA,IAAAC,GAAA;AAAA;AAAA,KAEC;A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KAAK,EAAE;AAAA,WACbR,KAAA,CAAMC,OAAOoC,OAAO;AAAA;AAAA,CAAA;AAIxB,MAAM8B,gBAAgBrE,MAAO,CAAAU,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAO7B,MAAM4D,WAAWtE,MAAO,CAAAU,GAAA;AAAA;AAAA,iBAEd,KAAK,EAAE;AAAA,WACbR,KAAA,CAAMC,OAAOoC,OAAO;AAAA;AAAA,CAAA;AAIxB,MAAMgC,cAAcvE,MAAO,CAAAU,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAKvBR,KAAA,CAAMC,OAAO6B,OAAO;AAAA,CAAA;AAGxB,MAAMwC,aAAgB,GAAAC,iBAAA;AAAA,KACxB5E,kBAAkB;AAAA;AAAA,iBAEN,CAAC;EAAE6E;CAAS,KAAMA,YAAY,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"CompareTable.styles.mjs","sources":["../../../../src/components/ModelCompareV4/CompareTable/CompareTable.styles.tsx"],"sourcesContent":["import styled, { createGlobalStyle, css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../constants/layout\";\nimport { theme } from \"../../../constants/theme\";\nimport type { LanguageDirectionType } from \"../../../contexts/MenuContext/utils\";\nimport { Badge as BadgeBase } from \"../../Badge\";\nimport { Button as ButtonBase } from \"../../Button\";\nimport { StyleableSvgImage } from \"../../StyleableSvgImage\";\nimport { StickyGridItem } from \"./CompareTableMarkup/components/StickyGrid\";\n\nexport const MOBILE_BREAKPOINT = 650;\n\nexport const TOOLTIP_CLASS_NAME = `model-compare-tooltip`;\nexport const PRODUCT_HEADER_TOOLTIP_CLASSNAME =\n \"model-compare-product-header-tooltip\";\n\nexport const PlaceholderGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n z-index: 3;\n`;\n\nexport const CenterPlaceholderGridItem = styled(StickyGridItem)``;\n\nexport const HEADER_GRID_ITEM_Y_PADDING = 16;\n\nexport const HEADER_GRID_ITEM_GAP_DESKTOP = 24;\nexport const HEADER_GRID_ITEM_GAP_MOBILE = 12;\n\nexport const ProductHeaderTooltipStyles = styled.div`\n position: relative;\n .${PRODUCT_HEADER_TOOLTIP_CLASSNAME} {\n box-shadow: 0 8px 24px 0 #00000014;\n width: 175px;\n font-size: 12px;\n line-height: 16px;\n font-weight: 700;\n padding: 10px 20px;\n margin-top: -1.5px;\n background: white;\n\n &::before {\n box-shadow: 0 8px 24px 0 #00000014;\n background: white;\n }\n }\n`;\n\n// This expands the hoverable area of the tooltip so users can move their mouse casually to the tooltip\nexport const ProductHeaderTooltipHoverArea = styled.div<{\n $width: number | undefined;\n $tooltipIsPositionedTop: boolean;\n}>`\n position: absolute;\n ${({ $tooltipIsPositionedTop }) =>\n $tooltipIsPositionedTop\n ? css`\n bottom: 0;\n `\n : css`\n top: 0;\n `}\n bottom: 0;\n right: 50%;\n transform: translateX(50%);\n width: ${({ $width }) => $width ?? 175}px;\n height: 35px;\n`;\n\nexport const ProductHeaderTooltipLink = styled.a`\n color: ${theme.colors.primaryBlue};\n\n &:hover {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const HeaderGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n text-align: center;\n padding: ${HEADER_GRID_ITEM_Y_PADDING}px 0;\n gap: ${HEADER_GRID_ITEM_GAP_DESKTOP}px;\n position: relative;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n gap: ${HEADER_GRID_ITEM_GAP_MOBILE}px;\n /* Need this padding-top so sticky offset looks good on mobile */\n padding: 25px 0 0;\n }\n`;\n\nexport const EmptyHeaderGridItem = styled(HeaderGridItem)`\n align-items: center;\n justify-content: center;\n`;\n\nexport const EmptyHeaderEmptyProductDescription = styled.div<{\n $headerItemsAreSticking: boolean;\n}>`\n width: 100%;\n height: 100%;\n\n ${({ $headerItemsAreSticking }) =>\n $headerItemsAreSticking &&\n css`\n display: none;\n `}\n`;\n\nexport const HeaderGridItemContainer = styled.div<{ $isStuck: boolean }>`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n`;\n\nexport const RemoveProductButton = styled.button<{ $isSmallScreen: boolean }>`\n position: absolute;\n top: 25px;\n right: 25px;\n background: transparent;\n border: none;\n padding: 5px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 30px;\n color: #c2c6cb;\n\n ${({ $isSmallScreen }) =>\n $isSmallScreen &&\n css`\n top: 0;\n right: 4%;\n `}\n`;\n\nexport const ProductMeta = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n width: 100%;\n padding: 0 10px;\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n &::before {\n display: none;\n }\n &::after {\n display: none;\n }\n }\n`;\n\nconst productTitleStyles = css`\n font-size: 16px;\n font-weight: 700;\n line-height: normal;\n letter-spacing: -0.32px;\n`;\n\nexport const ProductTitle = styled.div`\n ${productTitleStyles}\n\n color: ${theme.colors.black};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 14px;\n }\n`;\n\nexport const ProductTitleLink = styled(ButtonBase)`\n ${productTitleStyles}\n color: ${theme.colors.primaryBlue};\n\n :focus,\n :hover {\n text-decoration: none;\n }\n\n :focus {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const ProductDescription = styled.div<{\n $maxWidth?: number;\n $direction: LanguageDirectionType;\n}>`\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n margin-top: 6px;\n letter-spacing: -0.24px;\n color: ${theme.colors.black65};\n max-width: ${({ $maxWidth }) => ($maxWidth ? `${$maxWidth}px` : \"auto\")};\n direction: ${({ $direction }) => $direction && `${$direction}`};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n margin: 4px auto 12px;\n font-size: 12px;\n }\n`;\n\nexport const SelectFromAboveIsStuckContainer = styled.div<{\n $isStuck: boolean;\n}>`\n display: none;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n align-items: center;\n\n ${({ $isStuck }) =>\n $isStuck &&\n css`\n display: flex;\n `}\n`;\n\nexport const SelectFromAboveIsStuck = styled(ProductDescription)`\n margin: 0;\n`;\n\nexport const ProductNote = styled.div`\n color: ${theme.colors.black45};\n font-size: ${theme.font.size10};\n line-height: 16.8px;\n margin-top: 6px;\n text-align: center;\n`;\n\nexport const Badge = styled(BadgeBase)`\n margin: 10px 0 20px;\n`;\n\nexport const BadgeWrapper = styled.div`\n margin-top: auto;\n display: flex;\n gap: 10px;\n`;\n\nexport const PropertyTitleGridItem = styled(StickyGridItem)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n border-bottom: 1px solid ${theme.colors.athensGreyDark};\n background: ${theme.colors.white};\n z-index: 1;\n overflow: hidden;\n`;\n\nexport const EmptyPropertyTitleGridItem = styled(StickyGridItem)`\n background: ${theme.colors.white};\n`;\n\nexport const PropertyTitleGridItemContent = styled(StickyGridItem)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 16px 16px 16px 8px;\n width: 100%;\n gap: 8px;\n overflow: hidden;\n`;\n\nexport const PropertyTitle = styled.div`\n font-size: 14px;\n font-weight: ${theme.fontWeight.bold};\n color: ${theme.colors.black65};\n line-height: 16.8px;\n letter-spacing: -0.28px;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 12px;\n line-height: 14px;\n }\n`;\n\nexport const PropertyIcon = styled.div`\n width: 30px;\n height: 30px;\n color: ${theme.colors.shark};\n`;\n\nexport const SelectFromAboveIconCopyContainer = styled.div<{\n $isStuck: boolean;\n}>`\n display: flex;\n flex-direction: column;\n align-items: center;\n opacity: 1;\n\n ${({ $isStuck }) =>\n $isStuck &&\n css`\n opacity: 0;\n `}\n`;\n\nexport const ProductImage = styled.img`\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n -webkit-user-drag: none;\n`;\n\nexport const ProductImageWrap = styled.div<{ height: number }>`\n height: ${({ height }) => `${height}px`};\n display: flex;\n`;\n\nexport const PropertyTooltip = styled.div`\n height: 20px;\n`;\n\nexport const PropertyTooltipContent = styled.div`\n color: #fafafa;\n font-size: 12px;\n\n a {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const TooltipIcon = styled(StyleableSvgImage)`\n color: ${theme.colors.primaryBlue};\n`;\n\nexport const ButtonWrap = styled.div`\n padding: 16px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nconst buttonStyles = css`\n padding: 10px 15px;\n line-height: 20px;\n font-weight: ${theme.fontWeight.bold};\n margin: auto;\n :focus,\n :hover {\n text-decoration: none;\n }\n\n > * {\n position: static;\n }\n`;\n\nexport const Button = styled(ButtonBase)<{ $removePointerEvents: boolean }>`\n ${buttonStyles};\n\n ${({ $removePointerEvents }) =>\n $removePointerEvents &&\n css`\n pointer-events: none;\n `}\n`;\n\n// TODO: remove if not used anywhere else in store.core\nexport const ComingSoon = styled(ButtonBase)`\n ${buttonStyles};\n\n cursor: default;\n color: #445178;\n\n :focus,\n :hover {\n color: #445178;\n }\n`;\n\nexport const NotesWrap = styled.div`\n padding: 16px 10px 10px;\n text-wrap: pretty;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const Note = styled.div`\n font-size: 10px;\n line-height: ${17 / 10};\n color: ${theme.colors.black45};\n text-align: center;\n`;\n\nexport const FootnotesWrap = styled.div`\n padding: 0 0 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const Footnote = styled.div`\n font-size: 10px;\n line-height: ${17 / 10};\n color: ${theme.colors.black45};\n text-align: center;\n`;\n\nexport const KitIncluded = styled.div`\n font-size: 14px;\n font-weight: 400;\n letter-spacing: -0.28px;\n line-height: 16.8px;\n color: ${theme.colors.black65};\n`;\n\nexport const TooltipStyles = createGlobalStyle<{ maxWidth?: number }>`\n .${TOOLTIP_CLASS_NAME} {\n box-shadow: 0 8px 24px 0 #00000014;\n max-width: ${({ maxWidth }) => maxWidth ?? 200}px;\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n padding: 8px 16px;\n margin-top: -1.5px;\n\n &::before {\n box-shadow: 0 8px 24px 0 #00000014;\n }\n }\n`;\n"],"names":["MOBILE_BREAKPOINT","TOOLTIP_CLASS_NAME","PRODUCT_HEADER_TOOLTIP_CLASSNAME","PlaceholderGridItem","styled","StickyGridItem","theme","colors","white","CenterPlaceholderGridItem","HEADER_GRID_ITEM_Y_PADDING","HEADER_GRID_ITEM_GAP_DESKTOP","HEADER_GRID_ITEM_GAP_MOBILE","ProductHeaderTooltipStyles","div","ProductHeaderTooltipHoverArea","$tooltipIsPositionedTop","css","$width","ProductHeaderTooltipLink","a","primaryBlue","HeaderGridItem","BREAKPOINTS","MOBILE_AND_DOWN","EmptyHeaderGridItem","EmptyHeaderEmptyProductDescription","$headerItemsAreSticking","HeaderGridItemContainer","RemoveProductButton","button","$isSmallScreen","ProductMeta","productTitleStyles","ProductTitle","black","ProductTitleLink","ButtonBase","ProductDescription","black65","$maxWidth","$direction","SelectFromAboveIsStuckContainer","$isStuck","SelectFromAboveIsStuck","ProductNote","black45","font","size10","Badge","BadgeBase","BadgeWrapper","PropertyTitleGridItem","athensGreyDark","EmptyPropertyTitleGridItem","PropertyTitleGridItemContent","PropertyTitle","fontWeight","bold","PropertyIcon","shark","SelectFromAboveIconCopyContainer","ProductImage","img","ProductImageWrap","height","PropertyTooltip","PropertyTooltipContent","TooltipIcon","StyleableSvgImage","ButtonWrap","buttonStyles","Button","$removePointerEvents","ComingSoon","NotesWrap","Note","FootnotesWrap","Footnote","KitIncluded","TooltipStyles","createGlobalStyle","maxWidth"],"mappings":";;;;;;;;;;;;AAUO,MAAMA,iBAAoB,GAAA,GAAA;AAE1B,MAAMC,kBAAqB,GAAA,uBAAA;AAC3B,MAAMC,gCACX,GAAA,sCAAA;AAEW,MAAAC,mBAAA,GAAsBC,OAAOC,cAAc,CAA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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQzB,MAAM8D,OAAOxE,MAAO,CAAAU,GAAA;AAAA;AAAA,iBAEV,KAAK,EAAE;AAAA,WACbR,KAAA,CAAMC,OAAOuC,OAAO;AAAA;AAAA,CAAA;AAIxB,MAAM+B,gBAAgBzE,MAAO,CAAAU,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAO7B,MAAMgE,WAAW1E,MAAO,CAAAU,GAAA;AAAA;AAAA,iBAEd,KAAK,EAAE;AAAA,WACbR,KAAA,CAAMC,OAAOuC,OAAO;AAAA;AAAA,CAAA;AAIxB,MAAMiC,cAAc3E,MAAO,CAAAU,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAKvBR,KAAA,CAAMC,OAAOgC,OAAO;AAAA,CAAA;AAGxB,MAAMyC,aAAgB,GAAAC,iBAAA;AAAA,KACxBhF,kBAAkB;AAAA;AAAA,iBAEN,CAAC;EAAEiF;CAAS,KAAMA,YAAY,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;"}
|
|
@@ -7,6 +7,7 @@ require('../../../../../../constants/modelCompareData/assets/close.svg.js');
|
|
|
7
7
|
var useModelCompareTranslation = require('../../../../../../constants/modelCompareData/translations/useModelCompareTranslation.js');
|
|
8
8
|
var context = require('../../../../../../contexts/MenuContext/context.js');
|
|
9
9
|
var asset = require('../../../../../../utils/asset.js');
|
|
10
|
+
var Header_styles = require('../../../../../Header/Header.styles.js');
|
|
10
11
|
var Reveal = require('../../../../../Reveal/Reveal.js');
|
|
11
12
|
require('../../../../../StyleableSvgImage/index.js');
|
|
12
13
|
var CompareTable_styles = require('../../../CompareTable.styles.js');
|
|
@@ -43,6 +44,10 @@ const ProductHeader = ({
|
|
|
43
44
|
languageDirection,
|
|
44
45
|
storeId
|
|
45
46
|
} = context.useMenu();
|
|
47
|
+
const [productTitleWidth, setProductTitleWidth] = React.useState(void 0);
|
|
48
|
+
const [toolTipIsPositionedTop, setToolTipIsPositionedTop] = React.useState(true);
|
|
49
|
+
const productTitleRef = React.useRef(null);
|
|
50
|
+
const productMetaRef = React.useRef(null);
|
|
46
51
|
const storeHref = React.useMemo(() => getStoreHref.getStoreHref({
|
|
47
52
|
product,
|
|
48
53
|
createSiteUrl,
|
|
@@ -59,6 +64,19 @@ const ProductHeader = ({
|
|
|
59
64
|
setSelectedProducts(updatedProducts);
|
|
60
65
|
}
|
|
61
66
|
}, [product.id, selectedProducts, setExternalState, setSelectedProducts]);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
if (!productTitleRef.current) return;
|
|
69
|
+
setProductTitleWidth(productTitleRef.current.getBoundingClientRect().width);
|
|
70
|
+
}, [productTitleRef]);
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
const scrollHandler = () => {
|
|
73
|
+
if (productMetaRef.current) setToolTipIsPositionedTop(productMetaRef.current.getBoundingClientRect().top > Header_styles.HEADER_HEIGHT);
|
|
74
|
+
};
|
|
75
|
+
document.addEventListener("scroll", scrollHandler);
|
|
76
|
+
return () => {
|
|
77
|
+
document.removeEventListener("scroll", scrollHandler);
|
|
78
|
+
};
|
|
79
|
+
}, []);
|
|
62
80
|
return /* @__PURE__ */jsxRuntime.jsx(Reveal.Reveal, {
|
|
63
81
|
index,
|
|
64
82
|
playAnimation: hasBeenObserved,
|
|
@@ -82,20 +100,27 @@ const ProductHeader = ({
|
|
|
82
100
|
alt: formatMessage(product.title)
|
|
83
101
|
})
|
|
84
102
|
}), /* @__PURE__ */jsxRuntime.jsxs(CompareTable_styles.ProductMeta, {
|
|
103
|
+
ref: productMetaRef,
|
|
85
104
|
children: [linkToStoreTitleClick && storeHref || !linkToStoreTitleClick && techspecsHref ? /* @__PURE__ */jsxRuntime.jsx(CompareTable_styles.ProductHeaderTooltipStyles, {
|
|
86
|
-
children: /* @__PURE__ */jsxRuntime.
|
|
105
|
+
children: /* @__PURE__ */jsxRuntime.jsxs(Tooltip.Tooltip, {
|
|
87
106
|
motif: "light",
|
|
107
|
+
position: toolTipIsPositionedTop ? "top" : "bottom",
|
|
88
108
|
tooltipClassName: CompareTable_styles.PRODUCT_HEADER_TOOLTIP_CLASSNAME,
|
|
89
109
|
isInteractive: true,
|
|
90
110
|
description: /* @__PURE__ */jsxRuntime.jsxs(CompareTable_styles.ProductHeaderTooltipLink, {
|
|
91
111
|
href: productTitleHref,
|
|
112
|
+
target: "__blank",
|
|
92
113
|
children: [formatMessage("modelCompare.reviewIn.tooltip"), " Tech Specs"]
|
|
93
114
|
}),
|
|
94
|
-
children: /* @__PURE__ */jsxRuntime.jsx(CompareTable_styles.
|
|
115
|
+
children: [/* @__PURE__ */jsxRuntime.jsx(CompareTable_styles.ProductHeaderTooltipHoverArea, {
|
|
116
|
+
$width: productTitleWidth,
|
|
117
|
+
$tooltipIsPositionedTop: toolTipIsPositionedTop
|
|
118
|
+
}), /* @__PURE__ */jsxRuntime.jsx(CompareTable_styles.ProductTitleLink, {
|
|
95
119
|
variant: "link",
|
|
96
120
|
anchor: true,
|
|
121
|
+
ref: productTitleRef,
|
|
97
122
|
children: formatMessage(product.title)
|
|
98
|
-
})
|
|
123
|
+
})]
|
|
99
124
|
}, `tooltip-${product.id}`)
|
|
100
125
|
}) : /* @__PURE__ */jsxRuntime.jsx(CompareTable_styles.ProductTitle, {
|
|
101
126
|
children: formatMessage(product.title)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductHeader.js","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.tsx"],"sourcesContent":["import { Tooltip } from \"@ubnt/ui-components/Tooltip\";\nimport { useCallback, useMemo } from \"react\";\n\nimport closeIcon from \"../../../../../../constants/modelCompareData/assets/close.svg\";\nimport { useModelCompareTranslation } from \"../../../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\nimport { useMenu } from \"../../../../../../contexts/MenuContext/context\";\nimport { imageSrc } from \"../../../../../../utils/asset\";\nimport { Reveal } from \"../../../../../Reveal/Reveal\";\nimport { StyleableSvgImage } from \"../../../../../StyleableSvgImage\";\nimport * as S from \"../../../CompareTable.styles\";\nimport { getStoreHref } from \"../../../helpers/getStoreHref\";\nimport { Badges } from \"../Badges/Badges\";\nimport type { ProductHeaderProps } from \"./ProductHeader.types\";\n\nexport const ProductHeader = ({\n product,\n setSelectedProducts,\n index,\n setExternalState,\n selectedProducts,\n linkToStoreTitleClick,\n hasBeenObserved,\n isLessThanOrEqualToFiveProducts,\n hasMultipleProductsSelected,\n isSmallScreen,\n showBadges,\n isStaticProduct,\n}: ProductHeaderProps) => {\n const { formatMessage } = useModelCompareTranslation();\n const { createSiteUrl, languageDirection, storeId } = useMenu();\n\n const storeHref = useMemo(\n () => getStoreHref({ product, createSiteUrl, storeId }),\n [product, createSiteUrl, storeId],\n );\n\n const techspecsHref = useMemo(\n () => product.techspecsPath && createSiteUrl(product.techspecsPath),\n [createSiteUrl, product.techspecsPath],\n );\n\n const productTitleHref = useMemo(\n () => (linkToStoreTitleClick ? storeHref : techspecsHref),\n [linkToStoreTitleClick, storeHref, techspecsHref],\n );\n\n const removeHandler = useCallback(() => {\n const updatedProducts =\n selectedProducts &&\n selectedProducts.filter(\n (selectedProduct) => selectedProduct.productId !== product.id,\n );\n\n if (setExternalState && updatedProducts) {\n setExternalState(updatedProducts);\n }\n\n if (updatedProducts && setSelectedProducts) {\n setSelectedProducts(updatedProducts);\n }\n }, [product.id, selectedProducts, setExternalState, setSelectedProducts]);\n\n return (\n <Reveal index={index} playAnimation={hasBeenObserved}>\n <S.HeaderGridItem>\n {!isLessThanOrEqualToFiveProducts &&\n hasMultipleProductsSelected &&\n !isStaticProduct && (\n <S.RemoveProductButton\n type=\"button\"\n $isSmallScreen={isSmallScreen}\n onClick={removeHandler}\n >\n <StyleableSvgImage src={closeIcon} width={16} height={16} />\n </S.RemoveProductButton>\n )}\n <S.ProductImageWrap height={product.image.height}>\n <S.ProductImage\n loading=\"lazy\"\n decoding=\"async\"\n src={imageSrc(product.image.src)}\n width={product.image.width}\n alt={formatMessage(product.title)}\n />\n </S.ProductImageWrap>\n <S.ProductMeta>\n {(linkToStoreTitleClick && storeHref) ||\n (!linkToStoreTitleClick && techspecsHref) ? (\n <S.ProductHeaderTooltipStyles>\n <Tooltip\n key={`tooltip-${product.id}`}\n motif=\"light\"\n tooltipClassName={S.PRODUCT_HEADER_TOOLTIP_CLASSNAME}\n isInteractive\n description={\n <S.ProductHeaderTooltipLink href={productTitleHref}>\n {formatMessage(\"modelCompare.reviewIn.tooltip\")} Tech Specs\n </S.ProductHeaderTooltipLink>\n }\n >\n <S.ProductTitleLink variant=\"link\" anchor>\n {formatMessage(product.title)}\n </S.ProductTitleLink>\n </Tooltip>\n </S.ProductHeaderTooltipStyles>\n ) : (\n <S.ProductTitle>{formatMessage(product.title)}</S.ProductTitle>\n )}\n {!!product?.productNote && (\n <S.ProductNote>{formatMessage(product.productNote)}</S.ProductNote>\n )}\n {product.description ? (\n <S.ProductDescription\n $maxWidth={product.descriptionMaxWidth}\n $direction={languageDirection}\n >\n {formatMessage(product.description)}\n </S.ProductDescription>\n ) : null}\n {showBadges && (\n <S.BadgeWrapper>{<Badges product={product} />}</S.BadgeWrapper>\n )}\n </S.ProductMeta>\n </S.HeaderGridItem>\n </Reveal>\n );\n};\n"],"names":["ProductHeader","product","setSelectedProducts","index","setExternalState","selectedProducts","linkToStoreTitleClick","hasBeenObserved","isLessThanOrEqualToFiveProducts","hasMultipleProductsSelected","isSmallScreen","showBadges","isStaticProduct","formatMessage","useModelCompareTranslation","createSiteUrl","languageDirection","storeId","useMenu","storeHref","useMemo","getStoreHref","techspecsHref","techspecsPath","productTitleHref","removeHandler","useCallback","updatedProducts","filter","selectedProduct","productId","id","jsx","Reveal","playAnimation","children","jsxs","S.HeaderGridItem","S.RemoveProductButton","RemoveProductButton","type","$isSmallScreen","onClick","StyleableSvgImage","src","closeIcon","width","height","S.ProductImageWrap","ProductImageWrap","image","S.ProductImage","ProductImage","loading","decoding","imageSrc","alt","title","S.ProductMeta","S.ProductHeaderTooltipStyles","Tooltip","motif","tooltipClassName","S.PRODUCT_HEADER_TOOLTIP_CLASSNAME","PRODUCT_HEADER_TOOLTIP_CLASSNAME","isInteractive","description","S.ProductHeaderTooltipLink","ProductHeaderTooltipLink","href","S.ProductTitleLink","variant","anchor","S.ProductTitle","productNote","S.ProductNote","ProductNote","S.ProductDescription","ProductDescription","$maxWidth","descriptionMaxWidth","$direction","S.BadgeWrapper","Badges"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAMA,gBAAgBA,CAAC;EAC5BC,OAAA;EACAC,mBAAA;EACAC,KAAA;EACAC,gBAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC,eAAA;EACAC,+BAAA;EACAC,2BAAA;EACAC,aAAA;EACAC,UAAA;EACAC;AACF,CAA0B,KAAA;EAClB,MAAA;IAAEC;EAAc,CAAA,GAAIC,qDAA2B,CAAA,CAAA;EACrD,MAAM;IAAEC,aAAA;IAAeC,iBAAmB;IAAAC;EAAA,IAAYC,OAAAA,CAAAA,OAAQ,CAAA,CAAA;EAE9D,MAAMC,SAAY,GAAAC,KAAA,CAAAA,OAAA,CAChB,MAAMC,YAAa,CAAAA,YAAA,CAAA;IAAEpB,OAAS;IAAAc,aAAA;IAAeE;GAAS,CAAA,EACtD,CAAChB,OAAS,EAAAc,aAAA,EAAeE,OAAO,CAClC,CAAA;EAEA,MAAMK,aAAgB,GAAAF,KAAA,CAAAA,OAAA,CACpB,MAAMnB,OAAA,CAAQsB,aAAiB,IAAAR,aAAA,CAAcd,QAAQsB,aAAa,CAAA,EAClE,CAACR,aAAe,EAAAd,OAAA,CAAQsB,aAAa,CACvC,CAAA;EAEA,MAAMC,gBAAmB,GAAAJ,KAAA,CAAAA,OAAA,CACvB,MAAOd,wBAAwBa,SAAY,GAAAG,aAAA,EAC3C,CAAChB,qBAAuB,EAAAa,SAAA,EAAWG,aAAa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,eAAAlC,UAAA,CAAAA,GAAA,CAAC6C,mBAAE,CAAAC,kBAAA,EAAF;UACCC,WAAW9E,OAAQ,CAAA+E,mBAAA;UACnBC,UAAY,EAAAjE,iBAAA;UAEXmB,QAAA,EAAAtB,aAAA,CAAcZ,QAAQiE,WAAW;QAAA,CAAA,CAElC,GAAA,IAAA,EACHvD,UAAA,kCACEuE,mBAAAA,CAAAA,YAAE,EAAF;UAAgB/C,QAAC,EAAAH,eAAAA,UAAAA,CAAAA,GAAA,CAAAmD,MAAA,CAAAA,MAAA,EAAA;YAAOlF;WAAkB;QAAG,CAAA,CAAA;MAElD,CAAA,CAAA;IAAA,CACF;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ProductHeader.js","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.tsx"],"sourcesContent":["import { Tooltip } from \"@ubnt/ui-components/Tooltip\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport closeIcon from \"../../../../../../constants/modelCompareData/assets/close.svg\";\nimport { useModelCompareTranslation } from \"../../../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\nimport { useMenu } from \"../../../../../../contexts/MenuContext/context\";\nimport { imageSrc } from \"../../../../../../utils/asset\";\nimport { HEADER_HEIGHT } from \"../../../../../Header/Header.styles\";\nimport { Reveal } from \"../../../../../Reveal/Reveal\";\nimport { StyleableSvgImage } from \"../../../../../StyleableSvgImage\";\nimport * as S from \"../../../CompareTable.styles\";\nimport { getStoreHref } from \"../../../helpers/getStoreHref\";\nimport { Badges } from \"../Badges/Badges\";\nimport type { ProductHeaderProps } from \"./ProductHeader.types\";\n\nexport const ProductHeader = ({\n product,\n setSelectedProducts,\n index,\n setExternalState,\n selectedProducts,\n linkToStoreTitleClick,\n hasBeenObserved,\n isLessThanOrEqualToFiveProducts,\n hasMultipleProductsSelected,\n isSmallScreen,\n showBadges,\n isStaticProduct,\n}: ProductHeaderProps) => {\n const { formatMessage } = useModelCompareTranslation();\n const { createSiteUrl, languageDirection, storeId } = useMenu();\n const [productTitleWidth, setProductTitleWidth] = useState<\n number | undefined\n >(undefined);\n const [toolTipIsPositionedTop, setToolTipIsPositionedTop] = useState(true);\n\n const productTitleRef = useRef<HTMLAnchorElement | HTMLButtonElement | null>(\n null,\n );\n const productMetaRef = useRef<HTMLDivElement | null>(null);\n\n const storeHref = useMemo(\n () => getStoreHref({ product, createSiteUrl, storeId }),\n [product, createSiteUrl, storeId],\n );\n\n const techspecsHref = useMemo(\n () => product.techspecsPath && createSiteUrl(product.techspecsPath),\n [createSiteUrl, product.techspecsPath],\n );\n\n const productTitleHref = useMemo(\n () => (linkToStoreTitleClick ? storeHref : techspecsHref),\n [linkToStoreTitleClick, storeHref, techspecsHref],\n );\n\n const removeHandler = useCallback(() => {\n const updatedProducts =\n selectedProducts &&\n selectedProducts.filter(\n (selectedProduct) => selectedProduct.productId !== product.id,\n );\n\n if (setExternalState && updatedProducts) {\n setExternalState(updatedProducts);\n }\n\n if (updatedProducts && setSelectedProducts) {\n setSelectedProducts(updatedProducts);\n }\n }, [product.id, selectedProducts, setExternalState, setSelectedProducts]);\n\n useEffect(() => {\n if (!productTitleRef.current) return;\n\n setProductTitleWidth(productTitleRef.current.getBoundingClientRect().width);\n }, [productTitleRef]);\n\n useEffect(() => {\n const scrollHandler = () => {\n if (productMetaRef.current)\n setToolTipIsPositionedTop(\n productMetaRef.current.getBoundingClientRect().top > HEADER_HEIGHT,\n );\n };\n\n document.addEventListener(\"scroll\", scrollHandler);\n\n return () => {\n document.removeEventListener(\"scroll\", scrollHandler);\n };\n }, []);\n\n return (\n <Reveal index={index} playAnimation={hasBeenObserved}>\n <S.HeaderGridItem>\n {!isLessThanOrEqualToFiveProducts &&\n hasMultipleProductsSelected &&\n !isStaticProduct && (\n <S.RemoveProductButton\n type=\"button\"\n $isSmallScreen={isSmallScreen}\n onClick={removeHandler}\n >\n <StyleableSvgImage src={closeIcon} width={16} height={16} />\n </S.RemoveProductButton>\n )}\n <S.ProductImageWrap height={product.image.height}>\n <S.ProductImage\n loading=\"lazy\"\n decoding=\"async\"\n src={imageSrc(product.image.src)}\n width={product.image.width}\n alt={formatMessage(product.title)}\n />\n </S.ProductImageWrap>\n <S.ProductMeta ref={productMetaRef}>\n {(linkToStoreTitleClick && storeHref) ||\n (!linkToStoreTitleClick && techspecsHref) ? (\n <S.ProductHeaderTooltipStyles>\n <Tooltip\n key={`tooltip-${product.id}`}\n motif=\"light\"\n position={toolTipIsPositionedTop ? \"top\" : \"bottom\"}\n tooltipClassName={S.PRODUCT_HEADER_TOOLTIP_CLASSNAME}\n isInteractive\n description={\n <S.ProductHeaderTooltipLink\n href={productTitleHref}\n target=\"__blank\"\n >\n {formatMessage(\"modelCompare.reviewIn.tooltip\")} Tech Specs\n </S.ProductHeaderTooltipLink>\n }\n >\n <S.ProductHeaderTooltipHoverArea\n $width={productTitleWidth}\n $tooltipIsPositionedTop={toolTipIsPositionedTop}\n />\n <S.ProductTitleLink variant=\"link\" anchor ref={productTitleRef}>\n {formatMessage(product.title)}\n </S.ProductTitleLink>\n </Tooltip>\n </S.ProductHeaderTooltipStyles>\n ) : (\n <S.ProductTitle>{formatMessage(product.title)}</S.ProductTitle>\n )}\n {!!product?.productNote && (\n <S.ProductNote>{formatMessage(product.productNote)}</S.ProductNote>\n )}\n {product.description ? (\n <S.ProductDescription\n $maxWidth={product.descriptionMaxWidth}\n $direction={languageDirection}\n >\n {formatMessage(product.description)}\n </S.ProductDescription>\n ) : null}\n {showBadges && (\n <S.BadgeWrapper>{<Badges product={product} />}</S.BadgeWrapper>\n )}\n </S.ProductMeta>\n </S.HeaderGridItem>\n </Reveal>\n );\n};\n"],"names":["ProductHeader","product","setSelectedProducts","index","setExternalState","selectedProducts","linkToStoreTitleClick","hasBeenObserved","isLessThanOrEqualToFiveProducts","hasMultipleProductsSelected","isSmallScreen","showBadges","isStaticProduct","formatMessage","useModelCompareTranslation","createSiteUrl","languageDirection","storeId","useMenu","productTitleWidth","setProductTitleWidth","useState","toolTipIsPositionedTop","setToolTipIsPositionedTop","productTitleRef","useRef","productMetaRef","storeHref","useMemo","getStoreHref","techspecsHref","techspecsPath","productTitleHref","removeHandler","useCallback","updatedProducts","filter","selectedProduct","productId","id","useEffect","current","getBoundingClientRect","width","scrollHandler","top","HEADER_HEIGHT","document","addEventListener","removeEventListener","jsx","Reveal","playAnimation","children","jsxs","S.HeaderGridItem","S.RemoveProductButton","RemoveProductButton","type","$isSmallScreen","onClick","StyleableSvgImage","src","closeIcon","height","S.ProductImageWrap","ProductImageWrap","image","S.ProductImage","ProductImage","loading","decoding","imageSrc","alt","title","S.ProductMeta","ref","S.ProductHeaderTooltipStyles","Tooltip","motif","position","tooltipClassName","S.PRODUCT_HEADER_TOOLTIP_CLASSNAME","PRODUCT_HEADER_TOOLTIP_CLASSNAME","isInteractive","description","S.ProductHeaderTooltipLink","ProductHeaderTooltipLink","href","target","S.ProductHeaderTooltipHoverArea","ProductHeaderTooltipHoverArea","$width","$tooltipIsPositionedTop","S.ProductTitleLink","variant","anchor","S.ProductTitle","productNote","S.ProductNote","ProductNote","S.ProductDescription","ProductDescription","$maxWidth","descriptionMaxWidth","$direction","S.BadgeWrapper","Badges"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAMA,gBAAgBA,CAAC;EAC5BC,OAAA;EACAC,mBAAA;EACAC,KAAA;EACAC,gBAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC,eAAA;EACAC,+BAAA;EACAC,2BAAA;EACAC,aAAA;EACAC,UAAA;EACAC;AACF,CAA0B,KAAA;EAClB,MAAA;IAAEC;EAAc,CAAA,GAAIC,qDAA2B,CAAA,CAAA;EACrD,MAAM;IAAEC,aAAA;IAAeC,iBAAmB;IAAAC;EAAA,IAAYC,OAAAA,CAAAA,OAAQ,CAAA,CAAA;EAC9D,MAAM,CAACC,iBAAA,EAAmBC,oBAAoB,CAAA,GAAIC,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AAK,EAAApD,eAAA;cAC5C6B,QAAc,EAAAxC,aAAA,CAAAZ,OAAA,CAAQyE,KAAK;YAC9B,CAAA,CAAA;UAAA,CAAA,EApBK,WAAWzE,QAAQsC,EAAE,EAAA;SAsB9B,mBAECW,UAAA,CAAAA,GAAA,CAAA+C,kCAAA;UAAgB5C,QAAA,EAAAxC,aAAA,CAAcZ,OAAQ,CAAAyE,KAAK;SAAE,CAAA,EAE/C,CAAC,CAACzE,OAAA,EAASiG,WACV,IAAAhD,eAAAA,UAAAA,CAAAA,GAAA,CAACiD,mBAAE,CAAAC,WAAA,EAAF;UAAe/C,QAAA,EAAAxC,aAAA,CAAcZ,OAAQ,CAAAiG,WAAW;SAAE,CAAA,EAEpDjG,QAAQoF,WACP,GAAA,eAAAnC,UAAA,CAAAA,GAAA,CAACmD,mBAAE,CAAAC,kBAAA,EAAF;UACCC,WAAWtG,OAAQ,CAAAuG,mBAAA;UACnBC,UAAY,EAAAzF,iBAAA;UAEXqC,QAAA,EAAAxC,aAAA,CAAcZ,QAAQoF,WAAW;QAAA,CAAA,CAElC,GAAA,IAAA,EACH1E,UAAA,kCACE+F,mBAAAA,CAAAA,YAAE,EAAF;UAAgBrD,QAAC,EAAAH,eAAAA,UAAAA,CAAAA,GAAA,CAAAyD,MAAA,CAAAA,MAAA,EAAA;YAAO1G;WAAkB;QAAG,CAAA,CAAA;MAElD,CAAA,CAAA;IAAA,CACF;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { Tooltip } from '@ubnt/ui-components/Tooltip';
|
|
3
|
-
import { useMemo, useCallback } from 'react';
|
|
3
|
+
import { useState, useRef, useMemo, useCallback, useEffect } from 'react';
|
|
4
4
|
import '../../../../../../constants/modelCompareData/assets/close.svg.mjs';
|
|
5
5
|
import { useModelCompareTranslation } from '../../../../../../constants/modelCompareData/translations/useModelCompareTranslation.mjs';
|
|
6
6
|
import { useMenu } from '../../../../../../contexts/MenuContext/context.mjs';
|
|
7
7
|
import { imageSrc } from '../../../../../../utils/asset.mjs';
|
|
8
|
+
import { HEADER_HEIGHT } from '../../../../../Header/Header.styles.mjs';
|
|
8
9
|
import { Reveal } from '../../../../../Reveal/Reveal.mjs';
|
|
9
10
|
import '../../../../../StyleableSvgImage/index.mjs';
|
|
10
|
-
import { HeaderGridItem, RemoveProductButton, ProductImageWrap, ProductImage, ProductMeta, ProductHeaderTooltipStyles, ProductTitleLink, ProductHeaderTooltipLink, PRODUCT_HEADER_TOOLTIP_CLASSNAME, ProductTitle, ProductNote, ProductDescription, BadgeWrapper } from '../../../CompareTable.styles.mjs';
|
|
11
|
+
import { HeaderGridItem, RemoveProductButton, ProductImageWrap, ProductImage, ProductMeta, ProductHeaderTooltipStyles, ProductHeaderTooltipHoverArea, ProductTitleLink, ProductHeaderTooltipLink, PRODUCT_HEADER_TOOLTIP_CLASSNAME, ProductTitle, ProductNote, ProductDescription, BadgeWrapper } from '../../../CompareTable.styles.mjs';
|
|
11
12
|
import { getStoreHref } from '../../../helpers/getStoreHref.mjs';
|
|
12
13
|
import { Badges } from '../Badges/Badges.mjs';
|
|
13
14
|
import { StyleableSvgImage } from '../../../../../StyleableSvgImage/StyleableSvgImage.mjs';
|
|
@@ -35,6 +36,10 @@ const ProductHeader = ({
|
|
|
35
36
|
languageDirection,
|
|
36
37
|
storeId
|
|
37
38
|
} = useMenu();
|
|
39
|
+
const [productTitleWidth, setProductTitleWidth] = useState(void 0);
|
|
40
|
+
const [toolTipIsPositionedTop, setToolTipIsPositionedTop] = useState(true);
|
|
41
|
+
const productTitleRef = useRef(null);
|
|
42
|
+
const productMetaRef = useRef(null);
|
|
38
43
|
const storeHref = useMemo(() => getStoreHref({
|
|
39
44
|
product,
|
|
40
45
|
createSiteUrl,
|
|
@@ -51,6 +56,19 @@ const ProductHeader = ({
|
|
|
51
56
|
setSelectedProducts(updatedProducts);
|
|
52
57
|
}
|
|
53
58
|
}, [product.id, selectedProducts, setExternalState, setSelectedProducts]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (!productTitleRef.current) return;
|
|
61
|
+
setProductTitleWidth(productTitleRef.current.getBoundingClientRect().width);
|
|
62
|
+
}, [productTitleRef]);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
const scrollHandler = () => {
|
|
65
|
+
if (productMetaRef.current) setToolTipIsPositionedTop(productMetaRef.current.getBoundingClientRect().top > HEADER_HEIGHT);
|
|
66
|
+
};
|
|
67
|
+
document.addEventListener("scroll", scrollHandler);
|
|
68
|
+
return () => {
|
|
69
|
+
document.removeEventListener("scroll", scrollHandler);
|
|
70
|
+
};
|
|
71
|
+
}, []);
|
|
54
72
|
return /* @__PURE__ */jsx(Reveal, {
|
|
55
73
|
index,
|
|
56
74
|
playAnimation: hasBeenObserved,
|
|
@@ -74,20 +92,27 @@ const ProductHeader = ({
|
|
|
74
92
|
alt: formatMessage(product.title)
|
|
75
93
|
})
|
|
76
94
|
}), /* @__PURE__ */jsxs(ProductMeta, {
|
|
95
|
+
ref: productMetaRef,
|
|
77
96
|
children: [linkToStoreTitleClick && storeHref || !linkToStoreTitleClick && techspecsHref ? /* @__PURE__ */jsx(ProductHeaderTooltipStyles, {
|
|
78
|
-
children: /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */jsxs(Tooltip, {
|
|
79
98
|
motif: "light",
|
|
99
|
+
position: toolTipIsPositionedTop ? "top" : "bottom",
|
|
80
100
|
tooltipClassName: PRODUCT_HEADER_TOOLTIP_CLASSNAME,
|
|
81
101
|
isInteractive: true,
|
|
82
102
|
description: /* @__PURE__ */jsxs(ProductHeaderTooltipLink, {
|
|
83
103
|
href: productTitleHref,
|
|
104
|
+
target: "__blank",
|
|
84
105
|
children: [formatMessage("modelCompare.reviewIn.tooltip"), " Tech Specs"]
|
|
85
106
|
}),
|
|
86
|
-
children: /* @__PURE__ */jsx(
|
|
107
|
+
children: [/* @__PURE__ */jsx(ProductHeaderTooltipHoverArea, {
|
|
108
|
+
$width: productTitleWidth,
|
|
109
|
+
$tooltipIsPositionedTop: toolTipIsPositionedTop
|
|
110
|
+
}), /* @__PURE__ */jsx(ProductTitleLink, {
|
|
87
111
|
variant: "link",
|
|
88
112
|
anchor: true,
|
|
113
|
+
ref: productTitleRef,
|
|
89
114
|
children: formatMessage(product.title)
|
|
90
|
-
})
|
|
115
|
+
})]
|
|
91
116
|
}, `tooltip-${product.id}`)
|
|
92
117
|
}) : /* @__PURE__ */jsx(ProductTitle, {
|
|
93
118
|
children: formatMessage(product.title)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductHeader.mjs","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.tsx"],"sourcesContent":["import { Tooltip } from \"@ubnt/ui-components/Tooltip\";\nimport { useCallback, useMemo } from \"react\";\n\nimport closeIcon from \"../../../../../../constants/modelCompareData/assets/close.svg\";\nimport { useModelCompareTranslation } from \"../../../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\nimport { useMenu } from \"../../../../../../contexts/MenuContext/context\";\nimport { imageSrc } from \"../../../../../../utils/asset\";\nimport { Reveal } from \"../../../../../Reveal/Reveal\";\nimport { StyleableSvgImage } from \"../../../../../StyleableSvgImage\";\nimport * as S from \"../../../CompareTable.styles\";\nimport { getStoreHref } from \"../../../helpers/getStoreHref\";\nimport { Badges } from \"../Badges/Badges\";\nimport type { ProductHeaderProps } from \"./ProductHeader.types\";\n\nexport const ProductHeader = ({\n product,\n setSelectedProducts,\n index,\n setExternalState,\n selectedProducts,\n linkToStoreTitleClick,\n hasBeenObserved,\n isLessThanOrEqualToFiveProducts,\n hasMultipleProductsSelected,\n isSmallScreen,\n showBadges,\n isStaticProduct,\n}: ProductHeaderProps) => {\n const { formatMessage } = useModelCompareTranslation();\n const { createSiteUrl, languageDirection, storeId } = useMenu();\n\n const storeHref = useMemo(\n () => getStoreHref({ product, createSiteUrl, storeId }),\n [product, createSiteUrl, storeId],\n );\n\n const techspecsHref = useMemo(\n () => product.techspecsPath && createSiteUrl(product.techspecsPath),\n [createSiteUrl, product.techspecsPath],\n );\n\n const productTitleHref = useMemo(\n () => (linkToStoreTitleClick ? storeHref : techspecsHref),\n [linkToStoreTitleClick, storeHref, techspecsHref],\n );\n\n const removeHandler = useCallback(() => {\n const updatedProducts =\n selectedProducts &&\n selectedProducts.filter(\n (selectedProduct) => selectedProduct.productId !== product.id,\n );\n\n if (setExternalState && updatedProducts) {\n setExternalState(updatedProducts);\n }\n\n if (updatedProducts && setSelectedProducts) {\n setSelectedProducts(updatedProducts);\n }\n }, [product.id, selectedProducts, setExternalState, setSelectedProducts]);\n\n return (\n <Reveal index={index} playAnimation={hasBeenObserved}>\n <S.HeaderGridItem>\n {!isLessThanOrEqualToFiveProducts &&\n hasMultipleProductsSelected &&\n !isStaticProduct && (\n <S.RemoveProductButton\n type=\"button\"\n $isSmallScreen={isSmallScreen}\n onClick={removeHandler}\n >\n <StyleableSvgImage src={closeIcon} width={16} height={16} />\n </S.RemoveProductButton>\n )}\n <S.ProductImageWrap height={product.image.height}>\n <S.ProductImage\n loading=\"lazy\"\n decoding=\"async\"\n src={imageSrc(product.image.src)}\n width={product.image.width}\n alt={formatMessage(product.title)}\n />\n </S.ProductImageWrap>\n <S.ProductMeta>\n {(linkToStoreTitleClick && storeHref) ||\n (!linkToStoreTitleClick && techspecsHref) ? (\n <S.ProductHeaderTooltipStyles>\n <Tooltip\n key={`tooltip-${product.id}`}\n motif=\"light\"\n tooltipClassName={S.PRODUCT_HEADER_TOOLTIP_CLASSNAME}\n isInteractive\n description={\n <S.ProductHeaderTooltipLink href={productTitleHref}>\n {formatMessage(\"modelCompare.reviewIn.tooltip\")} Tech Specs\n </S.ProductHeaderTooltipLink>\n }\n >\n <S.ProductTitleLink variant=\"link\" anchor>\n {formatMessage(product.title)}\n </S.ProductTitleLink>\n </Tooltip>\n </S.ProductHeaderTooltipStyles>\n ) : (\n <S.ProductTitle>{formatMessage(product.title)}</S.ProductTitle>\n )}\n {!!product?.productNote && (\n <S.ProductNote>{formatMessage(product.productNote)}</S.ProductNote>\n )}\n {product.description ? (\n <S.ProductDescription\n $maxWidth={product.descriptionMaxWidth}\n $direction={languageDirection}\n >\n {formatMessage(product.description)}\n </S.ProductDescription>\n ) : null}\n {showBadges && (\n <S.BadgeWrapper>{<Badges product={product} />}</S.BadgeWrapper>\n )}\n </S.ProductMeta>\n </S.HeaderGridItem>\n </Reveal>\n );\n};\n"],"names":["ProductHeader","product","setSelectedProducts","index","setExternalState","selectedProducts","linkToStoreTitleClick","hasBeenObserved","isLessThanOrEqualToFiveProducts","hasMultipleProductsSelected","isSmallScreen","showBadges","isStaticProduct","formatMessage","useModelCompareTranslation","createSiteUrl","languageDirection","storeId","useMenu","storeHref","useMemo","getStoreHref","techspecsHref","techspecsPath","productTitleHref","removeHandler","useCallback","updatedProducts","filter","selectedProduct","productId","id","jsx","Reveal","playAnimation","children","jsxs","S.HeaderGridItem","S.RemoveProductButton","type","$isSmallScreen","onClick","StyleableSvgImage","src","closeIcon","width","height","S.ProductImageWrap","image","S.ProductImage","loading","decoding","imageSrc","alt","title","S.ProductMeta","S.ProductHeaderTooltipStyles","Tooltip","motif","tooltipClassName","S.PRODUCT_HEADER_TOOLTIP_CLASSNAME","isInteractive","description","S.ProductHeaderTooltipLink","href","S.ProductTitleLink","variant","anchor","S.ProductTitle","productNote","S.ProductNote","S.ProductDescription","$maxWidth","descriptionMaxWidth","$direction","S.BadgeWrapper","Badges"],"mappings":";;;;;;;;;;;;;;;AAcO,MAAMA,gBAAgBA,CAAC;EAC5BC,OAAA;EACAC,mBAAA;EACAC,KAAA;EACAC,gBAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC,eAAA;EACAC,+BAAA;EACAC,2BAAA;EACAC,aAAA;EACAC,UAAA;EACAC;AACF,CAA0B,KAAA;EAClB,MAAA;IAAEC;EAAc,CAAA,GAAIC,0B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AoC,cAAA;UAAgBjC,QAAA,EAAAtB,aAAA,CAAcZ,OAAQ,CAAAqD,KAAK;SAAE,CAAA,EAE/C,CAAC,CAACrD,OAAA,EAASoE,WACV,IAAA,eAAArC,GAAA,CAACsC,WAAE,EAAF;UAAenC,QAAA,EAAAtB,aAAA,CAAcZ,OAAQ,CAAAoE,WAAW;SAAE,CAAA,EAEpDpE,QAAQ6D,WACP,GAAA,eAAA9B,GAAA,CAACuC,kBAAE,EAAF;UACCC,WAAWvE,OAAQ,CAAAwE,mBAAA;UACnBC,UAAY,EAAA1D,iBAAA;UAEXmB,QAAA,EAAAtB,aAAA,CAAcZ,QAAQ6D,WAAW;QAAA,CAAA,CAElC,GAAA,IAAA,EACHnD,UAAA,uBACEgE,YAAE,EAAF;UAAgBxC,QAAC,EAAA,eAAAH,GAAA,CAAA4C,MAAA,EAAA;YAAO3E;WAAkB;QAAG,CAAA,CAAA;MAElD,CAAA,CAAA;IAAA,CACF;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ProductHeader.mjs","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.tsx"],"sourcesContent":["import { Tooltip } from \"@ubnt/ui-components/Tooltip\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport closeIcon from \"../../../../../../constants/modelCompareData/assets/close.svg\";\nimport { useModelCompareTranslation } from \"../../../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\nimport { useMenu } from \"../../../../../../contexts/MenuContext/context\";\nimport { imageSrc } from \"../../../../../../utils/asset\";\nimport { HEADER_HEIGHT } from \"../../../../../Header/Header.styles\";\nimport { Reveal } from \"../../../../../Reveal/Reveal\";\nimport { StyleableSvgImage } from \"../../../../../StyleableSvgImage\";\nimport * as S from \"../../../CompareTable.styles\";\nimport { getStoreHref } from \"../../../helpers/getStoreHref\";\nimport { Badges } from \"../Badges/Badges\";\nimport type { ProductHeaderProps } from \"./ProductHeader.types\";\n\nexport const ProductHeader = ({\n product,\n setSelectedProducts,\n index,\n setExternalState,\n selectedProducts,\n linkToStoreTitleClick,\n hasBeenObserved,\n isLessThanOrEqualToFiveProducts,\n hasMultipleProductsSelected,\n isSmallScreen,\n showBadges,\n isStaticProduct,\n}: ProductHeaderProps) => {\n const { formatMessage } = useModelCompareTranslation();\n const { createSiteUrl, languageDirection, storeId } = useMenu();\n const [productTitleWidth, setProductTitleWidth] = useState<\n number | undefined\n >(undefined);\n const [toolTipIsPositionedTop, setToolTipIsPositionedTop] = useState(true);\n\n const productTitleRef = useRef<HTMLAnchorElement | HTMLButtonElement | null>(\n null,\n );\n const productMetaRef = useRef<HTMLDivElement | null>(null);\n\n const storeHref = useMemo(\n () => getStoreHref({ product, createSiteUrl, storeId }),\n [product, createSiteUrl, storeId],\n );\n\n const techspecsHref = useMemo(\n () => product.techspecsPath && createSiteUrl(product.techspecsPath),\n [createSiteUrl, product.techspecsPath],\n );\n\n const productTitleHref = useMemo(\n () => (linkToStoreTitleClick ? storeHref : techspecsHref),\n [linkToStoreTitleClick, storeHref, techspecsHref],\n );\n\n const removeHandler = useCallback(() => {\n const updatedProducts =\n selectedProducts &&\n selectedProducts.filter(\n (selectedProduct) => selectedProduct.productId !== product.id,\n );\n\n if (setExternalState && updatedProducts) {\n setExternalState(updatedProducts);\n }\n\n if (updatedProducts && setSelectedProducts) {\n setSelectedProducts(updatedProducts);\n }\n }, [product.id, selectedProducts, setExternalState, setSelectedProducts]);\n\n useEffect(() => {\n if (!productTitleRef.current) return;\n\n setProductTitleWidth(productTitleRef.current.getBoundingClientRect().width);\n }, [productTitleRef]);\n\n useEffect(() => {\n const scrollHandler = () => {\n if (productMetaRef.current)\n setToolTipIsPositionedTop(\n productMetaRef.current.getBoundingClientRect().top > HEADER_HEIGHT,\n );\n };\n\n document.addEventListener(\"scroll\", scrollHandler);\n\n return () => {\n document.removeEventListener(\"scroll\", scrollHandler);\n };\n }, []);\n\n return (\n <Reveal index={index} playAnimation={hasBeenObserved}>\n <S.HeaderGridItem>\n {!isLessThanOrEqualToFiveProducts &&\n hasMultipleProductsSelected &&\n !isStaticProduct && (\n <S.RemoveProductButton\n type=\"button\"\n $isSmallScreen={isSmallScreen}\n onClick={removeHandler}\n >\n <StyleableSvgImage src={closeIcon} width={16} height={16} />\n </S.RemoveProductButton>\n )}\n <S.ProductImageWrap height={product.image.height}>\n <S.ProductImage\n loading=\"lazy\"\n decoding=\"async\"\n src={imageSrc(product.image.src)}\n width={product.image.width}\n alt={formatMessage(product.title)}\n />\n </S.ProductImageWrap>\n <S.ProductMeta ref={productMetaRef}>\n {(linkToStoreTitleClick && storeHref) ||\n (!linkToStoreTitleClick && techspecsHref) ? (\n <S.ProductHeaderTooltipStyles>\n <Tooltip\n key={`tooltip-${product.id}`}\n motif=\"light\"\n position={toolTipIsPositionedTop ? \"top\" : \"bottom\"}\n tooltipClassName={S.PRODUCT_HEADER_TOOLTIP_CLASSNAME}\n isInteractive\n description={\n <S.ProductHeaderTooltipLink\n href={productTitleHref}\n target=\"__blank\"\n >\n {formatMessage(\"modelCompare.reviewIn.tooltip\")} Tech Specs\n </S.ProductHeaderTooltipLink>\n }\n >\n <S.ProductHeaderTooltipHoverArea\n $width={productTitleWidth}\n $tooltipIsPositionedTop={toolTipIsPositionedTop}\n />\n <S.ProductTitleLink variant=\"link\" anchor ref={productTitleRef}>\n {formatMessage(product.title)}\n </S.ProductTitleLink>\n </Tooltip>\n </S.ProductHeaderTooltipStyles>\n ) : (\n <S.ProductTitle>{formatMessage(product.title)}</S.ProductTitle>\n )}\n {!!product?.productNote && (\n <S.ProductNote>{formatMessage(product.productNote)}</S.ProductNote>\n )}\n {product.description ? (\n <S.ProductDescription\n $maxWidth={product.descriptionMaxWidth}\n $direction={languageDirection}\n >\n {formatMessage(product.description)}\n </S.ProductDescription>\n ) : null}\n {showBadges && (\n <S.BadgeWrapper>{<Badges product={product} />}</S.BadgeWrapper>\n )}\n </S.ProductMeta>\n </S.HeaderGridItem>\n </Reveal>\n );\n};\n"],"names":["ProductHeader","product","setSelectedProducts","index","setExternalState","selectedProducts","linkToStoreTitleClick","hasBeenObserved","isLessThanOrEqualToFiveProducts","hasMultipleProductsSelected","isSmallScreen","showBadges","isStaticProduct","formatMessage","useModelCompareTranslation","createSiteUrl","languageDirection","storeId","useMenu","productTitleWidth","setProductTitleWidth","useState","toolTipIsPositionedTop","setToolTipIsPositionedTop","productTitleRef","useRef","productMetaRef","storeHref","useMemo","getStoreHref","techspecsHref","techspecsPath","productTitleHref","removeHandler","useCallback","updatedProducts","filter","selectedProduct","productId","id","useEffect","current","getBoundingClientRect","width","scrollHandler","top","HEADER_HEIGHT","document","addEventListener","removeEventListener","jsx","Reveal","playAnimation","children","jsxs","S.HeaderGridItem","S.RemoveProductButton","type","$isSmallScreen","onClick","StyleableSvgImage","src","closeIcon","height","S.ProductImageWrap","image","S.ProductImage","loading","decoding","imageSrc","alt","title","S.ProductMeta","ref","S.ProductHeaderTooltipStyles","Tooltip","motif","position","tooltipClassName","S.PRODUCT_HEADER_TOOLTIP_CLASSNAME","isInteractive","description","S.ProductHeaderTooltipLink","href","target","S.ProductHeaderTooltipHoverArea","$width","$tooltipIsPositionedTop","S.ProductTitleLink","variant","anchor","S.ProductTitle","productNote","S.ProductNote","S.ProductDescription","$maxWidth","descriptionMaxWidth","$direction","S.BadgeWrapper","Badges"],"mappings":";;;;;;;;;;;;;;;;AAeO,MAAMA,gBAAgBA,CAAC;EAC5BC,OAAA;EACAC,mBAAA;EACAC,KAAA;EACAC,gBAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC,eAAA;EACAC,+BAAA;EACAC,2BAAA;EACAC,aAAA;EACAC,UAAA;EACAC;AACF,CAA0B,KAAA;EAClB,MAAA;IAAEC;EAAc,CAAA,GAAIC,0BAA2B,CAAA,CAAA;EACrD,MAAM;IAAEC,aAAA;IAAeC,iBAAmB;IAAAC;EAAA,IAAYC,OAAQ,CAAA,CAAA;EAC9D,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,WAAW;SAAE,CAAA,EAEpD3F,QAAQgF,WACP,GAAA,eAAA/B,GAAA,CAAC4C,kBAAE,EAAF;UACCC,WAAW9F,OAAQ,CAAA+F,mBAAA;UACnBC,UAAY,EAAAjF,iBAAA;UAEXqC,QAAA,EAAAxC,aAAA,CAAcZ,QAAQgF,WAAW;QAAA,CAAA,CAElC,GAAA,IAAA,EACHtE,UAAA,uBACEuF,YAAE,EAAF;UAAgB7C,QAAC,EAAA,eAAAH,GAAA,CAAAiD,MAAA,EAAA;YAAOlG;WAAkB;QAAG,CAAA,CAAA;MAElD,CAAA,CAAA;IAAA,CACF;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
@@ -29,15 +29,19 @@ const useButtonRenderer = () => {
|
|
|
29
29
|
startTrialLink = void 0,
|
|
30
30
|
learnMoreLink = void 0
|
|
31
31
|
} = product;
|
|
32
|
-
const createButton = (label, href, variant = "primary") =>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
const createButton = (label, href, variant = "primary") => {
|
|
33
|
+
const BUTTONS_WITHOUT_POINTER_EVENTS = isComingSoon;
|
|
34
|
+
return /* @__PURE__ */jsxRuntime.jsx(CompareTable_styles.ButtonWrap, {
|
|
35
|
+
children: /* @__PURE__ */jsxRuntime.jsx(CompareTable_styles.Button, {
|
|
36
|
+
$removePointerEvents: Boolean(BUTTONS_WITHOUT_POINTER_EVENTS),
|
|
37
|
+
variant,
|
|
38
|
+
anchor: true,
|
|
39
|
+
href,
|
|
40
|
+
onClick: e => href && onLinkClick?.(e, href),
|
|
41
|
+
children: label
|
|
42
|
+
})
|
|
43
|
+
}, `${id}-${index}`);
|
|
44
|
+
};
|
|
41
45
|
if (addToCartButton) return addToCartButton;
|
|
42
46
|
if (typeof isComingSoon === "boolean" && !!isComingSoon || Array.isArray(isComingSoon) && isComingSoon.includes(storeId)) {
|
|
43
47
|
return createButton(getComingSoonButtonText(product), void 0, "comingSoon");
|