@bikdotai/bik-component-library 0.0.754-beta.5 → 0.0.754-beta.6
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/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -1
- package/dist/cjs/components/feature-announcements/styles/minorPopup.styles.d.ts +0 -2
- package/dist/cjs/components/feature-announcements/styles/minorPopup.styles.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +1 -1
- package/dist/esm/components/feature-announcements/styles/minorPopup.styles.d.ts +0 -2
- package/dist/esm/components/feature-announcements/styles/minorPopup.styles.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./constants/index.js");require("../../constants/Theme.js"),require("./constants/animations.js");var n=require("./styles/minorPopup.styles.js"),s=require("./utils/htmlHelpers.js"),i=require("./utils/animationHelpers.js"),o=require("./utils/elementHelpers.js");exports.default=l=>{let{feature:a,currentIndex:c,totalFeatures:u,onSkip:d,onExplore:p,onPrevious:f,onNext:g,setIsClosing:y}=l;var j,v;const[h,T]=t.useState(!1),[x,m]=t.useState(!1),[b,E]=t.useState(""),O=t.useRef(null);t.useEffect((()=>{h&&m(!0)}),[h]);const q=n.getMinorPopupStyles(x,b);return e.jsxs("div",Object.assign({ref:O,style:q.container},{children:[e.jsx("div",Object.assign({style:q.imageContainer},{children:a.displayImage?e.jsx("div",Object.assign({style:q.imageWrapper},{children:e.jsx("img",{src:a.displayImage,alt:a.title,style:q.image,onError:e=>{a.image&&(e.target.src=a.image)}})})):e.jsx("div",Object.assign({style:q.imagePlaceholder},{children:r.TEXT.FEATURE_PREVIEW_PLACEHOLDER}))})),e.jsxs("div",Object.assign({style:q.contentContainer},{children:[e.jsxs("div",{children:[e.jsx("h3",Object.assign({style:q.title},{children:a.title})),e.jsx("div",{style:q.content,dangerouslySetInnerHTML:{__html:s.decodeHTMLEntities(a.content||a.body||"")}})]}),e.jsxs("div",Object.assign({style:q.actionsContainer},{children:[(null===(j=a.secondaryButton)||void 0===j?void 0:j.text)&&e.jsx("span",Object.assign({onClick:()=>{var e,t,r;const n=null===(e=a.secondaryButton)||void 0===e?void 0:e.action;if("Open link"===n){const e=null===(t=a.secondaryButton)||void 0===t?void 0:t.redirectionUrl;if(e){e.startsWith("http")?window.open(e,"_blank","noopener,noreferrer"):window.location.href=e}}else"Close popup"!==n&&""!==n||null===(r=a.secondaryButton)||void 0===r||r.action;if(i.hideJoyrideArrow(O.current),O.current&&a.featureTag){const e=o.findFeatureTagElement(a.featureTag);if(e){const t=i.calculateCloseTransform(O.current,e);E(t)}else E("scale(0)")}else E("scale(0)");null==y||y(!0),T(!0)},style:q.understoodText},{children:a.secondaryButton.text})),e.jsx("button",Object.assign({onClick:()=>{var e,t;const r=null===(e=a.primaryButton)||void 0===e?void 0:e.action;if("Play Video"===r)p();else if("Open link"===r){const e=(null===(t=a.primaryButton)||void 0===t?void 0:t.redirectionUrl)||a.redirectUrl;if(e){e.startsWith("http")?window.open(e,"_blank","noopener,noreferrer"):window.location.href=e}}else p();if(i.hideJoyrideArrow(O.current),O.current&&a.featureTag){const e=a.featureTag.startsWith("#")||a.featureTag.startsWith(".")||a.featureTag.startsWith("[")?a.featureTag:`#${a.featureTag}`,t=document.querySelector(e);if(t){const e=i.calculateCloseTransform(O.current,t);E(e)}else E("scale(0)")}else E("scale(0)");null==y||y(!0),T(!0)},style:q.exploreButton},{children:(null===(v=a.primaryButton)||void 0===v?void 0:v.text)||a.buttonText||r.TEXT.DEFAULT_BUTTON_TEXT}))]}))]}))]}))};
|
|
@@ -4,8 +4,6 @@ export declare const getMinorPopupStyles: (startAnimation: boolean, transform: s
|
|
|
4
4
|
imageContainer: CSSProperties;
|
|
5
5
|
imageWrapper: CSSProperties;
|
|
6
6
|
image: CSSProperties;
|
|
7
|
-
badge: CSSProperties;
|
|
8
|
-
badgeText: CSSProperties;
|
|
9
7
|
imagePlaceholder: CSSProperties;
|
|
10
8
|
contentContainer: CSSProperties;
|
|
11
9
|
title: CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../constants/Theme.js"),t=require("../constants/animations.js"),i=require("../constants/dimensions.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../constants/Theme.js"),t=require("../constants/animations.js"),i=require("../constants/dimensions.js");exports.getMinorPopupStyles=(n,o)=>({container:{width:`${i.POPUP_DIMENSIONS.MINOR.width}px`,height:`${i.POPUP_DIMENSIONS.MINOR.height}px`,display:"flex",backgroundColor:e.BASE_COLORS.grayscale.white,borderRadius:i.BORDER_RADIUS.POPUP,overflow:"hidden",position:"relative",boxShadow:"0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04)",transform:n?o:"scale(1)",opacity:n?0:1,transition:t.POPUP_TRANSITION},imageContainer:{backgroundColor:e.BASE_COLORS.grayscale[50],borderRadius:i.BORDER_RADIUS.IMAGE,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",margin:i.SPACING.MINOR.imageMargin,width:`${i.POPUP_DIMENSIONS.MINOR.imageWidth}px`,minWidth:`${i.POPUP_DIMENSIONS.MINOR.imageWidth}px`,maxWidth:`${i.POPUP_DIMENSIONS.MINOR.imageWidth}px`,height:`${i.POPUP_DIMENSIONS.MINOR.imageHeight}px`},imageWrapper:{position:"relative",width:`${i.POPUP_DIMENSIONS.MINOR.imageWidth}px`,height:`${i.POPUP_DIMENSIONS.MINOR.imageHeight}px`},image:{width:`${i.POPUP_DIMENSIONS.MINOR.imageWidth}px`,height:`${i.POPUP_DIMENSIONS.MINOR.imageHeight}px`,objectFit:"cover",borderRadius:i.BORDER_RADIUS.IMAGE,display:"block"},imagePlaceholder:{color:e.BASE_COLORS.grayscale[500],fontSize:"14px",textAlign:"center",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.BASE_COLORS.grayscale[100],borderRadius:i.BORDER_RADIUS.IMAGE},contentContainer:{flex:1,display:"flex",margin:i.SPACING.MINOR.contentMargin,flexDirection:"column",justifyContent:"space-between",background:"transparent"},title:{fontSize:"16px",fontWeight:"600",padding:"0 0 0 0",color:e.BASE_COLORS.grayscale[900],lineHeight:"1.25",textAlign:"left"},content:{fontSize:"12px",fontWeight:"400",lineHeight:"1.2",color:e.BASE_COLORS.grayscale[700],textAlign:"left",maxHeight:"48px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},actionsContainer:{position:"absolute",bottom:i.SPACING.MINOR.actionsBottom,right:i.SPACING.MINOR.actionsRight,display:"flex",gap:i.SPACING.MINOR.actionsGap,alignItems:"center"},understoodText:{color:e.BASE_COLORS.brand[800],fontSize:"14px",fontWeight:"500",cursor:"pointer",transition:"all 0.2s"},exploreButton:{backgroundColor:e.BASE_COLORS.brand[800],border:"none",color:e.BASE_COLORS.grayscale.white,borderRadius:i.BORDER_RADIUS.BUTTON,fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useRef as r,useEffect as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useRef as r,useEffect as o}from"react";import{TEXT as i}from"./constants/index.js";import"../../constants/Theme.js";import"./constants/animations.js";import{getMinorPopupStyles as s}from"./styles/minorPopup.styles.js";import{decodeHTMLEntities as l}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as a,calculateCloseTransform as c}from"./utils/animationHelpers.js";import{findFeatureTagElement as d}from"./utils/elementHelpers.js";const u=u=>{let{feature:m,currentIndex:p,totalFeatures:f,onSkip:g,onExplore:y,onPrevious:v,onNext:h,setIsClosing:T}=u;var j,b;const[O,x]=n(!1),[B,E]=n(!1),[w,C]=n(""),_=r(null);o((()=>{O&&E(!0)}),[O]);const k=s(B,w);return e("div",Object.assign({ref:_,style:k.container},{children:[t("div",Object.assign({style:k.imageContainer},{children:m.displayImage?t("div",Object.assign({style:k.imageWrapper},{children:t("img",{src:m.displayImage,alt:m.title,style:k.image,onError:e=>{m.image&&(e.target.src=m.image)}})})):t("div",Object.assign({style:k.imagePlaceholder},{children:i.FEATURE_PREVIEW_PLACEHOLDER}))})),e("div",Object.assign({style:k.contentContainer},{children:[e("div",{children:[t("h3",Object.assign({style:k.title},{children:m.title})),t("div",{style:k.content,dangerouslySetInnerHTML:{__html:l(m.content||m.body||"")}})]}),e("div",Object.assign({style:k.actionsContainer},{children:[(null===(j=m.secondaryButton)||void 0===j?void 0:j.text)&&t("span",Object.assign({onClick:()=>{var e,t,n;const r=null===(e=m.secondaryButton)||void 0===e?void 0:e.action;if("Open link"===r){const e=null===(t=m.secondaryButton)||void 0===t?void 0:t.redirectionUrl;if(e){e.startsWith("http")?window.open(e,"_blank","noopener,noreferrer"):window.location.href=e}}else"Close popup"!==r&&""!==r||null===(n=m.secondaryButton)||void 0===n||n.action;if(a(_.current),_.current&&m.featureTag){const e=d(m.featureTag);if(e){const t=c(_.current,e);C(t)}else C("scale(0)")}else C("scale(0)");null==T||T(!0),x(!0)},style:k.understoodText},{children:m.secondaryButton.text})),t("button",Object.assign({onClick:()=>{var e,t;const n=null===(e=m.primaryButton)||void 0===e?void 0:e.action;if("Play Video"===n)y();else if("Open link"===n){const e=(null===(t=m.primaryButton)||void 0===t?void 0:t.redirectionUrl)||m.redirectUrl;if(e){e.startsWith("http")?window.open(e,"_blank","noopener,noreferrer"):window.location.href=e}}else y();if(a(_.current),_.current&&m.featureTag){const e=m.featureTag.startsWith("#")||m.featureTag.startsWith(".")||m.featureTag.startsWith("[")?m.featureTag:`#${m.featureTag}`,t=document.querySelector(e);if(t){const e=c(_.current,t);C(e)}else C("scale(0)")}else C("scale(0)");null==T||T(!0),x(!0)},style:k.exploreButton},{children:(null===(b=m.primaryButton)||void 0===b?void 0:b.text)||m.buttonText||i.DEFAULT_BUTTON_TEXT}))]}))]}))]}))};export{u as default};
|
|
@@ -4,8 +4,6 @@ export declare const getMinorPopupStyles: (startAnimation: boolean, transform: s
|
|
|
4
4
|
imageContainer: CSSProperties;
|
|
5
5
|
imageWrapper: CSSProperties;
|
|
6
6
|
image: CSSProperties;
|
|
7
|
-
badge: CSSProperties;
|
|
8
|
-
badgeText: CSSProperties;
|
|
9
7
|
imagePlaceholder: CSSProperties;
|
|
10
8
|
contentContainer: CSSProperties;
|
|
11
9
|
title: CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BASE_COLORS as t}from"../../../constants/Theme.js";import{POPUP_TRANSITION as e}from"../constants/animations.js";import{POPUP_DIMENSIONS as i,BORDER_RADIUS as o,SPACING as n}from"../constants/dimensions.js";
|
|
1
|
+
import{BASE_COLORS as t}from"../../../constants/Theme.js";import{POPUP_TRANSITION as e}from"../constants/animations.js";import{POPUP_DIMENSIONS as i,BORDER_RADIUS as o,SPACING as n}from"../constants/dimensions.js";const a=(a,r)=>({container:{width:`${i.MINOR.width}px`,height:`${i.MINOR.height}px`,display:"flex",backgroundColor:t.grayscale.white,borderRadius:o.POPUP,overflow:"hidden",position:"relative",boxShadow:"0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04)",transform:a?r:"scale(1)",opacity:a?0:1,transition:e},imageContainer:{backgroundColor:t.grayscale[50],borderRadius:o.IMAGE,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",margin:n.MINOR.imageMargin,width:`${i.MINOR.imageWidth}px`,minWidth:`${i.MINOR.imageWidth}px`,maxWidth:`${i.MINOR.imageWidth}px`,height:`${i.MINOR.imageHeight}px`},imageWrapper:{position:"relative",width:`${i.MINOR.imageWidth}px`,height:`${i.MINOR.imageHeight}px`},image:{width:`${i.MINOR.imageWidth}px`,height:`${i.MINOR.imageHeight}px`,objectFit:"cover",borderRadius:o.IMAGE,display:"block"},imagePlaceholder:{color:t.grayscale[500],fontSize:"14px",textAlign:"center",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t.grayscale[100],borderRadius:o.IMAGE},contentContainer:{flex:1,display:"flex",margin:n.MINOR.contentMargin,flexDirection:"column",justifyContent:"space-between",background:"transparent"},title:{fontSize:"16px",fontWeight:"600",padding:"0 0 0 0",color:t.grayscale[900],lineHeight:"1.25",textAlign:"left"},content:{fontSize:"12px",fontWeight:"400",lineHeight:"1.2",color:t.grayscale[700],textAlign:"left",maxHeight:"48px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},actionsContainer:{position:"absolute",bottom:n.MINOR.actionsBottom,right:n.MINOR.actionsRight,display:"flex",gap:n.MINOR.actionsGap,alignItems:"center"},understoodText:{color:t.brand[800],fontSize:"14px",fontWeight:"500",cursor:"pointer",transition:"all 0.2s"},exploreButton:{backgroundColor:t.brand[800],border:"none",color:t.grayscale.white,borderRadius:o.BUTTON,fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"}});export{a as getMinorPopupStyles};
|