@lifesg/react-design-system 3.4.0-canary.4 → 3.4.0-canary.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/badge/badge.style.d.ts +3 -3
- package/badge/badge.style.js +8 -8
- package/badge/badge.style.js.map +1 -1
- package/badge/types.d.ts +1 -1
- package/cjs/badge/badge.style.js +11 -11
- package/cjs/badge/badge.style.js.map +1 -1
- package/cjs/date-input/date-input.js +1 -1
- package/cjs/date-input/date-input.js.map +1 -1
- package/cjs/error-display/error-display-data.js +1 -1
- package/cjs/error-display/error-display-data.js.map +1 -1
- package/cjs/filter/filter-badge.js +2 -0
- package/cjs/filter/filter-badge.js.map +1 -0
- package/cjs/filter/filter-modal.js +1 -1
- package/cjs/filter/filter-modal.js.map +1 -1
- package/cjs/filter/filter-modal.styles.js +20 -12
- package/cjs/filter/filter-modal.styles.js.map +1 -1
- package/cjs/filter/filter-sidebar.js +1 -1
- package/cjs/filter/filter-sidebar.js.map +1 -1
- package/cjs/filter/filter-sidebar.styles.js +19 -14
- package/cjs/filter/filter-sidebar.styles.js.map +1 -1
- package/cjs/form/form-wrapper.js +1 -1
- package/cjs/form/form-wrapper.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/index.js +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/shared/standalone-date-input/standalone-date-input.js +1 -1
- package/cjs/shared/standalone-date-input/standalone-date-input.js.map +1 -1
- package/cjs/shared/standalone-date-input/standalone-date-input.style.js +19 -16
- package/cjs/shared/standalone-date-input/standalone-date-input.style.js.map +1 -1
- package/cjs/theme/colour-primitive/specs/careercompass-colour-set.js +2 -0
- package/cjs/theme/colour-primitive/specs/careercompass-colour-set.js.map +1 -0
- package/cjs/theme/colour-primitive/theme-helper.js +1 -1
- package/cjs/theme/colour-primitive/theme-helper.js.map +1 -1
- package/cjs/theme/colour-semantic/specs/a11yplayground-semantic-tokens.js +1 -1
- package/cjs/theme/colour-semantic/specs/a11yplayground-semantic-tokens.js.map +1 -1
- package/cjs/theme/colour-semantic/specs/lifesg-semantic-tokens.js +1 -1
- package/cjs/theme/colour-semantic/specs/lifesg-semantic-tokens.js.map +1 -1
- package/cjs/theme/colour-semantic/specs/pa-semantic-tokens.js +1 -1
- package/cjs/theme/colour-semantic/specs/pa-semantic-tokens.js.map +1 -1
- package/cjs/theme/colour-semantic/specs/sgwdigitallobby-tokens.js +1 -1
- package/cjs/theme/colour-semantic/specs/sgwdigitallobby-tokens.js.map +1 -1
- package/cjs/theme/colour-semantic/theme-helper.js +1 -1
- package/cjs/theme/colour-semantic/theme-helper.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/cjs/timepicker/timepicker.js +1 -1
- package/cjs/timepicker/timepicker.js.map +1 -1
- package/cjs/timepicker/timepicker.styles.js +4 -3
- package/cjs/timepicker/timepicker.styles.js.map +1 -1
- package/date-input/date-input.js +1 -1
- package/date-input/date-input.js.map +1 -1
- package/error-display/error-display-data.js +1 -1
- package/error-display/error-display-data.js.map +1 -1
- package/filter/filter-badge.d.ts +5 -0
- package/filter/filter-badge.js +2 -0
- package/filter/filter-badge.js.map +1 -0
- package/filter/filter-modal.d.ts +1 -1
- package/filter/filter-modal.js +1 -1
- package/filter/filter-modal.js.map +1 -1
- package/filter/filter-modal.styles.d.ts +2 -0
- package/filter/filter-modal.styles.js +24 -16
- package/filter/filter-modal.styles.js.map +1 -1
- package/filter/filter-sidebar.d.ts +1 -1
- package/filter/filter-sidebar.js +1 -1
- package/filter/filter-sidebar.js.map +1 -1
- package/filter/filter-sidebar.styles.d.ts +1 -0
- package/filter/filter-sidebar.styles.js +19 -14
- package/filter/filter-sidebar.styles.js.map +1 -1
- package/filter/filter.d.ts +2 -2
- package/filter/types.d.ts +1 -0
- package/form/form-wrapper.js +1 -1
- package/form/form-wrapper.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/index.js +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/shared/standalone-date-input/standalone-date-input.js +1 -1
- package/shared/standalone-date-input/standalone-date-input.js.map +1 -1
- package/shared/standalone-date-input/standalone-date-input.style.d.ts +2 -1
- package/shared/standalone-date-input/standalone-date-input.style.js +20 -17
- package/shared/standalone-date-input/standalone-date-input.style.js.map +1 -1
- package/theme/colour-primitive/specs/careercompass-colour-set.d.ts +3 -0
- package/theme/colour-primitive/specs/careercompass-colour-set.js +2 -0
- package/theme/colour-primitive/specs/careercompass-colour-set.js.map +1 -0
- package/theme/colour-primitive/theme-helper.js +1 -1
- package/theme/colour-primitive/theme-helper.js.map +1 -1
- package/theme/colour-semantic/specs/a11yplayground-semantic-tokens.js +1 -1
- package/theme/colour-semantic/specs/a11yplayground-semantic-tokens.js.map +1 -1
- package/theme/colour-semantic/specs/lifesg-semantic-tokens.js +1 -1
- package/theme/colour-semantic/specs/lifesg-semantic-tokens.js.map +1 -1
- package/theme/colour-semantic/specs/pa-semantic-tokens.js +1 -1
- package/theme/colour-semantic/specs/pa-semantic-tokens.js.map +1 -1
- package/theme/colour-semantic/specs/sgwdigitallobby-tokens.js +1 -1
- package/theme/colour-semantic/specs/sgwdigitallobby-tokens.js.map +1 -1
- package/theme/colour-semantic/theme-helper.js +1 -1
- package/theme/colour-semantic/theme-helper.js.map +1 -1
- package/theme/colour-semantic/types.d.ts +8 -0
- 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.d.ts +27 -0
- package/theme/index.js +1 -1
- package/theme/index.js.map +1 -1
- package/theme/types.d.ts +3 -3
- package/timepicker/timepicker.js +1 -1
- package/timepicker/timepicker.js.map +1 -1
- package/timepicker/timepicker.styles.d.ts +6 -2
- package/timepicker/timepicker.styles.js +3 -2
- package/timepicker/timepicker.styles.js.map +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,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,aAA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,EAAmBkB,EAA2B,WAAGC,GACtDG,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,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,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nDG,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-badge.js","sources":["../../src/filter/filter-badge.tsx"],"sourcesContent":["import { Badge } from \"../badge\";\n\ninterface FilterBadgeProps {\n count?: number;\n}\n\nexport const FilterBadge = ({ count }: FilterBadgeProps) =>\n count !== undefined && count > 0 ? (\n <Badge\n count={count}\n variant=\"square-number\"\n aria-label={`${count} selected`}\n />\n ) : null;\n"],"names":["FilterBadge","count","undefined","_jsx","Badge","variant"],"mappings":"kFAMO,MAAMA,EAAc,EAAGC,gBAChBC,IAAVD,GAAuBA,EAAQ,EAC3BE,EAACC,EAAK,CACFH,MAAOA,EACPI,QAAQ,6BACI,GAAGJ,eAEnB"}
|
package/filter/filter-modal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterModalProps } from "./types";
|
|
2
2
|
export declare const FilterModal: {
|
|
3
|
-
({ customLabels, onClear, onDone, onDismiss, onModalOpen, toggleFilterButtonStyle, clearButtonDisabled, insets, children, toggleFilterButtonLabel: _toggleFilterButtonLabel, headerTitle: _headerTitle, doneButtonLabel: _doneButtonLabel, ...otherProps }: FilterModalProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ customLabels, onClear, onDone, onDismiss, onModalOpen, toggleFilterButtonStyle, clearButtonDisabled, insets, count, children, toggleFilterButtonLabel: _toggleFilterButtonLabel, headerTitle: _headerTitle, doneButtonLabel: _doneButtonLabel, ...otherProps }: FilterModalProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
package/filter/filter-modal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e}from"../_virtual/_tslib.js";import{jsxs as l,jsx as t}from"react/jsx-runtime";import{useFloating as o,FloatingFocusManager as i}from"@floating-ui/react";import{FilterIcon as
|
|
1
|
+
import{__rest as e}from"../_virtual/_tslib.js";import{jsxs as l,jsx as t}from"react/jsx-runtime";import{useFloating as o,FloatingFocusManager as i}from"@floating-ui/react";import{FilterIcon as n,CrossIcon as r}from"@lifesg/react-icons";import{useRef as a,useState as d,useEffect as s}from"react";import{Overlay as c}from"../overlay/overlay.js";import{inertValue as u}from"../shared/accessibility/index.js";import{FilterBadge as m}from"./filter-badge.js";import{FilterContext as b}from"./filter-context.js";import{FilterButton as h,FilterToggleContent as f,FloatingWrapper as g,MobileOverlayContainer as p,MobileContainer as v,FilterHeader as y,FilterTitleGroup as B,FilterTitle as j,FilterClearButton as F}from"./filter-modal.styles.js";import{FilterHeaderButton as L,FilterBody as x,FilterFooter as C,FilterDoneButton as D}from"./filter.styles.js";const T=T=>{var{customLabels:k,onClear:O,onDone:$,onDismiss:w,onModalOpen:M,toggleFilterButtonStyle:N="light",clearButtonDisabled:S=!1,insets:_,count:H,children:I,toggleFilterButtonLabel:P,headerTitle:q,doneButtonLabel:z}=T,A=e(T,["customLabels","onClear","onDone","onDismiss","onModalOpen","toggleFilterButtonStyle","clearButtonDisabled","insets","count","children","toggleFilterButtonLabel","headerTitle","doneButtonLabel"]);const{context:E,refs:G}=o(),J=a(null),[K,Q]=d(!1),R={toggle:(null==k?void 0:k.toggleFilterButtonLabel)||P||"Filters",title:(null==k?void 0:k.headerTitle)||q||"Filters",done:(null==k?void 0:k.doneButtonLabel)||z||"Done",clear:(null==k?void 0:k.clearButtonLabel)||"Clear"};return s((()=>{var e;K&&(null===(e=J.current)||void 0===e||e.focus())}),[K]),l(b.Provider,{value:{mode:"mobile",rootNode:J},children:[t("div",Object.assign({},A,{children:t(h,{"data-testid":"filter-show-button",styleType:N,onClick:()=>{Q(!0),null==M||M()},type:"button",icon:t(n,{}),children:l(f,{children:[t("span",{children:R.toggle}),t(m,{count:H})]})})})),t(c,{show:K,disableTransition:!0,children:t(g,{inert:u(!K),children:t(i,{context:E,disabled:!K,children:t(p,{"data-id":"filter-mobile","data-testid":"filter-mobile",ref:G.setFloating,children:l(v,{ref:J,tabIndex:0,children:[l(y,{$insetTop:null==_?void 0:_.top,children:[t(L,{onClick:()=>{Q(!1),null==w||w()},focusOutline:"browser",focusHighlight:!1,"aria-label":`close ${R.title}`,children:t(r,{})}),l(B,{children:[t(j,{children:R.title}),t(m,{count:H})]}),t(F,{styleType:"link",type:"button",onClick:()=>null==O?void 0:O(),disabled:S,"aria-label":`clear ${R.title}`,children:R.clear})]}),t(x,{children:I}),t(C,{$insetBottom:null==_?void 0:_.bottom,children:t(D,{onClick:()=>{Q(!1),null==$||$()},children:R.done})})]})})})})})]})};T.displayName="Filter.Modal";export{T as FilterModal};
|
|
2
2
|
//# sourceMappingURL=filter-modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-modal.js","sources":["../../src/filter/filter-modal.tsx"],"sourcesContent":["import { FloatingFocusManager, useFloating } from \"@floating-ui/react\";\nimport { CrossIcon, FilterIcon } from \"@lifesg/react-icons\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { Overlay } from \"src/overlay\";\nimport { inertValue } from \"src/shared/accessibility\";\nimport { FilterContext } from \"./filter-context\";\nimport {\n FilterButton,\n FilterClearButton,\n FilterHeader,\n FilterTitle,\n FloatingWrapper,\n MobileContainer,\n MobileOverlayContainer,\n} from \"./filter-modal.styles\";\nimport { FilterModalProps } from \"./types\";\nimport {\n FilterBody,\n FilterDoneButton,\n FilterFooter,\n FilterHeaderButton,\n} from \"./filter.styles\";\n\nexport const FilterModal = ({\n customLabels,\n onClear,\n onDone,\n onDismiss,\n onModalOpen,\n toggleFilterButtonStyle = \"light\",\n clearButtonDisabled = false,\n insets,\n children,\n toggleFilterButtonLabel: _toggleFilterButtonLabel,\n headerTitle: _headerTitle,\n doneButtonLabel: _doneButtonLabel,\n ...otherProps\n}: FilterModalProps) => {\n const { context, refs } = useFloating();\n const nodeRef = useRef<HTMLDivElement>(null);\n\n const [visible, setVisible] = useState(false);\n\n const handleShow = () => setVisible(true);\n const handleDismiss = () => {\n setVisible(false);\n onDismiss?.();\n };\n const handleDone = () => {\n setVisible(false);\n onDone?.();\n };\n\n const handleShowFilter = () => {\n handleShow();\n onModalOpen?.();\n };\n\n const labels = {\n toggle:\n customLabels?.toggleFilterButtonLabel ||\n _toggleFilterButtonLabel ||\n \"Filters\",\n title: customLabels?.headerTitle || _headerTitle || \"Filters\",\n done: customLabels?.doneButtonLabel || _doneButtonLabel || \"Done\",\n clear: customLabels?.clearButtonLabel || \"Clear\",\n };\n\n useEffect(() => {\n if (visible) {\n nodeRef.current?.focus();\n }\n }, [visible]);\n\n return (\n <FilterContext.Provider value={{ mode: \"mobile\", rootNode: nodeRef }}>\n <div {...otherProps}>\n <FilterButton\n data-testid=\"filter-show-button\"\n styleType={toggleFilterButtonStyle}\n onClick={handleShowFilter}\n type=\"button\"\n icon={<FilterIcon />}\n >\n {labels.toggle}
|
|
1
|
+
{"version":3,"file":"filter-modal.js","sources":["../../src/filter/filter-modal.tsx"],"sourcesContent":["import { FloatingFocusManager, useFloating } from \"@floating-ui/react\";\nimport { CrossIcon, FilterIcon } from \"@lifesg/react-icons\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { Overlay } from \"src/overlay\";\nimport { inertValue } from \"src/shared/accessibility\";\nimport { FilterBadge } from \"./filter-badge\";\nimport { FilterContext } from \"./filter-context\";\nimport {\n FilterButton,\n FilterClearButton,\n FilterHeader,\n FilterTitle,\n FilterTitleGroup,\n FilterToggleContent,\n FloatingWrapper,\n MobileContainer,\n MobileOverlayContainer,\n} from \"./filter-modal.styles\";\nimport { FilterModalProps } from \"./types\";\nimport {\n FilterBody,\n FilterDoneButton,\n FilterFooter,\n FilterHeaderButton,\n} from \"./filter.styles\";\n\nexport const FilterModal = ({\n customLabels,\n onClear,\n onDone,\n onDismiss,\n onModalOpen,\n toggleFilterButtonStyle = \"light\",\n clearButtonDisabled = false,\n insets,\n count,\n children,\n toggleFilterButtonLabel: _toggleFilterButtonLabel,\n headerTitle: _headerTitle,\n doneButtonLabel: _doneButtonLabel,\n ...otherProps\n}: FilterModalProps) => {\n const { context, refs } = useFloating();\n const nodeRef = useRef<HTMLDivElement>(null);\n\n const [visible, setVisible] = useState(false);\n\n const handleShow = () => setVisible(true);\n const handleDismiss = () => {\n setVisible(false);\n onDismiss?.();\n };\n const handleDone = () => {\n setVisible(false);\n onDone?.();\n };\n\n const handleShowFilter = () => {\n handleShow();\n onModalOpen?.();\n };\n\n const labels = {\n toggle:\n customLabels?.toggleFilterButtonLabel ||\n _toggleFilterButtonLabel ||\n \"Filters\",\n title: customLabels?.headerTitle || _headerTitle || \"Filters\",\n done: customLabels?.doneButtonLabel || _doneButtonLabel || \"Done\",\n clear: customLabels?.clearButtonLabel || \"Clear\",\n };\n\n useEffect(() => {\n if (visible) {\n nodeRef.current?.focus();\n }\n }, [visible]);\n\n return (\n <FilterContext.Provider value={{ mode: \"mobile\", rootNode: nodeRef }}>\n <div {...otherProps}>\n <FilterButton\n data-testid=\"filter-show-button\"\n styleType={toggleFilterButtonStyle}\n onClick={handleShowFilter}\n type=\"button\"\n icon={<FilterIcon />}\n >\n <FilterToggleContent>\n <span>{labels.toggle}</span>\n <FilterBadge count={count} />\n </FilterToggleContent>\n </FilterButton>\n </div>\n <Overlay show={visible} disableTransition>\n <FloatingWrapper inert={inertValue(!visible)}>\n <FloatingFocusManager context={context} disabled={!visible}>\n <MobileOverlayContainer\n data-id=\"filter-mobile\"\n data-testid=\"filter-mobile\"\n ref={refs.setFloating}\n >\n <MobileContainer ref={nodeRef} tabIndex={0}>\n <FilterHeader $insetTop={insets?.top}>\n <FilterHeaderButton\n onClick={handleDismiss}\n focusOutline=\"browser\"\n focusHighlight={false}\n aria-label={`close ${labels.title}`}\n >\n <CrossIcon />\n </FilterHeaderButton>\n <FilterTitleGroup>\n <FilterTitle>\n {labels.title}\n </FilterTitle>\n <FilterBadge count={count} />\n </FilterTitleGroup>\n <FilterClearButton\n styleType=\"link\"\n type=\"button\"\n onClick={() => onClear?.()}\n disabled={clearButtonDisabled}\n aria-label={`clear ${labels.title}`}\n >\n {labels.clear}\n </FilterClearButton>\n </FilterHeader>\n <FilterBody>{children}</FilterBody>\n <FilterFooter $insetBottom={insets?.bottom}>\n <FilterDoneButton onClick={handleDone}>\n {labels.done}\n </FilterDoneButton>\n </FilterFooter>\n </MobileContainer>\n </MobileOverlayContainer>\n </FloatingFocusManager>\n </FloatingWrapper>\n </Overlay>\n </FilterContext.Provider>\n );\n};\n\nFilterModal.displayName = \"Filter.Modal\";\n"],"names":["FilterModal","_a","customLabels","onClear","onDone","onDismiss","onModalOpen","toggleFilterButtonStyle","clearButtonDisabled","insets","count","children","toggleFilterButtonLabel","_toggleFilterButtonLabel","headerTitle","_headerTitle","doneButtonLabel","_doneButtonLabel","otherProps","__rest","context","refs","useFloating","nodeRef","useRef","visible","setVisible","useState","labels","toggle","title","done","clear","clearButtonLabel","useEffect","current","focus","_jsxs","FilterContext","Provider","value","mode","rootNode","_jsx","Object","assign","FilterButton","styleType","onClick","type","icon","FilterIcon","FilterToggleContent","FilterBadge","Overlay","show","disableTransition","FloatingWrapper","inert","inertValue","FloatingFocusManager","disabled","MobileOverlayContainer","ref","setFloating","MobileContainer","tabIndex","FilterHeader","$insetTop","top","FilterHeaderButton","focusOutline","focusHighlight","CrossIcon","FilterTitleGroup","FilterTitle","FilterClearButton","FilterBody","FilterFooter","$insetBottom","bottom","FilterDoneButton","displayName"],"mappings":"i1BA0BO,MAAMA,EAAeC,IAAA,IAAAC,aACxBA,EAAYC,QACZA,EAAOC,OACPA,EAAMC,UACNA,EAASC,Y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rD,SAErB0B,EAAC4B,EAAe,CAACF,IAAKxC,EAAS2C,SAAU,EAACvD,SAAA,CACtC0B,EAAC8B,EAAY,CAAAC,UAAY3D,aAAM,EAANA,EAAQ4D,IAAG1D,SAAA,CAChCgC,EAAC2B,EAAkB,CACftB,QAzDd,KAClBtB,GAAW,GACXrB,SAAAA,GAAa,EAwDmBkE,aAAa,UACbC,gBAAgB,EAAK,aACT,SAAS5C,EAAOE,QAAOnB,SAEnCgC,EAAC8B,EAAS,CAAA,KAEdpC,EAACqC,EAAgB,CAAA/D,SAAA,CACbgC,EAACgC,EAAW,CAAAhE,SACPiB,EAAOE,QAEZa,EAACU,EAAW,CAAC3C,MAAOA,OAExBiC,EAACiC,EAAiB,CACd7B,UAAU,OACVE,KAAK,SACLD,QAAS,IAAM7C,aAAO,EAAPA,IACf0D,SAAUrD,EAAmB,aACjB,SAASoB,EAAOE,QAAOnB,SAElCiB,EAAOI,WAGhBW,EAACkC,EAAU,CAAAlE,SAAEA,IACbgC,EAACmC,EAAY,CAAAC,aAAetE,aAAM,EAANA,EAAQuE,OAAMrE,SACtCgC,EAACsC,EAAgB,CAACjC,QA9E/B,KACftB,GAAW,GACXtB,SAAAA,GAAU,EA4EuDO,SAChCiB,EAAOG,sBAQf,EAIjC/B,EAAYkF,YAAc"}
|
|
@@ -5,7 +5,9 @@ export declare const MobileContainer: import("styled-components/dist/types").ISt
|
|
|
5
5
|
export declare const MobileOverlayContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
6
6
|
export declare const FloatingWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
7
7
|
export declare const FilterHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$insetTop"> & FilterHeaderProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$insetTop"> & FilterHeaderProps, never>>> & string;
|
|
8
|
+
export declare const FilterTitleGroup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
8
9
|
export declare const FilterTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>>> & string;
|
|
10
|
+
export declare const FilterToggleContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
9
11
|
export declare const FilterClearButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("..").ButtonProps & import("react").RefAttributes<HTMLButtonElement>, never> & Partial<Pick<import("..").ButtonProps & import("react").RefAttributes<HTMLButtonElement>, never>>> & string & Omit<(props: import("..").ButtonProps & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null, keyof import("react").Component<any, {}, any>>;
|
|
10
12
|
export declare const FilterButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("..").ButtonWithIconProps & import("react").RefAttributes<HTMLButtonElement>, never> & Partial<Pick<import("..").ButtonWithIconProps & import("react").RefAttributes<HTMLButtonElement>, never>>> & string & Omit<(props: import("..").ButtonWithIconProps & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null, keyof import("react").Component<any, {}, any>>;
|
|
11
13
|
export {};
|
|
@@ -1,30 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
background-color: ${
|
|
1
|
+
import i from"styled-components";import{Button as t}from"../button/button.js";import{ButtonWithIcon as n}from"../button-with-icon/button-with-icon.js";import{Colour as o,Spacing as e,Font as a}from"../theme/index.js";const g=i.div`
|
|
2
|
+
background-color: ${o["bg-strong"]};
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
7
|
-
`,
|
|
8
|
-
background-color: ${
|
|
7
|
+
`,r=i.div`
|
|
8
|
+
background-color: ${o.bg};
|
|
9
9
|
height: 100%;
|
|
10
10
|
width: 100%;
|
|
11
|
-
`,
|
|
11
|
+
`,s=i.div`
|
|
12
12
|
height: 100%;
|
|
13
|
-
`,
|
|
13
|
+
`,d=i.div`
|
|
14
14
|
display: flex;
|
|
15
15
|
align-items: center;
|
|
16
|
-
background-color: ${
|
|
17
|
-
${
|
|
18
|
-
`,
|
|
19
|
-
${e["heading-xs-semibold"]}
|
|
16
|
+
background-color: ${o.bg};
|
|
17
|
+
${i=>i.$insetTop&&`padding-top: ${i.$insetTop}px;`}
|
|
18
|
+
`,p=i.div`
|
|
20
19
|
flex: 1;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
gap: ${e["spacing-8"]};
|
|
24
|
+
margin: ${e["spacing-24"]} 0;
|
|
25
|
+
`,c=i.h2`
|
|
26
|
+
${a["heading-xs-semibold"]}
|
|
27
|
+
`,l=i.span`
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: ${e["spacing-8"]};
|
|
31
|
+
`,m=i(t.Small)`
|
|
24
32
|
background-color: transparent;
|
|
25
33
|
height: 100%;
|
|
26
|
-
padding: ${
|
|
27
|
-
`,
|
|
34
|
+
padding: ${e["spacing-24"]} ${e["spacing-20"]};
|
|
35
|
+
`,h=i(n.Default)`
|
|
28
36
|
width: 100%;
|
|
29
|
-
`;export{
|
|
37
|
+
`;export{h as FilterButton,m as FilterClearButton,d as FilterHeader,c as FilterTitle,p as FilterTitleGroup,l as FilterToggleContent,s as FloatingWrapper,g as MobileContainer,r as MobileOverlayContainer};
|
|
30
38
|
//# sourceMappingURL=filter-modal.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-modal.styles.js","sources":["../../src/filter/filter-modal.styles.tsx"],"sourcesContent":["import styled from \"styled-components\";\nimport { Button } from \"../button\";\nimport { ButtonWithIcon } from \"../button-with-icon\";\nimport { Colour, Font, Spacing } from \"../theme\";\n\n// =============================================================================\n// STYLE INTERFACES\n// =============================================================================\ntype FilterHeaderProps = {\n $insetTop?: number | undefined;\n};\n\n// =============================================================================\n// CONTAINER STYLES\n// =============================================================================\n\nexport const MobileContainer = styled.div`\n background-color: ${Colour[\"bg-strong\"]};\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n`;\n\nexport const MobileOverlayContainer = styled.div`\n background-color: ${Colour[\"bg\"]};\n height: 100%;\n width: 100%;\n`;\n\nexport const FloatingWrapper = styled.div`\n height: 100%;\n`;\n\n// =============================================================================\n// HEADER STYLES\n// =============================================================================\n\nexport const FilterHeader = styled.div<FilterHeaderProps>`\n display: flex;\n align-items: center;\n background-color: ${Colour[\"bg\"]};\n ${(props) => props.$insetTop && `padding-top: ${props.$insetTop}px;`}\n`;\n\nexport const FilterTitle = styled.h2`\n ${Font[\"heading-xs-semibold\"]}\n
|
|
1
|
+
{"version":3,"file":"filter-modal.styles.js","sources":["../../src/filter/filter-modal.styles.tsx"],"sourcesContent":["import styled from \"styled-components\";\nimport { Button } from \"../button\";\nimport { ButtonWithIcon } from \"../button-with-icon\";\nimport { Colour, Font, Spacing } from \"../theme\";\n\n// =============================================================================\n// STYLE INTERFACES\n// =============================================================================\ntype FilterHeaderProps = {\n $insetTop?: number | undefined;\n};\n\n// =============================================================================\n// CONTAINER STYLES\n// =============================================================================\n\nexport const MobileContainer = styled.div`\n background-color: ${Colour[\"bg-strong\"]};\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n`;\n\nexport const MobileOverlayContainer = styled.div`\n background-color: ${Colour[\"bg\"]};\n height: 100%;\n width: 100%;\n`;\n\nexport const FloatingWrapper = styled.div`\n height: 100%;\n`;\n\n// =============================================================================\n// HEADER STYLES\n// =============================================================================\n\nexport const FilterHeader = styled.div<FilterHeaderProps>`\n display: flex;\n align-items: center;\n background-color: ${Colour[\"bg\"]};\n ${(props) => props.$insetTop && `padding-top: ${props.$insetTop}px;`}\n`;\n\nexport const FilterTitleGroup = styled.div`\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: ${Spacing[\"spacing-8\"]};\n margin: ${Spacing[\"spacing-24\"]} 0;\n`;\n\nexport const FilterTitle = styled.h2`\n ${Font[\"heading-xs-semibold\"]}\n`;\n\nexport const FilterToggleContent = styled.span`\n display: inline-flex;\n align-items: center;\n gap: ${Spacing[\"spacing-8\"]};\n`;\n\nexport const FilterClearButton = styled(Button.Small)`\n background-color: transparent;\n height: 100%;\n padding: ${Spacing[\"spacing-24\"]} ${Spacing[\"spacing-20\"]};\n`;\n\n// =============================================================================\n// COMPONENT STYLES\n// =============================================================================\n\nexport const FilterButton = styled(ButtonWithIcon.Default)`\n width: 100%;\n`;\n"],"names":["MobileContainer","styled","div","Colour","MobileOverlayContainer","FloatingWrapper","FilterHeader","props","$insetTop","FilterTitleGroup","Spacing","FilterTitle","h2","Font","FilterToggleContent","span","FilterClearButton","Button","Small","FilterButton","ButtonWithIcon","Default"],"mappings":"yNAgBO,MAAMA,EAAkBC,EAAOC,GAAG;wBACjBC,EAAO;;;;;EAOlBC,EAAyBH,EAAOC,GAAG;wBACxBC,EAAW;;;EAKtBE,EAAkBJ,EAAOC,GAAG;;EAQ5BI,EAAeL,EAAOC,GAAsB;;;wBAGjCC,EAAW;MAC5BI,GAAUA,EAAMC,WAAa,gBAAgBD,EAAMC;EAG7CC,EAAmBR,EAAOC,GAAG;;;;;WAK/BQ,EAAQ;cACLA,EAAQ;EAGTC,EAAcV,EAAOW,EAAE;MAC9BC,EAAK;EAGEC,EAAsBb,EAAOc,IAAI;;;WAGnCL,EAAQ;EAGNM,EAAoBf,EAAOgB,EAAOC,MAAM;;;eAGtCR,EAAQ,iBAAiBA,EAAQ;EAOnCS,EAAelB,EAAOmB,EAAeC,QAAQ;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterSidebarProps } from "./types";
|
|
2
2
|
export declare const FilterSidebar: {
|
|
3
|
-
({ customLabels, onClear, clearButtonDisabled, children, headerTitle: _headerTitle, ...otherProps }: FilterSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ customLabels, onClear, clearButtonDisabled, count, children, headerTitle: _headerTitle, ...otherProps }: FilterSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
package/filter/filter-sidebar.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 t,jsxs as l}from"react/jsx-runtime";import{useRef as r}from"react";import{FilterBadge as i}from"./filter-badge.js";import{FilterContext as o}from"./filter-context.js";import{DesktopContainer as a,FilterHeader as d,FilterTitleGroup as n,FilterTitle as s,FilterClearButton as c}from"./filter-sidebar.styles.js";import{FilterBody as m}from"./filter.styles.js";const u=u=>{var{customLabels:f,onClear:b,clearButtonDisabled:p=!1,count:h,children:j,headerTitle:v}=u,y=e(u,["customLabels","onClear","clearButtonDisabled","count","children","headerTitle"]);const k=r(null),C={title:(null==f?void 0:f.headerTitle)||v||"Filters",clear:(null==f?void 0:f.clearButtonLabel)||"Clear"};return t(o.Provider,{value:{mode:"default",rootNode:k},children:l(a,Object.assign({"data-id":"filter-desktop","data-testid":"filter-desktop",ref:k},y,{children:[l(d,{children:[l(n,{children:[t(s,{children:C.title}),t(i,{count:h})]}),t(c,{styleType:"link",type:"button",onClick:()=>null==b?void 0:b(),disabled:p,"aria-label":`clear ${C.title}`,children:C.clear})]}),t(m,{children:j})]}))})};u.displayName="Filter.Sidebar";export{u as FilterSidebar};
|
|
2
2
|
//# sourceMappingURL=filter-sidebar.js.map
|