@bikdotai/bik-component-library 0.0.772-beta.19 → 0.0.772-beta.20

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