@lifesg/react-design-system 3.4.0-canary.4 → 3.4.0-canary.5
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/error-display/error-display-data.js +1 -1
- package/cjs/error-display/error-display-data.js.map +1 -1
- package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
- package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
- package/cjs/modal/modal.js +1 -1
- package/cjs/modal/modal.js.map +1 -1
- package/cjs/modal/modal.styles.js +4 -5
- package/cjs/modal/modal.styles.js.map +1 -1
- package/cjs/modal-v2/modal-v2.js +1 -1
- package/cjs/modal-v2/modal-v2.js.map +1 -1
- package/cjs/modal-v2/modal-v2.styles.js +10 -10
- package/cjs/modal-v2/modal-v2.styles.js.map +1 -1
- package/cjs/shared/hooks/useViewport.js +1 -1
- package/cjs/shared/hooks/useViewport.js.map +1 -1
- package/cjs/theme/font/theme-helper.js +1 -1
- package/cjs/theme/font/theme-helper.js.map +1 -1
- package/cjs/theme/font-spec/theme-helper.js +1 -1
- package/cjs/theme/font-spec/theme-helper.js.map +1 -1
- package/cjs/theme/index.js +1 -1
- package/cjs/theme/index.js.map +1 -1
- package/error-display/error-display-data.js +1 -1
- package/error-display/error-display-data.js.map +1 -1
- package/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
- package/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
- package/modal/modal.js +1 -1
- package/modal/modal.js.map +1 -1
- package/modal/modal.styles.d.ts +1 -1
- package/modal/modal.styles.js +4 -5
- package/modal/modal.styles.js.map +1 -1
- package/modal-v2/modal-v2.js +1 -1
- package/modal-v2/modal-v2.js.map +1 -1
- package/modal-v2/modal-v2.styles.d.ts +0 -2
- package/modal-v2/modal-v2.styles.js +9 -9
- package/modal-v2/modal-v2.styles.js.map +1 -1
- package/package.json +1 -1
- package/shared/hooks/useViewport.d.ts +7 -2
- package/shared/hooks/useViewport.js +1 -1
- package/shared/hooks/useViewport.js.map +1 -1
- package/theme/font/theme-helper.js +1 -1
- package/theme/font/theme-helper.js.map +1 -1
- package/theme/font-spec/theme-helper.js +1 -1
- package/theme/font-spec/theme-helper.js.map +1 -1
- package/theme/index.js +1 -1
- package/theme/index.js.map +1 -1
- package/theme/types.d.ts +1 -1
- package/cjs/theme/font/specs/smgs-font-set.js +0 -2
- package/cjs/theme/font/specs/smgs-font-set.js.map +0 -1
- package/cjs/theme/font-spec/specs/smgs-font-spec-set.js +0 -2
- package/cjs/theme/font-spec/specs/smgs-font-spec-set.js.map +0 -1
- package/theme/font/specs/smgs-font-set.d.ts +0 -2
- package/theme/font/specs/smgs-font-set.js +0 -2
- package/theme/font/specs/smgs-font-set.js.map +0 -1
- package/theme/font-spec/specs/smgs-font-spec-set.d.ts +0 -2
- package/theme/font-spec/specs/smgs-font-spec-set.js +0 -2
- package/theme/font-spec/specs/smgs-font-spec-set.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderDescriptionWithProps as s}from"./error-display-helper-comp.js";import{ErrorDisplayHelper as e}from"./helper.js";const{imgAttributeHelper:t}=e,g={400:{base:"https://assets.life.gov.sg/react-design-system/img/error/400.png",md:"https://assets.life.gov.sg/react-design-system/img/error/400@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/400@3x.png",width:400,height:280},403:{base:"https://assets.life.gov.sg/react-design-system/img/error/403.png",md:"https://assets.life.gov.sg/react-design-system/img/error/403@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/403@3x.png",width:400,height:280},404:{base:"https://assets.life.gov.sg/react-design-system/img/error/404.png",md:"https://assets.life.gov.sg/react-design-system/img/error/404@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/404@3x.png",width:400,height:280},408:{base:"https://assets.life.gov.sg/react-design-system/img/error/408.png",md:"https://assets.life.gov.sg/react-design-system/img/error/408@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/408@3x.png",width:400,height:280},500:{base:"https://assets.life.gov.sg/react-design-system/img/error/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/generic-error@3x.png",width:400,height:280},502:{base:"https://assets.life.gov.sg/react-design-system/img/error/502.png",md:"https://assets.life.gov.sg/react-design-system/img/error/502@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/502@3x.png",width:400,height:280},503:{base:"https://assets.life.gov.sg/react-design-system/img/error/503.png",md:"https://assets.life.gov.sg/react-design-system/img/error/503@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/503@3x.png",width:400,height:280},504:{base:"https://assets.life.gov.sg/react-design-system/img/error/504.png",md:"https://assets.life.gov.sg/react-design-system/img/error/504@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/504@3x.png",width:400,height:280},confirmation:{base:"https://assets.life.gov.sg/react-design-system/img/error/confirmation.png",md:"https://assets.life.gov.sg/react-design-system/img/error/confirmation@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/confirmation@3x.png",width:400,height:280},"insufficient-credits":{base:"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit.png",md:"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit@3x.png",width:400,height:280},inactivity:{base:"https://assets.life.gov.sg/react-design-system/img/error/inactivity.png",md:"https://assets.life.gov.sg/react-design-system/img/error/inactivity@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/inactivity@3x.png",width:400,height:280},"link-error":{base:"https://assets.life.gov.sg/react-design-system/img/error/link-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/link-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/link-error@3x.png",width:400,height:280},logout:{base:"https://assets.life.gov.sg/react-design-system/img/error/logout.png",md:"https://assets.life.gov.sg/react-design-system/img/error/logout@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/logout@3x.png",width:400,height:280},"no-item-found":{base:"https://assets.life.gov.sg/react-design-system/img/error/no-item-found.png",md:"https://assets.life.gov.sg/react-design-system/img/error/no-item-found@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/no-item-found@3x.png",width:400,height:280},"payment-unsuccessful":{base:"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful.png",md:"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful@3x.png",width:400,height:281},"transfer-unsuccessful":{base:"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful.png",md:"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful@3x.png",width:400,height:280},"unsupported-browser":{base:"https://assets.life.gov.sg/react-design-system/img/error/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/generic-error@3x.png",width:400,height:280},warning:{base:"https://assets.life.gov.sg/react-design-system/img/error/warning.png",md:"https://assets.life.gov.sg/react-design-system/img/error/warning@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/warning@3x.png",width:400,height:280}},r={400:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/400.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/400@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/400@3x.png",width:400,height:215},403:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/403.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/403@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/403@3x.png",width:400,height:254},404:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/404.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/404@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/404@3x.png",width:400,height:319},408:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/408.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/408@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/408@3x.png",width:400,height:330},500:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@3x.png",width:400,height:232},502:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/502.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/502@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/502@3x.png",width:400,height:215},503:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/503.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/503@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/503@3x.png",width:400,height:191},504:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/504.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/504@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/504@3x.png",width:400,height:261},confirmation:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation@3x.png",width:400,height:280},"insufficient-credits":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit@3x.png",width:400,height:280},inactivity:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity@3x.png",width:400,height:276},"link-error":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error@3x.png",width:400,height:280},logout:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout@3x.png",width:400,height:280},"no-item-found":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found@3x.png",width:400,height:290},"payment-unsuccessful":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful@3x.png",width:400,height:280},"transfer-unsuccessful":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful@3x.png",width:400,height:280},"unsupported-browser":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@3x.png",width:400,height:232},warning:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning@3x.png",width:400,height:280}},i=Object.assign(Object.assign({},g),{400:{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/400.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/400@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/400@3x.png",width:400,height:280},404:{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@3x.png",width:400,height:280},500:{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@3x.png",width:400,height:280},confirmation:{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation@3x.png",width:400,height:280},"no-item-found":{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@3x.png",width:400,height:280},"unsupported-browser":{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@3x.png",width:400,height:280},warning:{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning@3x.png",width:400,height:280}}),n=Object.assign(Object.assign({},g),{400:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400@3x.png",width:400,height:280},403:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403@3x.png",width:400,height:280},404:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404@3x.png",width:400,height:280},408:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408@3x.png",width:400,height:280},500:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error@3x.png",width:400,height:280},502:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502@3x.png",width:400,height:280},503:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503@3x.png",width:400,height:280},504:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504@3x.png",width:400,height:280},confirmation:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation@3x.png",width:400,height:280},inactivity:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity@3x.png",width:400,height:280},"link-error":{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error@3x.png",width:400,height:280},logout:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout@3x.png",width:400,height:280},warning:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning@3x.png",width:400,height:280},"payment-unsuccessful":{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful@3x.png",width:400,height:280},"no-item-found":{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found@3x.png",width:400,height:280}}),o=(e,g)=>new Map([["400",{img:t(e[400],g),title:"Something went wrong",description:"This could be a temporary problem, so please refresh the page or try again later."}],["403",{img:t(e[403],g),title:"Error loading page",description:"You may not have permission to view this page. If someone gave you this link, let them know about this error."}],["404",{img:t(e[404],g),title:"Page not found",description:"If you entered or pasted the URL, check that it’s correct. If someone gave you this link, let them know about this error."}],["408",{img:t(e[408],g),title:"Something went wrong",description:"This could be a temporary problem, so please refresh the page or try again later."}],["500",{img:t(e[500],g),title:"Something went wrong",description:"We're working on a fix for the problem. Please try again later."}],["502",{img:t(e[502],g),title:"Something went wrong",description:"This could be a temporary problem, so please refresh the page or try again later."}],["503",{img:t(e[503],g),title:"Service under maintenance",description:"This service is currently unavailable. Please try again later."}],["504",{img:t(e[504],g),title:"Something went wrong",description:"This could be a temporary problem, so please refresh the page or try again later."}],["confirmation",{img:t(e.confirmation,g),title:"Leave and lose changes?",description:"You have unsaved changes. If you leave this page, you will lose the changes you’ve made."}],["link-error",{img:t(e["link-error"],g),title:"Link has expired",description:"If you entered or pasted the URL, check that it’s correct. If someone gave you this link, let them know it has expired."}],["logout",{img:t(e.logout,g),title:"You’ve been logged out",description:"It looks like you’ve left, so we logged you out to protect your privacy."}],["insufficient-credits",{img:t(e["insufficient-credits"],g),title:"Insufficient credits",description:"You do not have enough credits to make this transaction."}],["inactivity",{img:t(e.inactivity,g),title:"Are you still there?",description:"You’ve been inactive for a while. To protect your privacy, you’ll be logged out soon.\n\nIf you wish to stay on this page, let us know now.",renderDescription:s("inactivity")}],["maintenance",{img:t(e[503],g),title:"Service under maintenance",description:"This service is currently unavailable. Please try again later.",renderDescription:s("maintenance")}],["no-item-found",{img:t(e["no-item-found"],g),title:"No results found",description:"Try adjusting your search or filters to find what you’re looking for."}],["payment-unsuccessful",{img:t(e["payment-unsuccessful"],g),title:"Unsuccessful payment",description:"Your payment was unsuccessful. Please try again."}],["transfer-unsuccessful",{img:t(e["transfer-unsuccessful"],g),title:"Unsuccessful transfer",description:"Your transfer was unsuccessful. Please try again."}],["unsupported-browser",{img:t(e["unsupported-browser"],g),title:"Browser not supported",description:"Download the latest version of Chrome, Edge, Firefox or Safari."}],["partially-supported-browser",{img:t(e["unsupported-browser"],g),title:"Browser version not supported",description:"Update to the latest version of Chrome, Edge, Firefox or Safari."}],["warning",{img:t(e.warning,g),title:"Are you sure?",description:"You will lose your progress."}]]),a=(s,e,t)=>{switch(e){case"bookingsg":return o(r,t).get(s);case"ccube":return o(i,t).get(s);case"mylegacy":return o(n,t).get(s);default:return o(g,t).get(s)}};export{o as generateErrorDisplayData,a as getErrorDisplayData};
|
|
1
|
+
import{renderDescriptionWithProps as s}from"./error-display-helper-comp.js";import{ErrorDisplayHelper as e}from"./helper.js";const{imgAttributeHelper:t}=e,g={400:{base:"https://assets.life.gov.sg/react-design-system/img/error/400.png",md:"https://assets.life.gov.sg/react-design-system/img/error/400@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/400@3x.png",width:400,height:280},403:{base:"https://assets.life.gov.sg/react-design-system/img/error/403.png",md:"https://assets.life.gov.sg/react-design-system/img/error/403@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/403@3x.png",width:400,height:280},404:{base:"https://assets.life.gov.sg/react-design-system/img/error/404.png",md:"https://assets.life.gov.sg/react-design-system/img/error/404@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/404@3x.png",width:400,height:280},408:{base:"https://assets.life.gov.sg/react-design-system/img/error/408.png",md:"https://assets.life.gov.sg/react-design-system/img/error/408@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/408@3x.png",width:400,height:280},500:{base:"https://assets.life.gov.sg/react-design-system/img/error/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/generic-error@3x.png",width:400,height:280},502:{base:"https://assets.life.gov.sg/react-design-system/img/error/502.png",md:"https://assets.life.gov.sg/react-design-system/img/error/502@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/502@3x.png",width:400,height:280},503:{base:"https://assets.life.gov.sg/react-design-system/img/error/503.png",md:"https://assets.life.gov.sg/react-design-system/img/error/503@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/503@3x.png",width:400,height:280},504:{base:"https://assets.life.gov.sg/react-design-system/img/error/504.png",md:"https://assets.life.gov.sg/react-design-system/img/error/504@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/504@3x.png",width:400,height:280},confirmation:{base:"https://assets.life.gov.sg/react-design-system/img/error/confirmation.png",md:"https://assets.life.gov.sg/react-design-system/img/error/confirmation@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/confirmation@3x.png",width:400,height:280},"insufficient-credits":{base:"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit.png",md:"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit@3x.png",width:400,height:280},inactivity:{base:"https://assets.life.gov.sg/react-design-system/img/error/inactivity.png",md:"https://assets.life.gov.sg/react-design-system/img/error/inactivity@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/inactivity@3x.png",width:400,height:280},"link-error":{base:"https://assets.life.gov.sg/react-design-system/img/error/link-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/link-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/link-error@3x.png",width:400,height:280},logout:{base:"https://assets.life.gov.sg/react-design-system/img/error/logout.png",md:"https://assets.life.gov.sg/react-design-system/img/error/logout@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/logout@3x.png",width:400,height:280},"no-item-found":{base:"https://assets.life.gov.sg/react-design-system/img/error/no-item-found.png",md:"https://assets.life.gov.sg/react-design-system/img/error/no-item-found@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/no-item-found@3x.png",width:400,height:280},"payment-unsuccessful":{base:"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful.png",md:"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful@3x.png",width:400,height:281},"transfer-unsuccessful":{base:"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful.png",md:"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful@3x.png",width:400,height:280},"unsupported-browser":{base:"https://assets.life.gov.sg/react-design-system/img/error/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/generic-error@3x.png",width:400,height:280},warning:{base:"https://assets.life.gov.sg/react-design-system/img/error/warning.png",md:"https://assets.life.gov.sg/react-design-system/img/error/warning@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/warning@3x.png",width:400,height:280}},r={400:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/400.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/400@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/400@3x.png",width:400,height:215},403:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/403.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/403@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/403@3x.png",width:400,height:254},404:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/404.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/404@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/404@3x.png",width:400,height:319},408:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/408.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/408@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/408@3x.png",width:400,height:330},500:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@3x.png",width:400,height:232},502:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/502.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/502@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/502@3x.png",width:400,height:215},503:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/503.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/503@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/503@3x.png",width:400,height:191},504:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/504.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/504@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/504@3x.png",width:400,height:261},confirmation:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation@3x.png",width:400,height:280},"insufficient-credits":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit@3x.png",width:400,height:280},inactivity:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity@3x.png",width:400,height:276},"link-error":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error@3x.png",width:400,height:280},logout:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout@3x.png",width:400,height:280},"no-item-found":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found@3x.png",width:400,height:290},"payment-unsuccessful":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful@3x.png",width:400,height:280},"transfer-unsuccessful":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful@3x.png",width:400,height:280},"unsupported-browser":{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@3x.png",width:400,height:232},warning:{base:"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning.png",md:"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning@3x.png",width:400,height:280}},i=Object.assign(Object.assign({},g),{400:{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/400.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/400@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/400@3x.png",width:400,height:280},404:{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@3x.png",width:400,height:280},500:{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@3x.png",width:400,height:280},confirmation:{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation@3x.png",width:400,height:280},"no-item-found":{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@3x.png",width:400,height:280},"unsupported-browser":{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@3x.png",width:400,height:280},warning:{base:"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning.png",md:"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning@3x.png",width:400,height:280}}),n=Object.assign(Object.assign({},g),{400:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400@3x.png",width:400,height:280},403:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403@3x.png",width:400,height:280},404:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404@3x.png",width:400,height:280},408:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408@3x.png",width:400,height:280},500:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error@3x.png",width:400,height:280},502:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502@3x.png",width:400,height:280},503:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503@3x.png",width:400,height:280},504:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504@3x.png",width:400,height:280},confirmation:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation@3x.png",width:400,height:280},inactivity:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity@3x.png",width:400,height:280},"link-error":{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error@3x.png",width:400,height:280},logout:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout@3x.png",width:400,height:280},warning:{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning@3x.png",width:400,height:280},"payment-unsuccessful":{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful@3x.png",width:400,height:280},"no-item-found":{base:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found.png",md:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found@2x.png",lg:"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found@3x.png",width:400,height:280}}),o=(e,g)=>new Map([["400",{img:t(e[400],g),title:"Something went wrong",description:"This could be a temporary problem, so please refresh the page or try again later."}],["403",{img:t(e[403],g),title:"Error loading page",description:"You may not have permission to view this page. If someone gave you this link, let them know about this error."}],["404",{img:t(e[404],g),title:"Page not found",description:"If you entered or pasted the URL, check that it’s correct. If someone gave you this link, let them know about this error."}],["408",{img:t(e[408],g),title:"Something went wrong",description:"This could be a temporary problem, so please refresh the page or try again later."}],["500",{img:t(e[500],g),title:"Something went wrong",description:"We're working on a fix for the problem. Please try again later."}],["502",{img:t(e[502],g),title:"Something went wrong",description:"This could be a temporary problem, so please refresh the page or try again later."}],["503",{img:t(e[503],g),title:"Service under maintenance",description:"This service is currently unavailable. Please try again later."}],["504",{img:t(e[504],g),title:"Something went wrong",description:"This could be a temporary problem, so please refresh the page or try again later."}],["confirmation",{img:t(e.confirmation,g),title:"Leave and lose changes?",description:"You have unsaved changes. If you leave this page, you will lose the changes you’ve made."}],["link-error",{img:t(e["link-error"],g),title:"Link has expired",description:"If you entered or pasted the URL, check that it’s correct. If someone gave you this link, let them know it has expired."}],["logout",{img:t(e.logout,g),title:"You’ve been logged out",description:"It looks like you’ve left, so we logged you out to protect your privacy."}],["insufficient-credits",{img:t(e["insufficient-credits"],g),title:"Insufficient credits",description:"You do not have enough credits to make this transaction."}],["inactivity",{img:t(e.inactivity,g),title:"Are you still there?",description:"You’ve been inactive for a while. To protect your privacy, you’ll be logged out soon.\n\nIf you wish to stay on this page, let us know now.",renderDescription:s("inactivity")}],["maintenance",{img:t(e[503],g),title:"Service under maintenance",description:"This service is currently unavailable. Please try again later.",renderDescription:s("maintenance")}],["no-item-found",{img:t(e["no-item-found"],g),title:"No results found",description:"Try adjusting your search or filters to find what you’re looking for."}],["payment-unsuccessful",{img:t(e["payment-unsuccessful"],g),title:"Unsuccessful payment",description:"Your payment was unsuccessful. Please try again."}],["transfer-unsuccessful",{img:t(e["transfer-unsuccessful"],g),title:"Unsuccessful transfer",description:"Your transfer was unsuccessful. Please try again."}],["unsupported-browser",{img:t(e["unsupported-browser"],g),title:"Browser not supported",description:"Download the latest version of Chrome, Edge, Firefox or Safari."}],["partially-supported-browser",{img:t(e["unsupported-browser"],g),title:"Browser version not supported",description:"Update to the latest version of Chrome, Edge, Firefox or Safari."}],["warning",{img:t(e.warning,g),title:"Are you sure?",description:"You will lose your progress."}]]),a=(s,e,t)=>{switch(e){case"bookingsg":return o(r,t).get(s);case"ccube":return o(i,t).get(s);case"mylegacy":case"smgs":return o(n,t).get(s);default:return o(g,t).get(s)}};export{o as generateErrorDisplayData,a as getErrorDisplayData};
|
|
2
2
|
//# sourceMappingURL=error-display-data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-display-data.js","sources":["../../src/error-display/error-display-data.tsx"],"sourcesContent":["import { ResourceScheme, ThemeSpec } from \"../theme/types\";\nimport { renderDescriptionWithProps } from \"./error-display-helper-comp\";\nimport { ErrorDisplayHelper } from \"./helper\";\nimport {\n ErrorDisplayType,\n InactivityAdditionalAttributes,\n MaintenanceAdditionalAttributes,\n} from \"./types\";\n\nconst { imgAttributeHelper } = ErrorDisplayHelper;\n\n// =============================================================================\n// IMAGE PATHS\n// =============================================================================\n\nconst ImgPaths: Record<string, ErrorDisplayHelper.ImagePathAttributes> = {\n \"400\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/400.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/400@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/400@3x.png\",\n width: 400,\n height: 280,\n },\n \"403\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/403.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/403@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/403@3x.png\",\n width: 400,\n height: 280,\n },\n \"404\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/404.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/404@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/404@3x.png\",\n width: 400,\n height: 280,\n },\n \"408\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/408.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/408@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/408@3x.png\",\n width: 400,\n height: 280,\n },\n \"500\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error@3x.png\",\n width: 400,\n height: 280,\n },\n \"502\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/502.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/502@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/502@3x.png\",\n width: 400,\n height: 280,\n },\n \"503\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/503.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/503@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/503@3x.png\",\n width: 400,\n height: 280,\n },\n \"504\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/504.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/504@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/504@3x.png\",\n width: 400,\n height: 280,\n },\n confirmation: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/confirmation.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/confirmation@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/confirmation@3x.png\",\n width: 400,\n height: 280,\n },\n \"insufficient-credits\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit@3x.png\",\n width: 400,\n height: 280,\n },\n inactivity: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/inactivity.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/inactivity@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/inactivity@3x.png\",\n width: 400,\n height: 280,\n },\n \"link-error\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/link-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/link-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/link-error@3x.png\",\n width: 400,\n height: 280,\n },\n logout: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/logout.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/logout@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/logout@3x.png\",\n width: 400,\n height: 280,\n },\n \"no-item-found\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/no-item-found.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/no-item-found@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/no-item-found@3x.png\",\n width: 400,\n height: 280,\n },\n \"payment-unsuccessful\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful@3x.png\",\n width: 400,\n height: 281,\n },\n \"transfer-unsuccessful\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful@3x.png\",\n width: 400,\n height: 280,\n },\n \"unsupported-browser\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error@3x.png\",\n width: 400,\n height: 280,\n },\n warning: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/warning.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/warning@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/warning@3x.png\",\n width: 400,\n height: 280,\n },\n};\n\nconst BsgImgPaths: Record<string, ErrorDisplayHelper.ImagePathAttributes> = {\n \"400\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/400.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/400@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/400@3x.png\",\n width: 400,\n height: 215,\n },\n \"403\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/403.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/403@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/403@3x.png\",\n width: 400,\n height: 254,\n },\n \"404\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/404.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/404@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/404@3x.png\",\n width: 400,\n height: 319,\n },\n \"408\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/408.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/408@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/408@3x.png\",\n width: 400,\n height: 330,\n },\n \"500\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@3x.png\",\n width: 400,\n height: 232,\n },\n \"502\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/502.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/502@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/502@3x.png\",\n width: 400,\n height: 215,\n },\n \"503\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/503.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/503@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/503@3x.png\",\n width: 400,\n height: 191,\n },\n \"504\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/504.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/504@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/504@3x.png\",\n width: 400,\n height: 261,\n },\n confirmation: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation@3x.png\",\n width: 400,\n height: 280,\n },\n \"insufficient-credits\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit@3x.png\",\n width: 400,\n height: 280,\n },\n inactivity: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity@3x.png\",\n width: 400,\n height: 276,\n },\n \"link-error\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error@3x.png\",\n width: 400,\n height: 280,\n },\n logout: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout@3x.png\",\n width: 400,\n height: 280,\n },\n \"no-item-found\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found@3x.png\",\n width: 400,\n height: 290,\n },\n \"payment-unsuccessful\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful@3x.png\",\n width: 400,\n height: 280,\n },\n \"transfer-unsuccessful\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful@3x.png\",\n width: 400,\n height: 280,\n },\n \"unsupported-browser\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@3x.png\",\n width: 400,\n height: 232,\n },\n warning: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning@3x.png\",\n width: 400,\n height: 280,\n },\n};\n\nconst CCubeImgPaths: Record<string, ErrorDisplayHelper.ImagePathAttributes> = {\n ...ImgPaths,\n \"400\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/400.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/400@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/400@3x.png\",\n width: 400,\n height: 280,\n },\n \"404\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@3x.png\",\n width: 400,\n height: 280,\n },\n \"500\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@3x.png\",\n width: 400,\n height: 280,\n },\n confirmation: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation@3x.png\",\n width: 400,\n height: 280,\n },\n \"no-item-found\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@3x.png\",\n width: 400,\n height: 280,\n },\n \"unsupported-browser\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@3x.png\",\n width: 400,\n height: 280,\n },\n warning: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning@3x.png\",\n width: 400,\n height: 280,\n },\n};\n\nconst MyLegacyImgPaths: Record<string, ErrorDisplayHelper.ImagePathAttributes> =\n {\n ...ImgPaths,\n \"400\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400@3x.png\",\n width: 400,\n height: 280,\n },\n \"403\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403@3x.png\",\n width: 400,\n height: 280,\n },\n \"404\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404@3x.png\",\n width: 400,\n height: 280,\n },\n \"408\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408@3x.png\",\n width: 400,\n height: 280,\n },\n \"500\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error@3x.png\",\n width: 400,\n height: 280,\n },\n \"502\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502@3x.png\",\n width: 400,\n height: 280,\n },\n \"503\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503@3x.png\",\n width: 400,\n height: 280,\n },\n \"504\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504@3x.png\",\n width: 400,\n height: 280,\n },\n confirmation: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation@3x.png\",\n width: 400,\n height: 280,\n },\n inactivity: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity@3x.png\",\n width: 400,\n height: 280,\n },\n \"link-error\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error@3x.png\",\n width: 400,\n height: 280,\n },\n logout: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout@3x.png\",\n width: 400,\n height: 280,\n },\n warning: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning@3x.png\",\n width: 400,\n height: 280,\n },\n \"payment-unsuccessful\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful@3x.png\",\n width: 400,\n height: 280,\n },\n \"no-item-found\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found@3x.png\",\n width: 400,\n height: 280,\n },\n };\n\n// =============================================================================\n// ERROR DISPLAY ATTRIBUTES\n// =============================================================================\n\ninterface ErrorDisplayDataAttrs {\n img?: React.ImgHTMLAttributes<HTMLImageElement> | undefined;\n imgSrc?: string | undefined;\n title?: string | undefined;\n description?: string | JSX.Element | undefined;\n renderDescription?: (\n attrs?: MaintenanceAdditionalAttributes | InactivityAdditionalAttributes\n ) => JSX.Element | string | undefined;\n}\n\nexport const generateErrorDisplayData = (\n ImgPathsObject: Record<string, ErrorDisplayHelper.ImagePathAttributes>,\n theme?: ThemeSpec\n) =>\n new Map<ErrorDisplayType, ErrorDisplayDataAttrs>([\n [\n \"400\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"400\"], theme),\n title: \"Something went wrong\",\n description:\n \"This could be a temporary problem, so please refresh the page or try again later.\",\n },\n ],\n [\n \"403\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"403\"], theme),\n title: \"Error loading page\",\n description:\n \"You may not have permission to view this page. If someone gave you this link, let them know about this error.\",\n },\n ],\n [\n \"404\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"404\"], theme),\n title: \"Page not found\",\n description:\n \"If you entered or pasted the URL, check that it’s correct. If someone gave you this link, let them know about this error.\",\n },\n ],\n [\n \"408\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"408\"], theme),\n title: \"Something went wrong\",\n description:\n \"This could be a temporary problem, so please refresh the page or try again later.\",\n },\n ],\n [\n \"500\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"500\"], theme),\n title: \"Something went wrong\",\n description:\n \"We're working on a fix for the problem. Please try again later.\",\n },\n ],\n [\n \"502\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"502\"], theme),\n title: \"Something went wrong\",\n description:\n \"This could be a temporary problem, so please refresh the page or try again later.\",\n },\n ],\n [\n \"503\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"503\"], theme),\n title: \"Service under maintenance\",\n description:\n \"This service is currently unavailable. Please try again later.\",\n },\n ],\n [\n \"504\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"504\"], theme),\n title: \"Something went wrong\",\n description:\n \"This could be a temporary problem, so please refresh the page or try again later.\",\n },\n ],\n [\n \"confirmation\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"confirmation\"], theme),\n title: \"Leave and lose changes?\",\n description:\n \"You have unsaved changes. If you leave this page, you will lose the changes you’ve made.\",\n },\n ],\n [\n \"link-error\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"link-error\"], theme),\n title: \"Link has expired\",\n description:\n \"If you entered or pasted the URL, check that it’s correct. If someone gave you this link, let them know it has expired.\",\n },\n ],\n [\n \"logout\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"logout\"], theme),\n title: \"You’ve been logged out\",\n description:\n \"It looks like you’ve left, so we logged you out to protect your privacy.\",\n },\n ],\n [\n \"insufficient-credits\",\n {\n img: imgAttributeHelper(\n ImgPathsObject[\"insufficient-credits\"],\n theme\n ),\n title: \"Insufficient credits\",\n description:\n \"You do not have enough credits to make this transaction.\",\n },\n ],\n [\n \"inactivity\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"inactivity\"], theme),\n title: \"Are you still there?\",\n description:\n \"You’ve been inactive for a while. To protect your privacy, you’ll be logged out soon.\\n\\nIf you wish to stay on this page, let us know now.\",\n renderDescription: renderDescriptionWithProps(\"inactivity\"),\n },\n ],\n [\n \"maintenance\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"503\"], theme),\n title: \"Service under maintenance\",\n description:\n \"This service is currently unavailable. Please try again later.\",\n renderDescription: renderDescriptionWithProps(\"maintenance\"),\n },\n ],\n [\n \"no-item-found\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"no-item-found\"], theme),\n title: \"No results found\",\n description:\n \"Try adjusting your search or filters to find what you’re looking for.\",\n },\n ],\n [\n \"payment-unsuccessful\",\n {\n img: imgAttributeHelper(\n ImgPathsObject[\"payment-unsuccessful\"],\n theme\n ),\n title: \"Unsuccessful payment\",\n description: \"Your payment was unsuccessful. Please try again.\",\n },\n ],\n [\n \"transfer-unsuccessful\",\n {\n img: imgAttributeHelper(\n ImgPathsObject[\"transfer-unsuccessful\"],\n theme\n ),\n title: \"Unsuccessful transfer\",\n description:\n \"Your transfer was unsuccessful. Please try again.\",\n },\n ],\n [\n \"unsupported-browser\",\n {\n img: imgAttributeHelper(\n ImgPathsObject[\"unsupported-browser\"],\n theme\n ),\n title: \"Browser not supported\",\n description:\n \"Download the latest version of Chrome, Edge, Firefox or Safari.\",\n },\n ],\n [\n \"partially-supported-browser\",\n {\n img: imgAttributeHelper(\n ImgPathsObject[\"unsupported-browser\"],\n theme\n ),\n title: \"Browser version not supported\",\n description:\n \"Update to the latest version of Chrome, Edge, Firefox or Safari.\",\n },\n ],\n [\n \"warning\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"warning\"], theme),\n title: \"Are you sure?\",\n description: \"You will lose your progress.\",\n },\n ],\n ]);\n\nexport const getErrorDisplayData = (\n type: ErrorDisplayType,\n resourceScheme: ResourceScheme,\n theme?: ThemeSpec\n) => {\n switch (resourceScheme) {\n case \"bookingsg\":\n return generateErrorDisplayData(BsgImgPaths, theme).get(type);\n case \"ccube\":\n return generateErrorDisplayData(CCubeImgPaths, theme).get(type);\n case \"mylegacy\":\n return generateErrorDisplayData(MyLegacyImgPaths, theme).get(type);\n default:\n return generateErrorDisplayData(ImgPaths, theme).get(type);\n }\n};\n"],"names":["imgAttributeHelper","ErrorDisplayHelper","ImgPaths","base","md","lg","width","height","confirmation","inactivity","logout","warning","BsgImgPaths","CCubeImgPaths","Object","assign","MyLegacyImgPaths","generateErrorDisplayData","ImgPathsObject","theme","Map","img","title","description","renderDescription","renderDescriptionWithProps","getErrorDisplayData","type","resourceScheme","get"],"mappings":"6HASA,MAAMA,mBAAEA,GAAuBC,EAMzBC,EAAmE,CACrE,IAAO,CACHC,KAAM,mEACNC,GAAI,sEACJC,GAAI,sEACJC,MAAO,IACPC,OAAQ,KAEZ,IAAO,CACHJ,KAAM,mEACNC,GAAI,sEACJC,GAAI,sEACJC,MAAO,IACPC,OAAQ,KAEZ,IAAO,CACHJ,KAAM,mEACNC,GAAI,sEACJC,GAAI,sEACJC,MAAO,IACPC,OAAQ,KAEZ,IAAO,CACHJ,KAAM,mEACNC,G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AAmBkB,EAAwB,QAAGC,GACnDG,MAAO,gBACPC,YAAa,mCAKhBG,EAAsB,CAC/BC,EACAC,EACAT,KAEA,OAAQS,GACJ,IAAK,YACD,OAAOX,EAAyBL,EAAaO,GAAOU,IAAIF,GAC5D,IAAK,QACD,OAAOV,EAAyBJ,EAAeM,GAAOU,IAAIF,GAC9D,IAAK,WACD,OAAOV,EAAyBD,EAAkBG,GAAOU,IAAIF,GACjE,QACI,OAAOV,EAAyBf,EAAUiB,GAAOU,IAAIF"}
|
|
1
|
+
{"version":3,"file":"error-display-data.js","sources":["../../src/error-display/error-display-data.tsx"],"sourcesContent":["import { ResourceScheme, ThemeSpec } from \"../theme/types\";\nimport { renderDescriptionWithProps } from \"./error-display-helper-comp\";\nimport { ErrorDisplayHelper } from \"./helper\";\nimport {\n ErrorDisplayType,\n InactivityAdditionalAttributes,\n MaintenanceAdditionalAttributes,\n} from \"./types\";\n\nconst { imgAttributeHelper } = ErrorDisplayHelper;\n\n// =============================================================================\n// IMAGE PATHS\n// =============================================================================\n\nconst ImgPaths: Record<string, ErrorDisplayHelper.ImagePathAttributes> = {\n \"400\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/400.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/400@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/400@3x.png\",\n width: 400,\n height: 280,\n },\n \"403\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/403.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/403@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/403@3x.png\",\n width: 400,\n height: 280,\n },\n \"404\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/404.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/404@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/404@3x.png\",\n width: 400,\n height: 280,\n },\n \"408\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/408.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/408@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/408@3x.png\",\n width: 400,\n height: 280,\n },\n \"500\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error@3x.png\",\n width: 400,\n height: 280,\n },\n \"502\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/502.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/502@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/502@3x.png\",\n width: 400,\n height: 280,\n },\n \"503\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/503.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/503@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/503@3x.png\",\n width: 400,\n height: 280,\n },\n \"504\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/504.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/504@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/504@3x.png\",\n width: 400,\n height: 280,\n },\n confirmation: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/confirmation.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/confirmation@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/confirmation@3x.png\",\n width: 400,\n height: 280,\n },\n \"insufficient-credits\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/insuffcient-credit@3x.png\",\n width: 400,\n height: 280,\n },\n inactivity: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/inactivity.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/inactivity@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/inactivity@3x.png\",\n width: 400,\n height: 280,\n },\n \"link-error\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/link-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/link-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/link-error@3x.png\",\n width: 400,\n height: 280,\n },\n logout: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/logout.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/logout@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/logout@3x.png\",\n width: 400,\n height: 280,\n },\n \"no-item-found\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/no-item-found.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/no-item-found@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/no-item-found@3x.png\",\n width: 400,\n height: 280,\n },\n \"payment-unsuccessful\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/payment-unsuccessful@3x.png\",\n width: 400,\n height: 281,\n },\n \"transfer-unsuccessful\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/transfer-unsuccessful@3x.png\",\n width: 400,\n height: 280,\n },\n \"unsupported-browser\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/generic-error@3x.png\",\n width: 400,\n height: 280,\n },\n warning: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/warning.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/warning@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/warning@3x.png\",\n width: 400,\n height: 280,\n },\n};\n\nconst BsgImgPaths: Record<string, ErrorDisplayHelper.ImagePathAttributes> = {\n \"400\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/400.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/400@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/400@3x.png\",\n width: 400,\n height: 215,\n },\n \"403\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/403.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/403@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/403@3x.png\",\n width: 400,\n height: 254,\n },\n \"404\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/404.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/404@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/404@3x.png\",\n width: 400,\n height: 319,\n },\n \"408\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/408.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/408@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/408@3x.png\",\n width: 400,\n height: 330,\n },\n \"500\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@3x.png\",\n width: 400,\n height: 232,\n },\n \"502\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/502.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/502@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/502@3x.png\",\n width: 400,\n height: 215,\n },\n \"503\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/503.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/503@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/503@3x.png\",\n width: 400,\n height: 191,\n },\n \"504\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/504.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/504@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/504@3x.png\",\n width: 400,\n height: 261,\n },\n confirmation: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/confirmation@3x.png\",\n width: 400,\n height: 280,\n },\n \"insufficient-credits\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/insuffcient-credit@3x.png\",\n width: 400,\n height: 280,\n },\n inactivity: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/inactivity@3x.png\",\n width: 400,\n height: 276,\n },\n \"link-error\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/link-error@3x.png\",\n width: 400,\n height: 280,\n },\n logout: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/logout@3x.png\",\n width: 400,\n height: 280,\n },\n \"no-item-found\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/no-item-found@3x.png\",\n width: 400,\n height: 290,\n },\n \"payment-unsuccessful\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/payment-unsuccessful@3x.png\",\n width: 400,\n height: 280,\n },\n \"transfer-unsuccessful\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/transfer-unsuccessful@3x.png\",\n width: 400,\n height: 280,\n },\n \"unsupported-browser\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/generic-error@3x.png\",\n width: 400,\n height: 232,\n },\n warning: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/bsg/warning@3x.png\",\n width: 400,\n height: 280,\n },\n};\n\nconst CCubeImgPaths: Record<string, ErrorDisplayHelper.ImagePathAttributes> = {\n ...ImgPaths,\n \"400\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/400.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/400@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/400@3x.png\",\n width: 400,\n height: 280,\n },\n \"404\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@3x.png\",\n width: 400,\n height: 280,\n },\n \"500\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@3x.png\",\n width: 400,\n height: 280,\n },\n confirmation: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/confirmation@3x.png\",\n width: 400,\n height: 280,\n },\n \"no-item-found\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/no-item-found@3x.png\",\n width: 400,\n height: 280,\n },\n \"unsupported-browser\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/generic-error@3x.png\",\n width: 400,\n height: 280,\n },\n warning: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/ccube/warning@3x.png\",\n width: 400,\n height: 280,\n },\n};\n\nconst MyLegacyImgPaths: Record<string, ErrorDisplayHelper.ImagePathAttributes> =\n {\n ...ImgPaths,\n \"400\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/400@3x.png\",\n width: 400,\n height: 280,\n },\n \"403\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/403@3x.png\",\n width: 400,\n height: 280,\n },\n \"404\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/404@3x.png\",\n width: 400,\n height: 280,\n },\n \"408\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/408@3x.png\",\n width: 400,\n height: 280,\n },\n \"500\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/generic-error@3x.png\",\n width: 400,\n height: 280,\n },\n \"502\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/502@3x.png\",\n width: 400,\n height: 280,\n },\n \"503\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/503@3x.png\",\n width: 400,\n height: 280,\n },\n \"504\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/504@3x.png\",\n width: 400,\n height: 280,\n },\n confirmation: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/confirmation@3x.png\",\n width: 400,\n height: 280,\n },\n inactivity: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/inactivity@3x.png\",\n width: 400,\n height: 280,\n },\n \"link-error\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/link-error@3x.png\",\n width: 400,\n height: 280,\n },\n logout: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/logout@3x.png\",\n width: 400,\n height: 280,\n },\n warning: {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/warning@3x.png\",\n width: 400,\n height: 280,\n },\n \"payment-unsuccessful\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/payment-unsuccessful@3x.png\",\n width: 400,\n height: 280,\n },\n \"no-item-found\": {\n base: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found.png\",\n md: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found@2x.png\",\n lg: \"https://assets.life.gov.sg/react-design-system/img/error/mylegacy/no-item-found@3x.png\",\n width: 400,\n height: 280,\n },\n };\n\n// =============================================================================\n// ERROR DISPLAY ATTRIBUTES\n// =============================================================================\n\ninterface ErrorDisplayDataAttrs {\n img?: React.ImgHTMLAttributes<HTMLImageElement> | undefined;\n imgSrc?: string | undefined;\n title?: string | undefined;\n description?: string | JSX.Element | undefined;\n renderDescription?: (\n attrs?: MaintenanceAdditionalAttributes | InactivityAdditionalAttributes\n ) => JSX.Element | string | undefined;\n}\n\nexport const generateErrorDisplayData = (\n ImgPathsObject: Record<string, ErrorDisplayHelper.ImagePathAttributes>,\n theme?: ThemeSpec\n) =>\n new Map<ErrorDisplayType, ErrorDisplayDataAttrs>([\n [\n \"400\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"400\"], theme),\n title: \"Something went wrong\",\n description:\n \"This could be a temporary problem, so please refresh the page or try again later.\",\n },\n ],\n [\n \"403\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"403\"], theme),\n title: \"Error loading page\",\n description:\n \"You may not have permission to view this page. If someone gave you this link, let them know about this error.\",\n },\n ],\n [\n \"404\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"404\"], theme),\n title: \"Page not found\",\n description:\n \"If you entered or pasted the URL, check that it’s correct. If someone gave you this link, let them know about this error.\",\n },\n ],\n [\n \"408\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"408\"], theme),\n title: \"Something went wrong\",\n description:\n \"This could be a temporary problem, so please refresh the page or try again later.\",\n },\n ],\n [\n \"500\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"500\"], theme),\n title: \"Something went wrong\",\n description:\n \"We're working on a fix for the problem. Please try again later.\",\n },\n ],\n [\n \"502\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"502\"], theme),\n title: \"Something went wrong\",\n description:\n \"This could be a temporary problem, so please refresh the page or try again later.\",\n },\n ],\n [\n \"503\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"503\"], theme),\n title: \"Service under maintenance\",\n description:\n \"This service is currently unavailable. Please try again later.\",\n },\n ],\n [\n \"504\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"504\"], theme),\n title: \"Something went wrong\",\n description:\n \"This could be a temporary problem, so please refresh the page or try again later.\",\n },\n ],\n [\n \"confirmation\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"confirmation\"], theme),\n title: \"Leave and lose changes?\",\n description:\n \"You have unsaved changes. If you leave this page, you will lose the changes you’ve made.\",\n },\n ],\n [\n \"link-error\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"link-error\"], theme),\n title: \"Link has expired\",\n description:\n \"If you entered or pasted the URL, check that it’s correct. If someone gave you this link, let them know it has expired.\",\n },\n ],\n [\n \"logout\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"logout\"], theme),\n title: \"You’ve been logged out\",\n description:\n \"It looks like you’ve left, so we logged you out to protect your privacy.\",\n },\n ],\n [\n \"insufficient-credits\",\n {\n img: imgAttributeHelper(\n ImgPathsObject[\"insufficient-credits\"],\n theme\n ),\n title: \"Insufficient credits\",\n description:\n \"You do not have enough credits to make this transaction.\",\n },\n ],\n [\n \"inactivity\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"inactivity\"], theme),\n title: \"Are you still there?\",\n description:\n \"You’ve been inactive for a while. To protect your privacy, you’ll be logged out soon.\\n\\nIf you wish to stay on this page, let us know now.\",\n renderDescription: renderDescriptionWithProps(\"inactivity\"),\n },\n ],\n [\n \"maintenance\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"503\"], theme),\n title: \"Service under maintenance\",\n description:\n \"This service is currently unavailable. Please try again later.\",\n renderDescription: renderDescriptionWithProps(\"maintenance\"),\n },\n ],\n [\n \"no-item-found\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"no-item-found\"], theme),\n title: \"No results found\",\n description:\n \"Try adjusting your search or filters to find what you’re looking for.\",\n },\n ],\n [\n \"payment-unsuccessful\",\n {\n img: imgAttributeHelper(\n ImgPathsObject[\"payment-unsuccessful\"],\n theme\n ),\n title: \"Unsuccessful payment\",\n description: \"Your payment was unsuccessful. Please try again.\",\n },\n ],\n [\n \"transfer-unsuccessful\",\n {\n img: imgAttributeHelper(\n ImgPathsObject[\"transfer-unsuccessful\"],\n theme\n ),\n title: \"Unsuccessful transfer\",\n description:\n \"Your transfer was unsuccessful. Please try again.\",\n },\n ],\n [\n \"unsupported-browser\",\n {\n img: imgAttributeHelper(\n ImgPathsObject[\"unsupported-browser\"],\n theme\n ),\n title: \"Browser not supported\",\n description:\n \"Download the latest version of Chrome, Edge, Firefox or Safari.\",\n },\n ],\n [\n \"partially-supported-browser\",\n {\n img: imgAttributeHelper(\n ImgPathsObject[\"unsupported-browser\"],\n theme\n ),\n title: \"Browser version not supported\",\n description:\n \"Update to the latest version of Chrome, Edge, Firefox or Safari.\",\n },\n ],\n [\n \"warning\",\n {\n img: imgAttributeHelper(ImgPathsObject[\"warning\"], theme),\n title: \"Are you sure?\",\n description: \"You will lose your progress.\",\n },\n ],\n ]);\n\nexport const getErrorDisplayData = (\n type: ErrorDisplayType,\n resourceScheme: ResourceScheme,\n theme?: ThemeSpec\n) => {\n switch (resourceScheme) {\n case \"bookingsg\":\n return generateErrorDisplayData(BsgImgPaths, theme).get(type);\n case \"ccube\":\n return generateErrorDisplayData(CCubeImgPaths, theme).get(type);\n case \"mylegacy\":\n case \"smgs\":\n return generateErrorDisplayData(MyLegacyImgPaths, theme).get(type);\n default:\n return generateErrorDisplayData(ImgPaths, theme).get(type);\n }\n};\n"],"names":["imgAttributeHelper","ErrorDisplayHelper","ImgPaths","base","md","lg","width","height","confirmation","inactivity","logout","warning","BsgImgPaths","CCubeImgPaths","Object","assign","MyLegacyImgPaths","generateErrorDisplayData","ImgPathsObject","theme","Map","img","title","description","renderDescription","renderDescriptionWithProps","getErrorDisplayData","type","resourceScheme","get"],"mappings":"6HASA,MAAMA,mBAAEA,GAAuBC,EAMzBC,EAAmE,CACrE,IAAO,CACHC,KAAM,mEACNC,GAAI,sEACJC,GAAI,sEACJC,MAAO,IACPC,OAAQ,KAEZ,IAAO,CACHJ,KAAM,mEACNC,GAAI,sEACJC,GAAI,sEACJC,MAAO,IACPC,OAAQ,KAEZ,IAAO,CACHJ,KAAM,mEACNC,GAAI,sEACJC,GAAI,sEACJC,MAAO,IACPC,OAAQ,KAEZ,IAAO,CACHJ,KAAM,mEACNC,GAAI,sEACJC,GAAI,sEACJC,MAAO,IACPC,OAAQ,KAEZ,IAAO,CACHJ,KAAM,6EACNC,GAAI,gFACJC,GAAI,gFACJC,MAAO,IACPC,OAAQ,KAEZ,IAAO,CACHJ,KAAM,mEACNC,GAAI,sEACJC,GAAI,sEACJC,MAAO,IACPC,OAAQ,KAEZ,IAAO,CACHJ,KAAM,mEACNC,GAAI,sEACJC,GAAI,sEACJC,MAAO,IACPC,OAAQ,KAEZ,IAAO,CACHJ,KAAM,mEACNC,GAAI,sEACJC,GAAI,sEACJC,MAAO,IACPC,OAAQ,KAEZC,aAAc,CACVL,KAAM,4EACNC,GAAI,+EACJC,GAAI,+EACJC,MAAO,IACPC,OAAQ,KAEZ,uBAAwB,CACpBJ,KAAM,kFACNC,GAAI,qFACJC,GAAI,qFACJC,MAAO,IACPC,OAAQ,KAEZE,WAAY,CACRN,KAAM,0EACNC,GAAI,6EACJC,GAAI,6EACJC,MAAO,IACPC,OAAQ,KAEZ,aAAc,CACVJ,KAAM,0EACNC,GAAI,6EAC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MAAO,uBACPC,YACI,8IACJC,kBAAmBC,EAA2B,gBAGtD,CACI,cACA,CACIJ,IAAKrB,EAAmBkB,EAAe,KAAQC,GAC/CG,MAAO,4BACPC,YACI,iEACJC,kBAAmBC,EAA2B,iBAGtD,CACI,gBACA,CACIJ,IAAKrB,EAAmBkB,EAAe,iBAAkBC,GACzDG,MAAO,mBACPC,YACI,0EAGZ,CACI,uBACA,CACIF,IAAKrB,EACDkB,EAAe,wBACfC,GAEJG,MAAO,uBACPC,YAAa,qDAGrB,CACI,wBACA,CACIF,IAAKrB,EACDkB,EAAe,yBACfC,GAEJG,MAAO,wBACPC,YACI,sDAGZ,CACI,sBACA,CACIF,IAAKrB,EACDkB,EAAe,uBACfC,GAEJG,MAAO,wBACPC,YACI,oEAGZ,CACI,8BACA,CACIF,IAAKrB,EACDkB,EAAe,uBACfC,GAEJG,MAAO,gCACPC,YACI,qEAGZ,CACI,UACA,CACIF,IAAKrB,EAAmBkB,EAAwB,QAAGC,GACnDG,MAAO,gBACPC,YAAa,mCAKhBG,EAAsB,CAC/BC,EACAC,EACAT,KAEA,OAAQS,GACJ,IAAK,YACD,OAAOX,EAAyBL,EAAaO,GAAOU,IAAIF,GAC5D,IAAK,QACD,OAAOV,EAAyBJ,EAAeM,GAAOU,IAAIF,GAC9D,IAAK,WACL,IAAK,OACD,OAAOV,EAAyBD,EAAkBG,GAAOU,IAAIF,GACjE,QACI,OAAOV,EAAyBf,EAAUiB,GAAOU,IAAIF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e}from"../_virtual/_tslib.js";import{jsx as i,jsxs as t,Fragment as n}from"react/jsx-runtime";import{ChevronLeftIcon as
|
|
1
|
+
import{__rest as e}from"../_virtual/_tslib.js";import{jsx as i,jsxs as t,Fragment as n}from"react/jsx-runtime";import{ChevronLeftIcon as l,ChevronRightIcon as r,MagnifierPlusIcon as o,MagnifierMinusIcon as a,CrossIcon as d}from"@lifesg/react-icons";import{BinIcon as s}from"@lifesg/react-icons/bin";import{clearAnnouncer as c,announce as u}from"@react-aria/live-announcer";import{forwardRef as h,useState as m,useRef as v,useMemo as f,useCallback as g,useImperativeHandle as p,useEffect as b}from"react";import{TransformWrapper as $,TransformComponent as I}from"react-zoom-pan-pinch";import{ModalV2 as C}from"../modal-v2/index.js";import{useStateCallback as w}from"../shared/hooks/use-state-callback.js";import"../util/calendar-helper.js";import"../util/date-helper.js";import"../util/date-input-helper.js";import"../util/simple-id-generator.js";import"../util/string-helper.js";import{useEventListener as j}from"../util/use-event-listener.js";import{CarouselModalContent as T,ImageGalleryContainer as k,ImageGalleryWrapper as x,ImageGallerySwipe as y,ArrowButton as L,BoxChip as S,Chip as N,TopActionButtons as D,MagnifierButton as M,DeleteButton as z,CloseButton as A,ImageGallerySlides as R,ImageGallerySlide as Z,FocusableImageRegion as O,SlidePlaceholderImage as W,SlideImage as X,ThumbnailContainer as E,ThumbnailWrapper as F,ThumbnailItemContainer as P,ThumbnailItem as V,ThumbnailImage as _,FileInfoTextWrapper as B,FileInfoFileName as H,FileInfoFileSize as q}from"./fullscreen-image-carousel.style.js";const G=e=>!!e&&"custom"===e.type,J=(h,J)=>{var K,{items:Q,initialActiveItemIndex:U,hideThumbnail:Y=!1,hideNavigation:ee=!1,hideCounter:ie=!1,hideMagnifier:te=!1,onDelete:ne,onClose:le,insets:re,show:oe}=h,ae=e(h,["items","initialActiveItemIndex","hideThumbnail","hideNavigation","hideCounter","hideMagnifier","onDelete","onClose","insets","show"]);const[de,se]=w(null!=U?U:0),[ce,ue]=m({}),[he,me]=m(1),[ve,fe]=m(),[ge,pe]=m(),be=v(null),$e=v([]),Ie=v([]),Ce=v(null),we=ve&&ge?ve-ge:0,je=Q[de],Te=Q.some((e=>{var i;return G(e)&&!!(null===(i=e.itemLabel)||void 0===i?void 0:i.trim())})),ke=Te?"item":"image",xe=f((()=>Q.some((e=>{var i,t;return(null===(i=e.fileName)||void 0===i?void 0:i.trim())||(null===(t=e.fileSize)||void 0===t?void 0:t.trim())}))),[Q]),ye=g((e=>{var i,t;const n=Q[e],l=Te?"Item":"Image",r=G(n)?(null===(i=n.itemLabel)||void 0===i?void 0:i.trim())||"":(null===(t=n.alt)||void 0===t?void 0:t.trim())||"",o=`${l} ${e+1} of ${Q.length}.`;return r?`${r}. ${o}`:o}),[Q,Te]);p(J,(()=>({currentItemIndex:de,setCurrentItem:ze,goToPrevItem:De,goToNextItem:Me}))),j("keydown",(function(e){"ArrowRight"===e.key?Me():"ArrowLeft"===e.key?De():"Escape"===e.key&&(null==le||le())}),"document"),b((()=>{var e;oe&&(null===(e=Ce.current)||void 0===e||e.focus())}),[oe]),b((()=>{0!==Q.length?de>Q.length-1&&se(Q.length-1):se(0)}),[de,Q.length,se]),b((()=>{var e,i;null===(i=null===(e=$e.current)||void 0===e?void 0:e[de])||void 0===i||i.scrollIntoView({behavior:"smooth",inline:"center"}),me(1)}),[de]);const Le=e=>{me(e.state.scale)};const Se=({src:e,height:i,width:t})=>{ue((n=>Object.assign(Object.assign({},n),{[e]:{height:i,width:t}})))},Ne=()=>{if(!je||G(je))return;const e=ce[je.src];if(be.current&&e){const{clientHeight:i,clientWidth:t}=be.current,{width:n,height:l}=e,r=l/n<i/t;return n<t&&l<i?r?t/n:i/l:r?i/(l/(n/t)):t/(n/(l/i))}},De=()=>{var e,i;null===(i=null===(e=Ie.current)||void 0===e?void 0:e[de])||void 0===i||i.resetTransform(),se((e=>0===e?Q.length-1:e-1),(e=>{c("polite"),u(ye(e),"polite")}))},Me=()=>{var e,i;null===(i=null===(e=Ie.current)||void 0===e?void 0:e[de])||void 0===i||i.resetTransform(),se((e=>e===Q.length-1?0:e+1),(e=>{c("polite"),u(ye(e),"polite")}))},ze=e=>{var i,t;null===(t=null===(i=Ie.current)||void 0===i?void 0:i[de])||void 0===t||t.resetTransform(),se(e)};return i(C,Object.assign({},ae,{"data-testid":"image-carousel-modal","aria-label":Te?"Carousel":"Image carousel",show:oe,disableInitialFocus:!0,children:t(T,{children:[t(k,{children:[t(x,{children:[i(y,{ref:be,onTouchStart:e=>{he<=1&&fe(e.touches[0].clientX)},onTouchMove:e=>{!ve||he>1||pe(e.touches[0].clientX)},onTouchEnd:()=>{be.current&&(Math.abs(we)>be.current.offsetWidth/3&&(we>0?Me():De()),fe(void 0),pe(void 0))},children:i(R,{style:{transform:`translateX(calc(${100*-de}% - ${we}px))`},children:Q.map(((e,t)=>{const n=t===de,l=Math.abs(t-de)<=1||0===de&&t===Q.length-1||de===Q.length-1&&0===t;return i(Z,{"data-testid":"slide-item",children:i(O,{ref:n?Ce:null,tabIndex:n?0:-1,children:G(e)?l?e.renderContent():i(W,{}):i($,{ref:e=>Ie.current[t]=e,panning:{disabled:he<=1},initialScale:1,onZoom:Le,onZoomStop:Le,onWheel:Le,children:i(I,{children:i(X,{src:e.src,alt:ye(t),placeholder:i(W,{}),fit:"scale-down",retrieveImageDimension:!0,setDimension:Se})})})})},t)}))})}),!ee&&t(n,{children:[i(L,{"aria-label":`Previous ${ke}`,"data-testid":"prev-btn",$position:"left",onClick:De,$insetLeft:null==re?void 0:re.left,$insetRight:null==re?void 0:re.right,children:i(l,{"aria-hidden":!0})}),i(L,{"aria-label":`Next ${ke}`,"data-testid":"forward-btn",$position:"right",onClick:Me,$insetLeft:null==re?void 0:re.left,$insetRight:null==re?void 0:re.right,children:i(r,{"aria-hidden":!0})})]}),!ie&&i(S,{"aria-hidden":"true",children:i(N,{weight:"semibold",children:`${de+1}/${Q.length}`})})]}),!Y&&i(E,{$insetBottom:null==re?void 0:re.bottom,"aria-hidden":"true",children:i(F,{children:Q.map(((e,t)=>{var n;const l=G(e)?e.thumbnailSrc:null!==(n=e.thumbnailSrc)&&void 0!==n?n:e.src;return i(P,{children:i(V,{"data-testid":"thumbnail-item",$active:t===de,onClick:()=>ze(t),ref:e=>$e.current[t]=e,children:l?i(_,{src:l,alt:`Thumbnail ${t+1}`,fit:"cover"}):i(W,{})})},t)}))})})]}),t(D,{$hasFileInfo:xe,$insetTop:null==re?void 0:re.top,$insetLeft:null==re?void 0:re.left,$insetRight:null==re?void 0:re.right,children:[xe&&(()=>{const{fileName:e,fileSize:n}=null!=je?je:{},l=null==e?void 0:e.trim(),r=null==n?void 0:n.trim();return t(B,{$centerContent:!r,"aria-live":"polite","aria-atomic":"true","data-testid":"file-info-bar",children:[l&&i(H,{weight:"semibold","data-testid":"file-info-name",children:l}),r&&i(q,{"data-testid":"file-info-size",children:r})]})})(),!te&&!G(je)&&i(M,{"aria-label":1===he?"Zoom in":"Zoom out",onClick:()=>{var e,i,t,n;if(1===he){const t=Ne();null===(i=null===(e=Ie.current)||void 0===e?void 0:e[de])||void 0===i||i.centerView(t),me(null!=t?t:1)}else me(1),null===(n=null===(t=Ie.current)||void 0===t?void 0:t[de])||void 0===n||n.resetTransform()},children:i(1===he?o:a,{"aria-hidden":!0})}),ne&&i(z,{"aria-label":`Delete ${G(je)&&(null===(K=je.itemLabel)||void 0===K?void 0:K.trim())||"image"}`,"data-testid":"delete-btn",onClick:()=>{je&&ne&&ne(je,de)},children:i(s,{"aria-hidden":!0})}),i(A,{"aria-label":Te?"Close carousel":"Close image carousel",onClick:le,children:i(d,{"aria-hidden":!0})})]})]})}))},K=h(J);export{J as Component,K as FullscreenImageCarousel};
|
|
2
2
|
//# sourceMappingURL=fullscreen-image-carousel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullscreen-image-carousel.js","sources":["../../src/fullscreen-image-carousel/fullscreen-image-carousel.tsx"],"sourcesContent":["import {\n ChevronLeftIcon,\n ChevronRightIcon,\n CrossIcon,\n MagnifierMinusIcon,\n MagnifierPlusIcon,\n} from \"@lifesg/react-icons\";\nimport { BinIcon } from \"@lifesg/react-icons/bin\";\nimport { announce, clearAnnouncer } from \"@react-aria/live-announcer\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n ReactZoomPanPinchContentRef,\n ReactZoomPanPinchRef,\n TransformComponent,\n TransformWrapper,\n} from \"react-zoom-pan-pinch\";\nimport { ModalV2 } from \"../modal-v2\";\nimport { useStateCallback } from \"../shared/hooks\";\nimport { useEventListener } from \"../util\";\nimport {\n ArrowButton,\n BoxChip,\n CarouselModalContent,\n Chip,\n CloseButton,\n DeleteButton,\n FileInfoFileName,\n FileInfoFileSize,\n FileInfoTextWrapper,\n FocusableImageRegion,\n ImageGalleryContainer,\n ImageGallerySlide,\n ImageGallerySlides,\n ImageGallerySwipe,\n ImageGalleryWrapper,\n MagnifierButton,\n SlideImage,\n SlidePlaceholderImage,\n ThumbnailContainer,\n ThumbnailImage,\n ThumbnailItem,\n ThumbnailItemContainer,\n ThumbnailWrapper,\n TopActionButtons,\n} from \"./fullscreen-image-carousel.style\";\nimport {\n FullscreenImageCarouselCustomItemProps,\n FullscreenImageCarouselItemProps,\n FullscreenImageCarouselProps,\n FullscreenImageCarouselRef,\n ImageDimension,\n} from \"./types\";\n\nconst isCustomItem = (\n item: FullscreenImageCarouselItemProps | undefined\n): item is FullscreenImageCarouselCustomItemProps =>\n !!item && item.type === \"custom\";\n\nexport const Component = (\n {\n items,\n initialActiveItemIndex,\n hideThumbnail = false,\n hideNavigation = false,\n hideCounter = false,\n hideMagnifier = false,\n onDelete,\n onClose,\n insets,\n show,\n ...otherProps\n }: FullscreenImageCarouselProps,\n ref: React.Ref<FullscreenImageCarouselRef>\n) => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [currentSlide, setCurrentSlide] = useStateCallback(\n initialActiveItemIndex ?? 0\n );\n const [imagesDimension, setImageDimension] = useState<\n Record<string, ImageDimension>\n >({});\n const [zoom, setZoom] = useState(1);\n const [startX, setStartX] = useState<number | undefined>();\n const [endX, setEndX] = useState<number | undefined>();\n const containerRef = useRef<HTMLDivElement>(null);\n const thumbnailRefs = useRef<(HTMLDivElement | null)[]>([]);\n const zoomRefs = useRef<(ReactZoomPanPinchContentRef | null)[]>([]);\n const imageRef = useRef<HTMLDivElement>(null);\n const diff = startX && endX ? startX - endX : 0;\n const currentItem = items[currentSlide];\n const hasAnyItemLabel = items.some(\n (item) => isCustomItem(item) && !!item.itemLabel?.trim()\n );\n const carouselItemNoun = hasAnyItemLabel ? \"item\" : \"image\";\n const hasFileInfo = useMemo(\n () =>\n items.some(\n (item) => item.fileName?.trim() || item.fileSize?.trim()\n ),\n [items]\n );\n\n const getItemAriaLabel = useCallback(\n (index: number) => {\n const item = items[index];\n const itemTypeLabel = hasAnyItemLabel ? \"Item\" : \"Image\";\n const prefix = isCustomItem(item)\n ? item.itemLabel?.trim() || \"\"\n : item.alt?.trim() || \"\";\n const positionLabel = `${itemTypeLabel} ${index + 1} of ${\n items.length\n }.`;\n\n return prefix ? `${prefix}. ${positionLabel}` : positionLabel;\n },\n [items, hasAnyItemLabel]\n );\n\n useImperativeHandle<FullscreenImageCarouselRef, FullscreenImageCarouselRef>(\n ref,\n () => ({\n currentItemIndex: currentSlide,\n setCurrentItem: goToSlide,\n goToPrevItem: goToPrevSlide,\n goToNextItem: goToNextSlide,\n })\n );\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEventListener(\"keydown\", handleKeyDown, \"document\");\n\n useEffect(() => {\n if (show) {\n imageRef.current?.focus();\n }\n }, [show]);\n\n useEffect(() => {\n if (items.length === 0) {\n setCurrentSlide(0);\n return;\n }\n\n if (currentSlide > items.length - 1) {\n setCurrentSlide(items.length - 1);\n }\n }, [currentSlide, items.length, setCurrentSlide]);\n\n useEffect(() => {\n thumbnailRefs.current?.[currentSlide]?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"center\",\n });\n setZoom(1);\n }, [currentSlide]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleTouchStart = (e: React.TouchEvent) => {\n if (zoom <= 1) setStartX(e.touches[0].clientX);\n };\n\n const handleTouchMove = (e: React.TouchEvent) => {\n if (!startX || zoom > 1) return;\n setEndX(e.touches[0].clientX);\n };\n\n const handleTouchEnd = () => {\n if (!containerRef.current) return;\n if (Math.abs(diff) > containerRef.current.offsetWidth / 3) {\n if (diff > 0) {\n goToNextSlide();\n } else {\n goToPrevSlide();\n }\n }\n setStartX(undefined);\n setEndX(undefined);\n };\n\n const handleZoom = (e: ReactZoomPanPinchRef) => {\n setZoom(e.state.scale);\n };\n\n const handleDelete = () => {\n if (currentItem && onDelete) {\n onDelete(currentItem, currentSlide);\n }\n };\n\n function handleKeyDown(e: KeyboardEvent) {\n if (e.key === \"ArrowRight\") {\n goToNextSlide();\n } else if (e.key === \"ArrowLeft\") {\n goToPrevSlide();\n } else if (e.key === \"Escape\") {\n onClose?.();\n }\n }\n\n const handleMagnifier = () => {\n if (zoom === 1) {\n const zoomRatio = getZoomRatio();\n zoomRefs.current?.[currentSlide]?.centerView(zoomRatio);\n setZoom(zoomRatio ?? 1);\n } else {\n setZoom(1);\n zoomRefs.current?.[currentSlide]?.resetTransform();\n }\n };\n\n const setDimension = ({\n src,\n height,\n width,\n }: {\n src: string;\n height: number;\n width: number;\n }) => {\n setImageDimension((oldState) => {\n return { ...oldState, [src]: { height, width } };\n });\n };\n\n const getZoomRatio = () => {\n if (!currentItem || isCustomItem(currentItem)) {\n return;\n }\n\n const imageDimension = imagesDimension[currentItem.src];\n\n if (containerRef.current && !!imageDimension) {\n const { clientHeight, clientWidth } = containerRef.current;\n const { width, height } = imageDimension;\n const isSmallImg = width < clientWidth && height < clientHeight;\n\n const isImgLandscapeRelativeToDevice =\n height / width < clientHeight / clientWidth;\n\n if (isSmallImg) {\n return isImgLandscapeRelativeToDevice\n ? clientWidth / width\n : clientHeight / height;\n }\n\n return isImgLandscapeRelativeToDevice\n ? clientHeight / (height / (width / clientWidth))\n : clientWidth / (width / (height / clientHeight));\n }\n };\n\n // =============================================================================\n // HELPER FUNCTIONS\n // =============================================================================\n const goToPrevSlide = () => {\n zoomRefs.current?.[currentSlide]?.resetTransform();\n setCurrentSlide(\n (prev) => (prev === 0 ? items.length - 1 : prev - 1),\n (slide) => {\n clearAnnouncer(\"polite\");\n announce(getItemAriaLabel(slide), \"polite\");\n }\n );\n };\n\n const goToNextSlide = () => {\n zoomRefs.current?.[currentSlide]?.resetTransform();\n setCurrentSlide(\n (prev) => (prev === items.length - 1 ? 0 : prev + 1),\n (slide) => {\n clearAnnouncer(\"polite\");\n announce(getItemAriaLabel(slide), \"polite\");\n }\n );\n };\n\n const goToSlide = (index: number) => {\n zoomRefs.current?.[currentSlide]?.resetTransform();\n setCurrentSlide(index);\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderSlides = () => {\n return (\n <ImageGallerySlides\n style={{\n transform: `translateX(calc(${\n -currentSlide * 100\n }% - ${diff}px))`,\n }}\n >\n {items.map((item, index) => {\n const isActive = index === currentSlide;\n const isActiveOrAdjacent =\n Math.abs(index - currentSlide) <= 1 ||\n (currentSlide === 0 && index === items.length - 1) ||\n (currentSlide === items.length - 1 && index === 0);\n\n return (\n <ImageGallerySlide key={index} data-testid=\"slide-item\">\n <FocusableImageRegion\n ref={isActive ? imageRef : null}\n tabIndex={isActive ? 0 : -1}\n >\n {isCustomItem(item) ? (\n isActiveOrAdjacent ? (\n item.renderContent()\n ) : (\n <SlidePlaceholderImage />\n )\n ) : (\n <TransformWrapper\n ref={(el) =>\n (zoomRefs.current[index] = el)\n }\n panning={{\n disabled: zoom <= 1,\n }}\n initialScale={1}\n onZoom={handleZoom}\n onZoomStop={handleZoom}\n onWheel={handleZoom}\n >\n <TransformComponent>\n <SlideImage\n src={item.src}\n alt={getItemAriaLabel(index)}\n placeholder={\n <SlidePlaceholderImage />\n }\n fit=\"scale-down\"\n retrieveImageDimension\n setDimension={setDimension}\n />\n </TransformComponent>\n </TransformWrapper>\n )}\n </FocusableImageRegion>\n </ImageGallerySlide>\n );\n })}\n </ImageGallerySlides>\n );\n };\n\n const renderFileInfo = () => {\n const { fileName, fileSize } = currentItem ?? {};\n const trimmedName = fileName?.trim();\n const trimmedSize = fileSize?.trim();\n\n return (\n <FileInfoTextWrapper\n $centerContent={!trimmedSize}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-testid=\"file-info-bar\"\n >\n {trimmedName && (\n <FileInfoFileName\n weight=\"semibold\"\n data-testid=\"file-info-name\"\n >\n {trimmedName}\n </FileInfoFileName>\n )}\n {trimmedSize && (\n <FileInfoFileSize data-testid=\"file-info-size\">\n {trimmedSize}\n </FileInfoFileSize>\n )}\n </FileInfoTextWrapper>\n );\n };\n\n const renderThumbnails = () => {\n return (\n <ThumbnailContainer\n $insetBottom={insets?.bottom}\n aria-hidden=\"true\"\n >\n <ThumbnailWrapper>\n {items.map((item, index) => {\n const src = isCustomItem(item)\n ? item.thumbnailSrc\n : item.thumbnailSrc ?? item.src;\n return (\n <ThumbnailItemContainer key={index}>\n <ThumbnailItem\n data-testid=\"thumbnail-item\"\n $active={index === currentSlide}\n onClick={() => goToSlide(index)}\n ref={(el) =>\n (thumbnailRefs.current[index] = el)\n }\n >\n {src ? (\n <ThumbnailImage\n src={src}\n alt={`Thumbnail ${index + 1}`}\n fit=\"cover\"\n />\n ) : (\n <SlidePlaceholderImage />\n )}\n </ThumbnailItem>\n </ThumbnailItemContainer>\n );\n })}\n </ThumbnailWrapper>\n </ThumbnailContainer>\n );\n };\n\n return (\n <ModalV2\n {...otherProps}\n data-testid=\"image-carousel-modal\"\n aria-label={hasAnyItemLabel ? \"Carousel\" : \"Image carousel\"}\n show={show}\n disableInitialFocus\n >\n <CarouselModalContent>\n <ImageGalleryContainer>\n <ImageGalleryWrapper>\n <ImageGallerySwipe\n ref={containerRef}\n onTouchStart={handleTouchStart}\n onTouchMove={handleTouchMove}\n onTouchEnd={handleTouchEnd}\n >\n {renderSlides()}\n </ImageGallerySwipe>\n\n {!hideNavigation && (\n <>\n <ArrowButton\n aria-label={`Previous ${carouselItemNoun}`}\n data-testid=\"prev-btn\"\n $position=\"left\"\n onClick={goToPrevSlide}\n $insetLeft={insets?.left}\n $insetRight={insets?.right}\n >\n <ChevronLeftIcon aria-hidden />\n </ArrowButton>\n <ArrowButton\n aria-label={`Next ${carouselItemNoun}`}\n data-testid=\"forward-btn\"\n $position=\"right\"\n onClick={goToNextSlide}\n $insetLeft={insets?.left}\n $insetRight={insets?.right}\n >\n <ChevronRightIcon aria-hidden />\n </ArrowButton>\n </>\n )}\n\n {!hideCounter && (\n <BoxChip aria-hidden=\"true\">\n <Chip weight=\"semibold\">{`${currentSlide + 1}/${\n items.length\n }`}</Chip>\n </BoxChip>\n )}\n </ImageGalleryWrapper>\n\n {!hideThumbnail && renderThumbnails()}\n </ImageGalleryContainer>\n <TopActionButtons\n $hasFileInfo={hasFileInfo}\n $insetTop={insets?.top}\n $insetLeft={insets?.left}\n $insetRight={insets?.right}\n >\n {hasFileInfo && renderFileInfo()}\n {!hideMagnifier && !isCustomItem(currentItem) && (\n <MagnifierButton\n aria-label={zoom === 1 ? \"Zoom in\" : \"Zoom out\"}\n onClick={handleMagnifier}\n >\n {zoom === 1 ? (\n <MagnifierPlusIcon aria-hidden />\n ) : (\n <MagnifierMinusIcon aria-hidden />\n )}\n </MagnifierButton>\n )}\n\n {onDelete && (\n <DeleteButton\n aria-label={`Delete ${\n (isCustomItem(currentItem) &&\n currentItem.itemLabel?.trim()) ||\n \"image\"\n }`}\n data-testid=\"delete-btn\"\n onClick={handleDelete}\n >\n <BinIcon aria-hidden />\n </DeleteButton>\n )}\n\n <CloseButton\n aria-label={\n hasAnyItemLabel\n ? \"Close carousel\"\n : \"Close image carousel\"\n }\n onClick={onClose}\n >\n <CrossIcon aria-hidden />\n </CloseButton>\n </TopActionButtons>\n </CarouselModalContent>\n </ModalV2>\n );\n};\n\nexport const FullscreenImageCarousel = forwardRef<\n FullscreenImageCarouselRef,\n FullscreenImageCarouselProps\n>(Component);\n"],"names":["isCustomItem","item","type","Component","_a","ref","items","initialActiveItemIndex","hideThumbnail","hideNavigation","hideCounter","hideMagnifier","onDelete","onClose","insets","show","otherProps","__rest","currentSlide","setCurrentSlide","useStateCallback","imagesDimension","setImageDimension","useState","zoom","setZoom","startX","setStartX","endX","setEndX","containerRef","useRef","thumbnailRefs","zoomRefs","imageRef","diff","currentItem","hasAnyItemLabel","some","itemLabel","trim","carouselItemNoun","hasFileInfo","useMemo","fileName","fileSize","_b","getItemAriaLabel","useCallback","index","itemTypeLabel","prefix","alt","positionLabel","length","useImperativeHandle","currentItemIndex","setCurrentItem","goToSlide","goToPrevItem","goToPrevSlide","goToNextItem","goToNextSlide","useEventListener","e","key","useEffect","current","focus","scrollIntoView","behavior","inline","handleZoom","state","scale","setDimension","src","height","width","oldState","Object","assign","getZoomRatio","imageDimension","clientHeight","clientWidth","isImgLandscapeRelativeToDevice","resetTransform","prev","slide","clearAnnouncer","announce","_jsx","ModalV2","disableInitialFocus","children","_jsxs","CarouselModalContent","ImageGalleryContainer","ImageGalleryWrapper","ImageGallerySwipe","onTouchStart","touches","clientX","onTouchMove","onTouchEnd","Math","abs","offsetWidth","undefined","ImageGallerySlides","style","transform","map","isActive","isActiveOrAdjacent","ImageGallerySlide","FocusableImageRegion","tabIndex","renderContent","SlidePlaceholderImage","TransformWrapper","el","panning","disabled","initialScale","onZoom","onZoomStop","onWheel","TransformComponent","SlideImage","placeholder","fit","retrieveImageDimension","_Fragment","ArrowButton","$position","onClick","$insetLeft","left","$insetRight","right","ChevronLeftIcon","ChevronRightIcon","BoxChip","Chip","weight","ThumbnailContainer","$insetBottom","bottom","ThumbnailWrapper","thumbnailSrc","ThumbnailItemContainer","ThumbnailItem","$active","ThumbnailImage","TopActionButtons","$hasFileInfo","$insetTop","top","trimmedName","trimmedSize","FileInfoTextWrapper","FileInfoFileName","FileInfoFileSize","renderFileInfo","MagnifierButton","zoomRatio","centerView","_d","_c","MagnifierPlusIcon","MagnifierMinusIcon","DeleteButton","BinIcon","CloseButton","CrossIcon","FullscreenImageCarousel","forwardRef"],"mappings":"qjDA6DA,MAAMA,EACFC,KAEEA,GAAsB,WAAdA,EAAKC,KAENC,EAAY,CACrBC,EAaAC,YAbAC,M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iBAAgBnD,SAE3BiE,IAGRC,GACGrE,EAACwE,EAAgB,CAAA,cAAa,iBAAgBrE,SACzCkE,MAGS,EAyGEI,IACd1J,KAAkBX,EAAaoC,KAC7BwD,EAAC0E,EAAe,CAAA,aACS,IAAT9I,GAAa,UAAY,WACrCiH,QA1RA,iBACpB,GAAa,IAATjH,GAAY,CACZ,MAAM+I,EAAYrF,KACc,QAAhCpC,EAAgB,QAAhB1C,EAAA6B,GAASkC,eAAO,IAAA/D,OAAA,EAAAA,EAAGc,WAAa,IAAA4B,GAAAA,EAAE0H,WAAWD,GAC7C9I,GAAQ8I,QAAAA,EAAa,EACzB,MACI9I,GAAQ,GACwB,QAAhCgJ,EAAgB,QAAhBC,EAAAzI,GAASkC,eAAO,IAAAuG,OAAA,EAAAA,EAAGxJ,WAAa,IAAAuJ,GAAAA,EAAElF,gBACtC,EAkR4CQ,SAGpBH,EADM,IAATpE,GACImJ,EAEAC,EAFiB,CAAA,eAAA,MAO7BhK,IACGgF,EAACiF,EAAY,CAAA,aACG,UACP7K,EAAaoC,cACVU,EAAAV,GAAYG,gCAAWC,SAC3B,UACF,cACU,aACZiG,QA5TH,KACbrG,IAAexB,IACfA,GAASwB,GAAalB,GAC1B,EAyTyC6E,SAErBH,EAACkF,wBAITlF,EAACmF,gBAEO1I,GACM,iBACA,uBAEVoG,QAAS5H,GAAOkF,SAEhBH,EAACoF,gCAIP,EAILC,EAA0BC,EAGrC/K"}
|
|
1
|
+
{"version":3,"file":"fullscreen-image-carousel.js","sources":["../../src/fullscreen-image-carousel/fullscreen-image-carousel.tsx"],"sourcesContent":["import {\n ChevronLeftIcon,\n ChevronRightIcon,\n CrossIcon,\n MagnifierMinusIcon,\n MagnifierPlusIcon,\n} from \"@lifesg/react-icons\";\nimport { BinIcon } from \"@lifesg/react-icons/bin\";\nimport { announce, clearAnnouncer } from \"@react-aria/live-announcer\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n ReactZoomPanPinchContentRef,\n ReactZoomPanPinchRef,\n TransformComponent,\n TransformWrapper,\n} from \"react-zoom-pan-pinch\";\nimport { ModalV2 } from \"../modal-v2\";\nimport { useStateCallback } from \"../shared/hooks\";\nimport { useEventListener } from \"../util\";\nimport {\n ArrowButton,\n BoxChip,\n CarouselModalContent,\n Chip,\n CloseButton,\n DeleteButton,\n FileInfoFileName,\n FileInfoFileSize,\n FileInfoTextWrapper,\n FocusableImageRegion,\n ImageGalleryContainer,\n ImageGallerySlide,\n ImageGallerySlides,\n ImageGallerySwipe,\n ImageGalleryWrapper,\n MagnifierButton,\n SlideImage,\n SlidePlaceholderImage,\n ThumbnailContainer,\n ThumbnailImage,\n ThumbnailItem,\n ThumbnailItemContainer,\n ThumbnailWrapper,\n TopActionButtons,\n} from \"./fullscreen-image-carousel.style\";\nimport {\n FullscreenImageCarouselCustomItemProps,\n FullscreenImageCarouselItemProps,\n FullscreenImageCarouselProps,\n FullscreenImageCarouselRef,\n ImageDimension,\n} from \"./types\";\n\nconst isCustomItem = (\n item: FullscreenImageCarouselItemProps | undefined\n): item is FullscreenImageCarouselCustomItemProps =>\n !!item && item.type === \"custom\";\n\nexport const Component = (\n {\n items,\n initialActiveItemIndex,\n hideThumbnail = false,\n hideNavigation = false,\n hideCounter = false,\n hideMagnifier = false,\n onDelete,\n onClose,\n insets,\n show,\n ...otherProps\n }: FullscreenImageCarouselProps,\n ref: React.Ref<FullscreenImageCarouselRef>\n) => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [currentSlide, setCurrentSlide] = useStateCallback(\n initialActiveItemIndex ?? 0\n );\n const [imagesDimension, setImageDimension] = useState<\n Record<string, ImageDimension>\n >({});\n const [zoom, setZoom] = useState(1);\n const [startX, setStartX] = useState<number | undefined>();\n const [endX, setEndX] = useState<number | undefined>();\n const containerRef = useRef<HTMLDivElement>(null);\n const thumbnailRefs = useRef<(HTMLDivElement | null)[]>([]);\n const zoomRefs = useRef<(ReactZoomPanPinchContentRef | null)[]>([]);\n const imageRef = useRef<HTMLDivElement>(null);\n const diff = startX && endX ? startX - endX : 0;\n const currentItem = items[currentSlide];\n const hasAnyItemLabel = items.some(\n (item) => isCustomItem(item) && !!item.itemLabel?.trim()\n );\n const carouselItemNoun = hasAnyItemLabel ? \"item\" : \"image\";\n const hasFileInfo = useMemo(\n () =>\n items.some(\n (item) => item.fileName?.trim() || item.fileSize?.trim()\n ),\n [items]\n );\n\n const getItemAriaLabel = useCallback(\n (index: number) => {\n const item = items[index];\n const itemTypeLabel = hasAnyItemLabel ? \"Item\" : \"Image\";\n const prefix = isCustomItem(item)\n ? item.itemLabel?.trim() || \"\"\n : item.alt?.trim() || \"\";\n const positionLabel = `${itemTypeLabel} ${index + 1} of ${\n items.length\n }.`;\n\n return prefix ? `${prefix}. ${positionLabel}` : positionLabel;\n },\n [items, hasAnyItemLabel]\n );\n\n useImperativeHandle<FullscreenImageCarouselRef, FullscreenImageCarouselRef>(\n ref,\n () => ({\n currentItemIndex: currentSlide,\n setCurrentItem: goToSlide,\n goToPrevItem: goToPrevSlide,\n goToNextItem: goToNextSlide,\n })\n );\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEventListener(\"keydown\", handleKeyDown, \"document\");\n\n useEffect(() => {\n if (show) {\n imageRef.current?.focus();\n }\n }, [show]);\n\n useEffect(() => {\n if (items.length === 0) {\n setCurrentSlide(0);\n return;\n }\n\n if (currentSlide > items.length - 1) {\n setCurrentSlide(items.length - 1);\n }\n }, [currentSlide, items.length, setCurrentSlide]);\n\n useEffect(() => {\n thumbnailRefs.current?.[currentSlide]?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"center\",\n });\n setZoom(1);\n }, [currentSlide]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleTouchStart = (e: React.TouchEvent) => {\n if (zoom <= 1) setStartX(e.touches[0].clientX);\n };\n\n const handleTouchMove = (e: React.TouchEvent) => {\n if (!startX || zoom > 1) return;\n setEndX(e.touches[0].clientX);\n };\n\n const handleTouchEnd = () => {\n if (!containerRef.current) return;\n if (Math.abs(diff) > containerRef.current.offsetWidth / 3) {\n if (diff > 0) {\n goToNextSlide();\n } else {\n goToPrevSlide();\n }\n }\n setStartX(undefined);\n setEndX(undefined);\n };\n\n const handleZoom = (e: ReactZoomPanPinchRef) => {\n setZoom(e.state.scale);\n };\n\n const handleDelete = () => {\n if (currentItem && onDelete) {\n onDelete(currentItem, currentSlide);\n }\n };\n\n function handleKeyDown(e: KeyboardEvent) {\n if (e.key === \"ArrowRight\") {\n goToNextSlide();\n } else if (e.key === \"ArrowLeft\") {\n goToPrevSlide();\n } else if (e.key === \"Escape\") {\n onClose?.();\n }\n }\n\n const handleMagnifier = () => {\n if (zoom === 1) {\n const zoomRatio = getZoomRatio();\n zoomRefs.current?.[currentSlide]?.centerView(zoomRatio);\n setZoom(zoomRatio ?? 1);\n } else {\n setZoom(1);\n zoomRefs.current?.[currentSlide]?.resetTransform();\n }\n };\n\n const setDimension = ({\n src,\n height,\n width,\n }: {\n src: string;\n height: number;\n width: number;\n }) => {\n setImageDimension((oldState) => {\n return { ...oldState, [src]: { height, width } };\n });\n };\n\n const getZoomRatio = () => {\n if (!currentItem || isCustomItem(currentItem)) {\n return;\n }\n\n const imageDimension = imagesDimension[currentItem.src];\n\n if (containerRef.current && !!imageDimension) {\n const { clientHeight, clientWidth } = containerRef.current;\n const { width, height } = imageDimension;\n const isSmallImg = width < clientWidth && height < clientHeight;\n\n const isImgLandscapeRelativeToDevice =\n height / width < clientHeight / clientWidth;\n\n if (isSmallImg) {\n return isImgLandscapeRelativeToDevice\n ? clientWidth / width\n : clientHeight / height;\n }\n\n return isImgLandscapeRelativeToDevice\n ? clientHeight / (height / (width / clientWidth))\n : clientWidth / (width / (height / clientHeight));\n }\n };\n\n // =============================================================================\n // HELPER FUNCTIONS\n // =============================================================================\n const goToPrevSlide = () => {\n zoomRefs.current?.[currentSlide]?.resetTransform();\n setCurrentSlide(\n (prev) => (prev === 0 ? items.length - 1 : prev - 1),\n (slide) => {\n clearAnnouncer(\"polite\");\n announce(getItemAriaLabel(slide), \"polite\");\n }\n );\n };\n\n const goToNextSlide = () => {\n zoomRefs.current?.[currentSlide]?.resetTransform();\n setCurrentSlide(\n (prev) => (prev === items.length - 1 ? 0 : prev + 1),\n (slide) => {\n clearAnnouncer(\"polite\");\n announce(getItemAriaLabel(slide), \"polite\");\n }\n );\n };\n\n const goToSlide = (index: number) => {\n zoomRefs.current?.[currentSlide]?.resetTransform();\n setCurrentSlide(index);\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderSlides = () => {\n return (\n <ImageGallerySlides\n style={{\n transform: `translateX(calc(${\n -currentSlide * 100\n }% - ${diff}px))`,\n }}\n >\n {items.map((item, index) => {\n const isActive = index === currentSlide;\n const isActiveOrAdjacent =\n Math.abs(index - currentSlide) <= 1 ||\n (currentSlide === 0 && index === items.length - 1) ||\n (currentSlide === items.length - 1 && index === 0);\n\n return (\n <ImageGallerySlide key={index} data-testid=\"slide-item\">\n <FocusableImageRegion\n ref={isActive ? imageRef : null}\n tabIndex={isActive ? 0 : -1}\n >\n {isCustomItem(item) ? (\n isActiveOrAdjacent ? (\n item.renderContent()\n ) : (\n <SlidePlaceholderImage />\n )\n ) : (\n <TransformWrapper\n ref={(el) =>\n (zoomRefs.current[index] = el)\n }\n panning={{\n disabled: zoom <= 1,\n }}\n initialScale={1}\n onZoom={handleZoom}\n onZoomStop={handleZoom}\n onWheel={handleZoom}\n >\n <TransformComponent>\n <SlideImage\n src={item.src}\n alt={getItemAriaLabel(index)}\n placeholder={\n <SlidePlaceholderImage />\n }\n fit=\"scale-down\"\n retrieveImageDimension\n setDimension={setDimension}\n />\n </TransformComponent>\n </TransformWrapper>\n )}\n </FocusableImageRegion>\n </ImageGallerySlide>\n );\n })}\n </ImageGallerySlides>\n );\n };\n\n const renderFileInfo = () => {\n const { fileName, fileSize } = currentItem ?? {};\n const trimmedName = fileName?.trim();\n const trimmedSize = fileSize?.trim();\n\n return (\n <FileInfoTextWrapper\n $centerContent={!trimmedSize}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-testid=\"file-info-bar\"\n >\n {trimmedName && (\n <FileInfoFileName\n weight=\"semibold\"\n data-testid=\"file-info-name\"\n >\n {trimmedName}\n </FileInfoFileName>\n )}\n {trimmedSize && (\n <FileInfoFileSize data-testid=\"file-info-size\">\n {trimmedSize}\n </FileInfoFileSize>\n )}\n </FileInfoTextWrapper>\n );\n };\n\n const renderThumbnails = () => {\n return (\n <ThumbnailContainer\n $insetBottom={insets?.bottom}\n aria-hidden=\"true\"\n >\n <ThumbnailWrapper>\n {items.map((item, index) => {\n const src = isCustomItem(item)\n ? item.thumbnailSrc\n : item.thumbnailSrc ?? item.src;\n return (\n <ThumbnailItemContainer key={index}>\n <ThumbnailItem\n data-testid=\"thumbnail-item\"\n $active={index === currentSlide}\n onClick={() => goToSlide(index)}\n ref={(el) =>\n (thumbnailRefs.current[index] = el)\n }\n >\n {src ? (\n <ThumbnailImage\n src={src}\n alt={`Thumbnail ${index + 1}`}\n fit=\"cover\"\n />\n ) : (\n <SlidePlaceholderImage />\n )}\n </ThumbnailItem>\n </ThumbnailItemContainer>\n );\n })}\n </ThumbnailWrapper>\n </ThumbnailContainer>\n );\n };\n\n return (\n <ModalV2\n {...otherProps}\n data-testid=\"image-carousel-modal\"\n aria-label={hasAnyItemLabel ? \"Carousel\" : \"Image carousel\"}\n show={show}\n disableInitialFocus\n >\n <CarouselModalContent>\n <ImageGalleryContainer>\n <ImageGalleryWrapper>\n <ImageGallerySwipe\n ref={containerRef}\n onTouchStart={handleTouchStart}\n onTouchMove={handleTouchMove}\n onTouchEnd={handleTouchEnd}\n >\n {renderSlides()}\n </ImageGallerySwipe>\n\n {!hideNavigation && (\n <>\n <ArrowButton\n aria-label={`Previous ${carouselItemNoun}`}\n data-testid=\"prev-btn\"\n $position=\"left\"\n onClick={goToPrevSlide}\n $insetLeft={insets?.left}\n $insetRight={insets?.right}\n >\n <ChevronLeftIcon aria-hidden />\n </ArrowButton>\n <ArrowButton\n aria-label={`Next ${carouselItemNoun}`}\n data-testid=\"forward-btn\"\n $position=\"right\"\n onClick={goToNextSlide}\n $insetLeft={insets?.left}\n $insetRight={insets?.right}\n >\n <ChevronRightIcon aria-hidden />\n </ArrowButton>\n </>\n )}\n\n {!hideCounter && (\n <BoxChip aria-hidden=\"true\">\n <Chip weight=\"semibold\">{`${currentSlide + 1}/${\n items.length\n }`}</Chip>\n </BoxChip>\n )}\n </ImageGalleryWrapper>\n\n {!hideThumbnail && renderThumbnails()}\n </ImageGalleryContainer>\n <TopActionButtons\n $hasFileInfo={hasFileInfo}\n $insetTop={insets?.top}\n $insetLeft={insets?.left}\n $insetRight={insets?.right}\n >\n {hasFileInfo && renderFileInfo()}\n {!hideMagnifier && !isCustomItem(currentItem) && (\n <MagnifierButton\n aria-label={zoom === 1 ? \"Zoom in\" : \"Zoom out\"}\n onClick={handleMagnifier}\n >\n {zoom === 1 ? (\n <MagnifierPlusIcon aria-hidden />\n ) : (\n <MagnifierMinusIcon aria-hidden />\n )}\n </MagnifierButton>\n )}\n\n {onDelete && (\n <DeleteButton\n aria-label={`Delete ${\n (isCustomItem(currentItem) &&\n currentItem.itemLabel?.trim()) ||\n \"image\"\n }`}\n data-testid=\"delete-btn\"\n onClick={handleDelete}\n >\n <BinIcon aria-hidden />\n </DeleteButton>\n )}\n\n <CloseButton\n aria-label={\n hasAnyItemLabel\n ? \"Close carousel\"\n : \"Close image carousel\"\n }\n onClick={onClose}\n >\n <CrossIcon aria-hidden />\n </CloseButton>\n </TopActionButtons>\n </CarouselModalContent>\n </ModalV2>\n );\n};\n\nexport const FullscreenImageCarousel = forwardRef<\n FullscreenImageCarouselRef,\n FullscreenImageCarouselProps\n>(Component);\n"],"names":["isCustomItem","item","type","Component","_a","ref","items","initialActiveItemIndex","hideThumbnail","hideNavigation","hideCounter","hideMagnifier","onDelete","onClose","insets","show","otherProps","__rest","currentSlide","setCurrentSlide","useStateCallback","imagesDimension","setImageDimension","useState","zoom","setZoom","startX","setStartX","endX","setEndX","containerRef","useRef","thumbnailRefs","zoomRefs","imageRef","diff","currentItem","hasAnyItemLabel","some","itemLabel","trim","carouselItemNoun","hasFileInfo","useMemo","fileName","fileSize","_b","getItemAriaLabel","useCallback","index","itemTypeLabel","prefix","alt","positionLabel","length","useImperativeHandle","currentItemIndex","setCurrentItem","goToSlide","goToPrevItem","goToPrevSlide","goToNextItem","goToNextSlide","useEventListener","e","key","useEffect","current","focus","scrollIntoView","behavior","inline","handleZoom","state","scale","setDimension","src","height","width","oldState","Object","assign","getZoomRatio","imageDimension","clientHeight","clientWidth","isImgLandscapeRelativeToDevice","resetTransform","prev","slide","clearAnnouncer","announce","_jsx","ModalV2","disableInitialFocus","children","_jsxs","CarouselModalContent","ImageGalleryContainer","ImageGalleryWrapper","ImageGallerySwipe","onTouchStart","touches","clientX","onTouchMove","onTouchEnd","Math","abs","offsetWidth","undefined","ImageGallerySlides","style","transform","map","isActive","isActiveOrAdjacent","ImageGallerySlide","FocusableImageRegion","tabIndex","renderContent","SlidePlaceholderImage","TransformWrapper","el","panning","disabled","initialScale","onZoom","onZoomStop","onWheel","TransformComponent","SlideImage","placeholder","fit","retrieveImageDimension","_Fragment","ArrowButton","$position","onClick","$insetLeft","left","$insetRight","right","ChevronLeftIcon","ChevronRightIcon","BoxChip","Chip","weight","ThumbnailContainer","$insetBottom","bottom","ThumbnailWrapper","thumbnailSrc","ThumbnailItemContainer","ThumbnailItem","$active","ThumbnailImage","TopActionButtons","$hasFileInfo","$insetTop","top","trimmedName","trimmedSize","FileInfoTextWrapper","FileInfoFileName","FileInfoFileSize","renderFileInfo","MagnifierButton","zoomRatio","centerView","_d","_c","MagnifierPlusIcon","MagnifierMinusIcon","DeleteButton","BinIcon","CloseButton","CrossIcon","FullscreenImageCarousel","forwardRef"],"mappings":"u+CA6DA,MAAMA,EACFC,KAEEA,G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AM,cACN,0BAEXD,GACGpE,EAACuE,GACGjB,OAAO,WAAU,cACL,iBAAgBnD,SAE3BiE,IAGRC,GACGrE,EAACwE,EAAgB,CAAA,cAAa,iBAAgBrE,SACzCkE,MAGS,EAyGEI,IACd1J,KAAkBX,EAAaoC,KAC7BwD,EAAC0E,EAAe,CAAA,aACS,IAAT9I,GAAa,UAAY,WACrCiH,QA1RA,iBACpB,GAAa,IAATjH,GAAY,CACZ,MAAM+I,EAAYrF,KACc,QAAhCpC,EAAgB,QAAhB1C,EAAA6B,GAASkC,eAAO,IAAA/D,OAAA,EAAAA,EAAGc,WAAa,IAAA4B,GAAAA,EAAE0H,WAAWD,GAC7C9I,GAAQ8I,QAAAA,EAAa,EACzB,MACI9I,GAAQ,GACwB,QAAhCgJ,EAAgB,QAAhBC,EAAAzI,GAASkC,eAAO,IAAAuG,OAAA,EAAAA,EAAGxJ,WAAa,IAAAuJ,GAAAA,EAAElF,gBACtC,EAkR4CQ,SAGpBH,EADM,IAATpE,GACImJ,EAEAC,EAFiB,CAAA,eAAA,MAO7BhK,IACGgF,EAACiF,EAAY,CAAA,aACG,UACP7K,EAAaoC,cACVU,EAAAV,GAAYG,gCAAWC,SAC3B,UACF,cACU,aACZiG,QA5TH,KACbrG,IAAexB,IACfA,GAASwB,GAAalB,GAC1B,EAyTyC6E,SAErBH,EAACkF,wBAITlF,EAACmF,gBAEO1I,GACM,iBACA,uBAEVoG,QAAS5H,GAAOkF,SAEhBH,EAACoF,gCAIP,EAILC,EAA0BC,EAGrC/K"}
|
package/modal/modal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e}from"../_virtual/_tslib.js";import{jsx as
|
|
1
|
+
import{__rest as e}from"../_virtual/_tslib.js";import{jsx as r}from"react/jsx-runtime";import o,{useRef as t}from"react";import{Overlay as i}from"../overlay/overlay.js";import{useViewport as l}from"../shared/hooks/useViewport.js";import"../util/calendar-helper.js";import"../util/date-helper.js";import"../util/date-input-helper.js";import"../util/simple-id-generator.js";import"../util/string-helper.js";import"@react-aria/live-announcer";import{useEvent as a}from"../util/use-event.js";import{Container as n}from"./modal.styles.js";const m=m=>{var{id:s="modal",show:d,animationFrom:c="bottom",children:p,enableOverlayClick:v=!0,rootComponentId:h,zIndex:u,onOverlayClick:y,dismissKeyboardOnShow:j=!0}=m,b=e(m,["id","show","animationFrom","children","enableOverlayClick","rootComponentId","zIndex","onOverlayClick","dismissKeyboardOnShow"]);const f=a((()=>{var e,r;j&&(null===(r=null===(e=document.activeElement)||void 0===e?void 0:e.blur)||void 0===r||r.call(e))})),{verticalHeight:O,ready:C}=l({enabled:d,onBeforeStart:f}),k=t(null),w=p&&o.cloneElement(p,{ref:k});return r(i,{"data-testid":`${s}-overlay`,show:d,enableOverlayClick:v,onOverlayClick:y,id:s,rootId:h,containerRef:k,zIndex:u,children:r(n,Object.assign({$show:d,$ready:C,$animationFrom:c,"data-testid":s,$verticalHeight:O},b,{children:w}))})};export{m as Modal};
|
|
2
2
|
//# sourceMappingURL=modal.js.map
|