@bikdotai/bik-component-library 0.0.763-beta.32 → 0.0.763-beta.34

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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),l=require("../../constants/Theme.js"),o=require("../../assets/icons/chevronDown.svg.js"),r=require("../input/Input.js"),i=require("../input/context/InputStyleProvider.js"),s=require("./ChipInput.js"),a=require("./DropdownPopover/index.js"),d=require("./OpenedDropdown/utils/iterationOnOptions.js");function u(){}const c=c=>{var p,h,v,x,g,{placeHolder:f,size:j,onSelect:m,defaultOptions:w,disabled:b,noErrorHint:O,placeHolderHeight:S,showPlaceholderWhenSelected:y=!1,inputStyle:I={},inputType:H="default",onDeleteChip:D,truncatedText:P,showLeadingIconInPlaceholder:T=!1,showTrailingIconPlaceholder:q=!1,showLabelsOnMoreHover:C=!1}=c,E=e.__rest(c,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover"]);const[W,L]=n.useState(!1),M=null!=j?j:"default",_=n.useRef(),[z,A]=n.useState(null!=w?w:[]),F=n.useRef(null),[R,k]=n.useState(null);n.useEffect((()=>{var e;const t=[];console.log(E.value),null===(e=null==E?void 0:E.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&t.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&t.push(e)})),A([...t])}),[E.options]),n.useEffect((()=>{w&&A([...w])}),[w]);const N=d.getSelectedOptionsAsText(z),U=y?f:null!==(p=null!=N?N:f)&&void 0!==p?p:"Select an option";n.useEffect((()=>{if(F.current){const e=F.current.scrollWidth;k(e+("x-small"===M?16:"small"===M?20:24)+2*("x-small"===M?16:12)+8+2)}}),[U,M]);const V=null!==(v=null!==(h=E.buttonWidth)&&void 0!==h?h:E.inputWidth)&&void 0!==v?v:"100%",$=R?`${R}px`:V;return t.jsxs(t.Fragment,{children:[t.jsx("span",Object.assign({ref:F,style:{position:"absolute",visibility:"hidden",whiteSpace:"nowrap",fontSize:"x-small"===M?"12px":"small"===M?"14px":"16px",fontFamily:"Inter"}},{children:U})),t.jsx(i.InputStyleContext.Provider,Object.assign({value:{InputWrapper:Object.assign({height:S||("x-small"===M?24:"small"===M?32:48),width:$,maxWidth:V,zIndex:1,cursor:"pointer",padding:"x-small"===M?"4px 8px":"6px 8px"},I),input:{minHeight:"100%",maxWidth:"100%"}}},{children:t.jsxs(a.DropdownPopover,Object.assign({"data-test":E["data-test"],ref:_,onSelect:function(e){Array.isArray(e)?A([...e]):A([e]),null==m||m(e)},disabled:b,onDropdownVisbilityChange:e=>L(e)},E,{children:["default"==H&&t.jsx(r.Input,{version:E.version,noErrorHint:O,state:b?"disabled":"none",value:void 0===E.value?U:E.value,errorMessage:E.error,variant:M,placeholder:null!=f?f:"Select an option",onChangeText:u,leftIcon:T&&(null===(x=z[0])||void 0===x?void 0:x.leadingIcon)?{icon:()=>{var e;return t.jsx(t.Fragment,{children:null===(e=z[0])||void 0===e?void 0:e.leadingIcon})}}:void 0,rightIcon:{icon:()=>{var e;return t.jsxs("div",Object.assign({style:{display:"flex"}},{children:[q&&(null===(e=z[0])||void 0===e?void 0:e.trailingIcon),t.jsx(o.default,{style:{transform:W?"rotate(180deg)":"rotate(0deg)"},onClick:u,width:"x-small"===M?16:"small"===M?20:24,height:"x-small"===M?16:"small"===M?20:24,color:l.COLORS.content.primary})]}))}},truncateText:null==P||P}),"chip"==H&&t.jsx(s.default,{placeholder:null!=f?f:"Select options",chips:z,onDeleteChip:e=>{null==D||D(e)},errorMessage:E.error,isDropdownOpened:W,sizeToUse:M,containerStyle:{width:null!==(g=E.width)&&void 0!==g?g:"100%",cursor:"pointer"},showLabelsOnMoreHover:C})]}))}))]})};c.displayName="Dropdown",exports.Dropdown=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),t=require("react"),o=require("../../constants/Theme.js"),l=require("../../assets/icons/chevronDown.svg.js"),r=require("../input/Input.js"),i=require("../input/context/InputStyleProvider.js"),s=require("./ChipInput.js"),a=require("./DropdownPopover/index.js"),d=require("./OpenedDropdown/utils/iterationOnOptions.js");function u(){}const c=c=>{var p,h,v,x,g,{placeHolder:f,size:j,onSelect:b,defaultOptions:m,disabled:w,noErrorHint:O,placeHolderHeight:S,showPlaceholderWhenSelected:y=!1,inputStyle:I={},inputType:E="default",onDeleteChip:C,truncatedText:H,showLeadingIconInPlaceholder:D=!1,showTrailingIconPlaceholder:P=!1,showLabelsOnMoreHover:T=!1}=c,q=e.__rest(c,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover"]);const[M,W]=t.useState(!1),[L,_]=t.useState(!1),z=null!=j?j:"default",k=t.useRef(),[A,F]=t.useState(null!=m?m:[]),R=t.useRef(null),[N,U]=t.useState(null);t.useEffect((()=>{var e;const n=[];console.log(q.value),null===(e=null==q?void 0:q.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&n.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&n.push(e)})),F([...n])}),[q.options]),t.useEffect((()=>{m&&F([...m])}),[m]);const V=d.getSelectedOptionsAsText(A),$=y?f:null!==(p=null!=V?V:f)&&void 0!==p?p:"Select an option";t.useEffect((()=>{if(R.current){const e=R.current.scrollWidth;U(e+("x-small"===z?16:"small"===z?20:24)+2*("x-small"===z?16:12)+8+2)}}),[$,z]);const B=null!==(v=null!==(h=q.buttonWidth)&&void 0!==h?h:q.inputWidth)&&void 0!==v?v:"100%",G=N?`${N}px`:B;return n.jsxs(n.Fragment,{children:[n.jsx("span",Object.assign({ref:R,style:{position:"absolute",visibility:"hidden",whiteSpace:"nowrap",fontSize:"x-small"===z?"12px":"small"===z?"14px":"16px",fontFamily:"Inter"}},{children:$})),n.jsx(i.InputStyleContext.Provider,Object.assign({value:{InputWrapper:Object.assign({height:S||("x-small"===z?24:"small"===z?32:48),width:G,maxWidth:B,zIndex:1,cursor:"pointer",padding:"x-small"===z?"4px 8px":"6px 8px",backgroundColor:M||A.length>0?"#C3E4C4":L?"#E0E0E0":"transparent",transition:"backgroundColor 0.3s ease"},I),input:{minHeight:"100%",maxWidth:"100%",color:A.length>0?"#00580E":"inherit"}}},{children:n.jsx("div",Object.assign({onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},{children:n.jsxs(a.DropdownPopover,Object.assign({"data-test":q["data-test"],ref:k,onSelect:function(e){Array.isArray(e)?F([...e]):F([e]),null==b||b(e)},disabled:w,onDropdownVisbilityChange:e=>W(e)},q,{children:["default"==E&&n.jsx(r.Input,{version:q.version,noErrorHint:O,state:w?"disabled":"none",value:void 0===q.value?$:q.value,errorMessage:q.error,variant:z,placeholder:null!=f?f:"Select an option",onChangeText:u,leftIcon:D&&(null===(x=A[0])||void 0===x?void 0:x.leadingIcon)?{icon:()=>{var e;return n.jsx(n.Fragment,{children:null===(e=A[0])||void 0===e?void 0:e.leadingIcon})}}:void 0,rightIcon:{icon:()=>{var e;return n.jsxs("div",Object.assign({style:{display:"flex"}},{children:[P&&(null===(e=A[0])||void 0===e?void 0:e.trailingIcon),n.jsx(l.default,{style:{transform:M?"rotate(180deg)":"rotate(0deg)"},onClick:u,width:"x-small"===z?16:"small"===z?20:24,height:"x-small"===z?16:"small"===z?20:24,color:o.COLORS.content.primary})]}))}},truncateText:null==H||H}),"chip"==E&&n.jsx(s.default,{placeholder:null!=f?f:"Select options",chips:A,onDeleteChip:e=>{null==C||C(e)},errorMessage:q.error,isDropdownOpened:M,sizeToUse:z,containerStyle:{width:null!==(g=q.width)&&void 0!==g?g:"100%",cursor:"pointer"},showLabelsOnMoreHover:T})]}))}))}))]})};c.displayName="Dropdown",exports.Dropdown=c;
@@ -1 +1 @@
1
- import{__rest as e}from"../../_virtual/_tslib.js";import{jsxs as o,Fragment as n,jsx as l}from"react/jsx-runtime";import{useState as t,useRef as i,useEffect as r}from"react";import{COLORS as s}from"../../constants/Theme.js";import a from"../../assets/icons/chevronDown.svg.js";import{Input as d}from"../input/Input.js";import{InputStyleContext as c}from"../input/context/InputStyleProvider.js";import p from"./ChipInput.js";import{DropdownPopover as u}from"./DropdownPopover/index.js";import{getSelectedOptionsAsText as h}from"./OpenedDropdown/utils/iterationOnOptions.js";function m(){}const v=v=>{var g,f,x,b,w,{placeHolder:y,size:I,onSelect:j,defaultOptions:O,disabled:S,noErrorHint:H,placeHolderHeight:T,showPlaceholderWhenSelected:D=!1,inputStyle:P={},inputType:W="default",onDeleteChip:C,truncatedText:z,showLeadingIconInPlaceholder:E=!1,showTrailingIconPlaceholder:L=!1,showLabelsOnMoreHover:M=!1}=v,A=e(v,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover"]);const[_,k]=t(!1),F=null!=I?I:"default",N=i(),[U,V]=t(null!=O?O:[]),$=i(null),[q,B]=t(null);r((()=>{var e;const o=[];console.log(A.value),null===(e=null==A?void 0:A.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&o.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&o.push(e)})),V([...o])}),[A.options]),r((()=>{O&&V([...O])}),[O]);const G=h(U),J=D?y:null!==(g=null!=G?G:y)&&void 0!==g?g:"Select an option";r((()=>{if($.current){const e=$.current.scrollWidth;B(e+("x-small"===F?16:"small"===F?20:24)+2*("x-small"===F?16:12)+8+2)}}),[J,F]);const K=null!==(x=null!==(f=A.buttonWidth)&&void 0!==f?f:A.inputWidth)&&void 0!==x?x:"100%",Q=q?`${q}px`:K;return o(n,{children:[l("span",Object.assign({ref:$,style:{position:"absolute",visibility:"hidden",whiteSpace:"nowrap",fontSize:"x-small"===F?"12px":"small"===F?"14px":"16px",fontFamily:"Inter"}},{children:J})),l(c.Provider,Object.assign({value:{InputWrapper:Object.assign({height:T||("x-small"===F?24:"small"===F?32:48),width:Q,maxWidth:K,zIndex:1,cursor:"pointer",padding:"x-small"===F?"4px 8px":"6px 8px"},P),input:{minHeight:"100%",maxWidth:"100%"}}},{children:o(u,Object.assign({"data-test":A["data-test"],ref:N,onSelect:function(e){Array.isArray(e)?V([...e]):V([e]),null==j||j(e)},disabled:S,onDropdownVisbilityChange:e=>k(e)},A,{children:["default"==W&&l(d,{version:A.version,noErrorHint:H,state:S?"disabled":"none",value:void 0===A.value?J:A.value,errorMessage:A.error,variant:F,placeholder:null!=y?y:"Select an option",onChangeText:m,leftIcon:E&&(null===(b=U[0])||void 0===b?void 0:b.leadingIcon)?{icon:()=>{var e;return l(n,{children:null===(e=U[0])||void 0===e?void 0:e.leadingIcon})}}:void 0,rightIcon:{icon:()=>{var e;return o("div",Object.assign({style:{display:"flex"}},{children:[L&&(null===(e=U[0])||void 0===e?void 0:e.trailingIcon),l(a,{style:{transform:_?"rotate(180deg)":"rotate(0deg)"},onClick:m,width:"x-small"===F?16:"small"===F?20:24,height:"x-small"===F?16:"small"===F?20:24,color:s.content.primary})]}))}},truncateText:null==z||z}),"chip"==W&&l(p,{placeholder:null!=y?y:"Select options",chips:U,onDeleteChip:e=>{null==C||C(e)},errorMessage:A.error,isDropdownOpened:_,sizeToUse:F,containerStyle:{width:null!==(w=A.width)&&void 0!==w?w:"100%",cursor:"pointer"},showLabelsOnMoreHover:M})]}))}))]})};v.displayName="Dropdown";export{v as Dropdown};
1
+ import{__rest as e}from"../../_virtual/_tslib.js";import{jsxs as o,Fragment as n,jsx as l}from"react/jsx-runtime";import{useState as t,useRef as i,useEffect as r}from"react";import{COLORS as s}from"../../constants/Theme.js";import a from"../../assets/icons/chevronDown.svg.js";import{Input as d}from"../input/Input.js";import{InputStyleContext as c}from"../input/context/InputStyleProvider.js";import p from"./ChipInput.js";import{DropdownPopover as u}from"./DropdownPopover/index.js";import{getSelectedOptionsAsText as h}from"./OpenedDropdown/utils/iterationOnOptions.js";function m(){}const v=v=>{var g,f,x,b,w,{placeHolder:j,size:y,onSelect:I,defaultOptions:O,disabled:S,noErrorHint:H,placeHolderHeight:C,showPlaceholderWhenSelected:E=!1,inputStyle:T={},inputType:D="default",onDeleteChip:P,truncatedText:W,showLeadingIconInPlaceholder:M=!1,showTrailingIconPlaceholder:L=!1,showLabelsOnMoreHover:z=!1}=v,k=e(v,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover"]);const[A,_]=t(!1),[F,N]=t(!1),U=null!=y?y:"default",V=i(),[$,q]=t(null!=O?O:[]),B=i(null),[G,J]=t(null);r((()=>{var e;const o=[];console.log(k.value),null===(e=null==k?void 0:k.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&o.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&o.push(e)})),q([...o])}),[k.options]),r((()=>{O&&q([...O])}),[O]);const K=h($),Q=E?j:null!==(g=null!=K?K:j)&&void 0!==g?g:"Select an option";r((()=>{if(B.current){const e=B.current.scrollWidth;J(e+("x-small"===U?16:"small"===U?20:24)+2*("x-small"===U?16:12)+8+2)}}),[Q,U]);const R=null!==(x=null!==(f=k.buttonWidth)&&void 0!==f?f:k.inputWidth)&&void 0!==x?x:"100%",X=G?`${G}px`:R;return o(n,{children:[l("span",Object.assign({ref:B,style:{position:"absolute",visibility:"hidden",whiteSpace:"nowrap",fontSize:"x-small"===U?"12px":"small"===U?"14px":"16px",fontFamily:"Inter"}},{children:Q})),l(c.Provider,Object.assign({value:{InputWrapper:Object.assign({height:C||("x-small"===U?24:"small"===U?32:48),width:X,maxWidth:R,zIndex:1,cursor:"pointer",padding:"x-small"===U?"4px 8px":"6px 8px",backgroundColor:A||$.length>0?"#C3E4C4":F?"#E0E0E0":"transparent",transition:"backgroundColor 0.3s ease"},T),input:{minHeight:"100%",maxWidth:"100%",color:$.length>0?"#00580E":"inherit"}}},{children:l("div",Object.assign({onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1)},{children:o(u,Object.assign({"data-test":k["data-test"],ref:V,onSelect:function(e){Array.isArray(e)?q([...e]):q([e]),null==I||I(e)},disabled:S,onDropdownVisbilityChange:e=>_(e)},k,{children:["default"==D&&l(d,{version:k.version,noErrorHint:H,state:S?"disabled":"none",value:void 0===k.value?Q:k.value,errorMessage:k.error,variant:U,placeholder:null!=j?j:"Select an option",onChangeText:m,leftIcon:M&&(null===(b=$[0])||void 0===b?void 0:b.leadingIcon)?{icon:()=>{var e;return l(n,{children:null===(e=$[0])||void 0===e?void 0:e.leadingIcon})}}:void 0,rightIcon:{icon:()=>{var e;return o("div",Object.assign({style:{display:"flex"}},{children:[L&&(null===(e=$[0])||void 0===e?void 0:e.trailingIcon),l(a,{style:{transform:A?"rotate(180deg)":"rotate(0deg)"},onClick:m,width:"x-small"===U?16:"small"===U?20:24,height:"x-small"===U?16:"small"===U?20:24,color:s.content.primary})]}))}},truncateText:null==W||W}),"chip"==D&&l(p,{placeholder:null!=j?j:"Select options",chips:$,onDeleteChip:e=>{null==P||P(e)},errorMessage:k.error,isDropdownOpened:A,sizeToUse:U,containerStyle:{width:null!==(w=k.width)&&void 0!==w?w:"100%",cursor:"pointer"},showLabelsOnMoreHover:z})]}))}))}))]})};v.displayName="Dropdown";export{v as Dropdown};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.763-beta.32",
3
+ "version": "0.0.763-beta.34",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",