@bikdotai/bik-component-library 0.0.599-1 → 0.0.599

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,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Menus: ({
3
2
  displayName: string;
4
3
  key: number;
@@ -64,6 +64,5 @@ export interface InputProps {
64
64
  maxCharLimitPosition?: 'TOP' | 'BOTTOM';
65
65
  hightlightInputColor?: string;
66
66
  onKeyDownEvent?: (e: Event) => void;
67
- hideInputHeader?: boolean;
68
67
  }
69
68
  export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement | null>>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/info.svg.js"),n=require("react"),i=require("../button/Button.js"),s=require("./Input-helper.js"),r=require("../tooltips/Tooltip.js"),l=require("../TypographyStyle.js"),o=require("../../constants/Theme.js"),a=require("../../assets/icons/errorInfo.svg.js"),u=require("./context/InputStyleProvider.js"),c=require("./Input.styled.js");const d=n.forwardRef(((d,h)=>{var v,p,x,g,j,f,b;const{placeholder:m,leftIcon:y,rightIcon:C,labelText:O,maxCharLimit:I,isRequired:T,hintText:S,type:w,state:E,validate:k,variant:H,button:q,suffixText:L,prefixText:B,onChangeText:M,value:F,noErrorHint:P,reset:R,rangeValidation:D,noKeyDownChange:z,version:A,noMaxCharCheck:K,labelElement:N,autoGrow:_,minHeight:G,maxHeight:W,labelTextBold:V,truncateText:$,maxCharLimitPosition:J,hightlightInputColor:Q,onKeyDownEvent:U,hideInputHeader:X}=Object.assign({maxCharLimit:0,type:"text",variant:"default",maxCharLimitPosition:"TOP"},d),Y=null==y?void 0:y.icon,Z=null==C?void 0:C.icon,[ee,te]=n.useState(!1),[ne,ie]=n.useState(!1),[se,re]=n.useState(),le="small"===H?"18px":"22px",oe=n.useContext(u.InputStyleContext),[ae,ue]=n.useState(),ce=n.useRef(null),de=null!=h?h:ce;n.useEffect((()=>{ue(F),!F&&_&&(de.current.style.height=G||"48px")}),[F]),n.useEffect((()=>{var e;de.current&&(null===(e=d.onReferenceInit)||void 0===e||e.call(d,de.current))}),[de]),n.useEffect((()=>{const e=de.current;if(e&&["phonenumber","zip","number"].includes(w))return e.addEventListener("wheel",xe,{passive:!1}),()=>{e.removeEventListener("wheel",xe)}}),[]),n.useEffect((()=>{R&&ue("")}),[R]),n.useEffect((()=>{var e;ie(!!d.isActive),d.isActive&&(null===(e=de.current)||void 0===e||e.focus())}),[d.isActive]),n.useEffect((()=>{re(d.errorMessage)}),[d.errorMessage]),n.useEffect((()=>{var e;te(!1),("invalid"===d.state||se||"disabled-invalid"===d.state)&&te(!0),"active"===d.state&&(null===(e=de.current)||void 0===e||e.focus())}),[d.state,se]),n.useEffect((()=>{te(!!se||"invalid"===d.state)}),[se,d.state]);const he=function(e){if(s.isFunction(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];e(...n)}},ve=()=>"zip"===w?6:2e3,pe=e=>{const t=0!==I?I:ve();if(U&&U(e),z||M(F||"",e),K)return;const n=e.target.value;![8].includes(e.which)&&t>0&&n.length>=t&&e.preventDefault()},xe=e=>{e.preventDefault()},ge=e=>{let t=e.target.value;const n=0!==I?I+1:ve();!K&&n>0&&t.length>=n&&(t=t.substring(0,n-1)),M(t,e),d.textControl||ue(t),_&&(de.current.style.height=`${de.current.scrollHeight}px`,t||(de.current.style.height=G||"48px"));const i=k||s.validateInput;if(!i||!s.isFunction(i))return;const[r,l]=i(t,w,D);te(!r),re(d.errorMessage?d.errorMessage:l)},je=e=>{var t;d.skipFocus||ie(!0),he(null===(t=d.onFocus)||void 0===t?void 0:t.call(d,e))},fe=e=>{var t;d.skipFocus||ie(!1),he(null===(t=d.onBlur)||void 0===t?void 0:t.call(d,e))},be=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==w&&e.jsx("input",{className:$?"truncate-class":"","data-test":d["data-test"],id:d.id,style:null!==(t=null==oe?void 0:oe.input)&&void 0!==t?t:{},ref:de,type:["phonenumber","zip","number"].includes(w)?"number":w,value:ae,onFocus:e=>je(e),onBlur:e=>fe(e),placeholder:m||"Enter here",onChange:ge,onClick:e=>he(d.onClick),onKeyDown:e=>pe(e)}),"multiline"===w&&e.jsx("textarea",{"data-test":d["data-test"],value:ae,ref:de,onFocus:e=>je(e),onBlur:e=>fe(e),onClick:e=>he(d.onClick),placeholder:m||"Enter here",onChange:ge,onKeyDown:e=>pe(e),maxLength:I>0?I:void 0})]})};return e.jsxs(c.RootContainer,Object.assign({width:d.width,height:d.height,state:E,type:w,style:null!==(v=null==oe?void 0:oe.RootContainer)&&void 0!==v?v:{}},{children:[e.jsxs("div",Object.assign({className:"flex-align-center"},{children:[!P&&(!!S||!!se)&&e.jsxs(c.InputFooter,Object.assign({invalid:!!se},{children:[!!se&&e.jsx(a.default,{width:16,height:16}),se||S]})),I>0&&"BOTTOM"===J&&e.jsxs(c.MaxCharStyle,Object.assign({position:"BOTTOM"},{children:[null!==(x=null===(p=(null!=F?F:"").toString())||void 0===p?void 0:p.length)&&void 0!==x?x:0,"/",I]}))]})),e.jsxs(c.InputWrapper,Object.assign({variant:H,state:E,width:d.width,isActive:"active"===E||ne,isInvalid:ee,style:null!==(g=null==oe?void 0:oe.InputWrapper)&&void 0!==g?g:{},version:A,height:d.height,hightlightInputColor:Q},{children:[!!Y&&e.jsx(c.IconHolder,Object.assign({variant:H,iconSize:le,onClick:()=>he(null==y?void 0:y.callback),isLeft:!0,style:null!==(j=null==oe?void 0:oe.IconHolder)&&void 0!==j?j:{}},{children:e.jsx(Y,{})})),!!B&&e.jsx(c.PrefixHolder,Object.assign({variant:H},{children:B})),"default"===H&&e.jsx(c.InputContainer,Object.assign({height:d.height,type:d.type,minHeight:G,maxHeight:W,autoGrow:_},{children:be()})),"small"===H&&e.jsx(c.InputContainerSmall,Object.assign({height:d.height,type:d.type},{children:be()})),!!Z&&e.jsx(c.IconHolder,Object.assign({variant:H,iconSize:le,onClick:()=>he(null==C?void 0:C.callback),isLeft:!1},{children:e.jsx(Z,{})})),!!L&&e.jsx(c.SuffixHolder,Object.assign({variant:H},{children:L})),q&&q.text&&e.jsx(i.Button,{buttonText:q.text,onClick:()=>he(null==q?void 0:q.onClick)}),q&&q.buttonProps&&e.jsx(i.Button,Object.assign({},q.buttonProps))]})),!X&&(!!O||!!I)&&e.jsxs(c.InputHeader,Object.assign({invalid:ee},{children:[N&&N,e.jsxs("div",Object.assign({className:"label__container"},{children:[V?e.jsxs(l.TitleSmall,{children:[O,T?e.jsx("span",{children:"*"}):""]}):e.jsxs(l.BodySecondary,{children:[O,T?e.jsx("span",{children:"*"}):""]}),d.tooltipText&&e.jsx(r.Tooltip,Object.assign({body:d.tooltipText,placement:"top"},{children:e.jsx("span",{children:e.jsx(t.default,{style:{marginTop:-3},width:18,height:18,color:ee?o.COLORS.content.negative:o.COLORS.content.primary})})}))]})),I>0&&"TOP"===J&&e.jsxs(c.MaxCharStyle,{children:[null!==(b=null===(f=(null!=F?F:"").toString())||void 0===f?void 0:f.length)&&void 0!==b?b:0,"/",I]})]}))]}))}));d.displayName="Input",exports.Input=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/info.svg.js"),n=require("react"),i=require("../button/Button.js"),s=require("./Input-helper.js"),l=require("../tooltips/Tooltip.js"),r=require("../TypographyStyle.js"),o=require("../../constants/Theme.js"),a=require("../../assets/icons/errorInfo.svg.js"),u=require("./context/InputStyleProvider.js"),c=require("./Input.styled.js");const d=n.forwardRef(((d,h)=>{var v,p,x,g,j,f,b;const{placeholder:m,leftIcon:y,rightIcon:C,labelText:O,maxCharLimit:I,isRequired:T,hintText:S,type:w,state:E,validate:k,variant:q,button:H,suffixText:L,prefixText:B,onChangeText:M,value:F,noErrorHint:P,reset:R,rangeValidation:D,noKeyDownChange:z,version:A,noMaxCharCheck:K,labelElement:N,autoGrow:_,minHeight:G,maxHeight:W,labelTextBold:V,truncateText:$,maxCharLimitPosition:J,hightlightInputColor:Q,onKeyDownEvent:U}=Object.assign({maxCharLimit:0,type:"text",variant:"default",maxCharLimitPosition:"TOP"},d),X=null==y?void 0:y.icon,Y=null==C?void 0:C.icon,[Z,ee]=n.useState(!1),[te,ne]=n.useState(!1),[ie,se]=n.useState(),le="small"===q?"18px":"22px",re=n.useContext(u.InputStyleContext),[oe,ae]=n.useState(),ue=n.useRef(null),ce=null!=h?h:ue;n.useEffect((()=>{ae(F),!F&&_&&(ce.current.style.height=G||"48px")}),[F]),n.useEffect((()=>{var e;ce.current&&(null===(e=d.onReferenceInit)||void 0===e||e.call(d,ce.current))}),[ce]),n.useEffect((()=>{const e=ce.current;if(e&&["phonenumber","zip","number"].includes(w))return e.addEventListener("wheel",pe,{passive:!1}),()=>{e.removeEventListener("wheel",pe)}}),[]),n.useEffect((()=>{R&&ae("")}),[R]),n.useEffect((()=>{var e;ne(!!d.isActive),d.isActive&&(null===(e=ce.current)||void 0===e||e.focus())}),[d.isActive]),n.useEffect((()=>{se(d.errorMessage)}),[d.errorMessage]),n.useEffect((()=>{var e;ee(!1),("invalid"===d.state||ie||"disabled-invalid"===d.state)&&ee(!0),"active"===d.state&&(null===(e=ce.current)||void 0===e||e.focus())}),[d.state,ie]),n.useEffect((()=>{ee(!!ie||"invalid"===d.state)}),[ie,d.state]);const de=function(e){if(s.isFunction(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];e(...n)}},he=()=>"zip"===w?6:2e3,ve=e=>{const t=0!==I?I:he();if(U&&U(e),z||M(F||"",e),K)return;const n=e.target.value;![8].includes(e.which)&&t>0&&n.length>=t&&e.preventDefault()},pe=e=>{e.preventDefault()},xe=e=>{let t=e.target.value;const n=0!==I?I+1:he();!K&&n>0&&t.length>=n&&(t=t.substring(0,n-1)),M(t,e),d.textControl||ae(t),_&&(ce.current.style.height=`${ce.current.scrollHeight}px`,t||(ce.current.style.height=G||"48px"));const i=k||s.validateInput;if(!i||!s.isFunction(i))return;const[l,r]=i(t,w,D);ee(!l),se(d.errorMessage?d.errorMessage:r)},ge=e=>{var t;d.skipFocus||ne(!0),de(null===(t=d.onFocus)||void 0===t?void 0:t.call(d,e))},je=e=>{var t;d.skipFocus||ne(!1),de(null===(t=d.onBlur)||void 0===t?void 0:t.call(d,e))},fe=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==w&&e.jsx("input",{className:$?"truncate-class":"","data-test":d["data-test"],id:d.id,style:null!==(t=null==re?void 0:re.input)&&void 0!==t?t:{},ref:ce,type:["phonenumber","zip","number"].includes(w)?"number":w,value:oe,onFocus:e=>ge(e),onBlur:e=>je(e),placeholder:m||"Enter here",onChange:xe,onClick:e=>de(d.onClick),onKeyDown:e=>ve(e)}),"multiline"===w&&e.jsx("textarea",{"data-test":d["data-test"],value:oe,ref:ce,onFocus:e=>ge(e),onBlur:e=>je(e),onClick:e=>de(d.onClick),placeholder:m||"Enter here",onChange:xe,onKeyDown:e=>ve(e),maxLength:I>0?I:void 0})]})};return e.jsxs(c.RootContainer,Object.assign({width:d.width,height:d.height,state:E,type:w,style:null!==(v=null==re?void 0:re.RootContainer)&&void 0!==v?v:{}},{children:[e.jsxs("div",Object.assign({className:"flex-align-center"},{children:[!P&&(!!S||!!ie)&&e.jsxs(c.InputFooter,Object.assign({invalid:!!ie},{children:[!!ie&&e.jsx(a.default,{width:16,height:16}),ie||S]})),I>0&&"BOTTOM"===J&&e.jsxs(c.MaxCharStyle,Object.assign({position:"BOTTOM"},{children:[null!==(x=null===(p=(null!=F?F:"").toString())||void 0===p?void 0:p.length)&&void 0!==x?x:0,"/",I]}))]})),e.jsxs(c.InputWrapper,Object.assign({variant:q,state:E,width:d.width,isActive:"active"===E||te,isInvalid:Z,style:null!==(g=null==re?void 0:re.InputWrapper)&&void 0!==g?g:{},version:A,height:d.height,hightlightInputColor:Q},{children:[!!X&&e.jsx(c.IconHolder,Object.assign({variant:q,iconSize:le,onClick:()=>de(null==y?void 0:y.callback),isLeft:!0,style:null!==(j=null==re?void 0:re.IconHolder)&&void 0!==j?j:{}},{children:e.jsx(X,{})})),!!B&&e.jsx(c.PrefixHolder,Object.assign({variant:q},{children:B})),"default"===q&&e.jsx(c.InputContainer,Object.assign({height:d.height,type:d.type,minHeight:G,maxHeight:W,autoGrow:_},{children:fe()})),"small"===q&&e.jsx(c.InputContainerSmall,Object.assign({height:d.height,type:d.type},{children:fe()})),!!Y&&e.jsx(c.IconHolder,Object.assign({variant:q,iconSize:le,onClick:()=>de(null==C?void 0:C.callback),isLeft:!1},{children:e.jsx(Y,{})})),!!L&&e.jsx(c.SuffixHolder,Object.assign({variant:q},{children:L})),H&&H.text&&e.jsx(i.Button,{buttonText:H.text,onClick:()=>de(null==H?void 0:H.onClick)}),H&&H.buttonProps&&e.jsx(i.Button,Object.assign({},H.buttonProps))]})),(!!O||!!I)&&e.jsxs(c.InputHeader,Object.assign({invalid:Z},{children:[N&&N,e.jsxs("div",Object.assign({className:"label__container"},{children:[V?e.jsxs(r.TitleSmall,{children:[O,T?e.jsx("span",{children:"*"}):""]}):e.jsxs(r.BodySecondary,{children:[O,T?e.jsx("span",{children:"*"}):""]}),d.tooltipText&&e.jsx(l.Tooltip,Object.assign({body:d.tooltipText,placement:"top"},{children:e.jsx("span",{children:e.jsx(t.default,{style:{marginTop:-3},width:18,height:18,color:Z?o.COLORS.content.negative:o.COLORS.content.primary})})}))]})),I>0&&"TOP"===J&&e.jsxs(c.MaxCharStyle,{children:[null!==(b=null===(f=(null!=F?F:"").toString())||void 0===f?void 0:f.length)&&void 0!==b?b:0,"/",I]})]}))]}))}));d.displayName="Input",exports.Input=d;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Menus: ({
3
2
  displayName: string;
4
3
  key: number;
@@ -64,6 +64,5 @@ export interface InputProps {
64
64
  maxCharLimitPosition?: 'TOP' | 'BOTTOM';
65
65
  hightlightInputColor?: string;
66
66
  onKeyDownEvent?: (e: Event) => void;
67
- hideInputHeader?: boolean;
68
67
  }
69
68
  export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement | null>>;
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e,Fragment as n}from"react/jsx-runtime";import i from"../../assets/icons/info.svg.js";import{forwardRef as l,useState as r,useContext as o,useRef as a,useEffect as s}from"react";import{Button as c}from"../button/Button.js";import{isFunction as h,validateInput as u}from"./Input-helper.js";import{Tooltip as d}from"../tooltips/Tooltip.js";import{TitleSmall as v,BodySecondary as p}from"../TypographyStyle.js";import{COLORS as g}from"../../constants/Theme.js";import m from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as b}from"./context/InputStyleProvider.js";import{RootContainer as f,InputFooter as x,MaxCharStyle as y,InputWrapper as j,IconHolder as C,PrefixHolder as O,InputContainer as T,InputContainerSmall as w,SuffixHolder as I,InputHeader as k}from"./Input.styled.js";const L=l(((l,L)=>{var H,B,E,M,P,D,S;const{placeholder:z,leftIcon:A,rightIcon:F,labelText:K,maxCharLimit:N,isRequired:R,hintText:G,type:_,state:q,validate:V,variant:W,button:$,suffixText:J,prefixText:Q,onChangeText:U,value:X,noErrorHint:Y,reset:Z,rangeValidation:tt,noKeyDownChange:et,version:nt,noMaxCharCheck:it,labelElement:lt,autoGrow:rt,minHeight:ot,maxHeight:at,labelTextBold:st,truncateText:ct,maxCharLimitPosition:ht,hightlightInputColor:ut,onKeyDownEvent:dt,hideInputHeader:vt}=Object.assign({maxCharLimit:0,type:"text",variant:"default",maxCharLimitPosition:"TOP"},l),pt=null==A?void 0:A.icon,gt=null==F?void 0:F.icon,[mt,bt]=r(!1),[ft,xt]=r(!1),[yt,jt]=r(),Ct="small"===W?"18px":"22px",Ot=o(b),[Tt,wt]=r(),It=a(null),kt=null!=L?L:It;s((()=>{wt(X),!X&&rt&&(kt.current.style.height=ot||"48px")}),[X]),s((()=>{var t;kt.current&&(null===(t=l.onReferenceInit)||void 0===t||t.call(l,kt.current))}),[kt]),s((()=>{const t=kt.current;if(t&&["phonenumber","zip","number"].includes(_))return t.addEventListener("wheel",Et,{passive:!1}),()=>{t.removeEventListener("wheel",Et)}}),[]),s((()=>{Z&&wt("")}),[Z]),s((()=>{var t;xt(!!l.isActive),l.isActive&&(null===(t=kt.current)||void 0===t||t.focus())}),[l.isActive]),s((()=>{jt(l.errorMessage)}),[l.errorMessage]),s((()=>{var t;bt(!1),("invalid"===l.state||yt||"disabled-invalid"===l.state)&&bt(!0),"active"===l.state&&(null===(t=kt.current)||void 0===t||t.focus())}),[l.state,yt]),s((()=>{bt(!!yt||"invalid"===l.state)}),[yt,l.state]);const Lt=function(t){if(h(t)){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];t(...n)}},Ht=()=>"zip"===_?6:2e3,Bt=t=>{const e=0!==N?N:Ht();if(dt&&dt(t),et||U(X||"",t),it)return;const n=t.target.value;![8].includes(t.which)&&e>0&&n.length>=e&&t.preventDefault()},Et=t=>{t.preventDefault()},Mt=t=>{let e=t.target.value;const n=0!==N?N+1:Ht();!it&&n>0&&e.length>=n&&(e=e.substring(0,n-1)),U(e,t),l.textControl||wt(e),rt&&(kt.current.style.height=`${kt.current.scrollHeight}px`,e||(kt.current.style.height=ot||"48px"));const i=V||u;if(!i||!h(i))return;const[r,o]=i(e,_,tt);bt(!r),jt(l.errorMessage?l.errorMessage:o)},Pt=t=>{var e;l.skipFocus||xt(!0),Lt(null===(e=l.onFocus)||void 0===e?void 0:e.call(l,t))},Dt=t=>{var e;l.skipFocus||xt(!1),Lt(null===(e=l.onBlur)||void 0===e?void 0:e.call(l,t))},St=()=>{var i;return t(n,{children:["multiline"!==_&&e("input",{className:ct?"truncate-class":"","data-test":l["data-test"],id:l.id,style:null!==(i=null==Ot?void 0:Ot.input)&&void 0!==i?i:{},ref:kt,type:["phonenumber","zip","number"].includes(_)?"number":_,value:Tt,onFocus:t=>Pt(t),onBlur:t=>Dt(t),placeholder:z||"Enter here",onChange:Mt,onClick:t=>Lt(l.onClick),onKeyDown:t=>Bt(t)}),"multiline"===_&&e("textarea",{"data-test":l["data-test"],value:Tt,ref:kt,onFocus:t=>Pt(t),onBlur:t=>Dt(t),onClick:t=>Lt(l.onClick),placeholder:z||"Enter here",onChange:Mt,onKeyDown:t=>Bt(t),maxLength:N>0?N:void 0})]})};return t(f,Object.assign({width:l.width,height:l.height,state:q,type:_,style:null!==(H=null==Ot?void 0:Ot.RootContainer)&&void 0!==H?H:{}},{children:[t("div",Object.assign({className:"flex-align-center"},{children:[!Y&&(!!G||!!yt)&&t(x,Object.assign({invalid:!!yt},{children:[!!yt&&e(m,{width:16,height:16}),yt||G]})),N>0&&"BOTTOM"===ht&&t(y,Object.assign({position:"BOTTOM"},{children:[null!==(E=null===(B=(null!=X?X:"").toString())||void 0===B?void 0:B.length)&&void 0!==E?E:0,"/",N]}))]})),t(j,Object.assign({variant:W,state:q,width:l.width,isActive:"active"===q||ft,isInvalid:mt,style:null!==(M=null==Ot?void 0:Ot.InputWrapper)&&void 0!==M?M:{},version:nt,height:l.height,hightlightInputColor:ut},{children:[!!pt&&e(C,Object.assign({variant:W,iconSize:Ct,onClick:()=>Lt(null==A?void 0:A.callback),isLeft:!0,style:null!==(P=null==Ot?void 0:Ot.IconHolder)&&void 0!==P?P:{}},{children:e(pt,{})})),!!Q&&e(O,Object.assign({variant:W},{children:Q})),"default"===W&&e(T,Object.assign({height:l.height,type:l.type,minHeight:ot,maxHeight:at,autoGrow:rt},{children:St()})),"small"===W&&e(w,Object.assign({height:l.height,type:l.type},{children:St()})),!!gt&&e(C,Object.assign({variant:W,iconSize:Ct,onClick:()=>Lt(null==F?void 0:F.callback),isLeft:!1},{children:e(gt,{})})),!!J&&e(I,Object.assign({variant:W},{children:J})),$&&$.text&&e(c,{buttonText:$.text,onClick:()=>Lt(null==$?void 0:$.onClick)}),$&&$.buttonProps&&e(c,Object.assign({},$.buttonProps))]})),!vt&&(!!K||!!N)&&t(k,Object.assign({invalid:mt},{children:[lt&&lt,t("div",Object.assign({className:"label__container"},{children:[t(st?v:p,{children:[K,R?e("span",{children:"*"}):""]}),l.tooltipText&&e(d,Object.assign({body:l.tooltipText,placement:"top"},{children:e("span",{children:e(i,{style:{marginTop:-3},width:18,height:18,color:mt?g.content.negative:g.content.primary})})}))]})),N>0&&"TOP"===ht&&t(y,{children:[null!==(S=null===(D=(null!=X?X:"").toString())||void 0===D?void 0:D.length)&&void 0!==S?S:0,"/",N]})]}))]}))}));L.displayName="Input";export{L as Input};
1
+ import{jsxs as t,jsx as e,Fragment as n}from"react/jsx-runtime";import i from"../../assets/icons/info.svg.js";import{forwardRef as l,useState as o,useContext as r,useRef as a,useEffect as s}from"react";import{Button as c}from"../button/Button.js";import{isFunction as h,validateInput as u}from"./Input-helper.js";import{Tooltip as d}from"../tooltips/Tooltip.js";import{TitleSmall as v,BodySecondary as p}from"../TypographyStyle.js";import{COLORS as g}from"../../constants/Theme.js";import m from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as b}from"./context/InputStyleProvider.js";import{RootContainer as f,InputFooter as x,MaxCharStyle as y,InputWrapper as j,IconHolder as C,PrefixHolder as O,InputContainer as T,InputContainerSmall as w,SuffixHolder as k,InputHeader as I}from"./Input.styled.js";const L=l(((l,L)=>{var B,E,H,M,P,D,S;const{placeholder:z,leftIcon:A,rightIcon:F,labelText:K,maxCharLimit:N,isRequired:R,hintText:G,type:_,state:q,validate:V,variant:W,button:$,suffixText:J,prefixText:Q,onChangeText:U,value:X,noErrorHint:Y,reset:Z,rangeValidation:tt,noKeyDownChange:et,version:nt,noMaxCharCheck:it,labelElement:lt,autoGrow:ot,minHeight:rt,maxHeight:at,labelTextBold:st,truncateText:ct,maxCharLimitPosition:ht,hightlightInputColor:ut,onKeyDownEvent:dt}=Object.assign({maxCharLimit:0,type:"text",variant:"default",maxCharLimitPosition:"TOP"},l),vt=null==A?void 0:A.icon,pt=null==F?void 0:F.icon,[gt,mt]=o(!1),[bt,ft]=o(!1),[xt,yt]=o(),jt="small"===W?"18px":"22px",Ct=r(b),[Ot,Tt]=o(),wt=a(null),kt=null!=L?L:wt;s((()=>{Tt(X),!X&&ot&&(kt.current.style.height=rt||"48px")}),[X]),s((()=>{var t;kt.current&&(null===(t=l.onReferenceInit)||void 0===t||t.call(l,kt.current))}),[kt]),s((()=>{const t=kt.current;if(t&&["phonenumber","zip","number"].includes(_))return t.addEventListener("wheel",Et,{passive:!1}),()=>{t.removeEventListener("wheel",Et)}}),[]),s((()=>{Z&&Tt("")}),[Z]),s((()=>{var t;ft(!!l.isActive),l.isActive&&(null===(t=kt.current)||void 0===t||t.focus())}),[l.isActive]),s((()=>{yt(l.errorMessage)}),[l.errorMessage]),s((()=>{var t;mt(!1),("invalid"===l.state||xt||"disabled-invalid"===l.state)&&mt(!0),"active"===l.state&&(null===(t=kt.current)||void 0===t||t.focus())}),[l.state,xt]),s((()=>{mt(!!xt||"invalid"===l.state)}),[xt,l.state]);const It=function(t){if(h(t)){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];t(...n)}},Lt=()=>"zip"===_?6:2e3,Bt=t=>{const e=0!==N?N:Lt();if(dt&&dt(t),et||U(X||"",t),it)return;const n=t.target.value;![8].includes(t.which)&&e>0&&n.length>=e&&t.preventDefault()},Et=t=>{t.preventDefault()},Ht=t=>{let e=t.target.value;const n=0!==N?N+1:Lt();!it&&n>0&&e.length>=n&&(e=e.substring(0,n-1)),U(e,t),l.textControl||Tt(e),ot&&(kt.current.style.height=`${kt.current.scrollHeight}px`,e||(kt.current.style.height=rt||"48px"));const i=V||u;if(!i||!h(i))return;const[o,r]=i(e,_,tt);mt(!o),yt(l.errorMessage?l.errorMessage:r)},Mt=t=>{var e;l.skipFocus||ft(!0),It(null===(e=l.onFocus)||void 0===e?void 0:e.call(l,t))},Pt=t=>{var e;l.skipFocus||ft(!1),It(null===(e=l.onBlur)||void 0===e?void 0:e.call(l,t))},Dt=()=>{var i;return t(n,{children:["multiline"!==_&&e("input",{className:ct?"truncate-class":"","data-test":l["data-test"],id:l.id,style:null!==(i=null==Ct?void 0:Ct.input)&&void 0!==i?i:{},ref:kt,type:["phonenumber","zip","number"].includes(_)?"number":_,value:Ot,onFocus:t=>Mt(t),onBlur:t=>Pt(t),placeholder:z||"Enter here",onChange:Ht,onClick:t=>It(l.onClick),onKeyDown:t=>Bt(t)}),"multiline"===_&&e("textarea",{"data-test":l["data-test"],value:Ot,ref:kt,onFocus:t=>Mt(t),onBlur:t=>Pt(t),onClick:t=>It(l.onClick),placeholder:z||"Enter here",onChange:Ht,onKeyDown:t=>Bt(t),maxLength:N>0?N:void 0})]})};return t(f,Object.assign({width:l.width,height:l.height,state:q,type:_,style:null!==(B=null==Ct?void 0:Ct.RootContainer)&&void 0!==B?B:{}},{children:[t("div",Object.assign({className:"flex-align-center"},{children:[!Y&&(!!G||!!xt)&&t(x,Object.assign({invalid:!!xt},{children:[!!xt&&e(m,{width:16,height:16}),xt||G]})),N>0&&"BOTTOM"===ht&&t(y,Object.assign({position:"BOTTOM"},{children:[null!==(H=null===(E=(null!=X?X:"").toString())||void 0===E?void 0:E.length)&&void 0!==H?H:0,"/",N]}))]})),t(j,Object.assign({variant:W,state:q,width:l.width,isActive:"active"===q||bt,isInvalid:gt,style:null!==(M=null==Ct?void 0:Ct.InputWrapper)&&void 0!==M?M:{},version:nt,height:l.height,hightlightInputColor:ut},{children:[!!vt&&e(C,Object.assign({variant:W,iconSize:jt,onClick:()=>It(null==A?void 0:A.callback),isLeft:!0,style:null!==(P=null==Ct?void 0:Ct.IconHolder)&&void 0!==P?P:{}},{children:e(vt,{})})),!!Q&&e(O,Object.assign({variant:W},{children:Q})),"default"===W&&e(T,Object.assign({height:l.height,type:l.type,minHeight:rt,maxHeight:at,autoGrow:ot},{children:Dt()})),"small"===W&&e(w,Object.assign({height:l.height,type:l.type},{children:Dt()})),!!pt&&e(C,Object.assign({variant:W,iconSize:jt,onClick:()=>It(null==F?void 0:F.callback),isLeft:!1},{children:e(pt,{})})),!!J&&e(k,Object.assign({variant:W},{children:J})),$&&$.text&&e(c,{buttonText:$.text,onClick:()=>It(null==$?void 0:$.onClick)}),$&&$.buttonProps&&e(c,Object.assign({},$.buttonProps))]})),(!!K||!!N)&&t(I,Object.assign({invalid:gt},{children:[lt&&lt,t("div",Object.assign({className:"label__container"},{children:[t(st?v:p,{children:[K,R?e("span",{children:"*"}):""]}),l.tooltipText&&e(d,Object.assign({body:l.tooltipText,placement:"top"},{children:e("span",{children:e(i,{style:{marginTop:-3},width:18,height:18,color:gt?g.content.negative:g.content.primary})})}))]})),N>0&&"TOP"===ht&&t(y,{children:[null!==(S=null===(D=(null!=X?X:"").toString())||void 0===D?void 0:D.length)&&void 0!==S?S:0,"/",N]})]}))]}))}));L.displayName="Input";export{L as Input};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.599-1",
3
+ "version": "0.0.599",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",