@bikdotai/bik-component-library 0.0.786 → 0.0.787-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.
@@ -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;
@@ -33,6 +33,7 @@ export interface InputProps {
33
33
  onChangeText: (input: string, event?: Event) => void;
34
34
  button?: {
35
35
  text: string;
36
+ buttonType?: ButtonProps['buttonType'];
36
37
  onClick?: () => void;
37
38
  buttonProps?: ButtonProps;
38
39
  };
@@ -63,6 +64,7 @@ export interface InputProps {
63
64
  truncateText?: boolean;
64
65
  maxCharLimitPosition?: 'TOP' | 'BOTTOM';
65
66
  hightlightInputColor?: string;
67
+ maxCharAlignment?: boolean;
66
68
  onKeyDownEvent?: (e: Event) => void;
67
69
  hideInputHeader?: boolean;
68
70
  hideBorder?: boolean;
@@ -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"),l=require("../tooltips/Tooltip.js"),r=require("../TypographyStyle.js"),a=require("../../constants/Theme.js"),o=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,g,x,j,f,m,b;const{placeholder:y,leftIcon:C,rightIcon:O,labelText:T,maxCharLimit:I,isRequired:S,hintText:w,type:E,state:k,validate:H,variant:q,button:B,suffixText:L,prefixText:F,onChangeText:M,value:P,noErrorHint:R,reset:z,rangeValidation:D,noKeyDownChange:A,version:K,noMaxCharCheck:N,labelElement:_,autoGrow:W,minHeight:G,maxHeight:U,labelTextBold:V,truncateText:$,maxCharLimitPosition:J,hightlightInputColor:Q,onKeyDownEvent:X,hideInputHeader:Y,hideBorder:Z,inputWrapperStyles:ee,minCharsToTrigger:te,isDisabled:ne=!1,allowUnsafeInput:ie}=Object.assign({maxCharLimit:0,type:"text",variant:"default",maxCharLimitPosition:"TOP",minCharsToTrigger:0},d),se=null==C?void 0:C.icon,le=null==O?void 0:O.icon,[re,ae]=n.useState(!1),[oe,ue]=n.useState(!1),[ce,de]=n.useState(),he="x-small"===q?"12px":"small"===q?"18px":"22px",ve=n.useContext(u.InputStyleContext),[pe,ge]=n.useState(""),xe=n.useRef(null),je=null!=h?h:xe;n.useEffect((()=>{ge(P||""),!P&&W&&(je.current.style.height=G||"48px")}),[P]),n.useEffect((()=>{var e;je.current&&(null===(e=d.onReferenceInit)||void 0===e||e.call(d,je.current))}),[je]),n.useEffect((()=>{const e=je.current;if(e&&["phonenumber","zip","number"].includes(E))return e.addEventListener("wheel",ye,{passive:!1}),()=>{e.removeEventListener("wheel",ye)}}),[]),n.useEffect((()=>{z&&ge("")}),[z]),n.useEffect((()=>{var e;ue(!!d.isActive),d.isActive&&(null===(e=je.current)||void 0===e||e.focus())}),[d.isActive]),n.useEffect((()=>{de(d.errorMessage)}),[d.errorMessage]),n.useEffect((()=>{var e;ae(!1),("invalid"===d.state||ce||"disabled-invalid"===d.state)&&ae(!0),"active"===d.state&&(null===(e=je.current)||void 0===e||e.focus())}),[d.state,ce]),n.useEffect((()=>{ae(!!ce||"invalid"===d.state)}),[ce,d.state]);const fe=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)}},me=()=>"zip"===E?6:2e3,be=e=>{const t=0!==I?I:me(),n=te,i=e.target.value;X&&(!i.length||i.length>=n)&&X(e),A||i.length&&!(i.length>=n)||M(P||"",e),N||![8].includes(e.which)&&t>0&&i.length>=t&&e.preventDefault()},ye=e=>{e.preventDefault()},Ce=e=>{let t=e.target.value;const n=0!==I?I+1:me(),i=te;if(!ie&&s.shouldSanitizeForType(E)&&(t=s.sanitizeUnsafeInput(t)),!N&&n>0&&t.length>=n&&(t=t.substring(0,n-1)),d.textControl||ge(t||""),i&&t&&t.length<i)return;M(t,e),W&&(je.current.style.height=`${je.current.scrollHeight}px`,t||(je.current.style.height=G||"48px"));const l=H||s.validateInput;if(!l||!s.isFunction(l))return;const[r,a]=l(t,E,D);ae(!r),de(d.errorMessage?d.errorMessage:a)},Oe=e=>{var t;d.skipFocus||ue(!0),fe(null===(t=d.onFocus)||void 0===t?void 0:t.call(d,e))},Te=e=>{var t;d.skipFocus||ue(!1),fe(null===(t=d.onBlur)||void 0===t?void 0:t.call(d,e))},Ie=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==E&&e.jsx("input",{className:$?"truncate-class":"","data-test":d["data-test"],id:d.id,style:null!==(t=null==ve?void 0:ve.input)&&void 0!==t?t:{},ref:je,disabled:ne,type:["phonenumber","zip","number"].includes(E)?"number":E,value:pe,onFocus:e=>Oe(e),onBlur:e=>Te(e),placeholder:y||"Enter here",onChange:Ce,onClick:e=>fe(d.onClick),onKeyDown:e=>be(e)}),"multiline"===E&&e.jsx("textarea",{"data-test":d["data-test"],value:pe,ref:je,onFocus:e=>Oe(e),onBlur:e=>Te(e),onClick:e=>fe(d.onClick),disabled:ne,placeholder:y||"Enter here",onChange:Ce,onKeyDown:e=>be(e),maxLength:I>0?I:void 0})]})};return e.jsxs(c.RootContainer,Object.assign({width:d.width,height:d.height,state:k,type:E,style:null!==(v=null==ve?void 0:ve.RootContainer)&&void 0!==v?v:{}},{children:[e.jsxs("div",Object.assign({className:"flex-align-center"},{children:[!R&&(!!w||!!ce)&&e.jsxs(c.InputFooter,Object.assign({invalid:!!ce},{children:[!!ce&&e.jsx(o.default,{width:16,height:16}),ce||w]})),I>0&&"BOTTOM"===J&&e.jsxs(c.MaxCharStyle,Object.assign({position:"BOTTOM"},{children:[null!==(g=null===(p=(null!=P?P:"").toString())||void 0===p?void 0:p.length)&&void 0!==g?g:0,"/",I]}))]})),e.jsxs(c.InputWrapper,Object.assign({variant:q,state:k,width:d.width,isActive:"active"===k||oe,isInvalid:re,style:null!==(j=null!==(x=null==ve?void 0:ve.InputWrapper)&&void 0!==x?x:ee)&&void 0!==j?j:{},version:K,height:d.height,hightlightInputColor:Q,hideBorder:Z},{children:[!!se&&e.jsx(c.IconHolder,Object.assign({variant:q,iconSize:he,onClick:()=>fe(null==C?void 0:C.callback),isLeft:!0,style:null!==(f=null==ve?void 0:ve.IconHolder)&&void 0!==f?f:{}},{children:e.jsx(se,{})})),!!F&&e.jsx(c.PrefixHolder,Object.assign({variant:q},{children:F})),"default"===q&&e.jsx(c.InputContainer,Object.assign({height:d.height,type:d.type,minHeight:G,maxHeight:U,autoGrow:W},{children:Ie()})),["x-small","small"].includes(q)&&e.jsx(c.InputContainerSmall,Object.assign({height:d.height,type:d.type},{children:Ie()})),!!le&&e.jsx(c.IconHolder,Object.assign({variant:q,iconSize:he,onClick:()=>fe(null==O?void 0:O.callback),isLeft:!1},{children:e.jsx(le,{})})),!!L&&e.jsx(c.SuffixHolder,Object.assign({variant:q},{children:L})),B&&B.text&&e.jsx(i.Button,{buttonText:B.text,onClick:()=>fe(null==B?void 0:B.onClick)}),B&&B.buttonProps&&e.jsx(i.Button,Object.assign({},B.buttonProps))]})),!Y&&(!!T||!!I)&&e.jsxs(c.InputHeader,Object.assign({invalid:re},{children:[_&&_,e.jsxs("div",Object.assign({className:"label__container"},{children:[V?e.jsxs(r.TitleSmall,{children:[T,S?e.jsx("span",{children:"*"}):""]}):e.jsxs(r.BodySecondary,{children:[T,S?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:re?a.COLORS.content.negative:a.COLORS.content.primary})})}))]})),I>0&&"TOP"===J&&e.jsxs(c.MaxCharStyle,{children:[null!==(b=null===(m=(null!=P?P:"").toString())||void 0===m?void 0:m.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"),l=require("./Input-helper.js"),s=require("../tooltips/Tooltip.js"),r=require("../TypographyStyle.js"),a=require("../../constants/Theme.js"),o=require("../../assets/icons/errorInfo.svg.js"),u=require("./context/InputStyleProvider.js"),c=require("./Input.styled.js");const d=n.forwardRef(((d,h)=>{var p,v,g,x,j,f,m,b;const{placeholder:y,leftIcon:C,rightIcon:T,labelText:O,maxCharLimit:I,isRequired:S,hintText:w,type:E,state:k,validate:H,variant:q,button:B,suffixText:L,prefixText:F,onChangeText:M,value:P,noErrorHint:A,reset:R,rangeValidation:z,noKeyDownChange:D,version:K,noMaxCharCheck:N,labelElement:_,autoGrow:W,minHeight:G,maxHeight:U,labelTextBold:V,truncateText:$,maxCharLimitPosition:J,hightlightInputColor:Q,onKeyDownEvent:X,hideInputHeader:Y,hideBorder:Z,inputWrapperStyles:ee,minCharsToTrigger:te,maxCharAlignment:ne,isDisabled:ie=!1,allowUnsafeInput:le}=Object.assign({maxCharLimit:0,type:"text",variant:"default",maxCharLimitPosition:"TOP",minCharsToTrigger:0,maxCharAlignment:!1},d),se=null==C?void 0:C.icon,re=null==T?void 0:T.icon,[ae,oe]=n.useState(!1),[ue,ce]=n.useState(!1),[de,he]=n.useState(),pe="x-small"===q?"12px":"small"===q?"18px":"22px",ve=n.useContext(u.InputStyleContext),[ge,xe]=n.useState(""),je=n.useRef(null),fe=null!=h?h:je;n.useEffect((()=>{xe(P||""),!P&&W&&(fe.current.style.height=G||"48px")}),[P]),n.useEffect((()=>{var e;fe.current&&(null===(e=d.onReferenceInit)||void 0===e||e.call(d,fe.current))}),[fe]),n.useEffect((()=>{const e=fe.current;if(e&&["phonenumber","zip","number"].includes(E))return e.addEventListener("wheel",Ce,{passive:!1}),()=>{e.removeEventListener("wheel",Ce)}}),[]),n.useEffect((()=>{R&&xe("")}),[R]),n.useEffect((()=>{var e;ce(!!d.isActive),d.isActive&&(null===(e=fe.current)||void 0===e||e.focus())}),[d.isActive]),n.useEffect((()=>{he(d.errorMessage)}),[d.errorMessage]),n.useEffect((()=>{var e;oe(!1),("invalid"===d.state||de||"disabled-invalid"===d.state)&&oe(!0),"active"===d.state&&(null===(e=fe.current)||void 0===e||e.focus())}),[d.state,de]),n.useEffect((()=>{oe(!!de||"invalid"===d.state)}),[de,d.state]);const me=function(e){if(l.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)}},be=()=>"zip"===E?6:2e3,ye=e=>{const t=0!==I?I:be(),n=te,i=e.target.value;X&&(!i.length||i.length>=n)&&X(e),D||i.length&&!(i.length>=n)||M(P||"",e),N||![8].includes(e.which)&&t>0&&i.length>=t&&e.preventDefault()},Ce=e=>{e.preventDefault()},Te=e=>{let t=e.target.value;const n=0!==I?I+1:be(),i=te;if(!le&&l.shouldSanitizeForType(E)&&(t=l.sanitizeUnsafeInput(t)),!N&&n>0&&t.length>=n&&(t=t.substring(0,n-1)),d.textControl||xe(t||""),i&&t&&t.length<i)return;M(t,e),W&&(fe.current.style.height=`${fe.current.scrollHeight}px`,t||(fe.current.style.height=G||"48px"));const s=H||l.validateInput;if(!s||!l.isFunction(s))return;const[r,a]=s(t,E,z);oe(!r),he(d.errorMessage?d.errorMessage:a)},Oe=e=>{var t;d.skipFocus||ce(!0),me(null===(t=d.onFocus)||void 0===t?void 0:t.call(d,e))},Ie=e=>{var t;d.skipFocus||ce(!1),me(null===(t=d.onBlur)||void 0===t?void 0:t.call(d,e))},Se=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==E&&e.jsx("input",{className:$?"truncate-class":"","data-test":d["data-test"],id:d.id,style:null!==(t=null==ve?void 0:ve.input)&&void 0!==t?t:{},ref:fe,disabled:ie,type:["phonenumber","zip","number"].includes(E)?"number":E,value:ge,onFocus:e=>Oe(e),onBlur:e=>Ie(e),placeholder:y||"Enter here",onChange:Te,onClick:e=>me(d.onClick),onKeyDown:e=>ye(e)}),"multiline"===E&&e.jsx("textarea",{"data-test":d["data-test"],value:ge,ref:fe,onFocus:e=>Oe(e),onBlur:e=>Ie(e),onClick:e=>me(d.onClick),disabled:ie,placeholder:y||"Enter here",onChange:Te,onKeyDown:e=>ye(e),maxLength:I>0?I:void 0})]})};return e.jsxs(c.RootContainer,Object.assign({width:d.width,height:d.height,state:k,type:E,style:null!==(p=null==ve?void 0:ve.RootContainer)&&void 0!==p?p:{}},{children:[e.jsxs("div",Object.assign({className:"flex-align-center"},{children:[!A&&(!!w||!!de)&&e.jsxs(c.InputFooter,Object.assign({invalid:!!de},{children:[!!de&&e.jsx(o.default,{width:16,height:16}),de||w]})),I>0&&"BOTTOM"===J&&e.jsxs(c.MaxCharStyle,Object.assign({position:"BOTTOM"},{children:[null!==(g=null===(v=(null!=P?P:"").toString())||void 0===v?void 0:v.length)&&void 0!==g?g:0,"/",I]}))]})),e.jsxs(c.InputWrapper,Object.assign({variant:q,state:k,width:d.width,isActive:"active"===k||ue,isInvalid:ae,style:null!==(j=null!==(x=null==ve?void 0:ve.InputWrapper)&&void 0!==x?x:ee)&&void 0!==j?j:{},version:K,height:d.height,hightlightInputColor:Q,hideBorder:Z},{children:[!!se&&e.jsx(c.IconHolder,Object.assign({variant:q,iconSize:pe,onClick:()=>me(null==C?void 0:C.callback),isLeft:!0,style:null!==(f=null==ve?void 0:ve.IconHolder)&&void 0!==f?f:{}},{children:e.jsx(se,{})})),!!F&&e.jsx(c.PrefixHolder,Object.assign({variant:q},{children:F})),"default"===q&&e.jsx(c.InputContainer,Object.assign({height:d.height,type:d.type,minHeight:G,maxHeight:U,autoGrow:W},{children:Se()})),["x-small","small"].includes(q)&&e.jsx(c.InputContainerSmall,Object.assign({height:d.height,type:d.type},{children:Se()})),!!re&&e.jsx(c.IconHolder,Object.assign({variant:q,iconSize:pe,onClick:()=>me(null==T?void 0:T.callback),isLeft:!1},{children:e.jsx(re,{})})),!!L&&e.jsx(c.SuffixHolder,Object.assign({variant:q},{children:L})),B&&B.text&&e.jsx(i.Button,{buttonText:B.text,buttonType:B.buttonType,onClick:()=>me(null==B?void 0:B.onClick)}),B&&B.buttonProps&&e.jsx(i.Button,Object.assign({},B.buttonProps))]})),!Y&&(!!O||!!I)&&e.jsxs(c.InputHeader,Object.assign({invalid:ae,maxCharAlignment:ne},{children:[_&&_,e.jsxs("div",Object.assign({className:"label__container"},{children:[V?e.jsxs(r.TitleSmall,{children:[O,S?e.jsx("span",{children:"*"}):""]}):e.jsxs(r.BodySecondary,{children:[O,S?e.jsx("span",{children:"*"}):""]}),d.tooltipText&&e.jsx(s.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:ae?a.COLORS.content.negative:a.COLORS.content.primary})})}))]})),I>0&&"TOP"===J&&e.jsxs(c.MaxCharStyle,{children:[null!==(b=null===(m=(null!=P?P:"").toString())||void 0===m?void 0:m.length)&&void 0!==b?b:0,"/",I]})]}))]}))}));d.displayName="Input",exports.Input=d;
@@ -60,6 +60,7 @@ export declare const InputHeader: import("@emotion/styled").StyledComponent<{
60
60
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
61
61
  } & {
62
62
  invalid?: boolean | undefined;
63
+ maxCharAlignment?: boolean | undefined;
63
64
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
64
65
  export declare const MaxCharStyle: import("@emotion/styled").StyledComponent<{
65
66
  [x: string]: any;