@bikdotai/bik-component-library 0.0.373 → 0.0.374-beta.10

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.
@@ -7,4 +7,5 @@ export declare const InputWithVariables: (props: {
7
7
  prevVariable: SelectedVariable;
8
8
  showHelp?: boolean | undefined;
9
9
  onlyVariables?: boolean | undefined;
10
+ showSideModal?: boolean | undefined;
10
11
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("../../assets/icons/PlusIcon.js"),l=require("react"),r=require("styled-components"),i=require("uuid"),t=require("../../constants/Theme.js"),s=require("../add-variableV2/AddVariableBox.styled.js"),d=require("../add-variableV2/AddVariableV2.js"),u=require("../input/Input.js"),o=require("../TypographyStyle.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const c=n(r).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("../../assets/icons/PlusIcon.js"),l=require("react"),r=require("styled-components"),i=require("uuid"),d=require("../add-variableV2/AddVariableV2SideModal.js"),t=require("../add-variableV2/AddVariableV2.js"),s=require("../../constants/Theme.js"),u=require("../add-variableV2/AddVariableBox.styled.js"),o=require("../input/Input.js"),n=require("../TypographyStyle.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const v=c(r).default.div`
2
2
  margin-bottom: 32px;
3
3
  input {
4
- color: ${e=>e.isVar?t.COLORS.stroke.brand:"black"};
4
+ color: ${e=>e.isVar?s.COLORS.stroke.brand:"black"};
5
5
  }
6
- `;exports.InputWithVariables=r=>{const t=l.useRef(null),[n,v]=l.useState(!1),[b]=l.useState(i.v4()),[p,V]=l.useState(),[g,h]=l.useState(r.prevVariable),[j,x]=l.useState(!1),[y,T]=l.useState(!1);return l.useEffect((()=>{p&&p.actualValue&&(r.allowMix?h((e=>({actualValue:e.actualValue+p.actualValue,variableType:"string"}))):h((e=>({actualValue:p.actualValue,variableType:p.variableType,needsFetching:p.needsFetching}))))}),[p]),l.useEffect((()=>{r.onChange(g)}),[g]),e.jsxs(c,Object.assign({isVar:/^{{.*}}$/.test(g.actualValue)},{children:[e.jsx(u.Input,{id:b,ref:t,skipFocus:!0,textControl:!0,isActive:n,value:g.actualValue,validate:e=>[!0,""],errorMessage:"",placeholder:"Add a value",onChangeText:function(e,a){if(r.onlyVariables){const e=(null==a?void 0:a.keyCode)||(null==a?void 0:a.charCode);8!=e&&46!=e||h({actualValue:"",variableType:"string"})}else r.allowMix?h({actualValue:e,variableType:"string"}):h({actualValue:e.replace(/{{.*}}/,""),variableType:"string"})},onReferenceInit:()=>{},onFocus:e=>{var a;v(!0),T(!0),"Search..."!==(null===(a=e.relatedTarget)||void 0===a?void 0:a.placeholder)||j||x(!0)},onBlur:e=>{var a,l,r,i,s,d,u;"addVar"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||"varList"===(null===(l=e.relatedTarget)||void 0===l?void 0:l.id)||(null===(i=null===(r=e.relatedTarget)||void 0===r?void 0:r.className)||void 0===i?void 0:i.includes("exlualr0"))||(null===(d=null===(s=e.relatedTarget)||void 0===s?void 0:s.className)||void 0===d?void 0:d.includes("sc-dZoequ "))?(t.current&&t.current.focus(),v(!0)):"Search..."===(null===(u=e.relatedTarget)||void 0===u?void 0:u.placeholder)?v(!0):(v(!1),x(!1),T(!1))}}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[g.actualValue&&r.showHelp?e.jsx("div",Object.assign({style:{marginTop:4}},{children:e.jsx(o.BodyCaption,{children:`This value is of type ${g.variableType}`})})):e.jsx("div",{}),y&&e.jsx(s.AddVariableStyled,Object.assign({right:r.addVarBoxRight,id:"addVar",onClick:()=>{x(!j)}},{children:e.jsxs("div",Object.assign({className:"add"},{children:[e.jsx(a.default,{color:"white"}),e.jsx("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))]})),j&&e.jsx(d.AddVariableV2,{data:r.variablesList,showVariable:!0,setShowVariable:()=>{x(!1)},variableValue:p,setVariableValue:V,placeholder:"",pickerSize:"large",enableVariable:!0,selectWithTypes:!0,onSearchBlur:e=>{var a,l,r,i,s,d;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(s=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===s?void 0:s.includes("sc-dZoequ "))?t.current.focus():"Enter here"===(null===(d=e.relatedTarget)||void 0===d?void 0:d.placeholder)?e.relatedTarget.id!==b&&(x(!1),T(!1),v(!1)):(x(!1),T(!1),v(!1))}})]}))};
6
+ `;exports.InputWithVariables=r=>{var s;const c=l.useRef(null),[b,V]=l.useState(!1),[g]=l.useState(i.v4()),[h,p]=l.useState(),[T,j]=l.useState(r.prevVariable),[x,y]=l.useState(!1),[f,S]=l.useState(!1);return l.useEffect((()=>{h&&h.actualValue&&(r.allowMix?j((e=>({actualValue:e.actualValue+h.actualValue,variableType:"string"}))):j((e=>({actualValue:h.actualValue,variableType:h.variableType,needsFetching:h.needsFetching}))))}),[h]),l.useEffect((()=>{r.onChange(T)}),[T]),e.jsxs(v,Object.assign({isVar:/^{{.*}}$/.test(T.actualValue)},{children:[e.jsx(o.Input,{id:g,ref:c,skipFocus:!0,textControl:!0,isActive:b,value:T.actualValue,validate:e=>[!0,""],errorMessage:"",placeholder:"Add a value",onChangeText:function(e,a){if(r.onlyVariables){const e=(null==a?void 0:a.keyCode)||(null==a?void 0:a.charCode);8!=e&&46!=e||j({actualValue:"",variableType:"string"})}else r.allowMix?j({actualValue:e,variableType:"string"}):j({actualValue:e.replace(/{{.*}}/,""),variableType:"string"})},onReferenceInit:()=>{},onFocus:e=>{var a;V(!0),S(!0),"Search..."!==(null===(a=e.relatedTarget)||void 0===a?void 0:a.placeholder)||x||y(!0)},onBlur:e=>{var a,l,r,i,d,t,s;"addVar"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||"varList"===(null===(l=e.relatedTarget)||void 0===l?void 0:l.id)||(null===(i=null===(r=e.relatedTarget)||void 0===r?void 0:r.className)||void 0===i?void 0:i.includes("exlualr0"))||(null===(t=null===(d=e.relatedTarget)||void 0===d?void 0:d.className)||void 0===t?void 0:t.includes("sc-dZoequ "))?(c.current&&c.current.focus(),V(!0)):"Search..."===(null===(s=e.relatedTarget)||void 0===s?void 0:s.placeholder)?V(!0):(V(!1),y(!1),S(!1))}}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[T.actualValue&&r.showHelp?e.jsx("div",Object.assign({style:{marginTop:4}},{children:e.jsx(n.BodyCaption,{children:`This value is of type ${T.variableType}`})})):e.jsx("div",{}),f&&e.jsx(u.AddVariableStyled,Object.assign({right:r.addVarBoxRight,id:"addVar",onClick:()=>{y(!x)}},{children:e.jsxs("div",Object.assign({className:"add"},{children:[e.jsx(a.default,{color:"white"}),e.jsx("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))]})),x&&!r.showSideModal&&e.jsx(t.AddVariableV2,{data:r.variablesList,showVariable:!0,setShowVariable:()=>{y(!1)},variableValue:h,setVariableValue:p,placeholder:"",pickerSize:"large",enableVariable:!0,selectWithTypes:!0,onSearchBlur:e=>{var a,l,r,i,d,t;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(d=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===d?void 0:d.includes("sc-dZoequ "))?c.current.focus():"Enter here"===(null===(t=e.relatedTarget)||void 0===t?void 0:t.placeholder)?e.relatedTarget.id!==g&&(y(!1),S(!1),V(!1)):(y(!1),S(!1),V(!1))}}),x&&r.showSideModal&&e.jsx(d.AddVariableV2SideModal,{zIndex:2e3,data:null!==(s=r.variablesList)&&void 0!==s?s:[],showVariable:x,setShowVariable:()=>{y(!1)},placeholder:"Add a variable",customTrigger:e=>{p({actualValue:e.actualValue,variableType:"string"})},onSearchBlur:e=>{var a,l,r,i,d,t;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(d=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===d?void 0:d.includes("sc-dZoequ "))?c.current.focus():"Enter here"===(null===(t=e.relatedTarget)||void 0===t?void 0:t.placeholder)?e.relatedTarget.id!==g&&(y(!1),S(!1),V(!1)):(y(!1),S(!1),V(!1))}})]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/check.svg.js"),t=require("../../assets/icons/checkCircle.svg.js"),i=require("../../assets/icons/quotes.svg.js"),a=require("../../assets/icons/WhiteStarFilled.svg.js"),n=require("../button/Button.js"),r=require("./SubscriptionPlanStyled.js"),o=require("../TypographyStyle.js"),l=require("../../hooks/useCurreny.js"),c=require("../../constants/Theme.js"),d=require("../tag/Tag.js");exports.NewSubscriptionPlan=h=>{var u;const{formatCurrency:j}=l.useCurrency(),p=h.showMonthlyOptions?h.features:h.annualFeatures||[],g=h.showMonthlyOptions?h.monthlyPlan:h.yearlyPlan,m=!h.isDisabled&&h.isMostPopular,x=h.showMonthlyOptions?h.code:null!==(u=h.yearlyCode)&&void 0!==u?u:h.code,{planName:y,isSelected:b=!1,isDisabled:O=!1,onPlanSelect:C,oldPrice:S,hideMonthYearTag:v,planDescription:T,planDescriptionDiscount:N,showTrialOptions:f,freeTrialMessages:L,extraBlockMessage:P,isLoading:w,buttonText:k,bottomDescription:M,showMonthlyOptions:B,popularTestimony:q,skipRadioSelection:R=!1,includeText:D,height:F,showFeaturesButton:$,businessDescription:_,isPlanSelected:z=!1,onClickShowAllFeatures:W,showSelectedPlanChip:H=!1,perMonthForYearly:I=!1}=h,U=e=>I&&!B?0==e?"$0":j(e/12,"USD"):0==e?"$0":j(e,"USD");return e.jsxs(r.NewSubscriptionStyled,Object.assign({height:F,showMostPopularChip:m||!1,onClick:()=>C(x)},{children:[m&&e.jsxs("div",Object.assign({className:"most-popular-chip"},{children:[e.jsx(o.Caption,Object.assign({className:"popular-text"},{children:"Most popular "})),e.jsx(a.default,{height:12,width:12})]})),e.jsxs("div",Object.assign({className:`box ${O?"disabled":""} \n\t\t\t\t`},{children:[e.jsxs("div",Object.assign({className:"radio-flex"},{children:[!R&&e.jsx("input",{type:"radio",id:"html",name:"fav_language",value:"HTML",disabled:null!=O&&O,onChange:()=>C(x),className:"radio-button",checked:z}),e.jsx(o.TitleRegular,Object.assign({style:{color:c.COLORS.content.secondary,marginBottom:4}},{children:y})),H&&e.jsx("div",Object.assign({style:{marginLeft:"auto"}},{children:e.jsx(d.Tag,{tagText:"Current plan",type:"positive",theme:"dark"})}))]})),e.jsxs("div",Object.assign({className:"price-block"},{children:[S?e.jsx(o.BodyCaption,Object.assign({className:"old--price"},{children:U(g.price)})):e.jsx(e.Fragment,{}),e.jsx(o.TitleLarge,Object.assign({style:{color:c.COLORS.content.primary}},{children:U(S||g.price)})),e.jsx(o.Caption,Object.assign({style:{color:c.COLORS.content.secondary,marginLeft:4}},{children:v?"":"/ "+(B?"month":I?"month billed annually":"year")}))]})),T&&e.jsxs("div",Object.assign({className:"per-message-price"},{children:[e.jsx(o.BodyCaption,Object.assign({style:{color:c.COLORS.content.secondary}},{children:T})),N&&e.jsx(o.BodyCaption,Object.assign({style:{color:c.COLORS.background.positive.vibrant,marginLeft:4}},{children:N}))]})),_&&_.length&&e.jsx("div",Object.assign({style:{marginTop:4}},{children:_.map(((s,t)=>e.jsx(o.BodySecondary,{style:{color:c.COLORS.content.secondary},dangerouslySetInnerHTML:{__html:s}},t)))})),f&&e.jsxs(o.Caption,Object.assign({className:"trial "+(b?"selected":"")},{children:["7 day free trial with ",L," messages"]})),P&&e.jsx(o.Caption,Object.assign({className:"trial "+(b?"selected":"")},{children:P})),e.jsx(o.TitleSmall,Object.assign({className:"extra-include-margin",style:{height:D?"":"20px"}},{children:D||""})),e.jsx("div",Object.assign({className:"features"},{children:p.map(((s,i)=>e.jsxs("div",Object.assign({className:"feature"},{children:[e.jsx("div",{children:e.jsx(t.default,{height:20,width:20,color:c.COLORS.content.primary})}),e.jsx(o.BodySecondary,Object.assign({className:"feature-text"},{children:s.detail}),i)]}),s.detail)))})),$&&e.jsx(n.Button,{isLoading:!1,buttonType:"tertiary",buttonText:"See all features",size:"small",onClick:e=>{e.stopPropagation(),W&&W()}}),R&&e.jsx("div",Object.assign({className:"button-box"},{children:w?e.jsx(n.Button,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e.jsxs(e.Fragment,{children:[b&&e.jsx(n.Button,{disabled:O,LeadingIcon:s.default,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:k||"Selected Plan"}),!b&&!O&&e.jsx(n.Button,{buttonType:"primary",size:"medium",onClick:e=>{e.stopPropagation(),C(x)},matchParentWidth:!0,buttonText:k||"Choose plan"})]})})),q&&e.jsxs("div",Object.assign({className:"popular-testimony"},{children:[e.jsx(i.default,{height:26,width:70}),e.jsx("div",Object.assign({className:"testimony-text"},{children:e.jsx("i",{children:q})}))]}))]})),M&&e.jsx("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${O?"disabled":""}\n\t\t\t\t\t${b?"selected":""}\n\t\t\t\t`},{children:e.jsx(o.Caption,Object.assign({className:"text",style:{color:c.COLORS.background.inverse}},{children:M}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/check.svg.js"),t=require("../../assets/icons/checkCircle.svg.js"),i=require("../../assets/icons/quotes.svg.js"),a=require("../../assets/icons/WhiteStarFilled.svg.js"),n=require("../button/Button.js"),r=require("./SubscriptionPlanStyled.js"),o=require("../TypographyStyle.js"),l=require("../../hooks/useCurreny.js"),c=require("../../constants/Theme.js"),d=require("../tag/Tag.js");exports.NewSubscriptionPlan=h=>{var u;const{formatCurrency:j}=l.useCurrency(),p=h.showMonthlyOptions?h.features:h.annualFeatures||[],g=h.showMonthlyOptions?h.monthlyPlan:h.yearlyPlan,m=!h.isDisabled&&h.isMostPopular,x=h.showMonthlyOptions?h.code:null!==(u=h.yearlyCode)&&void 0!==u?u:h.code,{planName:y,isSelected:b=!1,isDisabled:O=!1,onPlanSelect:C,oldPrice:S,hideMonthYearTag:v,planDescription:T,planDescriptionDiscount:N,showTrialOptions:f,freeTrialMessages:L,extraBlockMessage:P,isLoading:w,buttonText:M,bottomDescription:k,showMonthlyOptions:B,popularTestimony:q,skipRadioSelection:R=!1,includeText:D,height:F,showFeaturesButton:$,businessDescription:_,isPlanSelected:z=!1,onClickShowAllFeatures:W,showSelectedPlanChip:H=!1,perMonthForYearly:I=!1}=h,U=e=>I&&!B?0==e?"$0":j(Math.round(e/12),"USD"):0==e?"$0":j(e,"USD");return e.jsxs(r.NewSubscriptionStyled,Object.assign({height:F,showMostPopularChip:m||!1,onClick:()=>C(x)},{children:[m&&e.jsxs("div",Object.assign({className:"most-popular-chip"},{children:[e.jsx(o.Caption,Object.assign({className:"popular-text"},{children:"Most popular "})),e.jsx(a.default,{height:12,width:12})]})),e.jsxs("div",Object.assign({className:`box ${O?"disabled":""} \n\t\t\t\t`},{children:[e.jsxs("div",Object.assign({className:"radio-flex"},{children:[!R&&e.jsx("input",{type:"radio",id:"html",name:"fav_language",value:"HTML",disabled:null!=O&&O,onChange:()=>C(x),className:"radio-button",checked:z}),e.jsx(o.TitleRegular,Object.assign({style:{color:c.COLORS.content.secondary,marginBottom:4}},{children:y})),H&&e.jsx("div",Object.assign({style:{marginLeft:"auto"}},{children:e.jsx(d.Tag,{tagText:"Current plan",type:"positive",theme:"dark"})}))]})),e.jsxs("div",Object.assign({className:"price-block"},{children:[S?e.jsx(o.BodyCaption,Object.assign({className:"old--price"},{children:U(g.price)})):e.jsx(e.Fragment,{}),e.jsx(o.TitleLarge,Object.assign({style:{color:c.COLORS.content.primary}},{children:U(S||g.price)})),e.jsx(o.Caption,Object.assign({style:{color:c.COLORS.content.secondary,marginLeft:4}},{children:v?"":"/ "+(B?"month":I?"month billed annually":"year")}))]})),T&&e.jsxs("div",Object.assign({className:"per-message-price"},{children:[e.jsx(o.BodyCaption,Object.assign({style:{color:c.COLORS.content.secondary}},{children:T})),N&&e.jsx(o.BodyCaption,Object.assign({style:{color:c.COLORS.background.positive.vibrant,marginLeft:4}},{children:N}))]})),_&&_.length&&e.jsx("div",Object.assign({style:{marginTop:4}},{children:_.map(((s,t)=>e.jsx(o.BodySecondary,{style:{color:c.COLORS.content.secondary},dangerouslySetInnerHTML:{__html:s}},t)))})),f&&e.jsxs(o.Caption,Object.assign({className:"trial "+(b?"selected":"")},{children:["7 day free trial with ",L," messages"]})),P&&e.jsx(o.Caption,Object.assign({className:"trial "+(b?"selected":"")},{children:P})),e.jsx(o.TitleSmall,Object.assign({className:"extra-include-margin",style:{height:D?"":"20px"}},{children:D||""})),e.jsx("div",Object.assign({className:"features"},{children:p.map(((s,i)=>e.jsxs("div",Object.assign({className:"feature"},{children:[e.jsx("div",{children:e.jsx(t.default,{height:20,width:20,color:c.COLORS.content.primary})}),e.jsx(o.BodySecondary,Object.assign({className:"feature-text"},{children:s.detail}),i)]}),s.detail)))})),$&&e.jsx(n.Button,{isLoading:!1,buttonType:"tertiary",buttonText:"See all features",size:"small",onClick:e=>{e.stopPropagation(),W&&W()}}),R&&e.jsx("div",Object.assign({className:"button-box"},{children:w?e.jsx(n.Button,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e.jsxs(e.Fragment,{children:[b&&e.jsx(n.Button,{disabled:O,LeadingIcon:s.default,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:M||"Selected Plan"}),!b&&!O&&e.jsx(n.Button,{buttonType:"primary",size:"medium",onClick:e=>{e.stopPropagation(),C(x)},matchParentWidth:!0,buttonText:M||"Choose plan"})]})})),q&&e.jsxs("div",Object.assign({className:"popular-testimony"},{children:[e.jsx(i.default,{height:26,width:70}),e.jsx("div",Object.assign({className:"testimony-text"},{children:e.jsx("i",{children:q})}))]}))]})),k&&e.jsx("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${O?"disabled":""}\n\t\t\t\t\t${b?"selected":""}\n\t\t\t\t`},{children:e.jsx(o.Caption,Object.assign({className:"text",style:{color:c.COLORS.background.inverse}},{children:k}))}))]}))};
@@ -7,4 +7,5 @@ export declare const InputWithVariables: (props: {
7
7
  prevVariable: SelectedVariable;
8
8
  showHelp?: boolean | undefined;
9
9
  onlyVariables?: boolean | undefined;
10
+ showSideModal?: boolean | undefined;
10
11
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
- import{jsxs as e,jsx as a}from"react/jsx-runtime";import l from"../../assets/icons/PlusIcon.js";import{useRef as r,useState as i,useEffect as t}from"react";import o from"styled-components";import{v4 as d}from"uuid";import{COLORS as s}from"../../constants/Theme.js";import{AddVariableStyled as n}from"../add-variableV2/AddVariableBox.styled.js";import{AddVariableV2 as c}from"../add-variableV2/AddVariableV2.js";import{Input as u}from"../input/Input.js";import{BodyCaption as v}from"../TypographyStyle.js";const p=o=>{const s=r(null),[p,g]=i(!1),[m]=i(d()),[h,V]=i(),[T,f]=i(o.prevVariable),[y,j]=i(!1),[x,w]=i(!1);return t((()=>{h&&h.actualValue&&(o.allowMix?f((e=>({actualValue:e.actualValue+h.actualValue,variableType:"string"}))):f((e=>({actualValue:h.actualValue,variableType:h.variableType,needsFetching:h.needsFetching}))))}),[h]),t((()=>{o.onChange(T)}),[T]),e(b,Object.assign({isVar:/^{{.*}}$/.test(T.actualValue)},{children:[a(u,{id:m,ref:s,skipFocus:!0,textControl:!0,isActive:p,value:T.actualValue,validate:e=>[!0,""],errorMessage:"",placeholder:"Add a value",onChangeText:function(e,a){if(o.onlyVariables){const e=(null==a?void 0:a.keyCode)||(null==a?void 0:a.charCode);8!=e&&46!=e||f({actualValue:"",variableType:"string"})}else o.allowMix?f({actualValue:e,variableType:"string"}):f({actualValue:e.replace(/{{.*}}/,""),variableType:"string"})},onReferenceInit:()=>{},onFocus:e=>{var a;g(!0),w(!0),"Search..."!==(null===(a=e.relatedTarget)||void 0===a?void 0:a.placeholder)||y||j(!0)},onBlur:e=>{var a,l,r,i,t,o,d;"addVar"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||"varList"===(null===(l=e.relatedTarget)||void 0===l?void 0:l.id)||(null===(i=null===(r=e.relatedTarget)||void 0===r?void 0:r.className)||void 0===i?void 0:i.includes("exlualr0"))||(null===(o=null===(t=e.relatedTarget)||void 0===t?void 0:t.className)||void 0===o?void 0:o.includes("sc-dZoequ "))?(s.current&&s.current.focus(),g(!0)):"Search..."===(null===(d=e.relatedTarget)||void 0===d?void 0:d.placeholder)?g(!0):(g(!1),j(!1),w(!1))}}),e("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[T.actualValue&&o.showHelp?a("div",Object.assign({style:{marginTop:4}},{children:a(v,{children:`This value is of type ${T.variableType}`})})):a("div",{}),x&&a(n,Object.assign({right:o.addVarBoxRight,id:"addVar",onClick:()=>{j(!y)}},{children:e("div",Object.assign({className:"add"},{children:[a(l,{color:"white"}),a("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))]})),y&&a(c,{data:o.variablesList,showVariable:!0,setShowVariable:()=>{j(!1)},variableValue:h,setVariableValue:V,placeholder:"",pickerSize:"large",enableVariable:!0,selectWithTypes:!0,onSearchBlur:e=>{var a,l,r,i,t,o;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(t=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===t?void 0:t.includes("sc-dZoequ "))?s.current.focus():"Enter here"===(null===(o=e.relatedTarget)||void 0===o?void 0:o.placeholder)?e.relatedTarget.id!==m&&(j(!1),w(!1),g(!1)):(j(!1),w(!1),g(!1))}})]}))},b=o.div`
1
+ import{jsxs as e,jsx as a}from"react/jsx-runtime";import l from"../../assets/icons/PlusIcon.js";import{useRef as r,useState as i,useEffect as d}from"react";import o from"styled-components";import{v4 as t}from"uuid";import{AddVariableV2SideModal as s}from"../add-variableV2/AddVariableV2SideModal.js";import{AddVariableV2 as n}from"../add-variableV2/AddVariableV2.js";import{COLORS as u}from"../../constants/Theme.js";import{AddVariableStyled as c}from"../add-variableV2/AddVariableBox.styled.js";import{Input as v}from"../input/Input.js";import{BodyCaption as p}from"../TypographyStyle.js";const g=o=>{var u;const g=r(null),[h,m]=i(!1),[V]=i(t()),[T,f]=i(),[y,j]=i(o.prevVariable),[x,w]=i(!1),[S,N]=i(!1);return d((()=>{T&&T.actualValue&&(o.allowMix?j((e=>({actualValue:e.actualValue+T.actualValue,variableType:"string"}))):j((e=>({actualValue:T.actualValue,variableType:T.variableType,needsFetching:T.needsFetching}))))}),[T]),d((()=>{o.onChange(y)}),[y]),e(b,Object.assign({isVar:/^{{.*}}$/.test(y.actualValue)},{children:[a(v,{id:V,ref:g,skipFocus:!0,textControl:!0,isActive:h,value:y.actualValue,validate:e=>[!0,""],errorMessage:"",placeholder:"Add a value",onChangeText:function(e,a){if(o.onlyVariables){const e=(null==a?void 0:a.keyCode)||(null==a?void 0:a.charCode);8!=e&&46!=e||j({actualValue:"",variableType:"string"})}else o.allowMix?j({actualValue:e,variableType:"string"}):j({actualValue:e.replace(/{{.*}}/,""),variableType:"string"})},onReferenceInit:()=>{},onFocus:e=>{var a;m(!0),N(!0),"Search..."!==(null===(a=e.relatedTarget)||void 0===a?void 0:a.placeholder)||x||w(!0)},onBlur:e=>{var a,l,r,i,d,o,t;"addVar"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||"varList"===(null===(l=e.relatedTarget)||void 0===l?void 0:l.id)||(null===(i=null===(r=e.relatedTarget)||void 0===r?void 0:r.className)||void 0===i?void 0:i.includes("exlualr0"))||(null===(o=null===(d=e.relatedTarget)||void 0===d?void 0:d.className)||void 0===o?void 0:o.includes("sc-dZoequ "))?(g.current&&g.current.focus(),m(!0)):"Search..."===(null===(t=e.relatedTarget)||void 0===t?void 0:t.placeholder)?m(!0):(m(!1),w(!1),N(!1))}}),e("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[y.actualValue&&o.showHelp?a("div",Object.assign({style:{marginTop:4}},{children:a(p,{children:`This value is of type ${y.variableType}`})})):a("div",{}),S&&a(c,Object.assign({right:o.addVarBoxRight,id:"addVar",onClick:()=>{w(!x)}},{children:e("div",Object.assign({className:"add"},{children:[a(l,{color:"white"}),a("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))]})),x&&!o.showSideModal&&a(n,{data:o.variablesList,showVariable:!0,setShowVariable:()=>{w(!1)},variableValue:T,setVariableValue:f,placeholder:"",pickerSize:"large",enableVariable:!0,selectWithTypes:!0,onSearchBlur:e=>{var a,l,r,i,d,o;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(d=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===d?void 0:d.includes("sc-dZoequ "))?g.current.focus():"Enter here"===(null===(o=e.relatedTarget)||void 0===o?void 0:o.placeholder)?e.relatedTarget.id!==V&&(w(!1),N(!1),m(!1)):(w(!1),N(!1),m(!1))}}),x&&o.showSideModal&&a(s,{zIndex:2e3,data:null!==(u=o.variablesList)&&void 0!==u?u:[],showVariable:x,setShowVariable:()=>{w(!1)},placeholder:"Add a variable",customTrigger:e=>{f({actualValue:e.actualValue,variableType:"string"})},onSearchBlur:e=>{var a,l,r,i,d,o;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(d=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===d?void 0:d.includes("sc-dZoequ "))?g.current.focus():"Enter here"===(null===(o=e.relatedTarget)||void 0===o?void 0:o.placeholder)?e.relatedTarget.id!==V&&(w(!1),N(!1),m(!1)):(w(!1),N(!1),m(!1))}})]}))},b=o.div`
2
2
  margin-bottom: 32px;
3
3
  input {
4
- color: ${e=>e.isVar?s.stroke.brand:"black"};
4
+ color: ${e=>e.isVar?u.stroke.brand:"black"};
5
5
  }
6
- `;export{p as InputWithVariables};
6
+ `;export{g as InputWithVariables};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import a from"../../assets/icons/checkCircle.svg.js";import n from"../../assets/icons/quotes.svg.js";import o from"../../assets/icons/WhiteStarFilled.svg.js";import{Button as r}from"../button/Button.js";import{NewSubscriptionStyled as l}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as d,BodyCaption as h,TitleLarge as m,BodySecondary as p,TitleSmall as g}from"../TypographyStyle.js";import{useCurrency as b}from"../../hooks/useCurreny.js";import{COLORS as u}from"../../constants/Theme.js";import{Tag as y}from"../tag/Tag.js";const j=j=>{var O;const{formatCurrency:v}=b(),f=j.showMonthlyOptions?j.features:j.annualFeatures||[],T=j.showMonthlyOptions?j.monthlyPlan:j.yearlyPlan,N=!j.isDisabled&&j.isMostPopular,x=j.showMonthlyOptions?j.code:null!==(O=j.yearlyCode)&&void 0!==O?O:j.code,{planName:P,isSelected:S=!1,isDisabled:k=!1,onPlanSelect:C,oldPrice:w,hideMonthYearTag:M,planDescription:D,planDescriptionDiscount:L,showTrialOptions:F,freeTrialMessages:$,extraBlockMessage:z,isLoading:B,buttonText:W,bottomDescription:_,showMonthlyOptions:H,popularTestimony:I,skipRadioSelection:U=!1,includeText:Y,height:q,showFeaturesButton:A,businessDescription:R,isPlanSelected:E=!1,onClickShowAllFeatures:G,showSelectedPlanChip:J=!1,perMonthForYearly:K=!1}=j,Q=e=>K&&!H?0==e?"$0":v(e/12,"USD"):0==e?"$0":v(e,"USD");return e(l,Object.assign({height:q,showMostPopularChip:N||!1,onClick:()=>C(x)},{children:[N&&e("div",Object.assign({className:"most-popular-chip"},{children:[t(c,Object.assign({className:"popular-text"},{children:"Most popular "})),t(o,{height:12,width:12})]})),e("div",Object.assign({className:`box ${k?"disabled":""} \n\t\t\t\t`},{children:[e("div",Object.assign({className:"radio-flex"},{children:[!U&&t("input",{type:"radio",id:"html",name:"fav_language",value:"HTML",disabled:null!=k&&k,onChange:()=>C(x),className:"radio-button",checked:E}),t(d,Object.assign({style:{color:u.content.secondary,marginBottom:4}},{children:P})),J&&t("div",Object.assign({style:{marginLeft:"auto"}},{children:t(y,{tagText:"Current plan",type:"positive",theme:"dark"})}))]})),e("div",Object.assign({className:"price-block"},{children:[w?t(h,Object.assign({className:"old--price"},{children:Q(T.price)})):t(s,{}),t(m,Object.assign({style:{color:u.content.primary}},{children:Q(w||T.price)})),t(c,Object.assign({style:{color:u.content.secondary,marginLeft:4}},{children:M?"":"/ "+(H?"month":K?"month billed annually":"year")}))]})),D&&e("div",Object.assign({className:"per-message-price"},{children:[t(h,Object.assign({style:{color:u.content.secondary}},{children:D})),L&&t(h,Object.assign({style:{color:u.background.positive.vibrant,marginLeft:4}},{children:L}))]})),R&&R.length&&t("div",Object.assign({style:{marginTop:4}},{children:R.map(((e,s)=>t(p,{style:{color:u.content.secondary},dangerouslySetInnerHTML:{__html:e}},s)))})),F&&e(c,Object.assign({className:"trial "+(S?"selected":"")},{children:["7 day free trial with ",$," messages"]})),z&&t(c,Object.assign({className:"trial "+(S?"selected":"")},{children:z})),t(g,Object.assign({className:"extra-include-margin",style:{height:Y?"":"20px"}},{children:Y||""})),t("div",Object.assign({className:"features"},{children:f.map(((s,i)=>e("div",Object.assign({className:"feature"},{children:[t("div",{children:t(a,{height:20,width:20,color:u.content.primary})}),t(p,Object.assign({className:"feature-text"},{children:s.detail}),i)]}),s.detail)))})),A&&t(r,{isLoading:!1,buttonType:"tertiary",buttonText:"See all features",size:"small",onClick:e=>{e.stopPropagation(),G&&G()}}),U&&t("div",Object.assign({className:"button-box"},{children:B?t(r,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e(s,{children:[S&&t(r,{disabled:k,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:W||"Selected Plan"}),!S&&!k&&t(r,{buttonType:"primary",size:"medium",onClick:e=>{e.stopPropagation(),C(x)},matchParentWidth:!0,buttonText:W||"Choose plan"})]})})),I&&e("div",Object.assign({className:"popular-testimony"},{children:[t(n,{height:26,width:70}),t("div",Object.assign({className:"testimony-text"},{children:t("i",{children:I})}))]}))]})),_&&t("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${k?"disabled":""}\n\t\t\t\t\t${S?"selected":""}\n\t\t\t\t`},{children:t(c,Object.assign({className:"text",style:{color:u.background.inverse}},{children:_}))}))]}))};export{j as NewSubscriptionPlan};
1
+ import{jsxs as e,jsx as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import a from"../../assets/icons/checkCircle.svg.js";import n from"../../assets/icons/quotes.svg.js";import o from"../../assets/icons/WhiteStarFilled.svg.js";import{Button as r}from"../button/Button.js";import{NewSubscriptionStyled as l}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as d,BodyCaption as h,TitleLarge as m,BodySecondary as p,TitleSmall as g}from"../TypographyStyle.js";import{useCurrency as u}from"../../hooks/useCurreny.js";import{COLORS as b}from"../../constants/Theme.js";import{Tag as y}from"../tag/Tag.js";const j=j=>{var O;const{formatCurrency:v}=u(),f=j.showMonthlyOptions?j.features:j.annualFeatures||[],T=j.showMonthlyOptions?j.monthlyPlan:j.yearlyPlan,N=!j.isDisabled&&j.isMostPopular,x=j.showMonthlyOptions?j.code:null!==(O=j.yearlyCode)&&void 0!==O?O:j.code,{planName:P,isSelected:S=!1,isDisabled:k=!1,onPlanSelect:C,oldPrice:M,hideMonthYearTag:w,planDescription:D,planDescriptionDiscount:L,showTrialOptions:F,freeTrialMessages:$,extraBlockMessage:z,isLoading:B,buttonText:W,bottomDescription:_,showMonthlyOptions:H,popularTestimony:I,skipRadioSelection:U=!1,includeText:Y,height:q,showFeaturesButton:A,businessDescription:R,isPlanSelected:E=!1,onClickShowAllFeatures:G,showSelectedPlanChip:J=!1,perMonthForYearly:K=!1}=j,Q=e=>K&&!H?0==e?"$0":v(Math.round(e/12),"USD"):0==e?"$0":v(e,"USD");return e(l,Object.assign({height:q,showMostPopularChip:N||!1,onClick:()=>C(x)},{children:[N&&e("div",Object.assign({className:"most-popular-chip"},{children:[t(c,Object.assign({className:"popular-text"},{children:"Most popular "})),t(o,{height:12,width:12})]})),e("div",Object.assign({className:`box ${k?"disabled":""} \n\t\t\t\t`},{children:[e("div",Object.assign({className:"radio-flex"},{children:[!U&&t("input",{type:"radio",id:"html",name:"fav_language",value:"HTML",disabled:null!=k&&k,onChange:()=>C(x),className:"radio-button",checked:E}),t(d,Object.assign({style:{color:b.content.secondary,marginBottom:4}},{children:P})),J&&t("div",Object.assign({style:{marginLeft:"auto"}},{children:t(y,{tagText:"Current plan",type:"positive",theme:"dark"})}))]})),e("div",Object.assign({className:"price-block"},{children:[M?t(h,Object.assign({className:"old--price"},{children:Q(T.price)})):t(s,{}),t(m,Object.assign({style:{color:b.content.primary}},{children:Q(M||T.price)})),t(c,Object.assign({style:{color:b.content.secondary,marginLeft:4}},{children:w?"":"/ "+(H?"month":K?"month billed annually":"year")}))]})),D&&e("div",Object.assign({className:"per-message-price"},{children:[t(h,Object.assign({style:{color:b.content.secondary}},{children:D})),L&&t(h,Object.assign({style:{color:b.background.positive.vibrant,marginLeft:4}},{children:L}))]})),R&&R.length&&t("div",Object.assign({style:{marginTop:4}},{children:R.map(((e,s)=>t(p,{style:{color:b.content.secondary},dangerouslySetInnerHTML:{__html:e}},s)))})),F&&e(c,Object.assign({className:"trial "+(S?"selected":"")},{children:["7 day free trial with ",$," messages"]})),z&&t(c,Object.assign({className:"trial "+(S?"selected":"")},{children:z})),t(g,Object.assign({className:"extra-include-margin",style:{height:Y?"":"20px"}},{children:Y||""})),t("div",Object.assign({className:"features"},{children:f.map(((s,i)=>e("div",Object.assign({className:"feature"},{children:[t("div",{children:t(a,{height:20,width:20,color:b.content.primary})}),t(p,Object.assign({className:"feature-text"},{children:s.detail}),i)]}),s.detail)))})),A&&t(r,{isLoading:!1,buttonType:"tertiary",buttonText:"See all features",size:"small",onClick:e=>{e.stopPropagation(),G&&G()}}),U&&t("div",Object.assign({className:"button-box"},{children:B?t(r,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e(s,{children:[S&&t(r,{disabled:k,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:W||"Selected Plan"}),!S&&!k&&t(r,{buttonType:"primary",size:"medium",onClick:e=>{e.stopPropagation(),C(x)},matchParentWidth:!0,buttonText:W||"Choose plan"})]})})),I&&e("div",Object.assign({className:"popular-testimony"},{children:[t(n,{height:26,width:70}),t("div",Object.assign({className:"testimony-text"},{children:t("i",{children:I})}))]}))]})),_&&t("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${k?"disabled":""}\n\t\t\t\t\t${S?"selected":""}\n\t\t\t\t`},{children:t(c,Object.assign({className:"text",style:{color:b.background.inverse}},{children:_}))}))]}))};export{j as NewSubscriptionPlan};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.373",
3
+ "version": "0.0.374-beta.10",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",