@bikdotai/bik-component-library 0.0.386 → 0.0.387-beta.101

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.
Files changed (27) hide show
  1. package/dist/cjs/components/accordion/Accordion.d.ts +0 -2
  2. package/dist/cjs/components/accordion/Accordion.js +1 -1
  3. package/dist/cjs/components/accordion/Accordion.style.d.ts +0 -1
  4. package/dist/cjs/components/accordion/Accordion.style.js +1 -1
  5. package/dist/cjs/components/add-variableV2/AddVariableV2.js +1 -1
  6. package/dist/cjs/components/add-variableV2/AddVariableV2.styled.js +0 -2
  7. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
  8. package/dist/cjs/components/input/Input.js +1 -1
  9. package/dist/cjs/components/input/Input.styled.d.ts +0 -4
  10. package/dist/cjs/components/input/Input.styled.js +1 -1
  11. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +3 -3
  12. package/dist/cjs/constants/Theme.d.ts +0 -19
  13. package/dist/cjs/constants/Theme.js +1 -1
  14. package/dist/esm/components/accordion/Accordion.d.ts +0 -2
  15. package/dist/esm/components/accordion/Accordion.js +1 -1
  16. package/dist/esm/components/accordion/Accordion.style.d.ts +0 -1
  17. package/dist/esm/components/accordion/Accordion.style.js +1 -1
  18. package/dist/esm/components/add-variableV2/AddVariableV2.js +1 -1
  19. package/dist/esm/components/add-variableV2/AddVariableV2.styled.js +0 -2
  20. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
  21. package/dist/esm/components/input/Input.js +1 -1
  22. package/dist/esm/components/input/Input.styled.d.ts +0 -4
  23. package/dist/esm/components/input/Input.styled.js +1 -1
  24. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +3 -3
  25. package/dist/esm/constants/Theme.d.ts +0 -19
  26. package/dist/esm/constants/Theme.js +1 -1
  27. package/package.json +2 -1
@@ -12,7 +12,5 @@ export interface AccordionProps {
12
12
  showBorders?: boolean;
13
13
  backgroundColor?: string;
14
14
  refresh?: number | boolean;
15
- autoOpen?: boolean;
16
- childrenMaxHeight?: number;
17
15
  }
18
16
  export declare const BikAccordion: React.FC<AccordionProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../TypographyStyle.js"),n=require("./Accordion.style.js"),i=require("./AccordionArrow.js");exports.BikAccordion=o=>{var s;const[a,c]=r.useState(!1),l=r.useRef(null),d=r.useRef(null);r.useEffect((()=>{o.autoOpen&&u(o.autoOpen,{})}),[o.autoOpen]);const u=(e,r)=>{var t;d.current&&l.current&&("keydown"===r.type&&"Enter"!==r.key||(c(e),d.current.style.maxHeight?(d.current.style.maxHeight="",l.current.style.transform="rotate(0deg)",l.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="padding 0s"):(d.current.style.maxHeight=(null!==(t=o.childrenMaxHeight)&&void 0!==t?t:d.current.scrollHeight)+"px",l.current.style.transform="rotate(180deg)",l.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="max-height 0.25s ease-in-out")))};return r.useEffect((()=>{var e;a&&(null==o?void 0:o.refresh)&&(null===(e=null==d?void 0:d.current)||void 0===e?void 0:e.scrollHeight)&&!o.childrenMaxHeight&&setTimeout((()=>{d.current.style.maxHeight=d.current.scrollHeight+"px"}),100)}),[a,null==o?void 0:o.refresh,null===(s=null==d?void 0:d.current)||void 0===s?void 0:s.scrollHeight]),e.jsxs(n.default,Object.assign({className:"accordion",isActive:a,width:null==o?void 0:o.width,contentMargin:null==o?void 0:o.contentMargin,headerPadding:o.headerPadding,skipHoverState:o.skipHoverHeader,showBorders:o.showBorders,backgroundColor:o.backgroundColor},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(a?"active":""),onClick:e=>u(!a,e),onKeyDown:e=>u(!a,e),role:"button",tabIndex:0},{children:[!o.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof o.header?e.jsx(t.TitleRegular,{children:null==o?void 0:o.header}):o.header,e.jsx(i.default,{isNewIcon:!0,ref:l})]})),o.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:[e.jsxs("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[e.jsx(i.default,{isNewIcon:!0,ref:l}),"string"==typeof o.header?e.jsx(t.TitleRegular,{children:null==o?void 0:o.header}):o.header]})),e.jsx("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:o.rightActionComponent}))]})),(null==o?void 0:o.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(t.BodySecondary,{children:o.caption})}))]})),e.jsx("div",Object.assign({ref:d,className:"accordion__content"},{children:o.children}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../TypographyStyle.js"),n=require("./Accordion.style.js"),i=require("./AccordionArrow.js");exports.BikAccordion=o=>{var s;const[a,c]=r.useState(!1),l=r.useRef(null),d=r.useRef(null),u=(e,r)=>{d.current&&l.current&&("keydown"===r.type&&"Enter"!==r.key||(c(e),d.current.style.maxHeight?(d.current.style.maxHeight="",l.current.style.transform="rotate(0deg)",l.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="padding 0s"):(d.current.style.maxHeight=d.current.scrollHeight+"px",l.current.style.transform="rotate(180deg)",l.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="max-height 0.25s ease-in-out")))};return r.useEffect((()=>{var e;a&&(null==o?void 0:o.refresh)&&(null===(e=null==d?void 0:d.current)||void 0===e?void 0:e.scrollHeight)&&setTimeout((()=>{d.current.style.maxHeight=d.current.scrollHeight+"px"}),100)}),[a,null==o?void 0:o.refresh,null===(s=null==d?void 0:d.current)||void 0===s?void 0:s.scrollHeight]),e.jsxs(n.default,Object.assign({className:"accordion",isActive:a,width:null==o?void 0:o.width,contentMargin:null==o?void 0:o.contentMargin,headerPadding:o.headerPadding,skipHoverState:o.skipHoverHeader,showBorders:o.showBorders,backgroundColor:o.backgroundColor},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(a?"active":""),onClick:e=>u(!a,e),onKeyDown:e=>u(!a,e),role:"button",tabIndex:0},{children:[!o.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof o.header?e.jsx(t.TitleRegular,{children:null==o?void 0:o.header}):o.header,e.jsx(i.default,{isNewIcon:!1,ref:l})]})),o.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:[e.jsxs("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[e.jsx(i.default,{isNewIcon:!0,ref:l}),"string"==typeof o.header?e.jsx(t.TitleRegular,{children:null==o?void 0:o.header}):o.header]})),e.jsx("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:o.rightActionComponent}))]})),(null==o?void 0:o.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(t.BodySecondary,{children:o.caption})}))]})),e.jsx("div",Object.assign({ref:d,className:"accordion__content"},{children:o.children}))]}))};
@@ -6,6 +6,5 @@ declare const AccordionStyle: import("styled-components").StyledComponent<"div",
6
6
  headerPadding?: string | undefined;
7
7
  showBorders?: boolean | undefined;
8
8
  backgroundColor?: string | undefined;
9
- hasChildrenMaxHeight?: boolean | undefined;
10
9
  }, never>;
11
10
  export default AccordionStyle;
@@ -29,7 +29,7 @@
29
29
  }
30
30
  &__content {
31
31
  ${e=>e.isActive?{margin:(null==e?void 0:e.contentMargin)||"0px"}:{}};
32
- overflow: ${e=>e.hasChildrenMaxHeight?"scroll":"hidden"};
32
+ overflow: hidden;
33
33
  max-height: 0;
34
34
  }
35
35
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),a=require("react/jsx-runtime"),s=require("../../assets/icons/back_icon.svg.js"),i=require("../../assets/icons/chevronRightAlt.svg.js"),l=require("../../assets/icons/cross.svg.js"),t=require("../../assets/icons/plus.svg.js"),n=require("../../assets/icons/undo.svg.js"),r=require("react"),c=require("./AddVariableV2.styled.js"),o=require("../button/Button.js"),d=require("../icon-button/IconButton.js"),b=require("../searchBar/searchBar.js"),u=require("../tooltips/Tooltip.js"),v=require("../../constants/Theme.js"),j=require("../switch/Switch.js"),g=require("../TypographyStyle.js");const m=r.memo((m=>{const{data:h}=m,[p,y]=r.useState(m.data),[x,f]=r.useState({}),[O,S]=r.useState(),[N,V]=r.useState(""),[C,_]=r.useState(""),[T,w]=r.useState(!1),[k,B]=r.useState(!0),q=/^[^.]*\.[^.]*$/;r.useEffect((()=>{const e={};h.forEach((a=>{e[a.displayName]=[]})),S(e)}),[h]),r.useEffect((()=>{A(!0)}),[]),r.useEffect((()=>{if(C){F(m.data,k).length>0?w(!0):w(!1)}else w(!0)}),[C]);const F=function(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.flatMap((e=>Object.keys(e.variables).filter((s=>{var i;return(null===(i=e.variables[s].displayName)||void 0===i?void 0:i.toLowerCase().includes(C.toLowerCase()))&&(!a||e.variables[s].isAvailable===a)||I(e.variables[s])}))))},L=(e,a)=>{const s=h.find((e=>e.displayName===a));if(s){let i=s;e.forEach(((e,a)=>{i=i.variables[e]})),f((e=>Object.assign(Object.assign({},e),{[a]:i})))}},I=e=>{let a=!1;if(e.isSubHeader&&e.variables){const s=Object.keys(e.variables);for(let i=0;i<s.length;i++){const l=s[i];if(e.variables&&e.variables[l].displayName.toLowerCase().includes(C.toLowerCase())&&e.variables[l].isAvailable===k){a=!0;break}}}return a},A=e=>{if(B(e),e){let a=[];if(N){const e=x[N];a=m.data.filter((e=>e.displayName===N)).map((a=>E(a,e))).filter((e=>null!=e))}else a=m.data.map((e=>E(e))).filter((e=>null!==e));y(a),C&&(a=F(a,e)),a.length>0?w(!0):w(!1)}else if(y(m.data),C){F(m.data,e).length>0?w(!0):w(!1)}else w(!0)};function E(e,a){const s={};if(a){for(const i in e.variables)if(e.variables[i]===a)for(const a in e.variables[i].variables)e.variables[i].variables[a].isAvailable&&(s[a]=e.variables[i].variables[a])}else for(const a in e.variables)e.variables[a].isAvailable&&(s[a]=e.variables[a]);return 0===Object.keys(s).length?null:Object.assign(Object.assign({},e),{variables:s})}const H=e=>{const s=e.item.description;return a.jsx(a.Fragment,{children:a.jsx(u.Tooltip,Object.assign({body:"",tooltipContent:a.jsx(g.BodyCaption,Object.assign({color:v.COLORS.content.primaryInverse,style:{whiteSpace:"pre-line",padding:8}},{children:e.item.isAvailable?s?`• ${s}\n• Recommended here`:"Recommended here":"Not recommended here"})),width:300,delay:300,placement:"bottom"},{children:a.jsx("div",{children:a.jsx(M,{item:e.item})})}))})},M=e=>a.jsx(o.Button,{darkMode:m.enableVariable?m.enableVariable:e.item.isAvailable,size:"chip",LeadingIcon:e.item.isSubHeader?void 0:t.default,TrailingIcon:()=>e.item.isSubHeader?a.jsx("div",Object.assign({className:"icon-trailing",style:{display:"flex"}},{children:a.jsx(i.default,{})})):a.jsx(a.Fragment,{}),buttonText:e.item.displayName}),P=(e,s)=>k&&!e.isAvailable?a.jsx(a.Fragment,{}):a.jsx("div",Object.assign({onClick:e.isSubHeader?()=>{const e=[...O[N],s];L(e,N),S((a=>Object.assign(Object.assign({},a),{[N]:e})))}:()=>{m.customTrigger?(m.customTrigger(e),m.setShowVariable(!1)):m.isEvaluationList?$(e):m.setVariableValue(m.selectWithTypes?{actualValue:e.actualValue,variableType:e.variableType,needsFetching:e.needsFetching}:e.actualValue)}},{children:a.jsx(H,{item:e})})),R=(e,a)=>{const s=[...O[e.displayName],a];L(s,e.displayName),S((a=>Object.assign(Object.assign({},a),{[e.displayName]:s}))),V(e.displayName)},$=e=>{if(e.actualValue.match(q)){const a=e.actualValue.replace("{{","").replace("}}","").split("."),s=a[0]+`['${a[1]}']`;m.setVariableValue(m.selectWithTypes?{actualValue:s,variableType:e.variableType,needsFetching:e.needsFetching}:s)}else{const a=e.actualValueEval?e.actualValueEval:e.actualValue;m.setVariableValue(m.selectWithTypes?{actualValue:a,variableType:e.variableType,needsFetching:e.needsFetching}:a)}},z=(e,a)=>{if(m.customTrigger)m.customTrigger(e.variables[a]),m.setShowVariable(!1);else if(m.isEvaluationList){const s=e.variables[a];$(s)}else m.setVariableValue(m.selectWithTypes?{actualValue:e.variables[a].actualValue,variableType:e.variables[a].variableType,needsFetching:e.variables[a].needsFetching}:e.variables[a].actualValue)},W=m.isModalState?void 0:{top:"small"===m.pickerSize?"300px":"60px",left:`${m.leftPosition?m.leftPosition+24:430}px`};return a.jsx("div",Object.assign({id:"varList",tabIndex:-1},{children:a.jsx(c.AddVariableStyled,Object.assign({style:W,onClick:e=>{e.stopPropagation()},pickerSize:m.pickerSize||"large",isModalState:m.isModalState},{children:m.showVariable&&a.jsxs("div",Object.assign({className:"popup"},{children:[a.jsxs("div",Object.assign({className:"sticky__bar"},{children:[a.jsxs("div",Object.assign({className:"header__bar"},{children:[a.jsx("div",Object.assign({className:"add__variable"},{children:"Add a new variable"})),a.jsx("div",Object.assign({onClick:()=>{m.setShowVariable(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center"}},{children:a.jsx(d.IconButton,{iconButtonType:"default",Icon:l.default})}))]})),a.jsxs("div",Object.assign({className:"search__bar",onBlur:e=>{m.onSearchBlur&&m.onSearchBlur(e)}},{children:[a.jsx(b.SearchBar,{width:"100%",isEnabled:!0,onChange:e=>{_(e)},onEnter:()=>{},placeholder:"Search...",variant:"default"}),a.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",marginTop:8,justifyContent:"space-between"}},{children:[a.jsx(g.BodySecondary,Object.assign({style:{color:v.COLORS.content.secondary}},{children:"Show only recommended variables"})),a.jsx(j.Switch,{value:k,onValueChange:a=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield A(a)}))})]}))]})),N&&O[N].length>0&&a.jsxs("div",Object.assign({className:"nav__bar"},{children:[a.jsxs("div",Object.assign({className:"left__nav"},{children:[a.jsx(d.IconButton,{Icon:s.default,style:{color:"#919191",display:"flex"},onClick:()=>{const e=O[N].slice(0,-1);L(e,N),S((a=>Object.assign(Object.assign({},a),{[N]:e}))),e.length||V("")}}),a.jsxs("div",Object.assign({className:"block"},{children:[a.jsx(g.TitleSmall,{children:x[N].displayName}),x[N].description&&a.jsx(g.BodyCaption,{children:x[N].description})]}))]})),a.jsxs("div",Object.assign({className:"right__nav"},{children:[a.jsx(d.IconButton,{Icon:n.default,style:{display:"flex"},onClick:()=>{L([],N),S((e=>Object.assign(Object.assign({},e),{[N]:[]}))),V("")}}),a.jsx("div",{children:"First page"})]}))]}))]})),!T&&a.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",marginTop:16}},{children:[a.jsx(g.TitleSmall,{children:"No results found!"}),k?a.jsx(g.BodyCaption,{children:"Sorry we could not find any recommended variables"}):a.jsx(g.BodyCaption,{children:`Sorry we could not find any results for "${C}"`})]})),a.jsx("div",Object.assign({className:"wrapper"},{children:a.jsx("div",Object.assign({className:"list__map"},{children:a.jsxs("div",Object.assign({className:"items"},{children:[!N&&p.map((e=>{let s=[];return C&&(s=Object.keys(e.variables).filter((a=>{var s;return(null===(s=e.variables[a].displayName)||void 0===s?void 0:s.toLowerCase().includes(C.toLowerCase()))||I(e.variables[a])}))),a.jsxs(a.Fragment,{children:[C?s.length>0?a.jsxs("div",Object.assign({className:"block"},{children:[a.jsx("div",Object.assign({className:"heading__font"},{children:null==e?void 0:e.displayName})),a.jsx(g.BodyCaption,Object.assign({style:{marginBottom:8,color:"#616161"}},{children:null==e?void 0:e.description}))]})):a.jsx(a.Fragment,{}):a.jsxs("div",Object.assign({className:"block"},{children:[a.jsx("div",Object.assign({className:"heading__font"},{children:null==e?void 0:e.displayName})),a.jsx(g.BodyCaption,Object.assign({style:{marginBottom:8,color:"#616161"}},{children:null==e?void 0:e.description}))]})),Object.keys(e.variables).map((s=>{var i;return C?(null===(i=e.variables[s].displayName)||void 0===i?void 0:i.toLowerCase().includes(C.toLowerCase()))||I(e.variables[s])?a.jsx("div",Object.assign({onClick:e.variables[s].isSubHeader?()=>R(e,s):()=>z(e,s)},{children:a.jsx(H,{item:e.variables[s]})})):a.jsx(a.Fragment,{}):a.jsx("div",Object.assign({onClick:e.variables[s].isSubHeader?()=>R(e,s):()=>z(e,s)},{children:a.jsx(H,{item:e.variables[s]})}))}))]})})),N&&a.jsx("div",Object.assign({className:"list__map"},{children:a.jsx("div",Object.assign({className:"items",style:{marginTop:16}},{children:Object.keys(x[N].variables).map(((e,s)=>{var i;return C?(null===(i=x[N].variables[e].displayName)||void 0===i?void 0:i.toLowerCase().includes(C.toLowerCase()))||I(x[N].variables[e])?P(x[N].variables[e],e):a.jsx(a.Fragment,{}):P(x[N].variables[e],e)}))}))}))]}))}))})),a.jsx("div",{className:"bottom__padding"})]}))}))}))}),((e,a)=>e.enableVariable===a.enableVariable&&e.leftPosition===a.leftPosition));exports.AddVariableV2=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/back_icon.svg.js"),a=require("../../assets/icons/chevronRightAlt.svg.js"),i=require("../../assets/icons/cross.svg.js"),t=require("../../assets/icons/plus.svg.js"),l=require("../../assets/icons/undo.svg.js"),n=require("react"),r=require("./AddVariableV2.styled.js"),c=require("../button/Button.js"),o=require("../icon-button/IconButton.js"),d=require("../searchBar/searchBar.js"),b=require("../tooltips/Tooltip.js"),u=require("../../constants/Theme.js"),j=require("../TypographyStyle.js");const v=n.memo((v=>{const{data:g}=v,[m,h]=n.useState({}),[p,y]=n.useState(),[x,O]=n.useState(""),[f,N]=n.useState(""),[V,S]=n.useState(!0),T=/^[^.]*\.[^.]*$/;n.useEffect((()=>{const e={};g.forEach((s=>{e[s.displayName]=[]})),y(e)}),[g]),n.useEffect((()=>{if(f){v.data.filter((e=>Object.keys(e.variables).filter((s=>{var a;return(null===(a=e.variables[s].displayName)||void 0===a?void 0:a.toLowerCase().includes(f.toLowerCase()))||_(e.variables[s])})).length>0)).length>0?S(!0):S(!1)}else S(!0)}),[f]);const C=(e,s)=>{const a=g.find((e=>e.displayName===s));if(a){let i=a;e.forEach(((e,s)=>{i=i.variables[e]})),h((e=>Object.assign(Object.assign({},e),{[s]:i})))}},_=e=>{let s=!1;if(e.isSubHeader&&e.variables){const a=Object.keys(e.variables);for(let i=0;i<a.length;i++){const t=a[i];if(e.variables&&e.variables[t].displayName.toLowerCase().includes(f.toLowerCase())){s=!0;break}}}return s},k=s=>{const a=s.item.description;return e.jsx(e.Fragment,{children:e.jsx(b.Tooltip,Object.assign({body:"",tooltipContent:e.jsx(j.BodyCaption,Object.assign({color:u.COLORS.content.primaryInverse,style:{whiteSpace:"pre-line",padding:8}},{children:s.item.isAvailable?a?`• ${a}\n• Recommended here`:"Recommended here":"Not recommended here"})),width:300,delay:300,placement:"bottom"},{children:e.jsx("div",{children:e.jsx(w,{item:s.item})})}))})},w=s=>e.jsx(c.Button,{darkMode:v.enableVariable?v.enableVariable:s.item.isAvailable,size:"chip",LeadingIcon:s.item.isSubHeader?void 0:t.default,TrailingIcon:()=>s.item.isSubHeader?e.jsx("div",Object.assign({className:"icon-trailing",style:{display:"flex"}},{children:e.jsx(a.default,{})})):e.jsx(e.Fragment,{}),buttonText:s.item.displayName}),B=(s,a)=>e.jsx("div",Object.assign({onClick:s.isSubHeader?()=>{const e=[...p[x],a];C(e,x),y((s=>Object.assign(Object.assign({},s),{[x]:e})))}:()=>{v.customTrigger?(v.customTrigger(s),v.setShowVariable(!1)):v.isEvaluationList?L(s):v.setVariableValue(v.selectWithTypes?{actualValue:s.actualValue,variableType:s.variableType,needsFetching:s.needsFetching}:s.actualValue)}},{children:e.jsx(k,{item:s})})),F=(e,s)=>{const a=[...p[e.displayName],s];C(a,e.displayName),y((s=>Object.assign(Object.assign({},s),{[e.displayName]:a}))),O(e.displayName)},L=e=>{if(e.actualValue.match(T)){const s=e.actualValue.replace("{{","").replace("}}","").split("."),a=s[0]+`['${s[1]}']`;v.setVariableValue(v.selectWithTypes?{actualValue:a,variableType:e.variableType,needsFetching:e.needsFetching}:a)}else{const s=e.actualValueEval?e.actualValueEval:e.actualValue;v.setVariableValue(v.selectWithTypes?{actualValue:s,variableType:e.variableType,needsFetching:e.needsFetching}:s)}},q=(e,s)=>{if(v.customTrigger)v.customTrigger(e.variables[s]),v.setShowVariable(!1);else if(v.isEvaluationList){const a=e.variables[s];L(a)}else v.setVariableValue(v.selectWithTypes?{actualValue:e.variables[s].actualValue,variableType:e.variables[s].variableType,needsFetching:e.variables[s].needsFetching}:e.variables[s].actualValue)},I=v.isModalState?void 0:{top:"small"===v.pickerSize?"300px":"60px",left:`${v.leftPosition?v.leftPosition+24:430}px`};return e.jsx("div",Object.assign({id:"varList",tabIndex:-1},{children:e.jsx(r.AddVariableStyled,Object.assign({style:I,onClick:e=>{e.stopPropagation()},pickerSize:v.pickerSize||"large",isModalState:v.isModalState},{children:v.showVariable&&e.jsxs("div",Object.assign({className:"popup"},{children:[e.jsxs("div",Object.assign({className:"sticky__bar"},{children:[e.jsxs("div",Object.assign({className:"header__bar"},{children:[e.jsx("div",Object.assign({className:"add__variable"},{children:"Add a new variable"})),e.jsx("div",Object.assign({onClick:()=>{v.setShowVariable(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center"}},{children:e.jsx(o.IconButton,{iconButtonType:"default",Icon:i.default})}))]})),e.jsx("div",Object.assign({className:"search__bar",onBlur:e=>{v.onSearchBlur&&v.onSearchBlur(e)}},{children:e.jsx(d.SearchBar,{width:"100%",isEnabled:!0,onChange:e=>{N(e)},onEnter:()=>{},placeholder:"Search...",variant:"default"})})),!V&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",marginTop:16}},{children:[e.jsx(j.TitleSmall,{children:"No results found!"}),e.jsx(j.BodyCaption,{children:`Sorry we could not find any results for "${f}"`})]})),x&&p[x].length>0&&e.jsxs("div",Object.assign({className:"nav__bar",style:{marginTop:8}},{children:[e.jsxs("div",Object.assign({className:"left__nav"},{children:[e.jsx(o.IconButton,{Icon:s.default,style:{color:"#919191",display:"flex"},onClick:()=>{const e=p[x].slice(0,-1);C(e,x),y((s=>Object.assign(Object.assign({},s),{[x]:e}))),e.length||O("")}}),e.jsxs("div",Object.assign({className:"block"},{children:[e.jsx(j.TitleSmall,{children:m[x].displayName}),m[x].description&&e.jsx(j.BodyCaption,{children:m[x].description})]}))]})),e.jsxs("div",Object.assign({className:"right__nav"},{children:[e.jsx(o.IconButton,{Icon:l.default,style:{display:"flex"},onClick:()=>{C([],x),y((e=>Object.assign(Object.assign({},e),{[x]:[]}))),O("")}}),e.jsx("div",{children:"First page"})]}))]}))]})),e.jsx("div",Object.assign({className:"wrapper"},{children:e.jsx("div",Object.assign({className:"list__map"},{children:e.jsxs("div",Object.assign({className:"items"},{children:[!x&&v.data.map((s=>{let a=[];return f&&(a=Object.keys(s.variables).filter((e=>{var a;return(null===(a=s.variables[e].displayName)||void 0===a?void 0:a.toLowerCase().includes(f.toLowerCase()))||_(s.variables[e])}))),e.jsxs(e.Fragment,{children:[f?a.length>0?e.jsxs("div",Object.assign({className:"block"},{children:[e.jsx("div",Object.assign({className:"heading__font"},{children:null==s?void 0:s.displayName})),e.jsx(j.BodyCaption,Object.assign({style:{marginBottom:8,color:"#616161"}},{children:null==s?void 0:s.description}))]})):e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"block"},{children:[e.jsx("div",Object.assign({className:"heading__font"},{children:null==s?void 0:s.displayName})),e.jsx(j.BodyCaption,Object.assign({style:{marginBottom:8,color:"#616161"}},{children:null==s?void 0:s.description}))]})),Object.keys(s.variables).map((a=>{var i;return f?(null===(i=s.variables[a].displayName)||void 0===i?void 0:i.toLowerCase().includes(f.toLowerCase()))||_(s.variables[a])?e.jsx("div",Object.assign({onClick:s.variables[a].isSubHeader?()=>F(s,a):()=>q(s,a)},{children:e.jsx(k,{item:s.variables[a]})})):e.jsx(e.Fragment,{}):e.jsx("div",Object.assign({onClick:s.variables[a].isSubHeader?()=>F(s,a):()=>q(s,a)},{children:e.jsx(k,{item:s.variables[a]})}))}))]})})),x&&e.jsx("div",Object.assign({className:"list__map"},{children:e.jsx("div",Object.assign({className:"items",style:{marginTop:16}},{children:Object.keys(m[x].variables).map(((s,a)=>{var i;return f?(null===(i=m[x].variables[s].displayName)||void 0===i?void 0:i.toLowerCase().includes(f.toLowerCase()))||_(m[x].variables[s])?B(m[x].variables[s],s):e.jsx(e.Fragment,{}):B(m[x].variables[s],s)}))}))}))]}))}))})),e.jsx("div",{className:"bottom__padding"})]}))}))}))}),((e,s)=>e.enableVariable===s.enableVariable&&e.leftPosition===s.leftPosition));exports.AddVariableV2=v;
@@ -40,8 +40,6 @@
40
40
 
41
41
  .search__bar {
42
42
  padding: 24px 24px 8px 24px;
43
- background-color: #fafafa;
44
- border-bottom: 1px solid var(--stroke-color-stroke-primary, #e0e0e0);
45
43
  }
46
44
  .nav__bar {
47
45
  display: flex;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),t=require("react-bootstrap"),n=require("../../constants/Theme.js"),s=require("../datePicker/DatePicker.js"),i=require("../TypographyStyle.js"),l=require("./CommonStyles.js");const a=o=>{let{eachOption:t,selectedOption:s,selectedDate:a,onClickingEachItem:c,rangeSelection:r}=o;return e.jsxs(l.ItemMenuContainer,Object.assign({onClick:()=>c(t),isSelected:t.isCustom?t.key==(null==s?void 0:s.key)&&!!a:t.key==(null==s?void 0:s.key)},{children:[e.jsx(i.BodySecondary,Object.assign({color:t.key==(null==s?void 0:s.key)?n.BASE_COLORS.positive[900]:n.BASE_COLORS.grayscale[900]},{children:t.label})),a&&(null==s?void 0:s.isCustom)&&t.key==(null==s?void 0:s.key)&&e.jsx(i.BodyCaption,{children:r?`${d(a[0])} to ${d(a[1])}`:`${d(a[0])}`})]}),t.key)},d=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});exports.AnalyticsDropdown=c=>{let{options:r,placeholder:u="Select an option",selected:g,onOptionSelected:p,resetDropdown:v,maxHeight:m,backgroundColor:O,calendarPopperConfig:j,variant:D="default",datePickerPlacement:y}=c;var S,b,h;const[x,f]=o.useState(!1),[k,w]=o.useState(g),[C,R]=o.useState(),[E,T]=o.useState(!1),A=()=>{!x&&T(!E)},[M,q]=o.useState(g),P="small"===D?i.Caption:i.BodySecondary;return o.useEffect((()=>{v&&w(void 0)}),[v]),o.useEffect((()=>{var e;(null==g?void 0:g.isCustom)&&(null===(e=g.dateRangeSelectionOptions)||void 0===e?void 0:e.selectedDates)?R(g.dateRangeSelectionOptions.selectedDates):g&&w(g)}),[g]),e.jsx(e.Fragment,{children:e.jsxs(l.MainDropdown,Object.assign({drop:"down",show:E,onToggle:A,backgroundColor:O},{children:[e.jsx(t.Dropdown.Toggle,Object.assign({id:"dropdown-autoclose-outside",className:"main--dropdown",style:"small"===D?{display:"flex",alignItems:"center",gap:6,padding:"4px 8px",backgroundColor:"#FAFAFA",borderRadius:4,border:`1px solid ${n.DEFAULT_THEME.colorsV2.stroke.primary}`}:void 0},{children:e.jsx(P,Object.assign({style:"small"===D?{color:n.DEFAULT_THEME.colorsV2.content.secondary}:void 0},{children:(null==k?void 0:k.isCustom)?C?d(C[0])===d(C[1])?`${d(C[0])}`:`${d(C[0])} to ${d(C[1])}`:null==M?void 0:M.label:k?null==k?void 0:k.label:u}))})),e.jsx(t.Dropdown.Menu,Object.assign({className:"main--dropdown"},{children:e.jsxs(l.MainDropdown,Object.assign({drop:null!=y?y:"end",id:"sub--dropdown",show:x,onToggle:e=>{!e&&T(!1),f(!x)}},{children:[e.jsx("div",Object.assign({style:{maxHeight:m||"auto",overflowY:"scroll"}},{children:r.map((o=>{var n;return e.jsx("div",{children:(null==o?void 0:o.isCustom)?e.jsx(t.Dropdown.Toggle,Object.assign({className:"sub--dropdown"},{children:e.jsx(a,{eachOption:o,selectedOption:k,selectedDate:C,onClickingEachItem:e=>{w(e),f(!0)},rangeSelection:!!(null===(n=null==o?void 0:o.dateRangeSelectionOptions)||void 0===n?void 0:n.selectRange)})})):e.jsx(a,{eachOption:o,selectedOption:k,selectedDate:C,onClickingEachItem:e=>{if(R(void 0),w(e),q(e),A(),!e.noOfDays)return void p(e);const o=new Date,t=new Date;t.setDate(o.getDate()-e.noOfDays),p(Object.assign(Object.assign({},e),{selectedRange:[t,o]}))}})},null==o?void 0:o.key)}))})),e.jsx(t.Dropdown.Menu,Object.assign({className:"sub--dropdown",popperConfig:{modifiers:[{name:"offset",options:{offset:[(null==j?void 0:j.offsetSkid)||0,(null==j?void 0:j.offsetDistance)||0]}}]}},{children:e.jsx(s.DatePicker,{selectRange:(null===(S=null==k?void 0:k.dateRangeSelectionOptions)||void 0===S?void 0:S.selectRange)||!1,maxDate:null===(b=null==k?void 0:k.dateRangeSelectionOptions)||void 0===b?void 0:b.maxDate,minDate:null===(h=null==k?void 0:k.dateRangeSelectionOptions)||void 0===h?void 0:h.minDate,selectedDates:C,onSelectRange:(e,o)=>{const t=[e,o];(null==k?void 0:k.dateRangeSelectionOptions)&&(k.dateRangeSelectionOptions.selectedDates=t,p(Object.assign(Object.assign({},k),{selectedRange:[e,o]}))),q(k),f(!1),R(t),T(!E)},onSelectDate:e=>{(null==k?void 0:k.dateRangeSelectionOptions)&&(k.dateRangeSelectionOptions.selectedDates=[e,e],p(Object.assign(Object.assign({},k),{selectedRange:[e,e]}))),q(k),f(!1),R([e,e]),T(!E)}})}))]}))}))]}))})},exports.EachItem=a,exports.formatDate=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),t=require("react-bootstrap"),n=require("../../constants/Theme.js"),s=require("../datePicker/DatePicker.js"),i=require("../TypographyStyle.js"),l=require("./CommonStyles.js");const a=o=>{let{eachOption:t,selectedOption:s,selectedDate:a,onClickingEachItem:c,rangeSelection:r}=o;return e.jsxs(l.ItemMenuContainer,Object.assign({onClick:()=>c(t),isSelected:t.isCustom?t.key==(null==s?void 0:s.key)&&!!a:t.key==(null==s?void 0:s.key)},{children:[e.jsx(i.BodySecondary,Object.assign({color:t.key==(null==s?void 0:s.key)?n.BASE_COLORS.positive[900]:n.BASE_COLORS.grayscale[900]},{children:t.label})),a&&(null==s?void 0:s.isCustom)&&t.key==(null==s?void 0:s.key)&&e.jsx(i.BodyCaption,{children:r?`${d(a[0])} to ${d(a[1])}`:`${d(a[0])}`})]}),t.key)},d=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});exports.AnalyticsDropdown=c=>{let{options:r,placeholder:u="Select an option",selected:g,onOptionSelected:p,resetDropdown:v,maxHeight:m,backgroundColor:O,calendarPopperConfig:j,variant:D="default",datePickerPlacement:y}=c;var S,b,h;const[x,f]=o.useState(!1),[k,w]=o.useState(g),[C,R]=o.useState(),[E,T]=o.useState(!1),A=()=>{!x&&T(!E)},[M,q]=o.useState(g),P="small"===D?i.Caption:i.BodySecondary;return o.useEffect((()=>{v&&w(void 0)}),[v]),o.useEffect((()=>{var e;(null==g?void 0:g.isCustom)&&(null===(e=g.dateRangeSelectionOptions)||void 0===e?void 0:e.selectedDates)?R(g.dateRangeSelectionOptions.selectedDates):R(void 0),w(g)}),[g]),e.jsx(e.Fragment,{children:e.jsxs(l.MainDropdown,Object.assign({drop:"down",show:E,onToggle:A,backgroundColor:O},{children:[e.jsx(t.Dropdown.Toggle,Object.assign({id:"dropdown-autoclose-outside",className:"main--dropdown",style:"small"===D?{display:"flex",alignItems:"center",gap:6,padding:"4px 8px",backgroundColor:"#FAFAFA",borderRadius:4,border:`1px solid ${n.DEFAULT_THEME.colorsV2.stroke.primary}`}:void 0},{children:e.jsx(P,Object.assign({style:"small"===D?{color:n.DEFAULT_THEME.colorsV2.content.secondary}:void 0},{children:(null==k?void 0:k.isCustom)?C?d(C[0])===d(C[1])?`${d(C[0])}`:`${d(C[0])} to ${d(C[1])}`:null==M?void 0:M.label:k?null==k?void 0:k.label:u}))})),e.jsx(t.Dropdown.Menu,Object.assign({className:"main--dropdown"},{children:e.jsxs(l.MainDropdown,Object.assign({drop:null!=y?y:"end",id:"sub--dropdown",show:x,onToggle:e=>{!e&&T(!1),f(!x)}},{children:[e.jsx("div",Object.assign({style:{maxHeight:m||"auto",overflowY:"scroll"}},{children:r.map((o=>{var n;return e.jsx("div",{children:(null==o?void 0:o.isCustom)?e.jsx(t.Dropdown.Toggle,Object.assign({className:"sub--dropdown"},{children:e.jsx(a,{eachOption:o,selectedOption:k,selectedDate:C,onClickingEachItem:e=>{w(e),f(!0)},rangeSelection:!!(null===(n=null==o?void 0:o.dateRangeSelectionOptions)||void 0===n?void 0:n.selectRange)})})):e.jsx(a,{eachOption:o,selectedOption:k,selectedDate:C,onClickingEachItem:e=>{if(R(void 0),w(e),q(e),A(),!e.noOfDays)return void p(e);const o=new Date,t=new Date;t.setDate(o.getDate()-e.noOfDays),p(Object.assign(Object.assign({},e),{selectedRange:[t,o]}))}})},null==o?void 0:o.key)}))})),e.jsx(t.Dropdown.Menu,Object.assign({className:"sub--dropdown",popperConfig:{modifiers:[{name:"offset",options:{offset:[(null==j?void 0:j.offsetSkid)||0,(null==j?void 0:j.offsetDistance)||0]}}]}},{children:e.jsx(s.DatePicker,{selectRange:(null===(S=null==k?void 0:k.dateRangeSelectionOptions)||void 0===S?void 0:S.selectRange)||!1,maxDate:null===(b=null==k?void 0:k.dateRangeSelectionOptions)||void 0===b?void 0:b.maxDate,minDate:null===(h=null==k?void 0:k.dateRangeSelectionOptions)||void 0===h?void 0:h.minDate,selectedDates:C,onSelectRange:(e,o)=>{const t=[e,o];(null==k?void 0:k.dateRangeSelectionOptions)&&(k.dateRangeSelectionOptions.selectedDates=t,p(Object.assign(Object.assign({},k),{selectedRange:[e,o]}))),q(k),f(!1),R(t),T(!E)},onSelectDate:e=>{(null==k?void 0:k.dateRangeSelectionOptions)&&(k.dateRangeSelectionOptions.selectedDates=[e,e],p(Object.assign(Object.assign({},k),{selectedRange:[e,e]}))),q(k),f(!1),R([e,e]),T(!E)}})}))]}))}))]}))})},exports.EachItem=a,exports.formatDate=d;
@@ -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"),a=require("./Input.styled.js");const o=t.forwardRef(((o,u)=>{var c,d,v,h,x;const{placeholder:f,leftIcon:p,rightIcon:g,labelText:j,maxCharLimit:y,isRequired:b,hintText:I,type:C,state:m,validate:w,variant:E,button:S,suffixText:O,prefixText:k,onChangeText:q,value:F,noErrorHint:H,reset:L,rangeValidation:M,noKeyDownChange:T,version:B,noMaxCharCheck:R}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},o),A=null==p?void 0:p.icon,D=null==g?void 0:g.icon,[z,K]=t.useState(!1),[P,W]=t.useState(!1),[_,N]=t.useState(),V="small"===E?"18px":"22px",G=t.useContext(l.InputStyleContext),[J,Q]=t.useState(),U=t.useRef(null),X=null!=u?u:U;t.useEffect((()=>{Q(F)}),[F]),t.useEffect((()=>{var e;X.current&&(null===(e=o.onReferenceInit)||void 0===e||e.call(o,X.current))}),[X]),t.useEffect((()=>{const e=X.current;if(e)return e.addEventListener("wheel",$,{passive:!1}),()=>{e.removeEventListener("wheel",$)}}),[]),t.useEffect((()=>{L&&Q("")}),[L]),t.useEffect((()=>{var e;W(!!o.isActive),o.isActive&&(null===(e=X.current)||void 0===e||e.focus())}),[o.isActive]),t.useEffect((()=>{N(o.errorMessage)}),[o.errorMessage]),t.useEffect((()=>{var e;K(!1),("invalid"===o.state||_)&&K(!0),"active"===o.state&&(null===(e=X.current)||void 0===e||e.focus())}),[o.state,_]),t.useEffect((()=>{K(!!_)}),[_]);const Y=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)}},Z=e=>{const t=y||("zip"===C?6:60);T||q(F||"",e),R||![8].includes(e.which)&&t>0&&e.target.value.length===t&&e.preventDefault()},$=e=>{e.preventDefault()},ee=e=>{const t=e.target.value;q(t,e),o.textControl||Q(t);const n=w||i.validateInput;if(!n||!i.isFunction(n))return;const[r,s]=n(t,C,M);K(!r),N(o.errorMessage?o.errorMessage:s)},te=e=>{var t;o.skipFocus||W(!0),Y(null===(t=o.onFocus)||void 0===t?void 0:t.call(o,e))},ne=e=>{var t;o.skipFocus||W(!1),Y(null===(t=o.onBlur)||void 0===t?void 0:t.call(o,e))},ie=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==C&&e.jsx("input",{id:o.id,style:null!==(t=null==G?void 0:G.input)&&void 0!==t?t:{},ref:X,type:["phonenumber","zip","number"].includes(C)?"number":C,value:J,onFocus:e=>te(e),onBlur:e=>ne(e),placeholder:f||"Enter here",onChange:ee,onKeyDown:e=>Z(e)}),"multiline"===C&&e.jsx("textarea",{value:J,ref:X,onFocus:e=>te(e),onBlur:e=>ne(e),placeholder:f||"Enter here",onChange:ee,onKeyDown:e=>Z(e),maxLength:y>0?y:void 0})]})};return e.jsxs(a.RootContainer,Object.assign({width:o.width,height:o.height,state:m,type:C,style:null!==(c=null==G?void 0:G.RootContainer)&&void 0!==c?c:{}},{children:[!H&&(!!I||!!_)&&e.jsxs(a.InputFooter,Object.assign({invalid:!!_},{children:[!!_&&e.jsx(s.default,{width:16,height:16}),_||I]})),e.jsxs(a.InputWrapper,Object.assign({variant:E,state:m,width:o.width,isActive:"active"===m||P,isInvalid:z,style:null!==(d=null==G?void 0:G.InputWrapper)&&void 0!==d?d:{},version:B,height:o.height},{children:[!!A&&e.jsx(a.IconHolder,Object.assign({variant:E,iconSize:V,onClick:()=>Y(null==p?void 0:p.callback),isLeft:!0,style:null!==(v=null==G?void 0:G.IconHolder)&&void 0!==v?v:{}},{children:e.jsx(A,{})})),!!k&&e.jsx(a.PrefixHolder,Object.assign({variant:E},{children:k})),"default"===E&&e.jsx(a.InputContainer,Object.assign({height:o.height},{children:ie()})),"small"===E&&e.jsx(a.InputContainerSmall,Object.assign({height:o.height},{children:ie()})),!!D&&e.jsx(a.IconHolder,Object.assign({variant:E,iconSize:V,onClick:()=>Y(null==g?void 0:g.callback),isLeft:!1},{children:e.jsx(D,{})})),!!O&&e.jsx(a.SuffixHolder,Object.assign({variant:E},{children:O})),S&&S.text&&e.jsx(n.Button,{buttonText:S.text,onClick:()=>Y(null==S?void 0:S.onClick)})]})),(!!j||!!y)&&e.jsxs(a.InputHeader,Object.assign({invalid:z},{children:[e.jsxs(r.BodySecondary,{children:[j,b?e.jsx("span",{children:"*"}):""]}),y>0&&e.jsxs(a.MaxCharStyle,{children:[null!==(x=null===(h=o.value)||void 0===h?void 0:h.length)&&void 0!==x?x:0,"/",y]})]}))]}))}));o.displayName="Input",exports.Input=o;
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:f,leftIcon:p,rightIcon:j,labelText:g,maxCharLimit:y,isRequired:I,hintText:C,type:b,state:m,validate:w,variant:E,button:S,suffixText:O,prefixText:k,onChangeText:q,value:F,noErrorHint:H,reset:L,rangeValidation:M,noKeyDownChange:T,version:B,noMaxCharCheck:R}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},a),A=null==p?void 0:p.icon,D=null==j?void 0:j.icon,[z,K]=t.useState(!1),[P,W]=t.useState(!1),[_,N]=t.useState(),V="small"===E?"18px":"22px",G=t.useContext(s.InputStyleContext),[J,Q]=t.useState(),U=t.useRef(null),X=null!=u?u:U;t.useEffect((()=>{Q(F)}),[F]),t.useEffect((()=>{var e;X.current&&(null===(e=a.onReferenceInit)||void 0===e||e.call(a,X.current))}),[X]),t.useEffect((()=>{const e=X.current;if(e)return e.addEventListener("wheel",$,{passive:!1}),()=>{e.removeEventListener("wheel",$)}}),[]),t.useEffect((()=>{L&&Q("")}),[L]),t.useEffect((()=>{var e;W(!!a.isActive),a.isActive&&(null===(e=X.current)||void 0===e||e.focus())}),[a.isActive]),t.useEffect((()=>{N(a.errorMessage)}),[a.errorMessage]),t.useEffect((()=>{var e;K(!1),("invalid"===a.state||_)&&K(!0),"active"===a.state&&(null===(e=X.current)||void 0===e||e.focus())}),[a.state,_]),t.useEffect((()=>{K(!!_)}),[_]);const Y=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)}},Z=e=>{const t=y||("zip"===b?6:60);T||q(F||"",e),R||![8].includes(e.which)&&t>0&&e.target.value.length===t&&e.preventDefault()},$=e=>{e.preventDefault()},ee=e=>{const t=e.target.value;q(t,e),a.textControl||Q(t);const n=w||i.validateInput;if(!n||!i.isFunction(n))return;const[r,l]=n(t,b,M);K(!r),N(a.errorMessage?a.errorMessage:l)},te=e=>{var t;a.skipFocus||W(!0),Y(null===(t=a.onFocus)||void 0===t?void 0:t.call(a,e))},ne=e=>{var t;a.skipFocus||W(!1),Y(null===(t=a.onBlur)||void 0===t?void 0:t.call(a,e))},ie=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==b&&e.jsx("input",{id:a.id,style:null!==(t=null==G?void 0:G.input)&&void 0!==t?t:{},ref:X,type:["phonenumber","zip","number"].includes(b)?"number":b,value:J,onFocus:e=>te(e),onBlur:e=>ne(e),placeholder:f||"Enter here",onChange:ee,onKeyDown:e=>Z(e)}),"multiline"===b&&e.jsx("textarea",{value:J,ref:X,onFocus:e=>te(e),onBlur:e=>ne(e),placeholder:f||"Enter here",onChange:ee,onKeyDown:e=>Z(e),maxLength:y>0?y:void 0})]})};return e.jsxs(o.RootContainer,Object.assign({width:a.width,height:a.height,state:m,type:b,style:null!==(c=null==G?void 0:G.RootContainer)&&void 0!==c?c:{}},{children:[!H&&(!!C||!!_)&&e.jsxs(o.InputFooter,Object.assign({invalid:!!_},{children:[!!_&&e.jsx(l.default,{width:16,height:16}),_||C]})),e.jsxs(o.InputWrapper,Object.assign({variant:E,state:m,width:a.width,isActive:"active"===m||P,isInvalid:z,style:null!==(d=null==G?void 0:G.InputWrapper)&&void 0!==d?d:{},version:B},{children:[!!A&&e.jsx(o.IconHolder,Object.assign({variant:E,iconSize:V,onClick:()=>Y(null==p?void 0:p.callback),isLeft:!0,style:null!==(v=null==G?void 0:G.IconHolder)&&void 0!==v?v:{}},{children:e.jsx(A,{})})),!!k&&e.jsx(o.PrefixHolder,Object.assign({variant:E},{children:k})),"default"===E&&e.jsx(o.InputContainer,{children:ie()}),"small"===E&&e.jsx(o.InputContainerSmall,{children:ie()}),!!D&&e.jsx(o.IconHolder,Object.assign({variant:E,iconSize:V,onClick:()=>Y(null==j?void 0:j.callback),isLeft:!1},{children:e.jsx(D,{})})),!!O&&e.jsx(o.SuffixHolder,Object.assign({variant:E},{children:O})),S&&S.text&&e.jsx(n.Button,{buttonText:S.text,onClick:()=>Y(null==S?void 0:S.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;
@@ -31,8 +31,6 @@ export declare const InputContainer: import("@emotion/styled").StyledComponent<{
31
31
  forwardedAs?: string | import("react").ComponentType<any> | undefined;
32
32
  } & {
33
33
  theme?: import("@emotion/react").Theme | undefined;
34
- } & {
35
- height?: string | undefined;
36
34
  }, {}, {}>;
37
35
  export declare const InputContainerSmall: import("@emotion/styled").StyledComponent<{
38
36
  [x: string]: any;
@@ -45,8 +43,6 @@ export declare const InputContainerSmall: import("@emotion/styled").StyledCompon
45
43
  forwardedAs?: string | import("react").ComponentType<any> | undefined;
46
44
  } & {
47
45
  theme?: import("@emotion/react").Theme | undefined;
48
- } & {
49
- height?: string | undefined;
50
46
  }, {}, {}>;
51
47
  export declare const InputHeader: import("@emotion/styled").StyledComponent<{
52
48
  theme?: import("@emotion/react").Theme | undefined;