@anker-in/headless-ui 1.1.13 → 1.1.14

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 (347) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.d.ts +1 -1
  2. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  3. package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
  4. package/dist/cjs/biz-components/AiuiProvider/index.js.map +2 -2
  5. package/dist/cjs/biz-components/AplusDesc/index.js +1 -1
  6. package/dist/cjs/biz-components/AplusDesc/index.js.map +3 -3
  7. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
  8. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +1 -1
  9. package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
  10. package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
  11. package/dist/cjs/biz-components/Category/index.d.ts +1 -1
  12. package/dist/cjs/biz-components/Category/index.js +1 -1
  13. package/dist/cjs/biz-components/Category/index.js.map +1 -1
  14. package/dist/cjs/biz-components/CreativeModule/index.js +1 -1
  15. package/dist/cjs/biz-components/CreativeModule/index.js.map +2 -2
  16. package/dist/cjs/biz-components/DownLoad/index.js +1 -1
  17. package/dist/cjs/biz-components/DownLoad/index.js.map +3 -3
  18. package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -1
  19. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  20. package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
  21. package/dist/cjs/biz-components/Faq/Faq.js +1 -1
  22. package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
  23. package/dist/cjs/biz-components/Features/index.js +1 -1
  24. package/dist/cjs/biz-components/Features/index.js.map +3 -3
  25. package/dist/cjs/biz-components/FootCharger/index.js +1 -1
  26. package/dist/cjs/biz-components/FootCharger/index.js.map +3 -3
  27. package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
  28. package/dist/cjs/biz-components/FooterNavigation/index.js.map +1 -1
  29. package/dist/cjs/biz-components/FooterNavigation/types.d.ts +1 -1
  30. package/dist/cjs/biz-components/FooterNavigation/types.js.map +1 -1
  31. package/dist/cjs/biz-components/GiftBox/index.js +1 -1
  32. package/dist/cjs/biz-components/GiftBox/index.js.map +3 -3
  33. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  34. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  35. package/dist/cjs/biz-components/GraphicMore/index.js +1 -1
  36. package/dist/cjs/biz-components/GraphicMore/index.js.map +3 -3
  37. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  38. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
  39. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.d.ts +5 -5
  40. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js +1 -1
  41. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
  42. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  43. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +2 -2
  44. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +7 -7
  45. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  46. package/dist/cjs/biz-components/HeaderNavigation/types.js.map +3 -3
  47. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +1 -1
  48. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +2 -2
  49. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +1 -1
  50. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
  51. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +2 -2
  52. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +1 -1
  53. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js +1 -1
  54. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js.map +2 -2
  55. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +1 -1
  56. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  57. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
  58. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  59. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -2
  60. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +1 -1
  61. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +1 -1
  62. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +1 -1
  63. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +3 -3
  64. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +1 -1
  65. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +1 -1
  66. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +2 -2
  67. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +1 -1
  68. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +1 -1
  69. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +3 -3
  70. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  71. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  72. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +3 -3
  73. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +1 -1
  74. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +2 -2
  75. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  76. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
  77. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +2 -2
  78. package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
  79. package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +3 -3
  80. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  81. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  82. package/dist/cjs/biz-components/SelectStore/index.js +1 -1
  83. package/dist/cjs/biz-components/SelectStore/index.js.map +1 -1
  84. package/dist/cjs/biz-components/Specs/index.js +1 -1
  85. package/dist/cjs/biz-components/Specs/index.js.map +1 -1
  86. package/dist/cjs/biz-components/Subscribe/index.js +2 -2
  87. package/dist/cjs/biz-components/Subscribe/index.js.map +1 -1
  88. package/dist/cjs/biz-components/TextModal/index.js +1 -1
  89. package/dist/cjs/biz-components/TextModal/index.js.map +1 -1
  90. package/dist/cjs/biz-components/Title/index.js +1 -1
  91. package/dist/cjs/biz-components/Title/index.js.map +1 -1
  92. package/dist/cjs/components/ExposureDetector.d.ts +3 -3
  93. package/dist/cjs/components/ExposureDetector.js.map +1 -1
  94. package/dist/cjs/components/alert.d.ts +5 -0
  95. package/dist/cjs/components/alert.js.map +2 -2
  96. package/dist/cjs/components/avatar.d.ts +5 -0
  97. package/dist/cjs/components/avatar.js.map +2 -2
  98. package/dist/cjs/components/badge.d.ts +5 -0
  99. package/dist/cjs/components/badge.js.map +2 -2
  100. package/dist/cjs/components/board.d.ts +5 -0
  101. package/dist/cjs/components/board.js +1 -1
  102. package/dist/cjs/components/board.js.map +2 -2
  103. package/dist/cjs/components/button.d.ts +5 -0
  104. package/dist/cjs/components/button.js.map +2 -2
  105. package/dist/cjs/components/carousel.js +1 -1
  106. package/dist/cjs/components/carousel.js.map +1 -1
  107. package/dist/cjs/components/checkbox.d.ts +5 -0
  108. package/dist/cjs/components/checkbox.js.map +2 -2
  109. package/dist/cjs/components/color.d.ts +7 -1
  110. package/dist/cjs/components/color.js +1 -1
  111. package/dist/cjs/components/color.js.map +2 -2
  112. package/dist/cjs/components/container.d.ts +5 -0
  113. package/dist/cjs/components/container.js.map +2 -2
  114. package/dist/cjs/components/{gird.d.ts → grid.d.ts} +5 -0
  115. package/dist/cjs/components/{gird.js → grid.js} +1 -1
  116. package/dist/cjs/components/{gird.js.map → grid.js.map} +4 -4
  117. package/dist/cjs/components/heading.d.ts +5 -0
  118. package/dist/cjs/components/heading.js.map +2 -2
  119. package/dist/cjs/components/index.d.ts +1 -1
  120. package/dist/cjs/components/index.js +1 -1
  121. package/dist/cjs/components/index.js.map +2 -2
  122. package/dist/cjs/components/input-number.d.ts +5 -0
  123. package/dist/cjs/components/input-number.js.map +2 -2
  124. package/dist/cjs/components/input.d.ts +5 -0
  125. package/dist/cjs/components/input.js.map +2 -2
  126. package/dist/cjs/components/link.d.ts +5 -0
  127. package/dist/cjs/components/link.js.map +2 -2
  128. package/dist/cjs/components/loadingDots.d.ts +5 -0
  129. package/dist/cjs/components/loadingDots.js.map +2 -2
  130. package/dist/cjs/components/picture.d.ts +5 -0
  131. package/dist/cjs/components/picture.js +1 -1
  132. package/dist/cjs/components/picture.js.map +3 -3
  133. package/dist/cjs/components/radio.d.ts +5 -0
  134. package/dist/cjs/components/radio.js.map +2 -2
  135. package/dist/cjs/components/skeleton.d.ts +5 -0
  136. package/dist/cjs/components/skeleton.js.map +2 -2
  137. package/dist/cjs/components/tabs.js +1 -1
  138. package/dist/cjs/components/tabs.js.map +1 -1
  139. package/dist/cjs/components/text.d.ts +5 -0
  140. package/dist/cjs/components/text.js.map +2 -2
  141. package/dist/cjs/components/theme.d.ts +4 -3
  142. package/dist/cjs/components/theme.js.map +2 -2
  143. package/dist/cjs/cpn-components/CpnNavigation/index.js +1 -1
  144. package/dist/cjs/cpn-components/CpnNavigation/index.js.map +3 -3
  145. package/dist/cjs/helpers/ScrollLoadVideo.d.ts +5 -4
  146. package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
  147. package/dist/cjs/helpers/ScrollLoadVideo.js.map +3 -3
  148. package/dist/cjs/shared/Styles.js +1 -1
  149. package/dist/cjs/shared/Styles.js.map +2 -2
  150. package/dist/cjs/stories/HeroBanner.stories.d.ts +3 -2
  151. package/dist/cjs/stories/HeroBanner.stories.js +2 -2
  152. package/dist/cjs/stories/HeroBanner.stories.js.map +3 -3
  153. package/dist/cjs/stories/container.stories.js +1 -1
  154. package/dist/cjs/stories/container.stories.js.map +3 -3
  155. package/dist/cjs/stories/faq.stories.js.map +2 -2
  156. package/dist/cjs/stories/graphic.stories.js +1 -1
  157. package/dist/cjs/stories/graphic.stories.js.map +3 -3
  158. package/dist/cjs/stories/graphicAttractionBlock.stories.js +1 -1
  159. package/dist/cjs/stories/graphicAttractionBlock.stories.js.map +3 -3
  160. package/dist/cjs/stories/grid.stories.js +1 -1
  161. package/dist/cjs/stories/grid.stories.js.map +2 -2
  162. package/dist/cjs/stories/heading.stories.js +4 -2
  163. package/dist/cjs/stories/heading.stories.js.map +2 -2
  164. package/dist/cjs/stories/picture.stories.d.ts +1 -0
  165. package/dist/cjs/stories/picture.stories.js +2 -2
  166. package/dist/cjs/stories/picture.stories.js.map +3 -3
  167. package/dist/cjs/stories/shelfDisplay.stories.js +1 -1
  168. package/dist/cjs/stories/shelfDisplay.stories.js.map +3 -3
  169. package/dist/cjs/stories/tabs.stories.d.ts +2 -2
  170. package/dist/cjs/stories/text.stories.js +4 -2
  171. package/dist/cjs/stories/text.stories.js.map +2 -2
  172. package/dist/esm/biz-components/AccordionCards/index.d.ts +1 -1
  173. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  174. package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
  175. package/dist/esm/biz-components/AiuiProvider/index.js.map +2 -2
  176. package/dist/esm/biz-components/AplusDesc/index.js +1 -1
  177. package/dist/esm/biz-components/AplusDesc/index.js.map +3 -3
  178. package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
  179. package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +1 -1
  180. package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
  181. package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
  182. package/dist/esm/biz-components/Category/index.d.ts +1 -1
  183. package/dist/esm/biz-components/Category/index.js +1 -1
  184. package/dist/esm/biz-components/Category/index.js.map +1 -1
  185. package/dist/esm/biz-components/CreativeModule/index.js +1 -1
  186. package/dist/esm/biz-components/CreativeModule/index.js.map +1 -1
  187. package/dist/esm/biz-components/DownLoad/index.js +1 -1
  188. package/dist/esm/biz-components/DownLoad/index.js.map +2 -2
  189. package/dist/esm/biz-components/Evaluate/index.d.ts +1 -1
  190. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  191. package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
  192. package/dist/esm/biz-components/Faq/Faq.js +1 -1
  193. package/dist/esm/biz-components/Faq/Faq.js.map +2 -2
  194. package/dist/esm/biz-components/Features/index.js +1 -1
  195. package/dist/esm/biz-components/Features/index.js.map +3 -3
  196. package/dist/esm/biz-components/FootCharger/index.js +1 -1
  197. package/dist/esm/biz-components/FootCharger/index.js.map +2 -2
  198. package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
  199. package/dist/esm/biz-components/FooterNavigation/index.js.map +1 -1
  200. package/dist/esm/biz-components/FooterNavigation/types.d.ts +1 -1
  201. package/dist/esm/biz-components/FooterNavigation/types.js.map +1 -1
  202. package/dist/esm/biz-components/GiftBox/index.js +1 -1
  203. package/dist/esm/biz-components/GiftBox/index.js.map +3 -3
  204. package/dist/esm/biz-components/Graphic/index.js +1 -1
  205. package/dist/esm/biz-components/Graphic/index.js.map +2 -2
  206. package/dist/esm/biz-components/GraphicMore/index.js +1 -1
  207. package/dist/esm/biz-components/GraphicMore/index.js.map +2 -2
  208. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  209. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
  210. package/dist/esm/biz-components/HeaderNavigation/NavProvider.d.ts +5 -5
  211. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js +1 -1
  212. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
  213. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  214. package/dist/esm/biz-components/HeaderNavigation/index.js.map +2 -2
  215. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +7 -7
  216. package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
  217. package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
  218. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +1 -1
  219. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +3 -3
  220. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +1 -1
  221. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
  222. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +2 -2
  223. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +1 -1
  224. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js +1 -1
  225. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js.map +2 -2
  226. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +1 -1
  227. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  228. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
  229. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  230. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  231. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -2
  232. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +1 -1
  233. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +1 -1
  234. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +1 -1
  235. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +3 -3
  236. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +1 -1
  237. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +2 -2
  238. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +1 -1
  239. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +1 -1
  240. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +3 -3
  241. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  242. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  243. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +3 -3
  244. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +1 -1
  245. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  246. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +2 -2
  247. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  248. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
  249. package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +2 -2
  250. package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
  251. package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +2 -2
  252. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  253. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +1 -1
  254. package/dist/esm/biz-components/SelectStore/index.js +1 -1
  255. package/dist/esm/biz-components/SelectStore/index.js.map +1 -1
  256. package/dist/esm/biz-components/Specs/index.js +1 -1
  257. package/dist/esm/biz-components/Specs/index.js.map +1 -1
  258. package/dist/esm/biz-components/Subscribe/index.js +2 -2
  259. package/dist/esm/biz-components/Subscribe/index.js.map +1 -1
  260. package/dist/esm/biz-components/TextModal/index.js +1 -1
  261. package/dist/esm/biz-components/TextModal/index.js.map +1 -1
  262. package/dist/esm/biz-components/Title/index.js +1 -1
  263. package/dist/esm/biz-components/Title/index.js.map +1 -1
  264. package/dist/esm/components/ExposureDetector.d.ts +3 -3
  265. package/dist/esm/components/ExposureDetector.js.map +1 -1
  266. package/dist/esm/components/alert.d.ts +5 -0
  267. package/dist/esm/components/alert.js.map +2 -2
  268. package/dist/esm/components/avatar.d.ts +5 -0
  269. package/dist/esm/components/avatar.js.map +2 -2
  270. package/dist/esm/components/badge.d.ts +5 -0
  271. package/dist/esm/components/badge.js.map +2 -2
  272. package/dist/esm/components/board.d.ts +5 -0
  273. package/dist/esm/components/board.js +1 -1
  274. package/dist/esm/components/board.js.map +2 -2
  275. package/dist/esm/components/button.d.ts +5 -0
  276. package/dist/esm/components/button.js.map +2 -2
  277. package/dist/esm/components/carousel.js +1 -1
  278. package/dist/esm/components/carousel.js.map +1 -1
  279. package/dist/esm/components/checkbox.d.ts +5 -0
  280. package/dist/esm/components/checkbox.js.map +2 -2
  281. package/dist/esm/components/color.d.ts +7 -1
  282. package/dist/esm/components/color.js +1 -1
  283. package/dist/esm/components/color.js.map +2 -2
  284. package/dist/esm/components/container.d.ts +5 -0
  285. package/dist/esm/components/container.js.map +2 -2
  286. package/dist/esm/components/{gird.d.ts → grid.d.ts} +5 -0
  287. package/dist/esm/components/{gird.js → grid.js} +1 -1
  288. package/dist/esm/components/{gird.js.map → grid.js.map} +3 -3
  289. package/dist/esm/components/heading.d.ts +5 -0
  290. package/dist/esm/components/heading.js.map +2 -2
  291. package/dist/esm/components/index.d.ts +1 -1
  292. package/dist/esm/components/index.js +1 -1
  293. package/dist/esm/components/index.js.map +1 -1
  294. package/dist/esm/components/input-number.d.ts +5 -0
  295. package/dist/esm/components/input-number.js.map +2 -2
  296. package/dist/esm/components/input.d.ts +5 -0
  297. package/dist/esm/components/input.js.map +2 -2
  298. package/dist/esm/components/link.d.ts +5 -0
  299. package/dist/esm/components/link.js.map +2 -2
  300. package/dist/esm/components/loadingDots.d.ts +5 -0
  301. package/dist/esm/components/loadingDots.js.map +2 -2
  302. package/dist/esm/components/picture.d.ts +5 -0
  303. package/dist/esm/components/picture.js +1 -1
  304. package/dist/esm/components/picture.js.map +3 -3
  305. package/dist/esm/components/radio.d.ts +5 -0
  306. package/dist/esm/components/radio.js.map +2 -2
  307. package/dist/esm/components/skeleton.d.ts +5 -0
  308. package/dist/esm/components/skeleton.js.map +2 -2
  309. package/dist/esm/components/tabs.js +1 -1
  310. package/dist/esm/components/tabs.js.map +1 -1
  311. package/dist/esm/components/text.d.ts +5 -0
  312. package/dist/esm/components/text.js.map +2 -2
  313. package/dist/esm/components/theme.d.ts +4 -3
  314. package/dist/esm/components/theme.js.map +2 -2
  315. package/dist/esm/cpn-components/CpnNavigation/index.js +1 -1
  316. package/dist/esm/cpn-components/CpnNavigation/index.js.map +2 -2
  317. package/dist/esm/helpers/ScrollLoadVideo.d.ts +5 -4
  318. package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
  319. package/dist/esm/helpers/ScrollLoadVideo.js.map +3 -3
  320. package/dist/esm/shared/Styles.js +1 -1
  321. package/dist/esm/shared/Styles.js.map +1 -1
  322. package/dist/esm/stories/HeroBanner.stories.d.ts +3 -2
  323. package/dist/esm/stories/HeroBanner.stories.js +2 -2
  324. package/dist/esm/stories/HeroBanner.stories.js.map +3 -3
  325. package/dist/esm/stories/container.stories.js +2 -2
  326. package/dist/esm/stories/container.stories.js.map +2 -2
  327. package/dist/esm/stories/faq.stories.js.map +2 -2
  328. package/dist/esm/stories/graphic.stories.js +1 -1
  329. package/dist/esm/stories/graphic.stories.js.map +2 -2
  330. package/dist/esm/stories/graphicAttractionBlock.stories.js +1 -1
  331. package/dist/esm/stories/graphicAttractionBlock.stories.js.map +2 -2
  332. package/dist/esm/stories/grid.stories.js +1 -1
  333. package/dist/esm/stories/grid.stories.js.map +1 -1
  334. package/dist/esm/stories/heading.stories.js +4 -2
  335. package/dist/esm/stories/heading.stories.js.map +3 -3
  336. package/dist/esm/stories/picture.stories.d.ts +1 -0
  337. package/dist/esm/stories/picture.stories.js +2 -2
  338. package/dist/esm/stories/picture.stories.js.map +3 -3
  339. package/dist/esm/stories/shelfDisplay.stories.js +1 -1
  340. package/dist/esm/stories/shelfDisplay.stories.js.map +2 -2
  341. package/dist/esm/stories/tabs.stories.d.ts +2 -2
  342. package/dist/esm/stories/text.stories.js +5 -3
  343. package/dist/esm/stories/text.stories.js.map +3 -3
  344. package/dist/tokens/base.css +50 -82
  345. package/package.json +3 -2
  346. package/style.css +15 -70
  347. package/tailwind.config.js +8 -31
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.tsx"],
4
- "sourcesContent": ["import React, { useState, useEffect, useRef } from 'react'\nimport { useMediaQuery } from 'react-responsive'\nimport type { MultiLayoutGraphicBlockProps, Item } from './types'\nimport { withLayout } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport { Heading } from '../../components/heading.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport Title from '../Title/index.js'\nimport { cn, spaceToHyphen } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { gaTrack } from '../../shared/track.js'\n\nconst componentType = 'image'\nconst componentName = 'p1_banner'\n\nconst ItemBlock = ({\n data: item,\n configuration,\n jIndex,\n spanType,\n title: titleProp,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n}: {\n data: Item\n configuration?: any\n jIndex?: number\n spanType?: string\n title?: string\n onSecondaryButtonClick?: (data: Item) => void\n onPrimaryButtonClick?: (data: Item) => void\n}) => {\n const [isMobile, setIsMobile] = useState<boolean>(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n const ref = useRef<HTMLDivElement>(null)\n\n const handleAspect = () => {\n if (spanType) {\n switch (spanType) {\n case 'full':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 'half':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 'one-third':\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n } else {\n switch (configuration?.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n }\n }\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: jIndex,\n componentTitle: item.title,\n componentDescription: item.description,\n navigation: configuration?.activeTab,\n })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const {\n theme = 'light',\n title,\n description,\n imageUrl,\n primaryButton,\n secondaryButton,\n imageMobileUrl,\n blockLink,\n video,\n youtubeId,\n isYouTube,\n } = item\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <div\n className={cn(\n 'item-wrapper cursor-pointer',\n 'text-info-primary group relative box-border w-full overflow-hidden',\n handleAspect(),\n {\n 'rounded-2xl': configuration?.shape === 'rounded',\n 'aiui-dark': theme === 'dark',\n 'h-[400px]': isMobile,\n },\n `text-info-primary`\n )}\n ref={ref}\n >\n {(blockLink || secondaryButton.link) && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(blockLink || secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n )}\n <div className=\"absolute inset-0\">\n {isVideo(imageUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:block hidden size-full overflow-hidden object-cover\">\n <source src={imageUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageUrl?.url}\n alt={imageUrl?.alt || ''}\n className=\"tablet:block hidden h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 group-hover:scale-105 object-cover\"\n style={{ aspectRatio: `${imageUrl?.width}/${imageUrl?.height}` }}\n />\n )}\n {isVideo(imageMobileUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:hidden block size-full overflow-hidden object-cover\">\n <source src={imageMobileUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageMobileUrl?.url || imageUrl?.url}\n alt={imageMobileUrl?.alt || imageUrl?.alt || ''}\n className=\"tablet:hidden block h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 object-cover\"\n />\n )}\n <div\n className={cn(\n 'absolutestyle laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4',\n {\n 'fullstyle laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto': item?.width === 'full',\n }\n )}\n >\n <div className=\"flex flex-col gap-1\">\n <Heading size={3} as=\"h3\" className=\"item-title\" html={title} />\n <Heading\n as=\"h4\"\n className=\"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]\"\n html={description}\n />\n </div>\n <div className=\"lg-desktop:gap-3 flex gap-2\">\n {secondaryButton && secondaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-left')}\n variant=\"secondary\"\n as=\"a\"\n onClick={() => {\n onSecondaryButtonClick?.(item)\n }}\n href={trackUrlRef(secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${secondaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {secondaryButton.text}\n <span className=\"sr-only\">{title ?? description}</span>\n </Button>\n )}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-right')}\n variant=\"primary\"\n as=\"a\"\n onClick={() => {\n onPrimaryButtonClick?.(item)\n }}\n href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${primaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n </div>\n </div>\n <div>\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4 z-20\">\n {(video?.url || youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(video?.url || youtubeId, isYouTube)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MultiLayoutGraphicBlock = React.forwardRef<HTMLDivElement, MultiLayoutGraphicBlockProps>((props, ref) => {\n const { onSecondaryButtonClick, onPrimaryButtonClick } = props\n const { shape, sectionTitle, groupByTab = false, items = [], carousel } = props.data\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n\n const getSpan = (width: 'full' | 'half' | 'one-third') => {\n switch (width) {\n case 'full':\n return 12\n case 'half':\n return 6\n case 'one-third':\n return 4\n }\n }\n\n const tabNames = items\n .map(item => item.tabName)\n .filter(Boolean)\n .filter((item, index, arr) => arr.indexOf(item) === index) as string[]\n\n const handleVideoPlayBtnClick = (url: string, isYouTube: boolean) => {\n setVisible(true)\n if (isYouTube) {\n setYouTubeId?.(url || '')\n } else {\n setVideoUrl?.(url || '')\n }\n }\n const handleTabNumber = (num: Number, flag?: boolean) => {\n switch (num) {\n case 1:\n return 1\n case 2:\n return 2\n default:\n return flag ? 2.3 : 3\n }\n }\n\n const tabItemsMaps = tabNames\n .map(tabName => ({\n tabName,\n items: items.filter(item => item.tabName === tabName),\n }))\n .reduce(\n (acc, cur) => {\n acc[cur.tabName] = cur.items\n return acc\n },\n {} as Record<string, (Item & { width?: 'full' | 'half' | 'one-third' })[]>\n )\n\n return (\n <section\n data-ui-component-id=\"MultiLayoutGraphicBlock\"\n ref={ref}\n className={cn('multiLayoutGraphicBlock', 'text-info-primary', props.className)}\n >\n {sectionTitle && <Title data={{ title: sectionTitle }} className=\"section-title\" />}\n\n {groupByTab ? (\n <Tabs shape={shape} align=\"left\" defaultValue={spaceToHyphen(tabNames[0]!)}>\n <TabsList>\n {tabNames.map((tabName, index) => (\n <TabsTrigger\n key={index}\n value={spaceToHyphen(tabName!)}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: sectionTitle,\n component_position: 1,\n navigation: tabName,\n button_name: tabName,\n },\n })\n }}\n >\n {tabName}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabNames.map((tabName, index) => (\n <TabsContent key={index} value={spaceToHyphen(tabName!)} className=\"desktop:mt-[36px] mt-[24px] w-full\">\n <>\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock1'}\n data={{\n list: tabItemsMaps?.[tabName] || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n activeTab: tabName,\n title: sectionTitle,\n num: tabItemsMaps?.[tabName]?.length || 0,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0, true),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0),\n },\n }}\n />\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock2'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <>\n <Grid className=\"w-full\">\n {items.map((item, index) => {\n return (\n <GridItem\n key={`${item?.title || ''}${index}`}\n span={getSpan(item.width ?? 'full')}\n className=\"laptop:block hidden\"\n >\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={item.width}\n onSecondaryButtonClick={onSecondaryButtonClick}\n onPrimaryButtonClick={onPrimaryButtonClick}\n />\n </GridItem>\n )\n })}\n {items.map((item, index) => (\n <GridItem key={`${item?.title || ''}${index}`} span={getSpan('full')} className=\"laptop:hidden block\">\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={'full'}\n />\n </GridItem>\n ))}\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock3'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n )}\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </section>\n )\n})\n\nMultiLayoutGraphicBlock.displayName = 'MultiLayoutGraphicBlock'\n\nexport default withLayout(MultiLayoutGraphicBlock)\nexport type { MultiLayoutGraphicBlockProps }\n"],
4
+ "sourcesContent": ["import React, { useState, useEffect, useRef } from 'react'\nimport { useMediaQuery } from 'react-responsive'\nimport type { MultiLayoutGraphicBlockProps, Item } from './types'\nimport { withLayout } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport { Heading } from '../../components/heading.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { Grid, GridItem } from '../../components/grid.js'\nimport Title from '../Title/index.js'\nimport { cn, spaceToHyphen } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { gaTrack } from '../../shared/track.js'\n\nconst componentType = 'image'\nconst componentName = 'p1_banner'\n\nconst ItemBlock = ({\n data: item,\n configuration,\n jIndex,\n spanType,\n title: titleProp,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n}: {\n data: Item\n configuration?: any\n jIndex?: number\n spanType?: string\n title?: string\n onSecondaryButtonClick?: (data: Item) => void\n onPrimaryButtonClick?: (data: Item) => void\n}) => {\n const [isMobile, setIsMobile] = useState<boolean>(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n const ref = useRef<HTMLDivElement>(null)\n\n const handleAspect = () => {\n if (spanType) {\n switch (spanType) {\n case 'full':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 'half':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 'one-third':\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n } else {\n switch (configuration?.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n }\n }\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: jIndex,\n componentTitle: item.title,\n componentDescription: item.description,\n navigation: configuration?.activeTab,\n })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const {\n theme = 'light',\n title,\n description,\n imageUrl,\n primaryButton,\n secondaryButton,\n imageMobileUrl,\n blockLink,\n video,\n youtubeId,\n isYouTube,\n } = item\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <div\n className={cn(\n 'item-wrapper cursor-pointer',\n 'text-info-primary group relative box-border w-full overflow-hidden',\n handleAspect(),\n {\n 'rounded-2xl': configuration?.shape === 'rounded',\n 'aiui-dark': theme === 'dark',\n 'h-[400px]': isMobile,\n },\n `text-info-primary`\n )}\n ref={ref}\n >\n {(blockLink || secondaryButton.link) && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(blockLink || secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n )}\n <div className=\"absolute inset-0\">\n {isVideo(imageUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:block hidden size-full overflow-hidden object-cover\">\n <source src={imageUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageUrl?.url}\n alt={imageUrl?.alt || ''}\n className=\"tablet:block hidden h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 group-hover:scale-105 object-cover\"\n style={{ aspectRatio: `${imageUrl?.width}/${imageUrl?.height}` }}\n />\n )}\n {isVideo(imageMobileUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:hidden block size-full overflow-hidden object-cover\">\n <source src={imageMobileUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageMobileUrl?.url || imageUrl?.url}\n alt={imageMobileUrl?.alt || imageUrl?.alt || ''}\n className=\"tablet:hidden block h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 object-cover\"\n />\n )}\n <div\n className={cn(\n 'absolutestyle laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4',\n {\n 'fullstyle laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto': item?.width === 'full',\n }\n )}\n >\n <div className=\"flex flex-col gap-1\">\n <Heading size={3} as=\"h3\" className=\"item-title\" html={title} />\n <Heading\n as=\"h4\"\n className=\"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]\"\n html={description}\n />\n </div>\n <div className=\"lg-desktop:gap-3 flex gap-2\">\n {secondaryButton && secondaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-left')}\n variant=\"secondary\"\n as=\"a\"\n onClick={() => {\n onSecondaryButtonClick?.(item)\n }}\n href={trackUrlRef(secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${secondaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {secondaryButton.text}\n <span className=\"sr-only\">{title ?? description}</span>\n </Button>\n )}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-right')}\n variant=\"primary\"\n as=\"a\"\n onClick={() => {\n onPrimaryButtonClick?.(item)\n }}\n href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${primaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n </div>\n </div>\n <div>\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4 z-20\">\n {(video?.url || youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(video?.url || youtubeId, isYouTube)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MultiLayoutGraphicBlock = React.forwardRef<HTMLDivElement, MultiLayoutGraphicBlockProps>((props, ref) => {\n const { onSecondaryButtonClick, onPrimaryButtonClick } = props\n const { shape, sectionTitle, groupByTab = false, items = [], carousel } = props.data\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n\n const getSpan = (width: 'full' | 'half' | 'one-third') => {\n switch (width) {\n case 'full':\n return 12\n case 'half':\n return 6\n case 'one-third':\n return 4\n }\n }\n\n const tabNames = items\n .map(item => item.tabName)\n .filter(Boolean)\n .filter((item, index, arr) => arr.indexOf(item) === index) as string[]\n\n const handleVideoPlayBtnClick = (url: string, isYouTube: boolean) => {\n setVisible(true)\n if (isYouTube) {\n setYouTubeId?.(url || '')\n } else {\n setVideoUrl?.(url || '')\n }\n }\n const handleTabNumber = (num: Number, flag?: boolean) => {\n switch (num) {\n case 1:\n return 1\n case 2:\n return 2\n default:\n return flag ? 2.3 : 3\n }\n }\n\n const tabItemsMaps = tabNames\n .map(tabName => ({\n tabName,\n items: items.filter(item => item.tabName === tabName),\n }))\n .reduce(\n (acc, cur) => {\n acc[cur.tabName] = cur.items\n return acc\n },\n {} as Record<string, (Item & { width?: 'full' | 'half' | 'one-third' })[]>\n )\n\n return (\n <section\n data-ui-component-id=\"MultiLayoutGraphicBlock\"\n ref={ref}\n className={cn('multiLayoutGraphicBlock', 'text-info-primary', props.className)}\n >\n {sectionTitle && <Title data={{ title: sectionTitle }} className=\"section-title\" />}\n\n {groupByTab ? (\n <Tabs shape={shape} align=\"left\" defaultValue={spaceToHyphen(tabNames[0]!)}>\n <TabsList>\n {tabNames.map((tabName, index) => (\n <TabsTrigger\n key={index}\n value={spaceToHyphen(tabName!)}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: sectionTitle,\n component_position: 1,\n navigation: tabName,\n button_name: tabName,\n },\n })\n }}\n >\n {tabName}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabNames.map((tabName, index) => (\n <TabsContent key={index} value={spaceToHyphen(tabName!)} className=\"desktop:mt-[36px] mt-[24px] w-full\">\n <>\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock1'}\n data={{\n list: tabItemsMaps?.[tabName] || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n activeTab: tabName,\n title: sectionTitle,\n num: tabItemsMaps?.[tabName]?.length || 0,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0, true),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0),\n },\n }}\n />\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock2'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <>\n <Grid className=\"w-full\">\n {items.map((item, index) => {\n return (\n <GridItem\n key={`${item?.title || ''}${index}`}\n span={getSpan(item.width ?? 'full')}\n className=\"laptop:block hidden\"\n >\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={item.width}\n onSecondaryButtonClick={onSecondaryButtonClick}\n onPrimaryButtonClick={onPrimaryButtonClick}\n />\n </GridItem>\n )\n })}\n {items.map((item, index) => (\n <GridItem key={`${item?.title || ''}${index}`} span={getSpan('full')} className=\"laptop:hidden block\">\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={'full'}\n />\n </GridItem>\n ))}\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock3'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n )}\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </section>\n )\n})\n\nMultiLayoutGraphicBlock.displayName = 'MultiLayoutGraphicBlock'\n\nexport default withLayout(MultiLayoutGraphicBlock)\nexport type { MultiLayoutGraphicBlockProps }\n"],
5
5
  "mappings": "AAiHQ,OA2MM,YAAAA,EA3MN,OAAAC,EA4CE,QAAA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BC,EACxB,GAXK,GAAGN,GAAM,OAAS,EAAE,GAAGwC,CAAK,EAYnC,CAEH,EACAX,EAAM,IAAI,CAAC7B,EAAMwC,IAChBrE,EAACa,EAAA,CAA8C,KAAMqD,EAAQ,MAAM,EAAG,UAAU,sBAC9E,SAAAlE,EAAC4B,EAAA,CACC,KAAMC,EACN,cAAe,CAAE,MAAO0B,EAAO,oBAAqBgB,EAAyB,MAAOf,CAAa,EACjG,OAAQa,EACR,SAAU,OACZ,GANa,GAAGxC,GAAM,OAAS,EAAE,GAAGwC,CAAK,EAO3C,CACD,GACH,EACCV,GAAYA,GAAU,MAAM,OAAS,EACpC3D,EAACiB,EAAA,CACC,UAAU,oBACV,GAAI,2BACJ,KAAM,CACJ,KAAM0C,GAAU,OAAS,CAAC,EAC1B,cAAe,CACb,MAAOJ,EACP,oBAAqBgB,EACrB,MAAOf,EACP,uBAAAtB,EACA,qBAAAC,CACF,CACF,EACA,MAAOP,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACE,MACN,EAEDgC,GACC5D,EAACW,EAAA,CACC,QAASiD,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CAAC,EAEDR,EAAwB,YAAc,0BAEtC,IAAO2B,GAAQzE,EAAW8C,CAAuB",
6
6
  "names": ["Fragment", "jsx", "jsxs", "React", "useState", "useEffect", "useRef", "useMediaQuery", "withLayout", "Picture", "Button", "Heading", "VideoModal", "Grid", "GridItem", "Title", "cn", "spaceToHyphen", "SwiperBox", "isVideo", "Tabs", "TabsList", "TabsTrigger", "TabsContent", "useExposure", "trackUrlRef", "gaTrack", "componentType", "componentName", "ItemBlock", "item", "configuration", "jIndex", "spanType", "titleProp", "onSecondaryButtonClick", "onPrimaryButtonClick", "isMobile", "setIsMobile", "mediaQuery", "ref", "handleAspect", "theme", "title", "description", "imageUrl", "primaryButton", "secondaryButton", "imageMobileUrl", "blockLink", "video", "youtubeId", "isYouTube", "lgButtonSize", "MultiLayoutGraphicBlock", "props", "shape", "sectionTitle", "groupByTab", "items", "carousel", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "getSpan", "width", "tabNames", "index", "arr", "handleVideoPlayBtnClick", "url", "handleTabNumber", "num", "flag", "tabItemsMaps", "tabName", "acc", "cur", "MultiLayoutGraphicBlock_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as d,jsx as t,jsxs as p}from"react/jsx-runtime";import"../../helpers/utils.js";import"../SwiperBox/index.js";import{withLayout as c}from"../../shared/Styles.js";import{Picture as i,Text as l}from"../../components/index.js";const m=o=>{const{data:s,className:g}=o,{list:a}=s;return t(d,{children:t("div",{className:"",children:t("div",{className:"laptop:grid-cols-3 tablet:grid-cols-2 grid grid-cols-1 gap-4",children:a.map((e,r)=>p("div",{className:"lg-desktop:aspect-[543/320] laptop:aspect-[440/280] tablet:aspect-[346/240] select-store-wrapper rounded-box relative flex aspect-[358/240] flex-col overflow-hidden bg-[#EAEAEC]",children:[t(i,{className:"object-cover",imgClassName:"w-full object-cover",source:`${e?.img?.url}, ${e?.padImg?.url} 1439, ${e?.miniImg?.url} 1023, ${e?.mobileImg?.url} 767`}),p("div",{className:"laptop:px-6 laptop:pb-4 lg-desktop:px-8 lg-desktop:pb-8 px-4 pb-4",children:[t(l,{html:e?.title,className:"lg-desktop:text-[24px] text-[20px] leading-[1.2] text-[#1d1d1f] [&_*_strong]:!font-bold"}),t(l,{html:e?.desc,className:"lg-desktop:text-[16px] line-clamp-1 text-[14px] leading-[1.4] text-[#1d1d1f]"})]})]},r))})})})};var I=c(m);export{I as default};
1
+ "use client";import{Fragment as d,jsx as t,jsxs as p}from"react/jsx-runtime";import"../../helpers/utils.js";import"../SwiperBox/index.js";import{withLayout as c}from"../../shared/Styles.js";import{Picture as i,Text as l}from"../../components/index.js";const m=o=>{const{data:s,className:g}=o,{list:a}=s;return t(d,{children:t("div",{className:"",children:t("div",{className:"laptop:grid-cols-3 tablet:grid-cols-2 grid grid-cols-1 gap-4",children:a.map((e,r)=>p("div",{className:"lg-desktop:aspect-[543/320] laptop:aspect-[440/280] tablet:aspect-[346/240] select-store-wrapper rounded-box relative flex aspect-[358/240] flex-col overflow-hidden bg-[#EAEAEC]",children:[t(i,{className:"object-cover",imgClassName:"w-full object-cover",source:`${e?.img?.url}, ${e?.padImg?.url} 1439, ${e?.miniImg?.url} 1023, ${e?.mobileImg?.url} 767`}),p("div",{className:"laptop:px-6 laptop:pb-4 lg-desktop:px-8 lg-desktop:pb-8 px-4 pb-4",children:[t(l,{html:e?.title,className:"lg-desktop:text-[24px] text-[20px] leading-[1.2] text-[#080A0F] [&_*_strong]:!font-bold"}),t(l,{html:e?.desc,className:"lg-desktop:text-[16px] line-clamp-1 text-[14px] leading-[1.4] text-[#080A0F]"})]})]},r))})})})};var I=c(m);export{I as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/SelectStore/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\n\nexport type SelectStoreDataType = {\n title: string\n desc: string\n img: Img\n mobileImg: Img\n padImg: Img\n miniImg: Img\n // pay: {\n // img: Img\n // }[]\n // delivery: {\n // img: Img\n // }[]\n // service: {\n // title: string\n // img: Img\n // }[]\n}\n\ntype SelectStoreType = {\n data: {\n list: SelectStoreDataType[]\n }\n className?: string\n}\n\nconst SelectStore = (props: SelectStoreType) => {\n const { data, className } = props\n const { list } = data\n // const number = list?.[2]?.service?.length || 0\n return (\n <>\n <div className=\"\">\n <div className=\"laptop:grid-cols-3 tablet:grid-cols-2 grid grid-cols-1 gap-4\">\n {list.map((item, index) => (\n <div\n key={index}\n className=\"lg-desktop:aspect-[543/320] laptop:aspect-[440/280] tablet:aspect-[346/240] select-store-wrapper rounded-box relative flex aspect-[358/240] flex-col overflow-hidden bg-[#EAEAEC]\"\n >\n <Picture\n className=\"object-cover\"\n imgClassName=\"w-full object-cover\"\n source={`${item?.img?.url}, ${item?.padImg?.url} 1439, ${item?.miniImg?.url} 1023, ${item?.mobileImg?.url} 767`}\n />\n <div className=\"laptop:px-6 laptop:pb-4 lg-desktop:px-8 lg-desktop:pb-8 px-4 pb-4\">\n <Text\n html={item?.title}\n className=\"lg-desktop:text-[24px] text-[20px] leading-[1.2] text-[#1d1d1f] [&_*_strong]:!font-bold\"\n />\n <Text\n html={item?.desc}\n className=\"lg-desktop:text-[16px] line-clamp-1 text-[14px] leading-[1.4] text-[#1d1d1f]\"\n />\n </div>\n </div>\n ))}\n </div>\n {/* <div className='grid desktop:grid-cols-3 tablet:grid-cols-2 grid-cols-1 gap-4'>\n {list.map((item, index) => (\n <div key={index} className='bg-[#EAEAEC] rounded-2xl min-h-[240px] laptop:min-h-[280px] lg-desktop:min-h-[320px]'>\n <div className='flex flex-col laptop:p-[24px] lg-desktop:p-[32px] p-[16px] justify-start h-full'>\n <div className=\"flex flex-col justify-center flex-1\">\n \n {item?.pay && (\n <div className='flex gap-[16px] flex-wrap items-center justify-center laptop:gap-[24px]'>\n {item?.pay?.map((pay, ind)=>{\n return (\n <div key={ind} className='laptop:w-[60px] w-[48px]'>\n <Picture\n className=\" w-full\"\n imgClassName=\"\"\n source={pay?.img?.url}\n alt={pay?.img?.alt || ''}\n />\n </div>\n )\n })}\n </div>\n )}\n \n {\n item?.delivery && (\n <div className='flex gap-[24px] items-center justify-center'>\n {item?.delivery?.map((delivery, ind)=>{\n return (\n <div key={ind} className=''>\n <Picture\n className={` ${ind === 0 ? 'laptop:w-[174px] w-[116px]' : 'laptop:w-[75px] w-[50px]'}`}\n imgClassName=\"\"\n source={delivery?.img?.url}\n alt={delivery?.img?.alt || ''}\n />\n </div>\n )\n })}\n </div>\n ) \n }\n \n {\n item?.service && (\n <div className=' desktop:gap-[24px] gap-[8px] tablet:gap-[12px] laptop:gap-[28px] grid l-tablet:grid-cols-2 tablet:flex flex-wrap desktop:grid-cols-4 items-center justify-center'>\n {item?.service?.map((service, ind)=>{\n // \u5224\u65AD\uFF1A\u53EA\u5BF9\u7B2C\u4E94\u6761\uFF08index === 4\uFF09\u5E94\u7528\u54CD\u5E94\u5F0F\u663E\u793A/\u9690\u85CF\n const isFifth = ind === 4;\n return (\n <div key={ind} className={`\n flex flex-col items-center desktop:h-full w-[157px] justify-start desktop:w-[81px]\n ${isFifth ? 'laptop:flex desktop:hidden hidden' : ''} \n `}>\n <div className='w-[70px] desktop:w-[54px]'>\n <Picture\n className=\"\"\n imgClassName=\"w-full h-auto\"\n source={service?.img?.url}\n alt={service?.img?.alt || ''}\n />\n </div>\n <div className='text-center'>\n <Text html={service?.title} className=' font-bold text-[12px] mt-[8px] leading-[1.4]' />\n </div>\n </div>\n )\n })}\n </div>\n )\n }\n </div>\n <div className='mt-auto'>\n <Text html={item?.title} className='text-[20px] lg-desktop:text-[24px] [&_*_strong]:!font-bold leading-[1.2] text-[#1d1d1f]'/>\n <Text html={item?.desc} className='text-[14px] line-clamp-1 lg-desktop:text-[16px] leading-[1.4] text-[#1d1d1f]'/>\n </div>\n \n </div>\n </div>\n ))}\n </div> */}\n </div>\n </>\n )\n}\n\nexport default withLayout(SelectStore)\n"],
4
+ "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\n\nexport type SelectStoreDataType = {\n title: string\n desc: string\n img: Img\n mobileImg: Img\n padImg: Img\n miniImg: Img\n // pay: {\n // img: Img\n // }[]\n // delivery: {\n // img: Img\n // }[]\n // service: {\n // title: string\n // img: Img\n // }[]\n}\n\ntype SelectStoreType = {\n data: {\n list: SelectStoreDataType[]\n }\n className?: string\n}\n\nconst SelectStore = (props: SelectStoreType) => {\n const { data, className } = props\n const { list } = data\n // const number = list?.[2]?.service?.length || 0\n return (\n <>\n <div className=\"\">\n <div className=\"laptop:grid-cols-3 tablet:grid-cols-2 grid grid-cols-1 gap-4\">\n {list.map((item, index) => (\n <div\n key={index}\n className=\"lg-desktop:aspect-[543/320] laptop:aspect-[440/280] tablet:aspect-[346/240] select-store-wrapper rounded-box relative flex aspect-[358/240] flex-col overflow-hidden bg-[#EAEAEC]\"\n >\n <Picture\n className=\"object-cover\"\n imgClassName=\"w-full object-cover\"\n source={`${item?.img?.url}, ${item?.padImg?.url} 1439, ${item?.miniImg?.url} 1023, ${item?.mobileImg?.url} 767`}\n />\n <div className=\"laptop:px-6 laptop:pb-4 lg-desktop:px-8 lg-desktop:pb-8 px-4 pb-4\">\n <Text\n html={item?.title}\n className=\"lg-desktop:text-[24px] text-[20px] leading-[1.2] text-[#080A0F] [&_*_strong]:!font-bold\"\n />\n <Text\n html={item?.desc}\n className=\"lg-desktop:text-[16px] line-clamp-1 text-[14px] leading-[1.4] text-[#080A0F]\"\n />\n </div>\n </div>\n ))}\n </div>\n {/* <div className='grid desktop:grid-cols-3 tablet:grid-cols-2 grid-cols-1 gap-4'>\n {list.map((item, index) => (\n <div key={index} className='bg-[#EAEAEC] rounded-2xl min-h-[240px] laptop:min-h-[280px] lg-desktop:min-h-[320px]'>\n <div className='flex flex-col laptop:p-[24px] lg-desktop:p-[32px] p-[16px] justify-start h-full'>\n <div className=\"flex flex-col justify-center flex-1\">\n \n {item?.pay && (\n <div className='flex gap-[16px] flex-wrap items-center justify-center laptop:gap-[24px]'>\n {item?.pay?.map((pay, ind)=>{\n return (\n <div key={ind} className='laptop:w-[60px] w-[48px]'>\n <Picture\n className=\" w-full\"\n imgClassName=\"\"\n source={pay?.img?.url}\n alt={pay?.img?.alt || ''}\n />\n </div>\n )\n })}\n </div>\n )}\n \n {\n item?.delivery && (\n <div className='flex gap-[24px] items-center justify-center'>\n {item?.delivery?.map((delivery, ind)=>{\n return (\n <div key={ind} className=''>\n <Picture\n className={` ${ind === 0 ? 'laptop:w-[174px] w-[116px]' : 'laptop:w-[75px] w-[50px]'}`}\n imgClassName=\"\"\n source={delivery?.img?.url}\n alt={delivery?.img?.alt || ''}\n />\n </div>\n )\n })}\n </div>\n ) \n }\n \n {\n item?.service && (\n <div className=' desktop:gap-[24px] gap-[8px] tablet:gap-[12px] laptop:gap-[28px] grid l-tablet:grid-cols-2 tablet:flex flex-wrap desktop:grid-cols-4 items-center justify-center'>\n {item?.service?.map((service, ind)=>{\n // \u5224\u65AD\uFF1A\u53EA\u5BF9\u7B2C\u4E94\u6761\uFF08index === 4\uFF09\u5E94\u7528\u54CD\u5E94\u5F0F\u663E\u793A/\u9690\u85CF\n const isFifth = ind === 4;\n return (\n <div key={ind} className={`\n flex flex-col items-center desktop:h-full w-[157px] justify-start desktop:w-[81px]\n ${isFifth ? 'laptop:flex desktop:hidden hidden' : ''} \n `}>\n <div className='w-[70px] desktop:w-[54px]'>\n <Picture\n className=\"\"\n imgClassName=\"w-full h-auto\"\n source={service?.img?.url}\n alt={service?.img?.alt || ''}\n />\n </div>\n <div className='text-center'>\n <Text html={service?.title} className=' font-bold text-[12px] mt-[8px] leading-[1.4]' />\n </div>\n </div>\n )\n })}\n </div>\n )\n }\n </div>\n <div className='mt-auto'>\n <Text html={item?.title} className='text-[20px] lg-desktop:text-[24px] [&_*_strong]:!font-bold leading-[1.2] text-[#080A0F]'/>\n <Text html={item?.desc} className='text-[14px] line-clamp-1 lg-desktop:text-[16px] leading-[1.4] text-[#080A0F]'/>\n </div>\n \n </div>\n </div>\n ))}\n </div> */}\n </div>\n </>\n )\n}\n\nexport default withLayout(SelectStore)\n"],
5
5
  "mappings": "aAsCI,mBAAAA,EAQU,OAAAC,EAKA,QAAAC,MAbV,oBArCJ,MAAmB,yBACnB,MAAsB,wBAEtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BA4B9B,MAAMC,EAAeC,GAA2B,CAC9C,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,KAAAG,CAAK,EAAIF,EAEjB,OACEP,EAAAD,EAAA,CACE,SAAAC,EAAC,OAAI,UAAU,GACb,SAAAA,EAAC,OAAI,UAAU,+DACZ,SAAAS,EAAK,IAAI,CAACC,EAAMC,IACfV,EAAC,OAEC,UAAU,oLAEV,UAAAD,EAACG,EAAA,CACC,UAAU,eACV,aAAa,sBACb,OAAQ,GAAGO,GAAM,KAAK,GAAG,KAAKA,GAAM,QAAQ,GAAG,UAAUA,GAAM,SAAS,GAAG,UAAUA,GAAM,WAAW,GAAG,OAC3G,EACAT,EAAC,OAAI,UAAU,oEACb,UAAAD,EAACI,EAAA,CACC,KAAMM,GAAM,MACZ,UAAU,0FACZ,EACAV,EAACI,EAAA,CACC,KAAMM,GAAM,KACZ,UAAU,+EACZ,GACF,IAjBKC,CAkBP,CACD,EACH,EAiFF,EACF,CAEJ,EAEA,IAAOC,EAAQV,EAAWG,CAAW",
6
6
  "names": ["Fragment", "jsx", "jsxs", "withLayout", "Picture", "Text", "SelectStore", "props", "data", "className", "list", "item", "index", "SelectStore_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as K,jsx as s,jsxs as c}from"react/jsx-runtime";import P from"./dropdown.js";import{useAiuiContext as _}from"../AiuiProvider/index.js";import{useMediaQuery as $}from"react-responsive";import{useMemo as U,useState as x,useEffect as E}from"react";import{withLayout as V}from"../../shared/Styles.js";import{formatVariantPrice as B}from"../ShelfDisplay/shelfDisplay.js";import{Picture as g,Text as q,Button as z,Heading as M}from"../../components/index.js";import Q,{useImperativeHandle as G,useRef as J}from"react";const j=Q.forwardRef((T,F)=>{const{data:v,buildData:p,onChange:A,onSecondaryChange:W}=T||{},h=$({query:"(max-width: 768px)"}),[n,m]=x({}),[k,w]=x(!1),[b,y]=x({}),N=J(null),{locale:L="us"}=_(),{LeftMenu:D,RightMenu:S,DefaultSelectMenu:u}=U(()=>v?.data||{},[v?.data]),H=e=>{try{const a=new URL(e).pathname.toLowerCase();return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(a)}catch{return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(e)}},R=(e,t)=>{const a=S?.menus?.find?.(f=>f?.handle===e?.handle),l=e?.variants?.find?.(f=>f?.sku===e?.sku||a?.sku),o=l?.coupons?.[0],{price:r,basePrice:d}=B({locale:L||"us",amount:o?o?.variant_price4wscode:l?.price,baseAmount:o?l?.price:0,currencyCode:e?.price?.currencyCode||"USD"}),i=typeof u?.buttonText=="string"?u?.buttonText:u?.buttonText?.[String(t)]||"";return c("div",{className:"specs-sku-node-wrap box-border",children:[c(q,{className:"md-tablet:p-2 l-tablet:mb-4 l-tablet:text-sm desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text relative mb-6 box-border block rounded-[50px] border border-[#E4E5E6] bg-[#F5F5F7] px-6 py-4 text-base font-bold",onClick:()=>{if(Object.keys(n||{})?.length<=2)return null;y({...b,[t]:!b?.[t]})},children:[c("div",{className:"flex items-center justify-between overflow-hidden",children:[s("div",{className:"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title flex-1 truncate text-base",title:n?.[t]?.name||"",children:n?.[t]?.name||""}),Object.keys(n||{})?.length>2?s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",className:"openDropDown",children:s("path",{d:"M6 9.5L12 15.5L18 9.5",stroke:"#1D1D1F","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})}):null]}),s(P,{index:t,list:p?.products,active:n,filterActive:n,setActive:m,visible:b,setVisible:y})]}),s("div",{className:"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]",children:s(g,{source:l?.image?.url||"",className:"aspect-h-[280] aspect-w-[280]",imgClassName:"w-full h-full object-cover hover:scale-105 transition-all duration-300"})}),l?.availableForSale?c("div",{className:"lg-desktop:text-2xl mb-2 mt-6 flex items-center text-xl font-bold",children:[s("div",{className:"specs-sku-node-price text-[#1D1D1F]",children:r||""}),d&&s("div",{className:"lg-desktop:text-2xl specs-sku-node-base-price ml-1 text-xl text-[#86868C] line-through",children:d})]}):!1,i?s(z,{onClick:()=>{A?.(e,t)},className:"specs-sku-node-button",children:i}):null]})},I=e=>e&&typeof e!="string"?c("div",{className:"size-full",children:[s("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm",dangerouslySetInnerHTML:{__html:e?.text||""}}),s(g,{source:e?.imgUrl,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"})]}):s("div",{className:"break-all",children:H(e)?s(g,{source:e,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"}):s("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm",dangerouslySetInnerHTML:{__html:e||""}})}),C=e=>e.map((t,a)=>{const l=a===0;return c("div",{className:"l-tablet:flex l-tablet:flex-col box-border grid w-full cursor-pointer grid-cols-3 overflow-hidden border-t border-t-[#E4E5E6] specs-product-node-wrap",children:[s(M,{as:"h3",html:t||"",className:"tablet:py-6 l-tablet:text-[#86868C] desktop:p-6 lg-desktop:text-lg specs-product-node-title mr-4 flex-1 pt-4 text-base font-bold md:text-sm"}),s("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols-${k?3:2} specs-product-node-body col-span-2 grid flex-1 py-6`,children:Object.keys(n)?.map?.(o=>{const r=n?.[o],d=S?.menus?.find?.(i=>i?.handle===r?.handle)?.subTitle;return I(d?.[t])})})]},t)}),O=e=>{if(!n)return;const{subTitle:t,isProduct:a}=e;return a?c(K,{children:[c("div",{className:"l-tablet:flex l-tablet:flex-col specs-content-item-product box-border grid w-full cursor-pointer grid-cols-3 border-t-0 border-t-[#E4E5E6]",children:[e?.title&&s(M,{as:"h3",html:e?.title||"",className:"l:hidden specs-item-product-title"}),s("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:px-6 desktop:pb-6 lg-desktop:gap-16 grid-cols-${k?3:2} specs-item-product-body col-span-2 grid flex-1 pb-4 pr-0`,children:Object.keys(n)?.map((l,o)=>{const r=n?.[l],d=p?.products?.find?.(i=>i?.handle===r?.handle);return s("div",{children:R({...d,sku:r?.sku,item:l},o)},l)})})]}),t?.length?C(t):null]}):C(t)};return G(F,()=>N.current),E(()=>{if(!p?.products?.length)return;const e=u?.sku?.split?.(",")||[];let t={};e?.forEach?.((a,l)=>{const o=p?.products?.find?.(r=>{if(r?.variants?.find?.(i=>i?.sku===a))return!0});o&&(t={...t,[l]:{sku:a,name:o?.name||o?.title,handle:o?.handle}})}),m(t),w(e?.length>2)},[p]),E(()=>{if(h){const e=Object.keys(n||{});if(e?.length>2){const t=e?.slice?.(0,2);let a={};t?.forEach?.(l=>{a={...a,[l]:n?.[l]}}),w(!1),m(a)}}},[h]),s("div",{className:"specs-wrapper w-full overflow-hidden bg-[#F5F5F7]",ref:N,children:D?.data?s("div",{className:"specs-wrapper-content box-border w-full overflow-hidden",children:D?.data?.map?.((e,t)=>s("div",{className:"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0",children:O(e)},t))}):null})});j.displayName="Specs";var oe=V(j);export{oe as default};
1
+ "use client";import{Fragment as K,jsx as s,jsxs as c}from"react/jsx-runtime";import P from"./dropdown.js";import{useAiuiContext as _}from"../AiuiProvider/index.js";import{useMediaQuery as $}from"react-responsive";import{useMemo as U,useState as x,useEffect as E}from"react";import{withLayout as V}from"../../shared/Styles.js";import{formatVariantPrice as B}from"../ShelfDisplay/shelfDisplay.js";import{Picture as g,Text as q,Button as z,Heading as M}from"../../components/index.js";import Q,{useImperativeHandle as G,useRef as J}from"react";const A=Q.forwardRef((j,T)=>{const{data:v,buildData:p,onChange:F,onSecondaryChange:W}=j||{},h=$({query:"(max-width: 768px)"}),[n,m]=x({}),[k,w]=x(!1),[b,y]=x({}),N=J(null),{locale:L="us"}=_(),{LeftMenu:D,RightMenu:S,DefaultSelectMenu:u}=U(()=>v?.data||{},[v?.data]),H=e=>{try{const a=new URL(e).pathname.toLowerCase();return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(a)}catch{return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(e)}},R=(e,t)=>{const a=S?.menus?.find?.(f=>f?.handle===e?.handle),l=e?.variants?.find?.(f=>f?.sku===e?.sku||a?.sku),o=l?.coupons?.[0],{price:r,basePrice:d}=B({locale:L||"us",amount:o?o?.variant_price4wscode:l?.price,baseAmount:o?l?.price:0,currencyCode:e?.price?.currencyCode||"USD"}),i=typeof u?.buttonText=="string"?u?.buttonText:u?.buttonText?.[String(t)]||"";return c("div",{className:"specs-sku-node-wrap box-border",children:[c(q,{className:"md-tablet:p-2 l-tablet:mb-4 l-tablet:text-sm desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text relative mb-6 box-border block rounded-[50px] border border-[#E4E5E6] bg-[#F5F5F7] px-6 py-4 text-base font-bold",onClick:()=>{if(Object.keys(n||{})?.length<=2)return null;y({...b,[t]:!b?.[t]})},children:[c("div",{className:"flex items-center justify-between overflow-hidden",children:[s("div",{className:"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title flex-1 truncate text-base",title:n?.[t]?.name||"",children:n?.[t]?.name||""}),Object.keys(n||{})?.length>2?s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",className:"openDropDown",children:s("path",{d:"M6 9.5L12 15.5L18 9.5",stroke:"#1D1D1F","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})}):null]}),s(P,{index:t,list:p?.products,active:n,filterActive:n,setActive:m,visible:b,setVisible:y})]}),s("div",{className:"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]",children:s(g,{source:l?.image?.url||"",className:"aspect-h-[280] aspect-w-[280]",imgClassName:"w-full h-full object-cover hover:scale-105 transition-all duration-300"})}),l?.availableForSale?c("div",{className:"lg-desktop:text-2xl mb-2 mt-6 flex items-center text-xl font-bold",children:[s("div",{className:"specs-sku-node-price text-[#080A0F]",children:r||""}),d&&s("div",{className:"lg-desktop:text-2xl specs-sku-node-base-price ml-1 text-xl text-[#86868C] line-through",children:d})]}):!1,i?s(z,{onClick:()=>{F?.(e,t)},className:"specs-sku-node-button",children:i}):null]})},I=e=>e&&typeof e!="string"?c("div",{className:"size-full",children:[s("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#080A0F] md:text-sm",dangerouslySetInnerHTML:{__html:e?.text||""}}),s(g,{source:e?.imgUrl,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"})]}):s("div",{className:"break-all",children:H(e)?s(g,{source:e,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"}):s("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#080A0F] md:text-sm",dangerouslySetInnerHTML:{__html:e||""}})}),C=e=>e.map((t,a)=>{const l=a===0;return c("div",{className:"l-tablet:flex l-tablet:flex-col box-border grid w-full cursor-pointer grid-cols-3 overflow-hidden border-t border-t-[#E4E5E6] specs-product-node-wrap",children:[s(M,{as:"h3",html:t||"",className:"tablet:py-6 l-tablet:text-[#86868C] desktop:p-6 lg-desktop:text-lg specs-product-node-title mr-4 flex-1 pt-4 text-base font-bold md:text-sm"}),s("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols-${k?3:2} specs-product-node-body col-span-2 grid flex-1 py-6`,children:Object.keys(n)?.map?.(o=>{const r=n?.[o],d=S?.menus?.find?.(i=>i?.handle===r?.handle)?.subTitle;return I(d?.[t])})})]},t)}),O=e=>{if(!n)return;const{subTitle:t,isProduct:a}=e;return a?c(K,{children:[c("div",{className:"l-tablet:flex l-tablet:flex-col specs-content-item-product box-border grid w-full cursor-pointer grid-cols-3 border-t-0 border-t-[#E4E5E6]",children:[e?.title&&s(M,{as:"h3",html:e?.title||"",className:"l:hidden specs-item-product-title"}),s("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:px-6 desktop:pb-6 lg-desktop:gap-16 grid-cols-${k?3:2} specs-item-product-body col-span-2 grid flex-1 pb-4 pr-0`,children:Object.keys(n)?.map((l,o)=>{const r=n?.[l],d=p?.products?.find?.(i=>i?.handle===r?.handle);return s("div",{children:R({...d,sku:r?.sku,item:l},o)},l)})})]}),t?.length?C(t):null]}):C(t)};return G(T,()=>N.current),E(()=>{if(!p?.products?.length)return;const e=u?.sku?.split?.(",")||[];let t={};e?.forEach?.((a,l)=>{const o=p?.products?.find?.(r=>{if(r?.variants?.find?.(i=>i?.sku===a))return!0});o&&(t={...t,[l]:{sku:a,name:o?.name||o?.title,handle:o?.handle}})}),m(t),w(e?.length>2)},[p]),E(()=>{if(h){const e=Object.keys(n||{});if(e?.length>2){const t=e?.slice?.(0,2);let a={};t?.forEach?.(l=>{a={...a,[l]:n?.[l]}}),w(!1),m(a)}}},[h]),s("div",{className:"specs-wrapper w-full overflow-hidden bg-[#F5F5F7]",ref:N,children:D?.data?s("div",{className:"specs-wrapper-content box-border w-full overflow-hidden",children:D?.data?.map?.((e,t)=>s("div",{className:"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0",children:O(e)},t))}):null})});A.displayName="Specs";var oe=V(A);export{oe as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Specs/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport DropDown from './dropdown.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useMemo, useState, useEffect } from 'react'\nimport { withLayout } from '../../shared/Styles.js'\nimport { formatVariantPrice } from '../ShelfDisplay/shelfDisplay.js'\nimport { Picture, Text, Button, Container, Heading } from '../../components/index.js'\nimport React, { useImperativeHandle, useRef } from 'react'\n\nconst Specs = React.forwardRef<HTMLDivElement, any>((page: any, ref) => {\n const { data, buildData, onChange, onSecondaryChange } = page || {}\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const [active, setActive] = useState<any>({})\n const [isShowMax, setIsShowMax] = useState<boolean>(false)\n const [visibleActive, setVisibleActive] = useState<{ [key: number]: boolean }>({})\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n const { locale = 'us' } = useAiuiContext()\n\n const { LeftMenu, RightMenu, DefaultSelectMenu } = useMemo(() => data?.data || {}, [data?.data])\n\n const isImageUrl = (urlPath: string) => {\n try {\n const url = new URL(urlPath)\n const path = url.pathname.toLowerCase()\n return /\\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(path)\n } catch (e) {\n // \u5982\u679C\u4F20\u5165\u7684\u4E0D\u662F\u6709\u6548URL\uFF08\u5982\u76F8\u5BF9\u8DEF\u5F84\uFF09\uFF0C\u76F4\u63A5\u68C0\u67E5\u8DEF\u5F84\n return /\\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(urlPath)\n }\n }\n\n const skuNode = (product: any, index: number) => {\n const findCurrentData = RightMenu?.menus?.find?.((item: any) => item?.handle === product?.handle)\n const findSku = product?.variants?.find?.((item: any) => item?.sku === product?.sku || findCurrentData?.sku)\n const coupon = findSku?.coupons?.[0]\n const { price, basePrice } = formatVariantPrice({\n locale: locale || 'us',\n amount: coupon ? coupon?.variant_price4wscode : findSku?.price,\n baseAmount: coupon ? findSku?.price : 0,\n currencyCode: product?.price?.currencyCode || 'USD',\n })\n const buttonTextValue =\n typeof DefaultSelectMenu?.buttonText === 'string'\n ? DefaultSelectMenu?.buttonText\n : DefaultSelectMenu?.buttonText?.[String(index)] || ''\n return (\n <div className=\"specs-sku-node-wrap box-border\">\n <Text\n className={`md-tablet:p-2 l-tablet:mb-4 l-tablet:text-sm desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text relative mb-6 box-border block rounded-[50px] border border-[#E4E5E6] bg-[#F5F5F7] px-6 py-4 text-base font-bold`}\n onClick={() => {\n if (Object.keys(active || {})?.length <= 2) return null\n\n setVisibleActive({\n ...visibleActive,\n [index]: !visibleActive?.[index],\n })\n }}\n >\n <div className=\"flex items-center justify-between overflow-hidden\">\n <div\n className=\"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title flex-1 truncate text-base\"\n title={active?.[index]?.name || ''}\n >\n {active?.[index]?.name || ''}\n </div>\n {Object.keys(active || {})?.length > 2 ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"25\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n className=\"openDropDown\"\n >\n <path\n d=\"M6 9.5L12 15.5L18 9.5\"\n stroke=\"#1D1D1F\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n ) : null}\n </div>\n <DropDown\n index={index}\n list={buildData?.products}\n active={active}\n filterActive={active}\n setActive={setActive}\n visible={visibleActive}\n setVisible={setVisibleActive}\n />\n </Text>\n <div className=\"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]\">\n <Picture\n source={findSku?.image?.url || ''}\n className=\"aspect-h-[280] aspect-w-[280]\"\n imgClassName=\"w-full h-full object-cover hover:scale-105 transition-all duration-300\"\n />\n </div>\n {findSku?.availableForSale ? (\n <div className=\"lg-desktop:text-2xl mb-2 mt-6 flex items-center text-xl font-bold\">\n <div className=\"specs-sku-node-price text-[#1D1D1F]\">{price || ''}</div>\n {basePrice && (\n <div className=\"lg-desktop:text-2xl specs-sku-node-base-price ml-1 text-xl text-[#86868C] line-through\">\n {basePrice}\n </div>\n )}\n </div>\n ) : (\n false\n )}\n {buttonTextValue ? (\n <Button\n onClick={() => {\n onChange?.(product, index)\n }}\n className=\"specs-sku-node-button\"\n >\n {buttonTextValue}\n </Button>\n ) : null}\n </div>\n )\n }\n\n const normalNode = (v: any) => {\n if (v && typeof v !== 'string') {\n return (\n <div className=\"size-full\">\n <p\n className=\"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm\"\n dangerouslySetInnerHTML={{\n __html: v?.text || '',\n }}\n />\n <Picture\n source={v?.imgUrl}\n className=\"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]\"\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n )\n }\n return (\n <div className=\"break-all\">\n {isImageUrl(v) ? (\n <Picture\n source={v}\n className=\"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]\"\n imgClassName=\"w-full h-full object-cover\"\n />\n ) : (\n <p\n className=\"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm\"\n dangerouslySetInnerHTML={{\n __html: v || '',\n }}\n />\n )}\n </div>\n )\n }\n\n const productNode = (data: any) => {\n return data.map((st: any, idx: number) => {\n const isFirstParameter = idx === 0\n return (\n <div\n key={st}\n className={`l-tablet:flex l-tablet:flex-col box-border grid w-full cursor-pointer grid-cols-3 overflow-hidden border-t border-t-[#E4E5E6] ${isFirstParameter ? '' : ''} specs-product-node-wrap`}\n >\n <Heading\n as=\"h3\"\n html={st || ''}\n className=\"tablet:py-6 l-tablet:text-[#86868C] desktop:p-6 lg-desktop:text-lg specs-product-node-title mr-4 flex-1 pt-4 text-base font-bold md:text-sm\"\n />\n <div\n className={`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols-${isShowMax ? 3 : 2} specs-product-node-body col-span-2 grid flex-1 py-6`}\n >\n {Object.keys(active)?.map?.((item: string) => {\n const currentData = active?.[item]\n const currentMenus = RightMenu?.menus?.find?.(\n (item: any) => item?.handle === currentData?.handle\n )?.subTitle\n return normalNode(currentMenus?.[st])\n })}\n </div>\n </div>\n )\n })\n }\n\n // \u5DE6\u4FA7\u6807\u9898\u83DC\u5355\n const childrenNode = (node: any) => {\n if (!active) return\n const { subTitle, isProduct } = node\n // \u5982\u679C\u662F\u4EA7\u54C1\n if (isProduct) {\n return (\n <>\n <div\n className={`l-tablet:flex l-tablet:flex-col specs-content-item-product box-border grid w-full cursor-pointer grid-cols-3 border-t-0 border-t-[#E4E5E6]`}\n >\n {node?.title && <Heading as=\"h3\" html={node?.title || ''} className=\"l:hidden specs-item-product-title\" />}\n <div\n className={`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:px-6 desktop:pb-6 lg-desktop:gap-16 grid-cols-${isShowMax ? 3 : 2} specs-item-product-body col-span-2 grid flex-1 pb-4 pr-0`}\n >\n {Object.keys(active)?.map((item: string, index: number) => {\n const currentData = active?.[item]\n const currentProduct = buildData?.products?.find?.((item: any) => item?.handle === currentData?.handle)\n return <div key={item}>{skuNode({ ...currentProduct, sku: currentData?.sku, item: item }, index)}</div>\n })}\n </div>\n </div>\n {subTitle?.length ? productNode(subTitle) : null}\n </>\n )\n }\n return productNode(subTitle)\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (!buildData?.products?.length) return\n const skus = DefaultSelectMenu?.sku?.split?.(',') || []\n let currentActive = {}\n skus?.forEach?.((sku: string, index: number) => {\n const findData = buildData?.products?.find?.((item: any) => {\n const findSku = item?.variants?.find?.((v: any) => v?.sku === sku)\n if (findSku) return true\n })\n if (findData) {\n currentActive = {\n ...currentActive,\n [index]: {\n sku: sku,\n name: findData?.name || findData?.title,\n handle: findData?.handle,\n },\n }\n }\n })\n setActive(currentActive)\n setIsShowMax(skus?.length > 2)\n }, [buildData])\n\n useEffect(() => {\n if (isMobile) {\n const currentActive = Object.keys(active || {})\n if (currentActive?.length > 2) {\n const newActive = currentActive?.slice?.(0, 2)\n let newShowActive = {}\n newActive?.forEach?.((item: string) => {\n newShowActive = { ...newShowActive, [item]: active?.[item] }\n })\n setIsShowMax(false)\n setActive(newShowActive)\n }\n }\n }, [isMobile])\n\n return (\n <div className=\"specs-wrapper w-full overflow-hidden bg-[#F5F5F7]\" ref={innerRef}>\n {LeftMenu?.data ? (\n <div className=\"specs-wrapper-content box-border w-full overflow-hidden\">\n {LeftMenu?.data?.map?.((item: any, index: number) => {\n return (\n <div key={index} className=\"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0\">\n {childrenNode(item)}\n </div>\n )\n })}\n </div>\n ) : null}\n </div>\n )\n})\n\nSpecs.displayName = 'Specs'\n\nexport default withLayout(Specs)\n"],
4
+ "sourcesContent": ["'use client'\n\nimport DropDown from './dropdown.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useMemo, useState, useEffect } from 'react'\nimport { withLayout } from '../../shared/Styles.js'\nimport { formatVariantPrice } from '../ShelfDisplay/shelfDisplay.js'\nimport { Picture, Text, Button, Container, Heading } from '../../components/index.js'\nimport React, { useImperativeHandle, useRef } from 'react'\n\nconst Specs = React.forwardRef<HTMLDivElement, any>((page: any, ref) => {\n const { data, buildData, onChange, onSecondaryChange } = page || {}\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const [active, setActive] = useState<any>({})\n const [isShowMax, setIsShowMax] = useState<boolean>(false)\n const [visibleActive, setVisibleActive] = useState<{ [key: number]: boolean }>({})\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n const { locale = 'us' } = useAiuiContext()\n\n const { LeftMenu, RightMenu, DefaultSelectMenu } = useMemo(() => data?.data || {}, [data?.data])\n\n const isImageUrl = (urlPath: string) => {\n try {\n const url = new URL(urlPath)\n const path = url.pathname.toLowerCase()\n return /\\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(path)\n } catch (e) {\n // \u5982\u679C\u4F20\u5165\u7684\u4E0D\u662F\u6709\u6548URL\uFF08\u5982\u76F8\u5BF9\u8DEF\u5F84\uFF09\uFF0C\u76F4\u63A5\u68C0\u67E5\u8DEF\u5F84\n return /\\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(urlPath)\n }\n }\n\n const skuNode = (product: any, index: number) => {\n const findCurrentData = RightMenu?.menus?.find?.((item: any) => item?.handle === product?.handle)\n const findSku = product?.variants?.find?.((item: any) => item?.sku === product?.sku || findCurrentData?.sku)\n const coupon = findSku?.coupons?.[0]\n const { price, basePrice } = formatVariantPrice({\n locale: locale || 'us',\n amount: coupon ? coupon?.variant_price4wscode : findSku?.price,\n baseAmount: coupon ? findSku?.price : 0,\n currencyCode: product?.price?.currencyCode || 'USD',\n })\n const buttonTextValue =\n typeof DefaultSelectMenu?.buttonText === 'string'\n ? DefaultSelectMenu?.buttonText\n : DefaultSelectMenu?.buttonText?.[String(index)] || ''\n return (\n <div className=\"specs-sku-node-wrap box-border\">\n <Text\n className={`md-tablet:p-2 l-tablet:mb-4 l-tablet:text-sm desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text relative mb-6 box-border block rounded-[50px] border border-[#E4E5E6] bg-[#F5F5F7] px-6 py-4 text-base font-bold`}\n onClick={() => {\n if (Object.keys(active || {})?.length <= 2) return null\n\n setVisibleActive({\n ...visibleActive,\n [index]: !visibleActive?.[index],\n })\n }}\n >\n <div className=\"flex items-center justify-between overflow-hidden\">\n <div\n className=\"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title flex-1 truncate text-base\"\n title={active?.[index]?.name || ''}\n >\n {active?.[index]?.name || ''}\n </div>\n {Object.keys(active || {})?.length > 2 ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"25\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n className=\"openDropDown\"\n >\n <path\n d=\"M6 9.5L12 15.5L18 9.5\"\n stroke=\"#1D1D1F\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n ) : null}\n </div>\n <DropDown\n index={index}\n list={buildData?.products}\n active={active}\n filterActive={active}\n setActive={setActive}\n visible={visibleActive}\n setVisible={setVisibleActive}\n />\n </Text>\n <div className=\"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]\">\n <Picture\n source={findSku?.image?.url || ''}\n className=\"aspect-h-[280] aspect-w-[280]\"\n imgClassName=\"w-full h-full object-cover hover:scale-105 transition-all duration-300\"\n />\n </div>\n {findSku?.availableForSale ? (\n <div className=\"lg-desktop:text-2xl mb-2 mt-6 flex items-center text-xl font-bold\">\n <div className=\"specs-sku-node-price text-[#080A0F]\">{price || ''}</div>\n {basePrice && (\n <div className=\"lg-desktop:text-2xl specs-sku-node-base-price ml-1 text-xl text-[#86868C] line-through\">\n {basePrice}\n </div>\n )}\n </div>\n ) : (\n false\n )}\n {buttonTextValue ? (\n <Button\n onClick={() => {\n onChange?.(product, index)\n }}\n className=\"specs-sku-node-button\"\n >\n {buttonTextValue}\n </Button>\n ) : null}\n </div>\n )\n }\n\n const normalNode = (v: any) => {\n if (v && typeof v !== 'string') {\n return (\n <div className=\"size-full\">\n <p\n className=\"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#080A0F] md:text-sm\"\n dangerouslySetInnerHTML={{\n __html: v?.text || '',\n }}\n />\n <Picture\n source={v?.imgUrl}\n className=\"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]\"\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n )\n }\n return (\n <div className=\"break-all\">\n {isImageUrl(v) ? (\n <Picture\n source={v}\n className=\"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]\"\n imgClassName=\"w-full h-full object-cover\"\n />\n ) : (\n <p\n className=\"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#080A0F] md:text-sm\"\n dangerouslySetInnerHTML={{\n __html: v || '',\n }}\n />\n )}\n </div>\n )\n }\n\n const productNode = (data: any) => {\n return data.map((st: any, idx: number) => {\n const isFirstParameter = idx === 0\n return (\n <div\n key={st}\n className={`l-tablet:flex l-tablet:flex-col box-border grid w-full cursor-pointer grid-cols-3 overflow-hidden border-t border-t-[#E4E5E6] ${isFirstParameter ? '' : ''} specs-product-node-wrap`}\n >\n <Heading\n as=\"h3\"\n html={st || ''}\n className=\"tablet:py-6 l-tablet:text-[#86868C] desktop:p-6 lg-desktop:text-lg specs-product-node-title mr-4 flex-1 pt-4 text-base font-bold md:text-sm\"\n />\n <div\n className={`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols-${isShowMax ? 3 : 2} specs-product-node-body col-span-2 grid flex-1 py-6`}\n >\n {Object.keys(active)?.map?.((item: string) => {\n const currentData = active?.[item]\n const currentMenus = RightMenu?.menus?.find?.(\n (item: any) => item?.handle === currentData?.handle\n )?.subTitle\n return normalNode(currentMenus?.[st])\n })}\n </div>\n </div>\n )\n })\n }\n\n // \u5DE6\u4FA7\u6807\u9898\u83DC\u5355\n const childrenNode = (node: any) => {\n if (!active) return\n const { subTitle, isProduct } = node\n // \u5982\u679C\u662F\u4EA7\u54C1\n if (isProduct) {\n return (\n <>\n <div\n className={`l-tablet:flex l-tablet:flex-col specs-content-item-product box-border grid w-full cursor-pointer grid-cols-3 border-t-0 border-t-[#E4E5E6]`}\n >\n {node?.title && <Heading as=\"h3\" html={node?.title || ''} className=\"l:hidden specs-item-product-title\" />}\n <div\n className={`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:px-6 desktop:pb-6 lg-desktop:gap-16 grid-cols-${isShowMax ? 3 : 2} specs-item-product-body col-span-2 grid flex-1 pb-4 pr-0`}\n >\n {Object.keys(active)?.map((item: string, index: number) => {\n const currentData = active?.[item]\n const currentProduct = buildData?.products?.find?.((item: any) => item?.handle === currentData?.handle)\n return <div key={item}>{skuNode({ ...currentProduct, sku: currentData?.sku, item: item }, index)}</div>\n })}\n </div>\n </div>\n {subTitle?.length ? productNode(subTitle) : null}\n </>\n )\n }\n return productNode(subTitle)\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (!buildData?.products?.length) return\n const skus = DefaultSelectMenu?.sku?.split?.(',') || []\n let currentActive = {}\n skus?.forEach?.((sku: string, index: number) => {\n const findData = buildData?.products?.find?.((item: any) => {\n const findSku = item?.variants?.find?.((v: any) => v?.sku === sku)\n if (findSku) return true\n })\n if (findData) {\n currentActive = {\n ...currentActive,\n [index]: {\n sku: sku,\n name: findData?.name || findData?.title,\n handle: findData?.handle,\n },\n }\n }\n })\n setActive(currentActive)\n setIsShowMax(skus?.length > 2)\n }, [buildData])\n\n useEffect(() => {\n if (isMobile) {\n const currentActive = Object.keys(active || {})\n if (currentActive?.length > 2) {\n const newActive = currentActive?.slice?.(0, 2)\n let newShowActive = {}\n newActive?.forEach?.((item: string) => {\n newShowActive = { ...newShowActive, [item]: active?.[item] }\n })\n setIsShowMax(false)\n setActive(newShowActive)\n }\n }\n }, [isMobile])\n\n return (\n <div className=\"specs-wrapper w-full overflow-hidden bg-[#F5F5F7]\" ref={innerRef}>\n {LeftMenu?.data ? (\n <div className=\"specs-wrapper-content box-border w-full overflow-hidden\">\n {LeftMenu?.data?.map?.((item: any, index: number) => {\n return (\n <div key={index} className=\"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0\">\n {childrenNode(item)}\n </div>\n )\n })}\n </div>\n ) : null}\n </div>\n )\n})\n\nSpecs.displayName = 'Specs'\n\nexport default withLayout(Specs)\n"],
5
5
  "mappings": "aAgEU,OA+IF,YAAAA,EA9II,OAAAC,EADF,QAAAC,MAAA,oBA9DV,OAAOC,MAAc,gBACrB,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,WAAAC,EAAS,YAAAC,EAAU,aAAAC,MAAiB,QAC7C,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,sBAAAC,MAA0B,kCACnC,OAAS,WAAAC,EAAS,QAAAC,EAAM,UAAAC,EAAmB,WAAAC,MAAe,4BAC1D,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QAEnD,MAAMC,EAAQH,EAAM,WAAgC,CAACI,EAAWC,IAAQ,CACtE,KAAM,CAAE,KAAAC,EAAM,UAAAC,EAAW,SAAAC,EAAU,kBAAAC,CAAkB,EAAIL,GAAQ,CAAC,EAE5DM,EAAWpB,EAAc,CAAE,MAAO,oBAAqB,CAAC,EAExD,CAACqB,EAAQC,CAAS,EAAIpB,EAAc,CAAC,CAAC,EACtC,CAACqB,EAAWC,CAAY,EAAItB,EAAkB,EAAK,EACnD,CAACuB,EAAeC,CAAgB,EAAIxB,EAAqC,CAAC,CAAC,EAE3EyB,EAAWf,EAAuB,IAAI,EAEtC,CAAE,OAAAgB,EAAS,IAAK,EAAI7B,EAAe,EAEnC,CAAE,SAAA8B,EAAU,UAAAC,EAAW,kBAAAC,CAAkB,EAAI9B,EAAQ,IAAMe,GAAM,MAAQ,CAAC,EAAG,CAACA,GAAM,IAAI,CAAC,EAEzFgB,EAAcC,GAAoB,CACtC,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U,OAAQsB,GAAc,CAE1D,GADgBA,GAAM,UAAU,OAAQO,GAAWA,GAAG,MAAQc,CAAG,EACpD,MAAO,EACtB,CAAC,EACGC,IACFF,EAAgB,CACd,GAAGA,EACH,CAACtB,CAAK,EAAG,CACP,IAAKuB,EACL,KAAMC,GAAU,MAAQA,GAAU,MAClC,OAAQA,GAAU,MACpB,CACF,EAEJ,CAAC,EACDvC,EAAUqC,CAAa,EACvBnC,EAAakC,GAAM,OAAS,CAAC,CAC/B,EAAG,CAACzC,CAAS,CAAC,EAEdd,EAAU,IAAM,CACd,GAAIiB,EAAU,CACZ,MAAMuC,EAAgB,OAAO,KAAKtC,GAAU,CAAC,CAAC,EAC9C,GAAIsC,GAAe,OAAS,EAAG,CAC7B,MAAMG,EAAYH,GAAe,QAAQ,EAAG,CAAC,EAC7C,IAAII,EAAgB,CAAC,EACrBD,GAAW,UAAWvB,GAAiB,CACrCwB,EAAgB,CAAE,GAAGA,EAAe,CAACxB,CAAI,EAAGlB,IAASkB,CAAI,CAAE,CAC7D,CAAC,EACDf,EAAa,EAAK,EAClBF,EAAUyC,CAAa,CACzB,CACF,CACF,EAAG,CAAC3C,CAAQ,CAAC,EAGXxB,EAAC,OAAI,UAAU,oDAAoD,IAAK+B,EACrE,SAAAE,GAAU,KACTjC,EAAC,OAAI,UAAU,0DACZ,SAAAiC,GAAU,MAAM,MAAM,CAACU,EAAWF,IAE/BzC,EAAC,OAAgB,UAAU,+EACxB,SAAAyD,EAAad,CAAI,GADVF,CAEV,CAEH,EACH,EACE,KACN,CAEJ,CAAC,EAEDxB,EAAM,YAAc,QAEpB,IAAOmD,GAAQ5D,EAAWS,CAAK",
6
6
  "names": ["Fragment", "jsx", "jsxs", "DropDown", "useAiuiContext", "useMediaQuery", "useMemo", "useState", "useEffect", "withLayout", "formatVariantPrice", "Picture", "Text", "Button", "Heading", "React", "useImperativeHandle", "useRef", "Specs", "page", "ref", "data", "buildData", "onChange", "onSecondaryChange", "isMobile", "active", "setActive", "isShowMax", "setIsShowMax", "visibleActive", "setVisibleActive", "innerRef", "locale", "LeftMenu", "RightMenu", "DefaultSelectMenu", "isImageUrl", "urlPath", "path", "skuNode", "product", "index", "findCurrentData", "item", "findSku", "coupon", "price", "basePrice", "buttonTextValue", "normalNode", "v", "productNode", "st", "idx", "isFirstParameter", "currentData", "currentMenus", "childrenNode", "node", "subTitle", "isProduct", "currentProduct", "skus", "currentActive", "sku", "findData", "newActive", "newShowActive", "Specs_default"]
7
7
  }
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as a}from"react";import{Text as s,Checkbox as g,Button as y}from"../../components/index.js";import{cn as u}from"../../helpers/utils.js";import{LoadingDots as D}from"../../components/index.js";const E=({subscribeMetadata:t,onSubmit:h,className:k,loading:w})=>{const[i,n]=a(null),[d,p]=a(null),[v,c]=a(!1),[x,f]=a(""),N=o=>{o.preventDefault();const r=new FormData(o.target),m=r.get("email"),b=r.get("terms"),B=r.get("news");if(!m){n(t?.emptyError);return}if(!/^[a-zA-Z0-9.,%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(m)){n(t?.formatError);return}if(!b){p(t?.termsError);return}h?.({email:m,terms:b,news:B,dealsType:t?.dealsType,onSuccess:()=>{c(!0);let F=setTimeout(()=>{c(!1),clearTimeout(F)},3e3)}})};return l("div",{className:u("subscribe-component laptop:flex-row laptop:gap-4 desktop:flex-col desktop:gap-8 flex flex-col gap-4",k),children:[e("style",{jsx:!0,global:!0,children:`
1
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as a}from"react";import{Text as s,Checkbox as g,Button as y}from"../../components/index.js";import{cn as u}from"../../helpers/utils.js";import{LoadingDots as A}from"../../components/index.js";const E=({subscribeMetadata:t,onSubmit:h,className:k,loading:w})=>{const[i,n]=a(null),[d,p]=a(null),[v,c]=a(!1),[x,f]=a(""),N=o=>{o.preventDefault();const r=new FormData(o.target),m=r.get("email"),b=r.get("terms"),B=r.get("news");if(!m){n(t?.emptyError);return}if(!/^[a-zA-Z0-9.,%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(m)){n(t?.formatError);return}if(!b){p(t?.termsError);return}h?.({email:m,terms:b,news:B,dealsType:t?.dealsType,onSuccess:()=>{c(!0);let F=setTimeout(()=>{c(!1),clearTimeout(F)},3e3)}})};return l("div",{className:u("subscribe-component laptop:flex-row laptop:gap-4 desktop:flex-col desktop:gap-8 flex flex-col gap-4",k),children:[e("style",{jsx:!0,global:!0,children:`
2
2
  .subscribe-component input:-webkit-autofill,
3
3
  .subscribe-component input:-webkit-autofill:hover,
4
4
  .subscribe-component input:-webkit-autofill:focus {
@@ -7,5 +7,5 @@ import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as a}from"reac
7
7
  transition: background-color 9999s ease-in-out 0s !important;
8
8
  caret-color: #fff;
9
9
  }
10
- `}),l("div",{className:"laptop:flex-1",children:[e(s,{as:"p",html:t?.title,className:"desktop:text-base text-sm font-bold leading-[1.4] text-white"}),e(s,{as:"p",html:t?.subtitle,className:"desktop:mt-2 desktop:text-[32px] mt-1 text-2xl font-bold leading-[1.2] text-white"})]}),l("form",{className:"laptop:flex-1",onSubmit:N,children:[l("div",{className:"desktop:h-[48px] flex h-[38px] items-center",children:[l("div",{className:"tablet:max-w-[320px] laptop:max-w-[404px] relative h-full flex-1",children:[e("input",{name:"email",onFocus:()=>n(null),value:x,onChange:o=>f(o.target.value),placeholder:t?.placeholder,className:"desktop:text-base rounded-l-btn size-full rounded-r-none border border-[#B6B6BA] bg-transparent px-4 text-sm font-bold leading-[1.2] text-white"}),e("button",{onClick:()=>f(""),className:u("absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",{hidden:!x}),children:"\u2715"})]}),e(y,{type:"submit",className:"desktop:px-7 rounded-r-btn desktop:text-base h-full !rounded-l-none bg-white px-5 text-sm font-bold leading-[1.2] text-black",children:w?e(D,{}):e(s,{html:t?.button,className:"desktop:text-base text-sm font-bold leading-[1.2]"})})]}),i&&e(s,{as:"p",html:i,className:"laptop:text-base mt-2 text-sm font-bold leading-[1.2] text-[#F84D4F]"}),l("div",{className:"mt-4 flex flex-col gap-2",children:[l("div",{className:"laptop:items-center flex items-start gap-2",children:[e(g,{name:"terms",id:"terms",size:"base",checked:t?.termsChecked,onCheckedChange:o=>o&&p(null),className:"border-[#B6B6BA] data-[state=checked]:bg-white data-[state=checked]:text-[#1D1D1F]"}),e("label",{htmlFor:"terms",children:e(s,{as:"p",html:t?.terms,className:"desktop:text-base text-sm font-bold leading-[1.4] text-[#B6B6BA]"})})]}),d&&e(s,{as:"p",html:d,className:"laptop:text-base text-sm font-bold leading-[1.2] text-[#F84D4F]"}),l("div",{className:"flex items-start gap-2",children:[e(g,{name:"news",id:"news",size:"base",checked:t?.newsChecked,className:"border-[#B6B6BA] data-[state=checked]:bg-white data-[state=checked]:text-[#1D1D1F]"}),e("label",{htmlFor:"news",children:e(s,{as:"p",html:t?.news,className:"desktop:text-base text-sm font-bold leading-[1.4] text-[#B6B6BA]"})})]}),v&&e(s,{as:"p",html:t?.successMessage,className:"text-brand-0 text-base font-bold leading-[1.2]"})]})]})]})};var L=E;export{L as default};
10
+ `}),l("div",{className:"laptop:flex-1",children:[e(s,{as:"p",html:t?.title,className:"desktop:text-base text-sm font-bold leading-[1.4] text-white"}),e(s,{as:"p",html:t?.subtitle,className:"desktop:mt-2 desktop:text-[32px] mt-1 text-2xl font-bold leading-[1.2] text-white"})]}),l("form",{className:"laptop:flex-1",onSubmit:N,children:[l("div",{className:"desktop:h-[48px] flex h-[38px] items-center",children:[l("div",{className:"tablet:max-w-[320px] laptop:max-w-[404px] relative h-full flex-1",children:[e("input",{name:"email",onFocus:()=>n(null),value:x,onChange:o=>f(o.target.value),placeholder:t?.placeholder,className:"desktop:text-base rounded-l-btn size-full rounded-r-none border border-[#B6B6BA] bg-transparent px-4 text-sm font-bold leading-[1.2] text-white"}),e("button",{onClick:()=>f(""),className:u("absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",{hidden:!x}),children:"\u2715"})]}),e(y,{type:"submit",className:"desktop:px-7 rounded-r-btn desktop:text-base h-full !rounded-l-none bg-white px-5 text-sm font-bold leading-[1.2] text-black",children:w?e(A,{}):e(s,{html:t?.button,className:"desktop:text-base text-sm font-bold leading-[1.2]"})})]}),i&&e(s,{as:"p",html:i,className:"laptop:text-base mt-2 text-sm font-bold leading-[1.2] text-[#F84D4F]"}),l("div",{className:"mt-4 flex flex-col gap-2",children:[l("div",{className:"laptop:items-center flex items-start gap-2",children:[e(g,{name:"terms",id:"terms",size:"base",checked:t?.termsChecked,onCheckedChange:o=>o&&p(null),className:"border-[#B6B6BA] data-[state=checked]:bg-white data-[state=checked]:text-[#080A0F]"}),e("label",{htmlFor:"terms",children:e(s,{as:"p",html:t?.terms,className:"desktop:text-base text-sm font-bold leading-[1.4] text-[#B6B6BA]"})})]}),d&&e(s,{as:"p",html:d,className:"laptop:text-base text-sm font-bold leading-[1.2] text-[#F84D4F]"}),l("div",{className:"flex items-start gap-2",children:[e(g,{name:"news",id:"news",size:"base",checked:t?.newsChecked,className:"border-[#B6B6BA] data-[state=checked]:bg-white data-[state=checked]:text-[#080A0F]"}),e("label",{htmlFor:"news",children:e(s,{as:"p",html:t?.news,className:"desktop:text-base text-sm font-bold leading-[1.4] text-[#B6B6BA]"})})]}),v&&e(s,{as:"p",html:t?.successMessage,className:"text-brand-0 text-base font-bold leading-[1.2]"})]})]})]})};var L=E;export{L as default};
11
11
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Subscribe/index.tsx"],
4
- "sourcesContent": ["import React, { useState } from 'react'\nimport { Text, Checkbox, Button } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { LoadingDots } from '../../components/index.js'\n\n/**\n * Subscribe \u8BA2\u9605\u6A21\u5757\n * @param subscribeMetadata \u8BA2\u9605\u6A21\u5757\u6570\u636E\n * @param onSubmit \u63D0\u4EA4\u4E8B\u4EF6\n * @param className \u7C7B\u540D\n * @returns\n */\nconst Subscribe = ({\n subscribeMetadata,\n onSubmit,\n className,\n loading,\n}: {\n subscribeMetadata: any\n onSubmit?: ({\n email,\n terms,\n news,\n dealsType,\n onSuccess,\n }: {\n email: string\n terms: string\n news: string\n dealsType?: string\n onSuccess?: () => void\n }) => void\n className?: string\n loading?: boolean\n}) => {\n const [error, setError] = useState<string | null>(null)\n const [termsError, setTermsError] = useState<string | null>(null)\n const [success, setSuccess] = useState<boolean>(false)\n const [email, setEmail] = useState<string>('')\n\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n const formData = new FormData(e.target as HTMLFormElement)\n const email = formData.get('email')\n const terms = formData.get('terms')\n const news = formData.get('news')\n if (!email) {\n setError(subscribeMetadata?.emptyError)\n return\n }\n if (!/^[a-zA-Z0-9.,%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/.test(email as string)) {\n setError(subscribeMetadata?.formatError)\n return\n }\n if (!terms) {\n setTermsError(subscribeMetadata?.termsError)\n return\n }\n onSubmit?.({\n email: email as string,\n terms: terms as string,\n news: news as string,\n dealsType: subscribeMetadata?.dealsType,\n onSuccess: () => {\n setSuccess(true)\n let timer = setTimeout(() => {\n setSuccess(false)\n clearTimeout(timer)\n }, 3000)\n },\n })\n }\n\n return (\n <div\n className={cn(\n 'subscribe-component laptop:flex-row laptop:gap-4 desktop:flex-col desktop:gap-8 flex flex-col gap-4',\n className\n )}\n >\n <style jsx global>\n {`\n .subscribe-component input:-webkit-autofill,\n .subscribe-component input:-webkit-autofill:hover,\n .subscribe-component input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important; /* \u80CC\u666F\u900F\u660E */\n -webkit-text-fill-color: #fff !important;\n transition: background-color 9999s ease-in-out 0s !important;\n caret-color: #fff;\n }\n `}\n </style>\n <div className=\"laptop:flex-1\">\n <Text\n as=\"p\"\n html={subscribeMetadata?.title}\n className=\"desktop:text-base text-sm font-bold leading-[1.4] text-white\"\n />\n <Text\n as=\"p\"\n html={subscribeMetadata?.subtitle}\n className=\"desktop:mt-2 desktop:text-[32px] mt-1 text-2xl font-bold leading-[1.2] text-white\"\n />\n </div>\n <form className=\"laptop:flex-1\" onSubmit={handleSubmit}>\n <div className=\"desktop:h-[48px] flex h-[38px] items-center\">\n <div className=\"tablet:max-w-[320px] laptop:max-w-[404px] relative h-full flex-1\">\n <input\n name=\"email\"\n onFocus={() => setError(null)}\n value={email}\n onChange={e => setEmail(e.target.value)}\n placeholder={subscribeMetadata?.placeholder}\n className=\"desktop:text-base rounded-l-btn size-full rounded-r-none border border-[#B6B6BA] bg-transparent px-4 text-sm font-bold leading-[1.2] text-white\"\n />\n <button\n onClick={() => setEmail('')}\n className={cn('absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600', {\n hidden: !email,\n })}\n >\n \u2715\n </button>\n </div>\n <Button\n type=\"submit\"\n className=\"desktop:px-7 rounded-r-btn desktop:text-base h-full !rounded-l-none bg-white px-5 text-sm font-bold leading-[1.2] text-black\"\n >\n {loading ? (\n <LoadingDots />\n ) : (\n <Text html={subscribeMetadata?.button} className=\"desktop:text-base text-sm font-bold leading-[1.2]\" />\n )}\n </Button>\n </div>\n {error && (\n <Text as=\"p\" html={error} className=\"laptop:text-base mt-2 text-sm font-bold leading-[1.2] text-[#F84D4F]\" />\n )}\n <div className=\"mt-4 flex flex-col gap-2\">\n <div className=\"laptop:items-center flex items-start gap-2\">\n <Checkbox\n name=\"terms\"\n id=\"terms\"\n size=\"base\"\n checked={subscribeMetadata?.termsChecked}\n onCheckedChange={(checked: boolean) => checked && setTermsError(null)}\n className=\"border-[#B6B6BA] data-[state=checked]:bg-white data-[state=checked]:text-[#1D1D1F]\"\n />\n <label htmlFor=\"terms\">\n <Text\n as=\"p\"\n html={subscribeMetadata?.terms}\n className=\"desktop:text-base text-sm font-bold leading-[1.4] text-[#B6B6BA]\"\n />\n </label>\n </div>\n {termsError && (\n <Text\n as=\"p\"\n html={termsError}\n className=\"laptop:text-base text-sm font-bold leading-[1.2] text-[#F84D4F]\"\n />\n )}\n <div className=\"flex items-start gap-2\">\n <Checkbox\n name=\"news\"\n id=\"news\"\n size=\"base\"\n checked={subscribeMetadata?.newsChecked}\n className=\"border-[#B6B6BA] data-[state=checked]:bg-white data-[state=checked]:text-[#1D1D1F]\"\n />\n <label htmlFor=\"news\">\n <Text\n as=\"p\"\n html={subscribeMetadata?.news}\n className=\"desktop:text-base text-sm font-bold leading-[1.4] text-[#B6B6BA]\"\n />\n </label>\n </div>\n {success && (\n <Text\n as=\"p\"\n html={subscribeMetadata?.successMessage}\n className=\"text-brand-0 text-base font-bold leading-[1.2]\"\n />\n )}\n </div>\n </form>\n </div>\n )\n}\n\nexport default Subscribe\n"],
4
+ "sourcesContent": ["import React, { useState } from 'react'\nimport { Text, Checkbox, Button } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { LoadingDots } from '../../components/index.js'\n\n/**\n * Subscribe \u8BA2\u9605\u6A21\u5757\n * @param subscribeMetadata \u8BA2\u9605\u6A21\u5757\u6570\u636E\n * @param onSubmit \u63D0\u4EA4\u4E8B\u4EF6\n * @param className \u7C7B\u540D\n * @returns\n */\nconst Subscribe = ({\n subscribeMetadata,\n onSubmit,\n className,\n loading,\n}: {\n subscribeMetadata: any\n onSubmit?: ({\n email,\n terms,\n news,\n dealsType,\n onSuccess,\n }: {\n email: string\n terms: string\n news: string\n dealsType?: string\n onSuccess?: () => void\n }) => void\n className?: string\n loading?: boolean\n}) => {\n const [error, setError] = useState<string | null>(null)\n const [termsError, setTermsError] = useState<string | null>(null)\n const [success, setSuccess] = useState<boolean>(false)\n const [email, setEmail] = useState<string>('')\n\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n const formData = new FormData(e.target as HTMLFormElement)\n const email = formData.get('email')\n const terms = formData.get('terms')\n const news = formData.get('news')\n if (!email) {\n setError(subscribeMetadata?.emptyError)\n return\n }\n if (!/^[a-zA-Z0-9.,%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/.test(email as string)) {\n setError(subscribeMetadata?.formatError)\n return\n }\n if (!terms) {\n setTermsError(subscribeMetadata?.termsError)\n return\n }\n onSubmit?.({\n email: email as string,\n terms: terms as string,\n news: news as string,\n dealsType: subscribeMetadata?.dealsType,\n onSuccess: () => {\n setSuccess(true)\n let timer = setTimeout(() => {\n setSuccess(false)\n clearTimeout(timer)\n }, 3000)\n },\n })\n }\n\n return (\n <div\n className={cn(\n 'subscribe-component laptop:flex-row laptop:gap-4 desktop:flex-col desktop:gap-8 flex flex-col gap-4',\n className\n )}\n >\n <style jsx global>\n {`\n .subscribe-component input:-webkit-autofill,\n .subscribe-component input:-webkit-autofill:hover,\n .subscribe-component input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important; /* \u80CC\u666F\u900F\u660E */\n -webkit-text-fill-color: #fff !important;\n transition: background-color 9999s ease-in-out 0s !important;\n caret-color: #fff;\n }\n `}\n </style>\n <div className=\"laptop:flex-1\">\n <Text\n as=\"p\"\n html={subscribeMetadata?.title}\n className=\"desktop:text-base text-sm font-bold leading-[1.4] text-white\"\n />\n <Text\n as=\"p\"\n html={subscribeMetadata?.subtitle}\n className=\"desktop:mt-2 desktop:text-[32px] mt-1 text-2xl font-bold leading-[1.2] text-white\"\n />\n </div>\n <form className=\"laptop:flex-1\" onSubmit={handleSubmit}>\n <div className=\"desktop:h-[48px] flex h-[38px] items-center\">\n <div className=\"tablet:max-w-[320px] laptop:max-w-[404px] relative h-full flex-1\">\n <input\n name=\"email\"\n onFocus={() => setError(null)}\n value={email}\n onChange={e => setEmail(e.target.value)}\n placeholder={subscribeMetadata?.placeholder}\n className=\"desktop:text-base rounded-l-btn size-full rounded-r-none border border-[#B6B6BA] bg-transparent px-4 text-sm font-bold leading-[1.2] text-white\"\n />\n <button\n onClick={() => setEmail('')}\n className={cn('absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600', {\n hidden: !email,\n })}\n >\n \u2715\n </button>\n </div>\n <Button\n type=\"submit\"\n className=\"desktop:px-7 rounded-r-btn desktop:text-base h-full !rounded-l-none bg-white px-5 text-sm font-bold leading-[1.2] text-black\"\n >\n {loading ? (\n <LoadingDots />\n ) : (\n <Text html={subscribeMetadata?.button} className=\"desktop:text-base text-sm font-bold leading-[1.2]\" />\n )}\n </Button>\n </div>\n {error && (\n <Text as=\"p\" html={error} className=\"laptop:text-base mt-2 text-sm font-bold leading-[1.2] text-[#F84D4F]\" />\n )}\n <div className=\"mt-4 flex flex-col gap-2\">\n <div className=\"laptop:items-center flex items-start gap-2\">\n <Checkbox\n name=\"terms\"\n id=\"terms\"\n size=\"base\"\n checked={subscribeMetadata?.termsChecked}\n onCheckedChange={(checked: boolean) => checked && setTermsError(null)}\n className=\"border-[#B6B6BA] data-[state=checked]:bg-white data-[state=checked]:text-[#080A0F]\"\n />\n <label htmlFor=\"terms\">\n <Text\n as=\"p\"\n html={subscribeMetadata?.terms}\n className=\"desktop:text-base text-sm font-bold leading-[1.4] text-[#B6B6BA]\"\n />\n </label>\n </div>\n {termsError && (\n <Text\n as=\"p\"\n html={termsError}\n className=\"laptop:text-base text-sm font-bold leading-[1.2] text-[#F84D4F]\"\n />\n )}\n <div className=\"flex items-start gap-2\">\n <Checkbox\n name=\"news\"\n id=\"news\"\n size=\"base\"\n checked={subscribeMetadata?.newsChecked}\n className=\"border-[#B6B6BA] data-[state=checked]:bg-white data-[state=checked]:text-[#080A0F]\"\n />\n <label htmlFor=\"news\">\n <Text\n as=\"p\"\n html={subscribeMetadata?.news}\n className=\"desktop:text-base text-sm font-bold leading-[1.4] text-[#B6B6BA]\"\n />\n </label>\n </div>\n {success && (\n <Text\n as=\"p\"\n html={subscribeMetadata?.successMessage}\n className=\"text-brand-0 text-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,EAAC,OAAI,UAAU,yBACb,UAAAD,EAACI,EAAA,CACC,KAAK,OACL,GAAG,OACH,KAAK,OACL,QAASK,GAAmB,YAC5B,UAAU,qFACZ,EACAT,EAAC,SAAM,QAAQ,OACb,SAAAA,EAACG,EAAA,CACC,GAAG,IACH,KAAMM,GAAmB,KACzB,UAAU,mEACZ,EACF,GACF,EACCQ,GACCjB,EAACG,EAAA,CACC,GAAG,IACH,KAAMM,GAAmB,eACzB,UAAU,iDACZ,GAEJ,GACF,GACF,CAEJ,EAEA,IAAOmB,EAAQpB",
6
6
  "names": ["jsx", "jsxs", "useState", "Text", "Checkbox", "Button", "cn", "LoadingDots", "Subscribe", "subscribeMetadata", "onSubmit", "className", "loading", "error", "setError", "termsError", "setTermsError", "success", "setSuccess", "email", "setEmail", "handleSubmit", "e", "formData", "terms", "news", "timer", "checked", "Subscribe_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Dialog as x,DialogContent as d}from"../../components/dialog.js";import{Picture as n,Text as l}from"../../components/index.js";import"../../helpers/index.js";const m=i=>{const{textVisible:s,extension:e,onCloseModal:o}=i;return t(x,{open:s,onOpenChange:()=>o(),children:t(d,{className:"tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl z-[9999] mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden",children:a("div",{className:"tablet:rounded-2xl md-tablet:flex md-tablet:flex-col overflow-hidden rounded-lg",children:[t("div",{className:"md-tablet:flex-1 min-h-[260px] w-full",children:t(n,{source:`${e?.textPcImg?.url||""} , ${e?.textMobileImg?.url||""} 767`,className:"size-full",imgClassName:"w-full h-full object-cover"})}),t("div",{className:"tablet:inset-x-8 tablet:top-8 absolute inset-x-4 top-4",children:t(l,{html:e?.textTitle,className:"tablet:text-[24px] text-[20px] font-bold leading-[1.2]"})}),t("div",{onClick:()=>o(),className:"absolute right-4 top-4 cursor-pointer",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:t("g",{"clip-path":"url(#clip0_2548_10038)",children:t("path",{d:"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z",fill:"white"})})})}),a("div",{className:"tablet:p-8 tablet:max-h-60 md-tablet:flex-1 overflow-y-auto p-4 text-[#1D1D1F]",children:[t(l,{html:e?.text,className:" tablet:text-2xl text-xl font-bold leading-[1.2]"}),t("br",{}),t(l,{html:e?.textDesc,className:"tablet:leading-[1.2] pt-1 text-base font-bold leading-[1.4]"})]})]})})})};export{m as TextModal};
1
+ import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Dialog as x,DialogContent as d}from"../../components/dialog.js";import{Picture as n,Text as l}from"../../components/index.js";import"../../helpers/index.js";const m=i=>{const{textVisible:s,extension:e,onCloseModal:o}=i;return t(x,{open:s,onOpenChange:()=>o(),children:t(d,{className:"tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl z-[9999] mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden",children:a("div",{className:"tablet:rounded-2xl md-tablet:flex md-tablet:flex-col overflow-hidden rounded-lg",children:[t("div",{className:"md-tablet:flex-1 min-h-[260px] w-full",children:t(n,{source:`${e?.textPcImg?.url||""} , ${e?.textMobileImg?.url||""} 767`,className:"size-full",imgClassName:"w-full h-full object-cover"})}),t("div",{className:"tablet:inset-x-8 tablet:top-8 absolute inset-x-4 top-4",children:t(l,{html:e?.textTitle,className:"tablet:text-[24px] text-[20px] font-bold leading-[1.2]"})}),t("div",{onClick:()=>o(),className:"absolute right-4 top-4 cursor-pointer",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:t("g",{"clip-path":"url(#clip0_2548_10038)",children:t("path",{d:"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z",fill:"white"})})})}),a("div",{className:"tablet:p-8 tablet:max-h-60 md-tablet:flex-1 overflow-y-auto p-4 text-[#080A0F]",children:[t(l,{html:e?.text,className:" tablet:text-2xl text-xl font-bold leading-[1.2]"}),t("br",{}),t(l,{html:e?.textDesc,className:"tablet:leading-[1.2] pt-1 text-base font-bold leading-[1.4]"})]})]})})})};export{m as TextModal};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/TextModal/index.tsx"],
4
- "sourcesContent": ["import type { Media } from '../../types/props.js'\nimport { Dialog, DialogContent } from '../../components/dialog.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport type { Img } from '../../types/props.js'\n\nexport type TextModalType = {\n textVisible: boolean\n extension?: {\n textPcImg: Img\n textMobileImg: Img\n textTitle: string\n text: string\n textDesc: string\n }\n onCloseModal: () => void\n}\n\nconst TextModal = (props: TextModalType) => {\n const { textVisible, extension, onCloseModal } = props\n\n return (\n <Dialog open={textVisible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\"tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl z-[9999] mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden\">\n <div className=\"tablet:rounded-2xl md-tablet:flex md-tablet:flex-col overflow-hidden rounded-lg\">\n <div className=\"md-tablet:flex-1 min-h-[260px] w-full\">\n <Picture\n source={`${extension?.textPcImg?.url || ''} , ${extension?.textMobileImg?.url || ''} 767`}\n className=\"size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n <div className=\"tablet:inset-x-8 tablet:top-8 absolute inset-x-4 top-4\">\n <Text html={extension?.textTitle} className=\"tablet:text-[24px] text-[20px] font-bold leading-[1.2]\" />\n </div>\n <div onClick={() => onCloseModal()} className=\"absolute right-4 top-4 cursor-pointer\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" viewBox=\"0 0 24 25\" fill=\"none\">\n <g clip-path=\"url(#clip0_2548_10038)\">\n <path\n d=\"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z\"\n fill=\"white\"\n />\n </g>\n </svg>\n </div>\n <div className=\"tablet:p-8 tablet:max-h-60 md-tablet:flex-1 overflow-y-auto p-4 text-[#1D1D1F]\">\n <Text html={extension?.text} className=\" tablet:text-2xl text-xl font-bold leading-[1.2]\" />\n <br />\n <Text html={extension?.textDesc} className=\"tablet:leading-[1.2] pt-1 text-base font-bold leading-[1.4]\" />\n </div>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { TextModal }\n"],
4
+ "sourcesContent": ["import type { Media } from '../../types/props.js'\nimport { Dialog, DialogContent } from '../../components/dialog.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport type { Img } from '../../types/props.js'\n\nexport type TextModalType = {\n textVisible: boolean\n extension?: {\n textPcImg: Img\n textMobileImg: Img\n textTitle: string\n text: string\n textDesc: string\n }\n onCloseModal: () => void\n}\n\nconst TextModal = (props: TextModalType) => {\n const { textVisible, extension, onCloseModal } = props\n\n return (\n <Dialog open={textVisible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\"tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl z-[9999] mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden\">\n <div className=\"tablet:rounded-2xl md-tablet:flex md-tablet:flex-col overflow-hidden rounded-lg\">\n <div className=\"md-tablet:flex-1 min-h-[260px] w-full\">\n <Picture\n source={`${extension?.textPcImg?.url || ''} , ${extension?.textMobileImg?.url || ''} 767`}\n className=\"size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n <div className=\"tablet:inset-x-8 tablet:top-8 absolute inset-x-4 top-4\">\n <Text html={extension?.textTitle} className=\"tablet:text-[24px] text-[20px] font-bold leading-[1.2]\" />\n </div>\n <div onClick={() => onCloseModal()} className=\"absolute right-4 top-4 cursor-pointer\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" viewBox=\"0 0 24 25\" fill=\"none\">\n <g clip-path=\"url(#clip0_2548_10038)\">\n <path\n d=\"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z\"\n fill=\"white\"\n />\n </g>\n </svg>\n </div>\n <div className=\"tablet:p-8 tablet:max-h-60 md-tablet:flex-1 overflow-y-auto p-4 text-[#080A0F]\">\n <Text html={extension?.text} className=\" tablet:text-2xl text-xl font-bold leading-[1.2]\" />\n <br />\n <Text html={extension?.textDesc} className=\"tablet:leading-[1.2] pt-1 text-base font-bold leading-[1.4]\" />\n </div>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { TextModal }\n"],
5
5
  "mappings": "AA0BY,cAAAA,EAmBF,QAAAC,MAnBE,oBAzBZ,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,6BACtC,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,MAAmB,yBAenB,MAAMC,EAAaC,GAAyB,CAC1C,KAAM,CAAE,YAAAC,EAAa,UAAAC,EAAW,aAAAC,CAAa,EAAIH,EAEjD,OACEP,EAACE,EAAA,CAAO,KAAMM,EAAa,aAAc,IAAME,EAAa,EAC1D,SAAAV,EAACG,EAAA,CAAc,UAAU,yJACvB,SAAAF,EAAC,OAAI,UAAU,kFACb,UAAAD,EAAC,OAAI,UAAU,wCACb,SAAAA,EAACI,EAAA,CACC,OAAQ,GAAGK,GAAW,WAAW,KAAO,EAAE,MAAMA,GAAW,eAAe,KAAO,EAAE,OACnF,UAAU,YACV,aAAa,6BACf,EACF,EACAT,EAAC,OAAI,UAAU,yDACb,SAAAA,EAACK,EAAA,CAAK,KAAMI,GAAW,UAAW,UAAU,yDAAyD,EACvG,EACAT,EAAC,OAAI,QAAS,IAAMU,EAAa,EAAG,UAAU,wCAC5C,SAAAV,EAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACtF,SAAAA,EAAC,KAAE,YAAU,yBACX,SAAAA,EAAC,QACC,EAAE,0gBACF,KAAK,QACP,EACF,EACF,EACF,EACAC,EAAC,OAAI,UAAU,iFACb,UAAAD,EAACK,EAAA,CAAK,KAAMI,GAAW,KAAM,UAAU,mDAAmD,EAC1FT,EAAC,OAAG,EACJA,EAACK,EAAA,CAAK,KAAMI,GAAW,SAAU,UAAU,8DAA8D,GAC3G,GACF,EACF,EACF,CAEJ",
6
6
  "names": ["jsx", "jsxs", "Dialog", "DialogContent", "Picture", "Text", "TextModal", "props", "textVisible", "extension", "onCloseModal"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as e,jsxs as R}from"react/jsx-runtime";import O,{useEffect as W,useRef as o,useImperativeHandle as _}from"react";import{gsap as p}from"gsap";import{SplitText as x}from"gsap/dist/SplitText";import{ScrollTrigger as T}from"gsap/dist/ScrollTrigger";import{cn as k}from"../../helpers/utils.js";import{Heading as q}from"../../components/index.js";import{withLayout as A}from"../../shared/Styles.js";import{trackUrlRef as G}from"../../shared/trackUrlRef.js";import{useInView as J}from"react-intersection-observer";const b="link",y="title",L=O.forwardRef(({data:N,className:H,as:M="h2",weight:E="bold"},$)=>{const{title:s,caption:l,theme:u,extensions:i,align:a="left"}=N,f=o(null),r=o(null),t=o(null),n=o(null),{ref:D,inView:g}=J();return _($,()=>f.current),W(()=>{p.registerPlugin(x,T);function z(){if(!r.current)return;const P=r.current?.clientHeight||80;t.current&&t.current.revert(),n.current&&n.current.kill(),t.current=new x(r.current,{type:"words",wordsClass:"word"});const c=t.current.words;p.set(c,{opacity:0}),n.current=T.create({trigger:r.current,start:"bottom bottom-=4%",end:`bottom+=${P*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:S=>{const I=S.progress,h=c.length||1,V=.5,m=1/h,v=m*(1-V),w=(h-1)*v+m,B=Math.min(1,w>0?I/w:0);c.forEach((U,j)=>{const C=j*v,F=m;let d=(B-C)/F;d=Math.max(0,Math.min(1,d)),p.set(U,{opacity:d})})}})}return g&&z(),()=>{t.current&&t.current.revert(),n.current&&n.current.kill()}},[g]),(s||l)&&R("div",{id:i?.id,className:"titleBottom title-box mb-6 flex items-end justify-between gap-2",ref:f,children:[e("div",{ref:D,className:k("flex-1 space-y-4",H,{"aiui-dark":u==="dark","text-center":a==="center","text-right":a==="right","text-left":a==="left"}),children:e(q,{ref:r,as:M,size:4,html:l||s,weight:E})}),i?.textLink&&R("a",{className:k({"aiui-dark":u==="dark"},"flex items-center overflow-hidden text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]"),href:G(i?.link,`${b}_${y}`),"data-headless-type-name":`${b}#${y}`,"data-headless-title-desc-button":`${s}#${l}`,children:[e("div",{className:"flex-1 truncate whitespace-nowrap",children:i?.textLink}),e("div",{className:"size-6",children:e("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:e("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]})});L.displayName="Title";var it=A(L);export{it as default};
1
+ "use client";import{jsx as e,jsxs as R}from"react/jsx-runtime";import F,{useEffect as O,useRef as o,useImperativeHandle as W}from"react";import{gsap as p}from"gsap";import{SplitText as x}from"gsap/dist/SplitText";import{ScrollTrigger as T}from"gsap/dist/ScrollTrigger";import{cn as k}from"../../helpers/utils.js";import{Heading as _}from"../../components/index.js";import{withLayout as q}from"../../shared/Styles.js";import{trackUrlRef as G}from"../../shared/trackUrlRef.js";import{useInView as J}from"react-intersection-observer";const b="link",y="title",L=F.forwardRef(({data:N,className:H,as:M="h2",weight:E="bold"},$)=>{const{title:s,caption:l,theme:u,extensions:i,align:a="left"}=N,f=o(null),r=o(null),t=o(null),n=o(null),{ref:z,inView:g}=J();return W($,()=>f.current),O(()=>{p.registerPlugin(x,T);function P(){if(!r.current)return;const S=r.current?.clientHeight||80;t.current&&t.current.revert(),n.current&&n.current.kill(),t.current=new x(r.current,{type:"words",wordsClass:"word"});const c=t.current.words;p.set(c,{opacity:0}),n.current=T.create({trigger:r.current,start:"bottom bottom-=4%",end:`bottom+=${S*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:D=>{const I=D.progress,h=c.length||1,V=.5,m=1/h,v=m*(1-V),w=(h-1)*v+m,B=Math.min(1,w>0?I/w:0);c.forEach((U,j)=>{const A=j*v,C=m;let d=(B-A)/C;d=Math.max(0,Math.min(1,d)),p.set(U,{opacity:d})})}})}return g&&P(),()=>{t.current&&t.current.revert(),n.current&&n.current.kill()}},[g]),(s||l)&&R("div",{id:i?.id,className:"titleBottom title-box mb-6 flex items-end justify-between gap-2",ref:f,children:[e("div",{ref:z,className:k("flex-1 space-y-4",H,{"aiui-dark":u==="dark","text-center":a==="center","text-right":a==="right","text-left":a==="left"}),children:e(_,{ref:r,as:M,size:4,html:l||s,weight:E})}),i?.textLink&&R("a",{className:k({"aiui-dark":u==="dark"},"flex items-center overflow-hidden text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#080A0F]"),href:G(i?.link,`${b}_${y}`),"data-headless-type-name":`${b}#${y}`,"data-headless-title-desc-button":`${s}#${l}`,children:[e("div",{className:"flex-1 truncate whitespace-nowrap",children:i?.textLink}),e("div",{className:"size-6",children:e("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:e("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]})});L.displayName="Title";var it=q(L);export{it as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className, as = 'h2', weight = 'bold' }, ref) => {\n const { title, caption, theme, extensions, align = 'left' } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n if (splitTextInstance.current) {\n splitTextInstance.current.revert()\n }\n if (scrollTriggerRef.current) {\n scrollTriggerRef.current.kill()\n }\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length || 1\n const overlap = 0.5\n const interval = 1 / total\n const step = interval * (1 - overlap)\n const lastEnd = (total - 1) * step + interval\n const normalizedProgress = Math.min(1, lastEnd > 0 ? progress / lastEnd : 0)\n words.forEach((word: any, i: number) => {\n const start = i * step\n const width = interval\n let opacity = (normalizedProgress - start) / width\n opacity = Math.max(0, Math.min(1, opacity))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n (title || caption) && (\n <div\n id={extensions?.id}\n className=\"titleBottom title-box mb-6 flex items-end justify-between gap-2\"\n ref={innerRef}\n >\n <div\n ref={inViewRef}\n className={cn('flex-1 space-y-4', className, {\n 'aiui-dark': theme === 'dark',\n 'text-center': align === 'center',\n 'text-right': align === 'right',\n 'text-left': align === 'left',\n })}\n >\n <Heading ref={titleRef} as={as} size={4} html={caption || title} weight={weight} />\n </div>\n {extensions?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'flex items-center overflow-hidden text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]'\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n >\n <div className=\"flex-1 truncate whitespace-nowrap\">{extensions?.textLink}</div>\n <div className=\"size-6\">\n <svg\n width=\"24\"\n height=\"24\"\n className=\"mb-[3px]\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n className=\"transition-all duration-[0.4s]\"\n d=\"M10.5 8L14.5 12L10.5 16\"\n stroke=\"#777\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n ></path>\n </svg>\n </div>\n </a>\n )}\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
4
+ "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className, as = 'h2', weight = 'bold' }, ref) => {\n const { title, caption, theme, extensions, align = 'left' } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n if (splitTextInstance.current) {\n splitTextInstance.current.revert()\n }\n if (scrollTriggerRef.current) {\n scrollTriggerRef.current.kill()\n }\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length || 1\n const overlap = 0.5\n const interval = 1 / total\n const step = interval * (1 - overlap)\n const lastEnd = (total - 1) * step + interval\n const normalizedProgress = Math.min(1, lastEnd > 0 ? progress / lastEnd : 0)\n words.forEach((word: any, i: number) => {\n const start = i * step\n const width = interval\n let opacity = (normalizedProgress - start) / width\n opacity = Math.max(0, Math.min(1, opacity))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n (title || caption) && (\n <div\n id={extensions?.id}\n className=\"titleBottom title-box mb-6 flex items-end justify-between gap-2\"\n ref={innerRef}\n >\n <div\n ref={inViewRef}\n className={cn('flex-1 space-y-4', className, {\n 'aiui-dark': theme === 'dark',\n 'text-center': align === 'center',\n 'text-right': align === 'right',\n 'text-left': align === 'left',\n })}\n >\n <Heading ref={titleRef} as={as} size={4} html={caption || title} weight={weight} />\n </div>\n {extensions?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'flex items-center overflow-hidden text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#080A0F]'\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n >\n <div className=\"flex-1 truncate whitespace-nowrap\">{extensions?.textLink}</div>\n <div className=\"size-6\">\n <svg\n width=\"24\"\n height=\"24\"\n className=\"mb-[3px]\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n className=\"transition-all duration-[0.4s]\"\n d=\"M10.5 8L14.5 12L10.5 16\"\n stroke=\"#777\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n ></path>\n </svg>\n </div>\n </a>\n )}\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
5
  "mappings":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X,CAAa,IAAIC,CAAa,EAAE,EACvE,0BAAyB,GAAGD,CAAa,IAAIC,CAAa,GAC1D,kCAAiC,GAAGO,CAAK,IAAIC,CAAO,GAEpD,UAAAvB,EAAC,OAAI,UAAU,oCAAqC,SAAAyB,GAAY,SAAS,EACzEzB,EAAC,OAAI,UAAU,SACb,SAAAA,EAAC,OACC,MAAM,KACN,OAAO,KACP,UAAU,WACV,MAAM,6BACN,QAAQ,YACR,KAAK,OAEL,SAAAA,EAAC,QACC,UAAU,iCACV,EAAE,0BACF,OAAO,OACP,YAAY,MACZ,cAAc,QACf,EACH,EACF,GACF,GAEJ,CAGN,CAAC,EAEDgB,EAAM,YAAc,QAEpB,IAAOiC,GAAQtC,EAAWK,CAAK",
6
6
  "names": ["jsx", "jsxs", "React", "useEffect", "useRef", "useImperativeHandle", "gsap", "SplitText", "ScrollTrigger", "cn", "Heading", "withLayout", "trackUrlRef", "useInView", "componentType", "componentName", "Title", "data", "className", "as", "weight", "ref", "title", "caption", "theme", "extensions", "align", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "overlap", "interval", "step", "lastEnd", "normalizedProgress", "word", "i", "start", "width", "opacity", "Title_default"]
7
7
  }
@@ -23,9 +23,9 @@ export interface ExposureDetectorProps extends Omit<UseExposureDetectionOptions,
23
23
  style?: React.CSSProperties;
24
24
  }
25
25
  /**
26
- * 曝光检测组件
27
- * 使用 IntersectionObserver 检测子元素是否至少 50% 可见且停留时间超过指定时间
28
- * 确保在整个页面生命周期中只曝光一次
26
+ * ExposureDetector - 曝光检测器
27
+ *
28
+ * @description 使用 IntersectionObserver 检测元素可见性的曝光检测组件,支持阈值和停留时间配置
29
29
  *
30
30
  * @example
31
31
  * ```tsx
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/ExposureDetector.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useRef, type ReactNode } from 'react'\nimport { useExposureDetection, type UseExposureDetectionOptions } from '../hooks/useExposureDetection.js'\n\nexport interface ExposureDetectorProps extends Omit<UseExposureDetectionOptions, 'onExposure'> {\n /**\n * \u5B50\u5143\u7D20\n */\n children: ReactNode\n /**\n * \u66DD\u5149\u56DE\u8C03\u51FD\u6570\n */\n onExposure?: () => void\n /**\n * \u5305\u88C5\u5143\u7D20\u7684\u6807\u7B7E\uFF0C\u9ED8\u8BA4 'div'\n */\n as?: keyof JSX.IntrinsicElements\n /**\n * \u5305\u88C5\u5143\u7D20\u7684 className\n */\n className?: string\n /**\n * \u5305\u88C5\u5143\u7D20\u7684 style\n */\n style?: React.CSSProperties\n}\n\n/**\n * \u66DD\u5149\u68C0\u6D4B\u7EC4\u4EF6\n * \u4F7F\u7528 IntersectionObserver \u68C0\u6D4B\u5B50\u5143\u7D20\u662F\u5426\u81F3\u5C11 50% \u53EF\u89C1\u4E14\u505C\u7559\u65F6\u95F4\u8D85\u8FC7\u6307\u5B9A\u65F6\u95F4\n * \u786E\u4FDD\u5728\u6574\u4E2A\u9875\u9762\u751F\u547D\u5468\u671F\u4E2D\u53EA\u66DD\u5149\u4E00\u6B21\n *\n * @example\n * ```tsx\n * <ExposureDetector\n * exposureKey=\"my-component-1\"\n * threshold={0.5}\n * duration={2000}\n * onExposure={() => {\n * console.log('\u5143\u7D20\u5DF2\u66DD\u5149')\n * }}\n * >\n * <div>\u5185\u5BB9</div>\n * </ExposureDetector>\n * ```\n */\nexport const ExposureDetector: React.FC<ExposureDetectorProps> = ({\n children,\n onExposure,\n exposureKey,\n threshold = 0.5,\n duration = 2000,\n once = true,\n rootMargin = '0px',\n as: Component = 'div',\n className,\n style,\n ...rest\n}) => {\n const elementRef = useRef<HTMLElement>(null)\n\n useExposureDetection(elementRef, {\n exposureKey,\n threshold,\n duration,\n once,\n onExposure,\n rootMargin,\n })\n\n return React.createElement(\n Component,\n {\n ref: elementRef,\n className,\n style,\n ...rest,\n },\n children\n )\n}\n\nexport default ExposureDetector\n"],
4
+ "sourcesContent": ["'use client'\nimport React, { useRef, type ReactNode } from 'react'\nimport { useExposureDetection, type UseExposureDetectionOptions } from '../hooks/useExposureDetection.js'\n\nexport interface ExposureDetectorProps extends Omit<UseExposureDetectionOptions, 'onExposure'> {\n /**\n * \u5B50\u5143\u7D20\n */\n children: ReactNode\n /**\n * \u66DD\u5149\u56DE\u8C03\u51FD\u6570\n */\n onExposure?: () => void\n /**\n * \u5305\u88C5\u5143\u7D20\u7684\u6807\u7B7E\uFF0C\u9ED8\u8BA4 'div'\n */\n as?: keyof JSX.IntrinsicElements\n /**\n * \u5305\u88C5\u5143\u7D20\u7684 className\n */\n className?: string\n /**\n * \u5305\u88C5\u5143\u7D20\u7684 style\n */\n style?: React.CSSProperties\n}\n\n/**\n * ExposureDetector - \u66DD\u5149\u68C0\u6D4B\u5668\n *\n * @description \u4F7F\u7528 IntersectionObserver \u68C0\u6D4B\u5143\u7D20\u53EF\u89C1\u6027\u7684\u66DD\u5149\u68C0\u6D4B\u7EC4\u4EF6\uFF0C\u652F\u6301\u9608\u503C\u548C\u505C\u7559\u65F6\u95F4\u914D\u7F6E\n *\n * @example\n * ```tsx\n * <ExposureDetector\n * exposureKey=\"my-component-1\"\n * threshold={0.5}\n * duration={2000}\n * onExposure={() => {\n * console.log('\u5143\u7D20\u5DF2\u66DD\u5149')\n * }}\n * >\n * <div>\u5185\u5BB9</div>\n * </ExposureDetector>\n * ```\n */\nexport const ExposureDetector: React.FC<ExposureDetectorProps> = ({\n children,\n onExposure,\n exposureKey,\n threshold = 0.5,\n duration = 2000,\n once = true,\n rootMargin = '0px',\n as: Component = 'div',\n className,\n style,\n ...rest\n}) => {\n const elementRef = useRef<HTMLElement>(null)\n\n useExposureDetection(elementRef, {\n exposureKey,\n threshold,\n duration,\n once,\n onExposure,\n rootMargin,\n })\n\n return React.createElement(\n Component,\n {\n ref: elementRef,\n className,\n style,\n ...rest,\n },\n children\n )\n}\n\nexport default ExposureDetector\n"],
5
5
  "mappings": "aACA,OAAOA,GAAS,UAAAC,MAA8B,QAC9C,OAAS,wBAAAC,MAA8D,mCA4ChE,MAAMC,EAAoD,CAAC,CAChE,SAAAC,EACA,WAAAC,EACA,YAAAC,EACA,UAAAC,EAAY,GACZ,SAAAC,EAAW,IACX,KAAAC,EAAO,GACP,WAAAC,EAAa,MACb,GAAIC,EAAY,MAChB,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAad,EAAoB,IAAI,EAE3C,OAAAC,EAAqBa,EAAY,CAC/B,YAAAT,EACA,UAAAC,EACA,SAAAC,EACA,KAAAC,EACA,WAAAJ,EACA,WAAAK,CACF,CAAC,EAEMV,EAAM,cACXW,EACA,CACE,IAAKI,EACL,UAAAH,EACA,MAAAC,EACA,GAAGC,CACL,EACAV,CACF,CACF,EAEA,IAAOY,EAAQb",
6
6
  "names": ["React", "useRef", "useExposureDetection", "ExposureDetector", "children", "onExposure", "exposureKey", "threshold", "duration", "once", "rootMargin", "Component", "className", "style", "rest", "elementRef", "ExposureDetector_default"]
7
7
  }
@@ -1,5 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
+ /**
4
+ * Alert - 警告提示
5
+ *
6
+ * @description 用于显示重要的警告或信息提示,支持多种状态和可关闭功能
7
+ */
3
8
  declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
4
9
  variant?: "default" | "destructive" | null | undefined;
5
10
  } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {