@bikdotai/bik-component-library 0.0.657-beta.0 → 0.0.657-beta.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/avatar/Avatar.d.ts +1 -3
- package/dist/cjs/components/avatar/Avatar.js +1 -1
- package/dist/cjs/components/bik-layout/BikSidebar.d.ts +1 -0
- package/dist/cjs/components/bik-layout/BikSidebar.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/avatar/Avatar.d.ts +1 -3
- package/dist/esm/components/avatar/Avatar.js +1 -1
- package/dist/esm/components/bik-layout/BikSidebar.d.ts +1 -0
- package/dist/esm/components/bik-layout/BikSidebar.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/assets/icons/bik_livechat.svg.js +0 -1
- package/dist/esm/assets/icons/bik_livechat.svg.js +0 -1
|
@@ -28,7 +28,6 @@ export type AvatarProps = {
|
|
|
28
28
|
isSelected: boolean;
|
|
29
29
|
isComments: boolean;
|
|
30
30
|
};
|
|
31
|
-
status?: 'ONLINE' | 'OFFLINE' | 'AWAY';
|
|
32
31
|
};
|
|
33
32
|
export declare const enum MESSAGE_CHANNELS {
|
|
34
33
|
INSTAGRAM = "instagram",
|
|
@@ -42,7 +41,6 @@ export declare const enum MESSAGE_CHANNELS {
|
|
|
42
41
|
EMAIL = "email",
|
|
43
42
|
SMTP = "smtp",
|
|
44
43
|
FACEBOOK_CATALOG = "facebook-catalog",
|
|
45
|
-
TASKS = "tasks"
|
|
46
|
-
BIK_LIVECHAT = "livechat"
|
|
44
|
+
TASKS = "tasks"
|
|
47
45
|
}
|
|
48
46
|
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"),
|
|
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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("../../assets/icons/Bik_logo.svg.js"),n=require("../../assets/icons/locked.svg.js"),t=require("react"),o=require("../progress-bar/CircularProgressBar.js"),s=require("../../constants/Theme.js"),l=require("../navigation-hyperlink/NavigationHyperlink.js"),a=require("./SidebarPopup.js"),d=require("./SidebarStyles.js"),r=require("./SimpleSidebar.js");const u=i=>{const{icon:n,isActive:t,activeStateIcon:o,hoverStateIcon:l,isHovered:a}=i,d=n,r=o,u=l;return e.jsx(e.Fragment,{children:t?e.jsx(r,{width:20,height:20}):a?e.jsx(u,{width:20,height:20,color:s.COLORS.surface.standard}):e.jsx(d,{width:20,height:20,color:s.COLORS.surface.standard})})},c=i=>{let{option:t,index:o,onClickMainMenuLogic:s,setHandleHoverForFullLayout:l,isDisabled:a,setHoveredComp:r,setPopupMenu:c,mainActiveMenu:v,hoveredComp:p,popupMenu:m}=i;var g,h,k,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("../../assets/icons/Bik_logo.svg.js"),n=require("../../assets/icons/locked.svg.js"),t=require("react"),o=require("../progress-bar/CircularProgressBar.js"),s=require("../../constants/Theme.js"),l=require("../navigation-hyperlink/NavigationHyperlink.js"),a=require("./SidebarPopup.js"),d=require("./SidebarStyles.js"),r=require("./SimpleSidebar.js");const u=i=>{const{icon:n,isActive:t,activeStateIcon:o,hoverStateIcon:l,isHovered:a}=i,d=n,r=o,u=l;return e.jsx(e.Fragment,{children:t?e.jsx(r,{width:20,height:20}):a?e.jsx(u,{width:20,height:20,color:s.COLORS.surface.standard}):e.jsx(d,{width:20,height:20,color:s.COLORS.surface.standard})})},c=i=>{let{option:t,index:o,onClickMainMenuLogic:s,setHandleHoverForFullLayout:l,isDisabled:a,setHoveredComp:r,setPopupMenu:c,mainActiveMenu:v,hoveredComp:p,popupMenu:m}=i;var g,h,y,k,j,b;return e.jsx(d.SibeBarMenuItem,{children:e.jsxs("div",Object.assign({id:(null===(h=null===(g=t.displayName)||void 0===g?void 0:g.split(" "))||void 0===h?void 0:h.join(""))||t.key.toString(),className:"main--sidebar",onClick:()=>s(t),onMouseEnter:()=>{!a&&l(t)},onMouseOver:()=>{!a&&l(t)},onMouseLeave:()=>{var e;(null===(e=null==t?void 0:t.children)||void 0===e?void 0:e.length)||(r(void 0),c(void 0))},onFocus:()=>{console.log(";")},"aria-hidden":"true"},{children:[t.isNew&&e.jsx("div",Object.assign({className:"new-tag "+(t.isLastSticky?"tag-sticky":"")},{children:"NEW"})),t.isLocked&&e.jsx("div",Object.assign({className:`locked--channel ${t.isLastSticky?"tag-sticky":""} ${t.is2ndLastSticky?"tag-sticky-2":""}`},{children:e.jsx(n.default,{height:16,width:16})})),e.jsxs("div",Object.assign({id:(null===(k=null===(y=t.displayName)||void 0===y?void 0:y.split(" "))||void 0===k?void 0:k.join(""))+"_sub"||t.key.toString()+"_sub",className:`sidebar-menu-item \n\t\t\t\t\t${(null==v?void 0:v.key)===t.key?"main-menu-active-class":""} \n\t\t\t\t\t${t.isLastSticky?"sticky-menu-int":""} \n\t\t\t\t\t${t.is2ndLastSticky?"sticky-menu":""} \n\t\t\t\t\t${t.key===(null==p?void 0:p.key)?"sidebar-menu-item-hover":""} \n\t\t\t\t\t${t.isNew?"new-menu-item":""}`},{children:[e.jsx(u,{icon:t.icon,isActive:t.key==(null==v?void 0:v.key),activeStateIcon:null!==(j=t.activeIcon)&&void 0!==j?j:{},hoverStateIcon:null!==(b=t.hoverIcon)&&void 0!==b?b:{},isHovered:t.key==(null==p?void 0:p.key)||t.key==(null==m?void 0:m.key)}),e.jsx("div",Object.assign({className:"menu-item-container"},{children:e.jsx("p",Object.assign({className:"menu-item-text "+((null==t?void 0:t.key)===(null==v?void 0:v.key)?"active-menu-item-text":"")},{children:t.displayName}))}))]}),o)]}),o)})};exports.BikSidebar=n=>{const{logoSvg:s,allMenuList:u,activeMainMenu:v,activeSubMenu:p,router:m,onClickingMainMenu:g,onClickingSubMenu:h,onClickingAccessUpgradePanel:y,onClickingPopupMenuItem:k,popupMinHeight:j,isNewSidebar:b,menuStyle:S}=n,[M,x]=t.useState(v),[w,C]=t.useState(),[f,L]=t.useState(p),[N,O]=t.useState(!1),[H,P]=t.useState(),[B,E]=t.useState(),[I,q]=t.useState(),[F,_]=t.useState(null),A=t.useMemo((()=>u.filter((e=>e.is2ndLastSticky||e.isLastSticky)).length),[u]);t.useEffect((()=>{x(v)}),[v]),t.useEffect((()=>{L(p)}),[p]);const $=t.useCallback((e=>{var i;"popup"!==(null==e?void 0:e.layout)&&(P(void 0),C(void 0),O(!0),x(e),e.path||g(e),(null===(i=null==e?void 0:e.children)||void 0===i?void 0:i.length)?L(null==e?void 0:e.children[0]):L({}),C(void 0),setTimeout((()=>{O(!1)}),1e3))}),[g]),R=t.useCallback((e=>{var i,n;if(W(),C(void 0),P(void 0),"popup"==(null==e?void 0:e.layout)){const i=U();i&&E(i),P(e)}else{const t=document.getElementById((null===(n=null===(i=e.displayName)||void 0===i?void 0:i.split(" "))||void 0===n?void 0:n.join(""))||e.key.toString());if(t){const e=D(t);q(e)}C(e),z()}}),[]),D=e=>{const i=e.getBoundingClientRect();let n=i.top;const t=e.querySelectorAll("div");let o=null;if(window.innerHeight<=768)return n;if(t.forEach((e=>{e.className.includes("sticky")&&(o=e)})),o){const e=window.innerHeight-i.bottom;n=i.top+e-140}return n};t.useEffect((()=>{const e=()=>{const e=U();e&&E(e),T()};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const T=()=>{const e=document.getElementById("_sub-menu"),i=null==e?void 0:e.getBoundingClientRect().height;i&&q(window.innerHeight-i)},U=()=>{var e,i;if(H){const n=(null===(i=null===(e=H.displayName)||void 0===e?void 0:e.split(" "))||void 0===i?void 0:i.join(""))+"_sub"||H.key.toString()+"_sub",t=document.getElementById(n);if(t){const e=t.getBoundingClientRect();let i=e.top;const n=null!=j?j:320;return e.bottom+n>window.innerHeight&&(i-=e.bottom+n-window.innerHeight),i}return null}},z=()=>{W();const e=setTimeout((()=>C(void 0)),1e4);_(e)},W=()=>{clearTimeout(F)};return e.jsxs(d.SideBarContainer,{children:[e.jsx("div",Object.assign({className:"bik-header-logo",onClick:()=>{},onKeyDown:()=>{},"aria-hidden":"true"},{children:s||e.jsx(i.default,{})})),e.jsxs(d.MainSideBarMenuWrapper,Object.assign({style:S},{children:[null==u?void 0:u.map(((i,n)=>{var o,s;return e.jsxs(t.Fragment,{children:[i.path?e.jsx(l.NavigationHyperlink,Object.assign({href:i.path,router:m},{children:e.jsx(c,{option:i,index:n,onClickMainMenuLogic:$,setHandleHoverForFullLayout:R,isDisabled:N,setHoveredComp:C,setPopupMenu:P,mainActiveMenu:M,hoveredComp:w,popupMenu:H})})):e.jsx(c,{option:i,index:n,onClickMainMenuLogic:$,setHandleHoverForFullLayout:R,isDisabled:N,setHoveredComp:C,setPopupMenu:P,mainActiveMenu:M,hoveredComp:w,popupMenu:H}),e.jsxs(e.Fragment,{children:["popup"===i.layout&&(null===(o=null==H?void 0:H.children)||void 0===o?void 0:o.length)&&e.jsx(a.SidebarPopup,{top:null!=B?B:void 0,menuList:null==H?void 0:H.children,onClickingPopupMenu:e=>{k&&k(e),P(void 0)},onMouseLeaveOnMenu:()=>P(void 0)}),(null===(s=null==w?void 0:w.children)||void 0===s?void 0:s.length)&&e.jsx(r.SimpleSidebar,{menuList:null==w?void 0:w.children,activeMenu:f,onMouseEnterOnMenu:()=>W(),onMouseLeaveOnMenu:()=>{W(),C(void 0)},left:b?92:88,postion:"fixed",header:w.displayName,theme:"brand",router:m,showAccessUpgradePanel:w.showAccessUpgradePanel,onMenuClick:(e,i)=>{L(e),x(w),C(void 0),P(void 0),i&&h(e)},onUpgrade:y,top:b&&I||0,isNewSidebar:b})]})]},n)})),"number"==typeof n.onboardingPercentage&&e.jsx(d.SibeBarMenuItem,{children:e.jsx("div",Object.assign({className:"main--sidebar"},{children:e.jsx("div",Object.assign({id:"bik-onboarding__checklist",className:"sidebar-menu-item "+(0===A?"sticky-menu":1===A?"sticky-menu-int":"sticky-menu-three")},{children:e.jsx(o.default,{percentage:n.onboardingPercentage,width:48})}))}))})]}))]})};
|
|
@@ -28,7 +28,6 @@ export type AvatarProps = {
|
|
|
28
28
|
isSelected: boolean;
|
|
29
29
|
isComments: boolean;
|
|
30
30
|
};
|
|
31
|
-
status?: 'ONLINE' | 'OFFLINE' | 'AWAY';
|
|
32
31
|
};
|
|
33
32
|
export declare const enum MESSAGE_CHANNELS {
|
|
34
33
|
INSTAGRAM = "instagram",
|
|
@@ -42,7 +41,6 @@ export declare const enum MESSAGE_CHANNELS {
|
|
|
42
41
|
EMAIL = "email",
|
|
43
42
|
SMTP = "smtp",
|
|
44
43
|
FACEBOOK_CATALOG = "facebook-catalog",
|
|
45
|
-
TASKS = "tasks"
|
|
46
|
-
BIK_LIVECHAT = "livechat"
|
|
44
|
+
TASKS = "tasks"
|
|
47
45
|
}
|
|
48
46
|
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
|
|
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 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i,Fragment as n}from"react/jsx-runtime";import t from"../../assets/icons/Bik_logo.svg.js";import o from"../../assets/icons/locked.svg.js";import{useState as l,useMemo as s,useEffect as d,useCallback as r,Fragment as a}from"react";import c from"../progress-bar/CircularProgressBar.js";import{COLORS as u}from"../../constants/Theme.js";import{NavigationHyperlink as v}from"../navigation-hyperlink/NavigationHyperlink.js";import{SidebarPopup as m}from"./SidebarPopup.js";import{SideBarContainer as p,MainSideBarMenuWrapper as g,SibeBarMenuItem as h}from"./SidebarStyles.js";import{SimpleSidebar as y}from"./SimpleSidebar.js";const k=o=>{const{logoSvg:u,allMenuList:k,activeMainMenu:b,activeSubMenu:w,router:S,onClickingMainMenu:
|
|
1
|
+
import{jsxs as e,jsx as i,Fragment as n}from"react/jsx-runtime";import t from"../../assets/icons/Bik_logo.svg.js";import o from"../../assets/icons/locked.svg.js";import{useState as l,useMemo as s,useEffect as d,useCallback as r,Fragment as a}from"react";import c from"../progress-bar/CircularProgressBar.js";import{COLORS as u}from"../../constants/Theme.js";import{NavigationHyperlink as v}from"../navigation-hyperlink/NavigationHyperlink.js";import{SidebarPopup as m}from"./SidebarPopup.js";import{SideBarContainer as p,MainSideBarMenuWrapper as g,SibeBarMenuItem as h}from"./SidebarStyles.js";import{SimpleSidebar as y}from"./SimpleSidebar.js";const k=o=>{const{logoSvg:u,allMenuList:k,activeMainMenu:b,activeSubMenu:w,router:S,onClickingMainMenu:j,onClickingSubMenu:f,onClickingAccessUpgradePanel:L,onClickingPopupMenuItem:N,popupMinHeight:C,isNewSidebar:H,menuStyle:O}=o,[P,I]=l(b),[A,E]=l(),[x,B]=l(w),[F,_]=l(!1),[$,D]=l(),[T,U]=l(),[R,z]=l(),[q,K]=l(null),W=s((()=>k.filter((e=>e.is2ndLastSticky||e.isLastSticky)).length),[k]);d((()=>{I(b)}),[b]),d((()=>{B(w)}),[w]);const G=r((e=>{var i;"popup"!==(null==e?void 0:e.layout)&&(D(void 0),E(void 0),_(!0),I(e),e.path||j(e),(null===(i=null==e?void 0:e.children)||void 0===i?void 0:i.length)?B(null==e?void 0:e.children[0]):B({}),E(void 0),setTimeout((()=>{_(!1)}),1e3))}),[j]),J=r((e=>{var i,n;if(Z(),E(void 0),D(void 0),"popup"==(null==e?void 0:e.layout)){const i=X();i&&U(i),D(e)}else{const t=document.getElementById((null===(n=null===(i=e.displayName)||void 0===i?void 0:i.split(" "))||void 0===n?void 0:n.join(""))||e.key.toString());if(t){const e=Q(t);z(e)}E(e),Y()}}),[]),Q=e=>{const i=e.getBoundingClientRect();let n=i.top;const t=e.querySelectorAll("div");let o=null;if(window.innerHeight<=768)return n;if(t.forEach((e=>{e.className.includes("sticky")&&(o=e)})),o){const e=window.innerHeight-i.bottom;n=i.top+e-140}return n};d((()=>{const e=()=>{const e=X();e&&U(e),V()};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const V=()=>{const e=document.getElementById("_sub-menu"),i=null==e?void 0:e.getBoundingClientRect().height;i&&z(window.innerHeight-i)},X=()=>{var e,i;if($){const n=(null===(i=null===(e=$.displayName)||void 0===e?void 0:e.split(" "))||void 0===i?void 0:i.join(""))+"_sub"||$.key.toString()+"_sub",t=document.getElementById(n);if(t){const e=t.getBoundingClientRect();let i=e.top;const n=null!=C?C:320;return e.bottom+n>window.innerHeight&&(i-=e.bottom+n-window.innerHeight),i}return null}},Y=()=>{Z();const e=setTimeout((()=>E(void 0)),1e4);K(e)},Z=()=>{clearTimeout(q)};return e(p,{children:[i("div",Object.assign({className:"bik-header-logo",onClick:()=>{},onKeyDown:()=>{},"aria-hidden":"true"},{children:u||i(t,{})})),e(g,Object.assign({style:O},{children:[null==k?void 0:k.map(((t,o)=>{var l,s;return e(a,{children:[t.path?i(v,Object.assign({href:t.path,router:S},{children:i(M,{option:t,index:o,onClickMainMenuLogic:G,setHandleHoverForFullLayout:J,isDisabled:F,setHoveredComp:E,setPopupMenu:D,mainActiveMenu:P,hoveredComp:A,popupMenu:$})})):i(M,{option:t,index:o,onClickMainMenuLogic:G,setHandleHoverForFullLayout:J,isDisabled:F,setHoveredComp:E,setPopupMenu:D,mainActiveMenu:P,hoveredComp:A,popupMenu:$}),e(n,{children:["popup"===t.layout&&(null===(l=null==$?void 0:$.children)||void 0===l?void 0:l.length)&&i(m,{top:null!=T?T:void 0,menuList:null==$?void 0:$.children,onClickingPopupMenu:e=>{N&&N(e),D(void 0)},onMouseLeaveOnMenu:()=>D(void 0)}),(null===(s=null==A?void 0:A.children)||void 0===s?void 0:s.length)&&i(y,{menuList:null==A?void 0:A.children,activeMenu:x,onMouseEnterOnMenu:()=>Z(),onMouseLeaveOnMenu:()=>{Z(),E(void 0)},left:H?92:88,postion:"fixed",header:A.displayName,theme:"brand",router:S,showAccessUpgradePanel:A.showAccessUpgradePanel,onMenuClick:(e,i)=>{B(e),I(A),E(void 0),D(void 0),i&&f(e)},onUpgrade:L,top:H&&R||0,isNewSidebar:H})]})]},o)})),"number"==typeof o.onboardingPercentage&&i(h,{children:i("div",Object.assign({className:"main--sidebar"},{children:i("div",Object.assign({id:"bik-onboarding__checklist",className:"sidebar-menu-item "+(0===W?"sticky-menu":1===W?"sticky-menu-int":"sticky-menu-three")},{children:i(c,{percentage:o.onboardingPercentage,width:48})}))}))})]}))]})},b=e=>{const{icon:t,isActive:o,activeStateIcon:l,hoverStateIcon:s,isHovered:d}=e,r=t,a=s;return i(n,{children:o?i(l,{width:20,height:20}):i(d?a:r,{width:20,height:20,color:u.surface.standard})})},M=n=>{let{option:t,index:l,onClickMainMenuLogic:s,setHandleHoverForFullLayout:d,isDisabled:r,setHoveredComp:a,setPopupMenu:c,mainActiveMenu:u,hoveredComp:v,popupMenu:m}=n;var p,g,y,k,M,w;return i(h,{children:e("div",Object.assign({id:(null===(g=null===(p=t.displayName)||void 0===p?void 0:p.split(" "))||void 0===g?void 0:g.join(""))||t.key.toString(),className:"main--sidebar",onClick:()=>s(t),onMouseEnter:()=>{!r&&d(t)},onMouseOver:()=>{!r&&d(t)},onMouseLeave:()=>{var e;(null===(e=null==t?void 0:t.children)||void 0===e?void 0:e.length)||(a(void 0),c(void 0))},onFocus:()=>{console.log(";")},"aria-hidden":"true"},{children:[t.isNew&&i("div",Object.assign({className:"new-tag "+(t.isLastSticky?"tag-sticky":"")},{children:"NEW"})),t.isLocked&&i("div",Object.assign({className:`locked--channel ${t.isLastSticky?"tag-sticky":""} ${t.is2ndLastSticky?"tag-sticky-2":""}`},{children:i(o,{height:16,width:16})})),e("div",Object.assign({id:(null===(k=null===(y=t.displayName)||void 0===y?void 0:y.split(" "))||void 0===k?void 0:k.join(""))+"_sub"||t.key.toString()+"_sub",className:`sidebar-menu-item \n\t\t\t\t\t${(null==u?void 0:u.key)===t.key?"main-menu-active-class":""} \n\t\t\t\t\t${t.isLastSticky?"sticky-menu-int":""} \n\t\t\t\t\t${t.is2ndLastSticky?"sticky-menu":""} \n\t\t\t\t\t${t.key===(null==v?void 0:v.key)?"sidebar-menu-item-hover":""} \n\t\t\t\t\t${t.isNew?"new-menu-item":""}`},{children:[i(b,{icon:t.icon,isActive:t.key==(null==u?void 0:u.key),activeStateIcon:null!==(M=t.activeIcon)&&void 0!==M?M:{},hoverStateIcon:null!==(w=t.hoverIcon)&&void 0!==w?w:{},isHovered:t.key==(null==v?void 0:v.key)||t.key==(null==m?void 0:m.key)}),i("div",Object.assign({className:"menu-item-container"},{children:i("p",Object.assign({className:"menu-item-text "+((null==t?void 0:t.key)===(null==u?void 0:u.key)?"active-menu-item-text":"")},{children:t.displayName}))}))]}),l)]}),l)})};export{k as BikSidebar};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
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};
|