@bikdotai/bik-component-library 0.0.627-beta-tp.0 → 0.0.627-colorFill

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