@gem-sdk/components 2.0.0-dev.277 → 2.0.0-dev.288

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 (300) hide show
  1. package/dist/cjs/accordion/components/Accordion.js +60 -179
  2. package/dist/cjs/accordion/components/Accordion.liquid.js +77 -101
  3. package/dist/cjs/accordion/components/AccordionItem.js +126 -280
  4. package/dist/cjs/accordion/components/AccordionItem.liquid.js +77 -215
  5. package/dist/cjs/accordion/components/common/classes.js +55 -0
  6. package/dist/cjs/accordion/components/common/index.js +146 -0
  7. package/dist/cjs/accordion/components/common/styles.js +131 -0
  8. package/dist/cjs/accordion/hooks/useAccordion.js +145 -0
  9. package/dist/cjs/accordion/hooks/useAccordionItem.js +119 -0
  10. package/dist/cjs/article/components/ArticleImage.js +0 -1
  11. package/dist/cjs/article/components/ArticlePagination.js +1 -1
  12. package/dist/cjs/article/components/ArticlePagination.liquid.js +3 -3
  13. package/dist/cjs/article/setting/configs/ArticleImage/settings.js +5 -5
  14. package/dist/cjs/banner/components/HeroBannerItem.js +0 -6
  15. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +3 -0
  16. package/dist/cjs/banner/setting/setting.js +28 -3
  17. package/dist/cjs/banner/setting/uiV2.js +10 -97
  18. package/dist/cjs/builder.js +18 -20
  19. package/dist/cjs/cart/components/CartLineImage.js +0 -2
  20. package/dist/cjs/code/common/classes.js +11 -0
  21. package/dist/cjs/code/common/styles.js +15 -0
  22. package/dist/cjs/code/components/CSSCode.js +9 -99
  23. package/dist/cjs/code/components/CSSCode.liquid.js +11 -11
  24. package/dist/cjs/code/hooks/useCSSCode.js +102 -0
  25. package/dist/cjs/code/setting/CSSCode.js +7 -121
  26. package/dist/cjs/code/setting/config/setting.js +77 -0
  27. package/dist/cjs/code/setting/config/uiV1.js +52 -0
  28. package/dist/cjs/code/setting/config/uiV2.js +58 -0
  29. package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +4 -1
  30. package/dist/cjs/form/components/contact/Contact.js +6 -2
  31. package/dist/cjs/form/components/contact/common/composeStyles.js +21 -0
  32. package/dist/cjs/form/components/form-checkbox/FormCheckbox.js +6 -4
  33. package/dist/cjs/form/components/form-checkbox/FormCheckbox.liquid.js +2 -4
  34. package/dist/cjs/form/components/form-checkbox/common/composeClasses.js +2 -2
  35. package/dist/cjs/form/components/form-checkbox/common/composeStyles.js +23 -10
  36. package/dist/cjs/form/components/form-dropdown/common/composeClasses.js +1 -1
  37. package/dist/cjs/form/components/form-email/FormEmail.js +18 -10
  38. package/dist/cjs/form/components/form-email/common/composeClasses.js +2 -1
  39. package/dist/cjs/form/components/newsletter/Newsletter.js +7 -2
  40. package/dist/cjs/form/components/newsletter/Newsletter.liquid.js +1 -1
  41. package/dist/cjs/form/components/newsletter/common/composeStyles.js +4 -2
  42. package/dist/cjs/form/components/textarea/TextArea.js +16 -8
  43. package/dist/cjs/form/components/textarea/common/composeClasses.js +1 -1
  44. package/dist/cjs/form/components/textfield/TextField.js +17 -9
  45. package/dist/cjs/form/components/textfield/common/composeClasses.js +2 -2
  46. package/dist/cjs/form/setting/contact/Contact.js +5 -1
  47. package/dist/cjs/form/setting/form-checkbox/configs/settings.js +153 -6
  48. package/dist/cjs/form/setting/form-checkbox/configs/uiV2.js +137 -0
  49. package/dist/cjs/form/setting/form-dropdown/configs/settings.js +147 -0
  50. package/dist/cjs/form/setting/form-dropdown/configs/uiV2.js +156 -4
  51. package/dist/cjs/form/setting/newsletter/configs/settings.js +132 -3
  52. package/dist/cjs/form/setting/newsletter/configs/uiV2.js +93 -0
  53. package/dist/cjs/form/setting/submit-button/configs/settings.js +37 -0
  54. package/dist/cjs/form/setting/submit-button/configs/uiV2.js +13 -0
  55. package/dist/cjs/grid/row/commons/getInnerRadius.js +11 -10
  56. package/dist/cjs/grid/row/setting/configs/uiV2.js +1 -1
  57. package/dist/cjs/header/components/kind/basic/index.js +1 -0
  58. package/dist/cjs/header/components/kind/modern/index.js +1 -1
  59. package/dist/cjs/helpers.js +53 -0
  60. package/dist/cjs/icon-list/setting/configs/uiV2.js +1 -1
  61. package/dist/cjs/icon-list-v2/setting/configs/settings.js +5 -5
  62. package/dist/cjs/image/components/AdaptiveImage.js +63 -49
  63. package/dist/cjs/image/components/AdaptiveImage.liquid.js +56 -44
  64. package/dist/cjs/image/components/Image.js +65 -154
  65. package/dist/cjs/image/components/Image.liquid.js +68 -103
  66. package/dist/cjs/image/components/Modal3d.liquid.js +54 -21
  67. package/dist/cjs/image/components/NextImage.js +26 -59
  68. package/dist/cjs/image/components/NextImage.liquid.js +27 -115
  69. package/dist/cjs/image/components/Video.liquid.js +38 -13
  70. package/dist/cjs/image/components/common/attributes.js +115 -0
  71. package/dist/cjs/image/components/common/classes.js +57 -0
  72. package/dist/cjs/image/components/common/constants.js +15 -0
  73. package/dist/cjs/image/components/common/data.js +24 -0
  74. package/dist/cjs/image/components/common/helpers.js +75 -0
  75. package/dist/cjs/image/components/common/styles.js +88 -0
  76. package/dist/cjs/image/components/helpers/getNextImageLiquidAttrs.js +80 -0
  77. package/dist/cjs/image/components/helpers/getNextImageReactAttrs.js +40 -0
  78. package/dist/cjs/image/components/hooks/useCheckNoImage.js +25 -0
  79. package/dist/cjs/image/helpers/getSrcSet.js +0 -2
  80. package/dist/cjs/image/next.js +1 -5
  81. package/dist/cjs/image/setting/configs/settings.js +14 -8
  82. package/dist/cjs/image/setting/configs/uiV2.js +61 -15
  83. package/dist/cjs/image/setting/index.js +1 -3
  84. package/dist/cjs/image-comparison/components/CompareImage.js +1 -1
  85. package/dist/cjs/image-comparison/components/CompareImage.liquid.js +1 -1
  86. package/dist/cjs/index.js +91 -91
  87. package/dist/cjs/index.liquid.js +8 -8
  88. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
  89. package/dist/cjs/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
  90. package/dist/cjs/post-purchase/countdown-timer/components/TextCountdown.js +12 -26
  91. package/dist/cjs/post-purchase/countdown-timer/components/common/getClasses.js +24 -0
  92. package/dist/cjs/post-purchase/countdown-timer/components/common/getStyles.js +21 -0
  93. package/dist/cjs/post-purchase/countdown-timer/hooks/useCountdownTimer.js +18 -1
  94. package/dist/cjs/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +18 -0
  95. package/dist/cjs/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
  96. package/dist/cjs/post-purchase/countdown-timer/settings/config/preset.js +26 -0
  97. package/dist/cjs/post-purchase/countdown-timer/settings/config/setting.js +243 -0
  98. package/dist/cjs/post-purchase/countdown-timer/settings/config/uiV1.js +125 -0
  99. package/dist/cjs/post-purchase/countdown-timer/settings/config/uiV2.js +185 -0
  100. package/dist/cjs/post-purchase/image/common/getClasses.js +1 -1
  101. package/dist/cjs/post-purchase/image/setting/setting-v2.js +5 -5
  102. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +24 -26
  103. package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
  104. package/dist/cjs/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
  105. package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +20 -7
  106. package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +3 -1
  107. package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
  108. package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
  109. package/dist/cjs/post-purchase/utils/constants.js +1 -1
  110. package/dist/cjs/product/components/FileUpload/components/common/index.js +3 -0
  111. package/dist/cjs/product/components/ProductBundle/common/classes.js +25 -0
  112. package/dist/cjs/product/components/ProductBundle/common/index.js +5 -0
  113. package/dist/cjs/product/components/ProductBundle/common/styles.js +89 -0
  114. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.js +82 -0
  115. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.liquid.js +74 -0
  116. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +69 -0
  117. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +46 -0
  118. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountItem.js +23 -0
  119. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js +14 -0
  120. package/dist/cjs/product/components/{ProductBundleDiscount.js → ProductBundle/hooks/useProductBundleDataState.js} +20 -215
  121. package/dist/cjs/product/components/ProductBundle/hooks/useProductBundleDiscountState.js +56 -0
  122. package/dist/cjs/product/{setting → components/ProductBundle/setting}/ProductBundleDiscount.js +7 -7
  123. package/dist/cjs/product/{setting → components/ProductBundle/setting}/ProductBundleDiscountItem.js +3 -0
  124. package/dist/cjs/product/components/ProductButton.js +2 -2
  125. package/dist/cjs/product/components/ProductButton.liquid.js +2 -2
  126. package/dist/cjs/product/components/ProductPrice/common/getAttr.js +23 -0
  127. package/dist/cjs/product/components/ProductPrice/common/getClasses.js +19 -0
  128. package/dist/cjs/product/components/ProductPrice/common/getTextData.js +40 -0
  129. package/dist/cjs/product/components/ProductPrice/hooks/useGpPrice.js +126 -0
  130. package/dist/cjs/product/components/ProductPrice/index.js +54 -0
  131. package/dist/cjs/product/components/ProductPrice/index.liquid.js +43 -0
  132. package/dist/cjs/product/components/ProductQuickView/ProductQuickView.js +5 -5
  133. package/dist/cjs/product/next.js +3 -3
  134. package/dist/cjs/product/setting/index.js +2 -2
  135. package/dist/cjs/product/setting/product/configs/presets.js +1 -0
  136. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +6 -7
  137. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +11 -12
  138. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/index.js +6 -5
  139. package/dist/cjs/product/setting/product-list/configs/settingsV2.js +10 -8
  140. package/dist/cjs/setting.js +5 -2
  141. package/dist/esm/accordion/components/Accordion.js +61 -180
  142. package/dist/esm/accordion/components/Accordion.liquid.js +78 -102
  143. package/dist/esm/accordion/components/AccordionItem.js +129 -281
  144. package/dist/esm/accordion/components/AccordionItem.liquid.js +76 -214
  145. package/dist/esm/accordion/components/common/classes.js +44 -0
  146. package/dist/esm/accordion/components/common/index.js +136 -0
  147. package/dist/esm/accordion/components/common/styles.js +122 -0
  148. package/dist/esm/accordion/hooks/useAccordion.js +141 -0
  149. package/dist/esm/accordion/hooks/useAccordionItem.js +115 -0
  150. package/dist/esm/article/components/ArticleImage.js +0 -1
  151. package/dist/esm/article/components/ArticlePagination.js +1 -1
  152. package/dist/esm/article/components/ArticlePagination.liquid.js +3 -3
  153. package/dist/esm/article/setting/configs/ArticleImage/settings.js +5 -5
  154. package/dist/esm/banner/components/HeroBannerItem.js +0 -6
  155. package/dist/esm/banner/components/HeroBannerItem.liquid.js +3 -0
  156. package/dist/esm/banner/setting/setting.js +28 -3
  157. package/dist/esm/banner/setting/uiV2.js +10 -97
  158. package/dist/esm/builder.js +3 -5
  159. package/dist/esm/cart/components/CartLineImage.js +0 -2
  160. package/dist/esm/code/common/classes.js +9 -0
  161. package/dist/esm/code/common/styles.js +13 -0
  162. package/dist/esm/code/components/CSSCode.js +9 -99
  163. package/dist/esm/code/components/CSSCode.liquid.js +12 -12
  164. package/dist/esm/code/hooks/useCSSCode.js +98 -0
  165. package/dist/esm/code/setting/CSSCode.js +7 -121
  166. package/dist/esm/code/setting/config/setting.js +75 -0
  167. package/dist/esm/code/setting/config/uiV1.js +50 -0
  168. package/dist/esm/code/setting/config/uiV2.js +56 -0
  169. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +4 -1
  170. package/dist/esm/form/components/contact/Contact.js +7 -3
  171. package/dist/esm/form/components/contact/common/composeStyles.js +19 -0
  172. package/dist/esm/form/components/form-checkbox/FormCheckbox.js +7 -5
  173. package/dist/esm/form/components/form-checkbox/FormCheckbox.liquid.js +3 -5
  174. package/dist/esm/form/components/form-checkbox/common/composeClasses.js +2 -2
  175. package/dist/esm/form/components/form-checkbox/common/composeStyles.js +25 -11
  176. package/dist/esm/form/components/form-dropdown/common/composeClasses.js +1 -1
  177. package/dist/esm/form/components/form-email/FormEmail.js +18 -10
  178. package/dist/esm/form/components/form-email/common/composeClasses.js +2 -1
  179. package/dist/esm/form/components/newsletter/Newsletter.js +8 -3
  180. package/dist/esm/form/components/newsletter/Newsletter.liquid.js +1 -1
  181. package/dist/esm/form/components/newsletter/common/composeStyles.js +4 -2
  182. package/dist/esm/form/components/textarea/TextArea.js +16 -8
  183. package/dist/esm/form/components/textarea/common/composeClasses.js +1 -1
  184. package/dist/esm/form/components/textfield/TextField.js +17 -9
  185. package/dist/esm/form/components/textfield/common/composeClasses.js +2 -2
  186. package/dist/esm/form/setting/contact/Contact.js +5 -1
  187. package/dist/esm/form/setting/form-checkbox/configs/settings.js +153 -6
  188. package/dist/esm/form/setting/form-checkbox/configs/uiV2.js +137 -0
  189. package/dist/esm/form/setting/form-dropdown/configs/settings.js +147 -0
  190. package/dist/esm/form/setting/form-dropdown/configs/uiV2.js +156 -4
  191. package/dist/esm/form/setting/newsletter/configs/settings.js +132 -3
  192. package/dist/esm/form/setting/newsletter/configs/uiV2.js +93 -0
  193. package/dist/esm/form/setting/submit-button/configs/settings.js +37 -0
  194. package/dist/esm/form/setting/submit-button/configs/uiV2.js +13 -0
  195. package/dist/esm/grid/row/commons/getInnerRadius.js +11 -10
  196. package/dist/esm/grid/row/setting/configs/uiV2.js +1 -1
  197. package/dist/esm/header/components/kind/basic/index.js +1 -0
  198. package/dist/esm/header/components/kind/modern/index.js +1 -1
  199. package/dist/esm/helpers.js +52 -1
  200. package/dist/esm/icon-list/setting/configs/uiV2.js +1 -1
  201. package/dist/esm/icon-list-v2/setting/configs/settings.js +5 -5
  202. package/dist/esm/image/components/AdaptiveImage.js +64 -50
  203. package/dist/esm/image/components/AdaptiveImage.liquid.js +57 -45
  204. package/dist/esm/image/components/Image.js +66 -155
  205. package/dist/esm/image/components/Image.liquid.js +69 -104
  206. package/dist/esm/image/components/Modal3d.liquid.js +55 -22
  207. package/dist/esm/image/components/NextImage.js +26 -59
  208. package/dist/esm/image/components/NextImage.liquid.js +28 -116
  209. package/dist/esm/image/components/Video.liquid.js +38 -13
  210. package/dist/esm/image/components/common/attributes.js +108 -0
  211. package/dist/esm/image/components/common/classes.js +51 -0
  212. package/dist/esm/image/components/common/constants.js +11 -0
  213. package/dist/esm/image/components/common/data.js +22 -0
  214. package/dist/esm/image/components/common/helpers.js +69 -0
  215. package/dist/esm/image/components/common/styles.js +80 -0
  216. package/dist/esm/image/components/helpers/getNextImageLiquidAttrs.js +78 -0
  217. package/dist/esm/image/components/helpers/getNextImageReactAttrs.js +38 -0
  218. package/dist/esm/image/components/hooks/useCheckNoImage.js +23 -0
  219. package/dist/esm/image/helpers/getSrcSet.js +1 -2
  220. package/dist/esm/image/next.js +1 -5
  221. package/dist/esm/image/setting/configs/settings.js +14 -8
  222. package/dist/esm/image/setting/configs/uiV2.js +61 -15
  223. package/dist/esm/image/setting/index.js +1 -3
  224. package/dist/esm/image-comparison/components/CompareImage.js +1 -1
  225. package/dist/esm/image-comparison/components/CompareImage.liquid.js +1 -1
  226. package/dist/esm/index.js +4 -5
  227. package/dist/esm/index.liquid.js +3 -3
  228. package/dist/esm/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
  229. package/dist/esm/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
  230. package/dist/esm/post-purchase/countdown-timer/components/TextCountdown.js +13 -27
  231. package/dist/esm/post-purchase/countdown-timer/components/common/getClasses.js +21 -0
  232. package/dist/esm/post-purchase/countdown-timer/components/common/getStyles.js +19 -0
  233. package/dist/esm/post-purchase/countdown-timer/hooks/useCountdownTimer.js +19 -3
  234. package/dist/esm/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +16 -0
  235. package/dist/esm/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
  236. package/dist/esm/post-purchase/countdown-timer/settings/config/preset.js +24 -0
  237. package/dist/esm/post-purchase/countdown-timer/settings/config/setting.js +241 -0
  238. package/dist/esm/post-purchase/countdown-timer/settings/config/uiV1.js +123 -0
  239. package/dist/esm/post-purchase/countdown-timer/settings/config/uiV2.js +183 -0
  240. package/dist/esm/post-purchase/image/common/getClasses.js +1 -1
  241. package/dist/esm/post-purchase/image/setting/setting-v2.js +5 -5
  242. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +25 -27
  243. package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
  244. package/dist/esm/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
  245. package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +20 -7
  246. package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +3 -1
  247. package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
  248. package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
  249. package/dist/esm/post-purchase/utils/constants.js +1 -1
  250. package/dist/esm/product/components/FileUpload/components/common/index.js +3 -0
  251. package/dist/esm/product/components/ProductBundle/common/classes.js +19 -0
  252. package/dist/esm/product/components/ProductBundle/common/index.js +3 -0
  253. package/dist/esm/product/components/ProductBundle/common/styles.js +80 -0
  254. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.js +78 -0
  255. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.liquid.js +70 -0
  256. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +65 -0
  257. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +42 -0
  258. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountItem.js +19 -0
  259. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js +10 -0
  260. package/dist/esm/product/components/{ProductBundleDiscount.js → ProductBundle/hooks/useProductBundleDataState.js} +21 -216
  261. package/dist/esm/product/components/ProductBundle/hooks/useProductBundleDiscountState.js +52 -0
  262. package/dist/esm/product/{setting → components/ProductBundle/setting}/ProductBundleDiscount.js +7 -7
  263. package/dist/esm/product/{setting → components/ProductBundle/setting}/ProductBundleDiscountItem.js +3 -0
  264. package/dist/esm/product/components/ProductButton.js +1 -1
  265. package/dist/esm/product/components/ProductButton.liquid.js +1 -1
  266. package/dist/esm/product/components/ProductPrice/common/getAttr.js +21 -0
  267. package/dist/esm/product/components/ProductPrice/common/getClasses.js +17 -0
  268. package/dist/esm/product/components/ProductPrice/common/getTextData.js +38 -0
  269. package/dist/esm/product/components/ProductPrice/hooks/useGpPrice.js +124 -0
  270. package/dist/esm/product/components/ProductPrice/index.js +50 -0
  271. package/dist/esm/product/components/ProductPrice/index.liquid.js +38 -0
  272. package/dist/esm/product/components/ProductQuickView/ProductQuickView.js +1 -1
  273. package/dist/esm/product/next.js +3 -3
  274. package/dist/esm/product/setting/index.js +2 -2
  275. package/dist/esm/product/setting/product/configs/presets.js +1 -0
  276. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +6 -7
  277. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +11 -12
  278. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/index.js +6 -5
  279. package/dist/esm/product/setting/product-list/configs/settingsV2.js +10 -8
  280. package/dist/esm/setting.js +5 -2
  281. package/dist/types/index.d.ts +173 -256
  282. package/package.json +2 -2
  283. package/dist/cjs/image/components/BackgroundImage.js +0 -102
  284. package/dist/cjs/image/components/Img.js +0 -28
  285. package/dist/cjs/image/components/helpers.js +0 -12
  286. package/dist/cjs/image/setting/BackgroundImage.js +0 -364
  287. package/dist/cjs/product/components/ProductBundleDiscount.liquid.js +0 -81
  288. package/dist/cjs/product/components/ProductBundleDiscountItem.js +0 -42
  289. package/dist/cjs/product/components/ProductBundleDiscountItem.liquid.js +0 -103
  290. package/dist/cjs/product/components/ProductPrice.js +0 -209
  291. package/dist/cjs/product/components/ProductPrice.liquid.js +0 -88
  292. package/dist/esm/image/components/BackgroundImage.js +0 -98
  293. package/dist/esm/image/components/Img.js +0 -24
  294. package/dist/esm/image/components/helpers.js +0 -9
  295. package/dist/esm/image/setting/BackgroundImage.js +0 -360
  296. package/dist/esm/product/components/ProductBundleDiscount.liquid.js +0 -77
  297. package/dist/esm/product/components/ProductBundleDiscountItem.js +0 -36
  298. package/dist/esm/product/components/ProductBundleDiscountItem.liquid.js +0 -99
  299. package/dist/esm/product/components/ProductPrice.js +0 -205
  300. package/dist/esm/product/components/ProductPrice.liquid.js +0 -83
@@ -1,109 +1,85 @@
1
- import { makeGlobalSize, template, getStyleBackgroundByDevice, WrapRenderChildren, makeStyleResponsive, RenderChildren, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
1
+ import { makeStyleResponsive, template, WrapRenderChildren, RenderChildren, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
2
  import { getDynamicSourceLocales, getSettingPreloadData } from '../../helpers.js';
3
+ import { createStateOrContext, createClass, createStyle, createAttr } from '@gem-sdk/system';
4
+ import { getDataState } from './common/index.js';
5
+ import { getContainerStyles } from './common/styles.js';
6
+ import { getContainerClasses, extendClasses } from './common/classes.js';
3
7
 
4
- const Accordion = ({ rawChildren, setting, styles, builderProps, pageContext, advanced })=>{
5
- const { childItem, activeKey, iconSvg, expandItem, iconPosition, iconCollapseSize, iconGlobalSize, iconExpand, iconCollapse, layoutHeader, expandedMode, configIconSize, translate } = setting ?? {};
6
- const { align, bgColor, color, headerBorder, width, fullWidth, textColor, itemHeaderSpacing, contentSizePadding, iconColor, headerContentPadding, widthHeightSize, backgroundContent } = styles ?? {};
7
- const contentSizePaddingSize = makeGlobalSize(styles?.contentSizePadding);
8
- let accordions = [];
9
- let activeIndex = [
10
- '0'
11
- ];
12
- if (!expandItem) {
13
- activeIndex = [];
14
- } else if (activeKey) {
15
- const composeActiveKeys = activeKey.toString().toLowerCase().split(',').map((item)=>parseInt(item.trim()) - 1).map((item)=>item.toString());
16
- activeIndex = composeActiveKeys;
17
- }
18
- const expanded = expandedMode === 'multiple' ? true : false;
19
- if (expanded) {
20
- accordions.push(...activeIndex);
21
- } else {
22
- accordions = activeIndex;
23
- }
24
- return template`
25
- <gp-accordion
26
- data-id="${builderProps?.uid}"
27
- ${builderProps}
28
- class="gp-flex gp-w-full gp-flex-col ${advanced?.cssClass}"
29
- style="${{
30
- ...contentSizePaddingSize.gap,
31
- ...getStyleBackgroundByDevice(backgroundContent),
32
- 'border-radius': 'inherit',
33
- overflow: 'hidden'
34
- }}"
35
- gp-data='${JSON.stringify({
36
- setting: {
37
- iconSvg,
38
- isIconPlus: iconSvg === 'plus',
39
- activeKey,
40
- expanded,
41
- expandItem,
42
- iconPosition,
43
- iconGlobalSize,
44
- iconCollapse,
45
- iconExpand,
46
- iconCollapseSize,
47
- layoutHeader,
48
- expandedMode,
49
- configIconSize,
50
- parentUid: builderProps?.uid,
51
- childListNumber: expandItem ? activeKey?.toString()?.toLowerCase() === 'all' ? rawChildren?.map((item, index)=>index.toString()) : accordions : [],
52
- chidlrenUid: rawChildren?.map((item)=>item.uid)
53
- },
54
- styles: {
55
- bgColor,
56
- color,
57
- headerBorder,
58
- fullWidth,
59
- width,
60
- itemHeaderSpacing,
61
- textColor,
62
- iconColor,
63
- contentSizePadding,
64
- headerContentPadding,
65
- widthHeightSize
66
- },
67
- uid: builderProps?.uid
68
- }).replaceAll("'", '&#039;')}'
69
- >
70
- <div class="gp-hidden gp-rotate-90 -gp-rotate-90 gp-rotate-180"></div>
71
- ${WrapRenderChildren({
72
- uid: builderProps?.uid || '',
73
- customProps: rawChildren?.[0].customProps
74
- }, rawChildren?.map((child, index)=>{
75
- if (child) {
76
- const title = getDynamicSourceLocales({
77
- val: childItem?.[index],
78
- uid: builderProps?.uid,
79
- settingId: `childItem_${index}`,
80
- pageContext,
81
- isCapitalize: setting?.titleTypo?.attrs?.transform === 'capitalize',
82
- translate
83
- });
84
- return template`<div
85
- class="gp-flex"
86
- style="${{
87
- ...makeStyleResponsive('jc', align)
88
- }}"
89
- >
90
- ${RenderChildren({
91
- ...child,
92
- index: index,
93
- title: title,
94
- accordions: accordions,
95
- parentSetting: setting,
96
- parentStyle: styles,
97
- parentUid: builderProps?.uid,
98
- childrenIcon: setting?.childConfig?.[index],
99
- activeKey: activeKey
100
- })}
101
- </div>
8
+ const Accordion = ({ rawChildren, setting, styles, builderProps, pageContext, advanced, style, builderAttrs })=>{
9
+ const { align } = styles ?? {};
10
+ const { translate, childItem, activeKey } = setting ?? {};
11
+ const { uidState, settingState, stylesState, accordions } = getDataState({
12
+ setting,
13
+ styles,
14
+ builderProps
15
+ }, rawChildren);
16
+ const createDataState = createStateOrContext({
17
+ uid: uidState,
18
+ setting: settingState,
19
+ styles: stylesState
20
+ });
21
+ const createContainerClasses = createClass(getContainerClasses(advanced?.cssClass));
22
+ const createContainerStyles = createStyle({
23
+ ...getContainerStyles(style, styles)
24
+ });
25
+ const createContainerAttr = createAttr({
26
+ ...builderAttrs,
27
+ 'data-id': builderProps?.uid ?? ''
28
+ });
29
+ const createChildrenContainerStyles = createStyle({
30
+ ...makeStyleResponsive('jc', align)
31
+ });
32
+ const createChildrenContainerClasses = createClass({
33
+ 'gp-flex': true
34
+ });
35
+ const createExtendClasses = createClass(extendClasses());
36
+ const composeChildren = ()=>{
37
+ return WrapRenderChildren({
38
+ uid: builderProps?.uid ?? '',
39
+ customProps: rawChildren?.[0].customProps
40
+ }, rawChildren?.map((child, index)=>{
41
+ if (child) {
42
+ const title = getDynamicSourceLocales({
43
+ val: childItem?.[index],
44
+ uid: builderProps?.uid,
45
+ settingId: `childItem_${index}`,
46
+ pageContext,
47
+ isCapitalize: setting?.titleTypo?.attrs?.transform === 'capitalize',
48
+ translate
49
+ });
50
+ return template`
51
+ <div class="${createChildrenContainerClasses}" style="${createChildrenContainerStyles}">
52
+ ${RenderChildren({
53
+ ...child,
54
+ index: index,
55
+ title: title,
56
+ accordions: accordions,
57
+ parentSetting: setting,
58
+ parentStyle: styles,
59
+ parentUid: builderProps?.uid,
60
+ childrenIcon: setting?.childConfig?.[index],
61
+ activeKey: activeKey
62
+ })}
63
+ </div>
102
64
  `;
103
- }
104
- }))}
65
+ }
66
+ }));
67
+ };
68
+ const renderScript = ()=>{
69
+ return RenderIf(isLocalEnv, `
70
+ <script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-accordion.js' | asset_url }}"
71
+ defer="defer"></script>`, `
72
+ <script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-accordion.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>
73
+ `);
74
+ };
75
+ return template`
76
+ <gp-accordion ${createContainerAttr} class="${createContainerClasses}" style="${createContainerStyles}"
77
+ gp-data='${JSON.stringify(createDataState).replaceAll("'", '&#039;')}'
78
+ >
79
+ <div class=" ${createExtendClasses}"></div>
80
+ ${composeChildren()}
105
81
  </gp-accordion>
106
- ${RenderIf(isLocalEnv, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-accordion.js' | asset_url }}" defer="defer"></script>`, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-accordion.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
82
+ ${renderScript()}
107
83
  `;
108
84
  };
109
85
 
@@ -1,305 +1,153 @@
1
1
  'use client';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { useState, useEffect, useMemo, Children } from 'react';
4
- import { makeGlobalSize, useEditorMode, makeStyleResponsive, makeWidth, makeStyle, getGlobalColorStateStyle, composeSize, removePaddingYInStyle, getSingleColorVariable, getStyleShadow, getRadiusStyleActiveState, cls, genSizeClass, getGlobalColorClass, getGlobalColorStateClass, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertBorderColor } from '@gem-sdk/core';
3
+ import { useMemo, Children } from 'react';
4
+ import { composeClasses } from '@gem-sdk/core';
5
5
  import ChildrenDroppable from '../../grid/components/ChildrenDroppable.js';
6
6
  import Text from '../../text/components/Text.js';
7
- import { useGetProductId } from '../../components/hooks/useGetProductId.js';
8
- import useMountTransition from '../hooks/useMountTransition.js';
7
+ import useAccordionItem from '../hooks/useAccordionItem.js';
8
+ import { createClass, createStyle, If } from '@gem-sdk/system';
9
+ import { getItemContainerStyles, getDropdownStyles, getIconRotateStyles, getIconGlobalSize, getGapStyles, getLayoutTextStyles, getRenderChildrenStyles } from './common/styles.js';
10
+ import { getItemContainerClasses, getDropdownClasses, getIconClasses, getIconRotateClasses, getContentClasses, getGapClasses, getLayoutTextClasses, getRenderChildrenClasses } from './common/classes.js';
11
+ import { getParentSettings, MINIMUM_CHILD, BODY_CHILD_INDEX, DEFAULT_BEFORE_ICON, DEFAULT_AFTER_ICON } from './common/index.js';
9
12
 
10
- const MINIMUM_CHILD = 1;
11
- const BODY_CHILD_INDEX = 0;
12
- const AccordionItem = ({ accordions, index, children, builderAttrs, builderProps, title, parentSetting = {}, parentStyle = {}, childrenIcon, handleDropDown, parentUid })=>{
13
- const { iconSvg, iconPosition, titleTypo, layoutHeader, iconGlobalSize, iconCollapseSize, iconCollapse, iconExpand, alignment, configIconSize } = parentSetting;
14
- delete titleTypo?.attrs?.color;
15
- const { bgColor, color, headerBorder, fullWidth, width, itemHeaderSpacing, itemContentSpacing, textColor, iconColor, backgroundContent, roundedContent, borderContent, contentSizePadding, headerContentPadding, widthHeightSize, accordionShadow } = parentStyle;
16
- const iconNimbus = `<svg width='16' height='16' fill='currentColor' viewBox="0 0 448 512"><path fill='currentColor' d="M400 288h-352c-17.69 0-32-14.32-32-32.01s14.31-31.99 32-31.99h352c17.69 0 32 14.3 32 31.99S417.7 288 400 288z"/></svg>`;
17
- const iconPlus = `<svg fill='currentColor' width='16' height='16' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill='currentColor' d="M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z"/></svg>`;
18
- const isShow = accordions?.includes(index?.toString() ?? '');
19
- const composeIconGlobalSize = makeGlobalSize(iconGlobalSize);
20
- const contentSizePaddingSize = makeGlobalSize(contentSizePadding);
21
- const headerContentPaddingSize = makeGlobalSize(headerContentPadding);
22
- const widthHeightSizeControl = makeGlobalSize(widthHeightSize);
23
- const mode = useEditorMode();
24
- const [isMounted, setIsMounted] = useState(isShow);
25
- const hasTransitionedIn = useMountTransition(isMounted || false, 500);
26
- useEffect(()=>{
27
- setIsMounted(isShow);
28
- }, [
29
- isShow
30
- ]);
31
- const widthStyle = widthHeightSizeControl.width['--w'] ? widthHeightSizeControl.width : makeStyleResponsive('w', makeWidth(width, fullWidth));
32
- const makeIcon = useMemo(()=>{
33
- if (iconExpand && isShow) {
34
- return iconExpand;
35
- }
36
- if (iconCollapse && !isShow) {
37
- return iconCollapse;
38
- }
39
- if (iconSvg === 'plus') {
40
- if (isShow) {
41
- return iconNimbus;
42
- }
43
- return iconPlus;
44
- }
45
- if (iconSvg) {
46
- return iconSvg;
47
- }
48
- }, [
49
- iconNimbus,
50
- iconPlus,
13
+ const AccordionItem = (props)=>{
14
+ const { children, index, parentUid, title, childrenIcon } = props;
15
+ const { iconSvg, titleTypo, layoutHeader, iconGlobalSize, iconCollapseSize, iconCollapse, iconExpand, alignment, configIconSize, iconPosition } = getParentSettings(props.parentSetting) ?? {};
16
+ const { refContainer, getIdDropdownItem, makeIcon, isShow, uniqueId, composeIconColor, isRenderChildren, composeContentSizeStyle, hasTransitionedIn, isMounted, productID } = useAccordionItem(props);
17
+ const composeContainerClasses = createClass(getItemContainerClasses);
18
+ const composeDropdownClasses = createClass(getDropdownClasses(props.parentStyle, {
19
+ isShow,
20
+ uniqueId,
21
+ makeIcon,
22
+ index
23
+ }));
24
+ const composeIconClasses = createClass(getIconClasses);
25
+ const composeIconRotateClasses = createClass(getIconRotateClasses(props.parentStyle, {
26
+ isShow,
27
+ iconExpand,
51
28
  iconSvg,
29
+ iconCollapse
30
+ }));
31
+ const composeContentClasses = createClass(getContentClasses(parentUid));
32
+ const composeGapClasses = createClass(getGapClasses);
33
+ const composeContainerStyles = createStyle(getItemContainerStyles(props.parentStyle, isShow));
34
+ const composeDropdownStyles = createStyle(getDropdownStyles(props.parentStyle, {
52
35
  isShow,
53
- iconCollapse,
54
- iconExpand
55
- ]);
56
- const composePosition = useMemo(()=>{
57
- return makeStyle({
58
- fd: iconPosition === 'left' ? 'row' : 'row-reverse',
59
- jc: iconPosition === 'right' ? 'space-between' : ''
60
- });
61
- }, [
62
36
  iconPosition
63
- ]);
64
- const getIdDropdownItem = (event, id)=>{
65
- if (event.target.closest('.gp-text')) return;
66
- if (handleDropDown && id) {
67
- setIsMounted(!isMounted);
68
- handleDropDown(id);
69
- }
70
- };
37
+ }));
38
+ const composeIconRotateStyles = createStyle(getIconRotateStyles(props.parentStyle, isShow, iconCollapseSize));
39
+ const composeIconPaddingGlobalSize = createStyle(getIconGlobalSize(iconGlobalSize));
40
+ const composeGapStyles = createStyle(getGapStyles(iconGlobalSize, alignment));
41
+ const inlineFlexClass = createClass(composeClasses('gp-inline-flex'));
42
+ const composeLayoutTextClasses = createClass(getLayoutTextClasses);
43
+ const composeLayoutTextStyles = createStyle(getLayoutTextStyles(composeIconColor, configIconSize));
44
+ const composeRenderChildrenClasses = createClass(getRenderChildrenClasses(props.parentStyle, {
45
+ isShow,
46
+ hasTransitionedIn,
47
+ isMounted
48
+ }));
49
+ const composeRenderChildrenStyles = createStyle(getRenderChildrenStyles(composeContentSizeStyle));
50
+ const composeItemBodyClasses = createClass(composeClasses('gp-accordion-item_body-inner gp-transition-all gp-duration-500 gp-min-h-0'));
51
+ const composeTextClasses = createClass(composeClasses('gp-border gp-border-transparent'));
71
52
  const childForBody = useMemo(()=>{
72
- if (Children.count(children) >= MINIMUM_CHILD) {
73
- return Children.toArray(children).at(BODY_CHILD_INDEX);
53
+ const childrenArray = Children.toArray(children);
54
+ if (childrenArray.length >= MINIMUM_CHILD) {
55
+ return childrenArray[BODY_CHILD_INDEX];
74
56
  }
75
57
  return /*#__PURE__*/ jsx(ChildrenDroppable, {});
76
58
  }, [
77
59
  children
78
60
  ]);
79
- const composeIconColor = useMemo(()=>{
80
- if (isShow) {
81
- return makeStyle({
82
- c: iconColor?.active
83
- });
84
- }
85
- return getGlobalColorStateStyle('c', iconColor);
86
- }, [
87
- iconColor,
88
- isShow
89
- ]);
90
- const { refContainer, productID } = useGetProductId();
91
- const uniqueId = useMemo(()=>{
92
- const prefix = `gp-accordion-item-${builderProps?.uid}-${index}`;
93
- return productID ? `${prefix}-${productID}` : prefix;
94
- }, [
95
- builderProps?.uid,
96
- index,
97
- productID
98
- ]);
99
- const composeColorIconStyle = useMemo(()=>{
100
- return `.${uniqueId}:hover {
101
- .gp-collapsible-icon {
102
- color: ${isShow ? color?.active : color?.hover}
103
- }
104
-
105
- .gp-icon {
106
- color: ${isShow ? iconColor?.active : iconColor?.hover}
107
- }
108
- }`;
109
- }, [
110
- isShow,
111
- color,
112
- iconColor,
113
- uniqueId
114
- ]);
115
- const composeContentSizeStyle = useMemo(()=>{
116
- const constentSizeStyle = {
117
- ...contentSizePadding && contentSizePaddingSize.padding,
118
- ...!itemContentSpacing?.type && !contentSizePadding ? composeSize(itemContentSpacing?.custom) : {}
119
- };
120
- if (!isShow) {
121
- return removePaddingYInStyle(constentSizeStyle);
122
- }
123
- return constentSizeStyle;
124
- }, [
125
- contentSizePadding,
126
- itemContentSpacing,
127
- isShow,
128
- contentSizePaddingSize
129
- ]);
130
- const isRenderChildren = useMemo(()=>hasTransitionedIn || isMounted || mode !== 'edit', [
131
- hasTransitionedIn,
132
- isMounted,
133
- mode
134
- ]);
135
- return /*#__PURE__*/ jsxs("div", {
136
- className: "gp-overflow-clip",
61
+ return /*#__PURE__*/ jsx("div", {
62
+ className: composeContainerClasses,
137
63
  ref: refContainer,
138
- style: {
139
- ...widthStyle,
140
- ...makeStyle({
141
- bs: borderContent?.border ?? borderContent?.border,
142
- bw: borderContent?.width ?? borderContent?.width,
143
- bc: getSingleColorVariable(borderContent?.color ?? borderContent?.color)
144
- }),
145
- ...makeStyleResponsive('bg', backgroundContent),
146
- ...getStyleShadow({
147
- value: accordionShadow,
148
- styleAppliedFor: 'box-shadow',
149
- isEnableShadow: accordionShadow?.type !== 'none'
150
- }),
151
- ...getRadiusStyleActiveState({
152
- ...roundedContent,
153
- active: {
154
- ...roundedContent || {},
155
- radiusType: 'custom'
156
- }
157
- })
158
- },
159
- children: [
160
- /*#__PURE__*/ jsx("style", {
161
- children: composeColorIconStyle
162
- }),
163
- /*#__PURE__*/ jsxs("div", {
164
- "data-index": index?.toString(),
165
- className: cls('gp-overflow-hidden', `gp-child-item-${parentUid}`),
166
- children: [
167
- /*#__PURE__*/ jsxs("div", {
168
- "aria-hidden": true,
169
- onClick: (event)=>{
170
- getIdDropdownItem(event, index?.toString());
171
- },
172
- className: cls('gp-flex gp-cursor-pointer gp-items-center', makeIcon ? 'gp-gap-[16px]' : '', uniqueId, itemHeaderSpacing?.type && !headerContentPadding ? genSizeClass(itemHeaderSpacing?.type) : '', {
173
- [getGlobalColorClass('bg', bgColor?.active)]: isShow,
174
- [getGlobalColorClass('text', textColor?.active)]: isShow,
175
- [getGlobalColorStateClass('bg', bgColor)]: !isShow,
176
- [getGlobalColorStateClass('text', textColor)]: !isShow
177
- }),
178
- style: {
179
- ...headerContentPadding && headerContentPaddingSize.padding,
180
- ...!itemHeaderSpacing?.type && !headerContentPadding ? composeSize(itemHeaderSpacing?.custom) : {},
181
- ...widthHeightSizeControl.height,
182
- ...composePosition,
183
- ...isShow ? makeStyle({
184
- bgc: getSingleColorVariable(bgColor?.active ?? bgColor?.normal),
185
- bs: headerBorder?.active?.border,
186
- bw: headerBorder?.active?.width,
187
- bc: getSingleColorVariable(headerBorder?.active?.color),
188
- c: getSingleColorVariable(textColor?.active ?? textColor?.normal)
189
- }) : {
190
- ...getGlobalColorStateStyle('bgc', bgColor),
191
- ...getGlobalColorStateStyle('c', textColor),
192
- ...handleConvertBorderStyle(headerBorder),
193
- ...handleConvertBorderWidth(headerBorder),
194
- ...handleConvertBorderColor(headerBorder),
195
- ...getGlobalColorStateStyle('bgc', bgColor)
196
- }
197
- },
198
- children: [
199
- makeIcon && /*#__PURE__*/ jsx("div", {
200
- className: "gp-inline-flex",
201
- children: /*#__PURE__*/ jsx("span", {
64
+ style: composeContainerStyles,
65
+ children: /*#__PURE__*/ jsxs("div", {
66
+ "data-index": index?.toString(),
67
+ className: composeContentClasses,
68
+ children: [
69
+ /*#__PURE__*/ jsxs("div", {
70
+ "aria-hidden": true,
71
+ onClick: (event)=>{
72
+ getIdDropdownItem(event, index?.toString());
73
+ },
74
+ className: composeDropdownClasses,
75
+ style: composeDropdownStyles,
76
+ children: [
77
+ If(Boolean(makeIcon), /*#__PURE__*/ jsx("div", {
78
+ className: composeIconClasses,
79
+ children: /*#__PURE__*/ jsx("span", {
80
+ style: composeIconRotateStyles,
81
+ className: composeIconRotateClasses,
82
+ dangerouslySetInnerHTML: {
83
+ __html: makeIcon ?? ''
84
+ }
85
+ })
86
+ })),
87
+ /*#__PURE__*/ jsxs("div", {
88
+ className: composeGapClasses,
89
+ style: composeGapStyles,
90
+ children: [
91
+ If(Boolean(layoutHeader === 'before-text'), /*#__PURE__*/ jsx("div", {
92
+ className: inlineFlexClass,
202
93
  style: {
203
- ...isShow ? makeStyle({
204
- c: getSingleColorVariable(color?.active ?? color?.normal)
205
- }) : {
206
- ...getGlobalColorStateStyle('c', color)
207
- },
208
- width: `${iconCollapseSize ? iconCollapseSize : 16}px`,
209
- height: `${iconCollapseSize ? iconCollapseSize : 16}px`,
210
- '--height': `${iconCollapseSize ? iconCollapseSize : 16}px`
94
+ ...composeIconPaddingGlobalSize
211
95
  },
212
- className: cls({
213
- '-gp-rotate-90': isShow === true && iconSvg !== 'plus' && !iconExpand,
214
- 'gp-rotate-90': isShow === false && !iconCollapse
215
- }, 'gp-collapsible-icon gp-inline-flex gp-items-center gp-justify-center gp-overflow-hidden gp-transition-all gp-duration-200 [&>svg]:!gp-h-[var(--height)] [&>svg]:!gp-w-auto', isShow ? getGlobalColorClass('text', color?.active) : getGlobalColorStateClass('text', color)),
216
- dangerouslySetInnerHTML: {
217
- __html: makeIcon ?? ''
218
- }
219
- })
220
- }),
221
- /*#__PURE__*/ jsxs("div", {
222
- className: "gp-flex gp-w-full gp-items-center gp-break-all",
223
- style: {
224
- ...composeIconGlobalSize.gap,
225
- ...makeStyleResponsive('jc', alignment)
226
- },
227
- children: [
228
- layoutHeader === 'before-text' && /*#__PURE__*/ jsx("div", {
229
- className: "gp-inline-flex",
230
- style: {
231
- ...composeIconGlobalSize.padding
232
- },
233
- children: /*#__PURE__*/ jsx("span", {
234
- className: "gp-icon gp-inline-flex gp-items-center gp-justify-center gp-overflow-hidden [&>svg]:!gp-h-[var(--height)] [&>svg]:!gp-w-auto",
235
- style: {
236
- ...composeIconColor,
237
- width: configIconSize ? `${configIconSize}px` : '16px',
238
- height: configIconSize ? `${configIconSize}px` : '16px',
239
- '--height': `${configIconSize ? `${configIconSize}px` : '16px'}`
240
- },
241
- dangerouslySetInnerHTML: {
242
- __html: childrenIcon ?? '<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg>'
243
- }
244
- })
245
- }),
246
- /*#__PURE__*/ jsx(Text, {
247
- setting: {
248
- text: title,
249
- htmlTag: 'div',
250
- options: {
251
- uniqueId,
252
- productID,
253
- useState: true
254
- },
255
- excludeFlex: true
256
- },
257
- styles: {
258
- typo: titleTypo
259
- },
260
- className: "gp-border gp-border-transparent"
261
- }),
262
- layoutHeader === 'after-text' && /*#__PURE__*/ jsx("div", {
263
- className: "gp-inline-flex",
264
- style: {
265
- ...composeIconGlobalSize.padding
96
+ children: /*#__PURE__*/ jsx("span", {
97
+ className: composeLayoutTextClasses,
98
+ style: composeLayoutTextStyles,
99
+ dangerouslySetInnerHTML: {
100
+ __html: childrenIcon ?? DEFAULT_BEFORE_ICON
101
+ }
102
+ })
103
+ })),
104
+ /*#__PURE__*/ jsx(Text, {
105
+ setting: {
106
+ text: title,
107
+ htmlTag: 'div',
108
+ options: {
109
+ uniqueId,
110
+ productID,
111
+ useState: true
266
112
  },
267
- children: /*#__PURE__*/ jsx("span", {
268
- style: {
269
- ...composeIconColor,
270
- width: configIconSize ? `${configIconSize}px` : '16px',
271
- height: configIconSize ? `${configIconSize}px` : '16px',
272
- '--height': `${configIconSize ? `${configIconSize}px` : '16px'}`
273
- },
274
- className: "gp-icon gp-inline-flex gp-items-center gp-justify-center gp-overflow-hidden [&>svg]:!gp-h-[var(--height)] [&>svg]:!gp-w-auto",
275
- dangerouslySetInnerHTML: {
276
- __html: childrenIcon ?? '<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg>'
277
- }
278
- })
113
+ excludeFlex: true
114
+ },
115
+ styles: {
116
+ typo: titleTypo
117
+ },
118
+ className: composeTextClasses
119
+ }),
120
+ If(Boolean(layoutHeader === 'after-text'), /*#__PURE__*/ jsx("div", {
121
+ className: inlineFlexClass,
122
+ style: {
123
+ ...composeIconPaddingGlobalSize
124
+ },
125
+ children: /*#__PURE__*/ jsx("span", {
126
+ style: composeLayoutTextStyles,
127
+ className: composeLayoutTextClasses,
128
+ dangerouslySetInnerHTML: {
129
+ __html: childrenIcon ?? DEFAULT_AFTER_ICON
130
+ }
279
131
  })
280
- ]
281
- })
282
- ]
283
- }),
284
- isRenderChildren && /*#__PURE__*/ jsx("div", {
285
- ...builderAttrs,
286
- className: cls('gp-grid gp-overflow-hidden gp-transition-all gp-duration-500', {
287
- 'gp-grid-rows-[1fr]': isShow ? hasTransitionedIn : isMounted,
288
- 'gp-grid-rows-[0fr]': !isShow ? !isMounted : !hasTransitionedIn
289
- }, itemContentSpacing?.type && !contentSizePadding ? genSizeClass(itemContentSpacing?.type) : ''),
290
- style: {
291
- ...composeContentSizeStyle,
292
- gridTemplateColumns: 'minmax(auto, 100%)'
293
- },
294
- children: /*#__PURE__*/ jsx("div", {
295
- className: "gp-min-h-0",
296
- children: childForBody
132
+ }))
133
+ ]
297
134
  })
135
+ ]
136
+ }),
137
+ isRenderChildren && /*#__PURE__*/ jsx("div", {
138
+ ...props?.builderAttrs,
139
+ className: composeRenderChildrenClasses,
140
+ style: composeRenderChildrenStyles,
141
+ "data-index": index,
142
+ "data-show": isShow,
143
+ children: /*#__PURE__*/ jsx("div", {
144
+ className: composeItemBodyClasses,
145
+ children: childForBody
298
146
  })
299
- ]
300
- })
301
- ]
147
+ })
148
+ ]
149
+ })
302
150
  });
303
151
  };
304
152
 
305
- export { BODY_CHILD_INDEX, MINIMUM_CHILD, AccordionItem as default };
153
+ export { AccordionItem as default };