@bikdotai/bik-component-library 0.0.509-beta.carousel-10 → 0.0.509-beta.carousel-11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/carousel-preview/CarouselPreview.d.ts +1 -0
- package/dist/cjs/components/carousel-preview/CarouselPreview.js +1 -3
- package/dist/cjs/components/carousel-preview/CarouselPreview.style.d.ts +1 -0
- package/dist/cjs/components/carousel-preview/CarouselPreview.style.js +1 -0
- package/dist/esm/components/carousel-preview/CarouselPreview.d.ts +1 -0
- package/dist/esm/components/carousel-preview/CarouselPreview.js +1 -3
- package/dist/esm/components/carousel-preview/CarouselPreview.style.d.ts +1 -0
- package/dist/esm/components/carousel-preview/CarouselPreview.style.js +1 -0
- package/package.json +1 -1
|
@@ -13,4 +13,5 @@ export declare const CarouselPreview: React.ForwardRefExoticComponent<{
|
|
|
13
13
|
showSampleValues?: boolean | undefined;
|
|
14
14
|
isPreview?: boolean | undefined;
|
|
15
15
|
removeBottomBorder?: boolean | undefined;
|
|
16
|
+
borderRadius?: string | undefined;
|
|
16
17
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("../../assets/icons/chevronLeft.svg.js"),t=require("../../assets/icons/chevronRight.svg.js"),l=require("react"),r=require("react-slick"),s=require("styled-components"),i=require("./CarouselPreview.style.js"),o=require("./CarouselPreviewCard.js"),d=require("../../constants/Theme.js"),a=require("../template-context-mapper/context/templateModalContext.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(l),x=c(r),p=c(s);const v=u.default.forwardRef((n=>{let{channel:t,template:l,isPreview:r,removeBottomBorder:s,borderRadius:d}=n;var c,u,p;const v=null===(c=null==l?void 0:l.components)||void 0===c?void 0:c[1].cards,{sliderRef:m,selectedCarouselIndex:j,cardCount:w,setIsCarouselHovered:C}=a.useTemplateModalContext();return e.jsxs(i.Container,Object.assign({removeBottomBorder:s,borderRadius:d},{children:[e.jsx(o.default,{channel:t,currentTemplate:l,carouselCardIndex:-1,isPreview:r,width:"77%"}),!!(null==v?void 0:v.length)&&e.jsx(g,Object.assign({cardCount:null!=w?w:0,selectedCarouselIndex:null!=j?j:-1,onMouseEnter:()=>null==C?void 0:C(!0),onMouseLeave:()=>null==C?void 0:C(!1)},{children:e.jsx(x.default,Object.assign({ref:m,swipeToSlide:!0,draggable:!0,swipe:!0,infinite:!1,focusOnSelect:!r,centerMode:!0,arrows:!0,adaptiveHeight:!0,nextArrow:e.jsx(h,{isPreview:null!=r&&r}),prevArrow:e.jsx(f,{isPreview:null!=r&&r})},{children:null===(p=null===(u=null==l?void 0:l.components)||void 0===u?void 0:u[1].cards)||void 0===p?void 0:p.map(((n,s)=>{var i,d;const a={components:n.components,mapping:null===(d=null===(i=null==l?void 0:l.mapping)||void 0===i?void 0:i.cards)||void 0===d?void 0:d[s]};return e.jsx(o.default,{channel:t,currentTemplate:a,carouselCardIndex:s,isPreview:r,width:"100%"},s)}))}))}))]}))})),h=n=>{const{className:l,style:r,onClick:s,isPreview:i}=n,{selectedCarouselIndex:o,setSelectedCarouselIndex:c,cardCount:u}=a.useTemplateModalContext();return e.jsx("div",Object.assign({className:l,style:Object.assign(Object.assign({},r),{display:s&&(null!=o?o:-1)>-1||i?"flex":"none",content:"none"}),onClick:e=>{console.log("onClick",o,u),null==s||s(e),(null!=o?o:-1)>=(null!=u?u:-1)-1||i||null==c||c((null!=o?o:-1)+1)}},{children:e.jsx(t.default,{height:10,width:10,color:d.COLORS.content.primary})}))},f=t=>{const{className:l,style:r,onClick:s,isPreview:i}=t,{selectedCarouselIndex:o,setSelectedCarouselIndex:c}=a.useTemplateModalContext();return e.jsx("div",Object.assign({className:l,style:Object.assign(Object.assign({},r),{display:s&&(null!=o?o:-1)>-1||i?"flex":"none",content:"none"}),onClick:e=>{null==s||s(e),(null!=o?o:-1)<1||i||null==c||c((null!=o?o:-1)-1)}},{children:e.jsx(n.default,{height:10,width:10,color:d.COLORS.content.primary})}))},g=p.default.div`
|
|
2
2
|
width: 100%;
|
|
3
|
-
/* ${e=>e.selectedCarouselIndex<e.cardCount-1?"width: calc(100% - 48px);":"width: 100%;"} */
|
|
4
|
-
/* margin: auto; */
|
|
5
3
|
|
|
6
4
|
.slick-next:before {
|
|
7
5
|
content: none;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
2
2
|
showHeader?: boolean | undefined;
|
|
3
3
|
removeBottomBorder?: boolean | undefined;
|
|
4
|
+
borderRadius?: string | undefined;
|
|
4
5
|
}, never>;
|
|
5
6
|
export declare const CarouselContainer: import("styled-components").StyledComponent<"div", any, {
|
|
6
7
|
height: string;
|
|
@@ -13,4 +13,5 @@ export declare const CarouselPreview: React.ForwardRefExoticComponent<{
|
|
|
13
13
|
showSampleValues?: boolean | undefined;
|
|
14
14
|
isPreview?: boolean | undefined;
|
|
15
15
|
removeBottomBorder?: boolean | undefined;
|
|
16
|
+
borderRadius?: string | undefined;
|
|
16
17
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n}from"react/jsx-runtime";import o from"../../assets/icons/chevronLeft.svg.js";import t from"../../assets/icons/chevronRight.svg.js";import l from"react";import
|
|
1
|
+
import{jsxs as e,jsx as n}from"react/jsx-runtime";import o from"../../assets/icons/chevronLeft.svg.js";import t from"../../assets/icons/chevronRight.svg.js";import l from"react";import r from"react-slick";import i from"styled-components";import{Container as s}from"./CarouselPreview.style.js";import c from"./CarouselPreviewCard.js";import{COLORS as d}from"../../constants/Theme.js";import{useTemplateModalContext as a}from"../template-context-mapper/context/templateModalContext.js";const u=l.forwardRef((o=>{let{channel:t,template:l,isPreview:i,removeBottomBorder:d,borderRadius:u}=o;var h,x,g;const f=null===(h=null==l?void 0:l.components)||void 0===h?void 0:h[1].cards,{sliderRef:w,selectedCarouselIndex:b,cardCount:C,setIsCarouselHovered:k}=a();return e(s,Object.assign({removeBottomBorder:d,borderRadius:u},{children:[n(c,{channel:t,currentTemplate:l,carouselCardIndex:-1,isPreview:i,width:"77%"}),!!(null==f?void 0:f.length)&&n(v,Object.assign({cardCount:null!=C?C:0,selectedCarouselIndex:null!=b?b:-1,onMouseEnter:()=>null==k?void 0:k(!0),onMouseLeave:()=>null==k?void 0:k(!1)},{children:n(r,Object.assign({ref:w,swipeToSlide:!0,draggable:!0,swipe:!0,infinite:!1,focusOnSelect:!i,centerMode:!0,arrows:!0,adaptiveHeight:!0,nextArrow:n(p,{isPreview:null!=i&&i}),prevArrow:n(m,{isPreview:null!=i&&i})},{children:null===(g=null===(x=null==l?void 0:l.components)||void 0===x?void 0:x[1].cards)||void 0===g?void 0:g.map(((e,o)=>{var r,s;const d={components:e.components,mapping:null===(s=null===(r=null==l?void 0:l.mapping)||void 0===r?void 0:r.cards)||void 0===s?void 0:s[o]};return n(c,{channel:t,currentTemplate:d,carouselCardIndex:o,isPreview:i,width:"100%"},o)}))}))}))]}))})),p=e=>{const{className:o,style:l,onClick:r,isPreview:i}=e,{selectedCarouselIndex:s,setSelectedCarouselIndex:c,cardCount:u}=a();return n("div",Object.assign({className:o,style:Object.assign(Object.assign({},l),{display:r&&(null!=s?s:-1)>-1||i?"flex":"none",content:"none"}),onClick:e=>{console.log("onClick",s,u),null==r||r(e),(null!=s?s:-1)>=(null!=u?u:-1)-1||i||null==c||c((null!=s?s:-1)+1)}},{children:n(t,{height:10,width:10,color:d.content.primary})}))},m=e=>{const{className:t,style:l,onClick:r,isPreview:i}=e,{selectedCarouselIndex:s,setSelectedCarouselIndex:c}=a();return n("div",Object.assign({className:t,style:Object.assign(Object.assign({},l),{display:r&&(null!=s?s:-1)>-1||i?"flex":"none",content:"none"}),onClick:e=>{null==r||r(e),(null!=s?s:-1)<1||i||null==c||c((null!=s?s:-1)-1)}},{children:n(o,{height:10,width:10,color:d.content.primary})}))},v=i.div`
|
|
2
2
|
width: 100%;
|
|
3
|
-
/* ${e=>e.selectedCarouselIndex<e.cardCount-1?"width: calc(100% - 48px);":"width: 100%;"} */
|
|
4
|
-
/* margin: auto; */
|
|
5
3
|
|
|
6
4
|
.slick-next:before {
|
|
7
5
|
content: none;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
2
2
|
showHeader?: boolean | undefined;
|
|
3
3
|
removeBottomBorder?: boolean | undefined;
|
|
4
|
+
borderRadius?: string | undefined;
|
|
4
5
|
}, never>;
|
|
5
6
|
export declare const CarouselContainer: import("styled-components").StyledComponent<"div", any, {
|
|
6
7
|
height: string;
|
|
@@ -11,6 +11,7 @@ import e from"styled-components";import{COLORS as o}from"../../constants/Theme.j
|
|
|
11
11
|
position: relative;
|
|
12
12
|
height: 500px;
|
|
13
13
|
overflow-y: auto;
|
|
14
|
+
border-radius: ${e=>{var o;return null!==(o=e.borderRadius)&&void 0!==o?o:"0px"}};
|
|
14
15
|
`;e.div`
|
|
15
16
|
flex-direction: row;
|
|
16
17
|
display: flex;
|