@bikdotai/bik-component-library 0.0.321-beta.1 → 0.0.322-beta.1

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.
@@ -36,7 +36,7 @@ export declare class MetaCustomProcessor {
36
36
  value: {
37
37
  operator: string;
38
38
  dataType: import("../types").QueryBuilderConnectorType;
39
- value?: string | number | Date | Date[] | string[] | number[] | undefined;
39
+ value?: string | number | string[] | number[] | Date | Date[] | undefined;
40
40
  };
41
41
  key: string;
42
42
  refresh?: boolean | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -49,7 +49,4 @@ export interface InputProps {
49
49
  skipFocus?: boolean;
50
50
  version?: '1.0' | '2.0';
51
51
  }
52
- export declare const Input: {
53
- (props: InputProps): JSX.Element;
54
- displayName: string;
55
- };
52
+ 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("react"),n=require("../button/Button.js"),i=require("./Input-helper.js"),r=require("../TypographyStyle.js"),s=require("../../assets/icons/errorInfo.svg.js"),l=require("./context/InputStyleProvider.js"),o=require("./Input.styled.js");const a=a=>{var u,c,d,v,h;const{placeholder:x,leftIcon:p,rightIcon:f,labelText:j,maxCharLimit:g,isRequired:y,hintText:I,type:b,state:C,validate:m,variant:S,button:w,suffixText:E,prefixText:O,onChangeText:q,value:F,noErrorHint:k,reset:H,rangeValidation:T,noKeyDownChange:B,version:M}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},a),A=null==p?void 0:p.icon,L=null==f?void 0:f.icon,[R,z]=t.useState(!1),[D,K]=t.useState(!1),[P,W]=t.useState(),_="small"===S?"18px":"22px",N=t.useContext(l.InputStyleContext),[V,G]=t.useState(),J=t.useRef();t.useEffect((()=>{G(F)}),[F]),t.useEffect((()=>{var e;J.current&&(null===(e=a.onReferenceInit)||void 0===e||e.call(a,J.current))}),[J]),t.useEffect((()=>{H&&G("")}),[H]),t.useEffect((()=>{var e;K(!!a.isActive),a.isActive&&(null===(e=J.current)||void 0===e||e.focus())}),[a.isActive]),t.useEffect((()=>{W(a.errorMessage)}),[a.errorMessage]),t.useEffect((()=>{var e;z(!1),("invalid"===a.state||P)&&z(!0),"active"===a.state&&(null===(e=J.current)||void 0===e||e.focus())}),[a.state,P]),t.useEffect((()=>{z(!!P)}),[P]);const Q=function(e){if(i.isFunction(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e(...n)}},U=e=>{const t=g||("zip"===b?6:60);B||q(F||"",e),![8].includes(e.which)&&t>0&&e.target.value.length===t&&e.preventDefault()},X=e=>{const t=e.target.value;q(t,e),G(t);const n=m||i.validateInput;if(!n||!i.isFunction(n))return;const[r,s]=n(t,b,T);z(!r),W(a.errorMessage?a.errorMessage:s)},Y=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==b&&e.jsx("input",{id:a.id,style:null!==(t=null==N?void 0:N.input)&&void 0!==t?t:{},ref:J,type:["phonenumber","zip","number"].includes(b)?"number":b,value:V,onFocus:()=>(a.skipFocus||K(!0),void Q(a.onFocus)),onBlur:e=>(e=>{var t;a.skipFocus||K(!1),Q(null===(t=a.onBlur)||void 0===t?void 0:t.call(a,e))})(e),placeholder:x||"Enter here",onChange:X,onKeyDown:e=>U(e)}),"multiline"===b&&e.jsx("textarea",{value:V,ref:J,onFocus:()=>K(!0),onBlur:()=>K(!1),placeholder:x||"Enter here",onChange:X,onKeyDown:e=>U(e),maxLength:g>0?g:void 0})]})};return e.jsxs(o.RootContainer,Object.assign({width:a.width,height:a.height,state:C,type:b,style:null!==(u=null==N?void 0:N.RootContainer)&&void 0!==u?u:{}},{children:[!k&&(!!I||!!P)&&e.jsxs(o.InputFooter,Object.assign({invalid:!!P},{children:[!!P&&e.jsx(s.default,{width:16,height:16}),P||I]})),e.jsxs(o.InputWrapper,Object.assign({variant:S,state:C,width:a.width,isActive:"active"===C||D,isInvalid:R,style:null!==(c=null==N?void 0:N.InputWrapper)&&void 0!==c?c:{},version:M},{children:[!!A&&e.jsx(o.IconHolder,Object.assign({variant:S,iconSize:_,onClick:()=>Q(null==p?void 0:p.callback),isLeft:!0,style:null!==(d=null==N?void 0:N.IconHolder)&&void 0!==d?d:{}},{children:e.jsx(A,{})})),!!O&&e.jsx(o.PrefixHolder,Object.assign({variant:S},{children:O})),"default"===S&&e.jsx(o.InputContainer,{children:Y()}),"small"===S&&e.jsx(o.InputContainerSmall,{children:Y()}),!!L&&e.jsx(o.IconHolder,Object.assign({variant:S,iconSize:_,onClick:()=>Q(null==f?void 0:f.callback),isLeft:!1},{children:e.jsx(L,{})})),!!E&&e.jsx(o.SuffixHolder,Object.assign({variant:S},{children:E})),w&&w.text&&e.jsx(n.Button,{buttonText:w.text,onClick:()=>Q(null==w?void 0:w.onClick)})]})),(!!j||!!g)&&e.jsxs(o.InputHeader,Object.assign({invalid:R},{children:[e.jsxs(r.BodySecondary,{children:[j,y?e.jsx("span",{children:"*"}):""]}),g>0&&e.jsxs(o.MaxCharStyle,{children:[null!==(h=null===(v=a.value)||void 0===v?void 0:v.length)&&void 0!==h?h:0,"/",g]})]}))]}))};a.displayName="Input",exports.Input=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../button/Button.js"),i=require("./Input-helper.js"),r=require("../TypographyStyle.js"),l=require("../../assets/icons/errorInfo.svg.js"),s=require("./context/InputStyleProvider.js"),o=require("./Input.styled.js");const a=t.forwardRef(((a,u)=>{var c,d,v,h,x;const{placeholder:p,leftIcon:f,rightIcon:j,labelText:g,maxCharLimit:y,isRequired:I,hintText:b,type:C,state:m,validate:S,variant:w,button:E,suffixText:O,prefixText:q,onChangeText:F,value:k,noErrorHint:H,reset:T,rangeValidation:B,noKeyDownChange:M,version:R}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},a),A=null==f?void 0:f.icon,L=null==j?void 0:j.icon,[z,D]=t.useState(!1),[K,P]=t.useState(!1),[W,_]=t.useState(),N="small"===w?"18px":"22px",V=t.useContext(s.InputStyleContext),[G,J]=t.useState(),Q=t.useRef(null),U=null!=u?u:Q;t.useEffect((()=>{J(k)}),[k]),t.useEffect((()=>{var e;U.current&&(null===(e=a.onReferenceInit)||void 0===e||e.call(a,U.current))}),[U]),t.useEffect((()=>{T&&J("")}),[T]),t.useEffect((()=>{var e;P(!!a.isActive),a.isActive&&(null===(e=U.current)||void 0===e||e.focus())}),[a.isActive]),t.useEffect((()=>{_(a.errorMessage)}),[a.errorMessage]),t.useEffect((()=>{var e;D(!1),("invalid"===a.state||W)&&D(!0),"active"===a.state&&(null===(e=U.current)||void 0===e||e.focus())}),[a.state,W]),t.useEffect((()=>{D(!!W)}),[W]);const X=function(e){if(i.isFunction(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e(...n)}},Y=e=>{const t=y||("zip"===C?6:60);M||F(k||"",e),![8].includes(e.which)&&t>0&&e.target.value.length===t&&e.preventDefault()},Z=e=>{const t=e.target.value;F(t,e),J(t);const n=S||i.validateInput;if(!n||!i.isFunction(n))return;const[r,l]=n(t,C,B);D(!r),_(a.errorMessage?a.errorMessage:l)},$=()=>{a.skipFocus||P(!0),X(a.onFocus)},ee=e=>{var t;a.skipFocus||P(!1),X(null===(t=a.onBlur)||void 0===t?void 0:t.call(a,e))},te=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==C&&e.jsx("input",{id:a.id,style:null!==(t=null==V?void 0:V.input)&&void 0!==t?t:{},ref:U,type:["phonenumber","zip","number"].includes(C)?"number":C,value:G,onFocus:()=>$(),onBlur:e=>ee(e),placeholder:p||"Enter here",onChange:Z,onKeyDown:e=>Y(e)}),"multiline"===C&&e.jsx("textarea",{value:G,ref:U,onFocus:()=>$(),onBlur:e=>ee(e),placeholder:p||"Enter here",onChange:Z,onKeyDown:e=>Y(e),maxLength:y>0?y:void 0})]})};return e.jsxs(o.RootContainer,Object.assign({width:a.width,height:a.height,state:m,type:C,style:null!==(c=null==V?void 0:V.RootContainer)&&void 0!==c?c:{}},{children:[!H&&(!!b||!!W)&&e.jsxs(o.InputFooter,Object.assign({invalid:!!W},{children:[!!W&&e.jsx(l.default,{width:16,height:16}),W||b]})),e.jsxs(o.InputWrapper,Object.assign({variant:w,state:m,width:a.width,isActive:"active"===m||K,isInvalid:z,style:null!==(d=null==V?void 0:V.InputWrapper)&&void 0!==d?d:{},version:R},{children:[!!A&&e.jsx(o.IconHolder,Object.assign({variant:w,iconSize:N,onClick:()=>X(null==f?void 0:f.callback),isLeft:!0,style:null!==(v=null==V?void 0:V.IconHolder)&&void 0!==v?v:{}},{children:e.jsx(A,{})})),!!q&&e.jsx(o.PrefixHolder,Object.assign({variant:w},{children:q})),"default"===w&&e.jsx(o.InputContainer,{children:te()}),"small"===w&&e.jsx(o.InputContainerSmall,{children:te()}),!!L&&e.jsx(o.IconHolder,Object.assign({variant:w,iconSize:N,onClick:()=>X(null==j?void 0:j.callback),isLeft:!1},{children:e.jsx(L,{})})),!!O&&e.jsx(o.SuffixHolder,Object.assign({variant:w},{children:O})),E&&E.text&&e.jsx(n.Button,{buttonText:E.text,onClick:()=>X(null==E?void 0:E.onClick)})]})),(!!g||!!y)&&e.jsxs(o.InputHeader,Object.assign({invalid:z},{children:[e.jsxs(r.BodySecondary,{children:[g,I?e.jsx("span",{children:"*"}):""]}),y>0&&e.jsxs(o.MaxCharStyle,{children:[null!==(x=null===(h=a.value)||void 0===h?void 0:h.length)&&void 0!==x?x:0,"/",y]})]}))]}))}));a.displayName="Input",exports.Input=a;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const WorkingStepper: () => JSX.Element;
2
3
  export declare enum STEPENUM {
3
4
  STEP1 = "STEP1",
@@ -36,7 +36,7 @@ export declare class MetaCustomProcessor {
36
36
  value: {
37
37
  operator: string;
38
38
  dataType: import("../types").QueryBuilderConnectorType;
39
- value?: string | number | Date | Date[] | string[] | number[] | undefined;
39
+ value?: string | number | string[] | number[] | Date | Date[] | undefined;
40
40
  };
41
41
  key: string;
42
42
  refresh?: boolean | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -49,7 +49,4 @@ export interface InputProps {
49
49
  skipFocus?: boolean;
50
50
  version?: '1.0' | '2.0';
51
51
  }
52
- export declare const Input: {
53
- (props: InputProps): JSX.Element;
54
- displayName: string;
55
- };
52
+ export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement | null>>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState as i,useContext as r,useRef as l,useEffect as o}from"react";import{Button as a}from"../button/Button.js";import{isFunction as s,validateInput as c}from"./Input-helper.js";import{BodySecondary as u}from"../TypographyStyle.js";import d from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as v}from"./context/InputStyleProvider.js";import{RootContainer as h,InputFooter as p,InputWrapper as g,IconHolder as m,PrefixHolder as f,InputContainer as x,InputContainerSmall as b,SuffixHolder as y,InputHeader as j,MaxCharStyle as C}from"./Input.styled.js";const I=I=>{var w,O,k,T,A;const{placeholder:F,leftIcon:L,rightIcon:z,labelText:B,maxCharLimit:D,isRequired:M,hintText:S,type:E,state:K,validate:R,variant:H,button:q,suffixText:N,prefixText:P,onChangeText:V,value:W,noErrorHint:G,reset:J,rangeValidation:Q,noKeyDownChange:U,version:X}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},I),Y=null==L?void 0:L.icon,Z=null==z?void 0:z.icon,[$,_]=i(!1),[ee,ne]=i(!1),[te,ie]=i(),re="small"===H?"18px":"22px",le=r(v),[oe,ae]=i(),se=l();o((()=>{ae(W)}),[W]),o((()=>{var e;se.current&&(null===(e=I.onReferenceInit)||void 0===e||e.call(I,se.current))}),[se]),o((()=>{J&&ae("")}),[J]),o((()=>{var e;ne(!!I.isActive),I.isActive&&(null===(e=se.current)||void 0===e||e.focus())}),[I.isActive]),o((()=>{ie(I.errorMessage)}),[I.errorMessage]),o((()=>{var e;_(!1),("invalid"===I.state||te)&&_(!0),"active"===I.state&&(null===(e=se.current)||void 0===e||e.focus())}),[I.state,te]),o((()=>{_(!!te)}),[te]);const ce=function(e){if(s(e)){for(var n=arguments.length,t=new Array(n>1?n-1:0),i=1;i<n;i++)t[i-1]=arguments[i];e(...t)}},ue=e=>{const n=D||("zip"===E?6:60);U||V(W||"",e),![8].includes(e.which)&&n>0&&e.target.value.length===n&&e.preventDefault()},de=e=>{const n=e.target.value;V(n,e),ae(n);const t=R||c;if(!t||!s(t))return;const[i,r]=t(n,E,Q);_(!i),ie(I.errorMessage?I.errorMessage:r)},ve=()=>{var i;return e(t,{children:["multiline"!==E&&n("input",{id:I.id,style:null!==(i=null==le?void 0:le.input)&&void 0!==i?i:{},ref:se,type:["phonenumber","zip","number"].includes(E)?"number":E,value:oe,onFocus:()=>(I.skipFocus||ne(!0),void ce(I.onFocus)),onBlur:e=>(e=>{var n;I.skipFocus||ne(!1),ce(null===(n=I.onBlur)||void 0===n?void 0:n.call(I,e))})(e),placeholder:F||"Enter here",onChange:de,onKeyDown:e=>ue(e)}),"multiline"===E&&n("textarea",{value:oe,ref:se,onFocus:()=>ne(!0),onBlur:()=>ne(!1),placeholder:F||"Enter here",onChange:de,onKeyDown:e=>ue(e),maxLength:D>0?D:void 0})]})};return e(h,Object.assign({width:I.width,height:I.height,state:K,type:E,style:null!==(w=null==le?void 0:le.RootContainer)&&void 0!==w?w:{}},{children:[!G&&(!!S||!!te)&&e(p,Object.assign({invalid:!!te},{children:[!!te&&n(d,{width:16,height:16}),te||S]})),e(g,Object.assign({variant:H,state:K,width:I.width,isActive:"active"===K||ee,isInvalid:$,style:null!==(O=null==le?void 0:le.InputWrapper)&&void 0!==O?O:{},version:X},{children:[!!Y&&n(m,Object.assign({variant:H,iconSize:re,onClick:()=>ce(null==L?void 0:L.callback),isLeft:!0,style:null!==(k=null==le?void 0:le.IconHolder)&&void 0!==k?k:{}},{children:n(Y,{})})),!!P&&n(f,Object.assign({variant:H},{children:P})),"default"===H&&n(x,{children:ve()}),"small"===H&&n(b,{children:ve()}),!!Z&&n(m,Object.assign({variant:H,iconSize:re,onClick:()=>ce(null==z?void 0:z.callback),isLeft:!1},{children:n(Z,{})})),!!N&&n(y,Object.assign({variant:H},{children:N})),q&&q.text&&n(a,{buttonText:q.text,onClick:()=>ce(null==q?void 0:q.onClick)})]})),(!!B||!!D)&&e(j,Object.assign({invalid:$},{children:[e(u,{children:[B,M?n("span",{children:"*"}):""]}),D>0&&e(C,{children:[null!==(A=null===(T=I.value)||void 0===T?void 0:T.length)&&void 0!==A?A:0,"/",D]})]}))]}))};I.displayName="Input";export{I as Input};
1
+ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{forwardRef as i,useState as r,useContext as l,useRef as o,useEffect as a}from"react";import{Button as s}from"../button/Button.js";import{isFunction as c,validateInput as u}from"./Input-helper.js";import{BodySecondary as d}from"../TypographyStyle.js";import v from"../../assets/icons/errorInfo.svg.js";import{InputStyleContext as h}from"./context/InputStyleProvider.js";import{RootContainer as p,InputFooter as g,InputWrapper as m,IconHolder as f,PrefixHolder as x,InputContainer as b,InputContainerSmall as y,SuffixHolder as j,InputHeader as C,MaxCharStyle as I}from"./Input.styled.js";const w=i(((i,w)=>{var O,k,T,A,F;const{placeholder:L,leftIcon:z,rightIcon:B,labelText:D,maxCharLimit:M,isRequired:S,hintText:E,type:K,state:R,validate:H,variant:q,button:N,suffixText:P,prefixText:V,onChangeText:W,value:G,noErrorHint:J,reset:Q,rangeValidation:U,noKeyDownChange:X,version:Y}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},i),Z=null==z?void 0:z.icon,$=null==B?void 0:B.icon,[_,ee]=r(!1),[ne,te]=r(!1),[ie,re]=r(),le="small"===q?"18px":"22px",oe=l(h),[ae,se]=r(),ce=o(null),ue=null!=w?w:ce;a((()=>{se(G)}),[G]),a((()=>{var e;ue.current&&(null===(e=i.onReferenceInit)||void 0===e||e.call(i,ue.current))}),[ue]),a((()=>{Q&&se("")}),[Q]),a((()=>{var e;te(!!i.isActive),i.isActive&&(null===(e=ue.current)||void 0===e||e.focus())}),[i.isActive]),a((()=>{re(i.errorMessage)}),[i.errorMessage]),a((()=>{var e;ee(!1),("invalid"===i.state||ie)&&ee(!0),"active"===i.state&&(null===(e=ue.current)||void 0===e||e.focus())}),[i.state,ie]),a((()=>{ee(!!ie)}),[ie]);const de=function(e){if(c(e)){for(var n=arguments.length,t=new Array(n>1?n-1:0),i=1;i<n;i++)t[i-1]=arguments[i];e(...t)}},ve=e=>{const n=M||("zip"===K?6:60);X||W(G||"",e),![8].includes(e.which)&&n>0&&e.target.value.length===n&&e.preventDefault()},he=e=>{const n=e.target.value;W(n,e),se(n);const t=H||u;if(!t||!c(t))return;const[r,l]=t(n,K,U);ee(!r),re(i.errorMessage?i.errorMessage:l)},pe=()=>{i.skipFocus||te(!0),de(i.onFocus)},ge=e=>{var n;i.skipFocus||te(!1),de(null===(n=i.onBlur)||void 0===n?void 0:n.call(i,e))},me=()=>{var r;return e(t,{children:["multiline"!==K&&n("input",{id:i.id,style:null!==(r=null==oe?void 0:oe.input)&&void 0!==r?r:{},ref:ue,type:["phonenumber","zip","number"].includes(K)?"number":K,value:ae,onFocus:()=>pe(),onBlur:e=>ge(e),placeholder:L||"Enter here",onChange:he,onKeyDown:e=>ve(e)}),"multiline"===K&&n("textarea",{value:ae,ref:ue,onFocus:()=>pe(),onBlur:e=>ge(e),placeholder:L||"Enter here",onChange:he,onKeyDown:e=>ve(e),maxLength:M>0?M:void 0})]})};return e(p,Object.assign({width:i.width,height:i.height,state:R,type:K,style:null!==(O=null==oe?void 0:oe.RootContainer)&&void 0!==O?O:{}},{children:[!J&&(!!E||!!ie)&&e(g,Object.assign({invalid:!!ie},{children:[!!ie&&n(v,{width:16,height:16}),ie||E]})),e(m,Object.assign({variant:q,state:R,width:i.width,isActive:"active"===R||ne,isInvalid:_,style:null!==(k=null==oe?void 0:oe.InputWrapper)&&void 0!==k?k:{},version:Y},{children:[!!Z&&n(f,Object.assign({variant:q,iconSize:le,onClick:()=>de(null==z?void 0:z.callback),isLeft:!0,style:null!==(T=null==oe?void 0:oe.IconHolder)&&void 0!==T?T:{}},{children:n(Z,{})})),!!V&&n(x,Object.assign({variant:q},{children:V})),"default"===q&&n(b,{children:me()}),"small"===q&&n(y,{children:me()}),!!$&&n(f,Object.assign({variant:q,iconSize:le,onClick:()=>de(null==B?void 0:B.callback),isLeft:!1},{children:n($,{})})),!!P&&n(j,Object.assign({variant:q},{children:P})),N&&N.text&&n(s,{buttonText:N.text,onClick:()=>de(null==N?void 0:N.onClick)})]})),(!!D||!!M)&&e(C,Object.assign({invalid:_},{children:[e(d,{children:[D,S?n("span",{children:"*"}):""]}),M>0&&e(I,{children:[null!==(F=null===(A=i.value)||void 0===A?void 0:A.length)&&void 0!==F?F:0,"/",M]})]}))]}))}));w.displayName="Input";export{w as Input};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const WorkingStepper: () => JSX.Element;
2
3
  export declare enum STEPENUM {
3
4
  STEP1 = "STEP1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.321-beta.1",
3
+ "version": "0.0.322-beta.1",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",