@bikdotai/bik-component-library 0.0.643-ddli-beta.1 → 0.0.643-ddli-beta.2

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