@cleartrip/ct-platform-pill-carousel 1.4.0-SNAPSHOT-native-main.0 → 1.4.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/components/PillCarousel/src/Pill/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAM3C,OAAO,EAAE,SAAS,EAAY,MAAM,cAAc,CAAC;AAInD,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAkGpC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/components/PillCarousel/src/Pill/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAO3C,OAAO,EAAE,SAAS,EAAY,MAAM,cAAc,CAAC;AAEnD,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAqGpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PillCarousel.d.ts","sourceRoot":"","sources":["../packages/components/PillCarousel/src/PillCarousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAKrD,OAAO,cAAc,CAAC;AAKtB,OAAO,EAAgB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAMvE,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAmH7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"PillCarousel.d.ts","sourceRoot":"","sources":["../packages/components/PillCarousel/src/PillCarousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAKrD,OAAO,cAAc,CAAC;AAKtB,OAAO,EAAgB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIvE,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4G7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("tslib"),i=require("react/jsx-runtime"),l=require("react"),t=require("swiper"),n=require("swiper/react"),r=require("@cleartrip/ct-design-style-manager"),a=require("@cleartrip/ct-design-typography"),s=require("@cleartrip/ct-design-components");function o(e){return e&&e.__esModule?e:{default:e}}var c,p=o(t),d=r.makeStyles(function(e){return{swiper:{width:"100%",height:"100%"}}}),u=r.makeStyles(function(e){return{"pill-story-container":{display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"center"},"pill-chip-container":{display:"flex",alignItems:"center",justifyContent:"center",borderWidth:1.5,borderStyle:"solid",borderColor:"#E6E6E6",borderRadius:16,height:32,paddingTop:0,paddingRight:8,paddingBottom:0,paddingLeft:8,gap:4,backgroundColor:"#FFF"},"pill-chip-image":{maxHeight:20,maxWidth:20},"pill-story-image":{borderRadius:30,padding:5}}});exports.PillType=void 0,(c=exports.PillType||(exports.PillType={})).CHIPS="CHIPS",c.STORY="STORY";var g,y=function(t){var n=t.pillData,r=t.pillType,o=t.pillClickHandler,c=t.isSelected,p=t.selectedPillStyles,d=t.textClass,g=t.imageClass,y=t.pillContainerClass,C=t.pillContainerStyles,x=t.textStyles,f=t.imageStyles,m=t.renderCustomLabel,_=t.renderCustomImage,h=e.__assign({border:"1.5px solid #1A1A1A",backgroundColor:"#F3F3F3",transition:"all 200ms ease-in-out"},p),S=l.useCallback(function(){return m?m(n):n.text?i.jsx(a.Typography,e.__assign({variant:a.TypographyVariant.B2,styleConfig:{root:[d,u["pill-text"],x]}},{children:n.text})):i.jsx(i.Fragment,{})},[]),T=l.useCallback(function(){return i.jsx(i.Fragment,{children:_?_(n):n.imageUrl&&i.jsx("img",{src:n.imageUrl,className:"".concat(g," ").concat(u[r===exports.PillType.STORY?"pill-story-container":"pill-chip-image"]),style:f})})},[]);return r===exports.PillType.STORY?i.jsxs(s.Container,e.__assign({as:"div",onClick:o,styleConfig:{root:["__local-".concat(y),"__local-".concat(u["pill-story-container"]),c?e.__assign(e.__assign({},C),h):C]}},{children:[T(),S()]})):i.jsxs(s.Container,e.__assign({as:"div",onClick:o,styleConfig:{root:["__local-".concat(y),"__local-".concat(u["pill-chip-container"]),c?e.__assign(e.__assign({},C),h):C]}},{children:[T(),S()]}))};exports.CarouselType=void 0,(g=exports.CarouselType||(exports.CarouselType={})).PILL_CHIP="PILL_CHIP",g.PILL_STORY="PILL_STORY",p.default.use([t.Autoplay,t.Pagination]);exports.PillCarousel=function(t){var r,a,o,c,p=t.isLoading,u=t.carouselData,g=t.carouselType,C=t.onItemClick,x=t.styleConfig,f=t.carouselConfig,m=t.renderCustomPillImage,_=t.defaultSelectedPillIndex,h=l.useState(null!=_?_:0),S=h[0],T=h[1],P=l.useCallback(function(e,i,l){T(l),e(i,l)},[]),v=l.useCallback(function(){return i.jsx(s.Container,e.__assign({as:"div",styleConfig:{root:[{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:16,gap:12}]}},{children:Array.from({length:3}).map(function(e,l){return i.jsx(s.Container,{as:"div",styleConfig:{root:[{display:"flex",width:88,height:32,paddingTop:4,paddingRight:8,paddingBottom:4,paddingLeft:8,flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:4,borderRadius:16,background:"rgba(255, 255, 255, 0.50)"}]}},l)})}))},[p]),I=l.useCallback(function(){return i.jsxs(i.Fragment,{children:[u.map(function(l,t){var r=e.__assign({pillType:g&&g===exports.CarouselType.PILL_STORY?exports.PillType.STORY:exports.PillType.CHIPS,pillData:l,isSelected:t==S,renderCustomImage:m,pillClickHandler:function(){P(C,l,t)}},null==x?void 0:x.pillStyleConfig);return i.jsx(n.SwiperSlide,e.__assign({style:{maxWidth:"fit-content"}},{children:i.jsx(y,e.__assign({},r))}),"slide-".concat(t))})," "]})},[S,u]),b={freeMode:null===(r=null==f?void 0:f.isFreeSwipe)||void 0===r||r,slidesPerView:null!==(a=null==f?void 0:f.pillsPerView)&&void 0!==a?a:"auto",spaceBetween:null!==(o=null==f?void 0:f.spaceBetweenPills)&&void 0!==o?o:12,loop:null!==(c=null==f?void 0:f.isInfiniteScroll)&&void 0!==c&&c};return i.jsx(i.Fragment,{children:p?v():i.jsx(n.Swiper,e.__assign({initialSlide:S,autoplay:!1,pagination:!1,className:d.swiper,style:null==x?void 0:x.carouselStyleConfig},b,{children:I()}))})};
1
+ "use strict";var e=require("tslib"),i=require("react/jsx-runtime"),l=require("react"),t=require("swiper"),n=require("swiper/react"),r=require("classnames"),s=require("@cleartrip/ct-design-typography");function a(e){return e&&e.__esModule?e:{default:e}}var o=a(t),p=a(r);function d(e,i){void 0===i&&(i={});var l=i.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===l&&t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}var c="index-module_swiper__r5-8U";d(".index-module_swiper__r5-8U{height:100%;width:100%}");var u,x={"pill-story-container":"index-module_pill-story-container__QnH4k","pill-chip-container":"index-module_pill-chip-container__-CDkA","pill-chip-image":"index-module_pill-chip-image__FGQ6V","pill-story-image":"index-module_pill-story-image__7VUfq"};d(".index-module_pill-story-container__QnH4k{align-items:center;display:flex;flex-direction:column;justify-content:space-evenly}.index-module_pill-chip-container__-CDkA{align-items:center;background-color:#fff;border:1.5px solid #e6e6e6;border-radius:16px;display:flex;gap:4px;height:32px;justify-content:center;padding:0 8px}.index-module_pill-chip-image__FGQ6V{max-height:20px;max-width:20px}.index-module_pill-story-image__7VUfq{border-radius:30px;padding:5px}"),exports.PillType=void 0,(u=exports.PillType||(exports.PillType={})).CHIPS="CHIPS",u.STORY="STORY";var g,_=function(t){var n=t.pillData,r=t.pillType,a=t.pillClickHandler,o=t.isSelected,d=t.selectedPillStyles,c=t.textClass,u=t.imageClass,g=t.pillContainerClass,_=t.pillContainerStyles,m=t.textStyles,y=t.imageStyles,f=t.renderCustomLabel,h=t.renderCustomImage,C=e.__assign({border:"1.5px solid #1A1A1A",backgroundColor:"#F3F3F3",transition:"all 200ms ease-in-out"},d),v=l.useCallback((function(){return f?f(n):n.text?i.jsx(s.Typography,e.__assign({variant:s.TypographyVariant.B2,className:p.default(c,x["pill-text"]),style:m},{children:n.text})):i.jsx(i.Fragment,{})}),[]),S=l.useCallback((function(){return i.jsx(i.Fragment,{children:h?h(n):n.imageUrl&&i.jsx("img",{src:n.imageUrl,className:p.default(u,x[r===exports.PillType.STORY?"pill-story-container":"pill-chip-image"]),style:y})})}),[]);return r===exports.PillType.STORY?i.jsxs("div",e.__assign({className:p.default(g,x["pill-story-container"]),style:o?e.__assign(e.__assign({},_),C):_,onClick:a},{children:[S(),v()]})):i.jsxs("div",e.__assign({className:p.default(g,x["pill-chip-container"]),style:o?e.__assign(e.__assign({},_),C):_,onClick:a},{children:[S(),v()]}))};exports.CarouselType=void 0,(g=exports.CarouselType||(exports.CarouselType={})).PILL_CHIP="PILL_CHIP",g.PILL_STORY="PILL_STORY",o.default.use([t.Autoplay,t.Pagination]);exports.PillCarousel=function(t){var r,s,a,o,p=t.isLoading,d=t.carouselData,u=t.carouselType,x=t.onItemClick,g=t.styleConfig,m=t.carouselConfig,y=t.renderCustomPillImage,f=t.defaultSelectedPillIndex,h=l.useState(null!=f?f:0),C=h[0],v=h[1],S=l.useCallback((function(e,i,l){v(l),e(i,l)}),[]),T=l.useCallback((function(){return i.jsx("div",e.__assign({style:{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"16px",gap:"12px"}},{children:Array.from({length:3}).map((function(e,l){return i.jsx("div",{style:{display:"flex",width:"88px",height:"32px",padding:"4px 8px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"4px",borderRadius:"16px",background:"rgba(255, 255, 255, 0.50)"}},l)}))}))}),[p]),P=l.useCallback((function(){return i.jsxs(i.Fragment,{children:[d.map((function(l,t){var r=e.__assign({pillType:u&&u===exports.CarouselType.PILL_STORY?exports.PillType.STORY:exports.PillType.CHIPS,pillData:l,isSelected:t==C,renderCustomImage:y,pillClickHandler:function(){S(x,l,t)}},null==g?void 0:g.pillStyleConfig);return i.jsx(n.SwiperSlide,e.__assign({style:{maxWidth:"fit-content"}},{children:i.jsx(_,e.__assign({},r))}),"slide-".concat(t))}))," "]})}),[C,d]),I={freeMode:null===(r=null==m?void 0:m.isFreeSwipe)||void 0===r||r,slidesPerView:null!==(s=null==m?void 0:m.pillsPerView)&&void 0!==s?s:"auto",spaceBetween:null!==(a=null==m?void 0:m.spaceBetweenPills)&&void 0!==a?a:12,loop:null!==(o=null==m?void 0:m.isInfiniteScroll)&&void 0!==o&&o};return i.jsx(i.Fragment,{children:p?T():i.jsx(n.Swiper,e.__assign({initialSlide:C,autoplay:!1,pagination:!1,className:c,style:null==g?void 0:g.carouselStyleConfig},I,{children:P()}))})};
2
2
  //# sourceMappingURL=ct-platform-pill-carousel.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-pill-carousel.cjs.js","sources":["../packages/components/PillCarousel/src/Pill/Pill.types.ts","../packages/components/PillCarousel/src/index.module.ts","../packages/components/PillCarousel/src/Pill/index.module.ts","../packages/components/PillCarousel/src/Pill/index.tsx","../packages/components/PillCarousel/src/PillCarousel.types.ts","../packages/components/PillCarousel/src/PillCarousel.tsx"],"sourcesContent":[null,null,null,null,null,null],"names":["PillType","styles","makeStyles","theme","swiper","width","height","display","flexDirection","justifyContent","alignItems","borderWidth","borderStyle","borderColor","borderRadius","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","backgroundColor","maxHeight","maxWidth","padding","CarouselType","Pill","_a","pillData","pillType","pillClickHandler","isSelected","selectedPillStyles","textClass","imageClass","pillContainerClass","pillContainerStyles","textStyles","imageStyles","renderCustomLabel","renderCustomImage","selectedPillStyle","__assign","border","transition","renderPillLabel","useCallback","text","_jsx","Typography","variant","TypographyVariant","B2","styleConfig","root","children","_Fragment","renderImage","imageUrl","src","className","concat","STORY","style","_jsxs","Container","as","onClick","SwiperCore","use","Autoplay","Pagination","isLoading","carouselData","carouselType","onItemClick","carouselConfig","renderCustomPillImage","defaultSelectedPillIndex","_f","useState","selectedIndex","setSelectedIndex","onPillClick","index","renderLoadingSlides","Array","from","length","map","_","background","renderSlides","args","PILL_STORY","CHIPS","pillStyleConfig","SwiperSlide","carouselConf","freeMode","_b","isFreeSwipe","slidesPerView","_c","pillsPerView","spaceBetween","_d","spaceBetweenPills","loop","_e","isInfiniteScroll","Swiper","initialSlide","autoplay","pagination","carouselStyleConfig"],"mappings":"qUAEYA,SCCNC,EAASC,EAAAA,WAAW,SAAAC,GAAS,MAAA,CACjCC,OAAQ,CACNC,MAAO,OACPC,OAAQ,QAHuB,GCA7BL,EAASC,EAAAA,WAAW,SAAAC,GAAS,MAAA,CACjC,uBAAwB,CACtBI,QAAS,OACTC,cAAe,SACfC,eAAgB,eAChBC,WAAY,UAGd,sBAAuB,CACrBH,QAAS,OACTG,WAAY,SACZD,eAAgB,SAChBE,YAAa,IACbC,YAAa,QACbC,YAAa,UACbC,aAAc,GACdR,OAAQ,GACRS,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,EACbC,IAAK,EACLC,gBAAiB,QAGnB,kBAAmB,CACjBC,UAAW,GACXC,SAAU,IAGZ,mBAAoB,CAClBR,aAAc,GACdS,QAAS,GAhCsB,GFDvBvB,QAAAA,cAAAA,GAAAA,EAAAA,QAAAA,WAAAA,iBAAQ,CAAA,IAChB,MAAA,QACAA,EAAA,MAAA,QGMG,ICNKwB,EDMCC,EAA4B,SAACC,GACtC,IAAAC,aACAC,EAAQF,EAAAE,SACRC,EAAgBH,EAAAG,iBAChBC,EAAUJ,EAAAI,WACVC,EAAkBL,EAAAK,mBAClBC,cACAC,EAAUP,EAAAO,WACVC,EAAkBR,EAAAQ,mBAClBC,EAAmBT,EAAAS,oBACnBC,EAAUV,EAAAU,WACVC,gBACAC,EAAiB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iBAAkB,WACdqD,EAAYR,EAAa/C,EAAUwD,EACvC,GACG/B,eAAAA,EAAa2C,iBAEpB,OACIhD,MAACiD,EAAAA,YAAWvD,EAAAA,SAAA,CAERqB,MAAO,CACHxC,SAAU,gBACb,CAAAgC,SAEDP,MAACtB,EAAIgB,EAAAA,SAAA,CAAA,EAAKmD,MALL,SAAAhC,OAASuB,GAQ1B,GAAI,MAGhB,EAAG,CAACH,EAAeR,IAEbyB,EAAe,CACjBC,SAAqC,QAA3BC,EAAAxB,eAAAA,EAAgByB,mBAAW,IAAAD,GAAAA,EACrCE,cAA2C,QAA5BC,EAAA3B,eAAAA,EAAgB4B,oBAAY,IAAAD,EAAAA,EAAI,OAC/CE,aAA+C,QAAjCC,EAAA9B,eAAAA,EAAgB+B,yBAAiB,IAAAD,EAAAA,EAAI,GACnDE,KAAsC,QAAhCC,EAAAjC,eAAAA,EAAgBkC,wBAAgB,IAAAD,GAAAA,GAE1C,OACI7D,EAAAA,IAAAQ,EAAAA,SAAA,CAAAD,SACKiB,EACGa,IAEArC,MAAC+D,EAAAA,OAAMrE,EAAAA,SAAA,CACHsE,aAAc/B,EACdgC,UAAU,EACVC,YAAY,EACZtD,UAAW1D,EAAe,OAC1B6D,MAAOV,eAAAA,EAAa8D,qBAChBjB,EAAY,CAAA3C,SAEfqC,QAKrB"}
1
+ {"version":3,"file":"ct-platform-pill-carousel.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/PillCarousel/src/Pill/Pill.types.ts","../packages/components/PillCarousel/src/Pill/index.tsx","../packages/components/PillCarousel/src/PillCarousel.types.ts","../packages/components/PillCarousel/src/PillCarousel.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","PillType","CarouselType","Pill","_a","pillData","pillType","pillClickHandler","isSelected","selectedPillStyles","textClass","imageClass","pillContainerClass","pillContainerStyles","textStyles","imageStyles","renderCustomLabel","renderCustomImage","selectedPillStyle","__assign","border","backgroundColor","transition","renderPillLabel","useCallback","text","_jsx","jsx","Typography","variant","TypographyVariant","B2","className","classNames","styles","children","_Fragment","Fragment","renderImage","imageUrl","src","default","STORY","_jsxs","onClick","SwiperCore","use","Autoplay","Pagination","isLoading","carouselData","carouselType","onItemClick","styleConfig","carouselConfig","renderCustomPillImage","defaultSelectedPillIndex","_f","useState","selectedIndex","setSelectedIndex","onPillClick","index","renderLoadingSlides","display","flexDirection","alignItems","paddingLeft","gap","Array","from","length","map","_","width","height","padding","justifyContent","borderRadius","background","renderSlides","args","PILL_STORY","CHIPS","pillStyleConfig","SwiperSlide","maxWidth","concat","carouselConf","freeMode","_b","isFreeSwipe","slidesPerView","_c","pillsPerView","spaceBetween","_d","spaceBetweenPills","loop","_e","isInfiniteScroll","Swiper","initialSlide","autoplay","pagination","carouselStyleConfig"],"mappings":"8QAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAK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exD,EAAAA,aAAY,WAC7B,OACImB,6BACKO,EAAasB,KAAI,SAACnE,EAAUyD,GACzB,IAAMmB,EAAI9D,EAAAA,SAAA,CACNb,SACI6C,GACAA,IAAiBjD,QAAYA,aAACgF,WACxBjF,QAAAA,SAASyC,MACTzC,QAAAA,SAASkF,MACnB9E,SAAUA,EACVG,WAAYsD,GAASH,EACrB1C,kBAAmBsC,EACnBhD,iBAAkB,WACdsD,EAAYT,EAAa/C,EAAUyD,KAEpCT,eAAAA,EAAa+B,iBAEpB,OACI1D,MAAC2D,EAAAA,YAAWlE,EAAAA,SAAA,CAER3B,MAAO,CACH8F,SAAU,gBAGd,CAAAnD,SAAAT,EAAAC,IAACxB,EAAIgB,EAAAA,SAAA,CAAA,EAAK8D,MALL,SAAAM,OAASzB,GAQ1B,IAAI,MAGhB,GAAG,CAACH,EAAeT,IAEbsC,EAAe,CACjBC,SAAqC,QAA3BC,EAAApC,eAAAA,EAAgBqC,mBAAW,IAAAD,GAAAA,EACrCE,cAA2C,QAA5BC,EAAAvC,eAAAA,EAAgBwC,oBAAY,IAAAD,EAAAA,EAAI,OAC/CE,aAA+C,QAAjCC,EAAA1C,eAAAA,EAAgB2C,yBAAiB,IAAAD,EAAAA,EAAI,GACnDE,KAAsC,QAAhCC,EAAA7C,eAAAA,EAAgB8C,wBAAgB,IAAAD,GAAAA,GAE1C,OACIzE,EAAAA,IACKU,EAAAA,SAAA,CAAAD,SAAAc,EACGc,IAEArC,MAAC2E,EAAAA,OAAMlF,EAAAA,SAAA,CACHmF,aAAc3C,EACd4C,UAAU,EACVC,YAAY,EACZxE,UAAWE,EACX1C,MAAO6D,eAAAA,EAAaoD,qBAChBjB,EAAY,CAAArD,SAEf6C,QAKrB","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as i,Fragment as l,jsxs as t}from"react/jsx-runtime";import{useCallback as n,useState as r}from"react";import o,{Autoplay as a,Pagination as c}from"swiper";import{SwiperSlide as d,Swiper as s}from"swiper/react";import{makeStyles as p}from"@cleartrip/ct-design-style-manager";import{Typography as u,TypographyVariant as g}from"@cleartrip/ct-design-typography";import{Container as m}from"@cleartrip/ct-design-components";var f,y=p(function(e){return{swiper:{width:"100%",height:"100%"}}}),C=p(function(e){return{"pill-story-container":{display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"center"},"pill-chip-container":{display:"flex",alignItems:"center",justifyContent:"center",borderWidth:1.5,borderStyle:"solid",borderColor:"#E6E6E6",borderRadius:16,height:32,paddingTop:0,paddingRight:8,paddingBottom:0,paddingLeft:8,gap:4,backgroundColor:"#FFF"},"pill-chip-image":{maxHeight:20,maxWidth:20},"pill-story-image":{borderRadius:30,padding:5}}});!function(e){e.CHIPS="CHIPS",e.STORY="STORY"}(f||(f={}));var h,S=function(r){var o=r.pillData,a=r.pillType,c=r.pillClickHandler,d=r.isSelected,s=r.selectedPillStyles,p=r.textClass,y=r.imageClass,h=r.pillContainerClass,S=r.pillContainerStyles,v=r.textStyles,x=r.imageStyles,I=r.renderCustomLabel,P=r.renderCustomImage,L=e({border:"1.5px solid #1A1A1A",backgroundColor:"#F3F3F3",transition:"all 200ms ease-in-out"},s),b=n(function(){return I?I(o):o.text?i(u,e({variant:g.B2,styleConfig:{root:[p,C["pill-text"],v]}},{children:o.text})):i(l,{})},[]),R=n(function(){return i(l,{children:P?P(o):o.imageUrl&&i("img",{src:o.imageUrl,className:"".concat(y," ").concat(C[a===f.STORY?"pill-story-container":"pill-chip-image"]),style:x})})},[]);return a===f.STORY?t(m,e({as:"div",onClick:c,styleConfig:{root:["__local-".concat(h),"__local-".concat(C["pill-story-container"]),d?e(e({},S),L):S]}},{children:[R(),b()]})):t(m,e({as:"div",onClick:c,styleConfig:{root:["__local-".concat(h),"__local-".concat(C["pill-chip-container"]),d?e(e({},S),L):S]}},{children:[R(),b()]}))};!function(e){e.PILL_CHIP="PILL_CHIP",e.PILL_STORY="PILL_STORY"}(h||(h={})),o.use([a,c]);var v=function(o){var a,c,p,u,g=o.isLoading,C=o.carouselData,v=o.carouselType,x=o.onItemClick,I=o.styleConfig,P=o.carouselConfig,L=o.renderCustomPillImage,b=o.defaultSelectedPillIndex,R=r(null!=b?b:0),T=R[0],_=R[1],w=n(function(e,i,l){_(l),e(i,l)},[]),k=n(function(){return i(m,e({as:"div",styleConfig:{root:[{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:16,gap:12}]}},{children:Array.from({length:3}).map(function(e,l){return i(m,{as:"div",styleConfig:{root:[{display:"flex",width:88,height:32,paddingTop:4,paddingRight:8,paddingBottom:4,paddingLeft:8,flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:4,borderRadius:16,background:"rgba(255, 255, 255, 0.50)"}]}},l)})}))},[g]),H=n(function(){return t(l,{children:[C.map(function(l,t){var n=e({pillType:v&&v===h.PILL_STORY?f.STORY:f.CHIPS,pillData:l,isSelected:t==T,renderCustomImage:L,pillClickHandler:function(){w(x,l,t)}},null==I?void 0:I.pillStyleConfig);return i(d,e({style:{maxWidth:"fit-content"}},{children:i(S,e({},n))}),"slide-".concat(t))})," "]})},[T,C]),O={freeMode:null===(a=null==P?void 0:P.isFreeSwipe)||void 0===a||a,slidesPerView:null!==(c=null==P?void 0:P.pillsPerView)&&void 0!==c?c:"auto",spaceBetween:null!==(p=null==P?void 0:P.spaceBetweenPills)&&void 0!==p?p:12,loop:null!==(u=null==P?void 0:P.isInfiniteScroll)&&void 0!==u&&u};return i(l,{children:g?k():i(s,e({initialSlide:T,autoplay:!1,pagination:!1,className:y.swiper,style:null==I?void 0:I.carouselStyleConfig},O,{children:H()}))})};export{h as CarouselType,v as PillCarousel,f as PillType};
1
+ import{__assign as e}from"tslib";import{jsx as i,Fragment as l,jsxs as t}from"react/jsx-runtime";import{useCallback as n,useState as r}from"react";import o,{Autoplay as a,Pagination as d}from"swiper";import{SwiperSlide as s,Swiper as p}from"swiper/react";import c from"classnames";import{Typography as u,TypographyVariant as m}from"@cleartrip/ct-design-typography";function f(e,i){void 0===i&&(i={});var l=i.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===l&&t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}var x="index-module_swiper__r5-8U";f(".index-module_swiper__r5-8U{height:100%;width:100%}");var g,y={"pill-story-container":"index-module_pill-story-container__QnH4k","pill-chip-container":"index-module_pill-chip-container__-CDkA","pill-chip-image":"index-module_pill-chip-image__FGQ6V","pill-story-image":"index-module_pill-story-image__7VUfq"};f(".index-module_pill-story-container__QnH4k{align-items:center;display:flex;flex-direction:column;justify-content:space-evenly}.index-module_pill-chip-container__-CDkA{align-items:center;background-color:#fff;border:1.5px solid #e6e6e6;border-radius:16px;display:flex;gap:4px;height:32px;justify-content:center;padding:0 8px}.index-module_pill-chip-image__FGQ6V{max-height:20px;max-width:20px}.index-module_pill-story-image__7VUfq{border-radius:30px;padding:5px}"),function(e){e.CHIPS="CHIPS",e.STORY="STORY"}(g||(g={}));var h,_=function(r){var o=r.pillData,a=r.pillType,d=r.pillClickHandler,s=r.isSelected,p=r.selectedPillStyles,f=r.textClass,x=r.imageClass,h=r.pillContainerClass,_=r.pillContainerStyles,C=r.textStyles,v=r.imageStyles,S=r.renderCustomLabel,I=r.renderCustomImage,P=e({border:"1.5px solid #1A1A1A",backgroundColor:"#F3F3F3",transition:"all 200ms ease-in-out"},p),T=n((function(){return S?S(o):o.text?i(u,e({variant:m.B2,className:c(f,y["pill-text"]),style:C},{children:o.text})):i(l,{})}),[]),w=n((function(){return i(l,{children:I?I(o):o.imageUrl&&i("img",{src:o.imageUrl,className:c(x,y[a===g.STORY?"pill-story-container":"pill-chip-image"]),style:v})})}),[]);return a===g.STORY?t("div",e({className:c(h,y["pill-story-container"]),style:s?e(e({},_),P):_,onClick:d},{children:[w(),T()]})):t("div",e({className:c(h,y["pill-chip-container"]),style:s?e(e({},_),P):_,onClick:d},{children:[w(),T()]}))};!function(e){e.PILL_CHIP="PILL_CHIP",e.PILL_STORY="PILL_STORY"}(h||(h={})),o.use([a,d]);var C=function(o){var a,d,c,u,m=o.isLoading,f=o.carouselData,y=o.carouselType,C=o.onItemClick,v=o.styleConfig,S=o.carouselConfig,I=o.renderCustomPillImage,P=o.defaultSelectedPillIndex,T=r(null!=P?P:0),w=T[0],L=T[1],k=n((function(e,i,l){L(l),e(i,l)}),[]),b=n((function(){return i("div",e({style:{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"16px",gap:"12px"}},{children:Array.from({length:3}).map((function(e,l){return i("div",{style:{display:"flex",width:"88px",height:"32px",padding:"4px 8px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"4px",borderRadius:"16px",background:"rgba(255, 255, 255, 0.50)"}},l)}))}))}),[m]),H=n((function(){return t(l,{children:[f.map((function(l,t){var n=e({pillType:y&&y===h.PILL_STORY?g.STORY:g.CHIPS,pillData:l,isSelected:t==w,renderCustomImage:I,pillClickHandler:function(){k(C,l,t)}},null==v?void 0:v.pillStyleConfig);return i(s,e({style:{maxWidth:"fit-content"}},{children:i(_,e({},n))}),"slide-".concat(t))}))," "]})}),[w,f]),R={freeMode:null===(a=null==S?void 0:S.isFreeSwipe)||void 0===a||a,slidesPerView:null!==(d=null==S?void 0:S.pillsPerView)&&void 0!==d?d:"auto",spaceBetween:null!==(c=null==S?void 0:S.spaceBetweenPills)&&void 0!==c?c:12,loop:null!==(u=null==S?void 0:S.isInfiniteScroll)&&void 0!==u&&u};return i(l,{children:m?b():i(p,e({initialSlide:w,autoplay:!1,pagination:!1,className:x,style:null==v?void 0:v.carouselStyleConfig},R,{children:H()}))})};export{h as CarouselType,C as PillCarousel,g as PillType};
2
2
  //# sourceMappingURL=ct-platform-pill-carousel.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-pill-carousel.esm.js","sources":["../packages/components/PillCarousel/src/index.module.ts","../packages/components/PillCarousel/src/Pill/Pill.types.ts","../packages/components/PillCarousel/src/Pill/index.module.ts","../packages/components/PillCarousel/src/Pill/index.tsx","../packages/components/PillCarousel/src/PillCarousel.types.ts","../packages/components/PillCarousel/src/PillCarousel.tsx"],"sourcesContent":[null,null,null,null,null,null],"names":["PillType","styles","makeStyles","theme","swiper","width","height","display","flexDirection","justifyContent","alignItems","borderWidth","borderStyle","borderColor","borderRadius","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","backgroundColor","maxHeight","maxWidth","padding","CarouselType","Pill","_a","pillData","pillType","pillClickHandler","isSelected","selectedPillStyles","textClass","imageClass","pillContainerClass","pillContainerStyles","textStyles","imageStyles","renderCustomLabel","renderCustomImage","selectedPillStyle","__assign","border","transition","renderPillLabel","useCallback","text","_jsx","Typography","variant","TypographyVariant","B2","styleConfig","root","children","_Fragment","renderImage","imageUrl","src","className","concat","STORY","style","_jsxs","Container","as","onClick","SwiperCore","use","Autoplay","Pagination","PillCarousel","isLoading","carouselData","carouselType","onItemClick","carouselConfig","renderCustomPillImage","defaultSelectedPillIndex","_f","useState","selectedIndex","setSelectedIndex","onPillClick","index","renderLoadingSlides","Array","from","length","map","_","background","renderSlides","args","PILL_STORY","CHIPS","pillStyleConfig","SwiperSlide","carouselConf","freeMode","_b","isFreeSwipe","slidesPerView","_c","pillsPerView","spaceBetween","_d","spaceBetweenPills","loop","_e","isInfiniteScroll","Swiper","initialSlide","autoplay","pagination","carouselStyleConfig"],"mappings":"+cAGA,ICDYA,EDCNC,EAASC,EAAW,SAAAC,GAAS,MAAA,CACjCC,OAAQ,CACNC,MAAO,OACPC,OAAQ,QAHuB,GEA7BL,EAASC,EAAW,SAAAC,GAAS,MAAA,CACjC,uBAAwB,CACtBI,QAAS,OACTC,cAAe,SACfC,eAAgB,eAChBC,WAAY,UAGd,sBAAuB,CACrBH,QAAS,OACTG,WAAY,SACZD,eAAgB,SAChBE,YAAa,IACbC,YAAa,QACbC,YAAa,UACbC,aAAc,GACdR,OA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aAAc,GACd6E,WAAY,gCAffP,EAHgC,KAwBzD,EAAG,CAACZ,IAEEoB,EAAe/C,EAAY,WAC7B,OACIkB,eACKU,EAAagB,IAAI,SAAC9D,EAAUyD,GACzB,IAAMS,EAAIpD,EAAA,CACNb,SACI8C,GACAA,IAAiBlD,EAAasE,WACxB9F,EAAS6D,MACT7D,EAAS+F,MACnBpE,SAAUA,EACVG,WAAYsD,GAASH,EACrB1C,kBAAmBsC,EACnBhD,iBAAkB,WACdsD,EAAYR,EAAahD,EAAUyD,EACvC,GACGhC,eAAAA,EAAa4C,iBAEpB,OACIjD,EAACkD,EAAWxD,EAAA,CAERqB,MAAO,CACHxC,SAAU,gBACb,CAAAgC,SAEDP,EAACtB,EAAIgB,EAAA,CAAA,EAAKoD,MALL,SAAAjC,OAASwB,GAQ1B,GAAI,MAGhB,EAAG,CAACH,EAAeR,IAEbyB,EAAe,CACjBC,SAAqC,QAA3BC,EAAAxB,eAAAA,EAAgByB,mBAAW,IAAAD,GAAAA,EACrCE,cAA2C,QAA5BC,EAAA3B,eAAAA,EAAgB4B,oBAAY,IAAAD,EAAAA,EAAI,OAC/CE,aAA+C,QAAjCC,EAAA9B,eAAAA,EAAgB+B,yBAAiB,IAAAD,EAAAA,EAAI,GACnDE,KAAsC,QAAhCC,EAAAjC,eAAAA,EAAgBkC,wBAAgB,IAAAD,GAAAA,GAE1C,OACI9D,EAAAQ,EAAA,CAAAD,SACKkB,EACGa,IAEAtC,EAACgE,EAAMtE,EAAA,CACHuE,aAAc/B,EACdgC,UAAU,EACVC,YAAY,EACZvD,UAAW1D,EAAe,OAC1B6D,MAAOV,eAAAA,EAAa+D,qBAChBjB,EAAY,CAAA5C,SAEfsC,QAKrB"}
1
+ {"version":3,"file":"ct-platform-pill-carousel.esm.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/PillCarousel/src/Pill/Pill.types.ts","../packages/components/PillCarousel/src/Pill/index.tsx","../packages/components/PillCarousel/src/PillCarousel.types.ts","../packages/components/PillCarousel/src/PillCarousel.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","PillType","CarouselType","Pill","_a","pillData","pillType","pillClickHandler","isSelected","selectedPillStyles","textClass","imageClass","pillContainerClass","pillContainerStyles","textStyles","imageStyles","renderCustomLabel","renderCustomImage","selectedPillStyle","__assign","border","backgroundColor","transition","renderPillLabel","useCallback","text","_jsx","Typography","variant","TypographyVariant","B2","className","classNames","styles","children","_Fragment","renderImage","imageUrl","src","STORY","_jsxs","onClick","SwiperCore","use","Autoplay","Pagination","PillCarousel","isLoading","carouselData","carouselType","onItemClick","styleConfig","carouselConfig","renderCustomPillImage","defaultSelectedPillIndex","_f","useState","selectedIndex","setSelectedIndex","onPillClick","index","renderLoadingSlides","display","flexDirection","alignItems","paddingLeft","gap","Array","from","length","map","_","width","height","padding","justifyContent","borderRadius","background","renderSlides","args","PILL_STORY","CHIPS","pillStyleConfig","SwiperSlide","maxWidth","concat","carouselConf","freeMode","_b","isFreeSwipe","slidesPerView","_c","pillsPerView","spaceBetween","_d","spaceBetweenPills","loop","_e","isInfiniteScroll","Swiper","initialSlide","autoplay","pagination","carouselStyleConfig"],"mappings":"6WAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC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AACb,IAEE+B,EAAetD,GAAY,WAC7B,OACIgB,eACKQ,EAAasB,KAAI,SAACjE,EAAUuD,GACzB,IAAMmB,EAAI5D,EAAA,CACNb,SACI2C,GACAA,IAAiB/C,EAAa8E,WACxB/E,EAASsC,MACTtC,EAASgF,MACnB5E,SAAUA,EACVG,WAAYoD,GAASH,EACrBxC,kBAAmBoC,EACnB9C,iBAAkB,WACdoD,EAAYT,EAAa7C,EAAUuD,KAEpCT,eAAAA,EAAa+B,iBAEpB,OACIxD,EAACyD,EAAWhE,EAAA,CAER3B,MAAO,CACH4F,SAAU,gBAGd,CAAAlD,SAAAR,EAACvB,EAAIgB,EAAA,CAAA,EAAK4D,MALL,SAAAM,OAASzB,GAQ1B,IAAI,MAGhB,GAAG,CAACH,EAAeT,IAEbsC,EAAe,CACjBC,SAAqC,QAA3BC,EAAApC,eAAAA,EAAgBqC,mBAAW,IAAAD,GAAAA,EACrCE,cAA2C,QAA5BC,EAAAvC,eAAAA,EAAgBwC,oBAAY,IAAAD,EAAAA,EAAI,OAC/CE,aAA+C,QAAjCC,EAAA1C,eAAAA,EAAgB2C,yBAAiB,IAAAD,EAAAA,EAAI,GACnDE,KAAsC,QAAhCC,EAAA7C,eAAAA,EAAgB8C,wBAAgB,IAAAD,GAAAA,GAE1C,OACIvE,EACKS,EAAA,CAAAD,SAAAa,EACGc,IAEAnC,EAACyE,EAAMhF,EAAA,CACHiF,aAAc3C,EACd4C,UAAU,EACVC,YAAY,EACZvE,UAAWE,EACXzC,MAAO2D,eAAAA,EAAaoD,qBAChBjB,EAAY,CAAApD,SAEf4C,QAKrB","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.css","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.css","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-platform-pill-carousel",
3
- "version": "1.4.0-SNAPSHOT-native-main.0",
3
+ "version": "1.4.0",
4
4
  "description": "PillCarousel Component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/ct-platform-pill-carousel.cjs.js",
@@ -10,10 +10,10 @@
10
10
  "dist"
11
11
  ],
12
12
  "dependencies": {
13
- "@cleartrip/ct-design-typography": ">=5.27.0-SNAPSHOT-native-main.6",
13
+ "@cleartrip/ct-design-typography": "2.6.0",
14
14
  "classnames": "^2.5.1",
15
15
  "swiper": "6.8.4",
16
- "@cleartrip/ct-platform-assets": "6.4.0-SNAPSHOT-native-main.0"
16
+ "@cleartrip/ct-platform-assets": "4.4.0"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": ">=16.8.0",
@@ -1,34 +0,0 @@
1
- declare const styles: {
2
- 'pill-story-container': {
3
- display: "flex";
4
- flexDirection: "column";
5
- justifyContent: "space-evenly";
6
- alignItems: "center";
7
- };
8
- 'pill-chip-container': {
9
- display: "flex";
10
- alignItems: "center";
11
- justifyContent: "center";
12
- borderWidth: number;
13
- borderStyle: "solid";
14
- borderColor: string;
15
- borderRadius: number;
16
- height: number;
17
- paddingTop: number;
18
- paddingRight: number;
19
- paddingBottom: number;
20
- paddingLeft: number;
21
- gap: number;
22
- backgroundColor: string;
23
- };
24
- 'pill-chip-image': {
25
- maxHeight: number;
26
- maxWidth: number;
27
- };
28
- 'pill-story-image': {
29
- borderRadius: number;
30
- padding: number;
31
- };
32
- };
33
- export default styles;
34
- //# sourceMappingURL=index.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.module.d.ts","sourceRoot":"","sources":["../../packages/components/PillCarousel/src/Pill/index.module.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCT,CAAC;AAEJ,eAAe,MAAM,CAAC"}
@@ -1,8 +0,0 @@
1
- declare const styles: {
2
- swiper: {
3
- width: "100%";
4
- height: "100%";
5
- };
6
- };
7
- export default styles;
8
- //# sourceMappingURL=index.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.module.d.ts","sourceRoot":"","sources":["../packages/components/PillCarousel/src/index.module.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM;;;;;CAKT,CAAC;AAEJ,eAAe,MAAM,CAAC"}