@lifesg/react-design-system 1.0.0-alpha.15 → 1.0.0-alpha.16

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/cjs/index.js CHANGED
@@ -2739,7 +2739,7 @@ function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof S
2739
2739
  width: 1.5rem;
2740
2740
  padding-right: 0.25rem;
2741
2741
  }
2742
- `,APP_ICON="https://assets.life.gov.sg/react-design-system/img/app-icon/app-icon.png",STAR_IMG="https://assets.life.gov.sg/react-design-system/img/star-rating/full-star.svg",HALF_STAR_IMG="https://assets.life.gov.sg/react-design-system/img/star-rating/half-star.svg",EMPTY_STAR_IMG="https://assets.life.gov.sg/react-design-system/img/star-rating/empty-star.svg",ID="smart-app-banner";function SmartAppBannerComponent(e,t){const{className:r,show:a,href:i,content:n,offset:s=0,icon:o=APP_ICON,animated:l=!1,onDismiss:d,onClick:h}=e,{title:c,message:p,buttonLabel:u,buttonAriaLabel:m,numberOfStars:f}=n,g=e=>{e.stopPropagation(),window.open(i,"_blank","noreferrer"),d(),h?.()};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:a&&jsxRuntime.jsxs(SmartAppBannerContainer,{ref:t,$isAnimated:l,$offset:s,className:r,children:[jsxRuntime.jsx(DismissContainer,{onClick:d,id:`${ID}-dismiss`,"data-testid":`${ID}-dismiss-container`,children:jsxRuntime.jsx(DismissButton,{"aria-label":"Dismiss",children:jsxRuntime.jsx(CrossIcon,{type:"cross"})})}),jsxRuntime.jsxs(ProceedContainer,{onClick:g,id:`${ID}-proceed`,"data-testid":`${ID}-proceed-container`,children:[jsxRuntime.jsx(BannerIcon,{src:o,alt:"lifesg-app-icon"}),jsxRuntime.jsxs(TextContainer,{children:[jsxRuntime.jsx(Title,{children:c}),jsxRuntime.jsx(Description,{children:p}),(()=>{if(isNaN(f)||f<0)return;const e=[],t=f-Math.floor(f)>=.4;for(let t=0;t<Math.floor(f);t++)e.push(jsxRuntime.jsx("img",{alt:"",src:STAR_IMG},`star${t}`));if(t&&e.push(jsxRuntime.jsx("img",{alt:"",src:HALF_STAR_IMG},"halfstar")),e.length<5){const t=5-e.length;for(let r=0;r<t;r++)e.push(jsxRuntime.jsx("img",{alt:"",src:EMPTY_STAR_IMG},`emptystar${r}`))}return jsxRuntime.jsx(RatingContainer,{children:e.slice(0,5)})})()]}),jsxRuntime.jsx(ButtonContainer,{children:jsxRuntime.jsx(StyledButton,{onClick:g,"aria-label":m,children:u})})]})]})})}const SmartAppBanner=React__default.default.forwardRef(SmartAppBannerComponent),baseListStyle=e=>`\n\tmargin-bottom: ${e||0}rem;\n`,BASE_MARGIN=3,StyledOrderedList=styled__default.default.ol`
2742
+ `,APP_ICON="https://assets.life.gov.sg/react-design-system/img/app-icon/app-icon.png",STAR_IMG="https://assets.life.gov.sg/react-design-system/img/star-rating/full-star.svg",HALF_STAR_IMG="https://assets.life.gov.sg/react-design-system/img/star-rating/half-star.svg",EMPTY_STAR_IMG="https://assets.life.gov.sg/react-design-system/img/star-rating/empty-star.svg",ID="smart-app-banner";function SmartAppBannerComponent(e,t){const{className:r,show:a,href:i,content:n,offset:s=0,icon:o=APP_ICON,animated:l=!1,onDismiss:d,onClick:h}=e,{title:c,message:p,buttonLabel:u,buttonAriaLabel:m,numberOfStars:f}=n,g=e=>{e.stopPropagation(),window.open(i,"_blank","noreferrer"),h?.()};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:a&&jsxRuntime.jsxs(SmartAppBannerContainer,{ref:t,$isAnimated:l,$offset:s,className:r,children:[jsxRuntime.jsx(DismissContainer,{onClick:d,id:`${ID}-dismiss`,"data-testid":`${ID}-dismiss-container`,children:jsxRuntime.jsx(DismissButton,{"aria-label":"Dismiss",children:jsxRuntime.jsx(CrossIcon,{type:"cross"})})}),jsxRuntime.jsxs(ProceedContainer,{onClick:g,id:`${ID}-proceed`,"data-testid":`${ID}-proceed-container`,children:[jsxRuntime.jsx(BannerIcon,{src:o,alt:"lifesg-app-icon"}),jsxRuntime.jsxs(TextContainer,{children:[jsxRuntime.jsx(Title,{children:c}),jsxRuntime.jsx(Description,{children:p}),(()=>{if(isNaN(f)||f<0)return;const e=[],t=f-Math.floor(f)>=.4;for(let t=0;t<Math.floor(f);t++)e.push(jsxRuntime.jsx("img",{alt:"",src:STAR_IMG},`star${t}`));if(t&&e.push(jsxRuntime.jsx("img",{alt:"",src:HALF_STAR_IMG},"halfstar")),e.length<5){const t=5-e.length;for(let r=0;r<t;r++)e.push(jsxRuntime.jsx("img",{alt:"",src:EMPTY_STAR_IMG},`emptystar${r}`))}return jsxRuntime.jsx(RatingContainer,{children:e.slice(0,5)})})()]}),jsxRuntime.jsx(ButtonContainer,{children:jsxRuntime.jsx(StyledButton,{onClick:g,"aria-label":m,children:u})})]})]})})}const SmartAppBanner=React__default.default.forwardRef(SmartAppBannerComponent),baseListStyle=e=>`\n\tmargin-bottom: ${e||0}rem;\n`,BASE_MARGIN=3,StyledOrderedList=styled__default.default.ol`
2743
2743
  ${e=>baseListStyle(e.bottomMargin)}
2744
2744
  margin-left: ${BASE_MARGIN}rem;
2745
2745