@bikdotai/bik-component-library 0.0.763-beta.29 → 0.0.763-beta.30

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