@ubnt/store.core 10.20.0-matt.13 → 10.20.0-matt.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/lib/assets/ai-dslr.jpg +0 -0
  3. package/lib/assets/ai-dslr2.jpg +0 -0
  4. package/lib/assets/ai-lpr.jpg +0 -0
  5. package/lib/assets/ai-lpr2.jpg +0 -0
  6. package/lib/assets/attention.svg +5 -5
  7. package/lib/assets/attention2.svg +5 -5
  8. package/lib/assets/bullet2.svg +2 -4
  9. package/lib/assets/bullet3.svg +4 -2
  10. package/lib/assets/door-hub-mini.jpg +0 -0
  11. package/lib/assets/door-hub-mini2.jpg +0 -0
  12. package/lib/assets/floodlight.svg +2 -9
  13. package/lib/assets/floodlight2.svg +9 -2
  14. package/lib/assets/g3-reader-flex.jpg +0 -0
  15. package/lib/assets/g3-reader-flex2.jpg +0 -0
  16. package/lib/assets/g3-starter-kit.jpg +0 -0
  17. package/lib/assets/g3-starter-kit2.jpg +0 -0
  18. package/lib/assets/g5-bullet.jpg +0 -0
  19. package/lib/assets/g5-bullet2.jpg +0 -0
  20. package/lib/assets/g5-dome-ultra.jpg +0 -0
  21. package/lib/assets/g5-dome-ultra2.jpg +0 -0
  22. package/lib/assets/globe.svg +2 -9
  23. package/lib/assets/globe2.svg +9 -2
  24. package/lib/assets/intercom.jpg +0 -0
  25. package/lib/assets/intercom2.jpg +0 -0
  26. package/lib/assets/interior-design.svg +2 -2
  27. package/lib/assets/interior-design2.svg +2 -2
  28. package/lib/assets/minus4.svg +8 -8
  29. package/lib/assets/minus5.svg +8 -8
  30. package/lib/assets/plus4.svg +9 -9
  31. package/lib/assets/plus5.svg +9 -9
  32. package/lib/assets/power.svg +1 -4
  33. package/lib/assets/power2.svg +4 -1
  34. package/lib/assets/ptz2.svg +2 -2
  35. package/lib/assets/ptz3.svg +2 -2
  36. package/lib/assets/rack.svg +1 -4
  37. package/lib/assets/rack2.svg +4 -1
  38. package/lib/components/Header/Header.js +1 -1
  39. package/lib/components/Header/Header.mjs +1 -1
  40. package/lib/components/Header/MenuItem/MenuItem.js +9 -1
  41. package/lib/components/Header/MenuItem/MenuItem.js.map +1 -1
  42. package/lib/components/Header/MenuItem/MenuItem.mjs +9 -1
  43. package/lib/components/Header/MenuItem/MenuItem.mjs.map +1 -1
  44. package/lib/components/Header/MicrositeMobileMenu/MicrositeMobileMenu.d.ts +2 -1
  45. package/lib/components/Header/MicrositeMobileMenu/MicrositeMobileMenu.js +9 -1
  46. package/lib/components/Header/MicrositeMobileMenu/MicrositeMobileMenu.js.map +1 -1
  47. package/lib/components/Header/MicrositeMobileMenu/MicrositeMobileMenu.mjs +10 -2
  48. package/lib/components/Header/MicrositeMobileMenu/MicrositeMobileMenu.mjs.map +1 -1
  49. package/lib/components/Header/ProHeader/ProHeader.js +1 -1
  50. package/lib/components/Header/ProHeader/ProHeader.mjs +1 -1
  51. package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.js +11 -5
  52. package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.js.map +1 -1
  53. package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.mjs +11 -5
  54. package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.mjs.map +1 -1
  55. package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.d.ts +3 -5
  56. package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.js +12 -11
  57. package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.js.map +1 -1
  58. package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.mjs +12 -11
  59. package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.mjs.map +1 -1
  60. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.js +9 -28
  61. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.js.map +1 -1
  62. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.mjs +11 -30
  63. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.mjs.map +1 -1
  64. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.d.ts +1 -0
  65. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.js +20 -5
  66. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.js.map +1 -1
  67. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.mjs +21 -7
  68. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.mjs.map +1 -1
  69. package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.d.ts +2 -2
  70. package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.js +5 -2
  71. package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.js.map +1 -1
  72. package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.mjs +5 -2
  73. package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.mjs.map +1 -1
  74. package/lib/components/ModelCompareV4/ProductList/ProductList.js +19 -5
  75. package/lib/components/ModelCompareV4/ProductList/ProductList.js.map +1 -1
  76. package/lib/components/ModelCompareV4/ProductList/ProductList.mjs +19 -5
  77. package/lib/components/ModelCompareV4/ProductList/ProductList.mjs.map +1 -1
  78. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
  79. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
  80. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
  81. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
  82. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
  83. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
  84. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
  85. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
  86. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
  87. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
  88. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
  89. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
  90. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
  91. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
  92. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
  93. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
  94. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
  95. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
  96. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
  97. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
  98. package/lib/constants/icons/header/globe.svg.js +1 -1
  99. package/lib/constants/icons/header/globe.svg.mjs +2 -2
  100. package/lib/constants/icons/header/index.js +1 -1
  101. package/lib/constants/icons/header/index.mjs +1 -1
  102. package/lib/constants/icons/menu/floodlight.svg.js +5 -5
  103. package/lib/constants/icons/menu/floodlight.svg.mjs +2 -2
  104. package/lib/constants/icons/menu/index.js +9 -9
  105. package/lib/constants/icons/menu/index.mjs +3 -3
  106. package/lib/constants/icons/menu/power.svg.js +5 -5
  107. package/lib/constants/icons/menu/power.svg.mjs +2 -2
  108. package/lib/constants/icons/menu/rack.svg.js +5 -5
  109. package/lib/constants/icons/menu/rack.svg.mjs +2 -2
  110. package/lib/constants/modelCompareData/assets/Bullet/ai-dslr.jpg.js +1 -1
  111. package/lib/constants/modelCompareData/assets/Bullet/ai-dslr.jpg.mjs +2 -2
  112. package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.js +1 -1
  113. package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.mjs +2 -2
  114. package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.js +1 -1
  115. package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.mjs +2 -2
  116. package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.js +1 -1
  117. package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.mjs +2 -2
  118. package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome-ultra.jpg.js +1 -1
  119. package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome-ultra.jpg.mjs +2 -2
  120. package/lib/constants/modelCompareData/assets/DoorAccess/door-hub-mini.jpg.js +1 -1
  121. package/lib/constants/modelCompareData/assets/DoorAccess/door-hub-mini.jpg.mjs +2 -2
  122. package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.js +1 -1
  123. package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.mjs +2 -2
  124. package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.js +1 -1
  125. package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.mjs +2 -2
  126. package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.js +1 -1
  127. package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.mjs +2 -2
  128. package/lib/constants/modelCompareData/assets/floodlight.svg.js +1 -1
  129. package/lib/constants/modelCompareData/assets/floodlight.svg.mjs +2 -2
  130. package/lib/constants/modelCompareData/assets/globe.svg.js +1 -1
  131. package/lib/constants/modelCompareData/assets/globe.svg.mjs +2 -2
  132. package/lib/constants/modelCompareData/assets/interior-design.svg.js +1 -1
  133. package/lib/constants/modelCompareData/assets/interior-design.svg.mjs +2 -2
  134. package/lib/constants/modelCompareData/assets/power.svg.js +1 -1
  135. package/lib/constants/modelCompareData/assets/power.svg.mjs +2 -2
  136. package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.js +1 -1
  137. package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.mjs +2 -2
  138. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-dslr.jpg.js +1 -1
  139. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-dslr.jpg.mjs +2 -2
  140. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.js +1 -1
  141. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.mjs +2 -2
  142. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/g5-bullet.jpg.js +1 -1
  143. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/g5-bullet.jpg.mjs +2 -2
  144. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome-ultra.jpg.js +1 -1
  145. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome-ultra.jpg.mjs +2 -2
  146. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub-mini.jpg.js +1 -1
  147. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub-mini.jpg.mjs +2 -2
  148. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.js +1 -1
  149. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.mjs +2 -2
  150. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.js +1 -1
  151. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.mjs +2 -2
  152. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.jpg.js +1 -1
  153. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.jpg.mjs +2 -2
  154. package/lib/constants/modelCompareData/assets/product-list-assets/interior-design.svg.js +1 -1
  155. package/lib/constants/modelCompareData/assets/product-list-assets/interior-design.svg.mjs +2 -2
  156. package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.js +1 -1
  157. package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.mjs +2 -2
  158. package/lib/constants/modelCompareData/assets/ptz.svg.js +1 -1
  159. package/lib/constants/modelCompareData/assets/ptz.svg.mjs +2 -2
  160. package/lib/constants/modelCompareData/assets/rack.svg.js +1 -1
  161. package/lib/constants/modelCompareData/assets/rack.svg.mjs +2 -2
  162. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.js +1 -1
  163. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.mjs +1 -1
  164. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/InteriorDesign.js +1 -1
  165. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/InteriorDesign.mjs +1 -1
  166. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.js +1 -1
  167. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.mjs +1 -1
  168. package/lib/constants/modelCompareData/data/product-list-groups/bullet.js +1 -1
  169. package/lib/constants/modelCompareData/data/product-list-groups/bullet.mjs +1 -1
  170. package/lib/constants/modelCompareData/data/product-list-groups/interiorDesign.js +1 -1
  171. package/lib/constants/modelCompareData/data/product-list-groups/interiorDesign.mjs +1 -1
  172. package/lib/constants/modelCompareData/data/product-list-groups/ptz.js +1 -1
  173. package/lib/constants/modelCompareData/data/product-list-groups/ptz.mjs +1 -1
  174. package/lib/constants/modelCompareData/data/products/aiDslr.js +2 -2
  175. package/lib/constants/modelCompareData/data/products/aiDslr.mjs +2 -2
  176. package/lib/constants/modelCompareData/data/products/aiLpr.js +2 -2
  177. package/lib/constants/modelCompareData/data/products/aiLpr.mjs +2 -2
  178. package/lib/constants/modelCompareData/data/products/doorHubMini.js +2 -2
  179. package/lib/constants/modelCompareData/data/products/doorHubMini.mjs +2 -2
  180. package/lib/constants/modelCompareData/data/products/g3ReaderFlex.js +2 -2
  181. package/lib/constants/modelCompareData/data/products/g3ReaderFlex.mjs +2 -2
  182. package/lib/constants/modelCompareData/data/products/g3StarterKit.js +2 -2
  183. package/lib/constants/modelCompareData/data/products/g3StarterKit.mjs +2 -2
  184. package/lib/constants/modelCompareData/data/products/g5Bullet.js +2 -2
  185. package/lib/constants/modelCompareData/data/products/g5Bullet.mjs +2 -2
  186. package/lib/constants/modelCompareData/data/products/g5DomeUltra.js +2 -2
  187. package/lib/constants/modelCompareData/data/products/g5DomeUltra.mjs +2 -2
  188. package/lib/constants/modelCompareData/data/products/intercom.js +2 -2
  189. package/lib/constants/modelCompareData/data/products/intercom.mjs +2 -2
  190. package/lib/constants/modelCompareData/data/properties/accessPowerMethod.js +1 -1
  191. package/lib/constants/modelCompareData/data/properties/accessPowerMethod.mjs +1 -1
  192. package/lib/constants/modelCompareData/data/properties/availability.js +1 -1
  193. package/lib/constants/modelCompareData/data/properties/availability.mjs +1 -1
  194. package/lib/constants/modelCompareData/data/properties/builtInFloodlight.js +1 -1
  195. package/lib/constants/modelCompareData/data/properties/builtInFloodlight.mjs +1 -1
  196. package/lib/constants/modelCompareData/data/properties/dcPowerOutput.js +1 -1
  197. package/lib/constants/modelCompareData/data/properties/dcPowerOutput.mjs +1 -1
  198. package/lib/constants/modelCompareData/data/properties/mounting.js +1 -1
  199. package/lib/constants/modelCompareData/data/properties/mounting.mjs +1 -1
  200. package/lib/constants/modelCompareData/data/properties/webMode.js +1 -1
  201. package/lib/constants/modelCompareData/data/properties/webMode.mjs +1 -1
  202. package/lib/contexts/MenuContext/mapping.js +3 -3
  203. package/lib/contexts/MenuContext/mapping.mjs +2 -2
  204. package/lib/contexts/MicrositeMenuContext/mapping.js +3 -3
  205. package/lib/contexts/MicrositeMenuContext/mapping.mjs +2 -2
  206. package/package.json +41 -41
@@ -1,4 +1,4 @@
1
- import styled, { keyframes, css } from 'styled-components';
1
+ import styled, { keyframes, createGlobalStyle, css } from 'styled-components';
2
2
  import { BREAKPOINTS } from '../../../../constants/layout.mjs';
3
3
  import { theme } from '../../../../constants/theme.mjs';
4
4
  import { ModalId } from '../../../../contexts/MicrositeMenuContext/types.mjs';
@@ -33,6 +33,11 @@ const removeZeroHeight = keyframes`
33
33
  max-height: 100%;
34
34
  }
35
35
  `;
36
+ const StableGutterGlobalStyles = createGlobalStyle`
37
+ html {
38
+ scrollbar-gutter: stable;
39
+ }
40
+ `;
36
41
  const Content = styled.div`
37
42
  position: absolute;
38
43
  z-index: ${theme.zIndex.modal};
@@ -80,6 +85,11 @@ const StyledContainer = styled.header`
80
85
  position: absolute;
81
86
  padding-bottom: 48px;
82
87
  top: env(safe-area-inset-top);
88
+
89
+ *:focus,
90
+ * {
91
+ outline: none !important;
92
+ }
83
93
  `;
84
94
  const Wrap = styled.nav`
85
95
  ${({
@@ -217,17 +227,15 @@ const ItemLabel = styled.span`
217
227
  color: ${theme.colors.primaryBlue};
218
228
  `}
219
229
 
220
- ${({
230
+ ${({
221
231
  $menuIsClosed,
222
232
  $motif
223
233
  }) => $menuIsClosed && css`
224
234
  color: ${$motif === HeaderMotif.DarkText ? theme.colors.black : theme.colors.white};
225
235
  `}
226
236
 
227
- @media (hover: hover) and (pointer: fine) {
228
- &:focus-visible {
229
- color: ${theme.colors.primaryBlue};
230
- }
237
+ &:focus {
238
+ color: ${theme.colors.primaryBlue};
231
239
  }
232
240
  `;
233
241
  const ArrowDownIcon = styled(StyleableSvgImage)`
@@ -309,6 +317,12 @@ const RightItem = styled.a`
309
317
  }
310
318
  `}
311
319
 
320
+ @media (hover: hover) and (pointer: fine) {
321
+ &:focus-visible {
322
+ color: ${theme.colors.primaryBlue};
323
+ }
324
+ }
325
+
312
326
  ${({
313
327
  $withMarginRight
314
328
  }) => $withMarginRight && css`
@@ -424,5 +438,5 @@ const TransparentButton = styled.button`
424
438
  }
425
439
  `}
426
440
  `;
427
- export { ANIMATION_TRANSITION, ActionIcon, ArrowDownIcon, Content, ContentContainer, Divider, InnerWrap, Item, ItemLabel, ItemsWrap, LeftWrap, LogoAnchor, ModalInnerWrap, ModalMenuInnerWrap, ModalMenuWrap, ModalWrap, OverflowWrapper, RightItem, RightWrap, StyledContainer, TransparentButton, Wrap };
441
+ export { ANIMATION_TRANSITION, ActionIcon, ArrowDownIcon, Content, ContentContainer, Divider, InnerWrap, Item, ItemLabel, ItemsWrap, LeftWrap, LogoAnchor, ModalInnerWrap, ModalMenuInnerWrap, ModalMenuWrap, ModalWrap, OverflowWrapper, RightItem, RightWrap, StableGutterGlobalStyles, StyledContainer, TransparentButton, Wrap };
428
442
  //# sourceMappingURL=HeaderContent.styles.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderContent.styles.mjs","sources":["../../../../../src/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.tsx"],"sourcesContent":["import styled, { css, keyframes } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../../constants/layout\";\nimport { theme } from \"../../../../constants/theme\";\nimport { ModalId } from \"../../../../contexts/MicrositeMenuContext/types\";\nimport { Container } from \"../../../Container\";\nimport { MenuButtonWrap } from \"../../../Header/MenuItem/MenuItem.styles\";\nimport { StyleableSvgImage } from \"../../../StyleableSvgImage\";\nimport { withCssTransition } from \"../DropdownMenu/DropdownMenu.styles\";\nimport { HeaderMotif } from \"./HeaderContent.types\";\n\nconst FIRST_LEVEL_MENU_HEIGHT = 48;\nexport const ANIMATION_TRANSITION = 0.3;\n\nconst addOpacity = keyframes`\n 0%{\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100%{\n opacity: 1;\n }\n`;\nconst removeOverflowHidden = keyframes`\n100% {\n overflow: unset;\n }\n`;\nconst removeZeroHeight = keyframes`\n 100% {\n max-height: 100%;\n }\n`;\nexport const Content = styled.div`\n position: absolute;\n z-index: ${theme.zIndex.modal};\n width: 100%;\n`;\n\nexport const ContentContainer = styled.div<{ $isCollapsed: boolean }>`\n transition: grid-template-rows ${ANIMATION_TRANSITION}s;\n display: grid;\n grid-template-rows: 1fr;\n flex: 0;\n margin: 0 auto;\n position: absolute;\n z-index: ${theme.zIndex.header - 1};\n background-color: ${theme.colors.white};\n width: 100%;\n padding: 0;\n max-width: 100%;\n\n ${({ $isCollapsed }) =>\n $isCollapsed &&\n css`\n grid-template-rows: 0fr;\n opacity: 0;\n\n ${Content} {\n overflow: hidden;\n max-height: 0;\n }\n `}\n\n ${({ $isCollapsed }) =>\n !$isCollapsed &&\n css`\n ${Content} {\n overflow: hidden;\n animation:\n ${ANIMATION_TRANSITION}s ${removeOverflowHidden} linear forwards,\n ${ANIMATION_TRANSITION}s ${addOpacity} ease-in-out forwards,\n ${ANIMATION_TRANSITION}s ${removeZeroHeight} ease-in-out forwards;\n }\n `}\n`;\n\nexport const StyledContainer = styled.header`\n width: 100%;\n position: absolute;\n padding-bottom: 48px;\n top: env(safe-area-inset-top);\n`;\n\nexport const Wrap = styled.nav<{\n $isLastMenu: boolean;\n $hasWhiteBackground: boolean;\n $transitionFade: boolean;\n $isActive?: boolean;\n $shouldAnimateBackground?: boolean;\n}>`\n ${({ $shouldAnimateBackground }) =>\n $shouldAnimateBackground && withCssTransition([\"background\"])}\n\n align-items: center;\n height: ${FIRST_LEVEL_MENU_HEIGHT}px;\n display: flex;\n justify-content: center;\n position: fixed;\n padding: 0 16px;\n top: env(safe-area-inset-top);\n width: 100%;\n\n ${({ $hasWhiteBackground }) =>\n $hasWhiteBackground &&\n css`\n box-shadow: 0 -1px 0 0 rgb(0 0 0 / 0.05) inset;\n background-color: ${theme.colors.white} !important;\n `}\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n ${({ $isActive }) =>\n $isActive &&\n css`\n box-shadow: 0 -1px 0 0 rgb(0 0 0 / 0.05) inset;\n `}\n }\n`;\n\nexport const LeftWrap = styled.div`\n align-items: center;\n display: flex;\n gap: 5px;\n height: 100%;\n`;\n\nexport const LogoAnchor = styled.a<{ $motif: HeaderMotif }>`\n -webkit-tap-highlight-color: transparent;\n\n @media (hover: hover) {\n &:hover {\n color: ${theme.colors.menu.active[\"light\"]};\n ${withCssTransition([\"color\"])};\n }\n }\n\n color: ${({ $motif }) =>\n $motif === HeaderMotif.LightText ? theme.colors.white : theme.colors.black};\n outline: none;\n\n &:active,\n &:focus {\n color: ${({ $motif }) =>\n $motif === HeaderMotif.LightText\n ? theme.colors.white\n : theme.colors.black};\n }\n\n @media (hover: none) {\n &:focus,\n &:active {\n box-shadow: none;\n background: inherit;\n color: ${theme.colors.black};\n }\n }\n\n margin-right: 35px;\n height: 100%;\n display: flex;\n align-items: center;\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n transform: translateX(100%);\n margin-right: 0;\n }\n`;\n\nexport const ItemsWrap = styled.nav`\n display: flex;\n align-items: center;\n gap: 2px;\n height: 100%;\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n display: none;\n }\n`;\n\nexport const ItemLabel = styled.span<{\n $active: boolean;\n $isStartItem?: boolean;\n $isHovered?: boolean;\n $motif: HeaderMotif;\n $menuIsClosed: boolean;\n}>`\n display: flex;\n align-items: center;\n gap: 7.5px;\n color: ${theme.colors.white};\n border-radius: 6px;\n padding: 7px 10px;\n\n ${withCssTransition([\"color\", \"background\"])};\n\n @media (hover: hover) {\n &:hover {\n background: rgb(244 245 246 / 0.2);\n color: ${theme.colors.white};\n }\n }\n\n ${({ $motif }) =>\n $motif === HeaderMotif.DarkText &&\n css`\n color: #212327;\n `}\n @media (hover: hover) {\n &:hover {\n color: ${theme.colors.primaryBlue};\n }\n }\n\n ${({ $active, $motif }) =>\n $active &&\n css`\n color: ${$motif === HeaderMotif.DarkText\n ? theme.colors.primaryBlue\n : theme.colors.white};\n background: ${$motif === HeaderMotif.DarkText\n ? \"#f4f5f6\"\n : \"rgba(244, 245, 246, 0.2)\"};\n `}\n\n ${({ $isStartItem }) =>\n $isStartItem &&\n css`\n background: transparent !important;\n padding: 7px 0;\n `}\n\n ${({ $isHovered }) =>\n $isHovered &&\n css`\n background: transparent !important;\n color: ${theme.colors.primaryBlue};\n `}\n\n ${({ $menuIsClosed, $motif }) =>\n $menuIsClosed &&\n css`\n color: ${$motif === HeaderMotif.DarkText\n ? theme.colors.black\n : theme.colors.white};\n `}\n\n @media (hover: hover) and (pointer: fine) {\n &:focus-visible {\n color: ${theme.colors.primaryBlue};\n }\n }\n`;\n\nexport const ArrowDownIcon = styled(StyleableSvgImage)<{ $isOpen?: boolean }>`\n margin-right: 6px;\n transition: transform 0.2s linear;\n\n ${({ $isOpen }) =>\n $isOpen &&\n css`\n transform: rotate(180deg);\n `}\n`;\n\nexport const Item = styled.button`\n font-size: 14px;\n text-align: center;\n height: 100%;\n background: transparent;\n outline: none;\n border: none;\n padding: 0;\n cursor: pointer;\n\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const RightWrap = styled.div`\n display: flex;\n align-items: center;\n gap: 10.5px;\n`;\n\nexport const ActionIcon = styled.div<{ $motif: HeaderMotif }>`\n cursor: pointer;\n color: ${theme.colors.white};\n ${withCssTransition([\"color\"])};\n\n ${({ $motif }) =>\n $motif === HeaderMotif.DarkText &&\n css`\n color: #212327;\n `}\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n .header-icon {\n width: 21px;\n height: 25px;\n }\n }\n`;\n\nexport const RightItem = styled.a<{\n $active?: boolean;\n $motif: HeaderMotif;\n $withMarginRight?: boolean;\n}>`\n font-size: 14px;\n text-align: center;\n height: 100%;\n\n cursor: pointer;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: ${theme.colors.white};\n ${withCssTransition([\"color\"])};\n\n @media (hover: hover) {\n :hover {\n color: ${theme.colors.primaryBlue};\n }\n }\n\n ${({ $motif }) =>\n $motif === HeaderMotif.DarkText &&\n css`\n color: #212327;\n\n @media (hover: hover) {\n &:hover {\n color: ${theme.colors.primaryBlue};\n }\n }\n `}\n\n ${({ $withMarginRight }) =>\n $withMarginRight &&\n css`\n margin-right: 4px;\n `}\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n display: none;\n }\n`;\n\nexport const ModalWrap = styled(Container)`\n flex: 0;\n margin: 0 auto;\n position: absolute;\n z-index: ${theme.zIndex.header - 1};\n /* replace with theme of motif? */\n background-color: white;\n`;\n\nexport const ModalMenuWrap = styled(Container)<{ $activeModal?: boolean }>`\n padding: 0 0 24px;\n max-width: 100%;\n margin: 24px auto;\n`;\n\nexport const OverflowWrapper = styled.div`\n flex: 1;\n overflow-y: auto;\n padding: 16px 16px 48px;\n background-color: ${theme.colors.white};\n /* Safari view height changes depending on user interaction and url bar */\n height: calc(var(--vh, 1vh) * 100);\n &::-webkit-scrollbar {\n /* @TODO should hide scrollbar? test outside of storybook */\n display: none;\n }\n`;\n\nexport const ModalMenuInnerWrap = styled.div<{\n $modal: ModalId;\n}>`\n top: 24px;\n z-index: ${theme.zIndex.modal};\n width: 100%;\n height: 100vh;\n\n ${({ $modal }) => {\n return (\n $modal === ModalId.MobileMenu &&\n css`\n margin: 0 auto;\n `\n );\n }}\n`;\n\nexport const ModalInnerWrap = styled.div<{\n $modal: ModalId;\n}>`\n position: absolute;\n top: 34px;\n z-index: ${theme.zIndex.modal};\n height: 100vh;\n\n ${({ $modal }) => {\n return (\n $modal === ModalId.Account &&\n css`\n right: 32px;\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n right: 10px;\n }\n `\n );\n }}\n`;\n\nexport const Divider = styled.div`\n width: 1px;\n height: 22px;\n background: rgb(0 0 0 / 0.15);\n margin: 0 8px 0 9px;\n`;\n\nexport const InnerWrap = styled.div<{ $motif: HeaderMotif }>`\n align-items: center;\n display: flex;\n height: ${FIRST_LEVEL_MENU_HEIGHT}px;\n justify-content: space-between;\n max-width: 1200px;\n width: 100vw;\n\n ${ItemLabel}, ${LogoAnchor}, ${ActionIcon}, ${RightItem}, ${MenuButtonWrap}, ${Divider} {\n z-index: ${theme.zIndex.header} !important;\n }\n\n .hamburger-icon {\n ${withCssTransition([\"color\"])};\n color: ${theme.colors.white};\n\n ${({ $motif }) =>\n $motif === HeaderMotif.DarkText &&\n css`\n color: #212327;\n `}\n }\n`;\n\nexport const TransparentButton = styled.button<{\n $shouldHideOnDesktop?: boolean;\n}>`\n background: transparent;\n outline: none;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n height: 100%;\n\n ${({ $shouldHideOnDesktop }) =>\n $shouldHideOnDesktop &&\n css`\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_UP} {\n display: none;\n }\n `}\n`;\n"],"names":["FIRST_LEVEL_MENU_HEIGHT","ANIMATION_TRANSITION","addOpacity","keyframes","removeOverflowHidden","removeZeroHeight","Content","styled","div","theme","zIndex","modal","ContentContainer","header","colors","white","$isCollapsed","css","StyledContainer","Wrap","nav","$shouldAnimateBackground","withCssTransition","$hasWhiteBackground","BREAKPOINTS","TOP_NAV_MOBILE_AND_DOWN","$isActive","LeftWrap","LogoAnchor","a","menu","active","$motif","HeaderMotif","LightText","black","ItemsWrap","ItemLabel","span","DarkText","primaryBlue","$active","$isStartItem","$isHovered","$menuIsClosed","ArrowDownIcon","StyleableSvgImage","$isOpen","Item","button","RightWrap","ActionIcon","RightItem","$withMarginRight","ModalWrap","Container","ModalMenuWrap","OverflowWrapper","ModalMenuInnerWrap","$modal","ModalId","MobileMenu","ModalInnerWrap","Account","Divider","InnerWrap","MenuButtonWrap","TransparentButton","$shouldHideOnDesktop","TOP_NAV_MOBILE_UP"],"mappings":";;;;;;;;;;;;AAWA,MAAMA,uBAA0B,GAAA,EAAA;AACzB,MAAMC,oBAAuB,GAAA,GAAA;AAEpC,MAAMC,UAAa,GAAAC,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAWnB,MAAMC,oBAAuB,GAAAD,SAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAK7B,MAAME,gBAAmB,GAAAF,SAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAKlB,MAAMG,UAAUC,MAAO,CAAAC,GAAA;AAAA;AAAA,aAEjBC,KAAA,CAAMC,OAAOC,KAAK;AAAA;AAAA,CAAA;AAIxB,MAAMC,mBAAmBL,MAAO,CAAAC,GAAA;AAAA,mCACJP,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAM1CQ,KAAA,CAAMC,MAAO,CAAAG,MAAA,GAAS,CAAC;AAAA,sBACdJ,KAAA,CAAMK,OAAOC,KAAK;AAAA;AAAA;AAAA;;AAAA,IAKpC,CAAC;EAAEC;CAAa,KAChBA,YACA,IAAAC,GAAA;AAAA;AAAA;;AAAA,QAIIX,OAAO;AAAA;AAAA;AAAA;AAAA,KAIV;;AAAA,IAED,CAAC;EAAEU;CAAa,KAChB,CAACA,YACD,IAAAC,GAAA;AAAA,QACIX,OAAO;AAAA;AAAA;AAAA,YAGHL,oBAAoB,KAAKG,oBAAoB;AAAA,YAC7CH,oBAAoB,KAAKC,UAAU;AAAA,YACnCD,oBAAoB,KAAKI,gBAAgB;AAAA;AAAA,KAEhD;AAAA,CAAA;AAGE,MAAMa,kBAAkBX,MAAO,CAAAM,MAAA;AAAA;AA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AAKF,OAAO;AAAA,eACzEvD,KAAA,CAAMC,OAAOG,MAAM;AAAA;;AAAA;AAAA,MAI5BS,iBAAkB,CAAA,CAAC,OAAO,CAAC,CAAC;AAAA,aACrBb,KAAA,CAAMK,OAAOC,KAAK;;AAAA,MAEzB,CAAC;EAAEiB;AACH,CAAA,KAAAA,MAAA,KAAWC,YAAYM,QACvB,IAAAtB,GAAA;AAAA;AAAA,OAEC;AAAA;AAAA,CAAA;AAIA,MAAMkD,oBAAoB5D,MAAO,CAAA0C,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA,IAapC,CAAC;EAAEmB;CAAqB,KACxBA,oBACA,IAAAnD,GAAA;AAAA,eACWO,YAAY6C,iBAAiB;AAAA;AAAA;AAAA,KAGvC;AAAA,CAAA;"}
1
+ {"version":3,"file":"HeaderContent.styles.mjs","sources":["../../../../../src/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.tsx"],"sourcesContent":["import styled, { createGlobalStyle, css, keyframes } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../../constants/layout\";\nimport { theme } from \"../../../../constants/theme\";\nimport { ModalId } from \"../../../../contexts/MicrositeMenuContext/types\";\nimport { Container } from \"../../../Container\";\nimport { MenuButtonWrap } from \"../../../Header/MenuItem/MenuItem.styles\";\nimport { StyleableSvgImage } from \"../../../StyleableSvgImage\";\nimport { withCssTransition } from \"../DropdownMenu/DropdownMenu.styles\";\nimport { HeaderMotif } from \"./HeaderContent.types\";\n\nconst FIRST_LEVEL_MENU_HEIGHT = 48;\nexport const ANIMATION_TRANSITION = 0.3;\n\nconst addOpacity = keyframes`\n 0%{\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100%{\n opacity: 1;\n }\n`;\n\nconst removeOverflowHidden = keyframes`\n100% {\n overflow: unset;\n }\n`;\n\nconst removeZeroHeight = keyframes`\n 100% {\n max-height: 100%;\n }\n`;\n\nexport const StableGutterGlobalStyles = createGlobalStyle`\n html {\n scrollbar-gutter: stable;\n }\n`;\n\nexport const Content = styled.div`\n position: absolute;\n z-index: ${theme.zIndex.modal};\n width: 100%;\n`;\n\nexport const ContentContainer = styled.div<{ $isCollapsed: boolean }>`\n transition: grid-template-rows ${ANIMATION_TRANSITION}s;\n display: grid;\n grid-template-rows: 1fr;\n flex: 0;\n margin: 0 auto;\n position: absolute;\n z-index: ${theme.zIndex.header - 1};\n background-color: ${theme.colors.white};\n width: 100%;\n padding: 0;\n max-width: 100%;\n\n ${({ $isCollapsed }) =>\n $isCollapsed &&\n css`\n grid-template-rows: 0fr;\n opacity: 0;\n\n ${Content} {\n overflow: hidden;\n max-height: 0;\n }\n `}\n\n ${({ $isCollapsed }) =>\n !$isCollapsed &&\n css`\n ${Content} {\n overflow: hidden;\n animation:\n ${ANIMATION_TRANSITION}s ${removeOverflowHidden} linear forwards,\n ${ANIMATION_TRANSITION}s ${addOpacity} ease-in-out forwards,\n ${ANIMATION_TRANSITION}s ${removeZeroHeight} ease-in-out forwards;\n }\n `}\n`;\n\nexport const StyledContainer = styled.header`\n width: 100%;\n position: absolute;\n padding-bottom: 48px;\n top: env(safe-area-inset-top);\n\n *:focus,\n * {\n outline: none !important;\n }\n`;\n\nexport const Wrap = styled.nav<{\n $isLastMenu: boolean;\n $hasWhiteBackground: boolean;\n $transitionFade: boolean;\n $isActive?: boolean;\n $shouldAnimateBackground?: boolean;\n}>`\n ${({ $shouldAnimateBackground }) =>\n $shouldAnimateBackground && withCssTransition([\"background\"])}\n\n align-items: center;\n height: ${FIRST_LEVEL_MENU_HEIGHT}px;\n display: flex;\n justify-content: center;\n position: fixed;\n padding: 0 16px;\n top: env(safe-area-inset-top);\n width: 100%;\n\n ${({ $hasWhiteBackground }) =>\n $hasWhiteBackground &&\n css`\n box-shadow: 0 -1px 0 0 rgb(0 0 0 / 0.05) inset;\n background-color: ${theme.colors.white} !important;\n `}\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n ${({ $isActive }) =>\n $isActive &&\n css`\n box-shadow: 0 -1px 0 0 rgb(0 0 0 / 0.05) inset;\n `}\n }\n`;\n\nexport const LeftWrap = styled.div`\n align-items: center;\n display: flex;\n gap: 5px;\n height: 100%;\n`;\n\nexport const LogoAnchor = styled.a<{ $motif: HeaderMotif }>`\n -webkit-tap-highlight-color: transparent;\n\n @media (hover: hover) {\n &:hover {\n color: ${theme.colors.menu.active[\"light\"]};\n ${withCssTransition([\"color\"])};\n }\n }\n\n color: ${({ $motif }) =>\n $motif === HeaderMotif.LightText ? theme.colors.white : theme.colors.black};\n outline: none;\n\n &:active,\n &:focus {\n color: ${({ $motif }) =>\n $motif === HeaderMotif.LightText\n ? theme.colors.white\n : theme.colors.black};\n }\n\n @media (hover: none) {\n &:focus,\n &:active {\n box-shadow: none;\n background: inherit;\n color: ${theme.colors.black};\n }\n }\n\n margin-right: 35px;\n height: 100%;\n display: flex;\n align-items: center;\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n transform: translateX(100%);\n margin-right: 0;\n }\n`;\n\nexport const ItemsWrap = styled.nav`\n display: flex;\n align-items: center;\n gap: 2px;\n height: 100%;\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n display: none;\n }\n`;\n\nexport const ItemLabel = styled.span<{\n $active: boolean;\n $isStartItem?: boolean;\n $isHovered?: boolean;\n $motif: HeaderMotif;\n $menuIsClosed: boolean;\n}>`\n display: flex;\n align-items: center;\n gap: 7.5px;\n color: ${theme.colors.white};\n border-radius: 6px;\n padding: 7px 10px;\n\n ${withCssTransition([\"color\", \"background\"])};\n\n @media (hover: hover) {\n &:hover {\n background: rgb(244 245 246 / 0.2);\n color: ${theme.colors.white};\n }\n }\n\n ${({ $motif }) =>\n $motif === HeaderMotif.DarkText &&\n css`\n color: #212327;\n `}\n @media (hover: hover) {\n &:hover {\n color: ${theme.colors.primaryBlue};\n }\n }\n\n ${({ $active, $motif }) =>\n $active &&\n css`\n color: ${$motif === HeaderMotif.DarkText\n ? theme.colors.primaryBlue\n : theme.colors.white};\n background: ${$motif === HeaderMotif.DarkText\n ? \"#f4f5f6\"\n : \"rgba(244, 245, 246, 0.2)\"};\n `}\n\n ${({ $isStartItem }) =>\n $isStartItem &&\n css`\n background: transparent !important;\n padding: 7px 0;\n `}\n\n ${({ $isHovered }) =>\n $isHovered &&\n css`\n background: transparent !important;\n color: ${theme.colors.primaryBlue};\n `}\n\n ${({ $menuIsClosed, $motif }) =>\n $menuIsClosed &&\n css`\n color: ${$motif === HeaderMotif.DarkText\n ? theme.colors.black\n : theme.colors.white};\n `}\n\n &:focus {\n color: ${theme.colors.primaryBlue};\n }\n`;\n\nexport const ArrowDownIcon = styled(StyleableSvgImage)<{ $isOpen?: boolean }>`\n margin-right: 6px;\n transition: transform 0.2s linear;\n\n ${({ $isOpen }) =>\n $isOpen &&\n css`\n transform: rotate(180deg);\n `}\n`;\n\nexport const Item = styled.button`\n font-size: 14px;\n text-align: center;\n height: 100%;\n background: transparent;\n outline: none;\n border: none;\n padding: 0;\n cursor: pointer;\n\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const RightWrap = styled.div`\n display: flex;\n align-items: center;\n gap: 10.5px;\n`;\n\nexport const ActionIcon = styled.div<{ $motif: HeaderMotif }>`\n cursor: pointer;\n color: ${theme.colors.white};\n ${withCssTransition([\"color\"])};\n\n ${({ $motif }) =>\n $motif === HeaderMotif.DarkText &&\n css`\n color: #212327;\n `}\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n .header-icon {\n width: 21px;\n height: 25px;\n }\n }\n`;\n\nexport const RightItem = styled.a<{\n $active?: boolean;\n $motif: HeaderMotif;\n $withMarginRight?: boolean;\n}>`\n font-size: 14px;\n text-align: center;\n height: 100%;\n\n cursor: pointer;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: ${theme.colors.white};\n ${withCssTransition([\"color\"])};\n\n @media (hover: hover) {\n :hover {\n color: ${theme.colors.primaryBlue};\n }\n }\n\n ${({ $motif }) =>\n $motif === HeaderMotif.DarkText &&\n css`\n color: #212327;\n\n @media (hover: hover) {\n &:hover {\n color: ${theme.colors.primaryBlue};\n }\n }\n `}\n\n @media (hover: hover) and (pointer: fine) {\n &:focus-visible {\n color: ${theme.colors.primaryBlue};\n }\n }\n\n ${({ $withMarginRight }) =>\n $withMarginRight &&\n css`\n margin-right: 4px;\n `}\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n display: none;\n }\n`;\n\nexport const ModalWrap = styled(Container)`\n flex: 0;\n margin: 0 auto;\n position: absolute;\n z-index: ${theme.zIndex.header - 1};\n /* replace with theme of motif? */\n background-color: white;\n`;\n\nexport const ModalMenuWrap = styled(Container)<{ $activeModal?: boolean }>`\n padding: 0 0 24px;\n max-width: 100%;\n margin: 24px auto;\n`;\n\nexport const OverflowWrapper = styled.div`\n flex: 1;\n overflow-y: auto;\n padding: 16px 16px 48px;\n background-color: ${theme.colors.white};\n /* Safari view height changes depending on user interaction and url bar */\n height: calc(var(--vh, 1vh) * 100);\n &::-webkit-scrollbar {\n /* @TODO should hide scrollbar? test outside of storybook */\n display: none;\n }\n`;\n\nexport const ModalMenuInnerWrap = styled.div<{\n $modal: ModalId;\n}>`\n top: 24px;\n z-index: ${theme.zIndex.modal};\n width: 100%;\n height: 100vh;\n\n ${({ $modal }) => {\n return (\n $modal === ModalId.MobileMenu &&\n css`\n margin: 0 auto;\n `\n );\n }}\n`;\n\nexport const ModalInnerWrap = styled.div<{\n $modal: ModalId;\n}>`\n position: absolute;\n top: 34px;\n z-index: ${theme.zIndex.modal};\n height: 100vh;\n\n ${({ $modal }) => {\n return (\n $modal === ModalId.Account &&\n css`\n right: 32px;\n\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n right: 10px;\n }\n `\n );\n }}\n`;\n\nexport const Divider = styled.div`\n width: 1px;\n height: 22px;\n background: rgb(0 0 0 / 0.15);\n margin: 0 8px 0 9px;\n`;\n\nexport const InnerWrap = styled.div<{ $motif: HeaderMotif }>`\n align-items: center;\n display: flex;\n height: ${FIRST_LEVEL_MENU_HEIGHT}px;\n justify-content: space-between;\n max-width: 1200px;\n width: 100vw;\n\n ${ItemLabel}, ${LogoAnchor}, ${ActionIcon}, ${RightItem}, ${MenuButtonWrap}, ${Divider} {\n z-index: ${theme.zIndex.header} !important;\n }\n\n .hamburger-icon {\n ${withCssTransition([\"color\"])};\n color: ${theme.colors.white};\n\n ${({ $motif }) =>\n $motif === HeaderMotif.DarkText &&\n css`\n color: #212327;\n `}\n }\n`;\n\nexport const TransparentButton = styled.button<{\n $shouldHideOnDesktop?: boolean;\n}>`\n background: transparent;\n outline: none;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n height: 100%;\n\n ${({ $shouldHideOnDesktop }) =>\n $shouldHideOnDesktop &&\n css`\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_UP} {\n display: none;\n }\n `}\n`;\n"],"names":["FIRST_LEVEL_MENU_HEIGHT","ANIMATION_TRANSITION","addOpacity","keyframes","removeOverflowHidden","removeZeroHeight","StableGutterGlobalStyles","createGlobalStyle","Content","styled","div","theme","zIndex","modal","ContentContainer","header","colors","white","$isCollapsed","css","StyledContainer","Wrap","nav","$shouldAnimateBackground","withCssTransition","$hasWhiteBackground","BREAKPOINTS","TOP_NAV_MOBILE_AND_DOWN","$isActive","LeftWrap","LogoAnchor","a","menu","active","$motif","HeaderMotif","LightText","black","ItemsWrap","ItemLabel","span","DarkText","primaryBlue","$active","$isStartItem","$isHovered","$menuIsClosed","ArrowDownIcon","StyleableSvgImage","$isOpen","Item","button","RightWrap","ActionIcon","RightItem","$withMarginRight","ModalWrap","Container","ModalMenuWrap","OverflowWrapper","ModalMenuInnerWrap","$modal","ModalId","MobileMenu","ModalInnerWrap","Account","Divider","InnerWrap","MenuButtonWrap","TransparentButton","$shouldHideOnDesktop","TOP_NAV_MOBILE_UP"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OAAOG,MAAM;AAAA;;AAAA;AAAA,MAI5BS,iBAAkB,CAAA,CAAC,OAAO,CAAC,CAAC;AAAA,aACrBb,KAAA,CAAMK,OAAOC,KAAK;;AAAA,MAEzB,CAAC;EAAEiB;AACH,CAAA,KAAAA,MAAA,KAAWC,YAAYM,QACvB,IAAAtB,GAAA;AAAA;AAAA,OAEC;AAAA;AAAA,CAAA;AAIA,MAAMkD,oBAAoB5D,MAAO,CAAA0C,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA,IAapC,CAAC;EAAEmB;CAAqB,KACxBA,oBACA,IAAAnD,GAAA;AAAA,eACWO,YAAY6C,iBAAiB;AAAA;AAAA;AAAA,KAGvC;AAAA,CAAA;"}
@@ -1,14 +1,14 @@
1
1
  import type { Dispatch, SetStateAction } from "react";
2
2
  import type { ParsedMicrositeHeaderItem } from "../../../../../../contexts/MicrositeMenuContext/types";
3
3
  import type { HeaderMotif } from "../../HeaderContent.types";
4
- export declare const NavigationItem: ({ item, motif, isActive, onMouseEnter, onClick, onTouchStart, onTouchEnd, menuIsClosed, setSelectedMenu, }: {
4
+ export declare const NavigationItem: ({ item, motif, isActive, onMouseEnter, setSelectedMenu, onClick, onTouchStart, onTouchEnd, menuIsClosed, }: {
5
5
  item: ParsedMicrositeHeaderItem;
6
6
  isActive: boolean;
7
7
  motif: HeaderMotif;
8
+ setSelectedMenu: Dispatch<SetStateAction<ParsedMicrositeHeaderItem | null>>;
8
9
  onClick: (event: React.MouseEvent<HTMLElement>) => void;
9
10
  onTouchStart: () => void;
10
11
  onTouchEnd: () => void;
11
12
  onMouseEnter: () => void;
12
13
  menuIsClosed: boolean;
13
- setSelectedMenu: Dispatch<SetStateAction<ParsedMicrositeHeaderItem | null>>;
14
14
  }) => JSX.Element;
@@ -21,11 +21,11 @@ const NavigationItem = ({
21
21
  motif,
22
22
  isActive,
23
23
  onMouseEnter,
24
+ setSelectedMenu,
24
25
  onClick,
25
26
  onTouchStart,
26
27
  onTouchEnd,
27
- menuIsClosed,
28
- setSelectedMenu
28
+ menuIsClosed
29
29
  }) => {
30
30
  const {
31
31
  language
@@ -38,6 +38,9 @@ const NavigationItem = ({
38
38
  onTouchStart,
39
39
  onTouchEnd,
40
40
  onClick,
41
+ onKeyDown: utils.handleKeyboardActivation(() => {
42
+ onMouseEnter?.();
43
+ }),
41
44
  children: [/* @__PURE__ */jsxRuntime.jsxs(HeaderContent_styles.ItemLabel, {
42
45
  tabIndex: 0,
43
46
  role: "button",
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationItem.js","sources":["../../../../../../../src/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from \"react\";\n\nimport ArrowDownIcon from \"../../../../../../assets/icons/arrowDown.svg\";\nimport { handleKeyboardActivation } from \"../../../../../../contexts/MenuContext/utils\";\nimport { useMicrositeMenu } from \"../../../../../../contexts/MicrositeMenuContext\";\nimport { START_HERE_ID } from \"../../../../../../contexts/MicrositeMenuContext/mapping\";\nimport { useMicrositeMenuTranslations } from \"../../../../../../contexts/MicrositeMenuContext/translations\";\nimport type { ParsedMicrositeHeaderItem } from \"../../../../../../contexts/MicrositeMenuContext/types\";\nimport * as S from \"../../HeaderContent.styles\";\nimport type { HeaderMotif } from \"../../HeaderContent.types\";\n\n// TODO: FIX TYPE CASTING\nexport const NavigationItem = ({\n item,\n motif,\n isActive,\n onMouseEnter,\n onClick,\n onTouchStart,\n onTouchEnd,\n menuIsClosed,\n setSelectedMenu,\n}: {\n item: ParsedMicrositeHeaderItem;\n isActive: boolean;\n motif: HeaderMotif;\n onClick: (event: React.MouseEvent<HTMLElement>) => void;\n onTouchStart: () => void;\n onTouchEnd: () => void;\n onMouseEnter: () => void;\n menuIsClosed: boolean;\n setSelectedMenu: Dispatch<SetStateAction<ParsedMicrositeHeaderItem | null>>;\n}) => {\n const { language } = useMicrositeMenu();\n const { formatMessage } = useMicrositeMenuTranslations(language);\n\n return (\n <S.Item\n onMouseEnter={onMouseEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onClick={onClick}\n >\n <S.ItemLabel\n tabIndex={0}\n role=\"button\"\n onKeyDown={handleKeyboardActivation(() => {\n return !isActive ? setSelectedMenu?.(item) : setSelectedMenu(null);\n })}\n $active={item?.active}\n $isHovered={isActive && !item?.active}\n $motif={motif}\n $isStartItem={item?.id === START_HERE_ID}\n $menuIsClosed={menuIsClosed}\n >\n {formatMessage(item.label)}\n\n {item.variant === \"dropdown\" && (\n <S.ArrowDownIcon\n src={ArrowDownIcon}\n height={4.5}\n width={9}\n $isOpen={isActive}\n />\n )}\n </S.ItemLabel>\n\n {item?.id === START_HERE_ID && <S.Divider />}\n </S.Item>\n );\n};\n"],"names":["NavigationItem","item","motif","isActive","onMouseEnter","onClick","onTouchStart","onTouchEnd","menuIsClosed","setSelectedMenu","language","useMicrositeMenu","formatMessage","useMicrositeMenuTranslations","jsxs","S.Item","Item","children","S.ItemLabel","ItemLabel","tabIndex","role","onKeyDown","handleKeyboardActivation","$active","active","$isHovered","$motif","$isStartItem","id","START_HERE_ID","$menuIsClosed","label","variant","jsx","S.ArrowDownIcon","ArrowDownIcon","src","height","width","$isOpen","S.Divider"],"mappings":";;;;;;;;;;;;;;;;;;AAYO,MAAMA,iBAAiBA,CAAC;EAC7BC,IAAA;EACAC,KAAA;EACAC,QAAA;EACAC,YAAA;EACAC,OAAA;EACAC,YAAA;EACAC,UAAA;EACAC,YAAA;EACAC;AACF,CAUM,KAAA;EACE,MAAA;IAAEC;EAAS,CAAA,GAAIC,wBAAiB,CAAA,CAAA;EACtC,MAAM;IAAEC;EAAA,CAAkB,GAAAC,YAAA,CAAAA,4BAAA,CAA6BH,QAAQ,CAAA;EAG7D,sBAAAI,UAAA,CAAAA,IAAA,CAACC,oBAAE,CAAAC,IAAA,EAAF;IACCZ,YAAA;IACAE,YAAA;IACAC,UAAA;IACAF,OAAA;IAEAY,QAAA,EAAA,CAAA,eAAAH,UAAA,CAAAA,IAAA,CAACI,oBAAE,CAAAC,SAAA,EAAF;MACCC,QAAU,EAAA,CAAA;MACVC,IAAK,EAAA,QAAA;MACLC,SAAA,EAAWC,+BAAyB,MAAM;QACxC,OAAO,CAACpB,QAAW,GAAAM,eAAA,GAAkBR,IAAI,CAAA,GAAIQ,gBAAgB,IAAI,CAAA;MAAA,CAClE,CAAA;MACDe,SAASvB,IAAM,EAAAwB,MAAA;MACfC,UAAA,EAAYvB,QAAY,IAAA,CAACF,IAAM,EAAAwB,MAAA;MAC/BE,MAAQ,EAAAzB,KAAA;MACR0B,YAAA,EAAc3B,MAAM4B,EAAO,KAAAC,OAAA,CAAAA,aAAA;MAC3BC,aAAe,EAAAvB,YAAA;MAEdS,QAAA,EAAA,CAAAL,aAAA,CAAcX,KAAK+B,KAAK,CAAA,EAExB/B,IAAA,CAAKgC,YAAY,UAChB,mBAAAC,UAAA,CAAAA,GAAA,CAACC,oBAAE,CAAAC,aAAA,EAAF;QACCC,GAAK,EAAAD,sBAAA,CAAA,SAAA,CAAA;QACLE,MAAQ,EAAA,GAAA;QACRC,KAAO,EAAA,CAAA;QACPC,OAAS,EAAArC;MAAA,CAAA,CAAA;IACX,CAEJ,CAAA,EAECF,MAAM4B,EAAO,KAAAC,OAAAA,CAAAA,aAAA,mBAAkBI,UAAA,CAAAA,GAAA,CAAAO,8BAAA,CAAU,CAAA,CAAA;EAAA,CAC5C,CAAA;AAEJ,CAAA;"}
1
+ {"version":3,"file":"NavigationItem.js","sources":["../../../../../../../src/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from \"react\";\n\nimport ArrowDownIcon from \"../../../../../../assets/icons/arrowDown.svg\";\nimport { handleKeyboardActivation } from \"../../../../../../contexts/MenuContext/utils\";\nimport { useMicrositeMenu } from \"../../../../../../contexts/MicrositeMenuContext\";\nimport { START_HERE_ID } from \"../../../../../../contexts/MicrositeMenuContext/mapping\";\nimport { useMicrositeMenuTranslations } from \"../../../../../../contexts/MicrositeMenuContext/translations\";\nimport type { ParsedMicrositeHeaderItem } from \"../../../../../../contexts/MicrositeMenuContext/types\";\nimport * as S from \"../../HeaderContent.styles\";\nimport type { HeaderMotif } from \"../../HeaderContent.types\";\n\n// TODO: FIX TYPE CASTING\nexport const NavigationItem = ({\n item,\n motif,\n isActive,\n onMouseEnter,\n setSelectedMenu,\n onClick,\n onTouchStart,\n onTouchEnd,\n menuIsClosed,\n}: {\n item: ParsedMicrositeHeaderItem;\n isActive: boolean;\n motif: HeaderMotif;\n setSelectedMenu: Dispatch<SetStateAction<ParsedMicrositeHeaderItem | null>>;\n onClick: (event: React.MouseEvent<HTMLElement>) => void;\n onTouchStart: () => void;\n onTouchEnd: () => void;\n onMouseEnter: () => void;\n menuIsClosed: boolean;\n}) => {\n const { language } = useMicrositeMenu();\n const { formatMessage } = useMicrositeMenuTranslations(language);\n\n return (\n <S.Item\n onMouseEnter={onMouseEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onClick={onClick}\n onKeyDown={handleKeyboardActivation(() => {\n onMouseEnter?.();\n })}\n >\n <S.ItemLabel\n tabIndex={0}\n role=\"button\"\n onKeyDown={handleKeyboardActivation(() => {\n return !isActive ? setSelectedMenu?.(item) : setSelectedMenu(null);\n })}\n $active={item?.active}\n $isHovered={isActive && !item?.active}\n $motif={motif}\n $isStartItem={item?.id === START_HERE_ID}\n $menuIsClosed={menuIsClosed}\n >\n {formatMessage(item.label)}\n\n {item.variant === \"dropdown\" && (\n <S.ArrowDownIcon\n src={ArrowDownIcon}\n height={4.5}\n width={9}\n $isOpen={isActive}\n />\n )}\n </S.ItemLabel>\n\n {item?.id === START_HERE_ID && <S.Divider />}\n </S.Item>\n );\n};\n"],"names":["NavigationItem","item","motif","isActive","onMouseEnter","setSelectedMenu","onClick","onTouchStart","onTouchEnd","menuIsClosed","language","useMicrositeMenu","formatMessage","useMicrositeMenuTranslations","jsxs","S.Item","Item","onKeyDown","handleKeyboardActivation","children","S.ItemLabel","ItemLabel","tabIndex","role","$active","active","$isHovered","$motif","$isStartItem","id","START_HERE_ID","$menuIsClosed","label","variant","jsx","S.ArrowDownIcon","ArrowDownIcon","src","height","width","$isOpen","S.Divider"],"mappings":";;;;;;;;;;;;;;;;;;AAYO,MAAMA,iBAAiBA,CAAC;EAC7BC,IAAA;EACAC,KAAA;EACAC,QAAA;EACAC,YAAA;EACAC,eAAA;EACAC,OAAA;EACAC,YAAA;EACAC,UAAA;EACAC;AACF,CAUM,KAAA;EACE,MAAA;IAAEC;EAAS,CAAA,GAAIC,wBAAiB,CAAA,CAAA;EACtC,MAAM;IAAEC;EAAA,CAAkB,GAAAC,YAAA,CAAAA,4BAAA,CAA6BH,QAAQ,CAAA;EAG7D,sBAAAI,UAAA,CAAAA,IAAA,CAACC,oBAAE,CAAAC,IAAA,EAAF;IACCZ,YAAA;IACAG,YAAA;IACAC,UAAA;IACAF,OAAA;IACAW,SAAA,EAAWC,+BAAyB,MAAM;MACzBd,YAAA,GAAA,CAAA;IAAA,CAChB,CAAA;IAEDe,QAAA,EAAA,CAAA,eAAAL,UAAA,CAAAA,IAAA,CAACM,oBAAE,CAAAC,SAAA,EAAF;MACCC,QAAU,EAAA,CAAA;MACVC,IAAK,EAAA,QAAA;MACLN,SAAA,EAAWC,+BAAyB,MAAM;QACxC,OAAO,CAACf,QAAW,GAAAE,eAAA,GAAkBJ,IAAI,CAAA,GAAII,gBAAgB,IAAI,CAAA;MAAA,CAClE,CAAA;MACDmB,SAASvB,IAAM,EAAAwB,MAAA;MACfC,UAAA,EAAYvB,QAAY,IAAA,CAACF,IAAM,EAAAwB,MAAA;MAC/BE,MAAQ,EAAAzB,KAAA;MACR0B,YAAA,EAAc3B,MAAM4B,EAAO,KAAAC,OAAA,CAAAA,aAAA;MAC3BC,aAAe,EAAAtB,YAAA;MAEdU,QAAA,EAAA,CAAAP,aAAA,CAAcX,KAAK+B,KAAK,CAAA,EAExB/B,IAAA,CAAKgC,YAAY,UAChB,mBAAAC,UAAA,CAAAA,GAAA,CAACC,oBAAE,CAAAC,aAAA,EAAF;QACCC,GAAK,EAAAD,sBAAA,CAAA,SAAA,CAAA;QACLE,MAAQ,EAAA,GAAA;QACRC,KAAO,EAAA,CAAA;QACPC,OAAS,EAAArC;MAAA,CAAA,CAAA;IACX,CAEJ,CAAA,EAECF,MAAM4B,EAAO,KAAAC,OAAAA,CAAAA,aAAA,mBAAkBI,UAAA,CAAAA,GAAA,CAAAO,8BAAA,CAAU,CAAA,CAAA;EAAA,CAC5C,CAAA;AAEJ,CAAA;"}
@@ -13,11 +13,11 @@ const NavigationItem = ({
13
13
  motif,
14
14
  isActive,
15
15
  onMouseEnter,
16
+ setSelectedMenu,
16
17
  onClick,
17
18
  onTouchStart,
18
19
  onTouchEnd,
19
- menuIsClosed,
20
- setSelectedMenu
20
+ menuIsClosed
21
21
  }) => {
22
22
  const {
23
23
  language
@@ -30,6 +30,9 @@ const NavigationItem = ({
30
30
  onTouchStart,
31
31
  onTouchEnd,
32
32
  onClick,
33
+ onKeyDown: handleKeyboardActivation(() => {
34
+ onMouseEnter?.();
35
+ }),
33
36
  children: [/* @__PURE__ */jsxs(ItemLabel, {
34
37
  tabIndex: 0,
35
38
  role: "button",
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationItem.mjs","sources":["../../../../../../../src/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from \"react\";\n\nimport ArrowDownIcon from \"../../../../../../assets/icons/arrowDown.svg\";\nimport { handleKeyboardActivation } from \"../../../../../../contexts/MenuContext/utils\";\nimport { useMicrositeMenu } from \"../../../../../../contexts/MicrositeMenuContext\";\nimport { START_HERE_ID } from \"../../../../../../contexts/MicrositeMenuContext/mapping\";\nimport { useMicrositeMenuTranslations } from \"../../../../../../contexts/MicrositeMenuContext/translations\";\nimport type { ParsedMicrositeHeaderItem } from \"../../../../../../contexts/MicrositeMenuContext/types\";\nimport * as S from \"../../HeaderContent.styles\";\nimport type { HeaderMotif } from \"../../HeaderContent.types\";\n\n// TODO: FIX TYPE CASTING\nexport const NavigationItem = ({\n item,\n motif,\n isActive,\n onMouseEnter,\n onClick,\n onTouchStart,\n onTouchEnd,\n menuIsClosed,\n setSelectedMenu,\n}: {\n item: ParsedMicrositeHeaderItem;\n isActive: boolean;\n motif: HeaderMotif;\n onClick: (event: React.MouseEvent<HTMLElement>) => void;\n onTouchStart: () => void;\n onTouchEnd: () => void;\n onMouseEnter: () => void;\n menuIsClosed: boolean;\n setSelectedMenu: Dispatch<SetStateAction<ParsedMicrositeHeaderItem | null>>;\n}) => {\n const { language } = useMicrositeMenu();\n const { formatMessage } = useMicrositeMenuTranslations(language);\n\n return (\n <S.Item\n onMouseEnter={onMouseEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onClick={onClick}\n >\n <S.ItemLabel\n tabIndex={0}\n role=\"button\"\n onKeyDown={handleKeyboardActivation(() => {\n return !isActive ? setSelectedMenu?.(item) : setSelectedMenu(null);\n })}\n $active={item?.active}\n $isHovered={isActive && !item?.active}\n $motif={motif}\n $isStartItem={item?.id === START_HERE_ID}\n $menuIsClosed={menuIsClosed}\n >\n {formatMessage(item.label)}\n\n {item.variant === \"dropdown\" && (\n <S.ArrowDownIcon\n src={ArrowDownIcon}\n height={4.5}\n width={9}\n $isOpen={isActive}\n />\n )}\n </S.ItemLabel>\n\n {item?.id === START_HERE_ID && <S.Divider />}\n </S.Item>\n );\n};\n"],"names":["NavigationItem","item","motif","isActive","onMouseEnter","onClick","onTouchStart","onTouchEnd","menuIsClosed","setSelectedMenu","language","useMicrositeMenu","formatMessage","useMicrositeMenuTranslations","jsxs","S.Item","children","S.ItemLabel","tabIndex","role","onKeyDown","handleKeyboardActivation","$active","active","$isHovered","$motif","$isStartItem","id","START_HERE_ID","$menuIsClosed","label","variant","jsx","S.Arrow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EJ,CAAA;"}
1
+ {"version":3,"file":"NavigationItem.mjs","sources":["../../../../../../../src/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from \"react\";\n\nimport ArrowDownIcon from \"../../../../../../assets/icons/arrowDown.svg\";\nimport { handleKeyboardActivation } from \"../../../../../../contexts/MenuContext/utils\";\nimport { useMicrositeMenu } from \"../../../../../../contexts/MicrositeMenuContext\";\nimport { START_HERE_ID } from \"../../../../../../contexts/MicrositeMenuContext/mapping\";\nimport { useMicrositeMenuTranslations } from \"../../../../../../contexts/MicrositeMenuContext/translations\";\nimport type { ParsedMicrositeHeaderItem } from \"../../../../../../contexts/MicrositeMenuContext/types\";\nimport * as S from \"../../HeaderContent.styles\";\nimport type { HeaderMotif } from \"../../HeaderContent.types\";\n\n// TODO: FIX TYPE CASTING\nexport const NavigationItem = ({\n item,\n motif,\n isActive,\n onMouseEnter,\n setSelectedMenu,\n onClick,\n onTouchStart,\n onTouchEnd,\n menuIsClosed,\n}: {\n item: ParsedMicrositeHeaderItem;\n isActive: boolean;\n motif: HeaderMotif;\n setSelectedMenu: Dispatch<SetStateAction<ParsedMicrositeHeaderItem | null>>;\n onClick: (event: React.MouseEvent<HTMLElement>) => void;\n onTouchStart: () => void;\n onTouchEnd: () => void;\n onMouseEnter: () => void;\n menuIsClosed: boolean;\n}) => {\n const { language } = useMicrositeMenu();\n const { formatMessage } = useMicrositeMenuTranslations(language);\n\n return (\n <S.Item\n onMouseEnter={onMouseEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onClick={onClick}\n onKeyDown={handleKeyboardActivation(() => {\n onMouseEnter?.();\n })}\n >\n <S.ItemLabel\n tabIndex={0}\n role=\"button\"\n onKeyDown={handleKeyboardActivation(() => {\n return !isActive ? setSelectedMenu?.(item) : setSelectedMenu(null);\n })}\n $active={item?.active}\n $isHovered={isActive && !item?.active}\n $motif={motif}\n $isStartItem={item?.id === START_HERE_ID}\n $menuIsClosed={menuIsClosed}\n >\n {formatMessage(item.label)}\n\n {item.variant === \"dropdown\" && (\n <S.ArrowDownIcon\n src={ArrowDownIcon}\n height={4.5}\n width={9}\n $isOpen={isActive}\n />\n )}\n </S.ItemLabel>\n\n {item?.id === START_HERE_ID && <S.Divider />}\n </S.Item>\n );\n};\n"],"names":["NavigationItem","item","motif","isActive","onMouseEnter","setSelectedMenu","onClick","onTouchStart","onTouchEnd","menuIsClosed","language","useMicrositeMenu","formatMessage","useMicrositeMenuTranslations","jsxs","S.Item","onKeyDown","handleKeyboardActivation","children","S.ItemLabel","tabIndex","role","$active","active","$isHovered","$motif","$isStartItem","id","START_HERE_ID","$menuIsClosed","label","variant","jsx","S.ArrowDownIcon","src","ArrowDownIcon","height","width","$isOpen","S.Divider"],"mappings":";;;;;;;;;;AAYO,MAAMA,iBAAiBA,CAAC;EAC7BC,IAAA;EACAC,KAAA;EACAC,QAAA;EACAC,YAAA;EACAC,eAAA;EACAC,OAAA;EACAC,YAAA;EACAC,UAAA;EACAC;AACF,CAUM,KAAA;EACE,MAAA;IAAEC;EAAS,CAAA,GAAIC,gBAAiB,CAAA,CAAA;EACtC,MAAM;IAAEC;EAAA,CAAkB,GAAAC,4BAAA,CAA6BH,QAAQ,CAAA;EAG7D,sBAAAI,IAAA,CAACC,IAAE,EAAF;IACCX,YAAA;IACAG,YAAA;IACAC,UAAA;IACAF,OAAA;IACAU,SAAA,EAAWC,yBAAyB,MAAM;MACzBb,YAAA,GAAA,CAAA;IAAA,CAChB,CAAA;IAEDc,QAAA,EAAA,CAAA,eAAAJ,IAAA,CAACK,SAAE,EAAF;MACCC,QAAU,EAAA,CAAA;MACVC,IAAK,EAAA,QAAA;MACLL,SAAA,EAAWC,yBAAyB,MAAM;QACxC,OAAO,CAACd,QAAW,GAAAE,eAAA,GAAkBJ,IAAI,CAAA,GAAII,gBAAgB,IAAI,CAAA;MAAA,CAClE,CAAA;MACDiB,SAASrB,IAAM,EAAAsB,MAAA;MACfC,UAAA,EAAYrB,QAAY,IAAA,CAACF,IAAM,EAAAsB,MAAA;MAC/BE,MAAQ,EAAAvB,KAAA;MACRwB,YAAA,EAAczB,MAAM0B,EAAO,KAAAC,aAAA;MAC3BC,aAAe,EAAApB,YAAA;MAEdS,QAAA,EAAA,CAAAN,aAAA,CAAcX,KAAK6B,KAAK,CAAA,EAExB7B,IAAA,CAAK8B,YAAY,UAChB,mBAAAC,GAAA,CAACC,aAAE,EAAF;QACCC,GAAK,EAAAC,sBAAA;QACLC,MAAQ,EAAA,GAAA;QACRC,KAAO,EAAA,CAAA;QACPC,OAAS,EAAAnC;MAAA,CAAA,CAAA;IACX,CAEJ,CAAA,EAECF,MAAM0B,EAAO,KAAAC,aAAA,mBAAkBI,GAAA,CAAAO,SAAA,CAAU,CAAA,CAAA;EAAA,CAC5C,CAAA;AAEJ,CAAA;"}
@@ -72,6 +72,7 @@ const ProductList = ({
72
72
  setIsDragging(false);
73
73
  setEndPosition(containerRef.current?.scrollLeft);
74
74
  document.removeEventListener("mousemove", dragHandler);
75
+ document.removeEventListener("mouseup", mouseUpHandler);
75
76
  }, [dragHandler]);
76
77
  const mouseDownHandler = React.useCallback(event => {
77
78
  if (event.buttons === 1) {
@@ -81,16 +82,29 @@ const ProductList = ({
81
82
  document.addEventListener("mouseup", mouseUpHandler);
82
83
  }
83
84
  }, [dragHandler, mouseUpHandler]);
84
- reactUse.useEffectOnce(() => {
85
+ React.useEffect(() => {
86
+ const container = containerRef.current;
87
+ if (!container) return;
85
88
  let isScrolling;
86
- containerRef.current.addEventListener("scroll", function () {
89
+ const scrollHandler = () => {
87
90
  window.clearTimeout(isScrolling);
88
- isScrolling = setTimeout(function () {
91
+ isScrolling = setTimeout(() => {
89
92
  setPlayAnimation(true);
90
93
  setEndPosition(containerRef.current?.scrollLeft);
91
94
  }, checkForScrollTimeout);
92
- });
93
- });
95
+ };
96
+ container.addEventListener("scroll", scrollHandler);
97
+ return () => {
98
+ container.removeEventListener("scroll", scrollHandler);
99
+ window.clearTimeout(isScrolling);
100
+ };
101
+ }, []);
102
+ React.useEffect(() => {
103
+ return () => {
104
+ document.removeEventListener("mousemove", dragHandler);
105
+ document.removeEventListener("mouseup", mouseUpHandler);
106
+ };
107
+ }, [dragHandler, mouseUpHandler]);
94
108
  const tabClickHandler = React.useCallback(({
95
109
  groupId
96
110
  }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ProductList.js","sources":["../../../../src/components/ModelCompareV4/ProductList/ProductList.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useEffectOnce, useHoverDirty } from \"react-use\";\n\nimport type {\n ProductId,\n ProductListGroupId,\n} from \"../../../constants/modelCompareData/types\";\nimport { ButtonGroup } from \"./components/ButtonGroup\";\nimport { Product } from \"./components/Product/Product\";\nimport { groupProducts } from \"./components/ProductGroups/groupProducts\";\nimport { ProductGroups } from \"./components/ProductGroups/ProductGroups\";\nimport { ScrollButton } from \"./components/ScrollButton/ScrollButton\";\nimport * as S from \"./ProductList.styles\";\nimport type { ProductListProps } from \"./ProductList.types\";\nimport { useIsAtMaxScroll } from \"./useIsAtMaxScroll\";\n\nexport const ProductList = ({\n products,\n selectedProducts,\n setSelectedProducts,\n hasBeenObserved,\n selectedProductsLimit,\n initialActiveGroup,\n setExternalState,\n showProductGroups,\n isOverviewPage,\n}: ProductListProps) => {\n const groupedGroups = groupProducts(products);\n const moreThanOneGroupExists = groupedGroups.length > 1;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const productListRef = useRef<HTMLDivElement>(null);\n\n const [buttonHasBeenClick, setButtonHasBeenClicked] = useState(false);\n const [activeGroup, setActiveGroup] = useState(initialActiveGroup);\n const [playAnimation, setPlayAnimation] = useState(false);\n const isHovering = useHoverDirty(containerRef);\n const [isDragging, setIsDragging] = useState(false);\n const [overflowExists, setOverflowExists] = useState(true);\n const [endPosition, setEndPosition] = useState<number>(0);\n const checkForScrollTimeout = 150;\n\n useEffectOnce(() => {\n const refsExist = containerRef.current && productListRef.current;\n if (\n refsExist &&\n containerRef.current?.getBoundingClientRect().width <\n productListRef.current?.getBoundingClientRect().width\n ) {\n setOverflowExists(true);\n } else {\n setOverflowExists(false);\n }\n });\n\n // TODO: figure out how to remove this TODO. Currently, without this `useEffect` `activeGroup` isn't updating when toggling between different tables (`Section`s).\n // ModelCompareV4 is sometimes used to toggle between sets of data of type Section. In this situation, we need the initial active group to be updated when the new data is passed to ModelCompareV4\n useEffect(() => {\n setActiveGroup(products[0]?.productListGroup?.id as ProductListGroupId);\n }, [products]);\n\n // #############################################################################\n // Scroll-Specific useEffects\n // #############################################################################\n\n // if there aren't any product list group buttons then the ending state of the animations need to exist on the initial render\n useEffect(() => {\n if (!showProductGroups && hasBeenObserved) {\n setPlayAnimation(true);\n }\n }, [hasBeenObserved, setPlayAnimation, showProductGroups]);\n\n // plays animation when no scroll has occurred on the initial observe\n useEffect(() => {\n const productListInitialPosition =\n productListRef.current?.getBoundingClientRect().left;\n\n if (hasBeenObserved || buttonHasBeenClick) {\n setTimeout(() => {\n const currentPosition =\n productListRef.current?.getBoundingClientRect().left;\n if (productListInitialPosition === currentPosition) {\n return setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n }\n }, [hasBeenObserved, setPlayAnimation, buttonHasBeenClick]);\n\n // #############################################################################\n // Drag Logic\n // #############################################################################\n const dragStartingPosition = useRef(0);\n const scrollAmount = useRef(0);\n\n const dragHandler = useCallback(\n (event: MouseEvent) => {\n scrollAmount.current = dragStartingPosition.current - event.clientX;\n containerRef.current?.scrollTo(endPosition + scrollAmount.current, 0);\n },\n [endPosition],\n );\n\n const mouseUpHandler = useCallback(() => {\n setIsDragging(false);\n setEndPosition(containerRef.current?.scrollLeft as number);\n document.removeEventListener(\"mousemove\", dragHandler);\n }, [dragHandler]);\n\n const mouseDownHandler = useCallback(\n (event: React.MouseEvent<Element, MouseEvent>) => {\n if (event.buttons === 1) {\n dragStartingPosition.current = event.clientX;\n setIsDragging(true);\n document.addEventListener(\"mousemove\", dragHandler);\n document.addEventListener(\"mouseup\", mouseUpHandler);\n }\n },\n [dragHandler, mouseUpHandler],\n );\n\n useEffectOnce(() => {\n let isScrolling: NodeJS.Timeout;\n (containerRef.current as HTMLDivElement).addEventListener(\n \"scroll\",\n function () {\n window.clearTimeout(isScrolling);\n\n // if scrolling occurs, animations are played after scrolling has completed\n // if scrolling occurs, the container's end position is track in state after scrolling has completed\n isScrolling = setTimeout(function () {\n setPlayAnimation(true);\n setEndPosition(containerRef.current?.scrollLeft as number);\n }, checkForScrollTimeout);\n },\n );\n });\n\n // #############################################################################\n // Click to Scroll Logic\n // #############################################################################\n\n const tabClickHandler = useCallback(\n ({ groupId }: { groupId: ProductListGroupId }) => {\n const initialScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n const checkForScroll = () => {\n const currentScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n return currentScrollPosition === initialScrollPosition;\n };\n\n const element = document.getElementById(groupId) as HTMLDivElement;\n\n setPlayAnimation(false);\n setActiveGroup(groupId);\n setButtonHasBeenClicked(true);\n element?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"start\",\n block: \"nearest\",\n });\n\n // if no scroll occurs animations are played\n setTimeout(() => {\n if (checkForScroll()) {\n setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n },\n [containerRef, setPlayAnimation, setActiveGroup, checkForScrollTimeout],\n );\n\n const scrollButtonHandler = ({ isLeftArrow }: { isLeftArrow?: boolean }) => {\n if (containerRef.current) {\n const currentScrollPosition = containerRef.current?.scrollLeft;\n\n const scrollLength = isLeftArrow\n ? currentScrollPosition - S.PRODUCT_CARD_WIDTH - S.PRODUCT_LIST_GRID_GAP\n : currentScrollPosition +\n S.PRODUCT_CARD_WIDTH +\n S.PRODUCT_LIST_GRID_GAP;\n\n containerRef.current?.scrollTo(scrollLength, 0);\n }\n };\n\n const { isMaxLeft, isMaxRight } = useIsAtMaxScroll(containerRef);\n\n return (\n <S.Wrapper>\n {showProductGroups && moreThanOneGroupExists && (\n <ButtonGroup\n items={groupedGroups.map((group) => group.productListGroup)}\n activeButton={activeGroup as string}\n onClick={(id) => {\n tabClickHandler({ groupId: id as ProductListGroupId });\n }}\n />\n )}\n <S.Container\n ref={containerRef}\n $isHovering={isHovering}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n $isDragging={isDragging}\n >\n <S.ProductGroupProductListContainer>\n {moreThanOneGroupExists && (\n <ProductGroups\n products={products}\n activeGroup={activeGroup as ProductListGroupId}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n showProductGroups={showProductGroups}\n />\n )}\n <S.ProductList\n $columns={products.length}\n $isDragging={isDragging}\n $overflowExists={overflowExists}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n onMouseDown={(event) => mouseDownHandler(event)}\n onMouseUp={mouseUpHandler}\n ref={productListRef}\n >\n <ScrollButton\n color=\"white\"\n rotationDegrees={180}\n isVisible={!isMaxLeft}\n onClick={() => scrollButtonHandler({ isLeftArrow: true })}\n />\n <ScrollButton\n color=\"white\"\n rotationDegrees={0}\n isVisible={isMaxRight}\n isRightButton\n onClick={() => scrollButtonHandler({ isLeftArrow: false })}\n />\n {products.map((product, productsArrayIndex) => {\n const groupIsActive =\n product.productListGroup?.id === activeGroup;\n\n const productListGroup = products.filter(\n (product) => activeGroup === product.productListGroup?.id,\n );\n\n const groupIndex = productListGroup.findIndex(\n (item) => item.id === product.id,\n );\n\n return (\n <Product\n onClick={() =>\n setActiveGroup(\n product.productListGroup?.id as ProductListGroupId,\n )\n }\n key={product.id}\n groupIndex={groupIndex}\n groupLength={productListGroup.length}\n id={product?.id as ProductId}\n groupId={product.productListGroup?.id as ProductListGroupId}\n image={product.image ?? { src: \"\", width: 0, height: 0 }}\n name={product.title}\n description={product.description}\n selectedProducts={selectedProducts}\n setSelectedProducts={setSelectedProducts}\n setExternalState={setExternalState}\n groupIsActive={groupIsActive}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n selectedProductsLimit={selectedProductsLimit}\n showProductGroups={showProductGroups}\n isStaticProduct={productsArrayIndex === 0}\n isOverviewPage={isOverviewPage}\n />\n );\n })}\n </S.ProductList>\n </S.ProductGroupProductListContainer>\n </S.Container>\n </S.Wrapper>\n );\n};\n"],"names":["ProductList","products","selectedProducts","setSelectedProducts","hasBeenObserved","selectedProductsLimit","initialActiveGroup","setExternalState","showProductGroups","isOverviewPage","groupedGroups","groupProducts","moreThanOneGroupExists","length","containerRef","useRef","productListRef","buttonHasBeenClick","setButtonHasBeenClicked","useState","activeGroup","setActiveGroup","playAnimation","setPlayAnimation","isHovering","useHoverDirty","isDragging","setIsDragging","overflowExists","setOverflowExists","endPosition","setEndPosition","checkForScrollTimeout","useEffectOnce","refsExist","current","getBoundingClientRect","width","useEffect","productListGroup","id","productListInitialPosition","left","setTimeout","currentPosition","dragStartingPosition","scrollAmount","dragHandler","useCallback","event","clientX","scrollTo","mouseUpHandler","scrollLeft","document","removeEventListener","mouseDownHandler","buttons","addEventListener","isScrolling","window","clearTimeout","tabClickHandler","groupId","initialScrollPosition","checkForScroll","currentScrollPosition","element","getElementById","scrollIntoView","behavior","inline","block","scrollButtonHandler","isLeftArrow","scrollLength","S.PRODUCT_CARD_WIDTH","PRODUCT_CARD_WIDTH","S.PRODUCT_LIST_GRID_GAP","PRODUCT_LIST_GRID_GAP","isMaxLeft","isMaxRight","useIsAtMaxScroll","jsxs","S.Wrapper","children","jsx","ButtonGroup","items","map","group","activeButton","onClick","S.Container","Container","ref","$isHovering","$moreThanOneGroupExists","$isDragging","S.ProductGroupProductListContainer","ProductGroups","canPlayAniimation","S.ProductList","$columns","$overflowExists","onMouseDown","onMouseUp","ScrollButton","color","rotationDegrees","isVisible","isRightButton","product","productsArrayIndex","groupIsActive","filter","groupIndex","findIndex","item","Product","groupLength","image","src","height","name","title","description","isStaticProduct"],"mappings":";;;;;;;;;;;;;;AAgBO,MAA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a,kBAAA;cACtCZ,qBAAA;cACAG,iBAAA;cACAuH,iBAAiBd,kBAAuB,KAAA,CAAA;cACxCxG;YAAA,CAAA,EAjBKuG,OAAQ,CAAAxE,EAkBf,CAAA;UAEH,CAAA,CAAA;QAAA,CAAA,CAAA;MAEL,CAAA;IAAA,CAAA,CAAA;GAEJ,CAAA;AAEJ,CAAA;"}
1
+ {"version":3,"file":"ProductList.js","sources":["../../../../src/components/ModelCompareV4/ProductList/ProductList.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useEffectOnce, useHoverDirty } from \"react-use\";\n\nimport type {\n ProductId,\n ProductListGroupId,\n} from \"../../../constants/modelCompareData/types\";\nimport { ButtonGroup } from \"./components/ButtonGroup\";\nimport { Product } from \"./components/Product/Product\";\nimport { groupProducts } from \"./components/ProductGroups/groupProducts\";\nimport { ProductGroups } from \"./components/ProductGroups/ProductGroups\";\nimport { ScrollButton } from \"./components/ScrollButton/ScrollButton\";\nimport * as S from \"./ProductList.styles\";\nimport type { ProductListProps } from \"./ProductList.types\";\nimport { useIsAtMaxScroll } from \"./useIsAtMaxScroll\";\n\nexport const ProductList = ({\n products,\n selectedProducts,\n setSelectedProducts,\n hasBeenObserved,\n selectedProductsLimit,\n initialActiveGroup,\n setExternalState,\n showProductGroups,\n isOverviewPage,\n}: ProductListProps) => {\n const groupedGroups = groupProducts(products);\n const moreThanOneGroupExists = groupedGroups.length > 1;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const productListRef = useRef<HTMLDivElement>(null);\n\n const [buttonHasBeenClick, setButtonHasBeenClicked] = useState(false);\n const [activeGroup, setActiveGroup] = useState(initialActiveGroup);\n const [playAnimation, setPlayAnimation] = useState(false);\n const isHovering = useHoverDirty(containerRef);\n const [isDragging, setIsDragging] = useState(false);\n const [overflowExists, setOverflowExists] = useState(true);\n const [endPosition, setEndPosition] = useState<number>(0);\n const checkForScrollTimeout = 150;\n\n useEffectOnce(() => {\n const refsExist = containerRef.current && productListRef.current;\n if (\n refsExist &&\n containerRef.current?.getBoundingClientRect().width <\n productListRef.current?.getBoundingClientRect().width\n ) {\n setOverflowExists(true);\n } else {\n setOverflowExists(false);\n }\n });\n\n // TODO: figure out how to remove this TODO. Currently, without this `useEffect` `activeGroup` isn't updating when toggling between different tables (`Section`s).\n // ModelCompareV4 is sometimes used to toggle between sets of data of type Section. In this situation, we need the initial active group to be updated when the new data is passed to ModelCompareV4\n useEffect(() => {\n setActiveGroup(products[0]?.productListGroup?.id as ProductListGroupId);\n }, [products]);\n\n // #############################################################################\n // Scroll-Specific useEffects\n // #############################################################################\n\n // if there aren't any product list group buttons then the ending state of the animations need to exist on the initial render\n useEffect(() => {\n if (!showProductGroups && hasBeenObserved) {\n setPlayAnimation(true);\n }\n }, [hasBeenObserved, setPlayAnimation, showProductGroups]);\n\n // plays animation when no scroll has occurred on the initial observe\n useEffect(() => {\n const productListInitialPosition =\n productListRef.current?.getBoundingClientRect().left;\n\n if (hasBeenObserved || buttonHasBeenClick) {\n setTimeout(() => {\n const currentPosition =\n productListRef.current?.getBoundingClientRect().left;\n if (productListInitialPosition === currentPosition) {\n return setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n }\n }, [hasBeenObserved, setPlayAnimation, buttonHasBeenClick]);\n\n // #############################################################################\n // Drag Logic\n // #############################################################################\n const dragStartingPosition = useRef(0);\n const scrollAmount = useRef(0);\n\n const dragHandler = useCallback(\n (event: MouseEvent) => {\n scrollAmount.current = dragStartingPosition.current - event.clientX;\n containerRef.current?.scrollTo(endPosition + scrollAmount.current, 0);\n },\n [endPosition],\n );\n\n const mouseUpHandler = useCallback(() => {\n setIsDragging(false);\n setEndPosition(containerRef.current?.scrollLeft as number);\n document.removeEventListener(\"mousemove\", dragHandler);\n document.removeEventListener(\"mouseup\", mouseUpHandler);\n }, [dragHandler]);\n\n const mouseDownHandler = useCallback(\n (event: React.MouseEvent<Element, MouseEvent>) => {\n if (event.buttons === 1) {\n dragStartingPosition.current = event.clientX;\n setIsDragging(true);\n document.addEventListener(\"mousemove\", dragHandler);\n document.addEventListener(\"mouseup\", mouseUpHandler);\n }\n },\n [dragHandler, mouseUpHandler],\n );\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n let isScrolling: NodeJS.Timeout;\n\n const scrollHandler = () => {\n window.clearTimeout(isScrolling);\n\n // if scrolling occurs, animations are played after scrolling has completed\n // if scrolling occurs, the container's end position is track in state after scrolling has completed\n isScrolling = setTimeout(() => {\n setPlayAnimation(true);\n setEndPosition(containerRef.current?.scrollLeft as number);\n }, checkForScrollTimeout);\n };\n\n container.addEventListener(\"scroll\", scrollHandler);\n\n return () => {\n container.removeEventListener(\"scroll\", scrollHandler);\n window.clearTimeout(isScrolling);\n };\n }, []); // Empty dependency array since we want this to run once\n\n // Add cleanup for drag handlers on unmount\n useEffect(() => {\n return () => {\n document.removeEventListener(\"mousemove\", dragHandler);\n document.removeEventListener(\"mouseup\", mouseUpHandler);\n };\n }, [dragHandler, mouseUpHandler]);\n\n // #############################################################################\n // Click to Scroll Logic\n // #############################################################################\n\n const tabClickHandler = useCallback(\n ({ groupId }: { groupId: ProductListGroupId }) => {\n const initialScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n const checkForScroll = () => {\n const currentScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n return currentScrollPosition === initialScrollPosition;\n };\n\n const element = document.getElementById(groupId) as HTMLDivElement;\n\n setPlayAnimation(false);\n setActiveGroup(groupId);\n setButtonHasBeenClicked(true);\n element?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"start\",\n block: \"nearest\",\n });\n\n // if no scroll occurs animations are played\n setTimeout(() => {\n if (checkForScroll()) {\n setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n },\n [containerRef, setPlayAnimation, setActiveGroup, checkForScrollTimeout],\n );\n\n const scrollButtonHandler = ({ isLeftArrow }: { isLeftArrow?: boolean }) => {\n if (containerRef.current) {\n const currentScrollPosition = containerRef.current?.scrollLeft;\n\n const scrollLength = isLeftArrow\n ? currentScrollPosition - S.PRODUCT_CARD_WIDTH - S.PRODUCT_LIST_GRID_GAP\n : currentScrollPosition +\n S.PRODUCT_CARD_WIDTH +\n S.PRODUCT_LIST_GRID_GAP;\n\n containerRef.current?.scrollTo(scrollLength, 0);\n }\n };\n\n const { isMaxLeft, isMaxRight } = useIsAtMaxScroll(containerRef);\n\n return (\n <S.Wrapper>\n {showProductGroups && moreThanOneGroupExists && (\n <ButtonGroup\n items={groupedGroups.map((group) => group.productListGroup)}\n activeButton={activeGroup as string}\n onClick={(id) => {\n tabClickHandler({ groupId: id as ProductListGroupId });\n }}\n />\n )}\n <S.Container\n ref={containerRef}\n $isHovering={isHovering}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n $isDragging={isDragging}\n >\n <S.ProductGroupProductListContainer>\n {moreThanOneGroupExists && (\n <ProductGroups\n products={products}\n activeGroup={activeGroup as ProductListGroupId}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n showProductGroups={showProductGroups}\n />\n )}\n <S.ProductList\n $columns={products.length}\n $isDragging={isDragging}\n $overflowExists={overflowExists}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n onMouseDown={(event) => mouseDownHandler(event)}\n onMouseUp={mouseUpHandler}\n ref={productListRef}\n >\n <ScrollButton\n color=\"white\"\n rotationDegrees={180}\n isVisible={!isMaxLeft}\n onClick={() => scrollButtonHandler({ isLeftArrow: true })}\n />\n <ScrollButton\n color=\"white\"\n rotationDegrees={0}\n isVisible={isMaxRight}\n isRightButton\n onClick={() => scrollButtonHandler({ isLeftArrow: false })}\n />\n {products.map((product, productsArrayIndex) => {\n const groupIsActive =\n product.productListGroup?.id === activeGroup;\n\n const productListGroup = products.filter(\n (product) => activeGroup === product.productListGroup?.id,\n );\n\n const groupIndex = productListGroup.findIndex(\n (item) => item.id === product.id,\n );\n\n return (\n <Product\n onClick={() =>\n setActiveGroup(\n product.productListGroup?.id as ProductListGroupId,\n )\n }\n key={product.id}\n groupIndex={groupIndex}\n groupLength={productListGroup.length}\n id={product?.id as ProductId}\n groupId={product.productListGroup?.id as ProductListGroupId}\n image={product.image ?? { src: \"\", width: 0, height: 0 }}\n name={product.title}\n description={product.description}\n selectedProducts={selectedProducts}\n setSelectedProducts={setSelectedProducts}\n setExternalState={setExternalState}\n groupIsActive={groupIsActive}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n selectedProductsLimit={selectedProductsLimit}\n showProductGroups={showProductGroups}\n isStaticProduct={productsArrayIndex === 0}\n isOverviewPage={isOverviewPage}\n />\n );\n })}\n </S.ProductList>\n </S.ProductGroupProductListContainer>\n </S.Container>\n </S.Wrapper>\n );\n};\n"],"names":["ProductList","products","selectedProducts","setSelectedProducts","hasBeenObserved","selectedProductsLimit","initialActiveGroup","setExternalState","showProductGroups","isOverviewPage","groupedGroups","groupProducts","moreThanOneGroupExists","length","containerRef","useRef","productListRef","buttonHasBeenClick","setButtonHasBeenClicked","useState","activeGroup","setActiveGroup","playAnimation","setPlayAnimation","isHovering","useHoverDirty","isDragging","setIsDragging","overflowExists","setOverflowExists","endPosition","setEndPosition","checkForScrollTimeout","useEffectOnce","refsExist","current","getBoundingClientRect","width","useEffect","productListGroup","id","productListInitialPosition","left","setTimeout","currentPosition","dragStartingPosition","scrollAmount","dragHandler","useCallback","event","clientX","scrollTo","mouseUpHandler","scrollLeft","document","removeEventListener","mouseDownHandler","buttons","addEventListener","container","isScrolling","scrollHandler","window","clearTimeout","tabClickHandler","groupId","initialScrollPosition","checkForScroll","currentScrollPosition","element","getElementById","scrollIntoView","behavior","inline","block","scrollButtonHandler","isLeftArrow","scrollLength","S.PRODUCT_CARD_WIDTH","PRODUCT_CARD_WIDTH","S.PRODUCT_LIST_GRID_GAP","PRODUCT_LIST_GRID_GAP","isMaxLeft","isMaxRight","useIsAtMaxScroll","jsxs","S.Wrapper","children","jsx","ButtonGroup","items","map","group","activeButton","onClick","S.Container","Container","ref","$isHovering","$moreThanOneGroupExists","$isDragging","S.ProductGroupProductListContainer","ProductGroups","canPlayAniimation","S.ProductList","$columns","$overflowExists","onMouseDown","onMouseUp","ScrollButton","color","rotationDegrees","isVisible","isRightButton","product","productsArrayIndex","groupIsActive","filter","groupIndex","findIndex","item","Product","groupLength","image","src","height","name","title","description","isStaticProduct"],"mappings":";;;;;;;;;;;;;;AAgBO,MAAMA,cAAcA,CAAC;EAC1BC,QAAA;EACAC,gBAAA;EACAC,mBAAA;EACAC,eAAA;EACAC,qBAAA;EACAC,kBAAA;EACAC,gBAAA;EACAC,iBAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAAC,aAAA,GAAgBC,4BAAcV,QAAQ,CAAA;EACtC,MAAAW,sBAAA,GAAyBF,cAAcG,MAAS,GAAA,CAAA;EAEhD,MAAAC,YAAA,GAAeC,aAAuB,IAAI,CAAA;EAC1C,MAAAC,cAAA,GAAiBD,aAAuB,IAAI,CAAA;EAElD,MAAM,CAACE,kBAAA,EAAoBC,uBAAuB,CAAA,GAAIC,KAAAA,CAAAA,SAAS,KAAK,CAAA;EACpE,MAAM,CAACC,WAAA,EAAaC,cAAc,CAAA,GAAIF,KAAAA,CAAAA,SAASb,kBAAkB,CAAA;EACjE,MAAM,CAACgB,aAAA,EAAeC,gBAAgB,CAAA,GAAIJ,KAAAA,CAAAA,SAAS,KAAK,CAAA;EAClD,MAAAK,UAAA,GAAaC,uBAAcX,YAAY,CAAA;EAC7C,MAAM,CAACY,UAAA,EAAYC,aAAa,CAAA,GAAIR,KAAAA,CAAAA,SAAS,KAAK,CAAA;EAClD,MAAM,CAACS,cAAA,EAAgBC,iBAAiB,CAAA,GAAIV,KAAAA,CAAAA,SAAS,IAAI,CAAA;EACzD,MAAM,CAACW,WAAA,EAAaC,cAAc,CAAA,GAAIZ,KAAAA,CAAAA,SAAiB,CAAC,CAAA;EACxD,MAAMa,qBAAwB,GAAA,GAAA;EAE9BC,QAAAA,C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AmBtC,QAAS,CAAAoH,MAAA,CAC/BH,QAAAA,IAAY9F,WAAgB8F,KAAAA,QAAAA,CAAQ3E,gBAAkB,EAAAC,EACzD,CAAA;YAEA,MAAM8E,aAAa/E,gBAAiB,CAAAgF,SAAA,CACjCC,IAAA,IAASA,IAAK,CAAAhF,EAAA,KAAO0E,OAAQ,CAAA1E,EAChC,CAAA;YAGE,sBAAAgD,UAAA,CAAAA,GAAA,CAACiC,OAAA,CAAAA,OAAA,EAAA;cACC3B,SAASA,CAAA,KACPzE,cAAA,CACE6F,QAAQ3E,gBAAkB,EAAAC,EAC5B,CAAA;cAGF8E,UAAA;cACAI,aAAanF,gBAAiB,CAAA1B,MAAA;cAC9B2B,IAAI0E,OAAS,EAAA1E,EAAA;cACbyB,OAAA,EAASiD,QAAQ3E,gBAAkB,EAAAC,EAAA;cACnCmF,KAAA,EAAOT,QAAQS,KAAS,IAAA;gBAAEC,KAAK,EAAI;gBAAAvF,KAAA,EAAO,CAAG;gBAAAwF,MAAA,EAAQ;cAAE,CAAA;cACvDC,MAAMZ,OAAQ,CAAAa,KAAA;cACdC,aAAad,OAAQ,CAAAc,WAAA;cACrB9H,gBAAA;cACAC,mBAAA;cACAI,gBAAA;cACA6G,aAAA;cACA9F,aAAA;cACAiF,mBAAmBnG,eAAmB,IAAAa,kBAAA;cACtCZ,qBAAA;cACAG,iBAAA;cACAyH,iBAAiBd,kBAAuB,KAAA,CAAA;cACxC1G;YAAA,CAAA,EAjBKyG,OAAQ,CAAA1E,EAkBf,CAAA;UAEH,CAAA,CAAA;QAAA,CAAA,CAAA;MAEL,CAAA;IAAA,CAAA,CAAA;GAEJ,CAAA;AAEJ,CAAA;"}
@@ -70,6 +70,7 @@ const ProductList = ({
70
70
  setIsDragging(false);
71
71
  setEndPosition(containerRef.current?.scrollLeft);
72
72
  document.removeEventListener("mousemove", dragHandler);
73
+ document.removeEventListener("mouseup", mouseUpHandler);
73
74
  }, [dragHandler]);
74
75
  const mouseDownHandler = useCallback(event => {
75
76
  if (event.buttons === 1) {
@@ -79,16 +80,29 @@ const ProductList = ({
79
80
  document.addEventListener("mouseup", mouseUpHandler);
80
81
  }
81
82
  }, [dragHandler, mouseUpHandler]);
82
- useEffectOnce(() => {
83
+ useEffect(() => {
84
+ const container = containerRef.current;
85
+ if (!container) return;
83
86
  let isScrolling;
84
- containerRef.current.addEventListener("scroll", function () {
87
+ const scrollHandler = () => {
85
88
  window.clearTimeout(isScrolling);
86
- isScrolling = setTimeout(function () {
89
+ isScrolling = setTimeout(() => {
87
90
  setPlayAnimation(true);
88
91
  setEndPosition(containerRef.current?.scrollLeft);
89
92
  }, checkForScrollTimeout);
90
- });
91
- });
93
+ };
94
+ container.addEventListener("scroll", scrollHandler);
95
+ return () => {
96
+ container.removeEventListener("scroll", scrollHandler);
97
+ window.clearTimeout(isScrolling);
98
+ };
99
+ }, []);
100
+ useEffect(() => {
101
+ return () => {
102
+ document.removeEventListener("mousemove", dragHandler);
103
+ document.removeEventListener("mouseup", mouseUpHandler);
104
+ };
105
+ }, [dragHandler, mouseUpHandler]);
92
106
  const tabClickHandler = useCallback(({
93
107
  groupId
94
108
  }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ProductList.mjs","sources":["../../../../src/components/ModelCompareV4/ProductList/ProductList.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useEffectOnce, useHoverDirty } from \"react-use\";\n\nimport type {\n ProductId,\n ProductListGroupId,\n} from \"../../../constants/modelCompareData/types\";\nimport { ButtonGroup } from \"./components/ButtonGroup\";\nimport { Product } from \"./components/Product/Product\";\nimport { groupProducts } from \"./components/ProductGroups/groupProducts\";\nimport { ProductGroups } from \"./components/ProductGroups/ProductGroups\";\nimport { ScrollButton } from \"./components/ScrollButton/ScrollButton\";\nimport * as S from \"./ProductList.styles\";\nimport type { ProductListProps } from \"./ProductList.types\";\nimport { useIsAtMaxScroll } from \"./useIsAtMaxScroll\";\n\nexport const ProductList = ({\n products,\n selectedProducts,\n setSelectedProducts,\n hasBeenObserved,\n selectedProductsLimit,\n initialActiveGroup,\n setExternalState,\n showProductGroups,\n isOverviewPage,\n}: ProductListProps) => {\n const groupedGroups = groupProducts(products);\n const moreThanOneGroupExists = groupedGroups.length > 1;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const productListRef = useRef<HTMLDivElement>(null);\n\n const [buttonHasBeenClick, setButtonHasBeenClicked] = useState(false);\n const [activeGroup, setActiveGroup] = useState(initialActiveGroup);\n const [playAnimation, setPlayAnimation] = useState(false);\n const isHovering = useHoverDirty(containerRef);\n const [isDragging, setIsDragging] = useState(false);\n const [overflowExists, setOverflowExists] = useState(true);\n const [endPosition, setEndPosition] = useState<number>(0);\n const checkForScrollTimeout = 150;\n\n useEffectOnce(() => {\n const refsExist = containerRef.current && productListRef.current;\n if (\n refsExist &&\n containerRef.current?.getBoundingClientRect().width <\n productListRef.current?.getBoundingClientRect().width\n ) {\n setOverflowExists(true);\n } else {\n setOverflowExists(false);\n }\n });\n\n // TODO: figure out how to remove this TODO. Currently, without this `useEffect` `activeGroup` isn't updating when toggling between different tables (`Section`s).\n // ModelCompareV4 is sometimes used to toggle between sets of data of type Section. In this situation, we need the initial active group to be updated when the new data is passed to ModelCompareV4\n useEffect(() => {\n setActiveGroup(products[0]?.productListGroup?.id as ProductListGroupId);\n }, [products]);\n\n // #############################################################################\n // Scroll-Specific useEffects\n // #############################################################################\n\n // if there aren't any product list group buttons then the ending state of the animations need to exist on the initial render\n useEffect(() => {\n if (!showProductGroups && hasBeenObserved) {\n setPlayAnimation(true);\n }\n }, [hasBeenObserved, setPlayAnimation, showProductGroups]);\n\n // plays animation when no scroll has occurred on the initial observe\n useEffect(() => {\n const productListInitialPosition =\n productListRef.current?.getBoundingClientRect().left;\n\n if (hasBeenObserved || buttonHasBeenClick) {\n setTimeout(() => {\n const currentPosition =\n productListRef.current?.getBoundingClientRect().left;\n if (productListInitialPosition === currentPosition) {\n return setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n }\n }, [hasBeenObserved, setPlayAnimation, buttonHasBeenClick]);\n\n // #############################################################################\n // Drag Logic\n // #############################################################################\n const dragStartingPosition = useRef(0);\n const scrollAmount = useRef(0);\n\n const dragHandler = useCallback(\n (event: MouseEvent) => {\n scrollAmount.current = dragStartingPosition.current - event.clientX;\n containerRef.current?.scrollTo(endPosition + scrollAmount.current, 0);\n },\n [endPosition],\n );\n\n const mouseUpHandler = useCallback(() => {\n setIsDragging(false);\n setEndPosition(containerRef.current?.scrollLeft as number);\n document.removeEventListener(\"mousemove\", dragHandler);\n }, [dragHandler]);\n\n const mouseDownHandler = useCallback(\n (event: React.MouseEvent<Element, MouseEvent>) => {\n if (event.buttons === 1) {\n dragStartingPosition.current = event.clientX;\n setIsDragging(true);\n document.addEventListener(\"mousemove\", dragHandler);\n document.addEventListener(\"mouseup\", mouseUpHandler);\n }\n },\n [dragHandler, mouseUpHandler],\n );\n\n useEffectOnce(() => {\n let isScrolling: NodeJS.Timeout;\n (containerRef.current as HTMLDivElement).addEventListener(\n \"scroll\",\n function () {\n window.clearTimeout(isScrolling);\n\n // if scrolling occurs, animations are played after scrolling has completed\n // if scrolling occurs, the container's end position is track in state after scrolling has completed\n isScrolling = setTimeout(function () {\n setPlayAnimation(true);\n setEndPosition(containerRef.current?.scrollLeft as number);\n }, checkForScrollTimeout);\n },\n );\n });\n\n // #############################################################################\n // Click to Scroll Logic\n // #############################################################################\n\n const tabClickHandler = useCallback(\n ({ groupId }: { groupId: ProductListGroupId }) => {\n const initialScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n const checkForScroll = () => {\n const currentScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n return currentScrollPosition === initialScrollPosition;\n };\n\n const element = document.getElementById(groupId) as HTMLDivElement;\n\n setPlayAnimation(false);\n setActiveGroup(groupId);\n setButtonHasBeenClicked(true);\n element?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"start\",\n block: \"nearest\",\n });\n\n // if no scroll occurs animations are played\n setTimeout(() => {\n if (checkForScroll()) {\n setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n },\n [containerRef, setPlayAnimation, setActiveGroup, checkForScrollTimeout],\n );\n\n const scrollButtonHandler = ({ isLeftArrow }: { isLeftArrow?: boolean }) => {\n if (containerRef.current) {\n const currentScrollPosition = containerRef.current?.scrollLeft;\n\n const scrollLength = isLeftArrow\n ? currentScrollPosition - S.PRODUCT_CARD_WIDTH - S.PRODUCT_LIST_GRID_GAP\n : currentScrollPosition +\n S.PRODUCT_CARD_WIDTH +\n S.PRODUCT_LIST_GRID_GAP;\n\n containerRef.current?.scrollTo(scrollLength, 0);\n }\n };\n\n const { isMaxLeft, isMaxRight } = useIsAtMaxScroll(containerRef);\n\n return (\n <S.Wrapper>\n {showProductGroups && moreThanOneGroupExists && (\n <ButtonGroup\n items={groupedGroups.map((group) => group.productListGroup)}\n activeButton={activeGroup as string}\n onClick={(id) => {\n tabClickHandler({ groupId: id as ProductListGroupId });\n }}\n />\n )}\n <S.Container\n ref={containerRef}\n $isHovering={isHovering}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n $isDragging={isDragging}\n >\n <S.ProductGroupProductListContainer>\n {moreThanOneGroupExists && (\n <ProductGroups\n products={products}\n activeGroup={activeGroup as ProductListGroupId}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n showProductGroups={showProductGroups}\n />\n )}\n <S.ProductList\n $columns={products.length}\n $isDragging={isDragging}\n $overflowExists={overflowExists}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n onMouseDown={(event) => mouseDownHandler(event)}\n onMouseUp={mouseUpHandler}\n ref={productListRef}\n >\n <ScrollButton\n color=\"white\"\n rotationDegrees={180}\n isVisible={!isMaxLeft}\n onClick={() => scrollButtonHandler({ isLeftArrow: true })}\n />\n <ScrollButton\n color=\"white\"\n rotationDegrees={0}\n isVisible={isMaxRight}\n isRightButton\n onClick={() => scrollButtonHandler({ isLeftArrow: false })}\n />\n {products.map((product, productsArrayIndex) => {\n const groupIsActive =\n product.productListGroup?.id === activeGroup;\n\n const productListGroup = products.filter(\n (product) => activeGroup === product.productListGroup?.id,\n );\n\n const groupIndex = productListGroup.findIndex(\n (item) => item.id === product.id,\n );\n\n return (\n <Product\n onClick={() =>\n setActiveGroup(\n product.productListGroup?.id as ProductListGroupId,\n )\n }\n key={product.id}\n groupIndex={groupIndex}\n groupLength={productListGroup.length}\n id={product?.id as ProductId}\n groupId={product.productListGroup?.id as ProductListGroupId}\n image={product.image ?? { src: \"\", width: 0, height: 0 }}\n name={product.title}\n description={product.description}\n selectedProducts={selectedProducts}\n setSelectedProducts={setSelectedProducts}\n setExternalState={setExternalState}\n groupIsActive={groupIsActive}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n selectedProductsLimit={selectedProductsLimit}\n showProductGroups={showProductGroups}\n isStaticProduct={productsArrayIndex === 0}\n isOverviewPage={isOverviewPage}\n />\n );\n })}\n </S.ProductList>\n </S.ProductGroupProductListContainer>\n </S.Container>\n </S.Wrapper>\n );\n};\n"],"names":["ProductList","products","selectedProducts","setSelectedProducts","hasBeenObserved","selectedProductsLimit","initialActiveGroup","setExternalState","showProductGroups","isOverviewPage","groupedGroups","groupProducts","moreThanOneGroupExists","length","containerRef","useRef","productListRef","buttonHasBeenClick","setButtonHasBeenClicked","useState","activeGroup","setActiveGroup","playAnimation","setPlayAnimation","isHovering","useHoverDirty","isDragging","setIsDragging","overflowExists","setOverflowExists","endPosition","setEndPosition","checkForScrollTimeout","useEffectOnce","refsExist","current","getBoundingClientRect","width","useEffect","productListGroup","id","productListInitialPosition","left","setTimeout","currentPosition","dragStartingPosition","scrollAmount","dragHandler","useCallback","event","clientX","scrollTo","mouseUpHandler","scrollLeft","document","removeEventListener","mouseDownHandler","buttons","addEventListener","isScrolling","window","clearTimeout","tabClickHandler","groupId","initialScrollPosition","checkForScroll","currentScrollPosition","element","getElementById","scrollIntoView","behavior","inline","block","scrollButtonHandler","isLeftArrow","scrollLength","S.PRODUCT_CARD_WIDTH","S.PRODUCT_LIST_GRID_GAP","isMaxLeft","isMaxRight","useIsAtMaxScroll","jsxs","S.Wrapper","children","jsx","ButtonGroup","items","map","group","activeButton","onClick","S.Container","ref","$isHovering","$moreThanOneGroupExists","$isDragging","S.ProductGroupProductListContainer","ProductGroups","canPlayAniimation","S.ProductList","$columns","$overflowExists","onMouseDown","onMouseUp","ScrollButton","color","rotationDegrees","isVisible","isRightButton","product","productsArrayIndex","groupIsActive","filter","groupIndex","findIndex","item","Product","groupLength","image","src","height","name","title","description","isStaticProduct"],"mappings":";;;;;;;;;;;;AAgBO,MAAMA,cAAcA,CAAC;EAC1BC,QAAA;EACAC,gBAAA;EACAC,mBAAA;EACAC,eAAA;EACAC,qBAAA;EACAC,kBAAA;EACAC,gBAAA;EACAC,iBAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAAC,aAAA,GAAgBC,cAAcV,QAAQ,CAAA;EACtC,MAAAW,sBAAA,GAAyBF,cAAcG,MAAS,GAAA,CAAA;EAEhD,MAAAC,YAAA,GAAeC,OAAuB,IAAI,CAAA;EAC1C,MAAAC,cAAA,GAAiBD,OAAuB,IAAI,CAAA;EAElD,MAAM,CAACE,kBAAA,EAAoBC,uBAAuB,CAAA,GAAIC,SAAS,KAAK,CAAA;EACpE,MAAM,CAACC,WAAA,EAAaC,cAAc,CAAA,GAAIF,SAASb,kBAAkB,CAAA;EACjE,MAAM,CAACgB,aAAA,EAAeC,gBAAgB,CAAA,GAAIJ,SAAS,KAAK,CAAA;EAClD,MAAAK,UAAA,GAAaC,cAAcX,YAAY,CAAA;EAC7C,MAAM,CAACY,UAAA,EAAYC,aAAa,CAAA,GAAIR,SAAS,KAAK,CAAA;EAClD,MAAM,CAACS,cAAA,EAAgBC,iBAAiB,CAAA,GAAIV,SAAS,IAAI,CAAA;EACzD,MAAM,CAACW,WAAA,EAAaC,cAAc,CAAA,GAAIZ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,CAAA;cACxCrG;YAAA,CAAA,EAjBKoG,OAAQ,CAAArE,EAkBf,CAAA;UAEH,CAAA,CAAA;QAAA,CAAA,CAAA;MAEL,CAAA;IAAA,CAAA,CAAA;GAEJ,CAAA;AAEJ,CAAA;"}
1
+ {"version":3,"file":"ProductList.mjs","sources":["../../../../src/components/ModelCompareV4/ProductList/ProductList.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useEffectOnce, useHoverDirty } from \"react-use\";\n\nimport type {\n ProductId,\n ProductListGroupId,\n} from \"../../../constants/modelCompareData/types\";\nimport { ButtonGroup } from \"./components/ButtonGroup\";\nimport { Product } from \"./components/Product/Product\";\nimport { groupProducts } from \"./components/ProductGroups/groupProducts\";\nimport { ProductGroups } from \"./components/ProductGroups/ProductGroups\";\nimport { ScrollButton } from \"./components/ScrollButton/ScrollButton\";\nimport * as S from \"./ProductList.styles\";\nimport type { ProductListProps } from \"./ProductList.types\";\nimport { useIsAtMaxScroll } from \"./useIsAtMaxScroll\";\n\nexport const ProductList = ({\n products,\n selectedProducts,\n setSelectedProducts,\n hasBeenObserved,\n selectedProductsLimit,\n initialActiveGroup,\n setExternalState,\n showProductGroups,\n isOverviewPage,\n}: ProductListProps) => {\n const groupedGroups = groupProducts(products);\n const moreThanOneGroupExists = groupedGroups.length > 1;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const productListRef = useRef<HTMLDivElement>(null);\n\n const [buttonHasBeenClick, setButtonHasBeenClicked] = useState(false);\n const [activeGroup, setActiveGroup] = useState(initialActiveGroup);\n const [playAnimation, setPlayAnimation] = useState(false);\n const isHovering = useHoverDirty(containerRef);\n const [isDragging, setIsDragging] = useState(false);\n const [overflowExists, setOverflowExists] = useState(true);\n const [endPosition, setEndPosition] = useState<number>(0);\n const checkForScrollTimeout = 150;\n\n useEffectOnce(() => {\n const refsExist = containerRef.current && productListRef.current;\n if (\n refsExist &&\n containerRef.current?.getBoundingClientRect().width <\n productListRef.current?.getBoundingClientRect().width\n ) {\n setOverflowExists(true);\n } else {\n setOverflowExists(false);\n }\n });\n\n // TODO: figure out how to remove this TODO. Currently, without this `useEffect` `activeGroup` isn't updating when toggling between different tables (`Section`s).\n // ModelCompareV4 is sometimes used to toggle between sets of data of type Section. In this situation, we need the initial active group to be updated when the new data is passed to ModelCompareV4\n useEffect(() => {\n setActiveGroup(products[0]?.productListGroup?.id as ProductListGroupId);\n }, [products]);\n\n // #############################################################################\n // Scroll-Specific useEffects\n // #############################################################################\n\n // if there aren't any product list group buttons then the ending state of the animations need to exist on the initial render\n useEffect(() => {\n if (!showProductGroups && hasBeenObserved) {\n setPlayAnimation(true);\n }\n }, [hasBeenObserved, setPlayAnimation, showProductGroups]);\n\n // plays animation when no scroll has occurred on the initial observe\n useEffect(() => {\n const productListInitialPosition =\n productListRef.current?.getBoundingClientRect().left;\n\n if (hasBeenObserved || buttonHasBeenClick) {\n setTimeout(() => {\n const currentPosition =\n productListRef.current?.getBoundingClientRect().left;\n if (productListInitialPosition === currentPosition) {\n return setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n }\n }, [hasBeenObserved, setPlayAnimation, buttonHasBeenClick]);\n\n // #############################################################################\n // Drag Logic\n // #############################################################################\n const dragStartingPosition = useRef(0);\n const scrollAmount = useRef(0);\n\n const dragHandler = useCallback(\n (event: MouseEvent) => {\n scrollAmount.current = dragStartingPosition.current - event.clientX;\n containerRef.current?.scrollTo(endPosition + scrollAmount.current, 0);\n },\n [endPosition],\n );\n\n const mouseUpHandler = useCallback(() => {\n setIsDragging(false);\n setEndPosition(containerRef.current?.scrollLeft as number);\n document.removeEventListener(\"mousemove\", dragHandler);\n document.removeEventListener(\"mouseup\", mouseUpHandler);\n }, [dragHandler]);\n\n const mouseDownHandler = useCallback(\n (event: React.MouseEvent<Element, MouseEvent>) => {\n if (event.buttons === 1) {\n dragStartingPosition.current = event.clientX;\n setIsDragging(true);\n document.addEventListener(\"mousemove\", dragHandler);\n document.addEventListener(\"mouseup\", mouseUpHandler);\n }\n },\n [dragHandler, mouseUpHandler],\n );\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n let isScrolling: NodeJS.Timeout;\n\n const scrollHandler = () => {\n window.clearTimeout(isScrolling);\n\n // if scrolling occurs, animations are played after scrolling has completed\n // if scrolling occurs, the container's end position is track in state after scrolling has completed\n isScrolling = setTimeout(() => {\n setPlayAnimation(true);\n setEndPosition(containerRef.current?.scrollLeft as number);\n }, checkForScrollTimeout);\n };\n\n container.addEventListener(\"scroll\", scrollHandler);\n\n return () => {\n container.removeEventListener(\"scroll\", scrollHandler);\n window.clearTimeout(isScrolling);\n };\n }, []); // Empty dependency array since we want this to run once\n\n // Add cleanup for drag handlers on unmount\n useEffect(() => {\n return () => {\n document.removeEventListener(\"mousemove\", dragHandler);\n document.removeEventListener(\"mouseup\", mouseUpHandler);\n };\n }, [dragHandler, mouseUpHandler]);\n\n // #############################################################################\n // Click to Scroll Logic\n // #############################################################################\n\n const tabClickHandler = useCallback(\n ({ groupId }: { groupId: ProductListGroupId }) => {\n const initialScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n const checkForScroll = () => {\n const currentScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n return currentScrollPosition === initialScrollPosition;\n };\n\n const element = document.getElementById(groupId) as HTMLDivElement;\n\n setPlayAnimation(false);\n setActiveGroup(groupId);\n setButtonHasBeenClicked(true);\n element?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"start\",\n block: \"nearest\",\n });\n\n // if no scroll occurs animations are played\n setTimeout(() => {\n if (checkForScroll()) {\n setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n },\n [containerRef, setPlayAnimation, setActiveGroup, checkForScrollTimeout],\n );\n\n const scrollButtonHandler = ({ isLeftArrow }: { isLeftArrow?: boolean }) => {\n if (containerRef.current) {\n const currentScrollPosition = containerRef.current?.scrollLeft;\n\n const scrollLength = isLeftArrow\n ? currentScrollPosition - S.PRODUCT_CARD_WIDTH - S.PRODUCT_LIST_GRID_GAP\n : currentScrollPosition +\n S.PRODUCT_CARD_WIDTH +\n S.PRODUCT_LIST_GRID_GAP;\n\n containerRef.current?.scrollTo(scrollLength, 0);\n }\n };\n\n const { isMaxLeft, isMaxRight } = useIsAtMaxScroll(containerRef);\n\n return (\n <S.Wrapper>\n {showProductGroups && moreThanOneGroupExists && (\n <ButtonGroup\n items={groupedGroups.map((group) => group.productListGroup)}\n activeButton={activeGroup as string}\n onClick={(id) => {\n tabClickHandler({ groupId: id as ProductListGroupId });\n }}\n />\n )}\n <S.Container\n ref={containerRef}\n $isHovering={isHovering}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n $isDragging={isDragging}\n >\n <S.ProductGroupProductListContainer>\n {moreThanOneGroupExists && (\n <ProductGroups\n products={products}\n activeGroup={activeGroup as ProductListGroupId}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n showProductGroups={showProductGroups}\n />\n )}\n <S.ProductList\n $columns={products.length}\n $isDragging={isDragging}\n $overflowExists={overflowExists}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n onMouseDown={(event) => mouseDownHandler(event)}\n onMouseUp={mouseUpHandler}\n ref={productListRef}\n >\n <ScrollButton\n color=\"white\"\n rotationDegrees={180}\n isVisible={!isMaxLeft}\n onClick={() => scrollButtonHandler({ isLeftArrow: true })}\n />\n <ScrollButton\n color=\"white\"\n rotationDegrees={0}\n isVisible={isMaxRight}\n isRightButton\n onClick={() => scrollButtonHandler({ isLeftArrow: false })}\n />\n {products.map((product, productsArrayIndex) => {\n const groupIsActive =\n product.productListGroup?.id === activeGroup;\n\n const productListGroup = products.filter(\n (product) => activeGroup === product.productListGroup?.id,\n );\n\n const groupIndex = productListGroup.findIndex(\n (item) => item.id === product.id,\n );\n\n return (\n <Product\n onClick={() =>\n setActiveGroup(\n product.productListGroup?.id as ProductListGroupId,\n )\n }\n key={product.id}\n groupIndex={groupIndex}\n groupLength={productListGroup.length}\n id={product?.id as ProductId}\n groupId={product.productListGroup?.id as ProductListGroupId}\n image={product.image ?? { src: \"\", width: 0, height: 0 }}\n name={product.title}\n description={product.description}\n selectedProducts={selectedProducts}\n setSelectedProducts={setSelectedProducts}\n setExternalState={setExternalState}\n groupIsActive={groupIsActive}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n selectedProductsLimit={selectedProductsLimit}\n showProductGroups={showProductGroups}\n isStaticProduct={productsArrayIndex === 0}\n isOverviewPage={isOverviewPage}\n />\n );\n })}\n </S.ProductList>\n </S.ProductGroupProductListContainer>\n </S.Container>\n </S.Wrapper>\n );\n};\n"],"names":["ProductList","products","selectedProducts","setSelectedProducts","hasBeenObserved","selectedProductsLimit","initialActiveGroup","setExternalState","showProductGroups","isOverviewPage","groupedGroups","groupProducts","moreThanOneGroupExists","length","containerRef","useRef","productListRef","buttonHasBeenClick","setButtonHasBeenClicked","useState","activeGroup","setActiveGroup","playAnimation","setPlayAnimation","isHovering","useHoverDirty","isDragging","setIsDragging","overflowExists","setOverflowExists","endPosition","setEndPosition","checkForScrollTimeout","useEffectOnce","refsExist","current","getBoundingClientRect","width","useEffect","productListGroup","id","productListInitialPosition","left","setTimeout","currentPosition","dragStartingPosition","scrollAmount","dragHandler","useCallback","event","clientX","scrollTo","mouseUpHandler","scrollLeft","document","removeEventListener","mouseDownHandler","buttons","addEventListener","container","isScrolling","scrollHandler","window","clearTimeout","tabClickHandler","groupId","initialScrollPosition","checkForScroll","currentScrollPosition","element","getElementById","scrollIntoView","behavior","inline","block","scrollButtonHandler","isLeftArrow","scrollLength","S.PRODUCT_CARD_WIDTH","S.PRODUCT_LIST_GRID_GAP","isMaxLeft","isMaxRight","useIsAtMaxScroll","jsxs","S.Wrapper","children","jsx","ButtonGroup","items","map","group","activeButton","onClick","S.Container","ref","$isHovering","$moreThanOneGroupExists","$isDragging","S.ProductGroupProductListContainer","ProductGroups","canPlayAniimation","S.ProductList","$columns","$overflowExists","onMouseDown","onMouseUp","ScrollButton","color","rotationDegrees","isVisible","isRightButton","product","productsArrayIndex","groupIsActive","filter","groupIndex","findIndex","item","Product","groupLength","image","src","height","name","title","description","isStaticProduct"],"mappings":";;;;;;;;;;;;AAgBO,MAAMA,cAAcA,CAAC;EAC1BC,QAAA;EACAC,gBAAA;EACAC,mBAAA;EACAC,eAAA;EACAC,qBAAA;EACAC,kBAAA;EACAC,gBAAA;EACAC,iBAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAAC,aAAA,GAAgBC,cAAcV,QAAQ,CAAA;EACtC,MAAAW,sBAAA,GAAyBF,cAAcG,MAAS,GAAA,CAAA;EAEhD,MAAAC,YAAA,GAAeC,OAAuB,IAAI,CAAA;EAC1C,MAAAC,cAAA,GAAiBD,OAAuB,IAAI,CAAA;EAElD,MAAM,CAACE,kBAAA,EAAoBC,uBAAuB,CAAA,GAAIC,SAAS,KAAK,CAAA;EACpE,MAAM,CAACC,WAAA,EAAaC,cAAc,CAAA,GAAIF,SAASb,kBAAkB,CAAA;EACjE,MAAM,CAACgB,aAAA,EAAeC,gBAAgB,CAAA,GAAIJ,SAAS,KAAK,CAAA;EAClD,MAAAK,UAAA,GAAaC,cAAcX,YAAY,CAAA;EAC7C,MAAM,CAACY,UAAA,EAAYC,aAAa,CAAA,GAAIR,SAAS,KAAK,CAAA;EAClD,MAAM,CAACS,cAAA,EAAgBC,iBAAiB,CAAA,GAAIV,SAAS,IAAI,CAAA;EACzD,MAAM,CAACW,WAAA,EAAaC,cAAc,CAAA,GAAIZ,SAAiB,CAAC,CAAA;EACxD,MAAMa,qBAAwB,GAAA,GAAA;EAE9BC,aAAA,CAAc,MAAM;IACZ,MAAAC,SAAA,GAAYpB,YAAa,CAAAqB,OAAA,IAAWnB,cAAe,CAAAmB,OAAA;IAEvD,IAAAD,SAAA,IACApB,YAAa,CAAAqB,OAAA,EAASC,qBAAsB,CAAA,CAAA,CAAEC,QAC5CrB,cAAe,CAAAmB,OAAA,EAASC,qB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,CAAA;cACvDC,MAAMZ,OAAQ,CAAAa,KAAA;cACdC,aAAad,OAAQ,CAAAc,WAAA;cACrB3H,gBAAA;cACAC,mBAAA;cACAI,gBAAA;cACA0G,aAAA;cACA3F,aAAA;cACA8E,mBAAmBhG,eAAmB,IAAAa,kBAAA;cACtCZ,qBAAA;cACAG,iBAAA;cACAsH,iBAAiBd,kBAAuB,KAAA,CAAA;cACxCvG;YAAA,CAAA,EAjBKsG,OAAQ,CAAAvE,EAkBf,CAAA;UAEH,CAAA,CAAA;QAAA,CAAA,CAAA;MAEL,CAAA;IAAA,CAAA,CAAA;GAEJ,CAAA;AAEJ,CAAA;"}
@@ -12,7 +12,7 @@ require('./assets/attention.svg.js');
12
12
  var InputCard_styles = require('./InputCard.styles.js');
13
13
  require('./InputSections/index.js');
14
14
  var CustomImage = require('../../../../CustomImage/CustomImage.js');
15
- var attentionIcon = require("../../../../../assets/attention.svg");
15
+ var attentionIcon = require("../../../../../assets/attention2.svg");
16
16
  var OptionSelectSection = require('./InputSections/OptionSelectSection.js');
17
17
  var SliderSection = require('./InputSections/SliderSection.js');
18
18
  var CounterSection = require('./InputSections/CounterSection.js');
@@ -10,7 +10,7 @@ import './assets/attention.svg.mjs';
10
10
  import { Card, Header, HeaderHeadingSection, HeadingIcon, HeadingTitle, HeaderActionSection, SubduedInfo, OverlayFilter, NotAvailableNoteWrap, NotAvailableNoteIcon, InputBody, InputSectionSpacing, Footer, FooterContent, FooterNote } from './InputCard.styles.mjs';
11
11
  import './InputSections/index.mjs';
12
12
  import { CustomImage } from '../../../../CustomImage/CustomImage.mjs';
13
- import attentionIcon__default from "../../../../../assets/attention.svg";
13
+ import attentionIcon__default from "../../../../../assets/attention2.svg";
14
14
  import { OptionSelectSection } from './InputSections/OptionSelectSection.mjs';
15
15
  import { SliderSection } from './InputSections/SliderSection.mjs';
16
16
  import { CounterSection } from './InputSections/CounterSection.mjs';
@@ -11,8 +11,8 @@ require('../assets/plus.svg.js');
11
11
  var Layout_styles = require('./Layout.styles.js');
12
12
  var CustomImage = require('../../../../../CustomImage/CustomImage.js');
13
13
  var StyleableSvgImage = require('../../../../../StyleableSvgImage/StyleableSvgImage.js');
14
- var MinusIcon = require("../../../../../../assets/minus4.svg");
15
- var PlusIcon = require("../../../../../../assets/plus4.svg");
14
+ var MinusIcon = require("../../../../../../assets/minus5.svg");
15
+ var PlusIcon = require("../../../../../../assets/plus5.svg");
16
16
  function _interopDefault(e) {
17
17
  return e && e.__esModule ? e : {
18
18
  default: e