@bikdotai/bik-component-library 0.0.507-beta.filter-2 → 0.0.507-beta.filter-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.
@@ -11,5 +11,6 @@ export type CheckBoxProps = {
11
11
  labelSize?: 'DEFAULT' | 'SMALL';
12
12
  rightComponent?: JSX.Element;
13
13
  checkboxBorderColor?: string;
14
+ boldOnChecked?: boolean;
14
15
  };
15
16
  export declare const CheckBox: React.FC<CheckBoxProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),s=require("./CheckBox.styled.js"),l=require("../TypographyStyle.js"),t=require("../../constants/Theme.js");const a=i=>e.jsxs("svg",Object.assign({width:i.isSmall?"16":"18",height:i.isSmall?"16":"18",viewBox:i.isSmall?"0 0 16 16":"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e.jsx("rect",{x:"0",y:"0",width:i.isSmall?"16":"18",height:i.isSmall?"16":"18",rx:"4",fill:i.isDisabled?t.COLORS.content.inactive:t.COLORS.background.positive.vibrant}),!i.isPartial&&e.jsx("svg",Object.assign({width:i.isSmall?"8":"10",height:i.isSmall?"7":"9",x:"4",y:"4",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z",fill:"white"})})),i.isPartial&&e.jsx("rect",{x:"5",y:i.isSmall?"7":"8",width:i.isSmall?"6":"8",height:"2",rx:"1",fill:t.COLORS.surface.standard})]}));exports.CheckBox=r=>{const[o,c]=i.useState(r.isChecked||!1),[n,d]=i.useState(r.isPartiallyChecked||!1),[h,S]=i.useState(r.isDisabled||!1),[x,b]=i.useState(!1),[u,C]=i.useState(!1);return i.useEffect((()=>{c(r.isChecked)}),[r.isChecked]),i.useEffect((()=>{S(r.isDisabled||!1)}),[r.isDisabled]),i.useEffect((()=>{d(r.isPartiallyChecked||!1)}),[r.isPartiallyChecked]),e.jsxs(s.CheckboxContainer,Object.assign({onClick:e=>{var i;if(!r.isDisabled){const s=!o;n?d(!n):c(s),null===(i=r.onValueChange)||void 0===i||i.call(r,s,r.value,e)}},onMouseEnter:()=>b(!r.skipHoverState),onMouseLeave:()=>b(!1),onMouseDown:()=>C(!r.skipHoverState),onMouseUp:()=>C(!1)},{children:[e.jsx(s.CheckboxIcon,Object.assign({checked:o,hovered:x,clicked:u,isDisabled:h,size:r.size,borderColor:r.checkboxBorderColor},{children:o&&e.jsx(a,{isPartial:n||!1,isDisabled:h,isSmall:"SMALL"===r.size})})),r.label&&"SMALL"!==r.size&&"SMALL"!==r.labelSize&&e.jsx(l.BodyPrimary,Object.assign({color:r.isDisabled?t.COLORS.text.disabled:t.COLORS.text.primary},{children:r.label})),r.label&&("SMALL"===r.size||"SMALL"===r.labelSize)&&e.jsx(l.BodySecondary,Object.assign({color:r.isDisabled?t.COLORS.text.disabled:t.COLORS.text.primary},{children:r.label})),r.rightComponent]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),i=require("./CheckBox.styled.js"),l=require("../TypographyStyle.js"),t=require("../../constants/Theme.js");const a=s=>e.jsxs("svg",Object.assign({width:s.isSmall?"16":"18",height:s.isSmall?"16":"18",viewBox:s.isSmall?"0 0 16 16":"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e.jsx("rect",{x:"0",y:"0",width:s.isSmall?"16":"18",height:s.isSmall?"16":"18",rx:"4",fill:s.isDisabled?t.COLORS.content.inactive:t.COLORS.background.positive.vibrant}),!s.isPartial&&e.jsx("svg",Object.assign({width:s.isSmall?"8":"10",height:s.isSmall?"7":"9",x:"4",y:"4",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z",fill:"white"})})),s.isPartial&&e.jsx("rect",{x:"5",y:s.isSmall?"7":"8",width:s.isSmall?"6":"8",height:"2",rx:"1",fill:t.COLORS.surface.standard})]}));exports.CheckBox=r=>{const[o,c]=s.useState(r.isChecked||!1),[d,n]=s.useState(r.isPartiallyChecked||!1),[h,x]=s.useState(r.isDisabled||!1),[b,S]=s.useState(!1),[C,u]=s.useState(!1);s.useEffect((()=>{c(r.isChecked)}),[r.isChecked]),s.useEffect((()=>{x(r.isDisabled||!1)}),[r.isDisabled]),s.useEffect((()=>{n(r.isPartiallyChecked||!1)}),[r.isPartiallyChecked]);return e.jsxs(i.CheckboxContainer,Object.assign({onClick:e=>{var s;if(!r.isDisabled){const i=!o;d?n(!d):c(i),null===(s=r.onValueChange)||void 0===s||s.call(r,i,r.value,e)}},onMouseEnter:()=>S(!r.skipHoverState),onMouseLeave:()=>S(!1),onMouseDown:()=>u(!r.skipHoverState),onMouseUp:()=>u(!1)},{children:[e.jsx(i.CheckboxIcon,Object.assign({checked:o,hovered:b,clicked:C,isDisabled:h,size:r.size,borderColor:r.checkboxBorderColor},{children:o&&e.jsx(a,{isPartial:d||!1,isDisabled:h,isSmall:"SMALL"===r.size})})),r.label?r.boldOnChecked&&o?e.jsx(l.TitleSmall,Object.assign({color:r.isDisabled?t.COLORS.text.disabled:t.COLORS.text.primary},{children:r.label})):"SMALL"===r.size||"SMALL"===r.labelSize?e.jsx(l.BodySecondary,Object.assign({color:r.isDisabled?t.COLORS.text.disabled:t.COLORS.text.primary},{children:r.label})):e.jsx(l.BodyPrimary,Object.assign({color:r.isDisabled?t.COLORS.text.disabled:t.COLORS.text.primary},{children:r.label})):e.jsx(e.Fragment,{}),r.rightComponent]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../../zeroState/ZeroState.js"),s=require("../../../../hooks/useOutside.js"),n=require("../../hooks/useDropdown.js"),o=require("./description/Description.js"),i=require("./menu/FreeFormMenu.js"),l=require("./menu/MenuList.js"),u=require("./menu/SelectAllMenu.js"),c=require("./multiSelect/MultiSelectDropdownBottomBar.js"),a=require("./OpennedDropdown.styled.js"),p=require("./searchbox/SearchBox.js"),d=require("./searchbox/SearchZeroState.js");const h=304,S=290;exports.OpenedDropdown=j=>{let{options:x,isSearchable:f,isMultiSelect:g,width:v,allowFreeForm:w,height:b,onClose:y,onSelect:m,onSearch:O,version:q,skipSorting:M,hideSelectAll:C,primaryButtonText:D}=j;const{dropdownOptions:L,search:F,searchedString:A,searchedOptions:k,onApplyHandler:B,selectAllHandler:H,onMultiSelectClear:Z,onFreeFormSelect:T,onMultiSelectApply:P,latestDropdownOptionsRef:R,getSelectedOptions:_}=n.useDropdown(q,x,m,M,g,O),[z,E]=t.useState(null!=v?v:S),[I,K]=t.useState(null),N=t.useRef(null);s.useOutside(N,(()=>{if(K(null),g&&"2.0"===q){const e=_(R.current);null==y||y(e)}else null==y||y(L)}));const W=null!=b?b:h,G="number"==typeof W?f&&g?W-96:f&&!g||!f&&g?W-48:W:W;t.useEffect((()=>{const e=null!=v?v:S;if(null===I)E(e);else if("number"==typeof e)E(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));E(t)}}),[I]);const J=[],Q=(A&&O?k:L).map((e=>{var t,r;if(A&&!O){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(A.toLowerCase()))&&(J.push(!A||e.label===A),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(A.toLowerCase()))||(null===(r=e.searchKey)||void 0===r?void 0:r.toLowerCase().includes(A.toLowerCase()))?(J.push(!A||e.label===A),e):null}return e})).filter((e=>null!==e)),U=!!f&&A&&0===Q.length;return e.jsxs(a.OpennedDropdownContainer,Object.assign({version:q,ref:N,style:{width:z}},{children:[e.jsxs("div",Object.assign({style:{width:I?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!f&&e.jsx(p.SearchBox,{onSearch:F,version:q}),Q.length||A?e.jsxs(a.MenuListContainer,Object.assign({minHeight:W,maxHeight:G},{children:[!!g&&!U&&C&&e.jsx(u.SelectAllMenu,{version:q,options:A&&O?k:L,onSelect:H}),!w&&U&&e.jsx(d.SearchZeroState,{height:G,searchedString:A}),w&&(U||!!J.length&&J.every((e=>!1===e)))&&e.jsx(i.FreeFormMenu,{version:q,isMultiSelect:g,onSelect:T,searchedString:A}),e.jsx(l.MenuList,{version:q,onSelect:B,showDescription:function(e,t){K(e&&t?{title:e,description:t}:null)},isMultiSelect:g,options:Q})]})):e.jsx("div",Object.assign({style:{height:W,display:"flex"}},{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."})})),!!g&&!(!Q.length&&!A)&&"2.0"!==q&&e.jsx(c.default,{onClear:Z,onApply:P,list:A&&O?k:L,buttonText:D})]})),!!I&&e.jsx(o.Description,{title:I.title,description:I.description,version:q})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../../zeroState/ZeroState.js"),s=require("../../../../hooks/useOutside.js"),n=require("../../hooks/useDropdown.js"),o=require("./description/Description.js"),i=require("./menu/FreeFormMenu.js"),l=require("./menu/MenuList.js"),u=require("./menu/SelectAllMenu.js"),c=require("./multiSelect/MultiSelectDropdownBottomBar.js"),a=require("./OpennedDropdown.styled.js"),p=require("./searchbox/SearchBox.js"),d=require("./searchbox/SearchZeroState.js");const h=304,S=290;exports.OpenedDropdown=j=>{let{options:x,isSearchable:f,isMultiSelect:g,width:v,allowFreeForm:w,height:b,onClose:y,onSelect:m,onSearch:O,version:q,skipSorting:M,hideSelectAll:C,primaryButtonText:D}=j;const{dropdownOptions:L,search:F,searchedString:A,searchedOptions:k,onApplyHandler:B,selectAllHandler:H,onMultiSelectClear:Z,onFreeFormSelect:T,onMultiSelectApply:P,latestDropdownOptionsRef:R,getSelectedOptions:_}=n.useDropdown(q,x,m,M,g,O),[z,E]=t.useState(null!=v?v:S),[I,K]=t.useState(null),N=t.useRef(null);s.useOutside(N,(()=>{if(K(null),g&&"2.0"===q){const e=_(R.current);null==y||y(e)}else null==y||y(L)}));const W=null!=b?b:h,G="number"==typeof W?f&&g?W-96:f&&!g||!f&&g?W-48:W:W;t.useEffect((()=>{const e=null!=v?v:S;if(null===I)E(e);else if("number"==typeof e)E(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));E(t)}}),[I]);const J=[],Q=(A&&O?k:L).map((e=>{var t,r;if(A&&!O){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(A.toLowerCase()))&&(J.push(!A||e.label===A),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(A.toLowerCase()))||(null===(r=e.searchKey)||void 0===r?void 0:r.toLowerCase().includes(A.toLowerCase()))?(J.push(!A||e.label===A),e):null}return e})).filter((e=>null!==e)),U=!!f&&A&&0===Q.length;return e.jsxs(a.OpennedDropdownContainer,Object.assign({version:q,ref:N,style:{width:z}},{children:[e.jsxs("div",Object.assign({style:{width:I?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!f&&e.jsx(p.SearchBox,{onSearch:F,version:q}),Q.length||A?e.jsxs(a.MenuListContainer,Object.assign({minHeight:W,maxHeight:G},{children:[!!g&&!U&&!C&&e.jsx(u.SelectAllMenu,{version:q,options:A&&O?k:L,onSelect:H}),!w&&U&&e.jsx(d.SearchZeroState,{height:G,searchedString:A}),w&&(U||!!J.length&&J.every((e=>!1===e)))&&e.jsx(i.FreeFormMenu,{version:q,isMultiSelect:g,onSelect:T,searchedString:A}),e.jsx(l.MenuList,{version:q,onSelect:B,showDescription:function(e,t){K(e&&t?{title:e,description:t}:null)},isMultiSelect:g,options:Q})]})):e.jsx("div",Object.assign({style:{height:W,display:"flex"}},{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."})})),!!g&&!(!Q.length&&!A)&&"2.0"!==q&&e.jsx(c.default,{onClear:Z,onApply:P,list:A&&O?k:L,buttonText:D})]})),!!I&&e.jsx(o.Description,{title:I.title,description:I.description,version:q})]}))};
@@ -8,5 +8,6 @@ export type RadioButtonProps = {
8
8
  skipHoverState?: boolean;
9
9
  size?: 'DEFAULT' | 'SMALL';
10
10
  labelSize?: 'DEFAULT' | 'MEDIUM';
11
+ boldOnChecked?: boolean;
11
12
  };
12
13
  export declare const RadioButton: React.FC<RadioButtonProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),s=require("./RadioButton.styled.js"),t=require("../TypographyStyle.js"),l=require("../../constants/Theme.js");const a=i=>{const s=i.isDisabled?l.COLORS.content.inactive:i.isActive?l.COLORS.background.positive.vibrant:l.COLORS.content.primary;return e.jsxs("svg",Object.assign({width:i.isSmall?"16":"20",height:i.isSmall?"16":"20",viewBox:i.isSmall?"0 0 16 16":"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e.jsx("circle",{cx:i.isSmall?"8":"10",cy:i.isSmall?"8":"10",r:i.isSmall?6:9,stroke:s,strokeWidth:i.isSmall?1.5:2}),i.isActive&&e.jsx("circle",{cx:i.isSmall?"8":"10",cy:i.isSmall?"8":"10",r:i.isSmall?3:5,fill:i.isDisabled?l.COLORS.content.inactive:l.COLORS.background.positive.vibrant})]}))};exports.RadioButton=r=>{const[o,n]=i.useState(r.isActive||!1),[c,d]=i.useState(!1),[S,b]=i.useState(!1);i.useEffect((()=>{n(r.isActive)}),[r.isActive]);return e.jsxs(s.RadioButtonContainer,Object.assign({onClick:()=>{var e;if(!r.isDisabled){const i=!o;n(i),null===(e=r.onValueChange)||void 0===e||e.call(r,i,r.value)}},onMouseEnter:()=>d(!r.skipHoverState),onMouseLeave:()=>d(!1),onMouseDown:()=>b(!r.skipHoverState),onMouseUp:()=>b(!1)},{children:[e.jsx(s.RadioButtonIcon,Object.assign({checked:o,hovered:c,clicked:S,isDisabled:r.isDisabled||!1,size:r.size},{children:e.jsx(a,{isSmall:"SMALL"===r.size,isActive:o,isDisabled:r.isDisabled||!1})})),r.label?"SMALL"===r.size?e.jsx(t.BodyCaption,Object.assign({color:r.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:r.label})):"MEDIUM"===r.labelSize?e.jsx(t.BodySecondary,Object.assign({color:r.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:r.label})):e.jsx(t.BodyPrimary,Object.assign({color:r.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:r.label})):e.jsx(e.Fragment,{})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),s=require("./RadioButton.styled.js"),t=require("../TypographyStyle.js"),l=require("../../constants/Theme.js");const a=i=>{const s=i.isDisabled?l.COLORS.content.inactive:i.isActive?l.COLORS.background.positive.vibrant:l.COLORS.content.primary;return e.jsxs("svg",Object.assign({width:i.isSmall?"16":"20",height:i.isSmall?"16":"20",viewBox:i.isSmall?"0 0 16 16":"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e.jsx("circle",{cx:i.isSmall?"8":"10",cy:i.isSmall?"8":"10",r:i.isSmall?6:9,stroke:s,strokeWidth:i.isSmall?1.5:2}),i.isActive&&e.jsx("circle",{cx:i.isSmall?"8":"10",cy:i.isSmall?"8":"10",r:i.isSmall?3:5,fill:i.isDisabled?l.COLORS.content.inactive:l.COLORS.background.positive.vibrant})]}))};exports.RadioButton=r=>{const[o,n]=i.useState(r.isActive||!1),[c,d]=i.useState(!1),[O,S]=i.useState(!1);i.useEffect((()=>{n(r.isActive)}),[r.isActive]);return e.jsxs(s.RadioButtonContainer,Object.assign({onClick:()=>{var e;if(!r.isDisabled){const i=!o;n(i),null===(e=r.onValueChange)||void 0===e||e.call(r,i,r.value)}},onMouseEnter:()=>d(!r.skipHoverState),onMouseLeave:()=>d(!1),onMouseDown:()=>S(!r.skipHoverState),onMouseUp:()=>S(!1)},{children:[e.jsx(s.RadioButtonIcon,Object.assign({checked:o,hovered:c,clicked:O,isDisabled:r.isDisabled||!1,size:r.size},{children:e.jsx(a,{isSmall:"SMALL"===r.size,isActive:o,isDisabled:r.isDisabled||!1})})),r.label?r.boldOnChecked&&o?e.jsx(t.TitleSmall,Object.assign({color:r.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:r.label})):"SMALL"===r.size?e.jsx(t.BodyCaption,Object.assign({color:r.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:r.label})):"MEDIUM"===r.labelSize?e.jsx(t.BodySecondary,Object.assign({color:r.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:r.label})):e.jsx(t.BodyPrimary,Object.assign({color:r.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:r.label})):e.jsx(e.Fragment,{})]}))};
@@ -11,5 +11,6 @@ export type CheckBoxProps = {
11
11
  labelSize?: 'DEFAULT' | 'SMALL';
12
12
  rightComponent?: JSX.Element;
13
13
  checkboxBorderColor?: string;
14
+ boldOnChecked?: boolean;
14
15
  };
15
16
  export declare const CheckBox: React.FC<CheckBoxProps>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as l,useEffect as s}from"react";import{CheckboxContainer as a,CheckboxIcon as t}from"./CheckBox.styled.js";import{BodyPrimary as r,BodySecondary as o}from"../TypographyStyle.js";import{COLORS as n}from"../../constants/Theme.js";const d=l=>e("svg",Object.assign({width:l.isSmall?"16":"18",height:l.isSmall?"16":"18",viewBox:l.isSmall?"0 0 16 16":"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[i("rect",{x:"0",y:"0",width:l.isSmall?"16":"18",height:l.isSmall?"16":"18",rx:"4",fill:l.isDisabled?n.content.inactive:n.background.positive.vibrant}),!l.isPartial&&i("svg",Object.assign({width:l.isSmall?"8":"10",height:l.isSmall?"7":"9",x:"4",y:"4",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z",fill:"white"})})),l.isPartial&&i("rect",{x:"5",y:l.isSmall?"7":"8",width:l.isSmall?"6":"8",height:"2",rx:"1",fill:n.surface.standard})]})),c=c=>{const[h,b]=l(c.isChecked||!1),[m,g]=l(c.isPartiallyChecked||!1),[S,p]=l(c.isDisabled||!1),[v,x]=l(!1),[C,w]=l(!1);return s((()=>{b(c.isChecked)}),[c.isChecked]),s((()=>{p(c.isDisabled||!1)}),[c.isDisabled]),s((()=>{g(c.isPartiallyChecked||!1)}),[c.isPartiallyChecked]),e(a,Object.assign({onClick:e=>{var i;if(!c.isDisabled){const l=!h;m?g(!m):b(l),null===(i=c.onValueChange)||void 0===i||i.call(c,l,c.value,e)}},onMouseEnter:()=>x(!c.skipHoverState),onMouseLeave:()=>x(!1),onMouseDown:()=>w(!c.skipHoverState),onMouseUp:()=>w(!1)},{children:[i(t,Object.assign({checked:h,hovered:v,clicked:C,isDisabled:S,size:c.size,borderColor:c.checkboxBorderColor},{children:h&&i(d,{isPartial:m||!1,isDisabled:S,isSmall:"SMALL"===c.size})})),c.label&&"SMALL"!==c.size&&"SMALL"!==c.labelSize&&i(r,Object.assign({color:c.isDisabled?n.text.disabled:n.text.primary},{children:c.label})),c.label&&("SMALL"===c.size||"SMALL"===c.labelSize)&&i(o,Object.assign({color:c.isDisabled?n.text.disabled:n.text.primary},{children:c.label})),c.rightComponent]}))};export{c as CheckBox};
1
+ import{jsxs as e,jsx as i,Fragment as l}from"react/jsx-runtime";import{useState as s,useEffect as t}from"react";import{CheckboxContainer as a,CheckboxIcon as r}from"./CheckBox.styled.js";import{TitleSmall as o,BodySecondary as d,BodyPrimary as n}from"../TypographyStyle.js";import{COLORS as c}from"../../constants/Theme.js";const h=l=>e("svg",Object.assign({width:l.isSmall?"16":"18",height:l.isSmall?"16":"18",viewBox:l.isSmall?"0 0 16 16":"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[i("rect",{x:"0",y:"0",width:l.isSmall?"16":"18",height:l.isSmall?"16":"18",rx:"4",fill:l.isDisabled?c.content.inactive:c.background.positive.vibrant}),!l.isPartial&&i("svg",Object.assign({width:l.isSmall?"8":"10",height:l.isSmall?"7":"9",x:"4",y:"4",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z",fill:"white"})})),l.isPartial&&i("rect",{x:"5",y:l.isSmall?"7":"8",width:l.isSmall?"6":"8",height:"2",rx:"1",fill:c.surface.standard})]})),b=b=>{const[m,g]=s(b.isChecked||!1),[p,x]=s(b.isPartiallyChecked||!1),[v,C]=s(b.isDisabled||!1),[S,w]=s(!1),[k,f]=s(!1);t((()=>{g(b.isChecked)}),[b.isChecked]),t((()=>{C(b.isDisabled||!1)}),[b.isDisabled]),t((()=>{x(b.isPartiallyChecked||!1)}),[b.isPartiallyChecked]);return e(a,Object.assign({onClick:e=>{var i;if(!b.isDisabled){const l=!m;p?x(!p):g(l),null===(i=b.onValueChange)||void 0===i||i.call(b,l,b.value,e)}},onMouseEnter:()=>w(!b.skipHoverState),onMouseLeave:()=>w(!1),onMouseDown:()=>f(!b.skipHoverState),onMouseUp:()=>f(!1)},{children:[i(r,Object.assign({checked:m,hovered:S,clicked:k,isDisabled:v,size:b.size,borderColor:b.checkboxBorderColor},{children:m&&i(h,{isPartial:p||!1,isDisabled:v,isSmall:"SMALL"===b.size})})),b.label?b.boldOnChecked&&m?i(o,Object.assign({color:b.isDisabled?c.text.disabled:c.text.primary},{children:b.label})):"SMALL"===b.size||"SMALL"===b.labelSize?i(d,Object.assign({color:b.isDisabled?c.text.disabled:c.text.primary},{children:b.label})):i(n,Object.assign({color:b.isDisabled?c.text.disabled:c.text.primary},{children:b.label})):i(l,{}),b.rightComponent]}))};export{b as CheckBox};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useRef as r,useEffect as i}from"react";import{ZeroState as n}from"../../../zeroState/ZeroState.js";import{useOutside as l}from"../../../../hooks/useOutside.js";import{useDropdown as s}from"../../hooks/useDropdown.js";import{Description as c}from"./description/Description.js";import{FreeFormMenu as a}from"./menu/FreeFormMenu.js";import{MenuList as p}from"./menu/MenuList.js";import{SelectAllMenu as u}from"./menu/SelectAllMenu.js";import d from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as h,MenuListContainer as m}from"./OpennedDropdown.styled.js";import{SearchBox as f}from"./searchbox/SearchBox.js";import{SearchZeroState as S}from"./searchbox/SearchZeroState.js";const g=304,b=290,v=v=>{let{options:j,isSearchable:w,isMultiSelect:y,width:x,allowFreeForm:O,height:C,onClose:M,onSelect:D,onSearch:L,version:A,skipSorting:F,hideSelectAll:k,primaryButtonText:B}=v;const{dropdownOptions:H,search:T,searchedString:Z,searchedOptions:q,onApplyHandler:z,selectAllHandler:I,onMultiSelectClear:K,onFreeFormSelect:N,onMultiSelectApply:P,latestDropdownOptionsRef:R,getSelectedOptions:W}=s(A,j,D,F,y,L),[E,G]=o(null!=x?x:b),[J,Q]=o(null),U=r(null);l(U,(()=>{if(Q(null),y&&"2.0"===A){const e=W(R.current);null==M||M(e)}else null==M||M(H)}));const V=null!=C?C:g,X="number"==typeof V?w&&y?V-96:w&&!y||!w&&y?V-48:V:V;i((()=>{const e=null!=x?x:b;if(null===J)G(e);else if("number"==typeof e)G(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));G(t)}}),[J]);const Y=[],$=(Z&&L?q:H).map((e=>{var t,o;if(Z&&!L){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(Z.toLowerCase()))&&(Y.push(!Z||e.label===Z),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(Z.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(Z.toLowerCase()))?(Y.push(!Z||e.label===Z),e):null}return e})).filter((e=>null!==e)),_=!!w&&Z&&0===$.length;return e(h,Object.assign({version:A,ref:U,style:{width:E}},{children:[e("div",Object.assign({style:{width:J?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!w&&t(f,{onSearch:T,version:A}),$.length||Z?e(m,Object.assign({minHeight:V,maxHeight:X},{children:[!!y&&!_&&k&&t(u,{version:A,options:Z&&L?q:H,onSelect:I}),!O&&_&&t(S,{height:X,searchedString:Z}),O&&(_||!!Y.length&&Y.every((e=>!1===e)))&&t(a,{version:A,isMultiSelect:y,onSelect:N,searchedString:Z}),t(p,{version:A,onSelect:z,showDescription:function(e,t){Q(e&&t?{title:e,description:t}:null)},isMultiSelect:y,options:$})]})):t("div",Object.assign({style:{height:V,display:"flex"}},{children:t(n,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})),!!y&&!(!$.length&&!Z)&&"2.0"!==A&&t(d,{onClear:K,onApply:P,list:Z&&L?q:H,buttonText:B})]})),!!J&&t(c,{title:J.title,description:J.description,version:A})]}))};export{v as OpenedDropdown};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useRef as r,useEffect as i}from"react";import{ZeroState as n}from"../../../zeroState/ZeroState.js";import{useOutside as l}from"../../../../hooks/useOutside.js";import{useDropdown as s}from"../../hooks/useDropdown.js";import{Description as c}from"./description/Description.js";import{FreeFormMenu as a}from"./menu/FreeFormMenu.js";import{MenuList as p}from"./menu/MenuList.js";import{SelectAllMenu as u}from"./menu/SelectAllMenu.js";import d from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as h,MenuListContainer as m}from"./OpennedDropdown.styled.js";import{SearchBox as f}from"./searchbox/SearchBox.js";import{SearchZeroState as S}from"./searchbox/SearchZeroState.js";const g=304,b=290,v=v=>{let{options:j,isSearchable:w,isMultiSelect:y,width:x,allowFreeForm:O,height:C,onClose:M,onSelect:D,onSearch:L,version:A,skipSorting:F,hideSelectAll:k,primaryButtonText:B}=v;const{dropdownOptions:H,search:T,searchedString:Z,searchedOptions:q,onApplyHandler:z,selectAllHandler:I,onMultiSelectClear:K,onFreeFormSelect:N,onMultiSelectApply:P,latestDropdownOptionsRef:R,getSelectedOptions:W}=s(A,j,D,F,y,L),[E,G]=o(null!=x?x:b),[J,Q]=o(null),U=r(null);l(U,(()=>{if(Q(null),y&&"2.0"===A){const e=W(R.current);null==M||M(e)}else null==M||M(H)}));const V=null!=C?C:g,X="number"==typeof V?w&&y?V-96:w&&!y||!w&&y?V-48:V:V;i((()=>{const e=null!=x?x:b;if(null===J)G(e);else if("number"==typeof e)G(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));G(t)}}),[J]);const Y=[],$=(Z&&L?q:H).map((e=>{var t,o;if(Z&&!L){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(Z.toLowerCase()))&&(Y.push(!Z||e.label===Z),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(Z.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(Z.toLowerCase()))?(Y.push(!Z||e.label===Z),e):null}return e})).filter((e=>null!==e)),_=!!w&&Z&&0===$.length;return e(h,Object.assign({version:A,ref:U,style:{width:E}},{children:[e("div",Object.assign({style:{width:J?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!w&&t(f,{onSearch:T,version:A}),$.length||Z?e(m,Object.assign({minHeight:V,maxHeight:X},{children:[!!y&&!_&&!k&&t(u,{version:A,options:Z&&L?q:H,onSelect:I}),!O&&_&&t(S,{height:X,searchedString:Z}),O&&(_||!!Y.length&&Y.every((e=>!1===e)))&&t(a,{version:A,isMultiSelect:y,onSelect:N,searchedString:Z}),t(p,{version:A,onSelect:z,showDescription:function(e,t){Q(e&&t?{title:e,description:t}:null)},isMultiSelect:y,options:$})]})):t("div",Object.assign({style:{height:V,display:"flex"}},{children:t(n,{title:"No results found",subTitle:"Please try again later or contact us at support@bik.ai if you require further assistance."})})),!!y&&!(!$.length&&!Z)&&"2.0"!==A&&t(d,{onClear:K,onApply:P,list:Z&&L?q:H,buttonText:B})]})),!!J&&t(c,{title:J.title,description:J.description,version:A})]}))};export{v as OpenedDropdown};
@@ -8,5 +8,6 @@ export type RadioButtonProps = {
8
8
  skipHoverState?: boolean;
9
9
  size?: 'DEFAULT' | 'SMALL';
10
10
  labelSize?: 'DEFAULT' | 'MEDIUM';
11
+ boldOnChecked?: boolean;
11
12
  };
12
13
  export declare const RadioButton: React.FC<RadioButtonProps>;
@@ -1 +1 @@
1
- import{jsxs as i,jsx as e,Fragment as s}from"react/jsx-runtime";import{useState as l,useEffect as t}from"react";import{RadioButtonContainer as a,RadioButtonIcon as o}from"./RadioButton.styled.js";import{BodyCaption as r,BodySecondary as c,BodyPrimary as n}from"../TypographyStyle.js";import{COLORS as d}from"../../constants/Theme.js";const b=s=>{const l=s.isDisabled?d.content.inactive:s.isActive?d.background.positive.vibrant:d.content.primary;return i("svg",Object.assign({width:s.isSmall?"16":"20",height:s.isSmall?"16":"20",viewBox:s.isSmall?"0 0 16 16":"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?6:9,stroke:l,strokeWidth:s.isSmall?1.5:2}),s.isActive&&e("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?3:5,fill:s.isDisabled?d.content.inactive:d.background.positive.vibrant})]}))},m=m=>{const[v,p]=l(m.isActive||!1),[S,h]=l(!1),[g,u]=l(!1);t((()=>{p(m.isActive)}),[m.isActive]);return i(a,Object.assign({onClick:()=>{var i;if(!m.isDisabled){const e=!v;p(e),null===(i=m.onValueChange)||void 0===i||i.call(m,e,m.value)}},onMouseEnter:()=>h(!m.skipHoverState),onMouseLeave:()=>h(!1),onMouseDown:()=>u(!m.skipHoverState),onMouseUp:()=>u(!1)},{children:[e(o,Object.assign({checked:v,hovered:S,clicked:g,isDisabled:m.isDisabled||!1,size:m.size},{children:e(b,{isSmall:"SMALL"===m.size,isActive:v,isDisabled:m.isDisabled||!1})})),m.label?"SMALL"===m.size?e(r,Object.assign({color:m.isDisabled?d.text.disabled:d.text.primary},{children:m.label})):"MEDIUM"===m.labelSize?e(c,Object.assign({color:m.isDisabled?d.text.disabled:d.text.primary},{children:m.label})):e(n,Object.assign({color:m.isDisabled?d.text.disabled:d.text.primary},{children:m.label})):e(s,{})]}))};export{m as RadioButton};
1
+ import{jsxs as i,jsx as e,Fragment as s}from"react/jsx-runtime";import{useState as l,useEffect as t}from"react";import{RadioButtonContainer as a,RadioButtonIcon as r}from"./RadioButton.styled.js";import{TitleSmall as o,BodyCaption as c,BodySecondary as n,BodyPrimary as d}from"../TypographyStyle.js";import{COLORS as b}from"../../constants/Theme.js";const m=s=>{const l=s.isDisabled?b.content.inactive:s.isActive?b.background.positive.vibrant:b.content.primary;return i("svg",Object.assign({width:s.isSmall?"16":"20",height:s.isSmall?"16":"20",viewBox:s.isSmall?"0 0 16 16":"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?6:9,stroke:l,strokeWidth:s.isSmall?1.5:2}),s.isActive&&e("circle",{cx:s.isSmall?"8":"10",cy:s.isSmall?"8":"10",r:s.isSmall?3:5,fill:s.isDisabled?b.content.inactive:b.background.positive.vibrant})]}))},v=v=>{const[p,h]=l(v.isActive||!1),[S,g]=l(!1),[x,u]=l(!1);t((()=>{h(v.isActive)}),[v.isActive]);return i(a,Object.assign({onClick:()=>{var i;if(!v.isDisabled){const e=!p;h(e),null===(i=v.onValueChange)||void 0===i||i.call(v,e,v.value)}},onMouseEnter:()=>g(!v.skipHoverState),onMouseLeave:()=>g(!1),onMouseDown:()=>u(!v.skipHoverState),onMouseUp:()=>u(!1)},{children:[e(r,Object.assign({checked:p,hovered:S,clicked:x,isDisabled:v.isDisabled||!1,size:v.size},{children:e(m,{isSmall:"SMALL"===v.size,isActive:p,isDisabled:v.isDisabled||!1})})),v.label?v.boldOnChecked&&p?e(o,Object.assign({color:v.isDisabled?b.text.disabled:b.text.primary},{children:v.label})):"SMALL"===v.size?e(c,Object.assign({color:v.isDisabled?b.text.disabled:b.text.primary},{children:v.label})):"MEDIUM"===v.labelSize?e(n,Object.assign({color:v.isDisabled?b.text.disabled:b.text.primary},{children:v.label})):e(d,Object.assign({color:v.isDisabled?b.text.disabled:b.text.primary},{children:v.label})):e(s,{})]}))};export{v as RadioButton};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.507-beta.filter-2",
3
+ "version": "0.0.507-beta.filter-4",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",