@bikdotai/bik-component-library 0.0.620-mldn.3 → 0.0.620-mldn.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../constants/Theme.js"),t=require("../TypographyStyle.js"),n=require("./MenuItem.js"),o=require("./MultiLevelDropdown.styled.js");exports.GroupedMenuList=s=>{let{width:i,onDropdownItemClick:p,option:l,parents:u}=s;return e.jsxs(o.GroupedMenuListContainer,{children:[e.jsx(t.BodyTiny,Object.assign({style:{padding:"4px 8px 4px 12px"},color:r.COLORS.content.placeholder},{children:l.label})),l.options.map(((r,t)=>e.jsx(n.MenuItem,{width:i,onDropdownItemClick:p,option:r,parents:u},t)))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../constants/Theme.js"),t=require("../TypographyStyle.js"),n=require("./MenuItem.js"),o=require("./MultiLevelDropdown.styled.js");exports.GroupedMenuList=s=>{let{width:i,onDropdownItemClick:p,option:l,parents:u}=s;return e.jsxs(o.GroupedMenuListContainer,{children:[e.jsx(t.BodyTiny,Object.assign({style:{padding:"4px 8px 4px 16px"},color:r.COLORS.content.placeholder},{children:l.label})),l.options.map(((r,t)=>e.jsx(n.MenuItem,{width:i,onDropdownItemClick:p,option:r,parents:u},t)))]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/chevronRight2.svg.js"),n=require("react"),i=require("../../constants/Theme.js"),s=require("../TypographyStyle.js"),o=require("./MenuList.js"),r=require("./MultiLevelDropdown.styled.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(n);exports.MenuItem=l=>{let{width:c,onDropdownItemClick:a,option:u,parents:p}=l;var h,O,v,j,b,g,C;const[x,m]=d.default.useState(!1),[f,y]=d.default.useState(!1),[S,L]=d.default.useState({top:0,left:0}),M=n.useRef({top:0,left:0});return e.jsxs(r.MenuItemWrapper,Object.assign({onMouseEnter:e=>{m(!0),(e=>{const t=e.currentTarget.getBoundingClientRect();L({top:t.top,left:t.right}),M.current={top:t.top,left:t.right}})(e)},onMouseLeave:()=>{m(!1)},onClick:()=>{var e;null!==(e=u.disabled)&&void 0!==e&&e||u.children||a(u,p)},id:"menuItemWrapper",style:{cursor:null!==(h=u.disabled)&&void 0!==h&&h?"not-allowed":"pointer",backgroundColor:null!==(O=u.disabled)&&void 0!==O&&O?i.COLORS.surface.standard:"transparent"}},{children:[u.customComponent?u.customComponent:e.jsxs(r.MenuItemContainer,Object.assign({isSelected:u.selected,isSubMenuOpen:x,isHovered:f,isDisabled:null!==(v=u.disabled)&&void 0!==v&&v},{children:[e.jsxs(r.ContentContainer,{children:[u.leadingIcon&&u.leadingIcon,e.jsxs("div",{children:[e.jsx(s.BodyCaption,Object.assign({style:{color:null!==(j=u.disabled)&&void 0!==j&&j?i.COLORS.content.inactive:u.selected||f?i.COLORS.content.positive:i.COLORS.content.primary}},{children:u.label})),u.subText&&e.jsx(s.BodyTiny,Object.assign({style:{color:null!==(b=u.disabled)&&void 0!==b&&b?i.COLORS.content.inactive:u.selected||f?i.COLORS.content.positive:i.COLORS.content.secondary,marginTop:"2px"}},{children:u.subText}))]})]}),u.children&&u.children.length>0?e.jsx(t.default,{width:16,height:16,color:null!==(g=u.disabled)&&void 0!==g&&g?i.COLORS.content.inactive:u.selected||f?i.COLORS.content.positive:i.COLORS.content.primary}):u.trailingIcon?u.trailingIcon:e.jsx(e.Fragment,{})]})),!(null!==(C=u.disabled)&&void 0!==C&&C)&&u.children&&u.children.length>0&&x&&e.jsx("div",Object.assign({style:{width:c},className:"submenu",onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)},{children:e.jsx(r.SubMenuWrapper,Object.assign({style:{width:c,top:`${S.top}px`,left:`${S.left}px`}},{children:e.jsx(r.Container,{children:e.jsx(o.MenuList,{width:c,onDropdownItemClick:a,options:u.children,parents:[...p,u]})})}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/chevronRight2.svg.js"),n=require("react"),i=require("../../constants/Theme.js"),s=require("../TypographyStyle.js"),o=require("./MenuList.js"),r=require("./MultiLevelDropdown.styled.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(n);exports.MenuItem=l=>{let{width:c,onDropdownItemClick:a,option:u,parents:p}=l;var h,O,v,j,b,g,C;const[x,m]=d.default.useState(!1),[S,f]=d.default.useState(!1),[y,L]=d.default.useState({top:0,left:0}),M=n.useRef({top:0,left:0});return e.jsxs(r.MenuItemWrapper,Object.assign({onMouseEnter:e=>{m(!0),(e=>{const t=e.currentTarget.getBoundingClientRect();L({top:t.top,left:t.right}),M.current={top:t.top,left:t.right}})(e)},onMouseLeave:()=>{m(!1)},onClick:()=>{var e;null!==(e=u.disabled)&&void 0!==e&&e||u.children||a(u,p)},id:"menuItemWrapper",style:{cursor:null!==(h=u.disabled)&&void 0!==h&&h?"not-allowed":"pointer",backgroundColor:null!==(O=u.disabled)&&void 0!==O&&O?i.COLORS.surface.standard:"transparent"}},{children:[u.customComponent?u.customComponent:e.jsxs(r.MenuItemContainer,Object.assign({isSelected:u.selected,isSubMenuOpen:x,isHovered:S,isDisabled:null!==(v=u.disabled)&&void 0!==v&&v},{children:[e.jsxs(r.ContentContainer,{children:[u.leadingIcon&&u.leadingIcon,e.jsxs("div",{children:[e.jsx(s.BodyCaption,Object.assign({style:{color:null!==(j=u.disabled)&&void 0!==j&&j?i.COLORS.content.inactive:u.selected||S?i.COLORS.content.positive:i.COLORS.content.primary}},{children:u.label})),u.subText&&e.jsx(s.BodyTiny,Object.assign({style:{color:null!==(b=u.disabled)&&void 0!==b&&b?i.COLORS.content.inactive:u.selected||S?i.COLORS.content.positive:i.COLORS.content.secondary,marginTop:"2px"}},{children:u.subText}))]})]}),u.children&&u.children.length>0?e.jsx(t.default,{width:16,height:16,color:null!==(g=u.disabled)&&void 0!==g&&g?i.COLORS.content.inactive:u.selected||S?i.COLORS.content.positive:i.COLORS.content.primary}):u.trailingIcon?u.trailingIcon:e.jsx(e.Fragment,{})]})),!(null!==(C=u.disabled)&&void 0!==C&&C)&&u.children&&u.children.length>0&&x&&e.jsx("div",Object.assign({style:{width:c},className:"submenu",onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1)},{children:e.jsx(r.SubMenuWrapper,Object.assign({style:{width:c,top:`${y.top}px`,left:`${y.left}px`}},{children:e.jsx(r.SubMenuListContainer,{children:e.jsx(o.MenuList,{width:c,onDropdownItemClick:a,options:u.children,parents:[...p,u]})})}))}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../zeroState/ZeroState.js"),t=require("../dropdown/OpenedDropdown/components/searchbox/SearchBox.js"),o=require("./MenuList.js"),s=require("./MultiLevelDropdown.styled.js");exports.MultiLevelDropdown=n=>{let{options:i,width:l,isSearchable:a,onDropdownItemClick:u}=n;return e.jsxs(s.DropdownContainer,Object.assign({width:l},{children:[a&&e.jsx("div",Object.assign({style:{padding:"4px 4px 0",width:null!=l?l:"200px"}},{children:e.jsx(t.SearchBox,{onSearch:e=>{console.log({searchString:e})},version:"2.0"})})),(null!=i?i:[]).length>0&&e.jsx(o.MenuList,{width:null!=l?l:"200px",onDropdownItemClick:u,options:i,parents:[]}),0===(null!=i?i:[]).length&&e.jsx(s.NoResultsContainer,{children:e.jsx(r.ZeroState,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../zeroState/ZeroState.js"),r=require("../../constants/Theme.js"),s=require("../dropdown/OpenedDropdown/components/searchbox/SearchBox.js"),o=require("../floater/floater.js"),i=require("./MenuList.js"),l=require("./MultiLevelDropdown.styled.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(t);exports.MultiLevelDropdown=u=>{let{options:d,width:a,isSearchable:p,onDropdownItemClick:f,refElement:h,topOffset:j,leftOffset:O,isDropdownOpen:w,onDropdownOutsideClick:x}=u;const b=c.default.useRef(null),[g,m]=t.useState(d),v=e=>{b.current&&!b.current.contains(e.target)?x&&x(!0):x&&x(!1)};return t.useEffect((()=>(document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)})),[]),e.jsx(o.Floater,Object.assign({refElement:h,topOffset:j,leftOffset:O},{children:w&&e.jsx("div",Object.assign({ref:b,style:{backgroundColor:r.COLORS.surface.standard,zIndex:99999}},{children:e.jsxs(l.DropdownContainer,Object.assign({width:a},{children:[p&&e.jsx("div",Object.assign({style:{padding:"4px",width:null!=a?a:"200px"}},{children:e.jsx(s.SearchBox,{onSearch:e=>{const t=[...d],n=[];for(;t.length>0;){const r=t.shift();r&&r.label.toLowerCase().includes(e.toLowerCase())&&n.push(r),r&&"children"in r&&r.children?t.push(...r.children):r&&"options"in r&&r.options&&t.push(...r.options)}const r=e=>e.map((e=>{if(n.includes(e))return e;if("children"in e&&e.children){const t=r(e.children);if(t.length>0)return Object.assign(Object.assign({},e),{children:t})}if("options"in e&&e.options){const t=r(e.options);if(t.length>0)return Object.assign(Object.assign({},e),{options:t})}return null})).filter((e=>null!==e));m(r(d))},version:"2.0"})})),e.jsx(l.OptionsContainer,Object.assign({width:a},{children:(null!=g?g:[]).length>0&&e.jsx(i.MenuList,{width:null!=a?a:"200px",onDropdownItemClick:f,options:g,parents:[]})})),0===(null!=g?g:[]).length&&e.jsx(l.NoResultsContainer,{children:e.jsx(n.ZeroState,{title:"No results found!",subTitle:"Sorry, we are unable to find any results for your search."})})]}))}))}))};
@@ -1,6 +1,9 @@
1
1
  export declare const DropdownContainer: import("styled-components").StyledComponent<"div", any, {
2
2
  width?: string | undefined;
3
3
  }, never>;
4
+ export declare const OptionsContainer: import("styled-components").StyledComponent<"div", any, {
5
+ width?: string | undefined;
6
+ }, never>;
4
7
  export declare const NoResultsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
8
  export declare const GroupedMenuListContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
6
9
  export declare const StyledMenuList: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -14,4 +17,4 @@ export interface MenuItemContainerProps {
14
17
  export declare const MenuItemContainer: import("styled-components").StyledComponent<"div", any, MenuItemContainerProps, never>;
15
18
  export declare const ContentContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
16
19
  export declare const SubMenuWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
17
- export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
20
+ export declare const SubMenuListContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,32 +1,33 @@
1
1
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(e);const o=i.default.div`
2
2
  position: relative;
3
+ border-radius: 8px;
4
+ box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.12);
5
+ padding-bottom: 4px;
6
+ `,n=i.default.div`
3
7
  width: ${e=>{let{width:t}=e;return t||"200px"}};
4
8
  max-width: 300px;
5
9
  max-height: 280px;
6
10
  overflow-y: scroll;
7
- border-radius: 8px;
8
- box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.12);
9
11
  &::-webkit-scrollbar {
10
12
  width: 0px;
11
13
  }
12
- `,n=i.default.div`
14
+ `,a=i.default.div`
13
15
  margin-top: 64px;
14
16
  height: 200px;
15
- `,a=i.default.div`
17
+ `,d=i.default.div`
16
18
  width: 100%;
17
19
  justify-content: center;
18
20
  cursor: pointer;
19
21
  align-items: center;
20
22
  justify-content: space-between;
21
23
  margin: 4px 0;
22
- `,d=i.default.div`
24
+ `,s=i.default.div`
23
25
  z-index: 1000;
24
26
  position: relative;
25
27
  margin: 0px;
26
28
  padding: 0px;
27
- padding-bottom: 4px;
28
29
  width: 100%;
29
- `,s=i.default.div`
30
+ `,p=i.default.div`
30
31
  position: relative;
31
32
  padding: 1px 4px;
32
33
  cursor: pointer;
@@ -35,7 +36,7 @@
35
36
  &:focus-within > .submenu {
36
37
  display: block;
37
38
  }
38
- `,p=i.default.div`
39
+ `,u=i.default.div`
39
40
  position: relative;
40
41
  padding: 4px 8px 4px 12px;
41
42
  transition: background-color 0.2s;
@@ -51,24 +52,25 @@
51
52
  &:hover {
52
53
  background-color: ${e=>{let{isSelected:r,isDisabled:i}=e;return i?t.COLORS.surface.standard:r?t.COLORS.background.positive.light:t.COLORS.surface.hovered}};
53
54
  }
54
- `,u=i.default.div`
55
+ `,l=i.default.div`
55
56
  display: flex;
56
57
  align-items: center;
57
58
  gap: 8px;
58
- `,l=i.default.div`
59
+ `,x=i.default.div`
59
60
  z-index: 1001;
60
61
  position: fixed;
61
62
  border-left: 4px solid transparent;
62
- `,x=i.default.div`
63
+ `,c=i.default.div`
63
64
  margin: 4px;
64
65
  background-color: ${t.COLORS.surface.standard};
65
66
  box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.12);
66
67
  border-radius: 8px;
67
68
  padding-top: 4px;
68
69
  max-height: 480px;
70
+ padding-bottom: 4px;
69
71
  overflow-y: scroll;
70
72
 
71
73
  &::-webkit-scrollbar {
72
74
  display: none;
73
75
  }
74
- `;exports.Container=x,exports.ContentContainer=u,exports.DropdownContainer=o,exports.GroupedMenuListContainer=a,exports.MenuItemContainer=p,exports.MenuItemWrapper=s,exports.NoResultsContainer=n,exports.StyledMenuList=d,exports.SubMenuWrapper=l;
76
+ `;exports.ContentContainer=l,exports.DropdownContainer=o,exports.GroupedMenuListContainer=d,exports.MenuItemContainer=u,exports.MenuItemWrapper=p,exports.NoResultsContainer=a,exports.OptionsContainer=n,exports.StyledMenuList=s,exports.SubMenuListContainer=c,exports.SubMenuWrapper=x;
@@ -1,8 +1,11 @@
1
1
  /// <reference types="react" />
2
- export interface MultiLevelDropdownProps {
2
+ import { FloaterProps } from '../floater/floater';
3
+ export interface MultiLevelDropdownProps extends FloaterProps {
3
4
  options: MultiLevelDropdownOption[];
4
5
  width?: string;
5
6
  isSearchable?: boolean;
7
+ isDropdownOpen?: boolean;
8
+ onDropdownOutsideClick?: (isOutsideClick: any) => void;
6
9
  onDropdownItemClick: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
7
10
  }
8
11
  export type GroupedOption = {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- import{jsxs as o,jsx as t}from"react/jsx-runtime";import{COLORS as e}from"../../constants/Theme.js";import{BodyTiny as r}from"../TypographyStyle.js";import{MenuItem as p}from"./MenuItem.js";import{GroupedMenuListContainer as n}from"./MultiLevelDropdown.styled.js";const i=i=>{let{width:m,onDropdownItemClick:l,option:s,parents:c}=i;return o(n,{children:[t(r,Object.assign({style:{padding:"4px 8px 4px 12px"},color:e.content.placeholder},{children:s.label})),s.options.map(((o,e)=>t(p,{width:m,onDropdownItemClick:l,option:o,parents:c},e)))]})};export{i as GroupedMenuList};
1
+ import{jsxs as o,jsx as t}from"react/jsx-runtime";import{COLORS as e}from"../../constants/Theme.js";import{BodyTiny as r}from"../TypographyStyle.js";import{MenuItem as p}from"./MenuItem.js";import{GroupedMenuListContainer as n}from"./MultiLevelDropdown.styled.js";const i=i=>{let{width:m,onDropdownItemClick:l,option:s,parents:c}=i;return o(n,{children:[t(r,Object.assign({style:{padding:"4px 8px 4px 16px"},color:e.content.placeholder},{children:s.label})),s.options.map(((o,e)=>t(p,{width:m,onDropdownItemClick:l,option:o,parents:c},e)))]})};export{i as GroupedMenuList};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o from"../../assets/icons/chevronRight2.svg.js";import i,{useRef as l}from"react";import{COLORS as s}from"../../constants/Theme.js";import{BodyCaption as r,BodyTiny as c}from"../TypographyStyle.js";import{MenuList as d}from"./MenuList.js";import{MenuItemWrapper as a,MenuItemContainer as p,ContentContainer as u,SubMenuWrapper as h,Container as m}from"./MultiLevelDropdown.styled.js";const v=v=>{let{width:g,onDropdownItemClick:b,option:f,parents:j}=v;var y,w,x,C,I,M,O;const[S,T]=i.useState(!1),[k,D]=i.useState(!1),[L,E]=i.useState({top:0,left:0}),R=l({top:0,left:0});return e(a,Object.assign({onMouseEnter:e=>{T(!0),(e=>{const t=e.currentTarget.getBoundingClientRect();E({top:t.top,left:t.right}),R.current={top:t.top,left:t.right}})(e)},onMouseLeave:()=>{T(!1)},onClick:()=>{var e;null!==(e=f.disabled)&&void 0!==e&&e||f.children||b(f,j)},id:"menuItemWrapper",style:{cursor:null!==(y=f.disabled)&&void 0!==y&&y?"not-allowed":"pointer",backgroundColor:null!==(w=f.disabled)&&void 0!==w&&w?s.surface.standard:"transparent"}},{children:[f.customComponent?f.customComponent:e(p,Object.assign({isSelected:f.selected,isSubMenuOpen:S,isHovered:k,isDisabled:null!==(x=f.disabled)&&void 0!==x&&x},{children:[e(u,{children:[f.leadingIcon&&f.leadingIcon,e("div",{children:[t(r,Object.assign({style:{color:null!==(C=f.disabled)&&void 0!==C&&C?s.content.inactive:f.selected||k?s.content.positive:s.content.primary}},{children:f.label})),f.subText&&t(c,Object.assign({style:{color:null!==(I=f.disabled)&&void 0!==I&&I?s.content.inactive:f.selected||k?s.content.positive:s.content.secondary,marginTop:"2px"}},{children:f.subText}))]})]}),f.children&&f.children.length>0?t(o,{width:16,height:16,color:null!==(M=f.disabled)&&void 0!==M&&M?s.content.inactive:f.selected||k?s.content.positive:s.content.primary}):f.trailingIcon?f.trailingIcon:t(n,{})]})),!(null!==(O=f.disabled)&&void 0!==O&&O)&&f.children&&f.children.length>0&&S&&t("div",Object.assign({style:{width:g},className:"submenu",onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1)},{children:t(h,Object.assign({style:{width:g,top:`${L.top}px`,left:`${L.left}px`}},{children:t(m,{children:t(d,{width:g,onDropdownItemClick:b,options:f.children,parents:[...j,f]})})}))}))]}))};export{v as MenuItem};
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import o from"../../assets/icons/chevronRight2.svg.js";import i,{useRef as l}from"react";import{COLORS as s}from"../../constants/Theme.js";import{BodyCaption as r,BodyTiny as c}from"../TypographyStyle.js";import{MenuList as d}from"./MenuList.js";import{MenuItemWrapper as a,MenuItemContainer as p,ContentContainer as u,SubMenuWrapper as h,SubMenuListContainer as m}from"./MultiLevelDropdown.styled.js";const v=v=>{let{width:g,onDropdownItemClick:b,option:f,parents:j}=v;var y,w,x,C,I,M,O;const[S,T]=i.useState(!1),[k,D]=i.useState(!1),[L,E]=i.useState({top:0,left:0}),R=l({top:0,left:0});return e(a,Object.assign({onMouseEnter:e=>{T(!0),(e=>{const t=e.currentTarget.getBoundingClientRect();E({top:t.top,left:t.right}),R.current={top:t.top,left:t.right}})(e)},onMouseLeave:()=>{T(!1)},onClick:()=>{var e;null!==(e=f.disabled)&&void 0!==e&&e||f.children||b(f,j)},id:"menuItemWrapper",style:{cursor:null!==(y=f.disabled)&&void 0!==y&&y?"not-allowed":"pointer",backgroundColor:null!==(w=f.disabled)&&void 0!==w&&w?s.surface.standard:"transparent"}},{children:[f.customComponent?f.customComponent:e(p,Object.assign({isSelected:f.selected,isSubMenuOpen:S,isHovered:k,isDisabled:null!==(x=f.disabled)&&void 0!==x&&x},{children:[e(u,{children:[f.leadingIcon&&f.leadingIcon,e("div",{children:[t(r,Object.assign({style:{color:null!==(C=f.disabled)&&void 0!==C&&C?s.content.inactive:f.selected||k?s.content.positive:s.content.primary}},{children:f.label})),f.subText&&t(c,Object.assign({style:{color:null!==(I=f.disabled)&&void 0!==I&&I?s.content.inactive:f.selected||k?s.content.positive:s.content.secondary,marginTop:"2px"}},{children:f.subText}))]})]}),f.children&&f.children.length>0?t(o,{width:16,height:16,color:null!==(M=f.disabled)&&void 0!==M&&M?s.content.inactive:f.selected||k?s.content.positive:s.content.primary}):f.trailingIcon?f.trailingIcon:t(n,{})]})),!(null!==(O=f.disabled)&&void 0!==O&&O)&&f.children&&f.children.length>0&&S&&t("div",Object.assign({style:{width:g},className:"submenu",onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1)},{children:t(h,Object.assign({style:{width:g,top:`${L.top}px`,left:`${L.left}px`}},{children:t(m,{children:t(d,{width:g,onDropdownItemClick:b,options:f.children,parents:[...j,f]})})}))}))]}))};export{v as MenuItem};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import{ZeroState as o}from"../zeroState/ZeroState.js";import{SearchBox as r}from"../dropdown/OpenedDropdown/components/searchbox/SearchBox.js";import{MenuList as n}from"./MenuList.js";import{DropdownContainer as i,NoResultsContainer as s}from"./MultiLevelDropdown.styled.js";const l=l=>{let{options:p,width:a,isSearchable:c,onDropdownItemClick:d}=l;return t(i,Object.assign({width:a},{children:[c&&e("div",Object.assign({style:{padding:"4px 4px 0",width:null!=a?a:"200px"}},{children:e(r,{onSearch:t=>{console.log({searchString:t})},version:"2.0"})})),(null!=p?p:[]).length>0&&e(n,{width:null!=a?a:"200px",onDropdownItemClick:d,options:p,parents:[]}),0===(null!=p?p:[]).length&&e(s,{children:e(o,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})]}))};export{l as MultiLevelDropdown};
1
+ import{jsx as e,jsxs as n}from"react/jsx-runtime";import t,{useState as o,useEffect as r}from"react";import{ZeroState as s}from"../zeroState/ZeroState.js";import{COLORS as i}from"../../constants/Theme.js";import{SearchBox as l}from"../dropdown/OpenedDropdown/components/searchbox/SearchBox.js";import{Floater as c}from"../floater/floater.js";import{MenuList as d}from"./MenuList.js";import{DropdownContainer as p,OptionsContainer as a,NoResultsContainer as f}from"./MultiLevelDropdown.styled.js";const u=u=>{let{options:h,width:m,isSearchable:g,onDropdownItemClick:w,refElement:j,topOffset:O,leftOffset:b,isDropdownOpen:x,onDropdownOutsideClick:v}=u;const y=t.useRef(null),[C,D]=o(h),L=e=>{y.current&&!y.current.contains(e.target)?v&&v(!0):v&&v(!1)};return r((()=>(document.addEventListener("mousedown",L),()=>{document.removeEventListener("mousedown",L)})),[]),e(c,Object.assign({refElement:j,topOffset:O,leftOffset:b},{children:x&&e("div",Object.assign({ref:y,style:{backgroundColor:i.surface.standard,zIndex:99999}},{children:n(p,Object.assign({width:m},{children:[g&&e("div",Object.assign({style:{padding:"4px",width:null!=m?m:"200px"}},{children:e(l,{onSearch:e=>{const n=[...h],t=[];for(;n.length>0;){const o=n.shift();o&&o.label.toLowerCase().includes(e.toLowerCase())&&t.push(o),o&&"children"in o&&o.children?n.push(...o.children):o&&"options"in o&&o.options&&n.push(...o.options)}const o=e=>e.map((e=>{if(t.includes(e))return e;if("children"in e&&e.children){const n=o(e.children);if(n.length>0)return Object.assign(Object.assign({},e),{children:n})}if("options"in e&&e.options){const n=o(e.options);if(n.length>0)return Object.assign(Object.assign({},e),{options:n})}return null})).filter((e=>null!==e));D(o(h))},version:"2.0"})})),e(a,Object.assign({width:m},{children:(null!=C?C:[]).length>0&&e(d,{width:null!=m?m:"200px",onDropdownItemClick:w,options:C,parents:[]})})),0===(null!=C?C:[]).length&&e(f,{children:e(s,{title:"No results found!",subTitle:"Sorry, we are unable to find any results for your search."})})]}))}))}))};export{u as MultiLevelDropdown};
@@ -1,6 +1,9 @@
1
1
  export declare const DropdownContainer: import("styled-components").StyledComponent<"div", any, {
2
2
  width?: string | undefined;
3
3
  }, never>;
4
+ export declare const OptionsContainer: import("styled-components").StyledComponent<"div", any, {
5
+ width?: string | undefined;
6
+ }, never>;
4
7
  export declare const NoResultsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
8
  export declare const GroupedMenuListContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
6
9
  export declare const StyledMenuList: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -14,4 +17,4 @@ export interface MenuItemContainerProps {
14
17
  export declare const MenuItemContainer: import("styled-components").StyledComponent<"div", any, MenuItemContainerProps, never>;
15
18
  export declare const ContentContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
16
19
  export declare const SubMenuWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
17
- export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
20
+ export declare const SubMenuListContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,32 +1,33 @@
1
1
  import e from"styled-components";import{COLORS as i}from"../../constants/Theme.js";const t=e.div`
2
2
  position: relative;
3
+ border-radius: 8px;
4
+ box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.12);
5
+ padding-bottom: 4px;
6
+ `,r=e.div`
3
7
  width: ${e=>{let{width:i}=e;return i||"200px"}};
4
8
  max-width: 300px;
5
9
  max-height: 280px;
6
10
  overflow-y: scroll;
7
- border-radius: 8px;
8
- box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.12);
9
11
  &::-webkit-scrollbar {
10
12
  width: 0px;
11
13
  }
12
- `,r=e.div`
14
+ `,o=e.div`
13
15
  margin-top: 64px;
14
16
  height: 200px;
15
- `,o=e.div`
17
+ `,n=e.div`
16
18
  width: 100%;
17
19
  justify-content: center;
18
20
  cursor: pointer;
19
21
  align-items: center;
20
22
  justify-content: space-between;
21
23
  margin: 4px 0;
22
- `,n=e.div`
24
+ `,d=e.div`
23
25
  z-index: 1000;
24
26
  position: relative;
25
27
  margin: 0px;
26
28
  padding: 0px;
27
- padding-bottom: 4px;
28
29
  width: 100%;
29
- `,d=e.div`
30
+ `,p=e.div`
30
31
  position: relative;
31
32
  padding: 1px 4px;
32
33
  cursor: pointer;
@@ -51,24 +52,25 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
51
52
  &:hover {
52
53
  background-color: ${e=>{let{isSelected:t,isDisabled:r}=e;return r?i.surface.standard:t?i.background.positive.light:i.surface.hovered}};
53
54
  }
54
- `,p=e.div`
55
+ `,a=e.div`
55
56
  display: flex;
56
57
  align-items: center;
57
58
  gap: 8px;
58
- `,a=e.div`
59
+ `,c=e.div`
59
60
  z-index: 1001;
60
61
  position: fixed;
61
62
  border-left: 4px solid transparent;
62
- `,c=e.div`
63
+ `,x=e.div`
63
64
  margin: 4px;
64
65
  background-color: ${i.surface.standard};
65
66
  box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.12);
66
67
  border-radius: 8px;
67
68
  padding-top: 4px;
68
69
  max-height: 480px;
70
+ padding-bottom: 4px;
69
71
  overflow-y: scroll;
70
72
 
71
73
  &::-webkit-scrollbar {
72
74
  display: none;
73
75
  }
74
- `;export{c as Container,p as ContentContainer,t as DropdownContainer,o as GroupedMenuListContainer,s as MenuItemContainer,d as MenuItemWrapper,r as NoResultsContainer,n as StyledMenuList,a as SubMenuWrapper};
76
+ `;export{a as ContentContainer,t as DropdownContainer,n as GroupedMenuListContainer,s as MenuItemContainer,p as MenuItemWrapper,o as NoResultsContainer,r as OptionsContainer,d as StyledMenuList,x as SubMenuListContainer,c as SubMenuWrapper};
@@ -1,8 +1,11 @@
1
1
  /// <reference types="react" />
2
- export interface MultiLevelDropdownProps {
2
+ import { FloaterProps } from '../floater/floater';
3
+ export interface MultiLevelDropdownProps extends FloaterProps {
3
4
  options: MultiLevelDropdownOption[];
4
5
  width?: string;
5
6
  isSearchable?: boolean;
7
+ isDropdownOpen?: boolean;
8
+ onDropdownOutsideClick?: (isOutsideClick: any) => void;
6
9
  onDropdownItemClick: (option: MultiLevelDropdownOption, parents: MultiLevelDropdownOption[]) => void;
7
10
  }
8
11
  export type GroupedOption = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.620-mldn.3",
3
+ "version": "0.0.620-mldn.4",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",