@gem-sdk/components 2.0.0-dev.370 → 2.0.0-dev.371

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 (124) hide show
  1. package/dist/cjs/builder.js +2 -2
  2. package/dist/cjs/button/setting/configs/settings.js +0 -14
  3. package/dist/cjs/carousel/arrow/Arrow.js +52 -0
  4. package/dist/cjs/carousel/arrow/Arrow.liquid.js +46 -0
  5. package/dist/cjs/carousel/{components/common/arrow.js → arrow/common/common.js} +13 -11
  6. package/dist/cjs/carousel/arrow/common/getClass.js +50 -0
  7. package/dist/cjs/carousel/arrow/common/getStyle.js +84 -0
  8. package/dist/cjs/carousel/carousel-item/CarouselItem.js +32 -0
  9. package/dist/cjs/carousel/carousel-item/CarouselItem.liquid.js +38 -0
  10. package/dist/cjs/carousel/carousel-item/common/getClass.js +29 -0
  11. package/dist/cjs/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js} +30 -47
  12. package/dist/cjs/carousel/carousel-item/hook/useCarouseItem.js +14 -0
  13. package/dist/cjs/carousel/components/const/index.js +5 -0
  14. package/dist/cjs/carousel/dots/Dots.js +51 -0
  15. package/dist/cjs/carousel/dots/Dots.liquid.js +26 -0
  16. package/dist/cjs/carousel/dots/common/common.js +46 -0
  17. package/dist/cjs/carousel/dots/common/getClass.js +40 -0
  18. package/dist/cjs/carousel/dots/common/getStyle.js +33 -0
  19. package/dist/cjs/carousel/dots/hook/useDotsSetting.js +21 -0
  20. package/dist/cjs/carousel/index.js +1 -2
  21. package/dist/cjs/carousel/next.js +2 -2
  22. package/dist/cjs/carousel/root/Carousel.js +129 -0
  23. package/dist/cjs/carousel/root/Carousel.liquid.js +104 -0
  24. package/dist/cjs/carousel/root/common/getAttr.js +25 -0
  25. package/dist/cjs/carousel/root/common/getClass.js +135 -0
  26. package/dist/cjs/carousel/root/common/getData.js +56 -0
  27. package/dist/cjs/carousel/root/common/getStyle.js +64 -0
  28. package/dist/cjs/carousel/{components/Carousel.js → root/hook/useCarousel.js} +153 -321
  29. package/dist/cjs/carousel/setting/Carousel.js +8 -1555
  30. package/dist/cjs/carousel/setting/configs/presets.js +380 -0
  31. package/dist/cjs/carousel/setting/configs/settingV2.js +771 -0
  32. package/dist/cjs/carousel/setting/configs/uiV1.js +434 -0
  33. package/dist/cjs/carousel/setting/configs/uiV2.js +627 -0
  34. package/dist/cjs/common/components/NoDataState.js +5 -5
  35. package/dist/cjs/grid/row/commons/common.js +3 -3
  36. package/dist/cjs/index.js +2 -2
  37. package/dist/cjs/index.liquid.js +2 -2
  38. package/dist/cjs/product/components/ProductImages/ProductGalleryCarousel.js +2 -2
  39. package/dist/cjs/product/components/ProductImages/ProductImagesLightBox.js +2 -2
  40. package/dist/cjs/product/components/ProductImages/liquid/ProductGalleryCarousel.liquid.js +5 -3
  41. package/dist/cjs/product/components/ProductImagesV2/common/getAttr.js +1 -0
  42. package/dist/cjs/product/components/ProductImagesV2/common/productFeaturedImage.js +1 -1
  43. package/dist/cjs/product/components/ProductImagesV2/common/productGallery.js +1 -1
  44. package/dist/cjs/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +5 -5
  45. package/dist/cjs/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +8 -4
  46. package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +2 -2
  47. package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.liquid.js +6 -3
  48. package/dist/cjs/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +2 -2
  49. package/dist/cjs/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js +3 -3
  50. package/dist/cjs/product/components/ProductList/ProductListCarouselLayout.js +2 -2
  51. package/dist/cjs/product/components/ProductList/ProductListCarouselLayout.liquid.js +5 -3
  52. package/dist/cjs/product/components/ProductList/common/index.js +5 -5
  53. package/dist/cjs/product/components/ProductVariants/common/main/getAttr.js +1 -1
  54. package/dist/cjs/text/components/Text.js +3 -3
  55. package/dist/esm/builder.js +2 -2
  56. package/dist/esm/button/setting/configs/settings.js +0 -14
  57. package/dist/esm/carousel/arrow/Arrow.js +48 -0
  58. package/dist/esm/carousel/arrow/Arrow.liquid.js +42 -0
  59. package/dist/esm/carousel/{components/common/arrow.js → arrow/common/common.js} +12 -10
  60. package/dist/esm/carousel/arrow/common/getClass.js +48 -0
  61. package/dist/esm/carousel/arrow/common/getStyle.js +82 -0
  62. package/dist/esm/carousel/carousel-item/CarouselItem.js +28 -0
  63. package/dist/esm/carousel/carousel-item/CarouselItem.liquid.js +34 -0
  64. package/dist/esm/carousel/carousel-item/common/getClass.js +27 -0
  65. package/dist/esm/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js} +31 -46
  66. package/dist/esm/carousel/carousel-item/hook/useCarouseItem.js +12 -0
  67. package/dist/esm/carousel/components/const/index.js +3 -0
  68. package/dist/esm/carousel/dots/Dots.js +47 -0
  69. package/dist/esm/carousel/dots/Dots.liquid.js +22 -0
  70. package/dist/esm/carousel/dots/common/common.js +43 -0
  71. package/dist/esm/carousel/dots/common/getClass.js +38 -0
  72. package/dist/esm/carousel/dots/common/getStyle.js +31 -0
  73. package/dist/esm/carousel/dots/hook/useDotsSetting.js +19 -0
  74. package/dist/esm/carousel/index.js +1 -2
  75. package/dist/esm/carousel/next.js +2 -2
  76. package/dist/esm/carousel/root/Carousel.js +125 -0
  77. package/dist/esm/carousel/root/Carousel.liquid.js +100 -0
  78. package/dist/esm/carousel/root/common/getAttr.js +23 -0
  79. package/dist/esm/carousel/root/common/getClass.js +133 -0
  80. package/dist/esm/carousel/root/common/getData.js +54 -0
  81. package/dist/esm/carousel/root/common/getStyle.js +62 -0
  82. package/dist/esm/carousel/{components/Carousel.js → root/hook/useCarousel.js} +150 -316
  83. package/dist/esm/carousel/setting/Carousel.js +8 -1555
  84. package/dist/esm/carousel/setting/configs/presets.js +378 -0
  85. package/dist/esm/carousel/setting/configs/settingV2.js +769 -0
  86. package/dist/esm/carousel/setting/configs/uiV1.js +432 -0
  87. package/dist/esm/carousel/setting/configs/uiV2.js +625 -0
  88. package/dist/esm/common/components/NoDataState.js +6 -6
  89. package/dist/esm/grid/row/commons/common.js +1 -1
  90. package/dist/esm/index.js +2 -2
  91. package/dist/esm/index.liquid.js +2 -2
  92. package/dist/esm/product/components/ProductImages/ProductGalleryCarousel.js +2 -2
  93. package/dist/esm/product/components/ProductImages/ProductImagesLightBox.js +2 -2
  94. package/dist/esm/product/components/ProductImages/liquid/ProductGalleryCarousel.liquid.js +5 -3
  95. package/dist/esm/product/components/ProductImagesV2/common/getAttr.js +1 -0
  96. package/dist/esm/product/components/ProductImagesV2/common/productFeaturedImage.js +1 -1
  97. package/dist/esm/product/components/ProductImagesV2/common/productGallery.js +1 -1
  98. package/dist/esm/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +5 -5
  99. package/dist/esm/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +8 -4
  100. package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +2 -2
  101. package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.liquid.js +6 -3
  102. package/dist/esm/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +2 -2
  103. package/dist/esm/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js +3 -3
  104. package/dist/esm/product/components/ProductList/ProductListCarouselLayout.js +2 -2
  105. package/dist/esm/product/components/ProductList/ProductListCarouselLayout.liquid.js +5 -3
  106. package/dist/esm/product/components/ProductList/common/index.js +3 -3
  107. package/dist/esm/product/components/ProductVariants/common/main/getAttr.js +1 -1
  108. package/dist/esm/text/components/Text.js +4 -4
  109. package/dist/types/index.d.ts +164 -67
  110. package/package.json +3 -3
  111. package/dist/cjs/carousel/components/Arrow.js +0 -110
  112. package/dist/cjs/carousel/components/Arrow.liquid.js +0 -103
  113. package/dist/cjs/carousel/components/Carousel.liquid.js +0 -256
  114. package/dist/cjs/carousel/components/CarouselItem.js +0 -88
  115. package/dist/cjs/carousel/components/Dots.js +0 -69
  116. package/dist/cjs/carousel/components/Dots.liquid.js +0 -23
  117. package/dist/cjs/carousel/components/common/dots.js +0 -57
  118. package/dist/esm/carousel/components/Arrow.js +0 -106
  119. package/dist/esm/carousel/components/Arrow.liquid.js +0 -99
  120. package/dist/esm/carousel/components/Carousel.liquid.js +0 -252
  121. package/dist/esm/carousel/components/CarouselItem.js +0 -84
  122. package/dist/esm/carousel/components/Dots.js +0 -65
  123. package/dist/esm/carousel/components/Dots.liquid.js +0 -19
  124. package/dist/esm/carousel/components/common/dots.js +0 -53
@@ -0,0 +1,64 @@
1
+ 'use strict';
2
+
3
+ var core = require('@gem-sdk/core');
4
+ var system = require('@gem-sdk/system');
5
+
6
+ const getStyle = (props)=>{
7
+ const DEVICES = [
8
+ 'mobile',
9
+ 'tablet',
10
+ 'desktop'
11
+ ];
12
+ const { styles, setting, style, rootStyles } = props;
13
+ const { arrowGapToEachSide = '16' } = setting ?? {};
14
+ const styleHeight = core.makeStyleResponsive('h', core.getHeightByShapeGlobalSize(styles?.sizeSetting));
15
+ const styleWidth = core.makeStyleWithDefault('w', core.getWidthByShapeGlobalSize(styles?.sizeSetting, true), {
16
+ desktop: '--g-ct-w',
17
+ tablet: '--g-ct-w',
18
+ mobile: '--g-ct-w'
19
+ });
20
+ const makeSpacing = ()=>{
21
+ let result = {};
22
+ DEVICES.forEach((device)=>{
23
+ const isVertical = core.getResponsiveValueByScreen(setting?.vertical, device);
24
+ const spacing = core.getResponsiveValueByScreen(styles?.spacing, device);
25
+ const key = isVertical ? `--rg${device !== 'desktop' ? `-${device}` : ''}` : `--cg${device !== 'desktop' ? `-${device}` : ''}`;
26
+ result = {
27
+ ...result,
28
+ [key]: `${spacing ?? 0}px`
29
+ };
30
+ });
31
+ return result;
32
+ };
33
+ const wrapperStyleRender = system.createStyle({
34
+ ...style,
35
+ ...styleHeight,
36
+ ...styleWidth,
37
+ ...core.makeStyleResponsive('bgc', styles?.backgroundColor),
38
+ ...core.getStyleBackgroundByDevice(styles?.backgroundImage, {
39
+ ignoreBackgroundColor: true
40
+ })
41
+ });
42
+ const wrapperInnerStyle = system.createStyle({
43
+ ...core.makeContainerWidthOrHeight({
44
+ vertical: setting?.vertical,
45
+ dotStyle: setting?.dotStyle
46
+ }),
47
+ gap: arrowGapToEachSide + 'px'
48
+ });
49
+ const rootStyleRender = system.createStyle({
50
+ ...core.makeStyleResponsive('jc', styles?.align),
51
+ ...rootStyles
52
+ });
53
+ const sliderStyle = system.createStyle({
54
+ ...makeSpacing()
55
+ });
56
+ return {
57
+ rootStyleRender,
58
+ wrapperStyleRender,
59
+ wrapperInnerStyle,
60
+ sliderStyle
61
+ };
62
+ };
63
+
64
+ exports.getStyle = getStyle;