@bikdotai/bik-component-library 0.0.385 → 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.
- package/dist/cjs/components/accordion/Accordion.d.ts +0 -2
- package/dist/cjs/components/accordion/Accordion.js +1 -1
- package/dist/cjs/components/accordion/Accordion.style.d.ts +0 -1
- package/dist/cjs/components/accordion/Accordion.style.js +1 -1
- package/dist/cjs/components/add-variableV2/AddVariableV2.js +1 -1
- package/dist/cjs/components/add-variableV2/AddVariableV2.styled.js +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +3 -3
- package/dist/cjs/constants/Theme.d.ts +0 -19
- package/dist/cjs/constants/Theme.js +1 -1
- package/dist/esm/components/accordion/Accordion.d.ts +0 -2
- package/dist/esm/components/accordion/Accordion.js +1 -1
- package/dist/esm/components/accordion/Accordion.style.d.ts +0 -1
- package/dist/esm/components/accordion/Accordion.style.js +1 -1
- package/dist/esm/components/add-variableV2/AddVariableV2.js +1 -1
- package/dist/esm/components/add-variableV2/AddVariableV2.styled.js +0 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +3 -3
- package/dist/esm/constants/Theme.d.ts +0 -19
- package/dist/esm/constants/Theme.js +1 -1
- package/package.json +2 -1
|
@@ -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)
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("
|
|
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;
|
|
@@ -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):
|
|
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;
|
package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("../../../assets/icons/info.svg.js"),t=require("react"),i=require("styled-components"),r=require("../../add-variableV2/AddVariableV2SideModal.js"),s=require("../../../assets/icons/plus.svg.js");require("../../add-variableV2/AddVariableV2.styled.js"),require("../../button/Button.js"),require("../../icon-button/IconButton.js");var l=require("../../input/Input.js"),n=require("../../tooltips/Tooltip.js"),o=require("../../../constants/Theme.js"),d=require("../../TypographyStyle.js"),c=require("../../checkBox/CheckBox.js"),u=require("../../template-preview/models/Channels.js"),h=require("../context/templateModalContext.js"),x=require("./VariableConnector.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=p(i);const j=b.default.div`
|
|
2
2
|
overflow-y: auto;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
height: 100%;
|
|
6
|
-
`,g=
|
|
6
|
+
`,g=b.default.button`
|
|
7
7
|
padding: 2px 8px;
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
color: white;
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
27
|
}
|
|
28
|
-
`;exports.AddVariableStyled=g,exports.Container=
|
|
28
|
+
`;exports.AddVariableStyled=g,exports.Container=j,exports.default=i=>{let{onFocus:p,showVariableModal:b,variableList:f,discountCode:v,setDiscountCode:y}=i;const{originalVariableList:m,channel:V}=h.useTemplateModalContext(),[O,C]=t.useState(!1),[S,q]=t.useState(!1),[w,T]=t.useState(!1),[k,L]=t.useState(""),[B,E]=t.useState(!1),A=t.useRef(),I=t.useRef();return t.useEffect((()=>{y&&y(v+k)}),[k]),t.useEffect((()=>{m.forEach((e=>{"checkout.checkoutUrl"===e.updatedValue.replace("{{","").replace("}}","")&&(C(!0),v&&E&&E(!0))}))}),[m]),e.jsxs(j,{children:[e.jsxs("div",Object.assign({style:{padding:8}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",gap:8,alignItems:"center",marginBottom:4}},{children:[e.jsx(d.TitleRegular,Object.assign({style:{color:o.COLORS.content.primary}},{children:"Edit variables and links"})),e.jsx(n.Tooltip,Object.assign({body:"Variables are placeholder texts which can either be filled by data, eg: customer name or can have any custom text within them"},{children:e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(a.default,{width:20,height:20,color:o.COLORS.content.placeholder})}))}))]})),e.jsx(d.BodySecondary,Object.assign({style:{color:o.COLORS.content.secondary}},{children:"You can view variables and links on the left underlined in purple colour."}))]})),null==m?void 0:m.map(((a,t)=>V!==u.CHANNEL_TYPE.EMAIL||a.isEditableVariable?e.jsx("div",Object.assign({style:{marginTop:16}},{children:e.jsx(x.default,{index:t,variable:a,onFocus:()=>null==p?void 0:p(t),showVariableModal:b,variableList:f,setShowDiscountCheckBox:C})}),t):e.jsxs("div",Object.assign({style:{margin:"16px 8px"}},{children:[e.jsxs(d.BodySecondary,Object.assign({style:{color:o.COLORS.content.primary}},{children:["Locked variable ",t+1]})),e.jsx(l.Input,{state:"disabled",placeholder:a.variableName,onChangeText:()=>{}})]}),t))),(O||v)&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8}},{children:[e.jsx(c.CheckBox,{isChecked:B,onValueChange:()=>{B&&y&&y(""),E(!B)}}),e.jsx(d.TitleSmall,Object.assign({style:{marginLeft:8}},{children:"Add discount code"}))]})),B&&e.jsxs("div",Object.assign({ref:A,style:{margin:10}},{children:[e.jsx(l.Input,{placeholder:"Enter your discount code",onChangeText:e=>{y&&y(e)},value:v,onFocus:()=>{q(!0)},onBlur:e=>{var a;"addVar"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)?(A.current&&A.current.focus(),q(!0)):(q(!1),T(!1))},noErrorHint:!0,validate:e=>[!0,""]}),S&&e.jsx(g,Object.assign({ref:I,id:"addVar",onClick:e=>{e.stopPropagation(),T(!0)}},{children:e.jsxs("div",Object.assign({className:"add"},{children:[e.jsx(s.default,{width:20,height:20,color:"white"}),e.jsx("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))]})),w&&e.jsx(r.AddVariableV2SideModal,{zIndex:2e3,data:null!=f?f:[],showVariable:w,setShowVariable:T,variableValue:k,setVariableValue:L,placeholder:"Add a variable",customTrigger:e=>{L(e.actualValue),q(!1)}})]})};
|
|
@@ -36,11 +36,6 @@ export declare const BASE_COLORS: {
|
|
|
36
36
|
100: string;
|
|
37
37
|
50: string;
|
|
38
38
|
};
|
|
39
|
-
bikAi: {
|
|
40
|
-
500: string;
|
|
41
|
-
100: string;
|
|
42
|
-
50: string;
|
|
43
|
-
};
|
|
44
39
|
};
|
|
45
40
|
export declare const COLORS: {
|
|
46
41
|
background: {
|
|
@@ -78,8 +73,6 @@ export declare const COLORS: {
|
|
|
78
73
|
subdued: string;
|
|
79
74
|
hovered: string;
|
|
80
75
|
grey: string;
|
|
81
|
-
ai: string;
|
|
82
|
-
aiLight: string;
|
|
83
76
|
};
|
|
84
77
|
content: {
|
|
85
78
|
primary: string;
|
|
@@ -93,7 +86,6 @@ export declare const COLORS: {
|
|
|
93
86
|
warning: string;
|
|
94
87
|
positive: string;
|
|
95
88
|
blue: string;
|
|
96
|
-
ai: string;
|
|
97
89
|
};
|
|
98
90
|
stroke: {
|
|
99
91
|
primary: string;
|
|
@@ -114,10 +106,6 @@ export declare const COLORS: {
|
|
|
114
106
|
blue: {
|
|
115
107
|
lightAlt: string;
|
|
116
108
|
};
|
|
117
|
-
ai: {
|
|
118
|
-
lightAlt: string;
|
|
119
|
-
vibrant: string;
|
|
120
|
-
};
|
|
121
109
|
};
|
|
122
110
|
special: {
|
|
123
111
|
whatsapp: {
|
|
@@ -367,8 +355,6 @@ export declare const DEFAULT_THEME: {
|
|
|
367
355
|
subdued: string;
|
|
368
356
|
hovered: string;
|
|
369
357
|
grey: string;
|
|
370
|
-
ai: string;
|
|
371
|
-
aiLight: string;
|
|
372
358
|
};
|
|
373
359
|
content: {
|
|
374
360
|
primary: string;
|
|
@@ -382,7 +368,6 @@ export declare const DEFAULT_THEME: {
|
|
|
382
368
|
warning: string;
|
|
383
369
|
positive: string;
|
|
384
370
|
blue: string;
|
|
385
|
-
ai: string;
|
|
386
371
|
};
|
|
387
372
|
stroke: {
|
|
388
373
|
primary: string;
|
|
@@ -403,10 +388,6 @@ export declare const DEFAULT_THEME: {
|
|
|
403
388
|
blue: {
|
|
404
389
|
lightAlt: string;
|
|
405
390
|
};
|
|
406
|
-
ai: {
|
|
407
|
-
lightAlt: string;
|
|
408
|
-
vibrant: string;
|
|
409
|
-
};
|
|
410
391
|
};
|
|
411
392
|
special: {
|
|
412
393
|
whatsapp: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={brand:{900:"#28034E",800:"#4B1583",500:"#731DCF",50:"#EFE6F9",10:"#F9F3FF"},grayscale:{900:"#212121",700:"#616161",500:"#9E9E9E",400:"#BDBDBD",200:"#E0E0E0",100:"#F0F0F0",70:"#F7F7F7",50:"#FAFAFA",white:"#FFFFFF",alpha:"#00000088"},negative:{900:"#B92321",700:"#D53434",100:"#FFCED4",50:"#FFEBEF"},warning:{900:"#99631B",500:"#FEC02D",100:"#FFEABE",50:"#FFF7E5"},positive:{900:"#00580E",700:"#1A872C",100:"#C3E4C4",50:"#E6F4E7"}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={brand:{900:"#28034E",800:"#4B1583",500:"#731DCF",50:"#EFE6F9",10:"#F9F3FF"},grayscale:{900:"#212121",700:"#616161",500:"#9E9E9E",400:"#BDBDBD",200:"#E0E0E0",100:"#F0F0F0",70:"#F7F7F7",50:"#FAFAFA",white:"#FFFFFF",alpha:"#00000088"},negative:{900:"#B92321",700:"#D53434",100:"#FFCED4",50:"#FFEBEF"},warning:{900:"#99631B",500:"#FEC02D",100:"#FFEABE",50:"#FFF7E5"},positive:{900:"#00580E",700:"#1A872C",100:"#C3E4C4",50:"#E6F4E7"}},t={background:{inactive:e.grayscale[200],base:e.grayscale[100],inverse:e.brand[900],inverseLight:e.brand[800],brand:e.brand[500],brandLight:e.brand[50],brandVeryLight:e.brand[10],negative:{vibrant:e.negative[700],light:e.negative[50]},warning:{vibrant:e.warning[500],light:e.warning[50]},positive:{vibrant:e.positive[700],light:e.positive[50]},blue:{light:"#E5F2FF"}},icon:{placeholder:"#9E9E9E"},scrim:{standard:"#00000099"},surface:{standard:e.grayscale.white,subdued:e.grayscale[50],hovered:e.grayscale[100],grey:e.grayscale[70]},content:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],inactive:e.grayscale[400],brand:e.brand[500],primaryInverse:e.grayscale.white,secondaryInverse:"#ffffffcc",negative:e.negative[900],warning:e.warning[900],positive:e.positive[900],blue:"#28458F"},stroke:{primary:e.grayscale[200],brand:e.brand[500],negative:{lightAlt:e.negative[100],vibrant:e.negative[700]},warning:{lightAlt:e.warning[100],vibrant:e.warning[500]},positive:{lightAlt:e.positive[100],vibrant:e.positive[700]},brandLightAlt:"#DDCCF0",blue:{lightAlt:"#C3D5E5"}},special:{whatsapp:{brand:"#25D366",gradient:"linear-gradient(360deg, #20B038 0%, #60D66A 100%)",dark:"#455A64",gradientArr:["#20B038","#60D66A"]},brand:{google:"#DD4B39",facebook:"#1877F2"}},text:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],disabled:e.grayscale[400],white:e.grayscale.white,brand:e.brand[500],altPrimary:e.brand[900],altSecondary:e.brand[800]}},i={display:{fontWeight:"400",fontSize:32,lineHeight:40,letterSpacing:0},titleXLarge:{fontWeight:"600",fontSize:32,lineHeight:40,letterSpacing:0},titleLarge:{fontWeight:"600",fontSize:28,lineHeight:40,letterSpacing:0},titleMedium:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},titleRegular:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},titleSmall:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},bodyPrimary:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodyLarge:{fontWeight:"400",fontSize:20,lineHeight:28,letterSpacing:0},bodySecondary:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},caption:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},tiny:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},subHeading:{fontWeight:"600",fontSize:10,lineHeight:12,letterSpacing:0},title1:{fontWeight:"600",fontSize:24,lineHeight:32,letterSpacing:0},title1Mobile:{fontWeight:"600",fontSize:20,lineHeight:30,letterSpacing:0},title2:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},title2Mobile:{fontWeight:"600",fontSize:18,lineHeight:24,letterSpacing:0},title3:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},title3Mobile:{fontWeight:"500",fontSize:14,lineHeight:20,letterSpacing:0},title4:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},textPlaceholder:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},title4Mobile:{fontWeight:"400",fontSize:10,lineHeight:16,letterSpacing:0},bodyRegularMobile:{fontWeight:"400",fontSize:14,lineHeight:18,letterSpacing:0},bodyRegular:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodySmall:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},buttonLarge:{fontWeight:"600",fontSize:16,lineHeight:20,letterSpacing:0},buttonRegular:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},captionMobile:{fontWeight:"500",fontSize:10,lineHeight:12,letterSpacing:0},captionBold:{fontWeight:"700",fontSize:12,lineHeight:16,letterSpacing:0},text1Bold:{fontWeight:"700",fontSize:10,lineHeight:14,letterSpacing:0},toast:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},toastMobile:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0}},n={colorsV2:t,fonts:i};exports.BASE_COLORS=e,exports.COLORS=t,exports.DEFAULT_THEME=n,exports.FONTS=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as t,useEffect as o}from"react";import{TitleRegular as i,BodySecondary as c}from"../TypographyStyle.js";import a from"./Accordion.style.js";import s from"./AccordionArrow.js";const l=l=>{var d;const[h,u]=n(!1),v=t(null),g=t(null)
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as t,useEffect as o}from"react";import{TitleRegular as i,BodySecondary as c}from"../TypographyStyle.js";import a from"./Accordion.style.js";import s from"./AccordionArrow.js";const l=l=>{var d;const[h,u]=n(!1),v=t(null),g=t(null),m=(e,r)=>{g.current&&v.current&&("keydown"===r.type&&"Enter"!==r.key||(u(e),g.current.style.maxHeight?(g.current.style.maxHeight="",v.current.style.transform="rotate(0deg)",v.current.style.transition="transform 0.25s ease-in-out",g.current.style.transition="padding 0s"):(g.current.style.maxHeight=g.current.scrollHeight+"px",v.current.style.transform="rotate(180deg)",v.current.style.transition="transform 0.25s ease-in-out",g.current.style.transition="max-height 0.25s ease-in-out")))};return o((()=>{var e;h&&(null==l?void 0:l.refresh)&&(null===(e=null==g?void 0:g.current)||void 0===e?void 0:e.scrollHeight)&&setTimeout((()=>{g.current.style.maxHeight=g.current.scrollHeight+"px"}),100)}),[h,null==l?void 0:l.refresh,null===(d=null==g?void 0:g.current)||void 0===d?void 0:d.scrollHeight]),e(a,Object.assign({className:"accordion",isActive:h,width:null==l?void 0:l.width,contentMargin:null==l?void 0:l.contentMargin,headerPadding:l.headerPadding,skipHoverState:l.skipHoverHeader,showBorders:l.showBorders,backgroundColor:l.backgroundColor},{children:[e("div",Object.assign({className:"accordion__overview "+(h?"active":""),onClick:e=>m(!h,e),onKeyDown:e=>m(!h,e),role:"button",tabIndex:0},{children:[!l.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof l.header?r(i,{children:null==l?void 0:l.header}):l.header,r(s,{isNewIcon:!1,ref:v})]})),l.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:[e("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[r(s,{isNewIcon:!0,ref:v}),"string"==typeof l.header?r(i,{children:null==l?void 0:l.header}):l.header]})),r("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:l.rightActionComponent}))]})),(null==l?void 0:l.caption)&&r("div",Object.assign({className:"accordion__overview__caption"},{children:r(c,{children:l.caption})}))]})),r("div",Object.assign({ref:g,className:"accordion__content"},{children:l.children}))]}))};export{l as BikAccordion};
|
|
@@ -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 @@ import e from"styled-components";import{COLORS as r}from"../../constants/Theme.j
|
|
|
29
29
|
}
|
|
30
30
|
&__content {
|
|
31
31
|
${e=>e.isActive?{margin:(null==e?void 0:e.contentMargin)||"0px"}:{}};
|
|
32
|
-
overflow:
|
|
32
|
+
overflow: hidden;
|
|
33
33
|
max-height: 0;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as e,jsxs as a,Fragment as i}from"react/jsx-runtime";import s from"../../assets/icons/back_icon.svg.js";import l from"../../assets/icons/chevronRightAlt.svg.js";import t from"../../assets/icons/cross.svg.js";import r from"../../assets/icons/plus.svg.js";import n from"../../assets/icons/undo.svg.js";import{memo as c,useState as o,useEffect as d}from"react";import{AddVariableStyled as b}from"./AddVariableV2.styled.js";import{Button as m}from"../button/Button.js";import{IconButton as v}from"../icon-button/IconButton.js";import{SearchBar as p}from"../searchBar/searchBar.js";import{Tooltip as g}from"../tooltips/Tooltip.js";import{COLORS as h}from"../../constants/Theme.js";import{TitleSmall as u,BodyCaption as y}from"../TypographyStyle.js";const j=c((c=>{const{data:j}=c,[f,O]=o({}),[N,V]=o(),[T,_]=o(""),[k,C]=o(""),[S,w]=o(!0),L=/^[^.]*\.[^.]*$/;d((()=>{const e={};j.forEach((a=>{e[a.displayName]=[]})),V(e)}),[j]),d((()=>{if(k){c.data.filter((e=>Object.keys(e.variables).filter((a=>{var i;return(null===(i=e.variables[a].displayName)||void 0===i?void 0:i.toLowerCase().includes(k.toLowerCase()))||B(e.variables[a])})).length>0)).length>0?w(!0):w(!1)}else w(!0)}),[k]);const x=(e,a)=>{const i=j.find((e=>e.displayName===a));if(i){let s=i;e.forEach(((e,a)=>{s=s.variables[e]})),O((e=>Object.assign(Object.assign({},e),{[a]:s})))}},B=e=>{let a=!1;if(e.isSubHeader&&e.variables){const i=Object.keys(e.variables);for(let s=0;s<i.length;s++){const l=i[s];if(e.variables&&e.variables[l].displayName.toLowerCase().includes(k.toLowerCase())){a=!0;break}}}return a},I=a=>{const s=a.item.description;return e(i,{children:e(g,Object.assign({body:"",tooltipContent:e(y,Object.assign({color:h.content.primaryInverse,style:{whiteSpace:"pre-line",padding:8}},{children:a.item.isAvailable?s?`• ${s}\n• Recommended here`:"Recommended here":"Not recommended here"})),width:300,delay:300,placement:"bottom"},{children:e("div",{children:e(F,{item:a.item})})}))})},F=a=>e(m,{darkMode:c.enableVariable?c.enableVariable:a.item.isAvailable,size:"chip",LeadingIcon:a.item.isSubHeader?void 0:r,TrailingIcon:()=>a.item.isSubHeader?e("div",Object.assign({className:"icon-trailing",style:{display:"flex"}},{children:e(l,{})})):e(i,{}),buttonText:a.item.displayName}),E=(a,i)=>e("div",Object.assign({onClick:a.isSubHeader?()=>{const e=[...N[T],i];x(e,T),V((a=>Object.assign(Object.assign({},a),{[T]:e})))}:()=>{c.customTrigger?(c.customTrigger(a),c.setShowVariable(!1)):c.isEvaluationList?A(a):c.setVariableValue(c.selectWithTypes?{actualValue:a.actualValue,variableType:a.variableType,needsFetching:a.needsFetching}:a.actualValue)}},{children:e(I,{item:a})})),H=(e,a)=>{const i=[...N[e.displayName],a];x(i,e.displayName),V((a=>Object.assign(Object.assign({},a),{[e.displayName]:i}))),_(e.displayName)},A=e=>{if(e.actualValue.match(L)){const a=e.actualValue.replace("{{","").replace("}}","").split("."),i=a[0]+`['${a[1]}']`;c.setVariableValue(c.selectWithTypes?{actualValue:i,variableType:e.variableType,needsFetching:e.needsFetching}:i)}else{const a=e.actualValueEval?e.actualValueEval:e.actualValue;c.setVariableValue(c.selectWithTypes?{actualValue:a,variableType:e.variableType,needsFetching:e.needsFetching}:a)}},P=(e,a)=>{if(c.customTrigger)c.customTrigger(e.variables[a]),c.setShowVariable(!1);else if(c.isEvaluationList){const i=e.variables[a];A(i)}else c.setVariableValue(c.selectWithTypes?{actualValue:e.variables[a].actualValue,variableType:e.variables[a].variableType,needsFetching:e.variables[a].needsFetching}:e.variables[a].actualValue)},$=c.isModalState?void 0:{top:"small"===c.pickerSize?"300px":"60px",left:`${c.leftPosition?c.leftPosition+24:430}px`};return e("div",Object.assign({id:"varList",tabIndex:-1},{children:e(b,Object.assign({style:$,onClick:e=>{e.stopPropagation()},pickerSize:c.pickerSize||"large",isModalState:c.isModalState},{children:c.showVariable&&a("div",Object.assign({className:"popup"},{children:[a("div",Object.assign({className:"sticky__bar"},{children:[a("div",Object.assign({className:"header__bar"},{children:[e("div",Object.assign({className:"add__variable"},{children:"Add a new variable"})),e("div",Object.assign({onClick:()=>{c.setShowVariable(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center"}},{children:e(v,{iconButtonType:"default",Icon:t})}))]})),e("div",Object.assign({className:"search__bar",onBlur:e=>{c.onSearchBlur&&c.onSearchBlur(e)}},{children:e(p,{width:"100%",isEnabled:!0,onChange:e=>{C(e)},onEnter:()=>{},placeholder:"Search...",variant:"default"})})),!S&&a("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",marginTop:16}},{children:[e(u,{children:"No results found!"}),e(y,{children:`Sorry we could not find any results for "${k}"`})]})),T&&N[T].length>0&&a("div",Object.assign({className:"nav__bar",style:{marginTop:8}},{children:[a("div",Object.assign({className:"left__nav"},{children:[e(v,{Icon:s,style:{color:"#919191",display:"flex"},onClick:()=>{const e=N[T].slice(0,-1);x(e,T),V((a=>Object.assign(Object.assign({},a),{[T]:e}))),e.length||_("")}}),a("div",Object.assign({className:"block"},{children:[e(u,{children:f[T].displayName}),f[T].description&&e(y,{children:f[T].description})]}))]})),a("div",Object.assign({className:"right__nav"},{children:[e(v,{Icon:n,style:{display:"flex"},onClick:()=>{x([],T),V((e=>Object.assign(Object.assign({},e),{[T]:[]}))),_("")}}),e("div",{children:"First page"})]}))]}))]})),e("div",Object.assign({className:"wrapper"},{children:e("div",Object.assign({className:"list__map"},{children:a("div",Object.assign({className:"items"},{children:[!T&&c.data.map((s=>{let l=[];return k&&(l=Object.keys(s.variables).filter((e=>{var a;return(null===(a=s.variables[e].displayName)||void 0===a?void 0:a.toLowerCase().includes(k.toLowerCase()))||B(s.variables[e])}))),a(i,{children:[k?l.length>0?a("div",Object.assign({className:"block"},{children:[e("div",Object.assign({className:"heading__font"},{children:null==s?void 0:s.displayName})),e(y,Object.assign({style:{marginBottom:8,color:"#616161"}},{children:null==s?void 0:s.description}))]})):e(i,{}):a("div",Object.assign({className:"block"},{children:[e("div",Object.assign({className:"heading__font"},{children:null==s?void 0:s.displayName})),e(y,Object.assign({style:{marginBottom:8,color:"#616161"}},{children:null==s?void 0:s.description}))]})),Object.keys(s.variables).map((a=>{var l;return k?(null===(l=s.variables[a].displayName)||void 0===l?void 0:l.toLowerCase().includes(k.toLowerCase()))||B(s.variables[a])?e("div",Object.assign({onClick:s.variables[a].isSubHeader?()=>H(s,a):()=>P(s,a)},{children:e(I,{item:s.variables[a]})})):e(i,{}):e("div",Object.assign({onClick:s.variables[a].isSubHeader?()=>H(s,a):()=>P(s,a)},{children:e(I,{item:s.variables[a]})}))}))]})})),T&&e("div",Object.assign({className:"list__map"},{children:e("div",Object.assign({className:"items",style:{marginTop:16}},{children:Object.keys(f[T].variables).map(((a,s)=>{var l;return k?(null===(l=f[T].variables[a].displayName)||void 0===l?void 0:l.toLowerCase().includes(k.toLowerCase()))||B(f[T].variables[a])?E(f[T].variables[a],a):e(i,{}):E(f[T].variables[a],a)}))}))}))]}))}))})),e("div",{className:"bottom__padding"})]}))}))}))}),((e,a)=>e.enableVariable===a.enableVariable&&e.leftPosition===a.leftPosition));export{j as AddVariableV2};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as o,jsxs as n}from"react/jsx-runtime";import{useState as t,useEffect as l}from"react";import{Dropdown as i}from"react-bootstrap";import{DEFAULT_THEME as s,BASE_COLORS as a}from"../../constants/Theme.js";import{DatePicker as d}from"../datePicker/DatePicker.js";import{BodySecondary as c,BodyCaption as r,Caption as g}from"../TypographyStyle.js";import{MainDropdown as p,ItemMenuContainer as u}from"./CommonStyles.js";const m=a=>{let{options:r,placeholder:u="Select an option",selected:m,onOptionSelected:b,resetDropdown:h,maxHeight:f,backgroundColor:y,calendarPopperConfig:k,variant:D="default",datePickerPlacement:j}=a;var S,R,C;const[w,x]=t(!1),[$,T]=t(m),[P,I]=t(),[N,A]=t(!1),E=()=>{!w&&A(!N)},[F,H]=t(m),M="small"===D?g:c;return l((()=>{h&&T(void 0)}),[h]),l((()=>{var e;(null==m?void 0:m.isCustom)&&(null===(e=m.dateRangeSelectionOptions)||void 0===e?void 0:e.selectedDates)?I(m.dateRangeSelectionOptions.selectedDates):
|
|
1
|
+
import{jsx as e,Fragment as o,jsxs as n}from"react/jsx-runtime";import{useState as t,useEffect as l}from"react";import{Dropdown as i}from"react-bootstrap";import{DEFAULT_THEME as s,BASE_COLORS as a}from"../../constants/Theme.js";import{DatePicker as d}from"../datePicker/DatePicker.js";import{BodySecondary as c,BodyCaption as r,Caption as g}from"../TypographyStyle.js";import{MainDropdown as p,ItemMenuContainer as u}from"./CommonStyles.js";const m=a=>{let{options:r,placeholder:u="Select an option",selected:m,onOptionSelected:b,resetDropdown:h,maxHeight:f,backgroundColor:y,calendarPopperConfig:k,variant:D="default",datePickerPlacement:j}=a;var S,R,C;const[w,x]=t(!1),[$,T]=t(m),[P,I]=t(),[N,A]=t(!1),E=()=>{!w&&A(!N)},[F,H]=t(m),M="small"===D?g:c;return l((()=>{h&&T(void 0)}),[h]),l((()=>{var e;(null==m?void 0:m.isCustom)&&(null===(e=m.dateRangeSelectionOptions)||void 0===e?void 0:e.selectedDates)?I(m.dateRangeSelectionOptions.selectedDates):I(void 0),T(m)}),[m]),e(o,{children:n(p,Object.assign({drop:"down",show:N,onToggle:E,backgroundColor:y},{children:[e(i.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 ${s.colorsV2.stroke.primary}`}:void 0},{children:e(M,Object.assign({style:"small"===D?{color:s.colorsV2.content.secondary}:void 0},{children:(null==$?void 0:$.isCustom)?P?O(P[0])===O(P[1])?`${O(P[0])}`:`${O(P[0])} to ${O(P[1])}`:null==F?void 0:F.label:$?null==$?void 0:$.label:u}))})),e(i.Menu,Object.assign({className:"main--dropdown"},{children:n(p,Object.assign({drop:null!=j?j:"end",id:"sub--dropdown",show:w,onToggle:e=>{!e&&A(!1),x(!w)}},{children:[e("div",Object.assign({style:{maxHeight:f||"auto",overflowY:"scroll"}},{children:r.map((o=>{var n;return e("div",{children:(null==o?void 0:o.isCustom)?e(i.Toggle,Object.assign({className:"sub--dropdown"},{children:e(v,{eachOption:o,selectedOption:$,selectedDate:P,onClickingEachItem:e=>{T(e),x(!0)},rangeSelection:!!(null===(n=null==o?void 0:o.dateRangeSelectionOptions)||void 0===n?void 0:n.selectRange)})})):e(v,{eachOption:o,selectedOption:$,selectedDate:P,onClickingEachItem:e=>{if(I(void 0),T(e),H(e),E(),!e.noOfDays)return void b(e);const o=new Date,n=new Date;n.setDate(o.getDate()-e.noOfDays),b(Object.assign(Object.assign({},e),{selectedRange:[n,o]}))}})},null==o?void 0:o.key)}))})),e(i.Menu,Object.assign({className:"sub--dropdown",popperConfig:{modifiers:[{name:"offset",options:{offset:[(null==k?void 0:k.offsetSkid)||0,(null==k?void 0:k.offsetDistance)||0]}}]}},{children:e(d,{selectRange:(null===(S=null==$?void 0:$.dateRangeSelectionOptions)||void 0===S?void 0:S.selectRange)||!1,maxDate:null===(R=null==$?void 0:$.dateRangeSelectionOptions)||void 0===R?void 0:R.maxDate,minDate:null===(C=null==$?void 0:$.dateRangeSelectionOptions)||void 0===C?void 0:C.minDate,selectedDates:P,onSelectRange:(e,o)=>{const n=[e,o];(null==$?void 0:$.dateRangeSelectionOptions)&&($.dateRangeSelectionOptions.selectedDates=n,b(Object.assign(Object.assign({},$),{selectedRange:[e,o]}))),H($),x(!1),I(n),A(!N)},onSelectDate:e=>{(null==$?void 0:$.dateRangeSelectionOptions)&&($.dateRangeSelectionOptions.selectedDates=[e,e],b(Object.assign(Object.assign({},$),{selectedRange:[e,e]}))),H($),x(!1),I([e,e]),A(!N)}})}))]}))}))]}))})},v=o=>{let{eachOption:t,selectedOption:l,selectedDate:i,onClickingEachItem:s,rangeSelection:d}=o;return n(u,Object.assign({onClick:()=>s(t),isSelected:t.isCustom?t.key==(null==l?void 0:l.key)&&!!i:t.key==(null==l?void 0:l.key)},{children:[e(c,Object.assign({color:t.key==(null==l?void 0:l.key)?a.positive[900]:a.grayscale[900]},{children:t.label})),i&&(null==l?void 0:l.isCustom)&&t.key==(null==l?void 0:l.key)&&e(r,{children:d?`${O(i[0])} to ${O(i[1])}`:`${O(i[0])}`})]}),t.key)},O=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});export{m as AnalyticsDropdown,v as EachItem,O as formatDate};
|
package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i}from"react/jsx-runtime";import t from"../../../assets/icons/info.svg.js";import{useState as a,useRef as o,useEffect as r}from"react";import l from"styled-components";import{AddVariableV2SideModal as n}from"../../add-variableV2/AddVariableV2SideModal.js";import
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import t from"../../../assets/icons/info.svg.js";import{useState as a,useRef as o,useEffect as r}from"react";import l from"styled-components";import{AddVariableV2SideModal as n}from"../../add-variableV2/AddVariableV2SideModal.js";import s from"../../../assets/icons/plus.svg.js";import"../../add-variableV2/AddVariableV2.styled.js";import"../../button/Button.js";import"../../icon-button/IconButton.js";import{Input as d}from"../../input/Input.js";import{Tooltip as c}from"../../tooltips/Tooltip.js";import{COLORS as p}from"../../../constants/Theme.js";import{TitleRegular as h,BodySecondary as m,TitleSmall as b}from"../../TypographyStyle.js";import{CheckBox as g}from"../../checkBox/CheckBox.js";import{CHANNEL_TYPE as u}from"../../template-preview/models/Channels.js";import{useTemplateModalContext as f}from"../context/templateModalContext.js";import v from"./VariableConnector.js";const x=l.div`
|
|
2
2
|
overflow-y: auto;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
height: 100%;
|
|
6
|
-
`,
|
|
6
|
+
`,y=l=>{let{onFocus:y,showVariableModal:V,variableList:w,discountCode:O,setDiscountCode:k}=l;const{originalVariableList:C,channel:T}=f(),[B,L]=a(!1),[A,E]=a(!1),[I,M]=a(!1),[S,D]=a(""),[F,N]=a(!1),z=o(),H=o();return r((()=>{k&&k(O+S)}),[S]),r((()=>{C.forEach((e=>{"checkout.checkoutUrl"===e.updatedValue.replace("{{","").replace("}}","")&&(L(!0),O&&N&&N(!0))}))}),[C]),e(x,{children:[e("div",Object.assign({style:{padding:8}},{children:[e("div",Object.assign({style:{display:"flex",gap:8,alignItems:"center",marginBottom:4}},{children:[i(h,Object.assign({style:{color:p.content.primary}},{children:"Edit variables and links"})),i(c,Object.assign({body:"Variables are placeholder texts which can either be filled by data, eg: customer name or can have any custom text within them"},{children:i("div",Object.assign({style:{display:"flex"}},{children:i(t,{width:20,height:20,color:p.content.placeholder})}))}))]})),i(m,Object.assign({style:{color:p.content.secondary}},{children:"You can view variables and links on the left underlined in purple colour."}))]})),null==C?void 0:C.map(((t,a)=>T!==u.EMAIL||t.isEditableVariable?i("div",Object.assign({style:{marginTop:16}},{children:i(v,{index:a,variable:t,onFocus:()=>null==y?void 0:y(a),showVariableModal:V,variableList:w,setShowDiscountCheckBox:L})}),a):e("div",Object.assign({style:{margin:"16px 8px"}},{children:[e(m,Object.assign({style:{color:p.content.primary}},{children:["Locked variable ",a+1]})),i(d,{state:"disabled",placeholder:t.variableName,onChangeText:()=>{}})]}),a))),(B||O)&&e("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8}},{children:[i(g,{isChecked:F,onValueChange:()=>{F&&k&&k(""),N(!F)}}),i(b,Object.assign({style:{marginLeft:8}},{children:"Add discount code"}))]})),F&&e("div",Object.assign({ref:z,style:{margin:10}},{children:[i(d,{placeholder:"Enter your discount code",onChangeText:e=>{k&&k(e)},value:O,onFocus:()=>{E(!0)},onBlur:e=>{var i;"addVar"===(null===(i=e.relatedTarget)||void 0===i?void 0:i.id)?(z.current&&z.current.focus(),E(!0)):(E(!1),M(!1))},noErrorHint:!0,validate:e=>[!0,""]}),A&&i(j,Object.assign({ref:H,id:"addVar",onClick:e=>{e.stopPropagation(),M(!0)}},{children:e("div",Object.assign({className:"add"},{children:[i(s,{width:20,height:20,color:"white"}),i("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))]})),I&&i(n,{zIndex:2e3,data:null!=w?w:[],showVariable:I,setShowVariable:M,variableValue:S,setVariableValue:D,placeholder:"Add a variable",customTrigger:e=>{D(e.actualValue),E(!1)}})]})},j=l.button`
|
|
7
7
|
padding: 2px 8px;
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
color: white;
|
|
@@ -25,4 +25,4 @@ import{jsxs as e,jsx as i}from"react/jsx-runtime";import t from"../../../assets/
|
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
27
|
}
|
|
28
|
-
`;export{
|
|
28
|
+
`;export{j as AddVariableStyled,x as Container,y as default};
|
|
@@ -36,11 +36,6 @@ export declare const BASE_COLORS: {
|
|
|
36
36
|
100: string;
|
|
37
37
|
50: string;
|
|
38
38
|
};
|
|
39
|
-
bikAi: {
|
|
40
|
-
500: string;
|
|
41
|
-
100: string;
|
|
42
|
-
50: string;
|
|
43
|
-
};
|
|
44
39
|
};
|
|
45
40
|
export declare const COLORS: {
|
|
46
41
|
background: {
|
|
@@ -78,8 +73,6 @@ export declare const COLORS: {
|
|
|
78
73
|
subdued: string;
|
|
79
74
|
hovered: string;
|
|
80
75
|
grey: string;
|
|
81
|
-
ai: string;
|
|
82
|
-
aiLight: string;
|
|
83
76
|
};
|
|
84
77
|
content: {
|
|
85
78
|
primary: string;
|
|
@@ -93,7 +86,6 @@ export declare const COLORS: {
|
|
|
93
86
|
warning: string;
|
|
94
87
|
positive: string;
|
|
95
88
|
blue: string;
|
|
96
|
-
ai: string;
|
|
97
89
|
};
|
|
98
90
|
stroke: {
|
|
99
91
|
primary: string;
|
|
@@ -114,10 +106,6 @@ export declare const COLORS: {
|
|
|
114
106
|
blue: {
|
|
115
107
|
lightAlt: string;
|
|
116
108
|
};
|
|
117
|
-
ai: {
|
|
118
|
-
lightAlt: string;
|
|
119
|
-
vibrant: string;
|
|
120
|
-
};
|
|
121
109
|
};
|
|
122
110
|
special: {
|
|
123
111
|
whatsapp: {
|
|
@@ -367,8 +355,6 @@ export declare const DEFAULT_THEME: {
|
|
|
367
355
|
subdued: string;
|
|
368
356
|
hovered: string;
|
|
369
357
|
grey: string;
|
|
370
|
-
ai: string;
|
|
371
|
-
aiLight: string;
|
|
372
358
|
};
|
|
373
359
|
content: {
|
|
374
360
|
primary: string;
|
|
@@ -382,7 +368,6 @@ export declare const DEFAULT_THEME: {
|
|
|
382
368
|
warning: string;
|
|
383
369
|
positive: string;
|
|
384
370
|
blue: string;
|
|
385
|
-
ai: string;
|
|
386
371
|
};
|
|
387
372
|
stroke: {
|
|
388
373
|
primary: string;
|
|
@@ -403,10 +388,6 @@ export declare const DEFAULT_THEME: {
|
|
|
403
388
|
blue: {
|
|
404
389
|
lightAlt: string;
|
|
405
390
|
};
|
|
406
|
-
ai: {
|
|
407
|
-
lightAlt: string;
|
|
408
|
-
vibrant: string;
|
|
409
|
-
};
|
|
410
391
|
};
|
|
411
392
|
special: {
|
|
412
393
|
whatsapp: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={brand:{900:"#28034E",800:"#4B1583",500:"#731DCF",50:"#EFE6F9",10:"#F9F3FF"},grayscale:{900:"#212121",700:"#616161",500:"#9E9E9E",400:"#BDBDBD",200:"#E0E0E0",100:"#F0F0F0",70:"#F7F7F7",50:"#FAFAFA",white:"#FFFFFF",alpha:"#00000088"},negative:{900:"#B92321",700:"#D53434",100:"#FFCED4",50:"#FFEBEF"},warning:{900:"#99631B",500:"#FEC02D",100:"#FFEABE",50:"#FFF7E5"},positive:{900:"#00580E",700:"#1A872C",100:"#C3E4C4",50:"#E6F4E7"}
|
|
1
|
+
const e={brand:{900:"#28034E",800:"#4B1583",500:"#731DCF",50:"#EFE6F9",10:"#F9F3FF"},grayscale:{900:"#212121",700:"#616161",500:"#9E9E9E",400:"#BDBDBD",200:"#E0E0E0",100:"#F0F0F0",70:"#F7F7F7",50:"#FAFAFA",white:"#FFFFFF",alpha:"#00000088"},negative:{900:"#B92321",700:"#D53434",100:"#FFCED4",50:"#FFEBEF"},warning:{900:"#99631B",500:"#FEC02D",100:"#FFEABE",50:"#FFF7E5"},positive:{900:"#00580E",700:"#1A872C",100:"#C3E4C4",50:"#E6F4E7"}},t={background:{inactive:e.grayscale[200],base:e.grayscale[100],inverse:e.brand[900],inverseLight:e.brand[800],brand:e.brand[500],brandLight:e.brand[50],brandVeryLight:e.brand[10],negative:{vibrant:e.negative[700],light:e.negative[50]},warning:{vibrant:e.warning[500],light:e.warning[50]},positive:{vibrant:e.positive[700],light:e.positive[50]},blue:{light:"#E5F2FF"}},icon:{placeholder:"#9E9E9E"},scrim:{standard:"#00000099"},surface:{standard:e.grayscale.white,subdued:e.grayscale[50],hovered:e.grayscale[100],grey:e.grayscale[70]},content:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],inactive:e.grayscale[400],brand:e.brand[500],primaryInverse:e.grayscale.white,secondaryInverse:"#ffffffcc",negative:e.negative[900],warning:e.warning[900],positive:e.positive[900],blue:"#28458F"},stroke:{primary:e.grayscale[200],brand:e.brand[500],negative:{lightAlt:e.negative[100],vibrant:e.negative[700]},warning:{lightAlt:e.warning[100],vibrant:e.warning[500]},positive:{lightAlt:e.positive[100],vibrant:e.positive[700]},brandLightAlt:"#DDCCF0",blue:{lightAlt:"#C3D5E5"}},special:{whatsapp:{brand:"#25D366",gradient:"linear-gradient(360deg, #20B038 0%, #60D66A 100%)",dark:"#455A64",gradientArr:["#20B038","#60D66A"]},brand:{google:"#DD4B39",facebook:"#1877F2"}},text:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],disabled:e.grayscale[400],white:e.grayscale.white,brand:e.brand[500],altPrimary:e.brand[900],altSecondary:e.brand[800]}},i={display:{fontWeight:"400",fontSize:32,lineHeight:40,letterSpacing:0},titleXLarge:{fontWeight:"600",fontSize:32,lineHeight:40,letterSpacing:0},titleLarge:{fontWeight:"600",fontSize:28,lineHeight:40,letterSpacing:0},titleMedium:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},titleRegular:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},titleSmall:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},bodyPrimary:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodyLarge:{fontWeight:"400",fontSize:20,lineHeight:28,letterSpacing:0},bodySecondary:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},caption:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},tiny:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},subHeading:{fontWeight:"600",fontSize:10,lineHeight:12,letterSpacing:0},title1:{fontWeight:"600",fontSize:24,lineHeight:32,letterSpacing:0},title1Mobile:{fontWeight:"600",fontSize:20,lineHeight:30,letterSpacing:0},title2:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},title2Mobile:{fontWeight:"600",fontSize:18,lineHeight:24,letterSpacing:0},title3:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},title3Mobile:{fontWeight:"500",fontSize:14,lineHeight:20,letterSpacing:0},title4:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},textPlaceholder:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},title4Mobile:{fontWeight:"400",fontSize:10,lineHeight:16,letterSpacing:0},bodyRegularMobile:{fontWeight:"400",fontSize:14,lineHeight:18,letterSpacing:0},bodyRegular:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodySmall:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},buttonLarge:{fontWeight:"600",fontSize:16,lineHeight:20,letterSpacing:0},buttonRegular:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},captionMobile:{fontWeight:"500",fontSize:10,lineHeight:12,letterSpacing:0},captionBold:{fontWeight:"700",fontSize:12,lineHeight:16,letterSpacing:0},text1Bold:{fontWeight:"700",fontSize:10,lineHeight:14,letterSpacing:0},toast:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},toastMobile:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0}},n={colorsV2:t,fonts:i};export{e as BASE_COLORS,t as COLORS,n as DEFAULT_THEME,i as FONTS};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bikdotai/bik-component-library",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.387-beta.101",
|
|
4
4
|
"description": "Bik Component Library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"emoji-picker-react": "^4.4.9",
|
|
59
59
|
"lodash": "^4.17.21",
|
|
60
60
|
"phone": "^3.1.37",
|
|
61
|
+
"react-beautiful-dnd": "^13.1.1",
|
|
61
62
|
"react-bootstrap": "^2.4.0",
|
|
62
63
|
"react-calendar": "^3.7.0",
|
|
63
64
|
"react-chartjs-2": "^4.3.1",
|