@bikdotai/bik-component-library 0.0.276 → 0.0.278
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/QueryBuilder/helpers/MetaCustomProcessor.d.ts +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/bik-layout/CommonStyles.js +1 -1
- package/dist/cjs/components/bik-layout/FeatureModal.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/checkBox/CheckBox.d.ts +1 -1
- package/dist/cjs/components/checkBox/CheckBox.js +1 -1
- package/dist/cjs/components/modals/Modal.js +1 -1
- package/dist/cjs/components/modals/modal.styled.d.ts +1 -1
- package/dist/cjs/components/modals/modal.styled.js +1 -1
- package/dist/cjs/components/product-picker-v2/collectionScreen.d.ts +2 -1
- package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.d.ts +2 -0
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/product-picker-v2/productScreen.d.ts +3 -0
- package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
- package/dist/cjs/components/side-modal/SideModal.d.ts +1 -0
- package/dist/cjs/components/side-modal/SideModal.js +1 -1
- package/dist/cjs/components/side-modal/SideModal.style.d.ts +3 -1
- package/dist/cjs/components/side-modal/SideModal.style.js +8 -8
- package/dist/cjs/components/states-modal/StateModalComponent.js +1 -1
- package/dist/cjs/components/stepper/WorkingStepper.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
- package/dist/cjs/components/toaster/Toaster.d.ts +1 -0
- package/dist/cjs/components/toaster/Toaster.js +1 -1
- package/dist/cjs/components/toaster/Toaster.styled.d.ts +1 -0
- package/dist/cjs/components/toaster/Toaster.styled.js +1 -1
- package/dist/cjs/constants/zindex.d.ts +7 -0
- package/dist/cjs/constants/zindex.js +1 -0
- package/dist/cjs/types/componentTypes.d.ts +8 -0
- package/dist/cjs/types/componentTypes.js +1 -0
- package/dist/esm/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/bik-layout/CommonStyles.js +1 -1
- package/dist/esm/components/bik-layout/FeatureModal.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/checkBox/CheckBox.d.ts +1 -1
- package/dist/esm/components/checkBox/CheckBox.js +1 -1
- package/dist/esm/components/modals/Modal.js +1 -1
- package/dist/esm/components/modals/modal.styled.d.ts +1 -1
- package/dist/esm/components/modals/modal.styled.js +1 -1
- package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +2 -1
- package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.d.ts +2 -0
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/product-picker-v2/productScreen.d.ts +3 -0
- package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
- package/dist/esm/components/side-modal/SideModal.d.ts +1 -0
- package/dist/esm/components/side-modal/SideModal.js +1 -1
- package/dist/esm/components/side-modal/SideModal.style.d.ts +3 -1
- package/dist/esm/components/side-modal/SideModal.style.js +16 -16
- package/dist/esm/components/states-modal/StateModalComponent.js +1 -1
- package/dist/esm/components/stepper/WorkingStepper.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
- package/dist/esm/components/toaster/Toaster.d.ts +1 -0
- package/dist/esm/components/toaster/Toaster.js +1 -1
- package/dist/esm/components/toaster/Toaster.styled.d.ts +1 -0
- package/dist/esm/components/toaster/Toaster.styled.js +1 -1
- package/dist/esm/constants/zindex.d.ts +7 -0
- package/dist/esm/constants/zindex.js +1 -0
- package/dist/esm/types/componentTypes.d.ts +8 -0
- package/dist/esm/types/componentTypes.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import s from"react-dom";import{COLORS as n}from"../../constants/Theme.js";import r from"../../assets/icons/cross.svg.js";import{Button as i}from"../button/Button.js";import{TitleMedium as a,BodyPrimary as c}from"../TypographyStyle.js";import{FeatureModalContainer as l,InnerModalContainer as d}from"./CommonStyles.js";const m=m=>{const{zIndex:u,disableCross:h=!1,otherContent:p,onClickingCross:b,onUpgrade:g,title:j,subTitle:f,showBookADemo:y,demoLink:k}=m,C=j||"Upgrade to access this feature",T=f||"This feature is not included in the current plan. Upgrade to get access and use this feature.";return s.createPortal(e(l,Object.assign({zIndex:u},{children:[!h&&t("div",Object.assign({className:"cross-button",onClick:()=>b(),"aria-hidden":"true"},{children:t(r,{height:20,width:20,color:n.surface.subdued})})),t(d,{children:p?t(o,{children:p}):e("div",Object.assign({className:"content-layout"},{children:[e("div",{children:[t(a,Object.assign({className:"title-color"},{children:C})),t(c,Object.assign({className:"title-color mt-8"},{children:T}))]}),e("div",Object.assign({className:"cta-buttons"},{children:[y&&t(i,{buttonText:"Book a demo",buttonType:"secondary",size:"large",inverse:!0,onClick:()=>{window.open(k,"_blank")}}),t(i,{buttonText:"Upgrade plan",buttonType:"primary",size:"large",inverse:!0,onClick:()=>g?g():""})]}))]}))})]})),document.body)};export{m as FeatureModal};
|
|
@@ -4,7 +4,7 @@ export type CheckBoxProps = {
|
|
|
4
4
|
isPartiallyChecked?: boolean;
|
|
5
5
|
isDisabled?: boolean;
|
|
6
6
|
value?: string;
|
|
7
|
-
onValueChange: (checked: boolean, value?: string) => void;
|
|
7
|
+
onValueChange: (checked: boolean, value?: string, event?: React.MouseEvent) => void;
|
|
8
8
|
label?: string;
|
|
9
9
|
size?: 'DEFAULT' | 'SMALL';
|
|
10
10
|
skipHoverState?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as i,jsx as e}from"react/jsx-runtime";import{useState as l,useEffect as s}from"react";import{CheckboxContainer as a,CheckboxIcon as t}from"./CheckBox.styled.js";import{BodyPrimary as r,BodySecondary as o}from"../TypographyStyle.js";import{COLORS as n}from"../../constants/Theme.js";const d=l=>i("svg",Object.assign({width:l.isSmall?"16":"18",height:l.isSmall?"16":"18",viewBox:l.isSmall?"0 0 16 16":"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e("rect",{x:"0",y:"0",width:l.isSmall?"16":"18",height:l.isSmall?"16":"18",rx:"4",fill:l.isDisabled?n.content.inactive:n.background.positive.vibrant}),!l.isPartial&&e("svg",Object.assign({width:l.isSmall?"8":"10",height:l.isSmall?"7":"9",x:"4",y:"4",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z",fill:"white"})})),l.isPartial&&e("rect",{x:"5",y:l.isSmall?"7":"8",width:l.isSmall?"6":"8",height:"2",rx:"1",fill:n.surface.standard})]})),c=c=>{const[h,m]=l(c.isChecked||!1),[b,g]=l(c.isPartiallyChecked||!1),[p,v]=l(c.isDisabled||!1),[w,x]=l(!1),[S,C]=l(!1);return s((()=>{m(c.isChecked)}),[c.isChecked]),s((()=>{v(c.isDisabled||!1)}),[c.isDisabled]),s((()=>{g(c.isPartiallyChecked||!1)}),[c.isPartiallyChecked]),i(a,Object.assign({onClick:
|
|
1
|
+
import{jsxs as i,jsx as e}from"react/jsx-runtime";import{useState as l,useEffect as s}from"react";import{CheckboxContainer as a,CheckboxIcon as t}from"./CheckBox.styled.js";import{BodyPrimary as r,BodySecondary as o}from"../TypographyStyle.js";import{COLORS as n}from"../../constants/Theme.js";const d=l=>i("svg",Object.assign({width:l.isSmall?"16":"18",height:l.isSmall?"16":"18",viewBox:l.isSmall?"0 0 16 16":"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e("rect",{x:"0",y:"0",width:l.isSmall?"16":"18",height:l.isSmall?"16":"18",rx:"4",fill:l.isDisabled?n.content.inactive:n.background.positive.vibrant}),!l.isPartial&&e("svg",Object.assign({width:l.isSmall?"8":"10",height:l.isSmall?"7":"9",x:"4",y:"4",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z",fill:"white"})})),l.isPartial&&e("rect",{x:"5",y:l.isSmall?"7":"8",width:l.isSmall?"6":"8",height:"2",rx:"1",fill:n.surface.standard})]})),c=c=>{const[h,m]=l(c.isChecked||!1),[b,g]=l(c.isPartiallyChecked||!1),[p,v]=l(c.isDisabled||!1),[w,x]=l(!1),[S,C]=l(!1);return s((()=>{m(c.isChecked)}),[c.isChecked]),s((()=>{v(c.isDisabled||!1)}),[c.isDisabled]),s((()=>{g(c.isPartiallyChecked||!1)}),[c.isPartiallyChecked]),i(a,Object.assign({onClick:i=>{var e;if(!c.isDisabled){const l=!h;b?g(!b):m(l),null===(e=c.onValueChange)||void 0===e||e.call(c,l,c.value,i)}},onMouseEnter:()=>x(!c.skipHoverState),onMouseLeave:()=>x(!1),onMouseDown:()=>C(!c.skipHoverState),onMouseUp:()=>C(!1)},{children:[e(t,Object.assign({checked:h,hovered:w,clicked:S,isDisabled:p,size:c.size},{children:h&&e(d,{isPartial:b||!1,isDisabled:p,isSmall:"SMALL"===c.size})})),c.label&&"SMALL"!==c.size&&e(r,Object.assign({color:c.isDisabled?n.text.disabled:n.text.primary},{children:c.label})),c.label&&"SMALL"===c.size&&e(o,Object.assign({color:c.isDisabled?n.text.disabled:n.text.primary},{children:c.label}))]}))};export{c as CheckBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,Fragment as n,jsxs as s}from"react/jsx-runtime";import{RootContainer as e,CentralContainer as t,CloseButtonContainer as i}from"./modal.styled.js";import{COLORS as r}from"../../constants/Theme.js";import l from"../../assets/icons/cross.svg.js";const c=c=>{var d;return o(n,{children:c.open&&o(e,Object.assign({zIndex:c.zIndex
|
|
1
|
+
import{jsx as o,Fragment as n,jsxs as s}from"react/jsx-runtime";import{RootContainer as e,CentralContainer as t,CloseButtonContainer as i}from"./modal.styled.js";import{COLORS as r}from"../../constants/Theme.js";import l from"../../assets/icons/cross.svg.js";const c=c=>{var d;return o(n,{children:c.open&&o(e,Object.assign({zIndex:c.zIndex,onClick:o=>{c.closeOnOutsideClick&&c.onClose?c.onClose():o.stopPropagation()}},{children:o(t,Object.assign({style:Object.assign({},null!==(d=c.centralContainerStyles)&&void 0!==d?d:{}),onClick:o=>{o.stopPropagation()},width:c.width},{children:s(n,{children:[!(null==c?void 0:c.hideCrossButton)&&o(i,Object.assign({onClick:()=>c.onClose&&c.onClose()},{children:o(l,{height:20,width:20,color:r.content.secondary})})),c.children]})}))}))})};export{c as Modal};
|
|
@@ -3,7 +3,7 @@ export declare const RootContainer: import("@emotion/styled").StyledComponent<{
|
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
} & {
|
|
6
|
-
zIndex
|
|
6
|
+
zIndex?: number | undefined;
|
|
7
7
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
8
|
export declare const CentralContainer: import("@emotion/styled").StyledComponent<{
|
|
9
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import c from"@emotion/styled/base";import{COLORS as b}from"../../constants/Theme.js";const
|
|
1
|
+
import c from"@emotion/styled/base";import{COLORS as b}from"../../constants/Theme.js";import{ComponentZindex as l}from"../../constants/zindex.js";const X=c("div","production"===process.env.NODE_ENV?{target:"en6feff2"}:{target:"en6feff2",label:"RootContainer"})("position:fixed;top:0;left:0;z-index:",(c=>c.zIndex||l.MODAL),";height:100%;width:100%;background-color:rgba(0, 0, 0, 0.6);display:flex;align-items:center;justify-content:center;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1vZGFsLnN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR3dDIiwiZmlsZSI6Im1vZGFsLnN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuaW1wb3J0IHsgQ29tcG9uZW50WmluZGV4IH0gZnJvbSBcIi4uLy4uL2NvbnN0YW50cy96aW5kZXhcIjtcclxuZXhwb3J0IGNvbnN0IFJvb3RDb250YWluZXIgPSBzdHlsZWQuZGl2IGBcblx0cG9zaXRpb246IGZpeGVkO1xuXHR0b3A6IDA7XG5cdGxlZnQ6IDA7XG5cdHotaW5kZXg6ICR7KHByb3BzKSA9PiBwcm9wcy56SW5kZXggfHwgQ29tcG9uZW50WmluZGV4L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bmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPW1vZGFsLnN0eWxlZC5qcy5tYXAiXX0= */")),G=c("div","production"===process.env.NODE_ENV?{target:"en6feff1"}:{target:"en6feff1",label:"CentralContainer"})("width:",(c=>{var b;return null!==(b=c.width)&&void 0!==b?b:"640px"}),";background-color:",b.surface.standard,";border-radius:4px;position:relative;display:flex;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1vZGFsLnN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZTJDIiwiZmlsZSI6Im1vZGFsLnN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuaW1wb3J0IHsgQ29tcG9uZW50WmluZGV4IH0gZnJvbSBcIi4uLy4uL2NvbnN0YW50cy96aW5kZXhcIjtcclxuZXhwb3J0IGNvbnN0IFJvb3RDb250YWluZXIgPSBzdHlsZWQuZGl2IGBcblx0cG9zaXRpb246IGZpeGVkO1xuXHR0b3A6IDA7XG5cdGxlZnQ6IDA7XG5cdHotaW5kZXg6ICR7KHByb3BzKSA9PiBwcm9wcy56SW5kZXggfHwgQ29tcG9uZW50WmluZGV4Lk1PREFMfTtcblx0aGVpZ2h0OiAxMDAlO1xuXHR3aWR0aDogMTAwJTtcblx0YmFja2dyb3VuZC1jb2xvcjogcmdiYSgwLCAwLCAwLCAwLjYpO1xuXHRkaXNwbGF5OiBmbGV4O1xuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbmA7XHJcbmV4cG9ydCBjb25zdCBDZW50cmFsQ29udGFpbmVyID0gc3R5bGVkLmRpdiBgXG5cdHdpZHRoOiAkeyhwcm9wcykgPT4geyB2YXIgX2E7IHJldHVybiAoX2EgPSBwcm9wcy53aWR0aCkgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogJzY0MHB4JzsgfX07XG5cdGJhY2tncm91bmQtY29sb3I6ICR7Q09MT1JTLnN1cmZhY2Uuc3RhbmRhcmR9O1xuXHRib3JkZXItcmFkaXVzOiA0cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcblx0ZGlzcGxheTogZmxleDtcbmA7XHJcbmV4cG9ydCBjb25zdCBDbG9zZUJ1dHRvbkNvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRoZWlnaHQ6IDM2cHg7XG5cdHdpZHRoOiAzNnB4O1xuXHRib3JkZXItcmFkaXVzOiA1MCU7XG5cdHBvc2l0aW9uOiBhYnNvbHV0ZTtcblx0cmlnaHQ6IDA7XG5cdHRvcDogMDtcblx0dHJhbnNsYXRlOiA1MCUgLTUwJTtcblx0ZGlzcGxheTogZmxleDtcblx0YWxpZ24taXRlbXM6IGNlbnRlcjtcblx0anVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG5cdGJhY2tncm91bmQtY29sb3I6ICR7Q09MT1JTLnN1cmZhY2Uuc3RhbmRhcmR9O1xuXHRib3JkZXI6IDFweCBzb2xpZCAke0NPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGN1cnNvcjogcG9pbnRlcjtcblx0ei1pbmRleDogMjtcbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPW1vZGFsLnN0eWxlZC5qcy5tYXAiXX0= */")),t=c("div","production"===process.env.NODE_ENV?{target:"en6feff0"}:{target:"en6feff0",label:"CloseButtonContainer"})("height:36px;width:36px;border-radius:50%;position:absolute;right:0;top:0;translate:50% -50%;display:flex;align-items:center;justify-content:center;background-color:",b.surface.standard,";border:1px solid ",b.stroke.primary,";cursor:pointer;z-index:2;"+("production"===process.env.NODE_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Gl1czogNHB4O1xuXHRwb3NpdGlvbjogcmVsYXRpdmU7XG5cdGRpc3BsYXk6IGZsZXg7XG5gO1xyXG5leHBvcnQgY29uc3QgQ2xvc2VCdXR0b25Db250YWluZXIgPSBzdHlsZWQuZGl2IGBcblx0aGVpZ2h0OiAzNnB4O1xuXHR3aWR0aDogMzZweDtcblx0Ym9yZGVyLXJhZGl1czogNTAlO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHJpZ2h0OiAwO1xuXHR0b3A6IDA7XG5cdHRyYW5zbGF0ZTogNTAlIC01MCU7XG5cdGRpc3BsYXk6IGZsZXg7XG5cdGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5cdGp1c3RpZnktY29udGVudDogY2VudGVyO1xuXHRiYWNrZ3JvdW5kLWNvbG9yOiAke0NPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAxcHggc29saWQgJHtDT0xPUlMuc3Ryb2tlLnByaW1hcnl9O1xuXHRjdXJzb3I6IHBvaW50ZXI7XG5cdHotaW5kZXg6IDI7XG5gO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1tb2RhbC5zdHlsZWQuanMubWFwIl19 */"));export{G as CentralContainer,t as CloseButtonContainer,X as RootContainer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Collection, CollectionFetcherReturn, SelectedItems } from '.';
|
|
3
3
|
import { CollectionsActions, SelectedCollectionsActions } from './reducers';
|
|
4
4
|
export declare const truncate: (str: string, n: number, useWordBoundary: boolean) => string;
|
|
@@ -20,6 +20,7 @@ interface CollectionsScreenInterface {
|
|
|
20
20
|
curPage: number;
|
|
21
21
|
setCurPage: React.Dispatch<React.SetStateAction<number>>;
|
|
22
22
|
};
|
|
23
|
+
hideCollectionCheckbox?: boolean;
|
|
23
24
|
}
|
|
24
25
|
export declare const CollectionsScreen: (props: CollectionsScreenInterface) => JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/chevronRight.svg.js";import{useRef as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/chevronRight.svg.js";import{useRef as c,useState as s,useEffect as r}from"react";import{CheckBox as n}from"../checkBox/CheckBox.js";import{IconButton as l}from"../icon-button/IconButton.js";import{BikShimmer as d}from"../shimmer/ShimmerComponent/BikShimmer.js";import{Tag as a}from"../tag/Tag.js";import{TitleRegular as h}from"../TypographyStyle.js";import{EmptyState as u}from"./emptyState.js";import{CollectionCardStyle as m,CollectionCardInfoStyle as p,CollectionCardDetailStyle as C,CollectionNameHolder as g}from"./style.js";const v=(e,t,o)=>{if(e.length<=t)return e;const i=e.slice(0,t-1);return(o?i.slice(0,i.lastIndexOf(" ")):i)+"..."},b=o=>{const{customCollectionRestriction:i,dataLoading:n,collections:l,selectedCollectionsDispatch:a,setCollectionId:h,selectedCollections:m,setScreen:p,collectionFetcher:C,collectionsDispatch:g,pagingControls:v,storeId:b,setSaveDisabled:f,hideCollectionCheckbox:k}=o,j=c(null),x=c(v.curPage),O=!!i&&(null==m?void 0:m.isCustom),[E,S]=s(!1);r((()=>{x.current=v.curPage}),[v.curPage]),r((()=>{const e=new IntersectionObserver((e=>{e[0].isIntersecting&&x.current>0&&(f(!0),S(!0),C(x.current,b).then((e=>{g({type:"paged",data:(null==e?void 0:e.collections)||{}}),v.setCurPage(x.current+1),S(!1),f(!1)})).catch())}),{threshold:1});return j.current&&e.observe(j.current),()=>{j.current&&e.unobserve(j.current)}}),[j]);const D=e=>{var t,o;let i=0,c=0;if(m[e]){const s=null===(t=l[e])||void 0===t?void 0:t.products;s&&Object.keys(s).forEach((e=>{var t;const o=null===(t=s[e])||void 0===t?void 0:t.variants;o&&Object.keys(o).forEach((e=>i+=1))}));const r=null===(o=m[e])||void 0===o?void 0:o.products;return r&&Object.keys(r).forEach((e=>{var t;const o=null===(t=r[e])||void 0===t?void 0:t.variants;o&&Object.keys(o).forEach((e=>c+=1))})),!(i<=0&&c>0)&&(c>0&&i!==c)}return!1};return e("div",{children:[Object.keys(l).length?Object.keys(l).map((e=>t(y,{customCollectionRestriction:i,data:l[e],isDisabled:O&&!(null==m?void 0:m[e]),isChecked:!!(null==m?void 0:m[e]),isPartiallyChecked:D(e),selectedCollectionsDispatch:a,setCollectionId:h,setScreen:p,id:e,hideCollectionCheckbox:k},e))):n?[1,2,3,4,5,6,7,8,9,10].map(((e,o)=>t("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:t(d,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),o))):t(u,{title:"No collections to show",subtitle:"We couldn’t find any collection."}),t("div",{ref:j}),E&&[1,2,3,4,5].map(((e,o)=>t("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:t(d,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),o)))]})},y=c=>{const{customCollectionRestriction:s,data:r,selectedCollectionsDispatch:d,setCollectionId:u,isPartiallyChecked:b,setScreen:y,id:f,isChecked:k,isDisabled:j,hideCollectionCheckbox:x}=c;return e(m,Object.assign({isDisabled:j,onClick:()=>{j||(u(f),y("products"))}},{children:[e(p,{children:[!x&&t(n,{isDisabled:j,isChecked:k,isPartiallyChecked:b,onValueChange:function(e,t,o){null==o||o.stopPropagation(),d(e?{type:"selected",data:{id:f,val:r,isRestricted:s}}:{type:"unselected",data:{id:f}}),u(e?f:"")}}),t(C,{children:e(g,{children:[t(h,{children:v(r.name,40,!0)}),r.isSmartCollection?t(a,{tagText:"Smart Collection",type:"warning"}):t(o,{})]})})]}),t(l,{height:12,width:12,disabled:j,Icon:i})]}))};export{b as CollectionsScreen,v as truncate};
|
|
@@ -49,5 +49,7 @@ export interface ProductPickerInterface {
|
|
|
49
49
|
visible: boolean;
|
|
50
50
|
zIndex?: number;
|
|
51
51
|
limit?: number;
|
|
52
|
+
hideCollectionCheckbox?: boolean;
|
|
53
|
+
hideProductCheckbox?: boolean;
|
|
52
54
|
}
|
|
53
55
|
export declare const ProductPickerModal: (props: ProductPickerInterface) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useEffect as l}from"react";import{COLORS as i}from"../../constants/Theme.js";import{Button as n}from"../button/Button.js";import{Input as d}from"../input/Input.js";import{StyledModal as a}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as p}from"../tag/Tag.js";import{CollectionsScreen as u}from"./collectionScreen.js";import{ProductsScreen as m}from"./productScreen.js";import{collectionsReducer as C,selectedColectionsReducer as v,CollectionIdContext as b}from"./reducers.js";import{SearchScreen as g}from"./searchScreen.js";import{SelectedScreen as y}from"./selectedScreen.js";import{ContainerStyle as f,ScrollContainerStyle as j}from"./style.js";const S=S=>{const{storeId:x,selectedItems:I,onClose:P,visible:k,zIndex:T,limit:F,hideCollectionCheckbox:D,hideProductCheckbox:E}=S,[O,R]=r(C,{}),[w,B]=s("collections"),[z,G]=s(""),[L,$]=s(0),[A,H]=s(!1),[M,Y]=s(0),[q,J]=s(""),[K,N]=s(!1),[Q,U]=s(!1),[V,W]=s(),[X,Z]=r(v,Object.keys(I).length>0?I:{});l((()=>{H(!0),U(!0),S.collectionFetcher(L,x).then((e=>{R({type:"fetched",data:(null==e?void 0:e.collections)||{}}),H(!1),$((e=>e+1)),U(!1)})).catch()}),[]),l((()=>{let e=0;Object.keys(X||[]).forEach((t=>{var o;Object.keys((null===(o=X[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=X[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),Y(e)})),l((()=>{var e;z&&!(null===(e=null==O?void 0:O[z])||void 0===e?void 0:e.products)&&(H(!0),S.productFetcher(z,x).then((e=>{Object.keys(e).length&&R({type:"productsFetched",data:{collectionId:z,products:e}}),H(!1)})).catch())}),[z]),l((()=>{const e=setTimeout((()=>{q.length&&(N(!0),S.searchFetcher(x,q).then((e=>{W(e),B("searchProducts"),H(!1),N(!1)})))}),800);return()=>clearTimeout(e)}),[q]);const _=()=>{Z({type:"reset",data:{}})};return e(a,Object.assign({zIndex:T,open:k,onClose:()=>{P(),_()},headingTitle:"collections"===w||"products"===w?"Select Products":"view"===w?"Selected Products":"searchProducts"===w?"Searched Products":void 0,footerShadow:!0,centralContainerStyles:{width:"480px"},primaryButton:{buttonText:A?"Loading...":"Add",disabled:A||M<1||F&&M>F||!1,onClick:()=>{S.onAdd(X,M),_()}},footerLeftCustomElement:F&&M>F?e(p,{tagText:`You can only select ${F} products`,type:"negative"}):e(n,M>0?{onClick:()=>{B("view")},buttonText:`${M} products selected`,buttonType:"tertiaryGray"}:{disabled:!0,buttonText:`${M} products selected`,buttonType:"tertiaryGray"})},{children:t(f,{children:[!S.hideGlobalSearch&&e(o,{children:("collections"===w||"searchProducts"===w)&&e("div",Object.assign({style:{padding:"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:e(d,{noErrorHint:!0,rightIcon:{icon:()=>K?e(h,{size:"small",color:i.content.primary}):e(c,{})},id:"listInput",height:"24px",type:"text",value:q,onChangeText:e=>{e.length&&e.trim().length&&J(e)},placeholder:"Search products..."})}))}),t(j,{children:["collections"===w&&e(u,{customCollectionRestriction:S.customCollectionRestriction,dataLoading:Q,collections:O,selectedCollectionsDispatch:Z,setCollectionId:G,setScreen:B,selectedCollections:X,collectionFetcher:S.collectionFetcher,storeId:x,collectionsDispatch:R,setSaveDisabled:H,pagingControls:{curPage:L,setCurPage:$},hideCollectionCheckbox:D}),"products"===w&&z&&e(b.Provider,Object.assign({value:z},{children:e(m,{hideInCollectionSearch:S.hideInCollectionSearch,customCollectionRestriction:S.customCollectionRestriction,productFetcher:S.productFetcher,setScreen:B,storeId:x,data:O[z],collectionsDispatch:R,selectedCollectionsDispatch:Z,selectedData:X,setSaveDisabled:H,searchInCollectionFetcher:S.searchInCollectionFetcher,hideProductCheckbox:E})})),"view"===w&&e(y,{selectedCollections:X||{},selectedCollectionsDispatch:Z,setScreen:B,collections:O}),"searchProducts"===w&&e(g,{customCollectionRestriction:S.customCollectionRestriction,selectedCollections:X||{},searchedCollections:V||{},selectedCollectionsDispatch:Z,setScreen:B,collections:O,onBackPress:()=>{J(""),W({})}})]})]})}))};export{S as ProductPickerModal};
|
|
@@ -13,6 +13,7 @@ interface ProductsScreenInterface {
|
|
|
13
13
|
storeId: string;
|
|
14
14
|
setScreen: React.Dispatch<React.SetStateAction<string>>;
|
|
15
15
|
setSaveDisabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
16
|
+
hideProductCheckbox?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export declare const ProductsScreen: (props: ProductsScreenInterface) => JSX.Element;
|
|
18
19
|
interface ProductGroupInterface {
|
|
@@ -24,6 +25,7 @@ interface ProductGroupInterface {
|
|
|
24
25
|
viewOnly: boolean;
|
|
25
26
|
isProductPartiallyChecked?: boolean;
|
|
26
27
|
upliftAdditions: any;
|
|
28
|
+
hideProductCheckbox?: boolean;
|
|
27
29
|
}
|
|
28
30
|
export declare const ProductGroup: (props: ProductGroupInterface) => JSX.Element;
|
|
29
31
|
interface ProductCardInterface {
|
|
@@ -37,6 +39,7 @@ interface ProductCardInterface {
|
|
|
37
39
|
viewOnly: boolean;
|
|
38
40
|
isPartiallyChecked?: boolean;
|
|
39
41
|
upliftAdditions: any;
|
|
42
|
+
hideProductCheckbox?: boolean;
|
|
40
43
|
}
|
|
41
44
|
export declare const ProductCard: (props: ProductCardInterface) => JSX.Element;
|
|
42
45
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import
|
|
1
|
+
import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import d from"../../assets/icons/box.svg.js";import c from"../../assets/icons/search.svg.js";import{cloneDeep as l}from"lodash";import{useContext as r,useState as n,useEffect as s}from"react";import{COLORS as a}from"../../constants/Theme.js";import{CheckBox as u}from"../checkBox/CheckBox.js";import{IconButton as h}from"../icon-button/IconButton.js";import{Input as p}from"../input/Input.js";import{BikShimmer as v}from"../shimmer/ShimmerComponent/BikShimmer.js";import{ShimmerImage as m}from"../shimmer-image/ShimmerImage.js";import{Spinner as y}from"../spinner/Spinner.js";import{BodyCaption as f,TitleRegular as g}from"../TypographyStyle.js";import{truncate as j}from"./collectionScreen.js";import{EmptyState as b}from"./emptyState.js";import{CollectionIdContext as I}from"./reducers.js";import{ProductScreenHeader as k,ProductScreenCollectionCardStyle as C,ProductCardStyle as O}from"./style.js";import{liftTheStateUp as x}from"./utility.js";const S=o=>{const m=r(I),{data:j,collectionsDispatch:O,selectedData:S,selectedCollectionsDispatch:E,productFetcher:w,storeId:D,setScreen:A,setSaveDisabled:B,hideInCollectionSearch:T,customCollectionRestriction:V,hideProductCheckbox:F}=o,[R,U]=n(""),[W,z]=n(!1),[H,N]=n(j);s((()=>{const t=setTimeout((()=>{R.length?(z(!0),o.searchInCollectionFetcher(D,m,R).then((t=>{var e;const o=l(j);o.products={};for(const i of t)(null===(e=null==j?void 0:j.products)||void 0===e?void 0:e[i])&&(o.products[i]=j.products[i]);N(o),B(!1),z(!1)}))):N(j)}),800);return()=>clearTimeout(t)}),[R]);const _=!!V&&j.isSmartCollection,q=t=>{var e,o,i,d,c,l,r,n;let s=0,a=0;return!!((null===(o=null===(e=null==S?void 0:S[m])||void 0===e?void 0:e.products)||void 0===o?void 0:o[t])&&(null===(c=Object.keys((null===(d=null===(i=null==j?void 0:j.products)||void 0===i?void 0:i[t])||void 0===d?void 0:d.variants)||[]))||void 0===c||c.forEach((()=>a++)),Object.keys((null===(n=null===(r=null===(l=null==S?void 0:S[m])||void 0===l?void 0:l.products)||void 0===r?void 0:r[t])||void 0===n?void 0:n.variants)||[]).forEach((()=>s++)),s>0&&a!==s))};s((()=>{(null==j?void 0:j.products)||G()}),[]);const G=()=>{B(!0),z(!0),w(m,D).then((t=>{Object.keys(t).length&&(O({type:"productsFetched",data:{collectionId:m,products:t}}),N(Object.assign(Object.assign({},H),{products:t}))),B(!1),z(!1)})).catch()},J=(t,e)=>{const o=x(e,j);E({type:t,data:Object.assign(Object.assign({},o),{isRestricted:V})})};return t("div",{children:[t(k,{children:[e(h,{Icon:i,height:16,onClick:()=>{A("collections")}}),e(f,Object.assign({style:{color:a.content.secondary}},{children:j.name}))]}),!T&&e("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e(p,{noErrorHint:!0,rightIcon:{icon:()=>W&&R.length?e(y,{size:"small",color:a.content.primary}):e(c,{})},id:"listInput",height:"24px",type:"text",value:R,onChangeText:t=>{t.length&&t.trim().length&&U(t)},placeholder:"Search products in this collection..."})})),t("div",{children:[Object.keys((null==H?void 0:H.products)||[]).length>0&&!_&&!R.length&&!F&&t(C,{children:[e(u,{isChecked:!!(null==S?void 0:S[m]),isPartiallyChecked:(t=>{var e;let o=0,i=0;if(S[t]){const d=null==j?void 0:j.products;d&&Object.keys(d).forEach((t=>{var e;const i=null===(e=d[t])||void 0===e?void 0:e.variants;i&&Object.keys(i).forEach((t=>o+=1))}));const c=null===(e=S[t])||void 0===e?void 0:e.products;return c&&Object.keys(c).forEach((t=>{var e;const o=null===(e=c[t])||void 0===e?void 0:e.variants;o&&Object.keys(o).forEach((()=>i+=1))})),i>0&&o!==i}return!1})(m),onValueChange:function(t){E(t?{type:"selected",data:{id:m,val:j}}:{type:"unselected",data:{id:m}})}}),e("div",Object.assign({style:{width:40,height:40}},{children:e(d,{})})),e(g,{children:"All Products"})]}),Object.keys((null==H?void 0:H.products)||[]).length?Object.keys(H.products||[]).map((t=>e(P,{collectionId:m,isProductPartiallyChecked:q(t),productId:t,data:H.products[t],selectedData:S,selectedCollectionsDispatch:E,viewOnly:!!_,upliftAdditions:J,hideProductCheckbox:F},t))):W?[1,2,3,4,5,6,7,8,9,10].map(((t,o)=>e("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:e(v,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),o))):e(b,{title:"No products to show",subtitle:R.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})]})]})},P=o=>{const{collectionId:i,productId:d,data:c,selectedData:l,selectedCollectionsDispatch:r,viewOnly:n,upliftAdditions:s,isProductPartiallyChecked:a,hideProductCheckbox:u}=o,h=t=>{var e,o,c,r,n,s;if(!(null===(o=null===(e=null==l?void 0:l[i])||void 0===e?void 0:e.products)||void 0===o?void 0:o[d]))return!1;return!!(null===(s=null===(n=null===(r=null===(c=null==l?void 0:l[i])||void 0===c?void 0:c.products)||void 0===r?void 0:r[d])||void 0===n?void 0:n.variants)||void 0===s?void 0:s[t])};return t("div",{children:[e(E,{isVariant:!1,data:c,productId:d,collectionId:i,isSelected:!!(null===(v=null===(p=null==l?void 0:l[i])||void 0===p?void 0:p.products)||void 0===v?void 0:v[d]),isPartiallyChecked:a,selectedCollectionsDispatch:r,upliftAdditions:s,viewOnly:n,hideProductCheckbox:u},d),Object.keys(c.variants||[]).map((t=>e(E,{isVariant:!0,data:c.variants[t],variantId:t,productId:d,viewOnly:n,upliftAdditions:s,collectionId:i,isSelected:h(t),selectedCollectionsDispatch:r},t)))]});var p,v},E=i=>{const{isVariant:d,data:c,productId:l,collectionId:r,variantId:n,isSelected:s,selectedCollectionsDispatch:a,viewOnly:h,upliftAdditions:p,isPartiallyChecked:v,hideProductCheckbox:y}=i;return t(O,Object.assign({isVariant:d},{children:[y||h?e(o,{}):e(u,{isChecked:s,isPartiallyChecked:v||!1,onValueChange:function(t){d?t?p("variantSelected",{productId:l,variantId:n,collectionId:r,variant:c}):a({type:"variantUnselected",data:{productId:l,variantId:n,collectionId:r}}):t?p("productSelected",{productId:l,collectionId:r,product:c}):a({type:"productUnselected",data:{productId:l,collectionId:r}})}}),e("div",{children:e(m,{width:40,height:40,imageUrl:c.image,alt:"Item",borderRadius:4})}),e(g,{children:j(c.name,40,!0)})]}))};export{E as ProductCard,P as ProductGroup,S as ProductsScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,jsxs as t,Fragment as e}from"react/jsx-runtime";import r from"react-dom";import
|
|
1
|
+
import{jsx as o,jsxs as t,Fragment as e}from"react/jsx-runtime";import r from"react-dom";import n from"../../assets/icons/cross.svg.js";import{Button as i}from"../button/Button.js";import{TitleMedium as s}from"../TypographyStyle.js";import{SideModalStyle as c,SideModalContainer as m,SideModalHeader as d,SideModalBody as a,SideModalFooter as l,FooterButtonWrapper as h}from"./SideModal.style.js";const p=p=>r.createPortal(o(c,Object.assign({zIndex:p.zIndex},{children:t(m,{children:[t(d,{children:[o(s,{children:p.header}),!p.hideCrossButton&&o(n,{width:24,height:24,onClick:p.onClose})]}),o(a,{children:p.children}),t(l,Object.assign({footerDirection:p.footerDirection},{children:[t(h,Object.assign({footerDirection:p.footerDirection},{children:[o(i,Object.assign({},p.saveButtonProps)),o(i,Object.assign({},p.cancelButtonProps))]})),p.footerCustomComponent?p.footerCustomComponent:o(e,{})]}))]})})),document.body);export{p as SideModal};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const SideModalStyle: import("styled-components").StyledComponent<"div", any, {
|
|
1
|
+
export declare const SideModalStyle: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
zIndex?: number | undefined;
|
|
3
|
+
}, never>;
|
|
2
4
|
export declare const SideModalContainer: import("styled-components").StyledComponent<"div", any, {
|
|
3
5
|
width?: string | undefined;
|
|
4
6
|
}, never>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"styled-components";import{COLORS as i}from"../../constants/Theme.js";import{ComponentZindex as e}from"../../constants/zindex.js";const o=t.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
5
|
-
z-index:
|
|
5
|
+
z-index: ${t=>t.zIndex||e.SIDE_MODAL};
|
|
6
6
|
height: 100%;
|
|
7
7
|
width: 100%;
|
|
8
8
|
background-color: rgba(0, 0, 0, 0.4);
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: flex-end;
|
|
12
|
-
`,
|
|
12
|
+
`,r=t.div`
|
|
13
13
|
height: 100%;
|
|
14
|
-
width: ${
|
|
15
|
-
background: ${
|
|
14
|
+
width: ${t=>t.width||"566px"};
|
|
15
|
+
background: ${i.surface.standard};
|
|
16
16
|
position: relative;
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
|
-
`,
|
|
19
|
+
`,n=t.div`
|
|
20
20
|
width: 100%;
|
|
21
21
|
height: 60px;
|
|
22
22
|
position: sticky;
|
|
@@ -25,30 +25,30 @@ import i from"styled-components";import{COLORS as t}from"../../constants/Theme.j
|
|
|
25
25
|
flex-direction: row;
|
|
26
26
|
align-items: center;
|
|
27
27
|
justify-content: space-between;
|
|
28
|
-
background: ${
|
|
28
|
+
background: ${i.surface.standard};
|
|
29
29
|
padding: 0px 24px;
|
|
30
|
-
border-bottom: 1px solid ${
|
|
30
|
+
border-bottom: 1px solid ${i.stroke.primary};
|
|
31
31
|
svg:hover {
|
|
32
32
|
cursor: pointer;
|
|
33
33
|
}
|
|
34
|
-
`,d=
|
|
34
|
+
`,d=t.div`
|
|
35
35
|
overflow-y: auto;
|
|
36
36
|
padding: 24px;
|
|
37
37
|
height: calc(100% - 120px);
|
|
38
|
-
`,
|
|
38
|
+
`,s=t.div`
|
|
39
39
|
height: 60px;
|
|
40
40
|
width: 100%;
|
|
41
41
|
position: sticky;
|
|
42
42
|
bottom: 0;
|
|
43
43
|
display: flex;
|
|
44
|
-
flex-direction: ${
|
|
44
|
+
flex-direction: ${t=>t.footerDirection||"row"};
|
|
45
45
|
justify-content: space-between;
|
|
46
46
|
align-items: center;
|
|
47
|
-
background: ${
|
|
48
|
-
border-top: 1px solid ${
|
|
47
|
+
background: ${i.surface.standard};
|
|
48
|
+
border-top: 1px solid ${i.stroke.primary};
|
|
49
49
|
padding: 0px 24px;
|
|
50
|
-
`,p=
|
|
50
|
+
`,p=t.div`
|
|
51
51
|
display: flex;
|
|
52
|
-
flex-direction: ${
|
|
52
|
+
flex-direction: ${t=>t.footerDirection||"row"};
|
|
53
53
|
gap: 8px;
|
|
54
|
-
`;export{p as FooterButtonWrapper,d as SideModalBody,
|
|
54
|
+
`;export{p as FooterButtonWrapper,d as SideModalBody,r as SideModalContainer,s as SideModalFooter,n as SideModalHeader,o as SideModalStyle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import{ComponentZindex as o}from"../../constants/zindex.js";import s from"../../assets/icons/errorIcon.svg.js";import e from"../../assets/icons/successIcon.svg.js";import i from"../../assets/icons/warningIcon.svg.js";import{StyledModal as r}from"../modals/styledModal.js";import{Spinner as c}from"../spinner/Spinner.js";import{StateInterface as a,StateComponent as l}from"../states/StateComponent.js";const d=d=>{const m=()=>p==a.SUCCESS?t(e,{}):p==a.WARNING?t(i,{}):p==a.ERROR?t(s,{}):p===a.LOADING?t(c,{size:"large"}):void 0,{states:p,heading:u,subline:f,icon:g=m(),isButtonEnabled:C,type:I,buttonText:j,onButtonClick:h,leadingIcon:O,width:b,zIndex:x}=d,[S,y]=n(!0);return t(r,Object.assign({open:S,onClose:function(){d.onClose&&d.onClose(),y(!1)},closeOnOutsideClick:!(p===a.LOADING),centralContainerStyles:{display:"flex",alignItems:"center",justifyContent:"center",width:b},hideCrossButton:p===a.LOADING,zIndex:x||o.STATE_MODAL},{children:t(l,Object.assign({states:p,heading:u,subline:f,isButtonEnabled:C,leadingIcon:O,type:I,buttonText:j,onButtonClick:h,icon:g,width:b||400},{children:d.children}))}))};export{d as StateModalComponent};
|
package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as o,Fragment as i,jsx as t}from"react/jsx-runtime";import
|
|
1
|
+
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as o,Fragment as i,jsx as t}from"react/jsx-runtime";import n,{useState as r}from"react";import{FileUploaderHelper as a}from"../../helpers/FileUploaderHelper.js";import{BikImageCropper as l}from"../../image-cropper/BikImageCropper.js";import"../../image-compress/ImageCompress.js";import"../../states/StateComponent.js";import"../../../constants/zindex.js";import"../../modals/styledModal.js";import"../../spinner/Spinner.js";import{HEADER_TYPES as s}from"../../template-preview/models/TemplateMeta.js";import p from"./EditMediaV2.js";const m=m=>{let{mediaComponent:c,template:d,updateTemplateImageUrl:f,whatsappSpecificPickerMeta:u}=m;var v,g;const[h,j]=r(void 0),[C,y]=r(),I=n.createRef(),[M,k]=r(!1),[w,A]=r("");function E(o){var i;return e(this,void 0,void 0,(function*(){const e=new a;if(o instanceof Blob){const t=e.validate(o);if(t)A(t),k(!1);else{const e=c.format===s.IMAGE,t=yield u.uploadMediaFiles({file:o,fileName:h,isImage:e});if(t.success){const[e]=o.type.split("/");f(null!==(i=t.url)&&void 0!==i?i:"","application"===e?s.DOCUMENT:s[e.toUpperCase()])}else A("An unknown technical error occured");k(!1)}}else A("An unknown technical error occured"),k(!1)}))}let U;return U=c.format===s.IMAGE?"image/png, image/jpeg":c.format===s.VIDEO?"video/mp4":"application/pdf",o(i,{children:[!!C&&t(l,{aspectRatio:15/8,src:C,onCropComplete:function(o){return e(this,void 0,void 0,(function*(){k(!1),A("");const e=yield fetch(o);E(yield e.blob()).then((()=>{y(void 0)}))}))},onCancel:()=>{k(!1),y("")}}),t("input",{ref:I,style:{display:"none"},type:"file",onChange:function(e){var o;A(""),k(!0);const i=null===(o=e.target.files)||void 0===o?void 0:o[0];if(c.format===s.IMAGE){const e=new FileReader;y(""),j(""),e.onload=()=>{y(e.result),j(null==i?void 0:i.name)},i&&e.readAsDataURL(i)}else E(i)},accept:U}),t(p,{imageName:null!==(g=null===(v=null==c?void 0:c.example)||void 0===v?void 0:v.header_handle)&&void 0!==g?g:[],handleImageChange:function(){var e;(null===(e=null==I?void 0:I.current)||void 0===e?void 0:e.click)&&I.current.click()},mediaType:null==c?void 0:c.format,error:w,isLoading:M})]})};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,Fragment as o,jsxs as e}from"react/jsx-runtime";import n from"../../assets/icons/cross.svg.js";import{useEffect as i}from"react";import{ToastContainer as
|
|
1
|
+
import{jsx as t,Fragment as o,jsxs as e}from"react/jsx-runtime";import n from"../../assets/icons/cross.svg.js";import{useEffect as i}from"react";import s from"react-dom";import{ToastContainer as r,toast as l}from"react-toastify";import{ToasterStyled as d}from"./Toaster.styled.js";import{BodyPrimary as a,ButtonRegular as c}from"../TypographyStyle.js";import{COLORS as u}from"../../constants/Theme.js";const p=o=>{const e="default"===o.type?u.content.secondary:u.content.secondaryInverse;return t("div",Object.assign({tabIndex:0,role:"button",style:{width:20,display:"flex",margin:"auto",cursor:"pointer"},onClick:o.closeToast,onKeyDown:t=>{"Enter"===t.key&&o.closeToast()}},{children:t(n,{height:20,width:20,color:e})}))},h=n=>{const i="default"===n.type?u.stroke.primary:"success"===n.type?u.background.positive.vibrant:"error"===n.type?u.background.negative.vibrant:"warning"===n.type?u.background.warning.vibrant:u.background.inverseLight;return t(o,{children:e("div",Object.assign({style:{display:"flex",flexGrow:1,borderRight:n.hideCloseButton?"unset":`1px solid ${i}`}},{children:[t("div",Object.assign({style:{flexGrow:1,marginRight:n.showButton?16:n.hideCloseButton?0:12}},{children:t(a,Object.assign({color:"inherit"},{children:n.toastText}))})),n.showButton&&t(c,Object.assign({style:{marginRight:n.hideCloseButton?0:12,marginTop:"auto",marginBottom:"auto",display:"flex",cursor:"pointer"},onClick:n.onButtonClick,color:"default"===n.type?u.content.brand:"inherit"},{children:n.buttonText}))]}))})},y=o=>(i((()=>{var e,n,i,s,r,d;void 0!==o.hideLeftIcon||o.leftIcon?l(t(h,{toastText:o.text,type:o.type||"info",buttonText:null===(e=o.buttonProps)||void 0===e?void 0:e.buttonText,showButton:null===(n=o.buttonProps)||void 0===n?void 0:n.showButton,onButtonClick:null===(i=o.buttonProps)||void 0===i?void 0:i.onButtonClick,hideCloseButton:o.hideCloseButton}),{onClose:o.onCloseToast?o.onCloseToast:()=>({}),icon:t=>!1!==o.hideLeftIcon&&(o.leftIcon?o.leftIcon:null),type:o.type,closeButton:!o.hideCloseButton&&t(p,{type:o.type||"default"})}):l(t(h,{toastText:o.text,type:o.type||"info",buttonText:null===(s=o.buttonProps)||void 0===s?void 0:s.buttonText,showButton:null===(r=o.buttonProps)||void 0===r?void 0:r.showButton,onButtonClick:null===(d=o.buttonProps)||void 0===d?void 0:d.onButtonClick,hideCloseButton:o.hideCloseButton}),{onClose:o.onCloseToast?o.onCloseToast:()=>({}),type:o.type,closeButton:!o.hideCloseButton&&t(p,{type:o.type||"info"})})}),[]),s.createPortal(t(d,Object.assign({width:o.width,height:o.height,zIndex:o.zIndex},{children:t(r,{position:o.position||"top-right",closeOnClick:o.closeOnClick||!1,hideProgressBar:o.hideProgressBar||!1,draggable:!1,autoClose:o.autoClose||!1,theme:"colored"})})),document.body));export{y as Toaster};
|
|
@@ -5,4 +5,5 @@ export declare const ToasterStyled: import("@emotion/styled").StyledComponent<{
|
|
|
5
5
|
} & {
|
|
6
6
|
width?: string | undefined;
|
|
7
7
|
height?: string | undefined;
|
|
8
|
+
zIndex?: number | undefined;
|
|
8
9
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@emotion/styled/base";import{COLORS as c}from"../../constants/Theme.js";const o=t("div","production"===process.env.NODE_ENV?{target:"e1tdeuzc0"}:{target:"e1tdeuzc0",label:"ToasterStyled"})("--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:",c.background.inverse,";--toastify-color-success:",c.content.positive,";--toastify-color-error:",c.content.negative,";--toastify-color-warning:",c.content.warning,";--toastify-text-color-light:",c.content.primary,';--toastify-toast-width:"fit-content";--toastify-toast-min-height:',(t=>t.height||"44px"),";--toastify-toast-max-height:",(t=>t.height||"fit-content"),";font-family:inherit;.custom-position{position:relative;}.Toastify__toast{padding:6px;max-width:",(t=>t.width),";.Toastify__close-button{display:block;margin:auto;}.Toastify__toast-body{padding:0 6px;}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--default{background:",c.content.brand,";}.Toastify__toast-body>div:last-child{display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
1
|
+
import t from"@emotion/styled/base";import{COLORS as c}from"../../constants/Theme.js";import{ComponentZindex as b}from"../../constants/zindex.js";const o=t("div","production"===process.env.NODE_ENV?{target:"e1tdeuzc0"}:{target:"e1tdeuzc0",label:"ToasterStyled"})("--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:",c.background.inverse,";--toastify-color-success:",c.content.positive,";--toastify-color-error:",c.content.negative,";--toastify-color-warning:",c.content.warning,";--toastify-text-color-light:",c.content.primary,';--toastify-toast-width:"fit-content";--toastify-toast-min-height:',(t=>t.height||"44px"),";--toastify-toast-max-height:",(t=>t.height||"fit-content"),";font-family:inherit;z-index:",(t=>t.zIndex||b.TOASTER),";.custom-position{position:relative;}.Toastify__toast{padding:6px;max-width:",(t=>t.width),";.Toastify__close-button{display:block;margin:auto;}.Toastify__toast-body{padding:0 6px;}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--default{background:",c.content.brand,";}.Toastify__toast-body>div:last-child{display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRvYXN0ZXIuc3R5bGVkLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHd0MiLCJmaWxlIjoiVG9hc3Rlci5zdHlsZWQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBDT0xPUlMgfSBmcm9tIFwiLi4vLi4vY29uc3RhbnRzL1RoZW1lXCI7XHJcbmltcG9ydCB7IENvbXBvbmVudFppbmRleCB9IGZyb20gXCIuLi8uLi9jb25zdGFudHMvemluZGV4XCI7XHJcbmV4cG9ydCBjb25zdCBUb2FzdGVyU3R5bGVkID0gc3R5bGVkLmRpdiBgXG5cblx0LS10b2FzdGlmeS1jb2xvci1saWdodDogI2ZmZjtcblx0LS10b2FzdGlmeS1jb2xvci1kYXJrOiAjMTIxMjEyO1xuXHQtLXRvYXN0aWZ5LWNvbG9yLWluZm86ICR7Q09MT1JTLmJhY2tncm91bmQuaW52ZXJzZX07XG5cdC0tdG9hc3RpZnktY29sb3Itc3VjY2VzczogJHtDT0xPUlMuY29udGVudC5wb3NpdGl2ZX07XG5cdC0tdG9hc3RpZnktY29sb3ItZXJyb3I6ICR7Q09MT1JTLmNvbnRlbnQubmVnYXRpdmV9O1xuXHQtLXRvYXN0aWZ5LWNvbG9yLXdhcm5pbmc6ICR7Q09MT1JTLmNvbnRlbnQud2FybmluZ307XG5cdC0tdG9hc3RpZnktdGV4dC1jb2xvci1saWdodDogJHtDT0xPUlMuY29udGVudC5wcmltYXJ5fTtcblx0LS10b2FzdGlmeS10b2FzdC13aWR0aDogXCJmaXQtY29udGVudFwiO1xuXHQtLXRvYXN0aWZ5LXRvYXN0LW1pbi1oZWln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,[A.MODAL]:11,[A.STYLED_MODAL]:11,[A.STATE_MODAL]:12,[A.FEATURE_MODAL]:12,[A.TOASTER]:13};export{D as ComponentZindex};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var A;!function(A){A.MODAL="MODAL",A.STYLED_MODAL="MODAL",A.SIDE_MODAL="SIDE_MODAL",A.FEATURE_MODAL="FEATURE_MODAL",A.STATE_MODAL="STATE_MODAL",A.TOASTER="TOASTER"}(A||(A={}));export{A as ComponentTypes};
|