@bikdotai/bik-component-library 0.0.559-7 → 0.0.559-beta.tp-1
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/accordion/Accordion.d.ts +0 -4
- package/dist/cjs/components/accordion/Accordion.js +1 -1
- package/dist/cjs/components/accordion/Accordion.style.d.ts +0 -1
- package/dist/cjs/components/accordion/Accordion.style.js +2 -6
- package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/cjs/components/tabs/Tabs.js +1 -1
- package/dist/cjs/components/tag/Tag.d.ts +1 -1
- package/dist/cjs/components/tag/Tag.js +1 -1
- package/dist/cjs/components/tag/Tag.styled.d.ts +0 -1
- package/dist/cjs/components/tag/Tag.styled.js +1 -1
- package/dist/cjs/components/tag/model.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/accordion/Accordion.d.ts +0 -4
- package/dist/esm/components/accordion/Accordion.js +1 -1
- package/dist/esm/components/accordion/Accordion.style.d.ts +0 -1
- package/dist/esm/components/accordion/Accordion.style.js +1 -5
- package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/esm/components/tabs/Tabs.js +1 -1
- package/dist/esm/components/tag/Tag.d.ts +1 -1
- package/dist/esm/components/tag/Tag.js +1 -1
- package/dist/esm/components/tag/Tag.styled.d.ts +0 -1
- package/dist/esm/components/tag/Tag.styled.js +1 -1
- package/dist/esm/components/tag/model.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/package.json +1 -1
|
@@ -18,9 +18,5 @@ export interface AccordionProps {
|
|
|
18
18
|
headerStyles?: React.CSSProperties;
|
|
19
19
|
onToggleAccordion?: (state: boolean) => void;
|
|
20
20
|
arrowColor?: string;
|
|
21
|
-
isOpen?: boolean;
|
|
22
|
-
buttonLinkText?: string;
|
|
23
|
-
onButtonLinkClick?: () => void;
|
|
24
|
-
captionStyle?: React.CSSProperties;
|
|
25
21
|
}
|
|
26
22
|
export declare const BikAccordion: React.FC<AccordionProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),o=require("../TypographyStyle.js"),t=require("./Accordion.style.js"),n=require("./AccordionArrow.js");exports.BikAccordion=i=>{var s,a;const[c,l]=r.useState(!1),d=r.useRef(null),u=r.useRef(null);r.useEffect((()=>{i.autoOpen&&h(i.autoOpen,{})}),[i.autoOpen]);const h=(e,r)=>{var o,t;u.current&&d.current&&("keydown"===r.type&&"Enter"!==r.key||(l(e),u.current.style.maxHeight?(u.current.style.maxHeight="",d.current.style.transform="rotate(0deg)",d.current.style.transition="transform 0.25s ease-in-out",u.current.style.transition="padding 0s"):(u.current.style.maxHeight=(null!==(o=i.childrenMaxHeight)&&void 0!==o?o:u.current.scrollHeight)+"px",d.current.style.transform="rotate(180deg)",d.current.style.transition="transform 0.25s ease-in-out",u.current.style.transition="max-height 0.25s ease-in-out"),null===(t=i.onToggleAccordion)||void 0===t||t.call(i,e)))};return r.useEffect((()=>{var e;c&&(null==i?void 0:i.refresh)&&(null===(e=null==u?void 0:u.current)||void 0===e?void 0:e.scrollHeight)&&!i.childrenMaxHeight&&setTimeout((()=>{u.current.style.maxHeight=u.current.scrollHeight+"px"}),100)}),[c,null==i?void 0:i.refresh,null===(s=null==u?void 0:u.current)||void 0===s?void 0:s.scrollHeight]),e.jsxs(t.default,Object.assign({className:"accordion",isActive:c,width:null==i?void 0:i.width,contentMargin:null==i?void 0:i.contentMargin,headerPadding:i.headerPadding,skipHoverState:i.skipHoverHeader,showBorders:i.showBorders,backgroundColor:i.backgroundColor,openDirection:i.openDirection},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(c?"active":""),onClick:e=>h(!c,e),onKeyDown:e=>h(!c,e),role:"button",tabIndex:0},{children:[!i.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header",style:null!==(a=i.headerStyles)&&void 0!==a?a:{}},{children:["string"==typeof i.header?e.jsx(o.TitleRegular,{children:null==i?void 0:i.header}):i.header,e.jsx(n.default,{arrowColor:i.arrowColor,isNewIcon:!0,ref:d})]})),i.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:[e.jsxs("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[e.jsx(n.default,{arrowColor:i.arrowColor,isNewIcon:!0,ref:d}),"string"==typeof i.header?e.jsx(o.TitleRegular,{children:null==i?void 0:i.header}):i.header]})),e.jsx("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:i.rightActionComponent}))]})),(null==i?void 0:i.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(o.BodySecondary,{children:i.caption})}))]})),e.jsx("div",Object.assign({ref:u,className:"accordion__content"},{children:i.children}))]}))};
|
|
@@ -11,4 +11,3 @@ declare const AccordionStyle: import("styled-components").StyledComponent<"div",
|
|
|
11
11
|
openDirection?: AccordionProps['openDirection'];
|
|
12
12
|
}, never>;
|
|
13
13
|
export default AccordionStyle;
|
|
14
|
-
export declare const AccordionHeaderGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const i=o(e).default.div`
|
|
2
2
|
width: ${e=>(null==e?void 0:e.width)||"100%"};
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -34,8 +34,4 @@
|
|
|
34
34
|
order: ${e=>"UP"===e.openDirection?-1:0};
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
gap: 24px;
|
|
41
|
-
`;exports.AccordionHeaderGroup=t,exports.default=d;
|
|
37
|
+
`;exports.default=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/chevronRight.svg.js"),l=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/chevronRight.svg.js"),l=require("react"),i=require("../checkBox/CheckBox.js"),o=require("../icon-button/IconButton.js"),c=require("../tag/Tag.js"),s=require("../tooltips/Tooltip.js"),r=require("../TypographyStyle.js"),n=require("./emptyState.js"),d=require("./ProductPickerShimmer.js"),a=require("./style.js"),u=require("./utility.js");const h=l=>{const{customCollectionRestriction:n,data:d,selectedCollectionsDispatch:u,setCollectionId:h,setSelectedCollectionId:C,isPartiallyChecked:p,setScreen:j,id:v,isChecked:y,isDisabled:g,hideCollectionCheckbox:x,pickerType:m,usedInSearch:b}=l;return e.jsxs(a.CollectionCardStyle,Object.assign({isDisabled:g,onClick:e=>{if(!g){if("COLLECTION"===m)return e.stopPropagation(),u({type:"reset",data:{}}),u({type:"selected",data:{id:v,val:d,isRestricted:n}}),h(v),void C(v);h(v),C(v),j("products")}},isActive:y,usedInSearch:null!=b&&b},{children:[e.jsxs(a.CollectionCardInfoStyle,{children:[!x&&e.jsx(i.CheckBox,{isDisabled:g,isChecked:y,isPartiallyChecked:p,onValueChange:function(e,t,l){null==l||l.stopPropagation(),u(e?{type:"selected",data:{id:v,val:d,isRestricted:n}}:{type:"unselected",data:{id:v}}),C(e?v:"")}}),e.jsx(a.CollectionCardDetailStyle,{children:e.jsx(s.Tooltip,Object.assign({body:d.name,placement:"bottom",delay:400,variant:"light"},{children:e.jsxs(a.CollectionNameHolder,{children:[b?e.jsx(r.BodyPrimary,Object.assign({numberOfLines:1},{children:d.name})):e.jsx(r.TitleRegular,Object.assign({numberOfLines:1},{children:d.name})),d.isSmartCollection?e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(c.Tag,{tagText:"Smart Collection",type:"warning"})})):e.jsx(e.Fragment,{})]})}))})]}),"COLLECTION"!==m&&e.jsx(o.IconButton,{height:12,width:12,disabled:g,Icon:t.default})]}))};exports.CollectionCard=h,exports.CollectionsScreen=t=>{var i;const{customCollectionRestriction:o,dataLoading:c,collections:s,selectedCollectionsDispatch:r,setCollectionId:a,setSelectedCollectionId:C,selectedCollections:p,setScreen:j,collectionFetcher:v,collectionsDispatch:y,pagingControls:g,storeId:x,setSaveDisabled:m,hideCollectionCheckbox:b,renderWithoutModal:k,pickerType:f,scrollContainerRef:S}=t,P=l.useRef(g.curPage),O=!!o&&(null==p?void 0:p.isCustom),[I,T]=l.useState(!1),q=l.useRef(!1),R=l.useRef(!1),D=()=>{if(!S||!(null==S?void 0:S.current))return;const{scrollTop:e,clientHeight:t,scrollHeight:l}=S.current;e+t>=l-20&&!q.current&&!R.current&&(m(!0),T(!0),R.current=!0,m(!0),T(!0),v(P.current,x).then((e=>{y({type:"paged",data:(null==e?void 0:e.collections)||{}}),g.setCurPage(P.current+1),T(!1),m(!1),R.current=!1,Object.keys(null==e?void 0:e.collections).length||(q.current=!0)})).catch())};return l.useEffect((()=>{var e;return null===(e=null==S?void 0:S.current)||void 0===e||e.addEventListener("scroll",D),()=>{var e;null===(e=null==S?void 0:S.current)||void 0===e||e.removeEventListener("scroll",D)}}),[]),l.useEffect((()=>{P.current=g.curPage}),[g.curPage]),e.jsxs("div",{children:[(null===(i=Object.keys(null!=s?s:{}))||void 0===i?void 0:i.length)?Object.keys(s).map((t=>{var l,i;const c=!!(null==p?void 0:p[t])&&("PRODUCT"!==f||!!Object.keys(null!==(i=null===(l=null==p?void 0:p[t])||void 0===l?void 0:l.products)&&void 0!==i?i:{}).length);return e.jsx(h,{customCollectionRestriction:o,data:s[t],isDisabled:O&&!(null==p?void 0:p[t]),isChecked:c,isPartiallyChecked:u.isCollectionPartiallyChecked(t,null==s?void 0:s[t],p),selectedCollectionsDispatch:r,setCollectionId:a,setSelectedCollectionId:C,setScreen:j,id:t,hideCollectionCheckbox:b||"-1"===t,selectedCollections:p,renderWithoutModal:k,pickerType:f},t)})):c?e.jsx(d.ProductPickerShimmer,{}):e.jsx(n.EmptyState,{title:"No collections to show",subtitle:"We couldn’t find any collection."}),I&&e.jsx(d.ProductPickerShimmer,{})]})},exports.truncate=(e,t,l)=>{if(!e)return"";if(e.length<=t)return e;const i=e.slice(0,t-1);return(l?i.slice(0,i.lastIndexOf(" ")):i)+"..."};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../../constants/Theme.js"),r=require("../TypographyStyle.js"),a=require("./Tabs.styles.js");const n=r=>{var n,l;const{tabs:i,initialTab:c,onTabSelected:d,TabItemStyledProps:b,selectedTab:u,extendedBorder:p,rightComponent:x,size:T="default",isSquared:m=!1,containerStyles:g}=r,[y,C]=t.useState(c||i[0].key),{colorsV2:j}=s.DEFAULT_THEME;t.useEffect((()=>{u&&
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../../constants/Theme.js"),r=require("../TypographyStyle.js"),a=require("./Tabs.styles.js");const n=r=>{var n,l;const{tabs:i,initialTab:c,onTabSelected:d,TabItemStyledProps:b,selectedTab:u,extendedBorder:p,rightComponent:x,size:T="default",isSquared:m=!1,containerStyles:g}=r,[y,C]=t.useState(c||i[0].key),{colorsV2:j}=s.DEFAULT_THEME;t.useEffect((()=>{u&&C(u)}),[u]);const S=r.backgroundColor,h=null!==(n=r.selectedTextColor)&&void 0!==n?n:j.background.brand,q=null!==(l=r.textColor)&&void 0!==l?l:j.content.secondary;return e.jsxs(a.TabHeader,Object.assign({style:null!=g?g:{},bgColor:S},{children:[i.map(((t,s)=>e.jsx(o,{hasEqualSpacing:r.hasEqualSpacing,selectedTextColor:h,textColor:q,tab:t,currentTab:y,TabItemStyledProps:b,IconComponent:t.icon,size:T,setCurrentTab:e=>{d(e),C(e)},isSquared:m,isFirstlement:0==s,isLastElement:s==i.length-1},t.key))),p&&e.jsx(a.EmptyTab,{}),e.jsx(a.RightComponent,{children:x})]}))},o=n=>{const{tab:o,currentTab:l,setCurrentTab:i,TabItemStyledProps:c,IconComponent:d,size:b="default",isSquared:u=!1,isFirstlement:p,isLastElement:x}=n,T=o.key===l,{colorsV2:m}=s.DEFAULT_THEME,g=t.useCallback((()=>Object.assign(Object.assign({},c),{borderRadius:n.isSquared?p?"4px 0px 0px 4px":x?"0px 4px 4px 0px":"":""})),[]);return e.jsxs(a.TabItem,Object.assign({style:g(),selected:T,hasEqualSpacing:n.hasEqualSpacing,onClick:()=>i(n.tab.key),selectedTextColor:n.selectedTextColor,isSquared:u},{children:[d&&e.jsx(d,{selected:T?m.background.brand:m.content.secondary}),e.jsx(a.TabItemText,Object.assign({style:"small"===b?{fontSize:14,fontStyle:"normal",fontWeight:600}:void 0,textColor:n.textColor,selectedTextColor:n.selectedTextColor,selected:T},{children:o.title})),void 0!==o.trailingNumber&&null!==o.trailingNumber&&e.jsx(a.TrailingNumberContainer,Object.assign({selected:T},{children:e.jsx(r.BodyCaption,Object.assign({color:m.content.primaryInverse},{children:o.trailingNumber}))}))]}))};n.displayName="Tabs",o.displayName="TabItemComponent",exports.TabItemComponent=o,exports.Tabs=n;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TagProps } from './model';
|
|
2
2
|
export declare const Tag: {
|
|
3
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor,
|
|
3
|
+
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../TypographyStyle.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../TypographyStyle.js"),r=require("./model.js"),t=require("./Tag.styled.js"),a=require("./themes.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(i);const l=i=>{let{tagText:s,LeadingIcon:l,TrailingIcon:o,onLeadingIconClicked:d,leadingIconId:g,trailingIconId:p,onTrailingIconClicked:j,theme:u="light",type:y="neutral",variant:m="regular",version:h,cursor:b}=i,x=s;const T=u;let O=y;r.ValidTagTypeMap[m][y]||(O="neutral"),"circle"===m&&"number"==typeof x&&x>99&&(x="99+");const I={height:"compressed"===m?11:16,width:"compressed"===m?11:16,color:a.getTagIconColor(u,O),style:{display:"block"}};return e.jsx(t.Tag,Object.assign({cursor:b,theme:T,type:y,variant:m,version:h},{children:e.jsxs("div",Object.assign({className:"container"},{children:[l&&e.jsx("button",Object.assign({className:"icon-leading",onClick:d,id:`${g}-wrapper`||"leading-icon-wrapper"},{children:c.default.createElement(l,Object.assign(Object.assign({},I),{id:g||"leading-icon"}))})),""!==x&&("ai"===y&&"light"===u?"compressed"===m?e.jsx(n.AiBodyTiny,{children:x}):e.jsx(n.AiBodyCaption,{children:x}):"compressed"===m?e.jsx(n.BodyTiny,Object.assign({className:"text"},{children:x})):e.jsx(n.BodyCaption,Object.assign({className:"text"},{children:x}))),o&&e.jsx("button",Object.assign({className:"icon-trailing",onClick:j,id:`${p}-wrapper`||"trailing-icon-wrapper"},{children:c.default.createElement(o,Object.assign(Object.assign({},I),{id:p||"trailing-icon"}))}))]}))}))};l.displayName="Tag",exports.Tag=l;
|
|
@@ -9,5 +9,4 @@ export declare const Tag: import("@emotion/styled").StyledComponent<{
|
|
|
9
9
|
variant: TagVariant;
|
|
10
10
|
version?: "1.0" | "2.0" | undefined;
|
|
11
11
|
cursor?: string | undefined;
|
|
12
|
-
alignIcon?: string | undefined;
|
|
13
12
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("@emotion/styled/base"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("@emotion/styled/base"),e=require("./themes.js");function l(c){return c&&"object"==typeof c&&"default"in c?c:{default:c}}const t=l(c).default("div","production"===process.env.NODE_ENV?{target:"e930jd90"}:{target:"e930jd90",label:"Tag"})("cursor:",(c=>{var e;return null!==(e=c.cursor)&&void 0!==e?e:"default"}),";",(c=>"regular"===c.variant?"display: block;\n\t\t min-height: 26px;\n\t\t":"min-height: 20px;")," .container{display:flex;align-items:center;gap:6px;padding:",(c=>e.getPadding(c.variant)),";background:",(c=>e.getBackgroundColor(c.theme,c.type)),";border-radius:",(c=>"regular"===c.variant?"4px":"12px"),";",(c=>"light"===c.theme&&`border: ${"2.0"===c.version?.5:1}px solid ${e.generateBorder(c.type,c.theme)};`)," .text{color:",(c=>e.getTextColor(c.theme,c.type)),";}.icon-trailing{all:unset;display:flex;}.icon-leading{all:unset;display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhZy5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJUYWcuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgZ2VuZXJhdGVCb3JkZXIsIGdldEJhY2tncm91bmRDb2xvciwgZ2V0UGFkZGluZywgZ2V0VGV4dENvbG9yLCB9IGZyb20gJy4vdGhlbWVzJztcclxuZXhwb3J0IGNvbnN0IFRhZyA9IHN0eWxlZC5kaXYgYFxuXHRjdXJzb3I6ICR7KHByb3BzKSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHByb3BzLmN1cnNvcikgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogJ2RlZmF1bHQnOyB9fTtcblx0JHsocHJvcHMpID0+IHByb3BzLnZhcmlhbnQgPT09ICdyZWd1bGFyJ1xyXG4gICAgPyBgZGlzcGxheTogYmxvY2s7XG5cdFx0ICAgICBtaW4taGVpZ2h0OiAyNnB4O1xuXHRcdGBcclxuICAgIDogYG1pbi1oZWlnaHQ6IDIwcHg7YH1cblx0LmNvbnRhaW5lciB7XG5cdFx0ZGlzcGxheTogZmxleDtcblx0XHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRcdGdhcDogNnB4O1xuXHRcdHBhZGRpbmc6ICR7KHByb3BzKSA9PiBnZXRQYWRkaW5nKHByb3BzLnZhcmlhbnQpfTtcblxuXHRcdGJhY2tncm91bmQ6ICR7KHByb3BzKSA9PiBnZXRCYWNrZ3JvdW5kQ29sb3IocHJvcHMudGhlbWUsIHByb3BzLnR5cGUpfTtcblxuXHRcdGJvcmRlci1yYWRpdXM6ICR7KHByb3BzKSA9PiAocHJvcHMudmFyaWFudCA9PT0gJ3JlZ3VsYXInID8gJzRweCcgOiAnMTJweCcpfTtcblxuXHRcdCR7KHByb3BzKSA9PiBwcm9wcy50aGVtZSA9PT0gJ2xpZ2h0JyAmJlxyXG4gICAgYGJvcmRlcjogJHtwcm9wcy52ZXJzaW9uID09PSAnMi4wJyA/IDAuNSA6IDF9cHggc29saWQgJHtnZW5lcmF0ZUJvcmRlcihwcm9wcy50eXBlLCBwcm9wcy50aGVtZSl9O2B9XG5cblx0XHQudGV4dCB7XG5cdFx0XHRjb2xvcjogJHsocHJvcHMpID0+IGdldFRleHRDb2xvcihwcm9wcy50aGVtZSwgcHJvcHMudHlwZSl9O1xuXHRcdH1cblxuXHRcdC5pY29uLXRyYWlsaW5nIHtcblx0XHRcdGFsbDogdW5zZXQ7XG5cdFx0XHRkaXNwbGF5OiBmbGV4O1xuXHRcdH1cblxuXHRcdC5pY29uLWxlYWRpbmcge1xuXHRcdFx0YWxsOiB1bnNldDtcblx0XHRcdGRpc3BsYXk6IGZsZXg7XG5cdFx0fVxuXHR9XG5gO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1UYWcuc3R5bGVkLmpzLm1hcCJdfQ== */"));exports.Tag=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),o=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),r=require("../modals/styledModal.js"),s=require("../template-preview/models/Channels.js"),i=require("./context/templateModalContext.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),l=require("react"),o=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),r=require("../modals/styledModal.js"),s=require("../template-preview/models/Channels.js"),i=require("../template-preview/models/WhatsAppTemplate.js"),n=require("./context/templateModalContext.js"),d=require("./modalElements/Footer.js"),u=require("./modalElements/TemplateSelectModalContent.js"),c=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=p=>{let{selectedTemplate:v,closeDialog:m,showVariableMapping:h,channel:C,htmlContent:S,templateVariables:b,onTemplateSelect:E,globalPlaceholders:x,showOnlyContent:P,whatsappSpecificPickerMeta:g,zIndex:f,showVariableModal:T,variableList:L,discountCode:I,setDiscountCode:j,onBackPress:y,enabledCustomText:w,variableListForImage:M,showSampleValues:A,disableEditVariable:k,pod:H,extras:N,pickerConf:V,selectedCarouselProducts:D,disableEditExpiry:O,cardWidth:q,onDeleteSelectedProducts:B,fileName:F,setFileName:_,hideDeviceContainerInPreview:W,maxCharLimit:R}=p;var Y,z,$,U,G,J,K,Q;l.useEffect((()=>{re(S)}),[S]);const X=C===s.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(z=null===(Y=null==v?void 0:v.components)||void 0===Y?void 0:Y[1])||void 0===z?void 0:z.type),Z=null==v?void 0:v.isProductCarouselType,[ee,te]=l.useState(C===s.CHANNEL_TYPE.EMAIL||X?"desktop":"mobile"),[le,oe]=l.useState(!1),[ae,re]=l.useState(S),[se,ie]=l.useState(!1),[ne,de]=l.useState([]),[ue,ce]=l.useState({}),[pe,ve]=l.useState(v),[me,he]=l.useState([]),[Ce,Se]=l.useState(null),[be,Ee]=l.useState(!1),[xe,Pe]=l.useState(null!=b?b:[]),[ge,fe]=l.useState(!1),[Te,Le]=l.useState(X?(null===(U=null===($=null==pe?void 0:pe.mapping)||void 0===$?void 0:$.body)||void 0===U?void 0:U.length)?-1:0:-1),[Ie,je]=l.useState([]),[ye,we]=l.useState(void 0),Me=l.useRef(null),[Ae,ke]=l.useState(!1),[He,Ne]=l.useState(!1),[Ve,De]=l.useState(!1),[Oe,qe]=l.useState({});l.useEffect((()=>{D?je(D):Z&&je([])}),[D]),l.useEffect((()=>{var e;if(!be&&Z&&(!D||0===je.length)){const t=null===(e=null==pe?void 0:pe.components)||void 0===e?void 0:e[1].cards,l=[];null==t||t.forEach((e=>{var t;null===(t=null==e?void 0:e.components)||void 0===t||t.forEach((e=>{var t,o,a;"HEADER"===e.type&&l.push(null!==(a=null===(o=null===(t=e.example)||void 0===t?void 0:t.header_handle)||void 0===o?void 0:o[0])&&void 0!==a?a:"")}))})),he(l),Ee(!0)}}),[be]);const Be=l.useMemo((()=>c.convertPlaceholdersToBikDropdown(x)),[x]);return l.useEffect((()=>{we(t.cloneDeep(L))}),[L]),e.jsx(n.TemplateModalContext.Provider,Object.assign({value:{hideFooterButton:Ve,setHideFooterButton:De,hideCrossButton:He,setHideCrossButton:Ne,variableList:ye,setVariableList:we,variableCallback:Ce,setVariableCallback:Se,showVariablePicker:le,setShowVariablePicker:oe,template:pe,setTemplate:ve,device:ee,setDevice:te,display_content:ae,setDisplayContent:re,originalVariableList:xe,setOriginalVariableList:Pe,isError:se,setIsError:ie,channel:C,globalNormalizedPlaceholders:Be,templateSelectionTriggered:ge,setTemplateSelectionTriggered:fe,enabledCustomText:w,disableEditVariable:k,pod:H,extras:N,isWhatsappCarousel:X,selectedCarouselIndex:Te,setSelectedCarouselIndex:Le,isProductCarouselType:Z,templateErrorIndexes:ue,cardCount:X?null===(J=null===(G=v.components)||void 0===G?void 0:G[1].cards)||void 0===J?void 0:J.length:void 0,errorIndexes:ne,setErrorIndexes:de,pickerConf:V,carouselProducts:Ie,setCarouselProducts:je,disableEditExpiry:O,cardWidth:q,cardImages:me,onDeleteSelectedProducts:B,hideDeviceContainerInPreview:W,sliderRef:Me,isCarouselHovered:Ae,setIsCarouselHovered:ke,maxCharLimit:R,ctaOptionsErrors:Oe,setCtaOptionsErrors:qe}},{children:P?e.jsx(u.default,{variableListFromProps:L,channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(r.StyledModal,Object.assign({hideCrossButton:He,zIndex:f,centralContainerStyles:{width:X?900:C===s.CHANNEL_TYPE.EMAIL&&h?1e3:800},open:!0,onClose:()=>{null==m||m()},headingTitle:null==pe?void 0:pe.label,headingSubtitle:C===s.CHANNEL_TYPE.WHATSAPP?`${o.default.capitaliseFirstLetterOfString(null!==(K=null==pe?void 0:pe.category)&&void 0!==K?K:"")} • ${null!==(Q=null==pe?void 0:pe.templateCategory)&&void 0!==Q?Q:""}`:"",onBackPress:()=>{null==y||y()},modalHeaderStyles:{borderBottom:`1px solid ${a.COLORS.stroke.primary}`}},{children:[e.jsx(u.default,{variableListFromProps:L,showSampleValues:A,showVariableMapping:h,channel:C,whatsappSpecificPickerMeta:g,showVariableModal:T,discountCode:I,setDiscountCode:j,variableListForImage:M&&(null==M?void 0:M.length)>0?M:ye,fileName:F,setFileName:e=>{null==_||_(e)}}),E?e.jsx(d.default,{isWhatsappCarousel:null!=X&&X,onSelect:function(){var e;if((null==Ie?void 0:Ie.length)<1&&Z)return void ie(!0);if(Object.keys(Oe).length>0&&H!==i.POD.CHATBOT)return void ie(!0);const t=null==E?void 0:E(pe,xe,null!=ae?ae:"",Ie);ce(null!==(e=null==t?void 0:t.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==t?void 0:t.errorIndexes)||(null==t?void 0:t.error)?((null==t?void 0:t.errorIndexes)&&de(t.errorIndexes),(null==t?void 0:t.error)&&ie(!!(null==t?void 0:t.error))):fe(!0)}}):e.jsx(e.Fragment,{})]}))}))};
|
|
@@ -18,9 +18,5 @@ export interface AccordionProps {
|
|
|
18
18
|
headerStyles?: React.CSSProperties;
|
|
19
19
|
onToggleAccordion?: (state: boolean) => void;
|
|
20
20
|
arrowColor?: string;
|
|
21
|
-
isOpen?: boolean;
|
|
22
|
-
buttonLinkText?: string;
|
|
23
|
-
onButtonLinkClick?: () => void;
|
|
24
|
-
captionStyle?: React.CSSProperties;
|
|
25
21
|
}
|
|
26
22
|
export declare const BikAccordion: React.FC<AccordionProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as o,useRef as n,useEffect as t}from"react";import{TitleRegular as i,BodySecondary as a}from"../TypographyStyle.js";import c from"./Accordion.style.js";import l from"./AccordionArrow.js";const s=s=>{var d,h;const[u,v]=o(!1),g=n(null),p=n(null);t((()=>{s.autoOpen&&m(s.autoOpen,{})}),[s.autoOpen]);const m=(e,r)=>{var o,n;p.current&&g.current&&("keydown"===r.type&&"Enter"!==r.key||(v(e),p.current.style.maxHeight?(p.current.style.maxHeight="",g.current.style.transform="rotate(0deg)",g.current.style.transition="transform 0.25s ease-in-out",p.current.style.transition="padding 0s"):(p.current.style.maxHeight=(null!==(o=s.childrenMaxHeight)&&void 0!==o?o:p.current.scrollHeight)+"px",g.current.style.transform="rotate(180deg)",g.current.style.transition="transform 0.25s ease-in-out",p.current.style.transition="max-height 0.25s ease-in-out"),null===(n=s.onToggleAccordion)||void 0===n||n.call(s,e)))};return t((()=>{var e;u&&(null==s?void 0:s.refresh)&&(null===(e=null==p?void 0:p.current)||void 0===e?void 0:e.scrollHeight)&&!s.childrenMaxHeight&&setTimeout((()=>{p.current.style.maxHeight=p.current.scrollHeight+"px"}),100)}),[u,null==s?void 0:s.refresh,null===(d=null==p?void 0:p.current)||void 0===d?void 0:d.scrollHeight]),e(c,Object.assign({className:"accordion",isActive:u,width:null==s?void 0:s.width,contentMargin:null==s?void 0:s.contentMargin,headerPadding:s.headerPadding,skipHoverState:s.skipHoverHeader,showBorders:s.showBorders,backgroundColor:s.backgroundColor,openDirection:s.openDirection},{children:[e("div",Object.assign({className:"accordion__overview "+(u?"active":""),onClick:e=>m(!u,e),onKeyDown:e=>m(!u,e),role:"button",tabIndex:0},{children:[!s.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header",style:null!==(h=s.headerStyles)&&void 0!==h?h:{}},{children:["string"==typeof s.header?r(i,{children:null==s?void 0:s.header}):s.header,r(l,{arrowColor:s.arrowColor,isNewIcon:!0,ref:g})]})),s.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:[e("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[r(l,{arrowColor:s.arrowColor,isNewIcon:!0,ref:g}),"string"==typeof s.header?r(i,{children:null==s?void 0:s.header}):s.header]})),r("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:s.rightActionComponent}))]})),(null==s?void 0:s.caption)&&r("div",Object.assign({className:"accordion__overview__caption"},{children:r(a,{children:s.caption})}))]})),r("div",Object.assign({ref:p,className:"accordion__content"},{children:s.children}))]}))};export{s as BikAccordion};
|
|
@@ -11,4 +11,3 @@ declare const AccordionStyle: import("styled-components").StyledComponent<"div",
|
|
|
11
11
|
openDirection?: AccordionProps['openDirection'];
|
|
12
12
|
}, never>;
|
|
13
13
|
export default AccordionStyle;
|
|
14
|
-
export declare const AccordionHeaderGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -34,8 +34,4 @@ import e from"styled-components";import{COLORS as r}from"../../constants/Theme.j
|
|
|
34
34
|
order: ${e=>"UP"===e.openDirection?-1:0};
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
gap: 24px;
|
|
41
|
-
`;export{i as AccordionHeaderGroup,o as default};
|
|
37
|
+
`;export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/chevronRight.svg.js";import{useRef as l,useState as c,useEffect as n}from"react";import{CheckBox as r}from"../checkBox/CheckBox.js";import{IconButton as s}from"../icon-button/IconButton.js";import{Tag as d}from"../tag/Tag.js";import{Tooltip as a}from"../tooltips/Tooltip.js";import{TitleRegular as u,BodyPrimary as h}from"../TypographyStyle.js";import{EmptyState as p}from"./emptyState.js";import{ProductPickerShimmer as m}from"./ProductPickerShimmer.js";import{CollectionCardStyle as C,CollectionCardInfoStyle as v,CollectionCardDetailStyle as g,CollectionNameHolder as y}from"./style.js";import{isCollectionPartiallyChecked as f}from"./utility.js";const b=(e,t,o)=>{if(!e)return"";if(e.length<=t)return e;const i=e.slice(0,t-1);return(o?i.slice(0,i.lastIndexOf(" ")):i)+"..."},k=o=>{var i;const{customCollectionRestriction:r,dataLoading:s,collections:d,selectedCollectionsDispatch:a,setCollectionId:u,setSelectedCollectionId:h,selectedCollections:C,setScreen:v,collectionFetcher:g,collectionsDispatch:y,pagingControls:b,storeId:k,setSaveDisabled:O,hideCollectionCheckbox:I,renderWithoutModal:S,pickerType:P,scrollContainerRef:T}=o,x=l(b.curPage),D=!!r&&(null==C?void 0:C.isCustom),[L,R]=c(!1),E=l(!1),w=l(!1),B=()=>{if(!T||!(null==T?void 0:T.current))return;const{scrollTop:e,clientHeight:t,scrollHeight:o}=T.current;e+t>=o-20&&!E.current&&!w.current&&(O(!0),R(!0),w.current=!0,O(!0),R(!0),g(x.current,k).then((e=>{y({type:"paged",data:(null==e?void 0:e.collections)||{}}),b.setCurPage(x.current+1),R(!1),O(!1),w.current=!1,Object.keys(null==e?void 0:e.collections).length||(E.current=!0)})).catch())};return n((()=>{var e;return null===(e=null==T?void 0:T.current)||void 0===e||e.addEventListener("scroll",B),()=>{var e;null===(e=null==T?void 0:T.current)||void 0===e||e.removeEventListener("scroll",B)}}),[]),n((()=>{x.current=b.curPage}),[b.curPage]),e("div",{children:[(null===(i=Object.keys(null!=d?d:{}))||void 0===i?void 0:i.length)?Object.keys(d).map((e=>{var o,i;const l=!!(null==C?void 0:C[e])&&("PRODUCT"!==P||!!Object.keys(null!==(i=null===(o=null==C?void 0:C[e])||void 0===o?void 0:o.products)&&void 0!==i?i:{}).length);return t(j,{customCollectionRestriction:r,data:d[e],isDisabled:D&&!(null==C?void 0:C[e]),isChecked:l,isPartiallyChecked:f(e,null==d?void 0:d[e],C),selectedCollectionsDispatch:a,setCollectionId:u,setSelectedCollectionId:h,setScreen:v,id:e,hideCollectionCheckbox:I||"-1"===e,selectedCollections:C,renderWithoutModal:S,pickerType:P},e)})):s?t(m,{}):t(p,{title:"No collections to show",subtitle:"We couldn’t find any collection."}),L&&t(m,{})]})},j=l=>{const{customCollectionRestriction:c,data:n,selectedCollectionsDispatch:p,setCollectionId:m,setSelectedCollectionId:f,isPartiallyChecked:b,setScreen:k,id:j,isChecked:O,isDisabled:I,hideCollectionCheckbox:S,pickerType:P,usedInSearch:T}=l;return e(C,Object.assign({isDisabled:I,onClick:e=>{if(!I){if("COLLECTION"===P)return e.stopPropagation(),p({type:"reset",data:{}}),p({type:"selected",data:{id:j,val:n,isRestricted:c}}),m(j),void f(j);m(j),f(j),k("products")}},isActive:O,usedInSearch:null!=T&&T},{children:[e(v,{children:[!S&&t(r,{isDisabled:I,isChecked:O,isPartiallyChecked:b,onValueChange:function(e,t,o){null==o||o.stopPropagation(),p(e?{type:"selected",data:{id:j,val:n,isRestricted:c}}:{type:"unselected",data:{id:j}}),f(e?j:"")}}),t(g,{children:t(a,Object.assign({body:n.name,placement:"bottom",delay:400,variant:"light"},{children:e(y,{children:[t(T?h:u,Object.assign({numberOfLines:1},{children:n.name})),n.isSmartCollection?t("div",Object.assign({style:{display:"flex"}},{children:t(d,{tagText:"Smart Collection",type:"warning"})})):t(o,{})]})}))})]}),"COLLECTION"!==P&&t(s,{height:12,width:12,disabled:I,Icon:i})]}))};export{j as CollectionCard,k as CollectionsScreen,b as truncate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as r,useCallback as s}from"react";import{DEFAULT_THEME as n}from"../../constants/Theme.js";import{BodyCaption as l}from"../TypographyStyle.js";import{TabHeader as a,EmptyTab as i,RightComponent as c,TabItem as d,TabItemText as b,TrailingNumberContainer as m}from"./Tabs.styles.js";const p=s=>{var l,d;const{tabs:b,initialTab:m,onTabSelected:p,TabItemStyledProps:g,selectedTab:x,extendedBorder:y,rightComponent:T,size:C="default",isSquared:S=!1,containerStyles:h}=s,[j,f]=o(m||b[0].key),{colorsV2:q}=n;r((()=>{x&&
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as r,useCallback as s}from"react";import{DEFAULT_THEME as n}from"../../constants/Theme.js";import{BodyCaption as l}from"../TypographyStyle.js";import{TabHeader as a,EmptyTab as i,RightComponent as c,TabItem as d,TabItemText as b,TrailingNumberContainer as m}from"./Tabs.styles.js";const p=s=>{var l,d;const{tabs:b,initialTab:m,onTabSelected:p,TabItemStyledProps:g,selectedTab:x,extendedBorder:y,rightComponent:T,size:C="default",isSquared:S=!1,containerStyles:h}=s,[j,f]=o(m||b[0].key),{colorsV2:q}=n;r((()=>{x&&f(x)}),[x]);const k=s.backgroundColor,I=null!==(l=s.selectedTextColor)&&void 0!==l?l:q.background.brand,O=null!==(d=s.textColor)&&void 0!==d?d:q.content.secondary;return e(a,Object.assign({style:null!=h?h:{},bgColor:k},{children:[b.map(((e,o)=>t(u,{hasEqualSpacing:s.hasEqualSpacing,selectedTextColor:I,textColor:O,tab:e,currentTab:j,TabItemStyledProps:g,IconComponent:e.icon,size:C,setCurrentTab:e=>{p(e),f(e)},isSquared:S,isFirstlement:0==o,isLastElement:o==b.length-1},e.key))),y&&t(i,{}),t(c,{children:T})]}))},u=o=>{const{tab:r,currentTab:a,setCurrentTab:i,TabItemStyledProps:c,IconComponent:p,size:u="default",isSquared:g=!1,isFirstlement:x,isLastElement:y}=o,T=r.key===a,{colorsV2:C}=n,S=s((()=>Object.assign(Object.assign({},c),{borderRadius:o.isSquared?x?"4px 0px 0px 4px":y?"0px 4px 4px 0px":"":""})),[]);return e(d,Object.assign({style:S(),selected:T,hasEqualSpacing:o.hasEqualSpacing,onClick:()=>i(o.tab.key),selectedTextColor:o.selectedTextColor,isSquared:g},{children:[p&&t(p,{selected:T?C.background.brand:C.content.secondary}),t(b,Object.assign({style:"small"===u?{fontSize:14,fontStyle:"normal",fontWeight:600}:void 0,textColor:o.textColor,selectedTextColor:o.selectedTextColor,selected:T},{children:r.title})),void 0!==r.trailingNumber&&null!==r.trailingNumber&&t(m,Object.assign({selected:T},{children:t(l,Object.assign({color:C.content.primaryInverse},{children:r.trailingNumber}))}))]}))};p.displayName="Tabs",u.displayName="TabItemComponent";export{u as TabItemComponent,p as Tabs};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TagProps } from './model';
|
|
2
2
|
export declare const Tag: {
|
|
3
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor,
|
|
3
|
+
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import n from"react";import{AiBodyTiny as r,AiBodyCaption as t,BodyTiny as a,BodyCaption as c}from"../TypographyStyle.js";import{ValidTagTypeMap as s}from"./model.js";import{Tag as o}from"./Tag.styled.js";import{getTagIconColor as l}from"./themes.js";const
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import n from"react";import{AiBodyTiny as r,AiBodyCaption as t,BodyTiny as a,BodyCaption as c}from"../TypographyStyle.js";import{ValidTagTypeMap as s}from"./model.js";import{Tag as o}from"./Tag.styled.js";import{getTagIconColor as l}from"./themes.js";const d=d=>{let{tagText:g,LeadingIcon:m,TrailingIcon:p,onLeadingIconClicked:h,leadingIconId:j,trailingIconId:b,onTrailingIconClicked:u,theme:y="light",type:O="neutral",variant:I="regular",version:f,cursor:T}=d,k=g;const v=y;let w=O;s[I][O]||(w="neutral"),"circle"===I&&"number"==typeof k&&k>99&&(k="99+");const N={height:"compressed"===I?11:16,width:"compressed"===I?11:16,color:l(y,w),style:{display:"block"}};return e(o,Object.assign({cursor:T,theme:v,type:O,variant:I,version:f},{children:i("div",Object.assign({className:"container"},{children:[m&&e("button",Object.assign({className:"icon-leading",onClick:h,id:`${j}-wrapper`||"leading-icon-wrapper"},{children:n.createElement(m,Object.assign(Object.assign({},N),{id:j||"leading-icon"}))})),""!==k&&("ai"===O&&"light"===y?e("compressed"===I?r:t,{children:k}):e("compressed"===I?a:c,Object.assign({className:"text"},{children:k}))),p&&e("button",Object.assign({className:"icon-trailing",onClick:u,id:`${b}-wrapper`||"trailing-icon-wrapper"},{children:n.createElement(p,Object.assign(Object.assign({},N),{id:b||"trailing-icon"}))}))]}))}))};d.displayName="Tag";export{d as Tag};
|
|
@@ -9,5 +9,4 @@ export declare const Tag: import("@emotion/styled").StyledComponent<{
|
|
|
9
9
|
variant: TagVariant;
|
|
10
10
|
version?: "1.0" | "2.0" | undefined;
|
|
11
11
|
cursor?: string | undefined;
|
|
12
|
-
alignIcon?: string | undefined;
|
|
13
12
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import c from"@emotion/styled/base";import{getPadding as l,getBackgroundColor as b,generateBorder as d,getTextColor as
|
|
1
|
+
import c from"@emotion/styled/base";import{getPadding as l,getBackgroundColor as b,generateBorder as d,getTextColor as t}from"./themes.js";const e=c("div","production"===process.env.NODE_ENV?{target:"e930jd90"}:{target:"e930jd90",label:"Tag"})("cursor:",(c=>{var l;return null!==(l=c.cursor)&&void 0!==l?l:"default"}),";",(c=>"regular"===c.variant?"display: block;\n\t\t min-height: 26px;\n\t\t":"min-height: 20px;")," .container{display:flex;align-items:center;gap:6px;padding:",(c=>l(c.variant)),";background:",(c=>b(c.theme,c.type)),";border-radius:",(c=>"regular"===c.variant?"4px":"12px"),";",(c=>"light"===c.theme&&`border: ${"2.0"===c.version?.5:1}px solid ${d(c.type,c.theme)};`)," .text{color:",(c=>t(c.theme,c.type)),";}.icon-trailing{all:unset;display:flex;}.icon-leading{all:unset;display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhZy5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJUYWcuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgZ2VuZXJhdGVCb3JkZXIsIGdldEJhY2tncm91bmRDb2xvciwgZ2V0UGFkZGluZywgZ2V0VGV4dENvbG9yLCB9IGZyb20gJy4vdGhlbWVzJztcclxuZXhwb3J0IGNvbnN0IFRhZyA9IHN0eWxlZC5kaXYgYFxuXHRjdXJzb3I6ICR7KHByb3BzKSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHByb3BzLmN1cnNvcikgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogJ2RlZmF1bHQnOyB9fTtcblx0JHsocHJvcHMpID0+IHByb3BzLnZhcmlhbnQgPT09ICdyZWd1bGFyJ1xyXG4gICAgPyBgZGlzcGxheTogYmxvY2s7XG5cdFx0ICAgICBtaW4taGVpZ2h0OiAyNnB4O1xuXHRcdGBcclxuICAgIDogYG1pbi1oZWlnaHQ6IDIwcHg7YH1cblx0LmNvbnRhaW5lciB7XG5cdFx0ZGlzcGxheTogZmxleDtcblx0XHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRcdGdhcDogNnB4O1xuXHRcdHBhZGRpbmc6ICR7KHByb3BzKSA9PiBnZXRQYWRkaW5nKHByb3BzLnZhcmlhbnQpfTtcblxuXHRcdGJhY2tncm91bmQ6ICR7KHByb3BzKSA9PiBnZXRCYWNrZ3JvdW5kQ29sb3IocHJvcHMudGhlbWUsIHByb3BzLnR5cGUpfTtcblxuXHRcdGJvcmRlci1yYWRpdXM6ICR7KHByb3BzKSA9PiAocHJvcHMudmFyaWFudCA9PT0gJ3JlZ3VsYXInID8gJzRweCcgOiAnMTJweCcpfTtcblxuXHRcdCR7KHByb3BzKSA9PiBwcm9wcy50aGVtZSA9PT0gJ2xpZ2h0JyAmJlxyXG4gICAgYGJvcmRlcjogJHtwcm9wcy52ZXJzaW9uID09PSAnMi4wJyA/IDAuNSA6IDF9cHggc29saWQgJHtnZW5lcmF0ZUJvcmRlcihwcm9wcy50eXBlLCBwcm9wcy50aGVtZSl9O2B9XG5cblx0XHQudGV4dCB7XG5cdFx0XHRjb2xvcjogJHsocHJvcHMpID0+IGdldFRleHRDb2xvcihwcm9wcy50aGVtZSwgcHJvcHMudHlwZSl9O1xuXHRcdH1cblxuXHRcdC5pY29uLXRyYWlsaW5nIHtcblx0XHRcdGFsbDogdW5zZXQ7XG5cdFx0XHRkaXNwbGF5OiBmbGV4O1xuXHRcdH1cblxuXHRcdC5pY29uLWxlYWRpbmcge1xuXHRcdFx0YWxsOiB1bnNldDtcblx0XHRcdGRpc3BsYXk6IGZsZXg7XG5cdFx0fVxuXHR9XG5gO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1UYWcuc3R5bGVkLmpzLm1hcCJdfQ== */"));export{e as Tag};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as l}from"react/jsx-runtime";import{cloneDeep as t}from"lodash";import{useEffect as r,useState as i,useRef as a,useMemo as s}from"react";import n from"../../utils/StringUtils.js";import{COLORS as d}from"../../constants/Theme.js";import{StyledModal as u}from"../modals/styledModal.js";import{CHANNEL_TYPE as c}from"../template-preview/models/Channels.js";import{TemplateModalContext as m}from"./context/templateModalContext.js";import
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as l}from"react/jsx-runtime";import{cloneDeep as t}from"lodash";import{useEffect as r,useState as i,useRef as a,useMemo as s}from"react";import n from"../../utils/StringUtils.js";import{COLORS as d}from"../../constants/Theme.js";import{StyledModal as u}from"../modals/styledModal.js";import{CHANNEL_TYPE as c}from"../template-preview/models/Channels.js";import{POD as p}from"../template-preview/models/WhatsAppTemplate.js";import{TemplateModalContext as m}from"./context/templateModalContext.js";import v from"./modalElements/Footer.js";import h from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as b}from"./utils/convertPlaceholdersToBikDropdown.js";const C=C=>{let{selectedTemplate:g,closeDialog:f,showVariableMapping:x,channel:P,htmlContent:E,templateVariables:I,onTemplateSelect:S,globalPlaceholders:T,showOnlyContent:y,whatsappSpecificPickerMeta:w,zIndex:L,showVariableModal:V,variableList:k,discountCode:j,setDiscountCode:M,onBackPress:A,enabledCustomText:D,variableListForImage:B,showSampleValues:F,disableEditVariable:H,pod:O,extras:W,pickerConf:N,selectedCarouselProducts:z,disableEditExpiry:R,cardWidth:$,onDeleteSelectedProducts:U,fileName:_,setFileName:q,hideDeviceContainerInPreview:G,maxCharLimit:J}=C;var K,Q,X,Y,Z,ee,oe,le;r((()=>{ue(E)}),[E]);const te=P===c.WHATSAPP&&"CAROUSEL"===(null===(Q=null===(K=null==g?void 0:g.components)||void 0===K?void 0:K[1])||void 0===Q?void 0:Q.type),re=null==g?void 0:g.isProductCarouselType,[ie,ae]=i(P===c.EMAIL||te?"desktop":"mobile"),[se,ne]=i(!1),[de,ue]=i(E),[ce,pe]=i(!1),[me,ve]=i([]),[he,be]=i({}),[Ce,ge]=i(g),[fe,xe]=i([]),[Pe,Ee]=i(null),[Ie,Se]=i(!1),[Te,ye]=i(null!=I?I:[]),[we,Le]=i(!1),[Ve,ke]=i(te?(null===(Y=null===(X=null==Ce?void 0:Ce.mapping)||void 0===X?void 0:X.body)||void 0===Y?void 0:Y.length)?-1:0:-1),[je,Me]=i([]),[Ae,De]=i(void 0),Be=a(null),[Fe,He]=i(!1),[Oe,We]=i(!1),[Ne,ze]=i(!1),[Re,$e]=i({});r((()=>{z?Me(z):re&&Me([])}),[z]),r((()=>{var e;if(!Ie&&re&&(!z||0===Me.length)){const o=null===(e=null==Ce?void 0:Ce.components)||void 0===e?void 0:e[1].cards,l=[];null==o||o.forEach((e=>{var o;null===(o=null==e?void 0:e.components)||void 0===o||o.forEach((e=>{var o,t,r;"HEADER"===e.type&&l.push(null!==(r=null===(t=null===(o=e.example)||void 0===o?void 0:o.header_handle)||void 0===t?void 0:t[0])&&void 0!==r?r:"")}))})),xe(l),Se(!0)}}),[Ie]);const Ue=s((()=>b(T)),[T]);return r((()=>{De(t(k))}),[k]),e(m.Provider,Object.assign({value:{hideFooterButton:Ne,setHideFooterButton:ze,hideCrossButton:Oe,setHideCrossButton:We,variableList:Ae,setVariableList:De,variableCallback:Pe,setVariableCallback:Ee,showVariablePicker:se,setShowVariablePicker:ne,template:Ce,setTemplate:ge,device:ie,setDevice:ae,display_content:de,setDisplayContent:ue,originalVariableList:Te,setOriginalVariableList:ye,isError:ce,setIsError:pe,channel:P,globalNormalizedPlaceholders:Ue,templateSelectionTriggered:we,setTemplateSelectionTriggered:Le,enabledCustomText:D,disableEditVariable:H,pod:O,extras:W,isWhatsappCarousel:te,selectedCarouselIndex:Ve,setSelectedCarouselIndex:ke,isProductCarouselType:re,templateErrorIndexes:he,cardCount:te?null===(ee=null===(Z=g.components)||void 0===Z?void 0:Z[1].cards)||void 0===ee?void 0:ee.length:void 0,errorIndexes:me,setErrorIndexes:ve,pickerConf:N,carouselProducts:je,setCarouselProducts:Me,disableEditExpiry:R,cardWidth:$,cardImages:fe,onDeleteSelectedProducts:U,hideDeviceContainerInPreview:G,sliderRef:Be,isCarouselHovered:Fe,setIsCarouselHovered:He,maxCharLimit:J,ctaOptionsErrors:Re,setCtaOptionsErrors:$e}},{children:y?e(h,{variableListFromProps:k,channel:c.EMAIL,hideHeader:!0}):o(u,Object.assign({hideCrossButton:Oe,zIndex:L,centralContainerStyles:{width:te?900:P===c.EMAIL&&x?1e3:800},open:!0,onClose:()=>{null==f||f()},headingTitle:null==Ce?void 0:Ce.label,headingSubtitle:P===c.WHATSAPP?`${n.capitaliseFirstLetterOfString(null!==(oe=null==Ce?void 0:Ce.category)&&void 0!==oe?oe:"")} • ${null!==(le=null==Ce?void 0:Ce.templateCategory)&&void 0!==le?le:""}`:"",onBackPress:()=>{null==A||A()},modalHeaderStyles:{borderBottom:`1px solid ${d.stroke.primary}`}},{children:[e(h,{variableListFromProps:k,showSampleValues:F,showVariableMapping:x,channel:P,whatsappSpecificPickerMeta:w,showVariableModal:V,discountCode:j,setDiscountCode:M,variableListForImage:B&&(null==B?void 0:B.length)>0?B:Ae,fileName:_,setFileName:e=>{null==q||q(e)}}),S?e(v,{isWhatsappCarousel:null!=te&&te,onSelect:function(){var e;if((null==je?void 0:je.length)<1&&re)return void pe(!0);if(Object.keys(Re).length>0&&O!==p.CHATBOT)return void pe(!0);const o=null==S?void 0:S(Ce,Te,null!=de?de:"",je);be(null!==(e=null==o?void 0:o.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==o?void 0:o.errorIndexes)||(null==o?void 0:o.error)?((null==o?void 0:o.errorIndexes)&&ve(o.errorIndexes),(null==o?void 0:o.error)&&pe(!!(null==o?void 0:o.error))):Le(!0)}}):e(l,{})]}))}))};export{C as TemplateContextMapper};
|