@bikdotai/bik-component-library 0.0.757-beta.14 → 0.0.757-beta.15

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