@bikdotai/bik-component-library 0.0.664-beta.0 → 0.0.664-beta.10

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.
@@ -0,0 +1 @@
1
+ "use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r,c,a=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(e[c]=r[c])}return e},n.apply(this,arguments)}var l=e=>a.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 54 54"},e),t||(t=a.createElement("path",{fill:"url(#bik_livechat_svg__a)",d:"M53.368 27a26.368 26.368 0 0 1-39.571 22.827l-10.27 3.425a2.198 2.198 0 0 1-2.78-2.78l3.425-10.27A26.369 26.369 0 1 1 53.368 27Z"})),r||(r=a.createElement("path",{fill:"#fff",d:"M36.983 32.943c-.31 0-.553-.08-.725-.241-.161-.173-.242-.415-.242-.725V21.739c0-.31.08-.546.242-.707.172-.173.414-.26.725-.26h6.301c.242 0 .426.064.552.19.127.116.19.288.19.518 0 .242-.063.426-.19.553-.126.127-.31.19-.552.19h-5.541v3.815h5.161c.253 0 .438.063.553.19.126.127.19.305.19.535 0 .242-.064.426-.19.552-.115.116-.3.173-.553.173h-5.162v4.005h5.542c.242 0 .426.064.552.19.127.127.19.305.19.535 0 .242-.063.426-.19.553-.126.115-.31.172-.552.172h-6.301ZM28.555 33.064c-.253 0-.466-.057-.639-.172a1.37 1.37 0 0 1-.397-.553l-4.644-10.513c-.092-.242-.115-.45-.069-.622a.664.664 0 0 1 .276-.397.917.917 0 0 1 .535-.155c.265 0 .467.057.605.172.138.115.253.288.345.518l4.35 10.082h-.638l4.315-10.099c.104-.219.225-.386.363-.5.15-.116.351-.173.604-.173.207 0 .374.052.5.155a.597.597 0 0 1 .26.397c.034.173 0 .38-.104.622l-4.626 10.513a1.37 1.37 0 0 1-.397.553c-.162.115-.374.172-.64.172ZM20.206 33.064c-.287 0-.512-.08-.673-.242-.15-.16-.224-.385-.224-.673V21.567c0-.3.075-.524.224-.674.161-.16.386-.241.673-.241.288 0 .507.08.657.241.16.15.241.374.241.674v10.582c0 .288-.075.512-.224.673-.15.162-.374.242-.674.242ZM10.699 32.943c-.288 0-.512-.08-.674-.241-.16-.161-.241-.386-.241-.674v-10.41c0-.299.074-.523.224-.673.161-.16.386-.241.673-.241.288 0 .507.08.656.241.162.15.242.374.242.674v9.788h5.352c.253 0 .449.069.587.207.138.127.207.31.207.552 0 .242-.07.432-.207.57-.138.138-.334.207-.587.207h-6.232Z"})),c||(c=a.createElement("defs",null,a.createElement("linearGradient",{id:"bik_livechat_svg__a",x1:27,x2:27,y1:.637,y2:53.371,gradientUnits:"userSpaceOnUse"},a.createElement("stop",{stopColor:"#B143FF"}),a.createElement("stop",{offset:1,stopColor:"#6532FF"})))));exports.default=l;
@@ -14,5 +14,8 @@ export type AlertProps = {
14
14
  redirectTo?: string;
15
15
  redirectToText?: string;
16
16
  iconStyle?: React.CSSProperties;
17
+ handleRedirectButtonClick?: () => void;
18
+ showCrossButton?: boolean;
19
+ handleCrossIconClick?: () => void;
17
20
  };
18
21
  export declare const Alert: React.FC<AlertProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("./Alert.styled.js"),i=require("./AlertHelper.js"),r=require("../TypographyStyle.js"),o=require("../../constants/Theme.js");exports.Alert=l=>{var n,s;return e.jsxs(t.AlertStyle,Object.assign({type:l.type,contentPosition:l.contentPosition,style:l.containerStyle},{children:[l.icon&&e.jsx("div",Object.assign({style:Object.assign(Object.assign({},null==l?void 0:l.iconStyle),{display:(null===(n=null==l?void 0:l.iconStyle)||void 0===n?void 0:n.display)||"flex",alignSelf:(null===(s=null==l?void 0:l.iconStyle)||void 0===s?void 0:s.alignSelf)||"flex-start"})},{children:e.jsx(l.icon,{color:i.COLOR_CONFIG_MAP[l.type].textColor,height:16,width:16})})),e.jsx(r.BodyCaption,Object.assign({style:{color:l.textColor||i.COLOR_CONFIG_MAP[l.type].textColor,marginLeft:8,marginRight:4}},{children:l.text})),l.redirectToText&&l.redirectTo&&e.jsx(r.BodyCaption,Object.assign({style:{color:o.COLORS.text.brand,cursor:"pointer",textDecoration:"underline"},onClick:()=>{l.redirectTo&&window.open(l.redirectTo,"_blank")}},{children:l.redirectToText}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/cross.svg.js"),r=require("./Alert.styled.js"),o=require("./AlertHelper.js"),i=require("../TypographyStyle.js"),n=require("../../constants/Theme.js");exports.Alert=l=>{var s,c;return e.jsxs(r.AlertStyle,Object.assign({type:l.type,contentPosition:l.contentPosition,style:l.containerStyle},{children:[e.jsxs(r.AlertContentWrapper,{children:[l.icon&&e.jsx("div",Object.assign({style:Object.assign(Object.assign({},null==l?void 0:l.iconStyle),{display:(null===(s=null==l?void 0:l.iconStyle)||void 0===s?void 0:s.display)||"flex",alignSelf:(null===(c=null==l?void 0:l.iconStyle)||void 0===c?void 0:c.alignSelf)||"flex-start"})},{children:e.jsx(l.icon,{color:o.COLOR_CONFIG_MAP[l.type].textColor,height:16,width:16})})),e.jsx(i.BodyCaption,Object.assign({style:{color:l.textColor||o.COLOR_CONFIG_MAP[l.type].textColor,marginLeft:8,marginRight:4}},{children:l.text})),l.redirectToText&&l.redirectTo&&e.jsx(i.BodyCaption,Object.assign({style:{color:n.COLORS.text.brand,cursor:"pointer",textDecoration:"underline"},onClick:()=>{"INTERNAL"===l.redirectTo&&l.handleRedirectButtonClick?l.handleRedirectButtonClick():l.redirectTo&&window.open(l.redirectTo,"_blank")}},{children:l.redirectToText}))]}),l.showCrossButton&&e.jsx(r.CloseIconWrapper,{children:e.jsx(t.default,{width:20,height:20,color:n.COLORS.content.secondary,onClick:()=>{(null==l?void 0:l.handleCrossIconClick)&&l.handleCrossIconClick()}})})]}))};
@@ -3,3 +3,5 @@ export declare const AlertStyle: import("styled-components").StyledComponent<"di
3
3
  type: ALERT_TYPES;
4
4
  contentPosition?: CONTENT_POSITION | undefined;
5
5
  }, never>;
6
+ export declare const AlertContentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const CloseIconWrapper: 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"),t=require("./AlertHelper.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const o=r(e).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("./AlertHelper.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e);const l=o.default.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: ${e=>e.contentPosition||t.CONTENT_POSITION.CENTER};
@@ -6,4 +6,12 @@
6
6
  background-color: ${e=>t.COLOR_CONFIG_MAP[e.type].backgroundColor};
7
7
  border-radius: 4px;
8
8
  border: 1px solid ${e=>t.COLOR_CONFIG_MAP[e.type].borderColor};
9
- `;exports.AlertStyle=o;
9
+ `,n=o.default.div`
10
+ flex: 1;
11
+ display: flex;
12
+ justify-content: center;
13
+ `,i=o.default.div`
14
+ margin-left: 16px;
15
+ display: flex;
16
+ align-items: center;
17
+ `;exports.AlertContentWrapper=n,exports.AlertStyle=l,exports.CloseIconWrapper=i;
@@ -8,7 +8,8 @@ export declare enum ALERT_TYPES {
8
8
  export declare enum CONTENT_POSITION {
9
9
  START = "start",
10
10
  CENTER = "center",
11
- END = "end"
11
+ END = "end",
12
+ SPACE_BETWEEN = "space-between"
12
13
  }
13
14
  export declare const COLOR_CONFIG_MAP: {
14
15
  Negative: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o,r,t=require("../../constants/Theme.js");exports.ALERT_TYPES=void 0,(o=exports.ALERT_TYPES||(exports.ALERT_TYPES={})).NEGATIVE="Negative",o.WARNING="Warning",o.POSITIVE="Positive",o.NEUTRAL="Neutral",o.BRAND="Brand",exports.CONTENT_POSITION=void 0,(r=exports.CONTENT_POSITION||(exports.CONTENT_POSITION={})).START="start",r.CENTER="center",r.END="end";const e={[exports.ALERT_TYPES.NEGATIVE]:{backgroundColor:t.COLORS.background.negative.light,textColor:t.COLORS.content.negative,borderColor:t.COLORS.stroke.negative.lightAlt},[exports.ALERT_TYPES.WARNING]:{backgroundColor:t.COLORS.background.warning.light,textColor:t.COLORS.content.warning,borderColor:t.COLORS.stroke.warning.lightAlt},[exports.ALERT_TYPES.POSITIVE]:{backgroundColor:t.COLORS.background.positive.light,textColor:t.COLORS.content.positive,borderColor:t.COLORS.stroke.positive.lightAlt},[exports.ALERT_TYPES.NEUTRAL]:{backgroundColor:t.COLORS.surface.subdued,textColor:t.COLORS.content.secondary,borderColor:t.COLORS.stroke.primary},[exports.ALERT_TYPES.BRAND]:{backgroundColor:t.COLORS.background.brandLight,textColor:t.COLORS.content.brand,borderColor:t.COLORS.stroke.brandLightAlt}};exports.COLOR_CONFIG_MAP=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o,r,t=require("../../constants/Theme.js");exports.ALERT_TYPES=void 0,(o=exports.ALERT_TYPES||(exports.ALERT_TYPES={})).NEGATIVE="Negative",o.WARNING="Warning",o.POSITIVE="Positive",o.NEUTRAL="Neutral",o.BRAND="Brand",exports.CONTENT_POSITION=void 0,(r=exports.CONTENT_POSITION||(exports.CONTENT_POSITION={})).START="start",r.CENTER="center",r.END="end",r.SPACE_BETWEEN="space-between";const e={[exports.ALERT_TYPES.NEGATIVE]:{backgroundColor:t.COLORS.background.negative.light,textColor:t.COLORS.content.negative,borderColor:t.COLORS.stroke.negative.lightAlt},[exports.ALERT_TYPES.WARNING]:{backgroundColor:t.COLORS.background.warning.light,textColor:t.COLORS.content.warning,borderColor:t.COLORS.stroke.warning.lightAlt},[exports.ALERT_TYPES.POSITIVE]:{backgroundColor:t.COLORS.background.positive.light,textColor:t.COLORS.content.positive,borderColor:t.COLORS.stroke.positive.lightAlt},[exports.ALERT_TYPES.NEUTRAL]:{backgroundColor:t.COLORS.surface.subdued,textColor:t.COLORS.content.secondary,borderColor:t.COLORS.stroke.primary},[exports.ALERT_TYPES.BRAND]:{backgroundColor:t.COLORS.background.brandLight,textColor:t.COLORS.content.brand,borderColor:t.COLORS.stroke.brandLightAlt}};exports.COLOR_CONFIG_MAP=e;
@@ -28,6 +28,7 @@ export type AvatarProps = {
28
28
  isSelected: boolean;
29
29
  isComments: boolean;
30
30
  };
31
+ status?: 'ONLINE' | 'OFFLINE' | 'AWAY';
31
32
  };
32
33
  export declare const enum MESSAGE_CHANNELS {
33
34
  INSTAGRAM = "instagram",
@@ -41,6 +42,7 @@ export declare const enum MESSAGE_CHANNELS {
41
42
  EMAIL = "email",
42
43
  SMTP = "smtp",
43
44
  FACEBOOK_CATALOG = "facebook-catalog",
44
- TASKS = "tasks"
45
+ TASKS = "tasks",
46
+ BIK_LIVECHAT = "livechat"
45
47
  }
46
48
  export declare const Avatar: React.FC<AvatarProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("./Avatar.styled.js"),i=require("./AvatarHelper.js"),r=require("../TypographyStyle.js"),a=require("../../constants/Theme.js"),A=require("../../assets/icons/CheckSquareOffset.svg.js"),o=require("../../assets/icons/email-channel.svg.js"),n=require("../../assets/icons/facebook_channel.svg.js"),S=require("../../assets/icons/gmail.svg.js"),c=require("../../assets/icons/instagram-channel.svg.js"),E=require("../../assets/icons/whatsapp_color.svg.js");const l={[i.SIZE.SMALL]:16,[i.SIZE.MEDIUM]:20,[i.SIZE.INBOX]:24,[i.SIZE.LARGE]:32},d={[i.AVATAR_BACKGROUND.LIGHT]:a.COLORS.content.secondary,[i.AVATAR_BACKGROUND.DARK]:a.COLORS.surface.standard};var u;exports.MESSAGE_CHANNELS=void 0,(u=exports.MESSAGE_CHANNELS||(exports.MESSAGE_CHANNELS={})).INSTAGRAM="instagram",u.MESSENGER="messenger",u.WHATSAPP="whatsapp",u.GMAIL="gmail",u.LIVECHAT="livechat",u.GOOGLE_BUSINESS_CHAT="gbm",u.SHOPIFY="shopify",u.FACEBOOK="facebook",u.EMAIL="email",u.SMTP="smtp",u.FACEBOOK_CATALOG="facebook-catalog",u.TASKS="tasks";exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=l,exports.Avatar=u=>{const[h,p]=s.useState(!1),g=()=>{const s=(u.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return u.size===i.SIZE.SMALL?e.jsx(r.BodyTiny,Object.assign({style:{color:d[u.background]}},{children:s})):u.size===i.SIZE.MEDIUM||u.size===i.SIZE.INBOX?e.jsx(r.TitleSmall,Object.assign({style:{color:d[u.background]}},{children:s})):u.size===i.SIZE.LARGE?e.jsx(r.TitleMedium,Object.assign({style:{color:d[u.background]}},{children:s})):void 0};return e.jsxs("div",Object.assign({style:{position:"relative"}},{children:[e.jsxs(t.AvatarStyle,Object.assign({type:u.type===i.AVATAR_TYPES.IMAGE&&h&&u.useNameFallback&&u.name?i.AVATAR_TYPES.INITIALS:u.type,size:u.size,background:u.background},{children:[u.type===i.AVATAR_TYPES.IMAGE&&(u.useNameFallback&&!h?e.jsx("img",{alt:"",width:i.AVATAR_SIZE_MAP[u.size],height:i.AVATAR_SIZE_MAP[u.size],style:{borderRadius:(null==u?void 0:u.borderRadius)||"50%",objectFit:"contain"},src:u.photoUrl,onError:()=>{p(!0)}}):u.useNameFallback&&h&&u.name?e.jsx("div",{children:g()}):e.jsx("img",{alt:"",width:i.AVATAR_SIZE_MAP[u.size],height:i.AVATAR_SIZE_MAP[u.size],style:{borderRadius:(null==u?void 0:u.borderRadius)||"50%",objectFit:"contain"},src:u.photoUrl})),u.type===i.AVATAR_TYPES.INITIALS&&e.jsx("div",{children:g()}),u.type===i.AVATAR_TYPES.ICON&&u.icon&&e.jsx(u.icon,{width:l[u.size],height:l[u.size],color:d[u.background]})]})),u.inboxSettings&&e.jsx("div",Object.assign({style:{position:"absolute",left:"20px",top:"20px",width:14,height:14,borderRadius:(null==u?void 0:u.borderRadius)||"50%",display:"flex",justifyContent:"center",backgroundColor:u.inboxSettings.isSelected?u.inboxSettings.isComments?a.COLORS.content.primary:a.COLORS.background.brandLight:u.inboxSettings.isComments?a.COLORS.content.primary:a.COLORS.surface.standard,alignItems:"center"}},{children:(()=>{switch(u.channelName){case exports.MESSAGE_CHANNELS.EMAIL:case exports.MESSAGE_CHANNELS.SMTP:return e.jsx(o.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.FACEBOOK:case exports.MESSAGE_CHANNELS.FACEBOOK_CATALOG:case exports.MESSAGE_CHANNELS.MESSENGER:return e.jsx(n.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.INSTAGRAM:return e.jsx(c.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.WHATSAPP:return e.jsx(E.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.GMAIL:return e.jsx(S.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.TASKS:return e.jsx(A.default,{width:11,height:11})}})()}))]}))},exports.BACKGROUND_VS_TEXT_COLOR_MAP=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("./Avatar.styled.js"),i=require("./AvatarHelper.js"),r=require("../TypographyStyle.js"),a=require("../../constants/Theme.js"),o=require("../../assets/icons/bik_livechat.svg.js"),n=require("../../assets/icons/CheckSquareOffset.svg.js"),A=require("../../assets/icons/email-channel.svg.js"),S=require("../../assets/icons/facebook_channel.svg.js"),c=require("../../assets/icons/gmail.svg.js"),l=require("../../assets/icons/instagram-channel.svg.js"),E=require("../../assets/icons/whatsapp_color.svg.js");const d={[i.SIZE.SMALL]:16,[i.SIZE.MEDIUM]:20,[i.SIZE.INBOX]:24,[i.SIZE.LARGE]:32},u={[i.AVATAR_BACKGROUND.LIGHT]:a.COLORS.content.secondary,[i.AVATAR_BACKGROUND.DARK]:a.COLORS.surface.standard};var h;exports.MESSAGE_CHANNELS=void 0,(h=exports.MESSAGE_CHANNELS||(exports.MESSAGE_CHANNELS={})).INSTAGRAM="instagram",h.MESSENGER="messenger",h.WHATSAPP="whatsapp",h.GMAIL="gmail",h.LIVECHAT="livechat",h.GOOGLE_BUSINESS_CHAT="gbm",h.SHOPIFY="shopify",h.FACEBOOK="facebook",h.EMAIL="email",h.SMTP="smtp",h.FACEBOOK_CATALOG="facebook-catalog",h.TASKS="tasks",h.BIK_LIVECHAT="livechat";exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=d,exports.Avatar=h=>{const[p,g]=s.useState(!1),x=()=>{const s=(h.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return h.size===i.SIZE.SMALL?e.jsx(r.BodyTiny,Object.assign({style:{color:u[h.background]}},{children:s})):h.size===i.SIZE.MEDIUM||h.size===i.SIZE.INBOX?e.jsx(r.TitleSmall,Object.assign({style:{color:u[h.background]}},{children:s})):h.size===i.SIZE.LARGE?e.jsx(r.TitleMedium,Object.assign({style:{color:u[h.background]}},{children:s})):void 0};return e.jsxs("div",Object.assign({style:{position:"relative"}},{children:[e.jsxs(t.AvatarStyle,Object.assign({type:h.type===i.AVATAR_TYPES.IMAGE&&p&&h.useNameFallback&&h.name?i.AVATAR_TYPES.INITIALS:h.type,size:h.size,background:h.background},{children:[h.type===i.AVATAR_TYPES.IMAGE&&(h.useNameFallback&&!p?e.jsx("img",{alt:"",width:i.AVATAR_SIZE_MAP[h.size],height:i.AVATAR_SIZE_MAP[h.size],style:{borderRadius:(null==h?void 0:h.borderRadius)||"50%",objectFit:"contain"},src:h.photoUrl,onError:()=>{g(!0)}}):h.useNameFallback&&p&&h.name?e.jsx("div",{children:x()}):e.jsx("img",{alt:"",width:i.AVATAR_SIZE_MAP[h.size],height:i.AVATAR_SIZE_MAP[h.size],style:{borderRadius:(null==h?void 0:h.borderRadius)||"50%",objectFit:"contain"},src:h.photoUrl})),h.type===i.AVATAR_TYPES.INITIALS&&e.jsx("div",{children:x()}),h.type===i.AVATAR_TYPES.ICON&&h.icon&&e.jsx(h.icon,{width:d[h.size],height:d[h.size],color:u[h.background]})]})),h.inboxSettings&&e.jsx("div",Object.assign({style:{position:"absolute",left:d[h.size]+"px",top:d[h.size]+"px",width:14,height:14,borderRadius:(null==h?void 0:h.borderRadius)||"50%",display:"flex",justifyContent:"center",backgroundColor:h.inboxSettings.isSelected?h.inboxSettings.isComments?a.COLORS.content.primary:a.COLORS.background.brandLight:h.inboxSettings.isComments?a.COLORS.content.primary:a.COLORS.surface.standard,alignItems:"center"}},{children:(()=>{switch(h.channelName){case exports.MESSAGE_CHANNELS.EMAIL:case exports.MESSAGE_CHANNELS.SMTP:return e.jsx(A.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.FACEBOOK:case exports.MESSAGE_CHANNELS.FACEBOOK_CATALOG:case exports.MESSAGE_CHANNELS.MESSENGER:return e.jsx(S.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.INSTAGRAM:return e.jsx(l.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.WHATSAPP:return e.jsx(E.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.GMAIL:return e.jsx(c.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.TASKS:return e.jsx(n.default,{width:11,height:11});case exports.MESSAGE_CHANNELS.BIK_LIVECHAT:return e.jsx(o.default,{width:11,height:11})}})()})),h.status&&e.jsx("div",Object.assign({style:{position:"absolute",left:d[h.size]+"px",top:d[h.size]+"px",width:11,height:11,borderRadius:"50%",display:"flex",justifyContent:"center",backgroundColor:a.COLORS.surface.standard,alignItems:"center"}},{children:h.status?e.jsx("div",{style:{backgroundColor:"ONLINE"===h.status?a.COLORS.special.whatsapp.brand:a.COLORS.content.inactive,width:"8px",height:"8px",borderRadius:"50%"}}):null}))]}))},exports.BACKGROUND_VS_TEXT_COLOR_MAP=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../constants/Theme.js"),i=require("../../assets/icons/info.svg.js"),o=require("../checkBox/CheckBox.js"),c=require("../icon-button/IconButton.js"),d=require("../shimmer-image/ShimmerImage.js"),r=require("../tooltips/Tooltip.js"),l=require("../TypographyStyle.js"),n=require("./constants.js"),a=require("./helpers/ProductHelper.js"),s=require("./ProductPickerTag.js"),u=require("./style.js"),v=require("./utility.js");const p=n=>{const{isVariant:p,data:h,productId:I,collectionId:y,variantId:j,isSelected:P,selectedCollectionsDispatch:x,viewOnly:g,upliftAdditions:k,isPartiallyChecked:C,hideProductCheckbox:b,outOfStockAction:O,hideVariantCheckbox:S,hideProductVariants:f,pickerType:m="PRODUCT",onProductDetailClick:T,showProductDetailInfoIcon:D,currencyAndPrice:V}=n,{isVariantForProductPickerTag:q,dataForProductPickerTag:w,tagText:A,tagType:U}=a.ProductHelper.getDataForProductPickerTag(h,p,O),B=v.getSkuId(h,p);return e.jsxs(u.ProductCardStyle,Object.assign({isVariant:p,onClick:e=>{if(e.stopPropagation(),"PRODUCT"===m&&(b||S)){const e=Object.keys(h.variants);f?P?x({type:"productUnselected",data:{productId:I,collectionId:y}}):k("productSelected",{productId:I,variantId:j,collectionId:y,product:h}):P?x({type:"variantUnselected",data:{productId:I,variantId:j,collectionId:y}}):k("variantSelected",{productId:I,variantId:j||e[0],collectionId:y,variant:h})}},isActive:P},{children:[p&&!g&&!S||!p&&!g&&!b?e.jsx(o.CheckBox,{isChecked:P,isPartiallyChecked:C||!1,onValueChange:function(e,t,i){null==i||i.stopPropagation(),console.log("checkbox clicked: ",e," isVariant: ",p),p?e?(console.log("4",{productId:I,collectionId:y,variantId:j,variant:h,hideProductVariants:f}),k(f?"productSelected":"variantSelected",{productId:I,variantId:j,collectionId:y,variant:h})):(console.log("3",{productId:I,collectionId:y,variantId:j,hideProductVariants:f}),x({type:f?"productUnselected":"variantUnselected",data:{productId:I,variantId:j,collectionId:y}})):e?(console.log("2",{productId:I,collectionId:y,product:h}),k("productSelected",{productId:I,collectionId:y,product:h})):(console.log("1",{productId:I,collectionId:y}),x({type:"productUnselected",data:{productId:I,collectionId:y}}))}}):e.jsx(e.Fragment,{}),e.jsx("div",{children:e.jsx(d.ShimmerImage,{width:40,height:40,imageUrl:h.image,alt:"Item",borderRadius:4})}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},{children:[e.jsx(r.Tooltip,Object.assign({variant:"light",body:h.name,placement:"bottom",delay:400},{children:e.jsx(l.TitleSmall,Object.assign({style:{flex:1},numberOfLines:1},{children:h.name}))})),e.jsxs(u.ProductInfo,{children:[e.jsx(s.ProductPickerTag,{isVariant:q,data:w,tagText:A,tagType:U}),D&&e.jsx(c.IconButton,{onClick:()=>{null==T||T(h)},Icon:()=>e.jsx(i.default,{width:20,height:20,color:t.COLORS.content.placeholder})})]})]})),e.jsxs(u.ProductSubTitle,{children:[!(null==w?void 0:w.fbStatus)&&q||A?null:e.jsx(l.BodyCaption,Object.assign({color:t.COLORS.content.secondary},{children:V})),B&&e.jsx(r.Tooltip,Object.assign({body:B,placement:"top"},{children:e.jsx(u.SKUIDBadge,{children:e.jsx(u.EllipsedBodyTiny,{children:`SKU ID: ${B}`})})}))]})]}))]}))};exports.ProductCard=p,exports.ProductGroup=t=>{var i,o,c,d,r,l,a,s,u;const{collectionId:h,productId:I,data:y,selectedData:j,selectedCollectionsDispatch:P,viewOnly:x,upliftAdditions:g,isProductPartiallyChecked:k,hideProductCheckbox:C,outOfStockAction:b,hideVariantCheckbox:O,hideProductVariants:S,pickerType:f,onProductDetailClick:m,showProductDetailInfoIcon:T}=t,D=e=>{var t,i,o,c,d,r;if(!(null===(i=null===(t=null==j?void 0:j[h])||void 0===t?void 0:t.products)||void 0===i?void 0:i[I]))return!1;return!!(null===(r=null===(d=null===(c=null===(o=null==j?void 0:j[h])||void 0===o?void 0:o.products)||void 0===c?void 0:c[I])||void 0===d?void 0:d.variants)||void 0===r?void 0:r[e])},V=S||!v.shouldShowVariant(y)?`${y.currency&&null!==(i=n.CurrencySymbols[y.currency])&&void 0!==i?i:""}${null!==(u=null!==(r=null===(d=null===(c=Object.values(null!==(o=y.variants)&&void 0!==o?o:{}))||void 0===c?void 0:c[0])||void 0===d?void 0:d.price)&&void 0!==r?r:null===(s=null===(a=Object.values(null!==(l=y.variants)&&void 0!==l?l:{}))||void 0===a?void 0:a[0])||void 0===s?void 0:s.actualPrice)&&void 0!==u?u:""}`:"";return e.jsxs("div",{children:[e.jsx(p,{isVariant:!1,data:y,productId:I,collectionId:h,isSelected:(()=>{var e,t;return!!(null===(t=null===(e=null==j?void 0:j[h])||void 0===e?void 0:e.products)||void 0===t?void 0:t[I])})(),isPartiallyChecked:k,selectedCollectionsDispatch:P,upliftAdditions:g,viewOnly:x,hideProductCheckbox:C,hideVariantCheckbox:O,hideProductVariants:S,pickerType:f,outOfStockAction:b,onProductDetailClick:m,showProductDetailInfoIcon:T,currencyAndPrice:V},I),S?null:v.shouldShowVariant(y)&&Object.keys(y.variants||[]).map((t=>{var i,o,c,d,r,l,a;const s=`${y.currency&&null!==(i=n.CurrencySymbols[y.currency])&&void 0!==i?i:""}${null!==(a=null!==(d=null===(c=null===(o=y.variants)||void 0===o?void 0:o[t])||void 0===c?void 0:c.price)&&void 0!==d?d:null===(l=null===(r=y.variants)||void 0===r?void 0:r[t])||void 0===l?void 0:l.actualPrice)&&void 0!==a?a:""}`;return e.jsx(p,{isVariant:!0,hideVariantCheckbox:O,data:Object.assign(Object.assign({},y.variants[t]),{currency:y.currency}),variantId:t,productId:I,viewOnly:x,upliftAdditions:g,collectionId:h,isSelected:D(t),selectedCollectionsDispatch:P,outOfStockAction:b,onProductDetailClick:m,showProductDetailInfoIcon:T,currencyAndPrice:s},t)}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../constants/Theme.js"),i=require("../../assets/icons/info.svg.js"),o=require("../checkBox/CheckBox.js"),c=require("../icon-button/IconButton.js"),d=require("../shimmer-image/ShimmerImage.js"),r=require("../tooltips/Tooltip.js"),l=require("../TypographyStyle.js"),n=require("./constants.js"),a=require("./helpers/ProductHelper.js"),s=require("./ProductPickerTag.js"),u=require("./style.js"),v=require("./utility.js");const p=n=>{const{isVariant:p,data:h,productId:y,collectionId:I,variantId:j,isSelected:P,selectedCollectionsDispatch:x,viewOnly:g,upliftAdditions:k,isPartiallyChecked:C,hideProductCheckbox:b,outOfStockAction:O,hideVariantCheckbox:S,hideProductVariants:f,pickerType:m="PRODUCT",onProductDetailClick:T,showProductDetailInfoIcon:D,currencyAndPrice:V}=n,{isVariantForProductPickerTag:q,dataForProductPickerTag:w,tagText:A,tagType:U}=a.ProductHelper.getDataForProductPickerTag(h,p,O),B=v.getSkuId(h,p);return e.jsxs(u.ProductCardStyle,Object.assign({isVariant:p,onClick:e=>{if(e.stopPropagation(),"PRODUCT"===m&&(b||S)){const e=Object.keys(h.variants);f?P?x({type:"productUnselected",data:{productId:y,collectionId:I}}):k("productSelected",{productId:y,variantId:j,collectionId:I,product:h}):P?x({type:"variantUnselected",data:{productId:y,variantId:j,collectionId:I}}):k("variantSelected",{productId:y,variantId:j||e[0],collectionId:I,variant:h})}},isActive:P},{children:[p&&!g&&!S||!p&&!g&&!b?e.jsx(o.CheckBox,{isChecked:P,isPartiallyChecked:C||!1,onValueChange:function(e,t,i){null==i||i.stopPropagation(),p?e?k(f?"productSelected":"variantSelected",{productId:y,variantId:j,collectionId:I,variant:h}):x({type:f?"productUnselected":"variantUnselected",data:{productId:y,variantId:j,collectionId:I}}):e?k("productSelected",{productId:y,collectionId:I,product:h}):x({type:"productUnselected",data:{productId:y,collectionId:I}})}}):e.jsx(e.Fragment,{}),e.jsx("div",{children:e.jsx(d.ShimmerImage,{width:40,height:40,imageUrl:h.image,alt:"Item",borderRadius:4})}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},{children:[e.jsx(r.Tooltip,Object.assign({variant:"light",body:h.name,placement:"bottom",delay:400},{children:e.jsx(l.TitleSmall,Object.assign({style:{flex:1},numberOfLines:1},{children:h.name}))})),e.jsxs(u.ProductInfo,{children:[e.jsx(s.ProductPickerTag,{isVariant:q,data:w,tagText:A,tagType:U}),D&&e.jsx(c.IconButton,{onClick:()=>{null==T||T(h)},Icon:()=>e.jsx(i.default,{width:20,height:20,color:t.COLORS.content.placeholder})})]})]})),e.jsxs(u.ProductSubTitle,{children:[!(null==w?void 0:w.fbStatus)&&q||A?null:e.jsx(l.BodyCaption,Object.assign({color:t.COLORS.content.secondary},{children:V})),B&&e.jsx(r.Tooltip,Object.assign({body:B,placement:"top"},{children:e.jsx(u.SKUIDBadge,{children:e.jsx(u.EllipsedBodyTiny,{children:`SKU ID: ${B}`})})}))]})]}))]}))};exports.ProductCard=p,exports.ProductGroup=t=>{var i,o,c,d,r,l,a,s,u;const{collectionId:h,productId:y,data:I,selectedData:j,selectedCollectionsDispatch:P,viewOnly:x,upliftAdditions:g,isProductPartiallyChecked:k,hideProductCheckbox:C,outOfStockAction:b,hideVariantCheckbox:O,hideProductVariants:S,pickerType:f,onProductDetailClick:m,showProductDetailInfoIcon:T}=t,D=e=>{var t,i,o,c,d,r;if(!(null===(i=null===(t=null==j?void 0:j[h])||void 0===t?void 0:t.products)||void 0===i?void 0:i[y]))return!1;return!!(null===(r=null===(d=null===(c=null===(o=null==j?void 0:j[h])||void 0===o?void 0:o.products)||void 0===c?void 0:c[y])||void 0===d?void 0:d.variants)||void 0===r?void 0:r[e])},V=S||!v.shouldShowVariant(I)?`${I.currency&&null!==(i=n.CurrencySymbols[I.currency])&&void 0!==i?i:""}${null!==(u=null!==(r=null===(d=null===(c=Object.values(null!==(o=I.variants)&&void 0!==o?o:{}))||void 0===c?void 0:c[0])||void 0===d?void 0:d.price)&&void 0!==r?r:null===(s=null===(a=Object.values(null!==(l=I.variants)&&void 0!==l?l:{}))||void 0===a?void 0:a[0])||void 0===s?void 0:s.actualPrice)&&void 0!==u?u:""}`:"";return e.jsxs("div",{children:[e.jsx(p,{isVariant:!1,data:I,productId:y,collectionId:h,isSelected:(()=>{var e,t;return!!(null===(t=null===(e=null==j?void 0:j[h])||void 0===e?void 0:e.products)||void 0===t?void 0:t[y])})(),isPartiallyChecked:k,selectedCollectionsDispatch:P,upliftAdditions:g,viewOnly:x,hideProductCheckbox:C,hideVariantCheckbox:O,hideProductVariants:S,pickerType:f,outOfStockAction:b,onProductDetailClick:m,showProductDetailInfoIcon:T,currencyAndPrice:V},y),S?null:v.shouldShowVariant(I)&&Object.keys(I.variants||[]).map((t=>{var i,o,c,d,r,l,a;const s=`${I.currency&&null!==(i=n.CurrencySymbols[I.currency])&&void 0!==i?i:""}${null!==(a=null!==(d=null===(c=null===(o=I.variants)||void 0===o?void 0:o[t])||void 0===c?void 0:c.price)&&void 0!==d?d:null===(l=null===(r=I.variants)||void 0===r?void 0:r[t])||void 0===l?void 0:l.actualPrice)&&void 0!==a?a:""}`;return e.jsx(p,{isVariant:!0,hideVariantCheckbox:O,data:Object.assign(Object.assign({},I.variants[t]),{currency:I.currency}),variantId:t,productId:y,viewOnly:x,upliftAdditions:g,collectionId:h,isSelected:D(t),selectedCollectionsDispatch:P,outOfStockAction:b,onProductDetailClick:m,showProductDetailInfoIcon:T,currencyAndPrice:s},t)}))]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),o=require("react"),l=require("../icon-button/IconButton.js"),i=require("../TypographyStyle.js"),c=require("./collectionScreen.js"),s=require("./emptyState.js"),d=require("./product.js"),r=require("./style.js"),n=require("./utility.js");exports.SearchScreen=u=>{var a;const{customCollectionRestriction:h,selectedCollections:p,searchedCollections:v,searchedCollectionsDispatch:C,selectedCollectionsDispatch:j,setScreen:y,collections:k,onBackPress:b,hideVariantCheckbox:x,pickerType:S,hideProductVariants:f,hideProductCheckbox:P,storeId:g,fbStatusFetcher:m,setCollectionId:I,setSelectedCollectionId:O,hideCollectionCheckbox:q,renderWithoutModal:D,outOfStockAction:F}=u;o.useEffect((()=>{var e;n.fetchFbStatusCollection(null!==(e=v.products)&&void 0!==e?e:{},g,C,m,"setProducts")}),[null==v?void 0:v.products]);const T=!!h&&(null==p?void 0:p.isCustom);return e.jsxs("div",{children:[e.jsxs(r.SelectedScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,onClick:()=>{y("collections"),b()}}),e.jsx(i.BodyCaption,{children:(null===(a=Object.keys(null==v?void 0:v.collections))||void 0===a?void 0:a.length)?"Searched Collections & Products":"Searched Products"})]}),e.jsx("div",{children:Object.keys(null==v?void 0:v.products).length||Object.keys(null==v?void 0:v.collections).length?e.jsxs(e.Fragment,{children:[e.jsx(e.Fragment,{children:Object.keys(null==v?void 0:v.collections).map((t=>e.jsx(c.CollectionCard,{customCollectionRestriction:h,data:null==k?void 0:k[t],isDisabled:T&&!(null==p?void 0:p[t]),isChecked:!!(null==p?void 0:p[t]),isPartiallyChecked:n.isCollectionPartiallyChecked(t,null==k?void 0:k[t],p,f),selectedCollectionsDispatch:j,setCollectionId:I,setSelectedCollectionId:O,setScreen:y,id:t,hideCollectionCheckbox:q||"-1"===t,selectedCollections:p,renderWithoutModal:D,pickerType:S,usedInSearch:!0},t)))}),e.jsx(e.Fragment,{children:Object.keys(null==v?void 0:v.products).map((t=>{var o,l;return Object.keys((null===(l=null===(o=null==v?void 0:v.products)||void 0===o?void 0:o[t])||void 0===l?void 0:l.products)||[]).map((o=>{var l,i,c;let s=!1;return(null===(l=null==v?void 0:v.products)||void 0===l?void 0:l.isCustom)&&(s=!0),e.jsx(d.ProductGroup,{collectionId:t,upliftAdditions:(e,o)=>{console.log("uplift additions in search screen called with : ",{collectionId:t,type:e,payload:o}),((e,t,o)=>{var l;const i=n.liftTheStateUp(o,null===(l=null==v?void 0:v.products)||void 0===l?void 0:l[e]);console.log("final payload: ",i," type: ",t," isRestricted: ",h),j({type:t,data:Object.assign(Object.assign({},i),{isRestricted:h})})})(t,e,o)},productId:o,data:(null===(i=null==v?void 0:v.products)||void 0===i?void 0:i[t].products)[o],isProductPartiallyChecked:n.isProductPartiallyChecked(t,o,p,null===(c=v.products)||void 0===c?void 0:c[t],f),selectedData:p,selectedCollectionsDispatch:j,viewOnly:s,hideProductCheckbox:P,hideVariantCheckbox:x,hideProductVariants:f,pickerType:S,outOfStockAction:F},o)}))}))})]}):e.jsx(s.EmptyState,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),o=require("react"),l=require("../icon-button/IconButton.js"),c=require("../TypographyStyle.js"),i=require("./collectionScreen.js"),s=require("./emptyState.js"),d=require("./product.js"),r=require("./style.js"),n=require("./utility.js");exports.SearchScreen=u=>{var a;const{customCollectionRestriction:h,selectedCollections:v,searchedCollections:p,searchedCollectionsDispatch:C,selectedCollectionsDispatch:j,setScreen:k,collections:y,onBackPress:b,hideVariantCheckbox:x,pickerType:S,hideProductVariants:P,hideProductCheckbox:f,storeId:m,fbStatusFetcher:O,setCollectionId:g,setSelectedCollectionId:I,hideCollectionCheckbox:q,renderWithoutModal:D,outOfStockAction:F}=u;o.useEffect((()=>{var e;n.fetchFbStatusCollection(null!==(e=p.products)&&void 0!==e?e:{},m,C,O,"setProducts")}),[null==p?void 0:p.products]);const T=!!h&&(null==v?void 0:v.isCustom);return e.jsxs("div",{children:[e.jsxs(r.SelectedScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,onClick:()=>{k("collections"),b()}}),e.jsx(c.BodyCaption,{children:(null===(a=Object.keys(null==p?void 0:p.collections))||void 0===a?void 0:a.length)?"Searched Collections & Products":"Searched Products"})]}),e.jsx("div",{children:Object.keys(null==p?void 0:p.products).length||Object.keys(null==p?void 0:p.collections).length?e.jsxs(e.Fragment,{children:[e.jsx(e.Fragment,{children:Object.keys(null==p?void 0:p.collections).map((t=>e.jsx(i.CollectionCard,{customCollectionRestriction:h,data:null==y?void 0:y[t],isDisabled:T&&!(null==v?void 0:v[t]),isChecked:!!(null==v?void 0:v[t]),isPartiallyChecked:n.isCollectionPartiallyChecked(t,null==y?void 0:y[t],v,P),selectedCollectionsDispatch:j,setCollectionId:g,setSelectedCollectionId:I,setScreen:k,id:t,hideCollectionCheckbox:q||"-1"===t,selectedCollections:v,renderWithoutModal:D,pickerType:S,usedInSearch:!0},t)))}),e.jsx(e.Fragment,{children:Object.keys(null==p?void 0:p.products).map((t=>{var o,l;return Object.keys((null===(l=null===(o=null==p?void 0:p.products)||void 0===o?void 0:o[t])||void 0===l?void 0:l.products)||[]).map((o=>{var l,c,i;let s=!1;return(null===(l=null==p?void 0:p.products)||void 0===l?void 0:l.isCustom)&&(s=!0),e.jsx(d.ProductGroup,{collectionId:t,upliftAdditions:(e,o)=>((e,t,o)=>{var l;const c=n.liftTheStateUp(o,null===(l=null==p?void 0:p.products)||void 0===l?void 0:l[e]);j({type:t,data:Object.assign(Object.assign({},c),{isRestricted:h})})})(t,e,o),productId:o,data:(null===(c=null==p?void 0:p.products)||void 0===c?void 0:c[t].products)[o],isProductPartiallyChecked:n.isProductPartiallyChecked(t,o,v,null===(i=p.products)||void 0===i?void 0:i[t],P),selectedData:v,selectedCollectionsDispatch:j,viewOnly:s,hideProductCheckbox:f,hideVariantCheckbox:x,hideProductVariants:P,pickerType:S,outOfStockAction:F},o)}))}))})]}):e.jsx(s.EmptyState,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};
@@ -0,0 +1 @@
1
+ import*as e from"react";var t,a,c;function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(e[c]=a[c])}return e},l.apply(this,arguments)}var r=r=>e.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 54 54"},r),t||(t=e.createElement("path",{fill:"url(#bik_livechat_svg__a)",d:"M53.368 27a26.368 26.368 0 0 1-39.571 22.827l-10.27 3.425a2.198 2.198 0 0 1-2.78-2.78l3.425-10.27A26.369 26.369 0 1 1 53.368 27Z"})),a||(a=e.createElement("path",{fill:"#fff",d:"M36.983 32.943c-.31 0-.553-.08-.725-.241-.161-.173-.242-.415-.242-.725V21.739c0-.31.08-.546.242-.707.172-.173.414-.26.725-.26h6.301c.242 0 .426.064.552.19.127.116.19.288.19.518 0 .242-.063.426-.19.553-.126.127-.31.19-.552.19h-5.541v3.815h5.161c.253 0 .438.063.553.19.126.127.19.305.19.535 0 .242-.064.426-.19.552-.115.116-.3.173-.553.173h-5.162v4.005h5.542c.242 0 .426.064.552.19.127.127.19.305.19.535 0 .242-.063.426-.19.553-.126.115-.31.172-.552.172h-6.301ZM28.555 33.064c-.253 0-.466-.057-.639-.172a1.37 1.37 0 0 1-.397-.553l-4.644-10.513c-.092-.242-.115-.45-.069-.622a.664.664 0 0 1 .276-.397.917.917 0 0 1 .535-.155c.265 0 .467.057.605.172.138.115.253.288.345.518l4.35 10.082h-.638l4.315-10.099c.104-.219.225-.386.363-.5.15-.116.351-.173.604-.173.207 0 .374.052.5.155a.597.597 0 0 1 .26.397c.034.173 0 .38-.104.622l-4.626 10.513a1.37 1.37 0 0 1-.397.553c-.162.115-.374.172-.64.172ZM20.206 33.064c-.287 0-.512-.08-.673-.242-.15-.16-.224-.385-.224-.673V21.567c0-.3.075-.524.224-.674.161-.16.386-.241.673-.241.288 0 .507.08.657.241.16.15.241.374.241.674v10.582c0 .288-.075.512-.224.673-.15.162-.374.242-.674.242ZM10.699 32.943c-.288 0-.512-.08-.674-.241-.16-.161-.241-.386-.241-.674v-10.41c0-.299.074-.523.224-.673.161-.16.386-.241.673-.241.288 0 .507.08.656.241.162.15.242.374.242.674v9.788h5.352c.253 0 .449.069.587.207.138.127.207.31.207.552 0 .242-.07.432-.207.57-.138.138-.334.207-.587.207h-6.232Z"})),c||(c=e.createElement("defs",null,e.createElement("linearGradient",{id:"bik_livechat_svg__a",x1:27,x2:27,y1:.637,y2:53.371,gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#B143FF"}),e.createElement("stop",{offset:1,stopColor:"#6532FF"})))));export{r as default};
@@ -14,5 +14,8 @@ export type AlertProps = {
14
14
  redirectTo?: string;
15
15
  redirectToText?: string;
16
16
  iconStyle?: React.CSSProperties;
17
+ handleRedirectButtonClick?: () => void;
18
+ showCrossButton?: boolean;
19
+ handleCrossIconClick?: () => void;
17
20
  };
18
21
  export declare const Alert: React.FC<AlertProps>;
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import{AlertStyle as o}from"./Alert.styled.js";import{COLOR_CONFIG_MAP as i}from"./AlertHelper.js";import{BodyCaption as r}from"../TypographyStyle.js";import{COLORS as n}from"../../constants/Theme.js";const l=l=>{var c,s;return t(o,Object.assign({type:l.type,contentPosition:l.contentPosition,style:l.containerStyle},{children:[l.icon&&e("div",Object.assign({style:Object.assign(Object.assign({},null==l?void 0:l.iconStyle),{display:(null===(c=null==l?void 0:l.iconStyle)||void 0===c?void 0:c.display)||"flex",alignSelf:(null===(s=null==l?void 0:l.iconStyle)||void 0===s?void 0:s.alignSelf)||"flex-start"})},{children:e(l.icon,{color:i[l.type].textColor,height:16,width:16})})),e(r,Object.assign({style:{color:l.textColor||i[l.type].textColor,marginLeft:8,marginRight:4}},{children:l.text})),l.redirectToText&&l.redirectTo&&e(r,Object.assign({style:{color:n.text.brand,cursor:"pointer",textDecoration:"underline"},onClick:()=>{l.redirectTo&&window.open(l.redirectTo,"_blank")}},{children:l.redirectToText}))]}))};export{l as Alert};
1
+ import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/cross.svg.js";import{AlertStyle as i,AlertContentWrapper as r,CloseIconWrapper as n}from"./Alert.styled.js";import{COLOR_CONFIG_MAP as l}from"./AlertHelper.js";import{BodyCaption as c}from"../TypographyStyle.js";import{COLORS as s}from"../../constants/Theme.js";const d=d=>{var a,h;return t(i,Object.assign({type:d.type,contentPosition:d.contentPosition,style:d.containerStyle},{children:[t(r,{children:[d.icon&&e("div",Object.assign({style:Object.assign(Object.assign({},null==d?void 0:d.iconStyle),{display:(null===(a=null==d?void 0:d.iconStyle)||void 0===a?void 0:a.display)||"flex",alignSelf:(null===(h=null==d?void 0:d.iconStyle)||void 0===h?void 0:h.alignSelf)||"flex-start"})},{children:e(d.icon,{color:l[d.type].textColor,height:16,width:16})})),e(c,Object.assign({style:{color:d.textColor||l[d.type].textColor,marginLeft:8,marginRight:4}},{children:d.text})),d.redirectToText&&d.redirectTo&&e(c,Object.assign({style:{color:s.text.brand,cursor:"pointer",textDecoration:"underline"},onClick:()=>{"INTERNAL"===d.redirectTo&&d.handleRedirectButtonClick?d.handleRedirectButtonClick():d.redirectTo&&window.open(d.redirectTo,"_blank")}},{children:d.redirectToText}))]}),d.showCrossButton&&e(n,{children:e(o,{width:20,height:20,color:s.content.secondary,onClick:()=>{(null==d?void 0:d.handleCrossIconClick)&&d.handleCrossIconClick()}})})]}))};export{d as Alert};
@@ -3,3 +3,5 @@ export declare const AlertStyle: import("styled-components").StyledComponent<"di
3
3
  type: ALERT_TYPES;
4
4
  contentPosition?: CONTENT_POSITION | undefined;
5
5
  }, never>;
6
+ export declare const AlertContentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const CloseIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,9 +1,17 @@
1
- import o from"styled-components";import{CONTENT_POSITION as r,COLOR_CONFIG_MAP as e}from"./AlertHelper.js";const t=o.div`
1
+ import e from"styled-components";import{CONTENT_POSITION as o,COLOR_CONFIG_MAP as t}from"./AlertHelper.js";const r=e.div`
2
2
  display: flex;
3
3
  align-items: center;
4
- justify-content: ${o=>o.contentPosition||r.CENTER};
4
+ justify-content: ${e=>e.contentPosition||o.CENTER};
5
5
  padding: 8px 16px;
6
- background-color: ${o=>e[o.type].backgroundColor};
6
+ background-color: ${e=>t[e.type].backgroundColor};
7
7
  border-radius: 4px;
8
- border: 1px solid ${o=>e[o.type].borderColor};
9
- `;export{t as AlertStyle};
8
+ border: 1px solid ${e=>t[e.type].borderColor};
9
+ `,i=e.div`
10
+ flex: 1;
11
+ display: flex;
12
+ justify-content: center;
13
+ `,n=e.div`
14
+ margin-left: 16px;
15
+ display: flex;
16
+ align-items: center;
17
+ `;export{i as AlertContentWrapper,r as AlertStyle,n as CloseIconWrapper};
@@ -8,7 +8,8 @@ export declare enum ALERT_TYPES {
8
8
  export declare enum CONTENT_POSITION {
9
9
  START = "start",
10
10
  CENTER = "center",
11
- END = "end"
11
+ END = "end",
12
+ SPACE_BETWEEN = "space-between"
12
13
  }
13
14
  export declare const COLOR_CONFIG_MAP: {
14
15
  Negative: {
@@ -1 +1 @@
1
- import{COLORS as o}from"../../constants/Theme.js";var r,t;!function(o){o.NEGATIVE="Negative",o.WARNING="Warning",o.POSITIVE="Positive",o.NEUTRAL="Neutral",o.BRAND="Brand"}(r||(r={})),function(o){o.START="start",o.CENTER="center",o.END="end"}(t||(t={}));const n={[r.NEGATIVE]:{backgroundColor:o.background.negative.light,textColor:o.content.negative,borderColor:o.stroke.negative.lightAlt},[r.WARNING]:{backgroundColor:o.background.warning.light,textColor:o.content.warning,borderColor:o.stroke.warning.lightAlt},[r.POSITIVE]:{backgroundColor:o.background.positive.light,textColor:o.content.positive,borderColor:o.stroke.positive.lightAlt},[r.NEUTRAL]:{backgroundColor:o.surface.subdued,textColor:o.content.secondary,borderColor:o.stroke.primary},[r.BRAND]:{backgroundColor:o.background.brandLight,textColor:o.content.brand,borderColor:o.stroke.brandLightAlt}};export{r as ALERT_TYPES,n as COLOR_CONFIG_MAP,t as CONTENT_POSITION};
1
+ import{COLORS as o}from"../../constants/Theme.js";var r,t;!function(o){o.NEGATIVE="Negative",o.WARNING="Warning",o.POSITIVE="Positive",o.NEUTRAL="Neutral",o.BRAND="Brand"}(r||(r={})),function(o){o.START="start",o.CENTER="center",o.END="end",o.SPACE_BETWEEN="space-between"}(t||(t={}));const e={[r.NEGATIVE]:{backgroundColor:o.background.negative.light,textColor:o.content.negative,borderColor:o.stroke.negative.lightAlt},[r.WARNING]:{backgroundColor:o.background.warning.light,textColor:o.content.warning,borderColor:o.stroke.warning.lightAlt},[r.POSITIVE]:{backgroundColor:o.background.positive.light,textColor:o.content.positive,borderColor:o.stroke.positive.lightAlt},[r.NEUTRAL]:{backgroundColor:o.surface.subdued,textColor:o.content.secondary,borderColor:o.stroke.primary},[r.BRAND]:{backgroundColor:o.background.brandLight,textColor:o.content.brand,borderColor:o.stroke.brandLightAlt}};export{r as ALERT_TYPES,e as COLOR_CONFIG_MAP,t as CONTENT_POSITION};
@@ -28,6 +28,7 @@ export type AvatarProps = {
28
28
  isSelected: boolean;
29
29
  isComments: boolean;
30
30
  };
31
+ status?: 'ONLINE' | 'OFFLINE' | 'AWAY';
31
32
  };
32
33
  export declare const enum MESSAGE_CHANNELS {
33
34
  INSTAGRAM = "instagram",
@@ -41,6 +42,7 @@ export declare const enum MESSAGE_CHANNELS {
41
42
  EMAIL = "email",
42
43
  SMTP = "smtp",
43
44
  FACEBOOK_CATALOG = "facebook-catalog",
44
- TASKS = "tasks"
45
+ TASKS = "tasks",
46
+ BIK_LIVECHAT = "livechat"
45
47
  }
46
48
  export declare const Avatar: React.FC<AvatarProps>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as s}from"react";import{AvatarStyle as i}from"./Avatar.styled.js";import{SIZE as r,AVATAR_BACKGROUND as o,AVATAR_TYPES as a,AVATAR_SIZE_MAP as n}from"./AvatarHelper.js";import{BodyTiny as c,TitleSmall as l,TitleMedium as d}from"../TypographyStyle.js";import{COLORS as h}from"../../constants/Theme.js";import m from"../../assets/icons/CheckSquareOffset.svg.js";import g from"../../assets/icons/email-channel.svg.js";import p from"../../assets/icons/facebook_channel.svg.js";import A from"../../assets/icons/gmail.svg.js";import b from"../../assets/icons/instagram-channel.svg.js";import u from"../../assets/icons/whatsapp_color.svg.js";const S={[r.SMALL]:16,[r.MEDIUM]:20,[r.INBOX]:24,[r.LARGE]:32},f={[o.LIGHT]:h.content.secondary,[o.DARK]:h.surface.standard};var I;!function(e){e.INSTAGRAM="instagram",e.MESSENGER="messenger",e.WHATSAPP="whatsapp",e.GMAIL="gmail",e.LIVECHAT="livechat",e.GOOGLE_BUSINESS_CHAT="gbm",e.SHOPIFY="shopify",e.FACEBOOK="facebook",e.EMAIL="email",e.SMTP="smtp",e.FACEBOOK_CATALOG="facebook-catalog",e.TASKS="tasks"}(I||(I={}));const y=o=>{const[y,O]=s(!1),j=()=>{const e=(o.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return o.size===r.SMALL?t(c,Object.assign({style:{color:f[o.background]}},{children:e})):o.size===r.MEDIUM||o.size===r.INBOX?t(l,Object.assign({style:{color:f[o.background]}},{children:e})):o.size===r.LARGE?t(d,Object.assign({style:{color:f[o.background]}},{children:e})):void 0};return e("div",Object.assign({style:{position:"relative"}},{children:[e(i,Object.assign({type:o.type===a.IMAGE&&y&&o.useNameFallback&&o.name?a.INITIALS:o.type,size:o.size,background:o.background},{children:[o.type===a.IMAGE&&(o.useNameFallback&&!y?t("img",{alt:"",width:n[o.size],height:n[o.size],style:{borderRadius:(null==o?void 0:o.borderRadius)||"50%",objectFit:"contain"},src:o.photoUrl,onError:()=>{O(!0)}}):o.useNameFallback&&y&&o.name?t("div",{children:j()}):t("img",{alt:"",width:n[o.size],height:n[o.size],style:{borderRadius:(null==o?void 0:o.borderRadius)||"50%",objectFit:"contain"},src:o.photoUrl})),o.type===a.INITIALS&&t("div",{children:j()}),o.type===a.ICON&&o.icon&&t(o.icon,{width:S[o.size],height:S[o.size],color:f[o.background]})]})),o.inboxSettings&&t("div",Object.assign({style:{position:"absolute",left:"20px",top:"20px",width:14,height:14,borderRadius:(null==o?void 0:o.borderRadius)||"50%",display:"flex",justifyContent:"center",backgroundColor:o.inboxSettings.isSelected?o.inboxSettings.isComments?h.content.primary:h.background.brandLight:o.inboxSettings.isComments?h.content.primary:h.surface.standard,alignItems:"center"}},{children:(()=>{switch(o.channelName){case I.EMAIL:case I.SMTP:return t(g,{width:11,height:11});case I.FACEBOOK:case I.FACEBOOK_CATALOG:case I.MESSENGER:return t(p,{width:11,height:11});case I.INSTAGRAM:return t(b,{width:11,height:11});case I.WHATSAPP:return t(u,{width:11,height:11});case I.GMAIL:return t(A,{width:11,height:11});case I.TASKS:return t(m,{width:11,height:11})}})()}))]}))};export{S as AVATAR_SIZE_VS_ICON_SIZE_MAP,y as Avatar,f as BACKGROUND_VS_TEXT_COLOR_MAP,I as MESSAGE_CHANNELS};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as s}from"react";import{AvatarStyle as i}from"./Avatar.styled.js";import{SIZE as r,AVATAR_BACKGROUND as a,AVATAR_TYPES as o,AVATAR_SIZE_MAP as n}from"./AvatarHelper.js";import{BodyTiny as c,TitleSmall as l,TitleMedium as d}from"../TypographyStyle.js";import{COLORS as h}from"../../constants/Theme.js";import m from"../../assets/icons/bik_livechat.svg.js";import g from"../../assets/icons/CheckSquareOffset.svg.js";import p from"../../assets/icons/email-channel.svg.js";import u from"../../assets/icons/facebook_channel.svg.js";import b from"../../assets/icons/gmail.svg.js";import A from"../../assets/icons/instagram-channel.svg.js";import I from"../../assets/icons/whatsapp_color.svg.js";const f={[r.SMALL]:16,[r.MEDIUM]:20,[r.INBOX]:24,[r.LARGE]:32},S={[a.LIGHT]:h.content.secondary,[a.DARK]:h.surface.standard};var y;!function(e){e.INSTAGRAM="instagram",e.MESSENGER="messenger",e.WHATSAPP="whatsapp",e.GMAIL="gmail",e.LIVECHAT="livechat",e.GOOGLE_BUSINESS_CHAT="gbm",e.SHOPIFY="shopify",e.FACEBOOK="facebook",e.EMAIL="email",e.SMTP="smtp",e.FACEBOOK_CATALOG="facebook-catalog",e.TASKS="tasks",e.BIK_LIVECHAT="livechat"}(y||(y={}));const j=a=>{const[j,v]=s(!1),E=()=>{const e=(a.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return a.size===r.SMALL?t(c,Object.assign({style:{color:S[a.background]}},{children:e})):a.size===r.MEDIUM||a.size===r.INBOX?t(l,Object.assign({style:{color:S[a.background]}},{children:e})):a.size===r.LARGE?t(d,Object.assign({style:{color:S[a.background]}},{children:e})):void 0};return e("div",Object.assign({style:{position:"relative"}},{children:[e(i,Object.assign({type:a.type===o.IMAGE&&j&&a.useNameFallback&&a.name?o.INITIALS:a.type,size:a.size,background:a.background},{children:[a.type===o.IMAGE&&(a.useNameFallback&&!j?t("img",{alt:"",width:n[a.size],height:n[a.size],style:{borderRadius:(null==a?void 0:a.borderRadius)||"50%",objectFit:"contain"},src:a.photoUrl,onError:()=>{v(!0)}}):a.useNameFallback&&j&&a.name?t("div",{children:E()}):t("img",{alt:"",width:n[a.size],height:n[a.size],style:{borderRadius:(null==a?void 0:a.borderRadius)||"50%",objectFit:"contain"},src:a.photoUrl})),a.type===o.INITIALS&&t("div",{children:E()}),a.type===o.ICON&&a.icon&&t(a.icon,{width:f[a.size],height:f[a.size],color:S[a.background]})]})),a.inboxSettings&&t("div",Object.assign({style:{position:"absolute",left:f[a.size]+"px",top:f[a.size]+"px",width:14,height:14,borderRadius:(null==a?void 0:a.borderRadius)||"50%",display:"flex",justifyContent:"center",backgroundColor:a.inboxSettings.isSelected?a.inboxSettings.isComments?h.content.primary:h.background.brandLight:a.inboxSettings.isComments?h.content.primary:h.surface.standard,alignItems:"center"}},{children:(()=>{switch(a.channelName){case y.EMAIL:case y.SMTP:return t(p,{width:11,height:11});case y.FACEBOOK:case y.FACEBOOK_CATALOG:case y.MESSENGER:return t(u,{width:11,height:11});case y.INSTAGRAM:return t(A,{width:11,height:11});case y.WHATSAPP:return t(I,{width:11,height:11});case y.GMAIL:return t(b,{width:11,height:11});case y.TASKS:return t(g,{width:11,height:11});case y.BIK_LIVECHAT:return t(m,{width:11,height:11})}})()})),a.status&&t("div",Object.assign({style:{position:"absolute",left:f[a.size]+"px",top:f[a.size]+"px",width:11,height:11,borderRadius:"50%",display:"flex",justifyContent:"center",backgroundColor:h.surface.standard,alignItems:"center"}},{children:a.status?t("div",{style:{backgroundColor:"ONLINE"===a.status?h.special.whatsapp.brand:h.content.inactive,width:"8px",height:"8px",borderRadius:"50%"}}):null}))]}))};export{f as AVATAR_SIZE_VS_ICON_SIZE_MAP,j as Avatar,S as BACKGROUND_VS_TEXT_COLOR_MAP,y as MESSAGE_CHANNELS};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as o,Fragment as i}from"react/jsx-runtime";import{COLORS as e}from"../../constants/Theme.js";import c from"../../assets/icons/info.svg.js";import{CheckBox as d}from"../checkBox/CheckBox.js";import{IconButton as l}from"../icon-button/IconButton.js";import{ShimmerImage as n}from"../shimmer-image/ShimmerImage.js";import{Tooltip as r}from"../tooltips/Tooltip.js";import{TitleSmall as a,BodyCaption as s}from"../TypographyStyle.js";import{CurrencySymbols as u}from"./constants.js";import{ProductHelper as v}from"./helpers/ProductHelper.js";import{ProductPickerTag as p}from"./ProductPickerTag.js";import{ProductCardStyle as h,ProductInfo as I,ProductSubTitle as m,SKUIDBadge as y,EllipsedBodyTiny as P}from"./style.js";import{shouldShowVariant as f,getSkuId as g}from"./utility.js";const k=i=>{var e,c,d,l,n,r,a,s,v;const{collectionId:p,productId:h,data:I,selectedData:m,selectedCollectionsDispatch:y,viewOnly:P,upliftAdditions:g,isProductPartiallyChecked:k,hideProductCheckbox:j,outOfStockAction:C,hideVariantCheckbox:O,hideProductVariants:x,pickerType:D,onProductDetailClick:V,showProductDetailInfoIcon:S}=i,T=t=>{var o,i,e,c,d,l;if(!(null===(i=null===(o=null==m?void 0:m[p])||void 0===o?void 0:o.products)||void 0===i?void 0:i[h]))return!1;return!!(null===(l=null===(d=null===(c=null===(e=null==m?void 0:m[p])||void 0===e?void 0:e.products)||void 0===c?void 0:c[h])||void 0===d?void 0:d.variants)||void 0===l?void 0:l[t])},A=x||!f(I)?`${I.currency&&null!==(e=u[I.currency])&&void 0!==e?e:""}${null!==(v=null!==(n=null===(l=null===(d=Object.values(null!==(c=I.variants)&&void 0!==c?c:{}))||void 0===d?void 0:d[0])||void 0===l?void 0:l.price)&&void 0!==n?n:null===(s=null===(a=Object.values(null!==(r=I.variants)&&void 0!==r?r:{}))||void 0===a?void 0:a[0])||void 0===s?void 0:s.actualPrice)&&void 0!==v?v:""}`:"";return t("div",{children:[o(b,{isVariant:!1,data:I,productId:h,collectionId:p,isSelected:(()=>{var t,o;return!!(null===(o=null===(t=null==m?void 0:m[p])||void 0===t?void 0:t.products)||void 0===o?void 0:o[h])})(),isPartiallyChecked:k,selectedCollectionsDispatch:y,upliftAdditions:g,viewOnly:P,hideProductCheckbox:j,hideVariantCheckbox:O,hideProductVariants:x,pickerType:D,outOfStockAction:C,onProductDetailClick:V,showProductDetailInfoIcon:S,currencyAndPrice:A},h),x?null:f(I)&&Object.keys(I.variants||[]).map((t=>{var i,e,c,d,l,n,r;const a=`${I.currency&&null!==(i=u[I.currency])&&void 0!==i?i:""}${null!==(r=null!==(d=null===(c=null===(e=I.variants)||void 0===e?void 0:e[t])||void 0===c?void 0:c.price)&&void 0!==d?d:null===(n=null===(l=I.variants)||void 0===l?void 0:l[t])||void 0===n?void 0:n.actualPrice)&&void 0!==r?r:""}`;return o(b,{isVariant:!0,hideVariantCheckbox:O,data:Object.assign(Object.assign({},I.variants[t]),{currency:I.currency}),variantId:t,productId:h,viewOnly:P,upliftAdditions:g,collectionId:p,isSelected:T(t),selectedCollectionsDispatch:y,outOfStockAction:C,onProductDetailClick:V,showProductDetailInfoIcon:S,currencyAndPrice:a},t)}))]})},b=u=>{const{isVariant:f,data:k,productId:b,collectionId:j,variantId:C,isSelected:O,selectedCollectionsDispatch:x,viewOnly:D,upliftAdditions:V,isPartiallyChecked:S,hideProductCheckbox:T,outOfStockAction:A,hideVariantCheckbox:w,hideProductVariants:U,pickerType:$="PRODUCT",onProductDetailClick:B,showProductDetailInfoIcon:F,currencyAndPrice:R}=u,{isVariantForProductPickerTag:H,dataForProductPickerTag:K,tagText:L,tagType:q}=v.getDataForProductPickerTag(k,f,A),z=g(k,f);return t(h,Object.assign({isVariant:f,onClick:t=>{if(t.stopPropagation(),"PRODUCT"===$&&(T||w)){const t=Object.keys(k.variants);U?O?x({type:"productUnselected",data:{productId:b,collectionId:j}}):V("productSelected",{productId:b,variantId:C,collectionId:j,product:k}):O?x({type:"variantUnselected",data:{productId:b,variantId:C,collectionId:j}}):V("variantSelected",{productId:b,variantId:C||t[0],collectionId:j,variant:k})}},isActive:O},{children:[f&&!D&&!w||!f&&!D&&!T?o(d,{isChecked:O,isPartiallyChecked:S||!1,onValueChange:function(t,o,i){null==i||i.stopPropagation(),console.log("checkbox clicked: ",t," isVariant: ",f),f?t?(console.log("4",{productId:b,collectionId:j,variantId:C,variant:k,hideProductVariants:U}),V(U?"productSelected":"variantSelected",{productId:b,variantId:C,collectionId:j,variant:k})):(console.log("3",{productId:b,collectionId:j,variantId:C,hideProductVariants:U}),x({type:U?"productUnselected":"variantUnselected",data:{productId:b,variantId:C,collectionId:j}})):t?(console.log("2",{productId:b,collectionId:j,product:k}),V("productSelected",{productId:b,collectionId:j,product:k})):(console.log("1",{productId:b,collectionId:j}),x({type:"productUnselected",data:{productId:b,collectionId:j}}))}}):o(i,{}),o("div",{children:o(n,{width:40,height:40,imageUrl:k.image,alt:"Item",borderRadius:4})}),t("div",Object.assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},{children:[o(r,Object.assign({variant:"light",body:k.name,placement:"bottom",delay:400},{children:o(a,Object.assign({style:{flex:1},numberOfLines:1},{children:k.name}))})),t(I,{children:[o(p,{isVariant:H,data:K,tagText:L,tagType:q}),F&&o(l,{onClick:()=>{null==B||B(k)},Icon:()=>o(c,{width:20,height:20,color:e.content.placeholder})})]})]})),t(m,{children:[!(null==K?void 0:K.fbStatus)&&H||L?null:o(s,Object.assign({color:e.content.secondary},{children:R})),z&&o(r,Object.assign({body:z,placement:"top"},{children:o(y,{children:o(P,{children:`SKU ID: ${z}`})})}))]})]}))]}))};export{b as ProductCard,k as ProductGroup};
1
+ import{jsxs as t,jsx as i,Fragment as e}from"react/jsx-runtime";import{COLORS as o}from"../../constants/Theme.js";import c from"../../assets/icons/info.svg.js";import{CheckBox as d}from"../checkBox/CheckBox.js";import{IconButton as n}from"../icon-button/IconButton.js";import{ShimmerImage as r}from"../shimmer-image/ShimmerImage.js";import{Tooltip as l}from"../tooltips/Tooltip.js";import{TitleSmall as a,BodyCaption as s}from"../TypographyStyle.js";import{CurrencySymbols as u}from"./constants.js";import{ProductHelper as v}from"./helpers/ProductHelper.js";import{ProductPickerTag as p}from"./ProductPickerTag.js";import{ProductCardStyle as h,ProductInfo as m,ProductSubTitle as I,SKUIDBadge as y,EllipsedBodyTiny as f}from"./style.js";import{shouldShowVariant as P,getSkuId as k}from"./utility.js";const g=e=>{var o,c,d,n,r,l,a,s,v;const{collectionId:p,productId:h,data:m,selectedData:I,selectedCollectionsDispatch:y,viewOnly:f,upliftAdditions:k,isProductPartiallyChecked:g,hideProductCheckbox:j,outOfStockAction:C,hideVariantCheckbox:O,hideProductVariants:x,pickerType:D,onProductDetailClick:S,showProductDetailInfoIcon:T}=e,V=t=>{var i,e,o,c,d,n;if(!(null===(e=null===(i=null==I?void 0:I[p])||void 0===i?void 0:i.products)||void 0===e?void 0:e[h]))return!1;return!!(null===(n=null===(d=null===(c=null===(o=null==I?void 0:I[p])||void 0===o?void 0:o.products)||void 0===c?void 0:c[h])||void 0===d?void 0:d.variants)||void 0===n?void 0:n[t])},A=x||!P(m)?`${m.currency&&null!==(o=u[m.currency])&&void 0!==o?o:""}${null!==(v=null!==(r=null===(n=null===(d=Object.values(null!==(c=m.variants)&&void 0!==c?c:{}))||void 0===d?void 0:d[0])||void 0===n?void 0:n.price)&&void 0!==r?r:null===(s=null===(a=Object.values(null!==(l=m.variants)&&void 0!==l?l:{}))||void 0===a?void 0:a[0])||void 0===s?void 0:s.actualPrice)&&void 0!==v?v:""}`:"";return t("div",{children:[i(b,{isVariant:!1,data:m,productId:h,collectionId:p,isSelected:(()=>{var t,i;return!!(null===(i=null===(t=null==I?void 0:I[p])||void 0===t?void 0:t.products)||void 0===i?void 0:i[h])})(),isPartiallyChecked:g,selectedCollectionsDispatch:y,upliftAdditions:k,viewOnly:f,hideProductCheckbox:j,hideVariantCheckbox:O,hideProductVariants:x,pickerType:D,outOfStockAction:C,onProductDetailClick:S,showProductDetailInfoIcon:T,currencyAndPrice:A},h),x?null:P(m)&&Object.keys(m.variants||[]).map((t=>{var e,o,c,d,n,r,l;const a=`${m.currency&&null!==(e=u[m.currency])&&void 0!==e?e:""}${null!==(l=null!==(d=null===(c=null===(o=m.variants)||void 0===o?void 0:o[t])||void 0===c?void 0:c.price)&&void 0!==d?d:null===(r=null===(n=m.variants)||void 0===n?void 0:n[t])||void 0===r?void 0:r.actualPrice)&&void 0!==l?l:""}`;return i(b,{isVariant:!0,hideVariantCheckbox:O,data:Object.assign(Object.assign({},m.variants[t]),{currency:m.currency}),variantId:t,productId:h,viewOnly:f,upliftAdditions:k,collectionId:p,isSelected:V(t),selectedCollectionsDispatch:y,outOfStockAction:C,onProductDetailClick:S,showProductDetailInfoIcon:T,currencyAndPrice:a},t)}))]})},b=u=>{const{isVariant:P,data:g,productId:b,collectionId:j,variantId:C,isSelected:O,selectedCollectionsDispatch:x,viewOnly:D,upliftAdditions:S,isPartiallyChecked:T,hideProductCheckbox:V,outOfStockAction:A,hideVariantCheckbox:w,hideProductVariants:U,pickerType:$="PRODUCT",onProductDetailClick:B,showProductDetailInfoIcon:F,currencyAndPrice:R}=u,{isVariantForProductPickerTag:H,dataForProductPickerTag:K,tagText:L,tagType:q}=v.getDataForProductPickerTag(g,P,A),z=k(g,P);return t(h,Object.assign({isVariant:P,onClick:t=>{if(t.stopPropagation(),"PRODUCT"===$&&(V||w)){const t=Object.keys(g.variants);U?O?x({type:"productUnselected",data:{productId:b,collectionId:j}}):S("productSelected",{productId:b,variantId:C,collectionId:j,product:g}):O?x({type:"variantUnselected",data:{productId:b,variantId:C,collectionId:j}}):S("variantSelected",{productId:b,variantId:C||t[0],collectionId:j,variant:g})}},isActive:O},{children:[P&&!D&&!w||!P&&!D&&!V?i(d,{isChecked:O,isPartiallyChecked:T||!1,onValueChange:function(t,i,e){null==e||e.stopPropagation(),P?t?S(U?"productSelected":"variantSelected",{productId:b,variantId:C,collectionId:j,variant:g}):x({type:U?"productUnselected":"variantUnselected",data:{productId:b,variantId:C,collectionId:j}}):t?S("productSelected",{productId:b,collectionId:j,product:g}):x({type:"productUnselected",data:{productId:b,collectionId:j}})}}):i(e,{}),i("div",{children:i(r,{width:40,height:40,imageUrl:g.image,alt:"Item",borderRadius:4})}),t("div",Object.assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},{children:[i(l,Object.assign({variant:"light",body:g.name,placement:"bottom",delay:400},{children:i(a,Object.assign({style:{flex:1},numberOfLines:1},{children:g.name}))})),t(m,{children:[i(p,{isVariant:H,data:K,tagText:L,tagType:q}),F&&i(n,{onClick:()=>{null==B||B(g)},Icon:()=>i(c,{width:20,height:20,color:o.content.placeholder})})]})]})),t(I,{children:[!(null==K?void 0:K.fbStatus)&&H||L?null:i(s,Object.assign({color:o.content.secondary},{children:R})),z&&i(l,Object.assign({body:z,placement:"top"},{children:i(y,{children:i(f,{children:`SKU ID: ${z}`})})}))]})]}))]}))};export{b as ProductCard,g as ProductGroup};
@@ -1 +1 @@
1
- import{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import l from"../../assets/icons/arrow_left.svg.js";import{useEffect as i}from"react";import{IconButton as c}from"../icon-button/IconButton.js";import{BodyCaption as d}from"../TypographyStyle.js";import{CollectionCard as s}from"./collectionScreen.js";import{EmptyState as n}from"./emptyState.js";import{ProductGroup as r}from"./product.js";import{SelectedScreenHeader as u}from"./style.js";import{fetchFbStatusCollection as a,isCollectionPartiallyChecked as p,isProductPartiallyChecked as h,liftTheStateUp as v}from"./utility.js";const m=m=>{var C;const{customCollectionRestriction:y,selectedCollections:k,searchedCollections:f,searchedCollectionsDispatch:b,selectedCollectionsDispatch:j,setScreen:S,collections:I,onBackPress:O,hideVariantCheckbox:P,pickerType:g,hideProductVariants:x,hideProductCheckbox:D,storeId:w,fbStatusFetcher:R,setCollectionId:T,setSelectedCollectionId:V,hideCollectionCheckbox:A,renderWithoutModal:W,outOfStockAction:B}=m;i((()=>{var o;a(null!==(o=f.products)&&void 0!==o?o:{},w,b,R,"setProducts")}),[null==f?void 0:f.products]);const M=!!y&&(null==k?void 0:k.isCustom);return o("div",{children:[o(u,{children:[e(c,{Icon:l,onClick:()=>{S("collections"),O()}}),e(d,{children:(null===(C=Object.keys(null==f?void 0:f.collections))||void 0===C?void 0:C.length)?"Searched Collections & Products":"Searched Products"})]}),e("div",{children:Object.keys(null==f?void 0:f.products).length||Object.keys(null==f?void 0:f.collections).length?o(t,{children:[e(t,{children:Object.keys(null==f?void 0:f.collections).map((o=>e(s,{customCollectionRestriction:y,data:null==I?void 0:I[o],isDisabled:M&&!(null==k?void 0:k[o]),isChecked:!!(null==k?void 0:k[o]),isPartiallyChecked:p(o,null==I?void 0:I[o],k,x),selectedCollectionsDispatch:j,setCollectionId:T,setSelectedCollectionId:V,setScreen:S,id:o,hideCollectionCheckbox:A||"-1"===o,selectedCollections:k,renderWithoutModal:W,pickerType:g,usedInSearch:!0},o)))}),e(t,{children:Object.keys(null==f?void 0:f.products).map((o=>{var t,l;return Object.keys((null===(l=null===(t=null==f?void 0:f.products)||void 0===t?void 0:t[o])||void 0===l?void 0:l.products)||[]).map((t=>{var l,i,c;let d=!1;return(null===(l=null==f?void 0:f.products)||void 0===l?void 0:l.isCustom)&&(d=!0),e(r,{collectionId:o,upliftAdditions:(e,t)=>{console.log("uplift additions in search screen called with : ",{collectionId:o,type:e,payload:t}),((o,e,t)=>{var l;const i=v(t,null===(l=null==f?void 0:f.products)||void 0===l?void 0:l[o]);console.log("final payload: ",i," type: ",e," isRestricted: ",y),j({type:e,data:Object.assign(Object.assign({},i),{isRestricted:y})})})(o,e,t)},productId:t,data:(null===(i=null==f?void 0:f.products)||void 0===i?void 0:i[o].products)[t],isProductPartiallyChecked:h(o,t,k,null===(c=f.products)||void 0===c?void 0:c[o],x),selectedData:k,selectedCollectionsDispatch:j,viewOnly:d,hideProductCheckbox:D,hideVariantCheckbox:P,hideProductVariants:x,pickerType:g,outOfStockAction:B},t)}))}))})]}):e(n,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{m as SearchScreen};
1
+ import{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import l from"../../assets/icons/arrow_left.svg.js";import{useEffect as i}from"react";import{IconButton as c}from"../icon-button/IconButton.js";import{BodyCaption as d}from"../TypographyStyle.js";import{CollectionCard as s}from"./collectionScreen.js";import{EmptyState as r}from"./emptyState.js";import{ProductGroup as n}from"./product.js";import{SelectedScreenHeader as u}from"./style.js";import{fetchFbStatusCollection as a,isCollectionPartiallyChecked as p,isProductPartiallyChecked as h,liftTheStateUp as v}from"./utility.js";const m=m=>{var C;const{customCollectionRestriction:k,selectedCollections:y,searchedCollections:b,searchedCollectionsDispatch:f,selectedCollectionsDispatch:j,setScreen:S,collections:O,onBackPress:P,hideVariantCheckbox:I,pickerType:g,hideProductVariants:x,hideProductCheckbox:D,storeId:T,fbStatusFetcher:V,setCollectionId:w,setSelectedCollectionId:A,hideCollectionCheckbox:R,renderWithoutModal:W,outOfStockAction:B}=m;i((()=>{var o;a(null!==(o=b.products)&&void 0!==o?o:{},T,f,V,"setProducts")}),[null==b?void 0:b.products]);const M=!!k&&(null==y?void 0:y.isCustom);return o("div",{children:[o(u,{children:[e(c,{Icon:l,onClick:()=>{S("collections"),P()}}),e(d,{children:(null===(C=Object.keys(null==b?void 0:b.collections))||void 0===C?void 0:C.length)?"Searched Collections & Products":"Searched Products"})]}),e("div",{children:Object.keys(null==b?void 0:b.products).length||Object.keys(null==b?void 0:b.collections).length?o(t,{children:[e(t,{children:Object.keys(null==b?void 0:b.collections).map((o=>e(s,{customCollectionRestriction:k,data:null==O?void 0:O[o],isDisabled:M&&!(null==y?void 0:y[o]),isChecked:!!(null==y?void 0:y[o]),isPartiallyChecked:p(o,null==O?void 0:O[o],y,x),selectedCollectionsDispatch:j,setCollectionId:w,setSelectedCollectionId:A,setScreen:S,id:o,hideCollectionCheckbox:R||"-1"===o,selectedCollections:y,renderWithoutModal:W,pickerType:g,usedInSearch:!0},o)))}),e(t,{children:Object.keys(null==b?void 0:b.products).map((o=>{var t,l;return Object.keys((null===(l=null===(t=null==b?void 0:b.products)||void 0===t?void 0:t[o])||void 0===l?void 0:l.products)||[]).map((t=>{var l,i,c;let d=!1;return(null===(l=null==b?void 0:b.products)||void 0===l?void 0:l.isCustom)&&(d=!0),e(n,{collectionId:o,upliftAdditions:(e,t)=>((o,e,t)=>{var l;const i=v(t,null===(l=null==b?void 0:b.products)||void 0===l?void 0:l[o]);j({type:e,data:Object.assign(Object.assign({},i),{isRestricted:k})})})(o,e,t),productId:t,data:(null===(i=null==b?void 0:b.products)||void 0===i?void 0:i[o].products)[t],isProductPartiallyChecked:h(o,t,y,null===(c=b.products)||void 0===c?void 0:c[o],x),selectedData:y,selectedCollectionsDispatch:j,viewOnly:d,hideProductCheckbox:D,hideVariantCheckbox:I,hideProductVariants:x,pickerType:g,outOfStockAction:B},t)}))}))})]}):e(r,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{m as SearchScreen};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.664-beta.0",
3
+ "version": "0.0.664-beta.10",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",