@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-helper.js","sources":["../../../../src/theme/colour-semantic/theme-helper.ts"],"sourcesContent":["import { StyledComponentProps, getCollection, getValue } from \"../helpers\";\nimport { ThemeCollectionSpec } from \"../internal-types\";\nimport { ColourScheme, SemanticColourSet } from \"../types\";\nimport {\n LifeSGColourSet,\n LifeSGDarkColourSet,\n} from \"./specs/lifesg-semantic-tokens\";\nimport { PAColourSet } from \"./specs/pa-semantic-tokens\";\nimport {\n A11yPlaygroundColourSet,\n A11yPlaygroundDarkColourSet,\n} from \"./specs/a11yplayground-semantic-tokens\";\nimport { SemanticColourCollectionMap } from \"./types\";\nimport {\n SGWDigitalLobbyColourSet,\n SGWDigitalLobbyDarkColourSet,\n} from \"./specs/sgwdigitallobby-tokens\";\n\nexport const ColourSpec: ThemeCollectionSpec<\n SemanticColourCollectionMap,\n ColourScheme\n> = {\n collections: {\n lifesg: LifeSGColourSet,\n bookingsg: LifeSGColourSet,\n rbs: LifeSGColourSet,\n mylegacy: LifeSGColourSet,\n ccube: LifeSGColourSet,\n oneservice: LifeSGColourSet,\n pa: PAColourSet,\n a11yplayground: A11yPlaygroundColourSet,\n supportgowhere: LifeSGColourSet,\n sgwdigitallobby: SGWDigitalLobbyColourSet,\n imda: LifeSGColourSet,\n spf: LifeSGColourSet,\n smgs: LifeSGColourSet,\n },\n defaultValue: \"lifesg\",\n};\n\nexport const DarkColourSpec: ThemeCollectionSpec<\n SemanticColourCollectionMap,\n ColourScheme\n> = {\n collections: {\n lifesg: LifeSGDarkColourSet,\n bookingsg: LifeSGDarkColourSet,\n rbs: LifeSGDarkColourSet,\n mylegacy: LifeSGDarkColourSet,\n ccube: LifeSGDarkColourSet,\n oneservice: LifeSGDarkColourSet,\n pa: LifeSGDarkColourSet,\n a11yplayground: A11yPlaygroundDarkColourSet,\n supportgowhere: LifeSGDarkColourSet,\n sgwdigitallobby: SGWDigitalLobbyDarkColourSet,\n imda: LifeSGDarkColourSet,\n spf: LifeSGDarkColourSet,\n smgs: LifeSGDarkColourSet,\n },\n defaultValue: \"lifesg\",\n};\n\nexport const getSemanticColour = (key: keyof SemanticColourSet) => {\n return (props: StyledComponentProps): string => {\n const theme = props.theme;\n const isDarkMode = theme?.colourMode === \"dark\";\n\n // Select the appropriate color spec based on theme mode\n const spec = isDarkMode ? DarkColourSpec : ColourSpec;\n const colorSet: SemanticColourSet = getCollection(\n spec,\n theme?.colourScheme\n );\n\n // Check for mode-specific overrides first,\n // then fallback to general overrides\n const overrideKey = isDarkMode\n ? \"semanticColourDark\"\n : \"semanticColour\";\n const overrides = theme?.overrides?.[overrideKey];\n\n const colorValue = overrides\n ? getValue(colorSet, key, overrides)\n : colorSet[key];\n\n // If function, resolve with props\n if (typeof colorValue === \"function\") {\n return (colorValue as (props: any) => string)(props);\n }\n\n return colorValue as string;\n };\n};\n\nexport const ColourSemantic: {\n [key in keyof SemanticColourSet]: (props: StyledComponentProps) => string;\n} = {\n // text\n text: getSemanticColour(\"text\"),\n \"text-subtle\": getSemanticColour(\"text-subtle\"),\n \"text-subtler\": getSemanticColour(\"text-subtler\"),\n \"text-subtlest\": getSemanticColour(\"text-subtlest\"),\n \"text-primary\": getSemanticColour(\"text-primary\"),\n \"text-primary-strongest\": getSemanticColour(\"text-primary-strongest\"),\n\n \"text-hover\": getSemanticColour(\"text-hover\"),\n \"text-selected\": getSemanticColour(\"text-selected\"),\n \"text-selected-hover\": getSemanticColour(\"text-selected-hover\"),\n\n \"text-disabled\": getSemanticColour(\"text-disabled\"),\n \"text-disabled-subtle\": getSemanticColour(\"text-disabled-subtle\"),\n \"text-disabled-subtlest\": getSemanticColour(\"text-disabled-subtlest\"),\n \"text-selected-disabled\": getSemanticColour(\"text-selected-disabled\"),\n\n \"text-success\": getSemanticColour(\"text-success\"),\n \"text-warning\": getSemanticColour(\"text-warning\"),\n \"text-error\": getSemanticColour(\"text-error\"),\n \"text-info\": getSemanticColour(\"text-info\"),\n \"text-inverse\": getSemanticColour(\"text-inverse\"),\n\n // icon\n icon: getSemanticColour(\"icon\"),\n \"icon-subtle\": getSemanticColour(\"icon-subtle\"),\n \"icon-strongest\": getSemanticColour(\"icon-strongest\"),\n \"icon-primary\": getSemanticColour(\"icon-primary\"),\n \"icon-primary-subtle\": getSemanticColour(\"icon-primary-subtle\"),\n \"icon-primary-subtlest\": getSemanticColour(\"icon-primary-subtlest\"),\n\n \"icon-hover\": getSemanticColour(\"icon-hover\"),\n \"icon-selected\": getSemanticColour(\"icon-selected\"),\n \"icon-selected-hover\": getSemanticColour(\"icon-selected-hover\"),\n\n \"icon-disabled\": getSemanticColour(\"icon-disabled\"),\n \"icon-disabled-subtle\": getSemanticColour(\"icon-disabled-subtle\"),\n \"icon-selected-disabled\": getSemanticColour(\"icon-selected-disabled\"),\n\n \"icon-success\": getSemanticColour(\"icon-success\"),\n \"icon-warning\": getSemanticColour(\"icon-warning\"),\n \"icon-error\": getSemanticColour(\"icon-error\"),\n \"icon-error-strong\": getSemanticColour(\"icon-error-strong\"),\n \"icon-info\": getSemanticColour(\"icon-info\"),\n \"icon-inverse\": getSemanticColour(\"icon-inverse\"),\n \"icon-primary-inverse\": getSemanticColour(\"icon-primary-inverse\"),\n\n // border\n border: getSemanticColour(\"border\"),\n \"border-strong\": getSemanticColour(\"border-strong\"),\n \"border-stronger\": getSemanticColour(\"border-stronger\"),\n \"border-primary\": getSemanticColour(\"border-primary\"),\n \"border-primary-subtle\": getSemanticColour(\"border-primary-subtle\"),\n\n \"border-hover\": getSemanticColour(\"border-hover\"),\n \"border-hover-strong\": getSemanticColour(\"border-hover-strong\"),\n\n \"border-selected\": getSemanticColour(\"border-selected\"),\n \"border-selected-subtle\": getSemanticColour(\"border-selected-subtle\"),\n \"border-selected-subtlest\": getSemanticColour(\"border-selected-subtlest\"),\n \"border-selected-hover\": getSemanticColour(\"border-selected-hover\"),\n\n \"border-focus\": getSemanticColour(\"border-focus\"),\n \"border-focus-strong\": getSemanticColour(\"border-focus-strong\"),\n\n \"border-disabled\": getSemanticColour(\"border-disabled\"),\n \"border-selected-disabled\": getSemanticColour(\"border-selected-disabled\"),\n\n \"border-success\": getSemanticColour(\"border-success\"),\n \"border-warning\": getSemanticColour(\"border-warning\"),\n \"border-error\": getSemanticColour(\"border-error\"),\n \"border-error-focus\": getSemanticColour(\"border-error-focus\"),\n \"border-error-focus-strong\": getSemanticColour(\"border-error-focus-strong\"),\n \"border-error-strong\": getSemanticColour(\"border-error-strong\"),\n \"border-info\": getSemanticColour(\"border-info\"),\n\n // background\n bg: getSemanticColour(\"bg\"),\n \"bg-strong\": getSemanticColour(\"bg-strong\"),\n \"bg-stronger\": getSemanticColour(\"bg-stronger\"),\n \"bg-strongest\": getSemanticColour(\"bg-strongest\"),\n\n \"bg-hover\": getSemanticColour(\"bg-hover\"),\n \"bg-hover-strong\": getSemanticColour(\"bg-hover-strong\"),\n \"bg-hover-subtle\": getSemanticColour(\"bg-hover-subtle\"),\n \"bg-hover-neutral\": getSemanticColour(\"bg-hover-neutral\"),\n \"bg-hover-neutral-strong\": getSemanticColour(\"bg-hover-neutral-strong\"),\n\n \"bg-selected\": getSemanticColour(\"bg-selected\"),\n \"bg-selected-hover\": getSemanticColour(\"bg-selected-hover\"),\n \"bg-selected-strong\": getSemanticColour(\"bg-selected-strong\"),\n \"bg-selected-stronger\": getSemanticColour(\"bg-selected-stronger\"),\n \"bg-selected-strongest\": getSemanticColour(\"bg-selected-strongest\"),\n \"bg-selected-strongest-hover\": getSemanticColour(\n \"bg-selected-strongest-hover\"\n ),\n\n \"bg-disabled\": getSemanticColour(\"bg-disabled\"),\n \"bg-selected-disabled\": getSemanticColour(\"bg-selected-disabled\"),\n \"bg-selected-stronger-disabled\": getSemanticColour(\n \"bg-selected-stronger-disabled\"\n ),\n\n \"bg-success\": getSemanticColour(\"bg-success\"),\n \"bg-success-hover\": getSemanticColour(\"bg-success-hover\"),\n \"bg-success-strong\": getSemanticColour(\"bg-success-strong\"),\n \"bg-success-strong-hover\": getSemanticColour(\"bg-success-strong-hover\"),\n \"bg-warning\": getSemanticColour(\"bg-warning\"),\n \"bg-warning-hover\": getSemanticColour(\"bg-warning-hover\"),\n \"bg-warning-strong\": getSemanticColour(\"bg-warning-strong\"),\n \"bg-warning-strong-hover\": getSemanticColour(\"bg-warning-strong-hover\"),\n \"bg-info\": getSemanticColour(\"bg-info\"),\n \"bg-info-hover\": getSemanticColour(\"bg-info-hover\"),\n \"bg-info-strong\": getSemanticColour(\"bg-info-strong\"),\n \"bg-info-strong-hover\": getSemanticColour(\"bg-info-strong-hover\"),\n \"bg-error\": getSemanticColour(\"bg-error\"),\n \"bg-error-hover\": getSemanticColour(\"bg-error-hover\"),\n \"bg-error-strong\": getSemanticColour(\"bg-error-strong\"),\n \"bg-error-strong-hover\": getSemanticColour(\"bg-error-strong-hover\"),\n\n \"bg-inverse\": getSemanticColour(\"bg-inverse\"),\n \"bg-inverse-subtle\": getSemanticColour(\"bg-inverse-subtle\"),\n \"bg-inverse-subtler\": getSemanticColour(\"bg-inverse-subtler\"),\n \"bg-inverse-subtlest\": getSemanticColour(\"bg-inverse-subtlest\"),\n \"bg-inverse-hover\": getSemanticColour(\"bg-inverse-hover\"),\n\n \"bg-primary\": getSemanticColour(\"bg-primary\"),\n \"bg-primary-subtle\": getSemanticColour(\"bg-primary-subtle\"),\n \"bg-primary-subtler\": getSemanticColour(\"bg-primary-subtler\"),\n \"bg-primary-subtlest\": getSemanticColour(\"bg-primary-subtlest\"),\n \"bg-available\": getSemanticColour(\"bg-available\"),\n\n \"bg-primary-hover\": getSemanticColour(\"bg-primary-hover\"),\n \"bg-primary-subtlest-hover\": getSemanticColour(\"bg-primary-subtlest-hover\"),\n \"bg-primary-subtlest-selected\": getSemanticColour(\n \"bg-primary-subtlest-selected\"\n ),\n\n // overlay\n \"overlay-strong\": getSemanticColour(\"overlay-strong\"),\n \"overlay-subtle\": getSemanticColour(\"overlay-subtle\"),\n\n // hyperlink\n hyperlink: getSemanticColour(\"hyperlink\"),\n \"hyperlink-hover\": getSemanticColour(\"hyperlink-hover\"),\n \"hyperlink-visited\": getSemanticColour(\"hyperlink-visited\"),\n \"hyperlink-inverse\": getSemanticColour(\"hyperlink-inverse\"),\n\n // focus ring\n \"focus-ring\": getSemanticColour(\"focus-ring\"),\n \"focus-ring-inverse\": getSemanticColour(\"focus-ring-inverse\"),\n};\n"],"names":["ColourSpec","collections","lifesg","LifeSGColourSet","bookingsg","rbs","mylegacy","ccube","oneservice","pa","PAColourSet","a11yplayground","A11yPlaygroundColourSet","supportgowhere","sgwdigitallobby","SGWDigitalLobbyColourSet","imda","spf","smgs","defaultValue","DarkColourSpec","LifeSGDarkColourSet","A11yPlaygroundDarkColourSet","SGWDigitalLobbyDarkColourSet","getSemanticColour","key","props","theme","isDarkMode","colourMode","spec","colorSet","getCollection","colourScheme","overrideKey","overrides","_a","colorValue","getValue","ColourSemantic","text","icon","border","bg","hyperlink"],"mappings":"4OAkBO,MAAMA,EAGT,CACAC,YAAa,CACTC,OAAQC,EAAAA,gBACRC,UAAWD,EAAAA,gBACXE,IAAKF,EAAAA,gBACLG,SAAUH,EAAAA,gBACVI,MAAOJ,EAAAA,gBACPK,WAAYL,EAAAA,gBACZM,GAAIC,EAAAA,YACJC,eAAgBC,EAAAA,wBAChBC,eAAgBV,EAAAA,gBAChBW,gBAAiBC,EAAAA,yBACjBC,KAAMb,EAAAA,gBACNc,IAAKd,EAAAA,gBACLe,KAAMf,EAAAA,iBAEVgB,aAAc,UAGLC,EAGT,CACAnB,YAAa,CACTC,OAAQmB,EAAAA,oBACRjB,UAAWiB,EAAAA,oBACXhB,IAAKgB,EAAAA,oBACLf,SAAUe,EAAAA,oBACVd,MAAOc,EAAAA,oBACPb,WAAYa,EAAAA,oBACZZ,GAAIY,EAAAA,oBACJV,eAAgBW,EAAAA,4BAChBT,eAAgBQ,EAAAA,oBAChBP,gBAAiBS,EAAAA,6BACjBP,KAAMK,EAAAA,oBACNJ,IAAKI,EAAAA,oBACLH,KAAMG,EAAAA,qBA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iBA,EAAkB,iBACnC,iBAAkBA,EAAkB,kBACpC,uBAAwBA,EAAkB,wBAC1C,WAAYA,EAAkB,YAC9B,iBAAkBA,EAAkB,kBACpC,kBAAmBA,EAAkB,mBACrC,wBAAyBA,EAAkB,yBAE3C,aAAcA,EAAkB,cAChC,oBAAqBA,EAAkB,qBACvC,qBAAsBA,EAAkB,sBACxC,sBAAuBA,EAAkB,uBACzC,mBAAoBA,EAAkB,oBAEtC,aAAcA,EAAkB,cAChC,oBAAqBA,EAAkB,qBACvC,qBAAsBA,EAAkB,sBACxC,sBAAuBA,EAAkB,uBACzC,eAAgBA,EAAkB,gBAElC,mBAAoBA,EAAkB,oBACtC,4BAA6BA,EAAkB,6BAC/C,+BAAgCA,EAC5B,gCAIJ,iBAAkBA,EAAkB,kBACpC,iBAAkBA,EAAkB,kBAGpCoB,UAAWpB,EAAkB,aAC7B,kBAAmBA,EAAkB,mBACrC,oBAAqBA,EAAkB,qBACvC,oBAAqBA,EAAkB,qBAGvC,aAAcA,EAAkB,cAChC,qBAAsBA,EAAkB"}
|
|
1
|
+
{"version":3,"file":"theme-helper.js","sources":["../../../../src/theme/colour-semantic/theme-helper.ts"],"sourcesContent":["import { StyledComponentProps, getCollection, getValue } from \"../helpers\";\nimport { ThemeCollectionSpec } from \"../internal-types\";\nimport { ColourScheme, SemanticColourSet } from \"../types\";\nimport {\n LifeSGColourSet,\n LifeSGDarkColourSet,\n} from \"./specs/lifesg-semantic-tokens\";\nimport { PAColourSet } from \"./specs/pa-semantic-tokens\";\nimport {\n A11yPlaygroundColourSet,\n A11yPlaygroundDarkColourSet,\n} from \"./specs/a11yplayground-semantic-tokens\";\nimport { SemanticColourCollectionMap } from \"./types\";\nimport {\n SGWDigitalLobbyColourSet,\n SGWDigitalLobbyDarkColourSet,\n} from \"./specs/sgwdigitallobby-tokens\";\n\nexport const ColourSpec: ThemeCollectionSpec<\n SemanticColourCollectionMap,\n ColourScheme\n> = {\n collections: {\n lifesg: LifeSGColourSet,\n bookingsg: LifeSGColourSet,\n rbs: LifeSGColourSet,\n mylegacy: LifeSGColourSet,\n ccube: LifeSGColourSet,\n oneservice: LifeSGColourSet,\n pa: PAColourSet,\n a11yplayground: A11yPlaygroundColourSet,\n supportgowhere: LifeSGColourSet,\n sgwdigitallobby: SGWDigitalLobbyColourSet,\n imda: LifeSGColourSet,\n spf: LifeSGColourSet,\n smgs: LifeSGColourSet,\n careercompass: LifeSGColourSet,\n },\n defaultValue: \"lifesg\",\n};\n\nexport const DarkColourSpec: ThemeCollectionSpec<\n SemanticColourCollectionMap,\n ColourScheme\n> = {\n collections: {\n lifesg: LifeSGDarkColourSet,\n bookingsg: LifeSGDarkColourSet,\n rbs: LifeSGDarkColourSet,\n mylegacy: LifeSGDarkColourSet,\n ccube: LifeSGDarkColourSet,\n oneservice: LifeSGDarkColourSet,\n pa: LifeSGDarkColourSet,\n a11yplayground: A11yPlaygroundDarkColourSet,\n supportgowhere: LifeSGDarkColourSet,\n sgwdigitallobby: SGWDigitalLobbyDarkColourSet,\n imda: LifeSGDarkColourSet,\n spf: LifeSGDarkColourSet,\n smgs: LifeSGDarkColourSet,\n careercompass: LifeSGDarkColourSet,\n },\n defaultValue: \"lifesg\",\n};\n\nexport const getSemanticColour = (key: keyof SemanticColourSet) => {\n return (props: StyledComponentProps): string => {\n const theme = props.theme;\n const isDarkMode = theme?.colourMode === \"dark\";\n\n // Select the appropriate color spec based on theme mode\n const spec = isDarkMode ? DarkColourSpec : ColourSpec;\n const colorSet: SemanticColourSet = getCollection(\n spec,\n theme?.colourScheme\n );\n\n // Check for mode-specific overrides first,\n // then fallback to general overrides\n const overrideKey = isDarkMode\n ? \"semanticColourDark\"\n : \"semanticColour\";\n const overrides = theme?.overrides?.[overrideKey];\n\n const colorValue = overrides\n ? getValue(colorSet, key, overrides)\n : colorSet[key];\n\n // If function, resolve with props\n if (typeof colorValue === \"function\") {\n return (colorValue as (props: any) => string)(props);\n }\n\n return colorValue as string;\n };\n};\n\nexport const ColourSemantic: {\n [key in keyof SemanticColourSet]: (props: StyledComponentProps) => string;\n} = {\n // text\n text: getSemanticColour(\"text\"),\n \"text-subtle\": getSemanticColour(\"text-subtle\"),\n \"text-subtler\": getSemanticColour(\"text-subtler\"),\n \"text-subtlest\": getSemanticColour(\"text-subtlest\"),\n \"text-primary\": getSemanticColour(\"text-primary\"),\n \"text-primary-strongest\": getSemanticColour(\"text-primary-strongest\"),\n \"text-secondary\": getSemanticColour(\"text-secondary\"),\n \"text-secondary-subtle\": getSemanticColour(\"text-secondary-subtle\"),\n\n \"text-hover\": getSemanticColour(\"text-hover\"),\n \"text-selected\": getSemanticColour(\"text-selected\"),\n \"text-selected-hover\": getSemanticColour(\"text-selected-hover\"),\n\n \"text-disabled\": getSemanticColour(\"text-disabled\"),\n \"text-disabled-subtle\": getSemanticColour(\"text-disabled-subtle\"),\n \"text-disabled-subtlest\": getSemanticColour(\"text-disabled-subtlest\"),\n \"text-selected-disabled\": getSemanticColour(\"text-selected-disabled\"),\n\n \"text-success\": getSemanticColour(\"text-success\"),\n \"text-warning\": getSemanticColour(\"text-warning\"),\n \"text-error\": getSemanticColour(\"text-error\"),\n \"text-info\": getSemanticColour(\"text-info\"),\n \"text-inverse\": getSemanticColour(\"text-inverse\"),\n\n // icon\n icon: getSemanticColour(\"icon\"),\n \"icon-subtle\": getSemanticColour(\"icon-subtle\"),\n \"icon-strongest\": getSemanticColour(\"icon-strongest\"),\n \"icon-primary\": getSemanticColour(\"icon-primary\"),\n \"icon-primary-subtle\": getSemanticColour(\"icon-primary-subtle\"),\n \"icon-primary-subtlest\": getSemanticColour(\"icon-primary-subtlest\"),\n \"icon-secondary\": getSemanticColour(\"icon-secondary\"),\n \"icon-secondary-subtle\": getSemanticColour(\"icon-secondary-subtle\"),\n\n \"icon-hover\": getSemanticColour(\"icon-hover\"),\n \"icon-selected\": getSemanticColour(\"icon-selected\"),\n \"icon-selected-hover\": getSemanticColour(\"icon-selected-hover\"),\n\n \"icon-disabled\": getSemanticColour(\"icon-disabled\"),\n \"icon-disabled-subtle\": getSemanticColour(\"icon-disabled-subtle\"),\n \"icon-selected-disabled\": getSemanticColour(\"icon-selected-disabled\"),\n\n \"icon-success\": getSemanticColour(\"icon-success\"),\n \"icon-warning\": getSemanticColour(\"icon-warning\"),\n \"icon-error\": getSemanticColour(\"icon-error\"),\n \"icon-error-strong\": getSemanticColour(\"icon-error-strong\"),\n \"icon-info\": getSemanticColour(\"icon-info\"),\n \"icon-inverse\": getSemanticColour(\"icon-inverse\"),\n \"icon-primary-inverse\": getSemanticColour(\"icon-primary-inverse\"),\n\n // border\n border: getSemanticColour(\"border\"),\n \"border-strong\": getSemanticColour(\"border-strong\"),\n \"border-stronger\": getSemanticColour(\"border-stronger\"),\n \"border-primary\": getSemanticColour(\"border-primary\"),\n \"border-primary-subtle\": getSemanticColour(\"border-primary-subtle\"),\n\n \"border-hover\": getSemanticColour(\"border-hover\"),\n \"border-hover-strong\": getSemanticColour(\"border-hover-strong\"),\n\n \"border-selected\": getSemanticColour(\"border-selected\"),\n \"border-selected-subtle\": getSemanticColour(\"border-selected-subtle\"),\n \"border-selected-subtlest\": getSemanticColour(\"border-selected-subtlest\"),\n \"border-selected-hover\": getSemanticColour(\"border-selected-hover\"),\n\n \"border-focus\": getSemanticColour(\"border-focus\"),\n \"border-focus-strong\": getSemanticColour(\"border-focus-strong\"),\n\n \"border-disabled\": getSemanticColour(\"border-disabled\"),\n \"border-selected-disabled\": getSemanticColour(\"border-selected-disabled\"),\n\n \"border-success\": getSemanticColour(\"border-success\"),\n \"border-warning\": getSemanticColour(\"border-warning\"),\n \"border-error\": getSemanticColour(\"border-error\"),\n \"border-error-focus\": getSemanticColour(\"border-error-focus\"),\n \"border-error-focus-strong\": getSemanticColour(\"border-error-focus-strong\"),\n \"border-error-strong\": getSemanticColour(\"border-error-strong\"),\n \"border-info\": getSemanticColour(\"border-info\"),\n\n // background\n bg: getSemanticColour(\"bg\"),\n \"bg-strong\": getSemanticColour(\"bg-strong\"),\n \"bg-stronger\": getSemanticColour(\"bg-stronger\"),\n \"bg-strongest\": getSemanticColour(\"bg-strongest\"),\n\n \"bg-hover\": getSemanticColour(\"bg-hover\"),\n \"bg-hover-strong\": getSemanticColour(\"bg-hover-strong\"),\n \"bg-hover-subtle\": getSemanticColour(\"bg-hover-subtle\"),\n \"bg-hover-neutral\": getSemanticColour(\"bg-hover-neutral\"),\n \"bg-hover-neutral-strong\": getSemanticColour(\"bg-hover-neutral-strong\"),\n\n \"bg-selected\": getSemanticColour(\"bg-selected\"),\n \"bg-selected-hover\": getSemanticColour(\"bg-selected-hover\"),\n \"bg-selected-strong\": getSemanticColour(\"bg-selected-strong\"),\n \"bg-selected-stronger\": getSemanticColour(\"bg-selected-stronger\"),\n \"bg-selected-strongest\": getSemanticColour(\"bg-selected-strongest\"),\n \"bg-selected-strongest-hover\": getSemanticColour(\n \"bg-selected-strongest-hover\"\n ),\n\n \"bg-disabled\": getSemanticColour(\"bg-disabled\"),\n \"bg-selected-disabled\": getSemanticColour(\"bg-selected-disabled\"),\n \"bg-selected-stronger-disabled\": getSemanticColour(\n \"bg-selected-stronger-disabled\"\n ),\n\n \"bg-success\": getSemanticColour(\"bg-success\"),\n \"bg-success-hover\": getSemanticColour(\"bg-success-hover\"),\n \"bg-success-strong\": getSemanticColour(\"bg-success-strong\"),\n \"bg-success-strong-hover\": getSemanticColour(\"bg-success-strong-hover\"),\n \"bg-warning\": getSemanticColour(\"bg-warning\"),\n \"bg-warning-hover\": getSemanticColour(\"bg-warning-hover\"),\n \"bg-warning-strong\": getSemanticColour(\"bg-warning-strong\"),\n \"bg-warning-strong-hover\": getSemanticColour(\"bg-warning-strong-hover\"),\n \"bg-info\": getSemanticColour(\"bg-info\"),\n \"bg-info-hover\": getSemanticColour(\"bg-info-hover\"),\n \"bg-info-strong\": getSemanticColour(\"bg-info-strong\"),\n \"bg-info-strong-hover\": getSemanticColour(\"bg-info-strong-hover\"),\n \"bg-error\": getSemanticColour(\"bg-error\"),\n \"bg-error-hover\": getSemanticColour(\"bg-error-hover\"),\n \"bg-error-strong\": getSemanticColour(\"bg-error-strong\"),\n \"bg-error-strong-hover\": getSemanticColour(\"bg-error-strong-hover\"),\n\n \"bg-inverse\": getSemanticColour(\"bg-inverse\"),\n \"bg-inverse-subtle\": getSemanticColour(\"bg-inverse-subtle\"),\n \"bg-inverse-subtler\": getSemanticColour(\"bg-inverse-subtler\"),\n \"bg-inverse-subtlest\": getSemanticColour(\"bg-inverse-subtlest\"),\n \"bg-inverse-hover\": getSemanticColour(\"bg-inverse-hover\"),\n\n \"bg-primary\": getSemanticColour(\"bg-primary\"),\n \"bg-primary-subtle\": getSemanticColour(\"bg-primary-subtle\"),\n \"bg-primary-subtler\": getSemanticColour(\"bg-primary-subtler\"),\n \"bg-primary-subtlest\": getSemanticColour(\"bg-primary-subtlest\"),\n \"bg-available\": getSemanticColour(\"bg-available\"),\n\n \"bg-secondary\": getSemanticColour(\"bg-secondary\"),\n \"bg-secondary-subtle\": getSemanticColour(\"bg-secondary-subtle\"),\n \"bg-secondary-subtler\": getSemanticColour(\"bg-secondary-subtler\"),\n \"bg-secondary-subtlest\": getSemanticColour(\"bg-secondary-subtlest\"),\n\n \"bg-primary-hover\": getSemanticColour(\"bg-primary-hover\"),\n \"bg-primary-subtlest-hover\": getSemanticColour(\"bg-primary-subtlest-hover\"),\n \"bg-primary-subtlest-selected\": getSemanticColour(\n \"bg-primary-subtlest-selected\"\n ),\n\n // overlay\n \"overlay-strong\": getSemanticColour(\"overlay-strong\"),\n \"overlay-subtle\": getSemanticColour(\"overlay-subtle\"),\n\n // hyperlink\n hyperlink: getSemanticColour(\"hyperlink\"),\n \"hyperlink-hover\": getSemanticColour(\"hyperlink-hover\"),\n \"hyperlink-visited\": getSemanticColour(\"hyperlink-visited\"),\n \"hyperlink-inverse\": getSemanticColour(\"hyperlink-inverse\"),\n\n // focus ring\n \"focus-ring\": getSemanticColour(\"focus-ring\"),\n \"focus-ring-inverse\": getSemanticColour(\"focus-ring-inverse\"),\n};\n"],"names":["ColourSpec","collections","lifesg","LifeSGColourSet","bookingsg","rbs","mylegacy","ccube","oneservice","pa","PAColourSet","a11yplayground","A11yPlaygroundColourSet","supportgowhere","sgwdigitallobby","SGWDigitalLobbyColourSet","imda","spf","smgs","careercompass","defaultValue","DarkColourSpec","LifeSGDarkColourSet","A11yPlaygroundDarkColourSet","SGWDigitalLobbyDarkColourSet","getSemanticColour","key","props","theme","isDarkMode","colourMode","spec","colorSet","getCollection","colourScheme","overrideKey","overrides","_a","colorValue","getValue","ColourSemantic","text","icon","border","bg","hyperlink"],"mappings":"4OAkBO,MAAMA,EAGT,CACAC,YAAa,CACTC,OAAQC,EAAAA,gBACRC,UAAWD,EAAAA,gBACXE,IAAKF,EAAAA,gBACLG,SAAUH,EAAAA,gBACVI,MAAOJ,EAAAA,gBACPK,WAAYL,EAAAA,gBACZM,GAAIC,EAAAA,YACJC,eAAgBC,EAAAA,wBAChBC,eAAgBV,EAAAA,gBAChBW,gBAAiBC,EAAAA,yBACjBC,KAAMb,EAAAA,gBACNc,IAAKd,EAAAA,gBACLe,KAAMf,EAAAA,gBACNgB,cAAehB,EAAAA,iBAEnBiB,aAAc,UAGLC,EAGT,CACApB,YAAa,CACTC,OAAQoB,EAAAA,oBACRlB,UAAWkB,EAAAA,oBACXjB,IAAKiB,EAAAA,oBACLhB,SAAUgB,EAAAA,oBACVf,MAAOe,EAAAA,oBACPd,WAAYc,EAAAA,oBACZb,GAAIa,EAAAA,oBACJX,eAAgBY,EAAAA,4BAChBV,eAAgBS,EAAAA,oBAChBR,gBAAiBU,EAAAA,6BACjBR,KAAMM,EAAAA,oBACNL,IAAKK,EAAAA,oBACLJ,KAAMI,EAAAA,oBACNH,cAAeG,EAAAA,qBAEnBF,aAAc,UAGLK,EAAqBC,GACtBC,UACJ,MAAMC,EAAQD,EAAMC,MACdC,EAAmC,UAAtBD,aAAK,EAALA,EAAOE,YAGpBC,EAAOF,EAAaR,EAAiBrB,E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BACpC,uBAAwBA,EAAkB,wBAC1C,WAAYA,EAAkB,YAC9B,iBAAkBA,EAAkB,kBACpC,kBAAmBA,EAAkB,mBACrC,wBAAyBA,EAAkB,yBAE3C,aAAcA,EAAkB,cAChC,oBAAqBA,EAAkB,qBACvC,qBAAsBA,EAAkB,sBACxC,sBAAuBA,EAAkB,uBACzC,mBAAoBA,EAAkB,oBAEtC,aAAcA,EAAkB,cAChC,oBAAqBA,EAAkB,qBACvC,qBAAsBA,EAAkB,sBACxC,sBAAuBA,EAAkB,uBACzC,eAAgBA,EAAkB,gBAElC,eAAgBA,EAAkB,gBAClC,sBAAuBA,EAAkB,uBACzC,uBAAwBA,EAAkB,wBAC1C,wBAAyBA,EAAkB,yBAE3C,mBAAoBA,EAAkB,oBACtC,4BAA6BA,EAAkB,6BAC/C,+BAAgCA,EAC5B,gCAIJ,iBAAkBA,EAAkB,kBACpC,iBAAkBA,EAAkB,kBAGpCoB,UAAWpB,EAAkB,aAC7B,kBAAmBA,EAAkB,mBACrC,oBAAqBA,EAAkB,qBACvC,oBAAqBA,EAAkB,qBAGvC,aAAcA,EAAkB,cAChC,qBAAsBA,EAAkB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../helpers.js"),d=require("./specs/bookingsg-font-set.js"),l=require("./specs/default-font-set.js"),o=require("./specs/pa-font-set.js"),i=require("./specs/a11yplayground-font-set.js"),s=require("./specs/supportgowhere-font-set.js"),g=require("./specs/imda-font-set.js"),
|
|
1
|
+
"use strict";var e=require("../helpers.js"),d=require("./specs/bookingsg-font-set.js"),l=require("./specs/default-font-set.js"),o=require("./specs/pa-font-set.js"),i=require("./specs/a11yplayground-font-set.js"),s=require("./specs/supportgowhere-font-set.js"),g=require("./specs/imda-font-set.js"),a=require("./specs/spf-font-set.js"),n=require("./specs/oneservice-font-set.js");const r={collections:{default:l.DefaultFontSet,bookingsg:d.BookingSgFontSet,mylegacy:l.DefaultFontSet,pa:o.PAFontSet,a11yplayground:i.A11yPlaygroundFontSet,supportgowhere:s.SupportGoWhereFontSet,sgwdigitallobby:s.SupportGoWhereFontSet,imda:g.IMDAFontSet,spf:a.SPFFontSet,oneservice:n.OneServiceFontSet},defaultValue:"default"},t=d=>l=>{var o;const i=l.theme,s=e.getCollection(r,null==i?void 0:i.fontScheme),g=(null===(o=null==i?void 0:i.overrides)||void 0===o?void 0:o.font)?e.getValue(s,d,i.overrides.font):s[d];return"function"==typeof g?g(l):g},b={"heading-xxl-light":t("heading-xxl-light"),"heading-xxl-regular":t("heading-xxl-regular"),"heading-xxl-semibold":t("heading-xxl-semibold"),"heading-xxl-bold":t("heading-xxl-bold"),"heading-xl-light":t("heading-xl-light"),"heading-xl-regular":t("heading-xl-regular"),"heading-xl-semibold":t("heading-xl-semibold"),"heading-xl-bold":t("heading-xl-bold"),"heading-lg-light":t("heading-lg-light"),"heading-lg-regular":t("heading-lg-regular"),"heading-lg-semibold":t("heading-lg-semibold"),"heading-lg-bold":t("heading-lg-bold"),"heading-md-light":t("heading-md-light"),"heading-md-regular":t("heading-md-regular"),"heading-md-semibold":t("heading-md-semibold"),"heading-md-bold":t("heading-md-bold"),"heading-sm-light":t("heading-sm-light"),"heading-sm-regular":t("heading-sm-regular"),"heading-sm-semibold":t("heading-sm-semibold"),"heading-sm-bold":t("heading-sm-bold"),"heading-xs-light":t("heading-xs-light"),"heading-xs-regular":t("heading-xs-regular"),"heading-xs-semibold":t("heading-xs-semibold"),"heading-xs-bold":t("heading-xs-bold"),"body-baseline-light":t("body-baseline-light"),"body-baseline-regular":t("body-baseline-regular"),"body-baseline-semibold":t("body-baseline-semibold"),"body-baseline-bold":t("body-baseline-bold"),"body-md-light":t("body-md-light"),"body-md-regular":t("body-md-regular"),"body-md-semibold":t("body-md-semibold"),"body-md-bold":t("body-md-bold"),"body-sm-light":t("body-sm-light"),"body-sm-regular":t("body-sm-regular"),"body-sm-semibold":t("body-sm-semibold"),"body-sm-bold":t("body-sm-bold"),"body-xs-light":t("body-xs-light"),"body-xs-regular":t("body-xs-regular"),"body-xs-semibold":t("body-xs-semibold"),"body-xs-bold":t("body-xs-bold"),"form-label":t("form-label"),"form-description":t("form-description")};exports.FontValues=b,exports.getFont=t;
|
|
2
2
|
//# sourceMappingURL=theme-helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-helper.js","sources":["../../../../src/theme/font/theme-helper.ts"],"sourcesContent":["import { CSSProp } from \"styled-components\";\nimport { StyledComponentProps, getCollection, getValue } from \"../helpers\";\nimport { ThemeCollectionSpec } from \"../internal-types\";\nimport { FontScheme } from \"../types\";\nimport { BookingSgFontSet } from \"./specs/bookingsg-font-set\";\nimport { DefaultFontSet } from \"./specs/default-font-set\";\nimport { PAFontSet } from \"./specs/pa-font-set\";\nimport { A11yPlaygroundFontSet } from \"./specs/a11yplayground-font-set\";\nimport { SupportGoWhereFontSet } from \"./specs/supportgowhere-font-set\";\nimport { IMDAFontSet } from \"./specs/imda-font-set\";\nimport { SPFFontSet } from \"./specs/spf-font-set\";\nimport { FontCollectionMap, FontSet } from \"./types\";\nimport { OneServiceFontSet } from \"./specs/oneservice-font-set\";\
|
|
1
|
+
{"version":3,"file":"theme-helper.js","sources":["../../../../src/theme/font/theme-helper.ts"],"sourcesContent":["import { CSSProp } from \"styled-components\";\nimport { StyledComponentProps, getCollection, getValue } from \"../helpers\";\nimport { ThemeCollectionSpec } from \"../internal-types\";\nimport { FontScheme } from \"../types\";\nimport { BookingSgFontSet } from \"./specs/bookingsg-font-set\";\nimport { DefaultFontSet } from \"./specs/default-font-set\";\nimport { PAFontSet } from \"./specs/pa-font-set\";\nimport { A11yPlaygroundFontSet } from \"./specs/a11yplayground-font-set\";\nimport { SupportGoWhereFontSet } from \"./specs/supportgowhere-font-set\";\nimport { IMDAFontSet } from \"./specs/imda-font-set\";\nimport { SPFFontSet } from \"./specs/spf-font-set\";\nimport { FontCollectionMap, FontSet } from \"./types\";\nimport { OneServiceFontSet } from \"./specs/oneservice-font-set\";\n\nconst FontSpec: ThemeCollectionSpec<FontCollectionMap, FontScheme> = {\n collections: {\n default: DefaultFontSet,\n bookingsg: BookingSgFontSet,\n mylegacy: DefaultFontSet,\n pa: PAFontSet,\n a11yplayground: A11yPlaygroundFontSet,\n supportgowhere: SupportGoWhereFontSet,\n sgwdigitallobby: SupportGoWhereFontSet,\n imda: IMDAFontSet,\n spf: SPFFontSet,\n oneservice: OneServiceFontSet,\n },\n defaultValue: \"default\",\n};\n\nexport const getFont = (key: keyof FontSet) => {\n return (props: StyledComponentProps): CSSProp | string => {\n const theme = props.theme;\n const fontSet: FontSet = getCollection(FontSpec, theme?.fontScheme);\n\n // Check for an override\n const fontValue = theme?.overrides?.font\n ? getValue(fontSet, key, theme.overrides.font)\n : fontSet[key];\n\n // If function, resolve with props\n return typeof fontValue === \"function\"\n ? (fontValue as (props: any) => string)(props)\n : fontValue;\n };\n};\n\nexport const FontValues: {\n [key in keyof FontSet]: (props: StyledComponentProps) => CSSProp;\n} = {\n \"heading-xxl-light\": getFont(\"heading-xxl-light\"),\n \"heading-xxl-regular\": getFont(\"heading-xxl-regular\"),\n \"heading-xxl-semibold\": getFont(\"heading-xxl-semibold\"),\n \"heading-xxl-bold\": getFont(\"heading-xxl-bold\"),\n\n \"heading-xl-light\": getFont(\"heading-xl-light\"),\n \"heading-xl-regular\": getFont(\"heading-xl-regular\"),\n \"heading-xl-semibold\": getFont(\"heading-xl-semibold\"),\n \"heading-xl-bold\": getFont(\"heading-xl-bold\"),\n\n \"heading-lg-light\": getFont(\"heading-lg-light\"),\n \"heading-lg-regular\": getFont(\"heading-lg-regular\"),\n \"heading-lg-semibold\": getFont(\"heading-lg-semibold\"),\n \"heading-lg-bold\": getFont(\"heading-lg-bold\"),\n\n \"heading-md-light\": getFont(\"heading-md-light\"),\n \"heading-md-regular\": getFont(\"heading-md-regular\"),\n \"heading-md-semibold\": getFont(\"heading-md-semibold\"),\n \"heading-md-bold\": getFont(\"heading-md-bold\"),\n\n \"heading-sm-light\": getFont(\"heading-sm-light\"),\n \"heading-sm-regular\": getFont(\"heading-sm-regular\"),\n \"heading-sm-semibold\": getFont(\"heading-sm-semibold\"),\n \"heading-sm-bold\": getFont(\"heading-sm-bold\"),\n\n \"heading-xs-light\": getFont(\"heading-xs-light\"),\n \"heading-xs-regular\": getFont(\"heading-xs-regular\"),\n \"heading-xs-semibold\": getFont(\"heading-xs-semibold\"),\n \"heading-xs-bold\": getFont(\"heading-xs-bold\"),\n\n \"body-baseline-light\": getFont(\"body-baseline-light\"),\n \"body-baseline-regular\": getFont(\"body-baseline-regular\"),\n \"body-baseline-semibold\": getFont(\"body-baseline-semibold\"),\n \"body-baseline-bold\": getFont(\"body-baseline-bold\"),\n\n \"body-md-light\": getFont(\"body-md-light\"),\n \"body-md-regular\": getFont(\"body-md-regular\"),\n \"body-md-semibold\": getFont(\"body-md-semibold\"),\n \"body-md-bold\": getFont(\"body-md-bold\"),\n\n \"body-sm-light\": getFont(\"body-sm-light\"),\n \"body-sm-regular\": getFont(\"body-sm-regular\"),\n \"body-sm-semibold\": getFont(\"body-sm-semibold\"),\n \"body-sm-bold\": getFont(\"body-sm-bold\"),\n\n \"body-xs-light\": getFont(\"body-xs-light\"),\n \"body-xs-regular\": getFont(\"body-xs-regular\"),\n \"body-xs-semibold\": getFont(\"body-xs-semibold\"),\n \"body-xs-bold\": getFont(\"body-xs-bold\"),\n\n \"form-label\": getFont(\"form-label\"),\n \"form-description\": getFont(\"form-description\"),\n};\n"],"names":["FontSpec","collections","default","DefaultFontSet","bookingsg","BookingSgFontSet","mylegacy","pa","PAFontSet","a11yplayground","A11yPlaygroundFontSet","supportgowhere","SupportGoWhereFontSet","sgwdigitallobby","imda","IMDAFontSet","spf","SPFFontSet","oneservice","OneServiceFontSet","defaultValue","getFont","key","props","theme","fontSet","getCollection","fontScheme","fontValue","_a","overrides","font","getValue","FontValues"],"mappings":"2XAcA,MAAMA,EAA+D,CACjEC,YAAa,CACTC,QAASC,EAAAA,eACT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9B,gBAAiBA,EAAQ,iBACzB,kBAAmBA,EAAQ,mBAC3B,mBAAoBA,EAAQ,oBAC5B,eAAgBA,EAAQ,gBAExB,gBAAiBA,EAAQ,iBACzB,kBAAmBA,EAAQ,mBAC3B,mBAAoBA,EAAQ,oBAC5B,eAAgBA,EAAQ,gBAExB,gBAAiBA,EAAQ,iBACzB,kBAAmBA,EAAQ,mBAC3B,mBAAoBA,EAAQ,oBAC5B,eAAgBA,EAAQ,gBAExB,aAAcA,EAAQ,cACtB,mBAAoBA,EAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../helpers.js"),s=require("./specs/a11yplayground-font-spec-set.js"),i=require("./specs/bookingsg-font-spec-set.js"),l=require("./specs/default-font-spec-set.js"),o=require("./specs/imda-font-spec-set.js"),d=require("./specs/mylegacy-font-spec-set.js"),n=require("./specs/oneservice-font-spec-set.js"),t=require("./specs/pa-font-spec-set.js"),a=require("./specs/sgw-digital-lobby-font-spec-set.js"),g=require("./specs/spf-font-spec-set.js"),h=require("./specs/supportgowhere-font-spec-set.js")
|
|
1
|
+
"use strict";var e=require("../helpers.js"),s=require("./specs/a11yplayground-font-spec-set.js"),i=require("./specs/bookingsg-font-spec-set.js"),l=require("./specs/default-font-spec-set.js"),o=require("./specs/imda-font-spec-set.js"),d=require("./specs/mylegacy-font-spec-set.js"),n=require("./specs/oneservice-font-spec-set.js"),t=require("./specs/pa-font-spec-set.js"),a=require("./specs/sgw-digital-lobby-font-spec-set.js"),g=require("./specs/spf-font-spec-set.js"),h=require("./specs/supportgowhere-font-spec-set.js");const r={collections:{default:l.DefaultFontSpecSet,bookingsg:i.BookingSgFontSpecSet,mylegacy:d.MyLegacyFontSpecSet,pa:t.PAFontSpecSet,a11yplayground:s.A11yPlaygroundFontSpecSet,supportgowhere:h.SupportGoWhereFontSpecSet,sgwdigitallobby:a.SGWDigitalLobbyFontSpecSet,imda:o.IMDAFontSpecSet,spf:g.SPFFontSpecSet,oneservice:n.OneServiceFontSpecSet},defaultValue:"default"},p=s=>i=>{var l;const o=i.theme,d=e.getCollection(r,null==o?void 0:o.fontScheme);return(null===(l=null==o?void 0:o.overrides)||void 0===l?void 0:l.fontSpec)?e.getValue(d,s,o.overrides.fontSpec):d[s]},c={"heading-size-xxl":p("heading-size-xxl"),"heading-size-xl":p("heading-size-xl"),"heading-size-lg":p("heading-size-lg"),"heading-size-md":p("heading-size-md"),"heading-size-sm":p("heading-size-sm"),"heading-size-xs":p("heading-size-xs"),"heading-lh-xxl":p("heading-lh-xxl"),"heading-lh-xl":p("heading-lh-xl"),"heading-lh-lg":p("heading-lh-lg"),"heading-lh-md":p("heading-lh-md"),"heading-lh-sm":p("heading-lh-sm"),"heading-lh-xs":p("heading-lh-xs"),"heading-ls-xxl":p("heading-ls-xxl"),"heading-ls-xl":p("heading-ls-xl"),"heading-ls-lg":p("heading-ls-lg"),"heading-ls-md":p("heading-ls-md"),"heading-ls-sm":p("heading-ls-sm"),"heading-ls-xs":p("heading-ls-xs"),"weight-light":p("weight-light"),"weight-regular":p("weight-regular"),"weight-semibold":p("weight-semibold"),"weight-bold":p("weight-bold"),"font-family":p("font-family"),"heading-font-family":p("heading-font-family"),"body-font-family":p("body-font-family"),"body-size-baseline":p("body-size-baseline"),"body-size-md":p("body-size-md"),"body-size-sm":p("body-size-sm"),"body-size-xs":p("body-size-xs"),"body-lh-baseline":p("body-lh-baseline"),"body-lh-md":p("body-lh-md"),"body-lh-sm":p("body-lh-sm"),"body-lh-xs":p("body-lh-xs"),"body-ls-baseline":p("body-ls-baseline"),"body-ls-md":p("body-ls-md"),"body-ls-sm":p("body-ls-sm"),"body-ls-xs":p("body-ls-xs"),"form-label-size":p("form-label-size"),"form-description-size":p("form-description-size"),"form-label-lh":p("form-label-lh"),"form-description-lh":p("form-description-lh"),"form-label-ls":p("form-label-ls"),"form-description-ls":p("form-description-ls")};exports.FontSpecValues=c,exports.getFontSpec=p;
|
|
2
2
|
//# sourceMappingURL=theme-helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-helper.js","sources":["../../../../src/theme/font-spec/theme-helper.ts"],"sourcesContent":["import { StyledComponentProps, getCollection, getValue } from \"../helpers\";\nimport { ThemeCollectionSpec } from \"../internal-types\";\nimport { FontScheme } from \"../types\";\nimport { A11yPlaygroundFontSpecSet } from \"./specs/a11yplayground-font-spec-set\";\nimport { BookingSgFontSpecSet } from \"./specs/bookingsg-font-spec-set\";\nimport { DefaultFontSpecSet } from \"./specs/default-font-spec-set\";\nimport { IMDAFontSpecSet } from \"./specs/imda-font-spec-set\";\nimport { MyLegacyFontSpecSet } from \"./specs/mylegacy-font-spec-set\";\nimport { OneServiceFontSpecSet } from \"./specs/oneservice-font-spec-set\";\nimport { PAFontSpecSet } from \"./specs/pa-font-spec-set\";\nimport { SGWDigitalLobbyFontSpecSet } from \"./specs/sgw-digital-lobby-font-spec-set\";\nimport { SPFFontSpecSet } from \"./specs/spf-font-spec-set\";\nimport { SupportGoWhereFontSpecSet } from \"./specs/supportgowhere-font-spec-set\";\nimport { FontSpecCollectionMap, FontSpecSet } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"theme-helper.js","sources":["../../../../src/theme/font-spec/theme-helper.ts"],"sourcesContent":["import { StyledComponentProps, getCollection, getValue } from \"../helpers\";\nimport { ThemeCollectionSpec } from \"../internal-types\";\nimport { FontScheme } from \"../types\";\nimport { A11yPlaygroundFontSpecSet } from \"./specs/a11yplayground-font-spec-set\";\nimport { BookingSgFontSpecSet } from \"./specs/bookingsg-font-spec-set\";\nimport { DefaultFontSpecSet } from \"./specs/default-font-spec-set\";\nimport { IMDAFontSpecSet } from \"./specs/imda-font-spec-set\";\nimport { MyLegacyFontSpecSet } from \"./specs/mylegacy-font-spec-set\";\nimport { OneServiceFontSpecSet } from \"./specs/oneservice-font-spec-set\";\nimport { PAFontSpecSet } from \"./specs/pa-font-spec-set\";\nimport { SGWDigitalLobbyFontSpecSet } from \"./specs/sgw-digital-lobby-font-spec-set\";\nimport { SPFFontSpecSet } from \"./specs/spf-font-spec-set\";\nimport { SupportGoWhereFontSpecSet } from \"./specs/supportgowhere-font-spec-set\";\nimport { FontSpecCollectionMap, FontSpecSet } from \"./types\";\n\nconst FontSpec: ThemeCollectionSpec<FontSpecCollectionMap, FontScheme> = {\n collections: {\n default: DefaultFontSpecSet,\n bookingsg: BookingSgFontSpecSet,\n mylegacy: MyLegacyFontSpecSet,\n pa: PAFontSpecSet,\n a11yplayground: A11yPlaygroundFontSpecSet,\n supportgowhere: SupportGoWhereFontSpecSet,\n sgwdigitallobby: SGWDigitalLobbyFontSpecSet,\n imda: IMDAFontSpecSet,\n spf: SPFFontSpecSet,\n oneservice: OneServiceFontSpecSet,\n },\n defaultValue: \"default\",\n};\n\nexport const getFontSpec = (key: keyof FontSpecSet) => {\n return (props: StyledComponentProps): string => {\n const theme = props.theme;\n const fontSpecSet: FontSpecSet = getCollection(\n FontSpec,\n theme?.fontScheme\n );\n\n if (theme?.overrides?.fontSpec) {\n return getValue(fontSpecSet, key, theme.overrides.fontSpec);\n } else {\n return fontSpecSet[key];\n }\n };\n};\n\nexport const FontSpecValues: {\n [key in keyof FontSpecSet]: (props: StyledComponentProps) => string;\n} = {\n \"heading-size-xxl\": getFontSpec(\"heading-size-xxl\"),\n \"heading-size-xl\": getFontSpec(\"heading-size-xl\"),\n \"heading-size-lg\": getFontSpec(\"heading-size-lg\"),\n \"heading-size-md\": getFontSpec(\"heading-size-md\"),\n \"heading-size-sm\": getFontSpec(\"heading-size-sm\"),\n \"heading-size-xs\": getFontSpec(\"heading-size-xs\"),\n\n \"heading-lh-xxl\": getFontSpec(\"heading-lh-xxl\"),\n \"heading-lh-xl\": getFontSpec(\"heading-lh-xl\"),\n \"heading-lh-lg\": getFontSpec(\"heading-lh-lg\"),\n \"heading-lh-md\": getFontSpec(\"heading-lh-md\"),\n \"heading-lh-sm\": getFontSpec(\"heading-lh-sm\"),\n \"heading-lh-xs\": getFontSpec(\"heading-lh-xs\"),\n\n \"heading-ls-xxl\": getFontSpec(\"heading-ls-xxl\"),\n \"heading-ls-xl\": getFontSpec(\"heading-ls-xl\"),\n \"heading-ls-lg\": getFontSpec(\"heading-ls-lg\"),\n \"heading-ls-md\": getFontSpec(\"heading-ls-md\"),\n \"heading-ls-sm\": getFontSpec(\"heading-ls-sm\"),\n \"heading-ls-xs\": getFontSpec(\"heading-ls-xs\"),\n\n \"weight-light\": getFontSpec(\"weight-light\"),\n \"weight-regular\": getFontSpec(\"weight-regular\"),\n \"weight-semibold\": getFontSpec(\"weight-semibold\"),\n \"weight-bold\": getFontSpec(\"weight-bold\"),\n \"font-family\": getFontSpec(\"font-family\"),\n \"heading-font-family\": getFontSpec(\"heading-font-family\"),\n \"body-font-family\": getFontSpec(\"body-font-family\"),\n\n \"body-size-baseline\": getFontSpec(\"body-size-baseline\"),\n \"body-size-md\": getFontSpec(\"body-size-md\"),\n \"body-size-sm\": getFontSpec(\"body-size-sm\"),\n \"body-size-xs\": getFontSpec(\"body-size-xs\"),\n\n \"body-lh-baseline\": getFontSpec(\"body-lh-baseline\"),\n \"body-lh-md\": getFontSpec(\"body-lh-md\"),\n \"body-lh-sm\": getFontSpec(\"body-lh-sm\"),\n \"body-lh-xs\": getFontSpec(\"body-lh-xs\"),\n\n \"body-ls-baseline\": getFontSpec(\"body-ls-baseline\"),\n \"body-ls-md\": getFontSpec(\"body-ls-md\"),\n \"body-ls-sm\": getFontSpec(\"body-ls-sm\"),\n \"body-ls-xs\": getFontSpec(\"body-ls-xs\"),\n\n \"form-label-size\": getFontSpec(\"form-label-size\"),\n \"form-description-size\": getFontSpec(\"form-description-size\"),\n\n \"form-label-lh\": getFontSpec(\"form-label-lh\"),\n \"form-description-lh\": getFontSpec(\"form-description-lh\"),\n\n \"form-label-ls\": getFontSpec(\"form-label-ls\"),\n \"form-description-ls\": getFontSpec(\"form-description-ls\"),\n};\n"],"names":["FontSpec","collections","default","DefaultFontSpecSet","bookingsg","BookingSgFontSpecSet","mylegacy","MyLegacyFontSpecSet","pa","PAFontSpecSet","a11yplayground","A11yPlaygroundFontSpecSet","supportgowhere","SupportGoWhereFontSpecSet","sgwdigitallobby","SGWDigitalLobbyFontSpecSet","imda","IMDAFontSpecSet","spf","SPFFontSpecSet","oneservice","OneServiceFontSpecSet","defaultValue","getFontSpec","key","props","theme","fontSpecSet","getCollection","fontScheme","_a","overrides","fontSpec","getValue","FontSpecValues"],"mappings":"0gBAeA,MAAMA,EAAmE,CACrEC,YAAa,CACTC,QAASC,EAAAA,mBACTC,UAAWC,EAAAA,qBACXC,SAAUC,EAAAA,oBACVC,GAAIC,EAAAA,cACJC,eAAgBC,EAAAA,0BAChBC,eAAgBC,EAAAA,0BAChBC,gBAAiBC,EAAAA,2BACjBC,KAAMC,EAAAA,gBACNC,IAAKC,EAAAA,eACLC,WAAYC,EAAAA,uBAEhBC,aAAc,WAGLC,EAAeC,GAChBC,UACJ,MAAMC,EAAQD,EAAMC,MACdC,EAA2BC,EAAAA,cAC7B5B,EACA0B,aAAK,EAALA,EAAOG,YAGX,OAAoB,QAAhBC,EAAAJ,aAAK,EAALA,EAAOK,iBAAS,IAAAD,OAAA,EAAAA,EAAEE,UACXC,EAAAA,SAASN,EAAaH,EAAKE,EAAMK,UAAUC,UAE3CL,EAAYH,EACvB,EAIKU,EAET,CACA,mBAAoBX,EAAY,oBAChC,kBAAmBA,EAAY,mBAC/B,kBAAmBA,EAAY,mBAC/B,kBAAmBA,EAAY,mBAC/B,kBAAmBA,EAAY,mBAC/B,kBAAmBA,EAAY,mBAE/B,iBAAkBA,EAAY,kBAC9B,gBAAiBA,EAAY,iBAC7B,gBAAiBA,EAAY,iBAC7B,gBAAiBA,EAAY,iBAC7B,gBAAiBA,EAAY,iBAC7B,gBAAiBA,EAAY,iBAE7B,iBAAkBA,EAAY,kBAC9B,gBAAiBA,EAAY,iBAC7B,gBAAiBA,EAAY,iBAC7B,gBAAiBA,EAAY,iBAC7B,gBAAiBA,EAAY,iBAC7B,gBAAiBA,EAAY,iBAE7B,eAAgBA,EAAY,gBAC5B,iBAAkBA,EAAY,kBAC9B,kBAAmBA,EAAY,mBAC/B,cAAeA,EAAY,eAC3B,cAAeA,EAAY,eAC3B,sBAAuBA,EAAY,uBACnC,mBAAoBA,EAAY,oBAEhC,qBAAsBA,EAAY,sBAClC,eAAgBA,EAAY,gBAC5B,eAAgBA,EAAY,gBAC5B,eAAgBA,EAAY,gBAE5B,mBAAoBA,EAAY,oBAChC,aAAcA,EAAY,cAC1B,aAAcA,EAAY,cAC1B,aAAcA,EAAY,cAE1B,mBAAoBA,EAAY,oBAChC,aAAcA,EAAY,cAC1B,aAAcA,EAAY,cAC1B,aAAcA,EAAY,cAE1B,kBAAmBA,EAAY,mBAC/B,wBAAyBA,EAAY,yBAErC,gBAAiBA,EAAY,iBAC7B,sBAAuBA,EAAY,uBAEnC,gBAAiBA,EAAY,iBAC7B,sBAAuBA,EAAY"}
|
package/cjs/theme/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./border-util/theme-helper.js"),o=require("./border/theme-helper.js"),t=require("./breakpoint/media-query-helper.js"),r=require("./breakpoint/theme-helper.js"),h=require("./colour-primitive/theme-helper.js"),
|
|
1
|
+
"use strict";var e=require("./border-util/theme-helper.js"),o=require("./border/theme-helper.js"),t=require("./breakpoint/media-query-helper.js"),r=require("./breakpoint/theme-helper.js"),h=require("./colour-primitive/theme-helper.js"),a=require("./colour-semantic/theme-helper.js"),c=require("./components/theme-helper.js"),m=require("./font-spec/theme-helper.js"),s=require("./font/theme-helper.js"),i=require("./motion/theme-helper.js"),u=require("./radius/theme-helper.js"),d=require("./shadow/theme-helper.js"),l=require("./spacing/theme-helper.js"),S=require("./use-theme-mode.js"),n=require("./ds-theme-provider.js");const g=Object.assign(Object.assign({},a.ColourSemantic),{Primitive:h.PrimitiveColour}),p=Object.assign(Object.assign({},s.FontValues),{Spec:m.FontSpecValues}),f=i.MotionValues,b=Object.assign(Object.assign({},o.BorderValues),{Util:e.BorderUtilValues}),k=l.SpacingValues,T=u.RadiusValues,j=d.ShadowValues,C=r.BreakpointValues,M=t.MediaQuery,y={Button:c.ThemeButton,Navbar:c.ThemeNavbar},x={colourScheme:"lifesg",fontScheme:"default",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"lifesg",componentScheme:"lifesg",_v2:{colorScheme:"base",textStyleScheme:"base",designTokenScheme:"base",resourceScheme:"base"}},O={colourScheme:"bookingsg",fontScheme:"bookingsg",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"bookingsg",_v2:{colorScheme:"bookingsg",textStyleScheme:"base",designTokenScheme:"base",resourceScheme:"bookingsg"}},W={colourScheme:"ccube",fontScheme:"default",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"ccube",_v2:{colorScheme:"ccube",textStyleScheme:"base",designTokenScheme:"base",resourceScheme:"ccube"}},w={colourScheme:"careercompass",fontScheme:"bookingsg",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"careercompass",componentScheme:"default"},v={colourScheme:"mylegacy",fontScheme:"mylegacy",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"mylegacy",_v2:{colorScheme:"mylegacy",textStyleScheme:"base",designTokenScheme:"base",resourceScheme:"mylegacy"}},q={colourScheme:"rbs",fontScheme:"default",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"rbs",_v2:{colorScheme:"rbs",textStyleScheme:"base",designTokenScheme:"rbs",resourceScheme:"rbs"}},B={colourScheme:"oneservice",fontScheme:"oneservice",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"oneservice"},V={colourScheme:"pa",fontScheme:"pa",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"pa",componentScheme:"pa"},D={colourScheme:"a11yplayground",fontScheme:"a11yplayground",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"a11yplayground",componentScheme:"a11yplayground"},G={colourScheme:"supportgowhere",fontScheme:"supportgowhere",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"supportgowhere",componentScheme:"default"},P={colourScheme:"sgwdigitallobby",fontScheme:"sgwdigitallobby",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"supportgowhere",componentScheme:"default"},_={colourScheme:"imda",fontScheme:"imda",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"imda",componentScheme:"default"},F={colourScheme:"spf",fontScheme:"spf",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"spf",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"spf",componentScheme:"spf"},L={colourScheme:"smgs",fontScheme:"bookingsg",motionScheme:"default",borderScheme:"default",spacingScheme:"default",radiusScheme:"default",shadowScheme:"default",breakpointScheme:"default",resourceScheme:"smgs",componentScheme:"smgs"},A=Object.assign(Object.assign({},x),{light:S.createThemeWithColourMode(x,"light"),dark:S.createThemeWithColourMode(x,"dark")}),R=Object.assign(Object.assign({},O),{light:S.createThemeWithColourMode(O,"light"),dark:S.createThemeWithColourMode(O,"dark")}),N=Object.assign(Object.assign({},W),{light:S.createThemeWithColourMode(W,"light"),dark:S.createThemeWithColourMode(W,"dark")}),Q=Object.assign(Object.assign({},w),{light:S.createThemeWithColourMode(w,"light"),dark:S.createThemeWithColourMode(w,"dark")}),U=Object.assign(Object.assign({},v),{light:S.createThemeWithColourMode(v,"light"),dark:S.createThemeWithColourMode(v,"dark")}),I=Object.assign(Object.assign({},q),{light:S.createThemeWithColourMode(q,"light"),dark:S.createThemeWithColourMode(q,"dark")}),z=Object.assign(Object.assign({},B),{light:S.createThemeWithColourMode(B,"light"),dark:S.createThemeWithColourMode(B,"dark")}),E=Object.assign(Object.assign({},V),{light:S.createThemeWithColourMode(V,"light"),dark:S.createThemeWithColourMode(V,"dark")}),H=Object.assign(Object.assign({},D),{light:S.createThemeWithColourMode(D,"light"),dark:S.createThemeWithColourMode(D,"dark")}),J=Object.assign(Object.assign({},G),{light:S.createThemeWithColourMode(G,"light"),dark:S.createThemeWithColourMode(G,"dark")}),K=Object.assign(Object.assign({},P),{light:S.createThemeWithColourMode(P,"light"),dark:S.createThemeWithColourMode(P,"dark")}),X=Object.assign(Object.assign({},_),{light:S.createThemeWithColourMode(_,"light"),dark:S.createThemeWithColourMode(_,"dark")}),Y=Object.assign(Object.assign({},F),{light:S.createThemeWithColourMode(F,"light"),dark:S.createThemeWithColourMode(F,"dark")}),Z=Object.assign(Object.assign({},L),{light:S.createThemeWithColourMode(L,"light"),dark:S.createThemeWithColourMode(L,"dark")});exports.createThemeWithColourMode=S.createThemeWithColourMode,exports.getSystemColourMode=S.getSystemColourMode,exports.useDSTheme=S.useDSTheme,exports.DSThemeProvider=n.DSThemeProvider,exports.A11yPlaygroundTheme=H,exports.BookingSGTheme=R,exports.Border=b,exports.Breakpoint=C,exports.CCubeTheme=N,exports.CareerCompassTheme=Q,exports.Colour=g,exports.Font=p,exports.IMDATheme=X,exports.LifeSGTheme=A,exports.MediaQuery=M,exports.Motion=f,exports.MyLegacyTheme=U,exports.OneServiceTheme=z,exports.PATheme=E,exports.RBSTheme=I,exports.Radius=T,exports.SGWDigitalLobbyTheme=K,exports.SGWDigitalLobbyThemeBase=P,exports.SMGSTheme=Z,exports.SPFTheme=Y,exports.Shadow=j,exports.Spacing=k,exports.SupportGoWhereTheme=J,exports.SupportGoWhereThemeBase=G,exports.ThemeComponent=y;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/cjs/theme/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/theme/index.ts"],"sourcesContent":["import { BorderUtilValues } from \"./border-util/theme-helper\";\nimport { BorderValues } from \"./border/theme-helper\";\nimport { MediaQuery as MediaQueryValues } from \"./breakpoint/media-query-helper\";\nimport { BreakpointValues } from \"./breakpoint/theme-helper\";\nimport { PrimitiveColour } from \"./colour-primitive/theme-helper\";\nimport { ColourSemantic } from \"./colour-semantic/theme-helper\";\nimport { ThemeButton, ThemeNavbar } from \"./components/theme-helper\";\nimport { FontSpecValues } from \"./font-spec/theme-helper\";\nimport { FontValues } from \"./font/theme-helper\";\nimport { MotionValues } from \"./motion/theme-helper\";\nimport { RadiusValues } from \"./radius/theme-helper\";\nimport { ShadowValues } from \"./shadow/theme-helper\";\nimport { SpacingValues } from \"./spacing/theme-helper\";\nimport { ThemeSpec } from \"./types\";\nimport { createThemeWithColourMode } from \"./use-theme-mode\";\n\nexport * from \"./types\";\nexport * from \"./ds-theme-provider\";\nexport * from \"./use-theme-mode\";\n\n// =============================================================================\n// TOKENS\n// =============================================================================\n\nexport const Colour = {\n ...ColourSemantic,\n Primitive: PrimitiveColour,\n};\n\nexport const Font = {\n ...FontValues,\n Spec: FontSpecValues,\n};\n\nexport const Motion = MotionValues;\n\nexport const Border = {\n ...BorderValues,\n Util: BorderUtilValues,\n};\n\nexport const Spacing = SpacingValues;\n\nexport const Radius = RadiusValues;\n\nexport const Shadow = ShadowValues;\n\nexport const Breakpoint = BreakpointValues;\n\nexport const MediaQuery = MediaQueryValues;\n\nexport const ThemeComponent = {\n Button: ThemeButton,\n Navbar: ThemeNavbar,\n};\n\n// =============================================================================\n// THEME PRESETS\n// =============================================================================\n\n// Theme definitions\nconst LifeSGThemeBase: ThemeSpec = {\n colourScheme: \"lifesg\",\n fontScheme: \"default\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"lifesg\",\n componentScheme: \"lifesg\",\n _v2: {\n colorScheme: \"base\",\n textStyleScheme: \"base\",\n designTokenScheme: \"base\",\n resourceScheme: \"base\",\n },\n};\n\nconst BookingSGThemeBase: ThemeSpec = {\n colourScheme: \"bookingsg\",\n fontScheme: \"bookingsg\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"bookingsg\",\n _v2: {\n colorScheme: \"bookingsg\",\n textStyleScheme: \"base\",\n designTokenScheme: \"base\",\n resourceScheme: \"bookingsg\",\n },\n};\n\nconst CCubeThemeBase: ThemeSpec = {\n colourScheme: \"ccube\",\n fontScheme: \"default\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"ccube\",\n _v2: {\n colorScheme: \"ccube\",\n textStyleScheme: \"base\",\n designTokenScheme: \"base\",\n resourceScheme: \"ccube\",\n },\n};\n\nconst MyLegacyThemeBase: ThemeSpec = {\n colourScheme: \"mylegacy\",\n fontScheme: \"mylegacy\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"mylegacy\",\n _v2: {\n colorScheme: \"mylegacy\",\n textStyleScheme: \"base\",\n designTokenScheme: \"base\",\n resourceScheme: \"mylegacy\",\n },\n};\n\nconst RBSThemeBase: ThemeSpec = {\n colourScheme: \"rbs\",\n fontScheme: \"default\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"rbs\",\n _v2: {\n colorScheme: \"rbs\",\n textStyleScheme: \"base\",\n designTokenScheme: \"rbs\",\n resourceScheme: \"rbs\",\n },\n};\n\nconst OneServiceThemeBase: ThemeSpec = {\n colourScheme: \"oneservice\",\n fontScheme: \"oneservice\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"oneservice\",\n};\n\nconst PAThemeBase: ThemeSpec = {\n colourScheme: \"pa\",\n fontScheme: \"pa\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"pa\",\n componentScheme: \"pa\",\n};\n\nconst A11yPlaygroundThemeBase: ThemeSpec = {\n colourScheme: \"a11yplayground\",\n fontScheme: \"a11yplayground\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"a11yplayground\",\n componentScheme: \"a11yplayground\",\n};\n\nexport const SupportGoWhereThemeBase: ThemeSpec = {\n colourScheme: \"supportgowhere\",\n fontScheme: \"supportgowhere\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"supportgowhere\",\n componentScheme: \"default\",\n};\n\nexport const SGWDigitalLobbyThemeBase: ThemeSpec = {\n colourScheme: \"sgwdigitallobby\",\n fontScheme: \"sgwdigitallobby\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"supportgowhere\",\n componentScheme: \"default\",\n};\n\nconst IMDAThemeBase: ThemeSpec = {\n colourScheme: \"imda\",\n fontScheme: \"imda\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"imda\",\n componentScheme: \"default\",\n};\n\nconst SPFThemeBase: ThemeSpec = {\n colourScheme: \"spf\",\n fontScheme: \"spf\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"spf\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"spf\",\n componentScheme: \"spf\",\n};\n\nconst SMGSThemeBase: ThemeSpec = {\n colourScheme: \"smgs\",\n fontScheme: \"smgs\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"smgs\",\n componentScheme: \"smgs\",\n};\n\n// =============================================================================\n// THEME COLLECTIONS\n// =============================================================================\n\n// Theme presets with backward compatibility and light/dark variants\nexport const LifeSGTheme = {\n ...LifeSGThemeBase,\n light: createThemeWithColourMode(LifeSGThemeBase, \"light\"),\n dark: createThemeWithColourMode(LifeSGThemeBase, \"dark\"),\n};\n\nexport const BookingSGTheme = {\n ...BookingSGThemeBase,\n light: createThemeWithColourMode(BookingSGThemeBase, \"light\"),\n dark: createThemeWithColourMode(BookingSGThemeBase, \"dark\"),\n};\n\nexport const CCubeTheme = {\n ...CCubeThemeBase,\n light: createThemeWithColourMode(CCubeThemeBase, \"light\"),\n dark: createThemeWithColourMode(CCubeThemeBase, \"dark\"),\n};\n\nexport const MyLegacyTheme = {\n ...MyLegacyThemeBase,\n light: createThemeWithColourMode(MyLegacyThemeBase, \"light\"),\n dark: createThemeWithColourMode(MyLegacyThemeBase, \"dark\"),\n};\n\nexport const RBSTheme = {\n ...RBSThemeBase,\n light: createThemeWithColourMode(RBSThemeBase, \"light\"),\n dark: createThemeWithColourMode(RBSThemeBase, \"dark\"),\n};\n\nexport const OneServiceTheme = {\n ...OneServiceThemeBase,\n light: createThemeWithColourMode(OneServiceThemeBase, \"light\"),\n dark: createThemeWithColourMode(OneServiceThemeBase, \"dark\"),\n};\n\nexport const PATheme = {\n ...PAThemeBase,\n light: createThemeWithColourMode(PAThemeBase, \"light\"),\n dark: createThemeWithColourMode(PAThemeBase, \"dark\"),\n};\n\nexport const A11yPlaygroundTheme = {\n ...A11yPlaygroundThemeBase,\n light: createThemeWithColourMode(A11yPlaygroundThemeBase, \"light\"),\n dark: createThemeWithColourMode(A11yPlaygroundThemeBase, \"dark\"),\n};\n\nexport const SupportGoWhereTheme = {\n ...SupportGoWhereThemeBase,\n light: createThemeWithColourMode(SupportGoWhereThemeBase, \"light\"),\n dark: createThemeWithColourMode(SupportGoWhereThemeBase, \"dark\"),\n};\n\nexport const SGWDigitalLobbyTheme = {\n ...SGWDigitalLobbyThemeBase,\n light: createThemeWithColourMode(SGWDigitalLobbyThemeBase, \"light\"),\n dark: createThemeWithColourMode(SGWDigitalLobbyThemeBase, \"dark\"),\n};\n\nexport const IMDATheme = {\n ...IMDAThemeBase,\n light: createThemeWithColourMode(IMDAThemeBase, \"light\"),\n dark: createThemeWithColourMode(IMDAThemeBase, \"dark\"),\n};\n\nexport const SPFTheme = {\n ...SPFThemeBase,\n light: createThemeWithColourMode(SPFThemeBase, \"light\"),\n dark: createThemeWithColourMode(SPFThemeBase, \"dark\"),\n};\n\nexport const SMGSTheme = {\n ...SMGSThemeBase,\n light: createThemeWithColourMode(SMGSThemeBase, \"light\"),\n dark: createThemeWithColourMode(SMGSThemeBase, \"dark\"),\n};\n"],"names":["Colour","Object","assign","ColourSemantic","Primitive","PrimitiveColour","Font","FontValues","Spec","FontSpecValues","Motion","MotionValues","Border","BorderValues","Util","BorderUtilValues","Spacing","SpacingValues","Radius","RadiusValues","Shadow","ShadowValues","Breakpoint","BreakpointValues","MediaQuery","MediaQueryValues","ThemeComponent","Button","ThemeButton","Navbar","ThemeNavbar","LifeSGThemeBase","colourScheme","fontScheme","motionScheme","borderScheme","spacingScheme","radiusScheme","shadowScheme","breakpointScheme","resourceScheme","componentScheme","_v2","colorScheme","textStyleScheme","designTokenScheme","BookingSGThemeBase","CCubeThemeBase","MyLegacyThemeBase","RBSThemeBase","OneServiceThemeBase","PAThemeBase","A11yPlaygroundThemeBase","SupportGoWhereThemeBase","SGWDigitalLobbyThemeBase","IMDAThemeBase","SPFThemeBase","SMGSThemeBase","LifeSGTheme","light","createThemeWithColourMode","dark","BookingSGTheme","CCubeTheme","MyLegacyTheme","RBSTheme","OneServiceTheme","PATheme","A11yPlaygroundTheme","SupportGoWhereTheme","SGWDigitalLobbyTheme","IMDATheme","SPFTheme","SMGSTheme"],"mappings":"gnBAwBO,MAAMA,EAAMC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACZC,mBACHC,UAAWC,oBAGFC,EAAIL,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACVK,eACHC,KAAMC,mBAGGC,EAASC,EAAAA,aAETC,EAAMX,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACZW,iBACHC,KAAMC,qBAGGC,EAAUC,EAAAA,cAEVC,EAASC,EAAAA,aAETC,EAASC,EAAAA,aAETC,EAAaC,EAAAA,iBAEbC,EAAaC,EAAAA,WAEbC,EAAiB,CAC1BC,OAAQC,EAAAA,YACRC,OAAQC,EAAAA,aAQNC,EAA6B,CAC/BC,aAAc,SACdC,WAAY,UACZC,aAAc,UACdC,aAAc,UACdC,cAAe,UACfC,aAAc,UACdC,aAAc,UACdC,iBAAkB,UAClBC,eAAgB,SAChBC,gBAAiB,SACjBC,IAAK,CACDC,YAAa,OACbC,gBAAiB,OACjBC,kBAAmB,OACnBL,eAAgB,SAIlBM,EAAgC,CAClCd,aAAc,YACdC,WAAY,YACZC,aAAc,UACdC,aAAc,UACdC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AAAC,OAAA,CAAA,EACd+C,IACHU,MAAOC,EAAAA,0BAA0BX,EAAc,SAC/CY,KAAMD,4BAA0BX,EAAc,UAGrCiB,EAAejE,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACrBgD,IACHS,MAAOC,EAAAA,0BAA0BV,EAAqB,SACtDW,KAAMD,4BAA0BV,EAAqB,UAG5CiB,EAAOlE,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACbiD,IACHQ,MAAOC,EAAAA,0BAA0BT,EAAa,SAC9CU,KAAMD,4BAA0BT,EAAa,UAGpCiB,EAAmBnE,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACzBkD,IACHO,MAAOC,EAAAA,0BAA0BR,EAAyB,SAC1DS,KAAMD,4BAA0BR,EAAyB,UAGhDiB,EAAmBpE,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACzBmD,IACHM,MAAOC,EAAAA,0BAA0BP,EAAyB,SAC1DQ,KAAMD,4BAA0BP,EAAyB,UAGhDiB,EAAoBrE,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAC1BoD,IACHK,MAAOC,EAAAA,0BAA0BN,EAA0B,SAC3DO,KAAMD,4BAA0BN,EAA0B,UAGjDiB,EAAStE,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACfqD,IACHI,MAAOC,EAAAA,0BAA0BL,EAAe,SAChDM,KAAMD,4BAA0BL,EAAe,UAGtCiB,EAAQvE,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACdsD,IACHG,MAAOC,EAAAA,0BAA0BJ,EAAc,SAC/CK,KAAMD,4BAA0BJ,EAAc,UAGrCiB,EAASxE,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACfuD,IACHE,MAAOC,EAAAA,0BAA0BH,EAAe,SAChDI,KAAMD,4BAA0BH,EAAe"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/theme/index.ts"],"sourcesContent":["import { BorderUtilValues } from \"./border-util/theme-helper\";\nimport { BorderValues } from \"./border/theme-helper\";\nimport { MediaQuery as MediaQueryValues } from \"./breakpoint/media-query-helper\";\nimport { BreakpointValues } from \"./breakpoint/theme-helper\";\nimport { PrimitiveColour } from \"./colour-primitive/theme-helper\";\nimport { ColourSemantic } from \"./colour-semantic/theme-helper\";\nimport { ThemeButton, ThemeNavbar } from \"./components/theme-helper\";\nimport { FontSpecValues } from \"./font-spec/theme-helper\";\nimport { FontValues } from \"./font/theme-helper\";\nimport { MotionValues } from \"./motion/theme-helper\";\nimport { RadiusValues } from \"./radius/theme-helper\";\nimport { ShadowValues } from \"./shadow/theme-helper\";\nimport { SpacingValues } from \"./spacing/theme-helper\";\nimport { ThemeSpec } from \"./types\";\nimport { createThemeWithColourMode } from \"./use-theme-mode\";\n\nexport * from \"./types\";\nexport * from \"./ds-theme-provider\";\nexport * from \"./use-theme-mode\";\n\n// =============================================================================\n// TOKENS\n// =============================================================================\n\nexport const Colour = {\n ...ColourSemantic,\n Primitive: PrimitiveColour,\n};\n\nexport const Font = {\n ...FontValues,\n Spec: FontSpecValues,\n};\n\nexport const Motion = MotionValues;\n\nexport const Border = {\n ...BorderValues,\n Util: BorderUtilValues,\n};\n\nexport const Spacing = SpacingValues;\n\nexport const Radius = RadiusValues;\n\nexport const Shadow = ShadowValues;\n\nexport const Breakpoint = BreakpointValues;\n\nexport const MediaQuery = MediaQueryValues;\n\nexport const ThemeComponent = {\n Button: ThemeButton,\n Navbar: ThemeNavbar,\n};\n\n// =============================================================================\n// THEME PRESETS\n// =============================================================================\n\n// Theme definitions\nconst LifeSGThemeBase: ThemeSpec = {\n colourScheme: \"lifesg\",\n fontScheme: \"default\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"lifesg\",\n componentScheme: \"lifesg\",\n _v2: {\n colorScheme: \"base\",\n textStyleScheme: \"base\",\n designTokenScheme: \"base\",\n resourceScheme: \"base\",\n },\n};\n\nconst BookingSGThemeBase: ThemeSpec = {\n colourScheme: \"bookingsg\",\n fontScheme: \"bookingsg\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"bookingsg\",\n _v2: {\n colorScheme: \"bookingsg\",\n textStyleScheme: \"base\",\n designTokenScheme: \"base\",\n resourceScheme: \"bookingsg\",\n },\n};\n\nconst CCubeThemeBase: ThemeSpec = {\n colourScheme: \"ccube\",\n fontScheme: \"default\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"ccube\",\n _v2: {\n colorScheme: \"ccube\",\n textStyleScheme: \"base\",\n designTokenScheme: \"base\",\n resourceScheme: \"ccube\",\n },\n};\n\nconst CareerCompassThemeBase: ThemeSpec = {\n colourScheme: \"careercompass\",\n fontScheme: \"bookingsg\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"careercompass\",\n componentScheme: \"default\",\n};\n\nconst MyLegacyThemeBase: ThemeSpec = {\n colourScheme: \"mylegacy\",\n fontScheme: \"mylegacy\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"mylegacy\",\n _v2: {\n colorScheme: \"mylegacy\",\n textStyleScheme: \"base\",\n designTokenScheme: \"base\",\n resourceScheme: \"mylegacy\",\n },\n};\n\nconst RBSThemeBase: ThemeSpec = {\n colourScheme: \"rbs\",\n fontScheme: \"default\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"rbs\",\n _v2: {\n colorScheme: \"rbs\",\n textStyleScheme: \"base\",\n designTokenScheme: \"rbs\",\n resourceScheme: \"rbs\",\n },\n};\n\nconst OneServiceThemeBase: ThemeSpec = {\n colourScheme: \"oneservice\",\n fontScheme: \"oneservice\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"oneservice\",\n};\n\nconst PAThemeBase: ThemeSpec = {\n colourScheme: \"pa\",\n fontScheme: \"pa\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"pa\",\n componentScheme: \"pa\",\n};\n\nconst A11yPlaygroundThemeBase: ThemeSpec = {\n colourScheme: \"a11yplayground\",\n fontScheme: \"a11yplayground\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"a11yplayground\",\n componentScheme: \"a11yplayground\",\n};\n\nexport const SupportGoWhereThemeBase: ThemeSpec = {\n colourScheme: \"supportgowhere\",\n fontScheme: \"supportgowhere\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"supportgowhere\",\n componentScheme: \"default\",\n};\n\nexport const SGWDigitalLobbyThemeBase: ThemeSpec = {\n colourScheme: \"sgwdigitallobby\",\n fontScheme: \"sgwdigitallobby\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"supportgowhere\",\n componentScheme: \"default\",\n};\n\nconst IMDAThemeBase: ThemeSpec = {\n colourScheme: \"imda\",\n fontScheme: \"imda\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"imda\",\n componentScheme: \"default\",\n};\n\nconst SPFThemeBase: ThemeSpec = {\n colourScheme: \"spf\",\n fontScheme: \"spf\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"spf\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"spf\",\n componentScheme: \"spf\",\n};\n\nconst SMGSThemeBase: ThemeSpec = {\n colourScheme: \"smgs\",\n fontScheme: \"bookingsg\",\n motionScheme: \"default\",\n borderScheme: \"default\",\n spacingScheme: \"default\",\n radiusScheme: \"default\",\n shadowScheme: \"default\",\n breakpointScheme: \"default\",\n resourceScheme: \"smgs\",\n componentScheme: \"smgs\",\n};\n\n// =============================================================================\n// THEME COLLECTIONS\n// =============================================================================\n\n// Theme presets with backward compatibility and light/dark variants\nexport const LifeSGTheme = {\n ...LifeSGThemeBase,\n light: createThemeWithColourMode(LifeSGThemeBase, \"light\"),\n dark: createThemeWithColourMode(LifeSGThemeBase, \"dark\"),\n};\n\nexport const BookingSGTheme = {\n ...BookingSGThemeBase,\n light: createThemeWithColourMode(BookingSGThemeBase, \"light\"),\n dark: createThemeWithColourMode(BookingSGThemeBase, \"dark\"),\n};\n\nexport const CCubeTheme = {\n ...CCubeThemeBase,\n light: createThemeWithColourMode(CCubeThemeBase, \"light\"),\n dark: createThemeWithColourMode(CCubeThemeBase, \"dark\"),\n};\n\nexport const CareerCompassTheme = {\n ...CareerCompassThemeBase,\n light: createThemeWithColourMode(CareerCompassThemeBase, \"light\"),\n dark: createThemeWithColourMode(CareerCompassThemeBase, \"dark\"),\n};\n\nexport const MyLegacyTheme = {\n ...MyLegacyThemeBase,\n light: createThemeWithColourMode(MyLegacyThemeBase, \"light\"),\n dark: createThemeWithColourMode(MyLegacyThemeBase, \"dark\"),\n};\n\nexport const RBSTheme = {\n ...RBSThemeBase,\n light: createThemeWithColourMode(RBSThemeBase, \"light\"),\n dark: createThemeWithColourMode(RBSThemeBase, \"dark\"),\n};\n\nexport const OneServiceTheme = {\n ...OneServiceThemeBase,\n light: createThemeWithColourMode(OneServiceThemeBase, \"light\"),\n dark: createThemeWithColourMode(OneServiceThemeBase, \"dark\"),\n};\n\nexport const PATheme = {\n ...PAThemeBase,\n light: createThemeWithColourMode(PAThemeBase, \"light\"),\n dark: createThemeWithColourMode(PAThemeBase, \"dark\"),\n};\n\nexport const A11yPlaygroundTheme = {\n ...A11yPlaygroundThemeBase,\n light: createThemeWithColourMode(A11yPlaygroundThemeBase, \"light\"),\n dark: createThemeWithColourMode(A11yPlaygroundThemeBase, \"dark\"),\n};\n\nexport const SupportGoWhereTheme = {\n ...SupportGoWhereThemeBase,\n light: createThemeWithColourMode(SupportGoWhereThemeBase, \"light\"),\n dark: createThemeWithColourMode(SupportGoWhereThemeBase, \"dark\"),\n};\n\nexport const SGWDigitalLobbyTheme = {\n ...SGWDigitalLobbyThemeBase,\n light: createThemeWithColourMode(SGWDigitalLobbyThemeBase, \"light\"),\n dark: createThemeWithColourMode(SGWDigitalLobbyThemeBase, \"dark\"),\n};\n\nexport const IMDATheme = {\n ...IMDAThemeBase,\n light: createThemeWithColourMode(IMDAThemeBase, \"light\"),\n dark: createThemeWithColourMode(IMDAThemeBase, \"dark\"),\n};\n\nexport const SPFTheme = {\n ...SPFThemeBase,\n light: createThemeWithColourMode(SPFThemeBase, \"light\"),\n dark: createThemeWithColourMode(SPFThemeBase, \"dark\"),\n};\n\nexport const SMGSTheme = {\n ...SMGSThemeBase,\n light: createThemeWithColourMode(SMGSThemeBase, \"light\"),\n dark: createThemeWithColourMode(SMGSThemeBase, \"dark\"),\n};\n"],"names":["Colour","Object","assign","ColourSemantic","Primitive","PrimitiveColour","Font","FontValues","Spec","FontSpecValues","Motion","MotionValues","Border","BorderValues","Util","BorderUtilValues","Spacing","SpacingValues","Radius","RadiusValues","Shadow","ShadowValues","Breakpoint","BreakpointValues","MediaQuery","MediaQueryValues","ThemeComponent","Button","ThemeButton","Navbar","ThemeNavbar","LifeSGThemeBase","colourScheme","fontScheme","motionScheme","borderScheme","spacingScheme","radiusScheme","shadowScheme","breakpointScheme","resourceScheme","componentScheme","_v2","colorScheme","textStyleScheme","designTokenScheme","BookingSGThemeBase","CCubeThemeBase","CareerCompassThemeBase","MyLegacyThemeBase","RBSThemeBase","OneServiceThemeBase","PAThemeBase","A11yPlaygroundThemeBase","SupportGoWhereThemeBase","SGWDigitalLobbyThemeBase","IMDAThemeBase","SPFThemeBase","SMGSThemeBase","LifeSGTheme","light","createThemeWithColourMode","dark","BookingSGTheme","CCubeTheme","CareerCompassTheme","MyLegacyTheme","RBSTheme","OneServiceTheme","PATheme","A11yPlaygroundTheme","SupportGoWhereTheme","SGWDigitalLobbyTheme","IMDATheme","SPFTheme","SMGSTheme"],"mappings":"gnBAwBO,MAAMA,EAAMC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACZC,mBACHC,UAAWC,oBAGFC,EAAIL,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACVK,eACHC,KAAMC,mBAGGC,EAASC,EAAAA,aAETC,EAAMX,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACZW,iBACHC,KAAMC,qBAGGC,EAAUC,EAAAA,cAEVC,EAASC,EAAAA,aAETC,EAASC,EAAAA,aAETC,EAAaC,EAAAA,iBAEbC,EAAaC,EAAAA,WAEbC,EAAiB,CAC1BC,OAAQC,EAAAA,YACRC,OAAQC,EAAAA,aAQNC,EAA6B,CAC/BC,aAAc,SACdC,WAAY,UACZC,aAAc,UACdC,aAAc,UACdC,cAAe,UACfC,aAAc,UACdC,aAAc,UACdC,iBAAkB,UAClBC,eAAgB,SAChBC,gBAAiB,SACjBC,IAAK,CACDC,YAAa,OACbC,gBAAiB,OACjBC,kBAAmB,OACnBL,eAAgB,SAIlBM,EAAgC,CAClCd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OAAAC,OAAA,CAAA,EACduD,IACHG,MAAOC,EAAAA,0BAA0BJ,EAAc,SAC/CK,KAAMD,4BAA0BJ,EAAc,UAGrCkB,EAAS1E,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACfwD,IACHE,MAAOC,EAAAA,0BAA0BH,EAAe,SAChDI,KAAMD,4BAA0BH,EAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../_virtual/_tslib.js"),r=require("react/jsx-runtime"),o=require("react"),l=require("../shared/dropdown-wrapper/element-with-dropdown.js"),a=require("../shared/input-wrapper/input-wrapper.js"),n=require("../shared/timepicker-dropdown/timepicker-dropdown.js"),i=require("../util/time-helper.js"),d=require("./timepicker.styles.js");exports.Timepicker=t=>{var{id:s,disabled:u=!1,readOnly:p=!1,error:c,value:m,placeholder:b,format:v="24hr",onChange:w,onFocus:y,onBlur:h,alignment:f,dropdownZIndex:g,dropdownRootNode:j,"aria-labelledby":k,"aria-describedby":x}=t,q=e.__rest(t,["id","disabled","readOnly","error","value","placeholder","format","onChange","onFocus","onBlur","alignment","dropdownZIndex","dropdownRootNode","aria-labelledby","aria-describedby"]);const[D,O]=o.useState(!1),C=o.useRef(null)
|
|
1
|
+
"use strict";var e=require("../_virtual/_tslib.js"),r=require("react/jsx-runtime"),o=require("react"),l=require("../shared/dropdown-wrapper/element-with-dropdown.js"),a=require("../shared/input-wrapper/input-wrapper.js"),n=require("../shared/timepicker-dropdown/timepicker-dropdown.js"),i=require("../util/time-helper.js"),d=require("./timepicker.styles.js");exports.Timepicker=t=>{var{id:s,disabled:u=!1,readOnly:p=!1,error:c,value:m,placeholder:b,format:v="24hr",onChange:w,onFocus:y,onBlur:h,alignment:f,dropdownZIndex:g,dropdownRootNode:j,"aria-labelledby":k,"aria-describedby":x}=t,q=e.__rest(t,["id","disabled","readOnly","error","value","placeholder","format","onChange","onFocus","onBlur","alignment","dropdownZIndex","dropdownRootNode","aria-labelledby","aria-describedby"]);const[D,O]=o.useState(!1),C=o.useRef(null),$=o.useRef(null),F=o.useCallback((()=>"12hr"===v?"HH:MMam":"HH:MM"),[v]),H=()=>{var e;null===(e=$.current)||void 0===e||e.focus({preventScroll:!0})},I=()=>{u||p||O(!0)},R=()=>{O(!1),H()},T=e=>{null==w||w(e),O(!1),H()},E=()=>{u||null==y||y()},M=e=>{var r;if(D||u)return;const o=e.relatedTarget;o&&(null===(r=C.current)||void 0===r?void 0:r.contains(o))||null==h||h()},_=e=>{u||p||"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),I())};return r.jsx(l.ElementWithDropdown,{enabled:!p&&!u,isOpen:D,renderElement:()=>r.jsx(a.InputWrapper,Object.assign({ref:C,role:"group",$readOnly:p,$disabled:u,$focused:D,$error:c},q,{children:r.jsx(d.InputSelectorElement,{$disabled:u,ref:$,readOnly:!0,placeholder:b||F(),value:i.TimeHelper.formatDisplayValue(m,v),role:"combobox","aria-invalid":c||void 0,"aria-disabled":u||void 0,"aria-readonly":p||void 0,"aria-labelledby":k,"aria-describedby":x,"aria-expanded":!u&&!p&&D,"data-testid":s?`${s}-timepicker-selector`:"timepicker-selector",onFocus:E,onClick:I,onKeyDown:_,onBlur:M})})),renderDropdown:({styles:e,setFloatingRef:o,getFloatingProps:l})=>r.jsx("div",Object.assign({ref:o,style:e,role:"dialog","aria-label":"Time picker"},l(),{children:r.jsx(n.TimepickerDropdown,{id:s,show:D,value:m,format:v,onCancel:R,onChange:T})})),onOpen:I,onClose:()=>{O(!1),null==h||h()},onDismiss:R,offset:8,alignment:f,customZIndex:g,rootNode:j})};
|
|
2
2
|
//# sourceMappingURL=timepicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timepicker.js","sources":["../../../src/timepicker/timepicker.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from \"react\";\nimport {\n DropdownRenderProps,\n ElementWithDropdown,\n} from \"../shared/dropdown-wrapper\";\nimport { InputWrapper } from \"../shared/input-wrapper/input-wrapper\";\nimport { TimepickerDropdown } from \"../shared/timepicker-dropdown/timepicker-dropdown\";\nimport { TimeHelper } from \"../util/time-helper\";\nimport { InputSelectorElement } from \"./timepicker.styles\";\nimport { TimepickerProps } from \"./types\";\n\nexport const Timepicker = ({\n id,\n disabled = false,\n readOnly = false,\n error,\n value,\n placeholder,\n format = \"24hr\",\n onChange,\n onFocus,\n onBlur,\n alignment,\n dropdownZIndex,\n dropdownRootNode,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n}: TimepickerProps) => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [isOpen, setIsOpen] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLInputElement>(null);\n\n // =============================================================================\n // HELPER FUNCTIONS\n // =============================================================================\n const getPlaceholderValue = useCallback(() => {\n switch (format) {\n case \"12hr\":\n return \"HH:MMam\";\n case \"24hr\":\n default:\n return \"HH:MM\";\n }\n }, [format]);\n\n const restoreFocusToSelector = () => {\n selectorRef.current?.focus({ preventScroll: true });\n };\n\n // =============================================================================\n // EVENT LISTENERS\n // =============================================================================\n const handleOpen = () => {\n if (disabled || readOnly) return;\n setIsOpen(true);\n };\n\n const handleClose = () => {\n setIsOpen(false);\n onBlur?.();\n };\n\n const handleDismiss = () => {\n setIsOpen(false);\n restoreFocusToSelector();\n };\n\n const handleChange = (v: string) => {\n onChange?.(v);\n setIsOpen(false);\n restoreFocusToSelector();\n };\n\n const handleFocus = () => {\n onFocus?.();\n };\n\n const handleSelectorBlur = (e: React.FocusEvent<HTMLInputElement>) => {\n if (isOpen) return;\n\n const next = e.relatedTarget as Node | null;\n if (next && wrapperRef.current?.contains(next)) return;\n\n onBlur?.();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n if (e.key === \"Enter\" || e.key === \" \" || e.key === \"ArrowDown\") {\n e.preventDefault();\n handleOpen();\n }\n };\n\n // =============================================================================\n // RENDER\n // =============================================================================\n const renderElement = () => (\n <InputWrapper\n ref={wrapperRef}\n role=\"group\"\n $readOnly={readOnly}\n $disabled={disabled}\n $focused={isOpen}\n $error={error}\n {...otherProps}\n >\n <InputSelectorElement\n ref={selectorRef}\n readOnly\n placeholder={placeholder || getPlaceholderValue()}\n value={TimeHelper.formatDisplayValue(value, format)}\n role=\"combobox\"\n aria-invalid={error || undefined}\n aria-disabled={disabled || undefined}\n aria-readonly={readOnly || undefined}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={!disabled && !readOnly ? isOpen : false}\n data-testid={\n id ? `${id}-timepicker-selector` : \"timepicker-selector\"\n }\n onFocus={handleFocus}\n onClick={handleOpen}\n onKeyDown={handleKeyDown}\n onBlur={handleSelectorBlur}\n />\n </InputWrapper>\n );\n\n const renderDropdown = ({\n styles,\n setFloatingRef,\n getFloatingProps,\n }: DropdownRenderProps) => (\n <div\n ref={setFloatingRef}\n style={styles}\n role=\"dialog\"\n aria-label=\"Time picker\"\n {...getFloatingProps()}\n >\n <TimepickerDropdown\n id={id}\n show={isOpen}\n value={value}\n format={format}\n onCancel={handleDismiss}\n onChange={handleChange}\n />\n </div>\n );\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={isOpen}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n offset={8}\n alignment={alignment}\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["_a","id","disabled","readOnly","error","value","placeholder","format","onChange","onFocus","onBlur","alignment","dropdownZIndex","dropdownRootNode","ariaLabelledBy","ariaDescribedBy","otherProps","__rest","isOpen","setIsOpen","useState","wrapperRef","useRef","selectorRef","getPlaceholderValue","useCallback","restoreFocusToSelector","current","focus","preventScroll","handleOpen","handleDismiss","handleChange","v","handleFocus","handleSelectorBlur","e","next","relatedTarget","contains","handleKeyDown","key","preventDefault","_jsx","ElementWithDropdown","enabled","renderElement","InputWrapper","Object","assign","ref","role","$readOnly","$disabled","$focused","$error","children","InputSelectorElement","TimeHelper","formatDisplayValue","undefined","onClick","onKeyDown","renderDropdown","styles","setFloatingRef","getFloatingProps","style","TimepickerDropdown","show","onCancel","onOpen","onClose","onDismiss","offset","customZIndex","rootNode"],"mappings":"0XAW2BA,QAAAC,GACvBA,EAAEC,SACFA,GAAW,EAAKC,SAChBA,GAAW,EAAKC,MAChBA,EAAKC,MACLA,EAAKC,YACLA,EAAWC,OACXA,EAAS,OAAMC,SACfA,EAAQC,QACRA,EAAOC,OACPA,EAAMC,UACNA,EAASC,eACTA,EAAcC,iBACdA,EACA,kBAAmBC,EACnB,mBAAoBC,GAAef,EAChCgB,EAAUC,EAAAA,OAAAjB,EAhBU,wLAqBvB,MAAOkB,EAAQC,GAAaC,EAAAA,UAAS,GAC/BC,EAAaC,EAAAA,OAAuB,MACpCC,EAAcD,EAAAA,OAAyB,MAKvCE,EAAsBC,EAAAA,aAAY,IAE3B,SADDlB,EAEO,UAGA,SAEhB,CAACA,IAEEmB,EAAyB,WACR,QAAnB1B,EAAAuB,EAAYI,eAAO,IAAA3B,GAAAA,EAAE4B,MAAM,CAAEC,eAAe,GAAO,EAMjDC,EAAa,KACX5B,GAAYC,GAChBgB,GAAU,EAAK,EAQbY,EAAgB,KAClBZ,GAAU,GACVO,GAAwB,EAGtBM,EAAgBC,IAClBzB,SAAAA,EAAWyB,GACXd,GAAU,GACVO,GAAwB,EAGtBQ,EAAc,
|
|
1
|
+
{"version":3,"file":"timepicker.js","sources":["../../../src/timepicker/timepicker.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from \"react\";\nimport {\n DropdownRenderProps,\n ElementWithDropdown,\n} from \"../shared/dropdown-wrapper\";\nimport { InputWrapper } from \"../shared/input-wrapper/input-wrapper\";\nimport { TimepickerDropdown } from \"../shared/timepicker-dropdown/timepicker-dropdown\";\nimport { TimeHelper } from \"../util/time-helper\";\nimport { InputSelectorElement } from \"./timepicker.styles\";\nimport { TimepickerProps } from \"./types\";\n\nexport const Timepicker = ({\n id,\n disabled = false,\n readOnly = false,\n error,\n value,\n placeholder,\n format = \"24hr\",\n onChange,\n onFocus,\n onBlur,\n alignment,\n dropdownZIndex,\n dropdownRootNode,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n}: TimepickerProps) => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [isOpen, setIsOpen] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLInputElement>(null);\n\n // =============================================================================\n // HELPER FUNCTIONS\n // =============================================================================\n const getPlaceholderValue = useCallback(() => {\n switch (format) {\n case \"12hr\":\n return \"HH:MMam\";\n case \"24hr\":\n default:\n return \"HH:MM\";\n }\n }, [format]);\n\n const restoreFocusToSelector = () => {\n selectorRef.current?.focus({ preventScroll: true });\n };\n\n // =============================================================================\n // EVENT LISTENERS\n // =============================================================================\n const handleOpen = () => {\n if (disabled || readOnly) return;\n setIsOpen(true);\n };\n\n const handleClose = () => {\n setIsOpen(false);\n onBlur?.();\n };\n\n const handleDismiss = () => {\n setIsOpen(false);\n restoreFocusToSelector();\n };\n\n const handleChange = (v: string) => {\n onChange?.(v);\n setIsOpen(false);\n restoreFocusToSelector();\n };\n\n const handleFocus = () => {\n if (disabled) return;\n onFocus?.();\n };\n\n const handleSelectorBlur = (e: React.FocusEvent<HTMLInputElement>) => {\n if (isOpen || disabled) return;\n\n const next = e.relatedTarget as Node | null;\n if (next && wrapperRef.current?.contains(next)) return;\n\n onBlur?.();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n if (e.key === \"Enter\" || e.key === \" \" || e.key === \"ArrowDown\") {\n e.preventDefault();\n handleOpen();\n }\n };\n\n // =============================================================================\n // RENDER\n // =============================================================================\n const renderElement = () => (\n <InputWrapper\n ref={wrapperRef}\n role=\"group\"\n $readOnly={readOnly}\n $disabled={disabled}\n $focused={isOpen}\n $error={error}\n {...otherProps}\n >\n <InputSelectorElement\n $disabled={disabled}\n ref={selectorRef}\n readOnly\n placeholder={placeholder || getPlaceholderValue()}\n value={TimeHelper.formatDisplayValue(value, format)}\n role=\"combobox\"\n aria-invalid={error || undefined}\n aria-disabled={disabled || undefined}\n aria-readonly={readOnly || undefined}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={!disabled && !readOnly ? isOpen : false}\n data-testid={\n id ? `${id}-timepicker-selector` : \"timepicker-selector\"\n }\n onFocus={handleFocus}\n onClick={handleOpen}\n onKeyDown={handleKeyDown}\n onBlur={handleSelectorBlur}\n />\n </InputWrapper>\n );\n\n const renderDropdown = ({\n styles,\n setFloatingRef,\n getFloatingProps,\n }: DropdownRenderProps) => (\n <div\n ref={setFloatingRef}\n style={styles}\n role=\"dialog\"\n aria-label=\"Time picker\"\n {...getFloatingProps()}\n >\n <TimepickerDropdown\n id={id}\n show={isOpen}\n value={value}\n format={format}\n onCancel={handleDismiss}\n onChange={handleChange}\n />\n </div>\n );\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={isOpen}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n offset={8}\n alignment={alignment}\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["_a","id","disabled","readOnly","error","value","placeholder","format","onChange","onFocus","onBlur","alignment","dropdownZIndex","dropdownRootNode","ariaLabelledBy","ariaDescribedBy","otherProps","__rest","isOpen","setIsOpen","useState","wrapperRef","useRef","selectorRef","getPlaceholderValue","useCallback","restoreFocusToSelector","current","focus","preventScroll","handleOpen","handleDismiss","handleChange","v","handleFocus","handleSelectorBlur","e","next","relatedTarget","contains","handleKeyDown","key","preventDefault","_jsx","ElementWithDropdown","enabled","renderElement","InputWrapper","Object","assign","ref","role","$readOnly","$disabled","$focused","$error","children","InputSelectorElement","TimeHelper","formatDisplayValue","undefined","onClick","onKeyDown","renderDropdown","styles","setFloatingRef","getFloatingProps","style","TimepickerDropdown","show","onCancel","onOpen","onClose","onDismiss","offset","customZIndex","rootNode"],"mappings":"0XAW2BA,QAAAC,GACvBA,EAAEC,SACFA,GAAW,EAAKC,SAChBA,GAAW,EAAKC,MAChBA,EAAKC,MACLA,EAAKC,YACLA,EAAWC,OACXA,EAAS,OAAMC,SACfA,EAAQC,QACRA,EAAOC,OACPA,EAAMC,UACNA,EAASC,eACTA,EAAcC,iBACdA,EACA,kBAAmBC,EACnB,mBAAoBC,GAAef,EAChCgB,EAAUC,EAAAA,OAAAjB,EAhBU,wLAqBvB,MAAOkB,EAAQC,GAAaC,EAAAA,UAAS,GAC/BC,EAAaC,EAAAA,OAAuB,MACpCC,EAAcD,EAAAA,OAAyB,MAKvCE,EAAsBC,EAAAA,aAAY,IAE3B,SADDlB,EAEO,UAGA,SAEhB,CAACA,IAEEmB,EAAyB,WACR,QAAnB1B,EAAAuB,EAAYI,eAAO,IAAA3B,GAAAA,EAAE4B,MAAM,CAAEC,eAAe,GAAO,EAMjDC,EAAa,KACX5B,GAAYC,GAChBgB,GAAU,EAAK,EAQbY,EAAgB,KAClBZ,GAAU,GACVO,GAAwB,EAGtBM,EAAgBC,IAClBzB,SAAAA,EAAWyB,GACXd,GAAU,GACVO,GAAwB,EAGtBQ,EAAc,KACZhC,GACJO,SAAAA,GAAW,EAGT0B,EAAsBC,UACxB,GAAIlB,GAAUhB,EAAU,OAExB,MAAMmC,EAAOD,EAAEE,cACXD,IAA0B,QAAlBrC,EAAAqB,EAAWM,eAAO,IAAA3B,OAAA,EAAAA,EAAEuC,SAASF,KAEzC3B,SAAAA,GAAU,EAGR8B,EAAiBJ,IACflC,GAAYC,GAIF,UAAViC,EAAEK,KAA6B,MAAVL,EAAEK,KAAyB,cAAVL,EAAEK,MACxCL,EAAEM,iBACFZ,IACJ,EA+DJ,OACIa,EAAAA,IAACC,EAAAA,oBAAmB,CAChBC,SAAU1C,IAAaD,EACvBgB,OAAQA,EACR4B,cA7Dc,IAClBH,MAACI,EAAAA,aAAYC,OAAAC,OAAA,CACTC,IAAK7B,EACL8B,KAAK,QAAOC,UACDjD,EAAQkD,UACRnD,EAAQoD,SACTpC,EAAMqC,OACRnD,GACJY,EAAU,CAAAwC,SAEdb,MAACc,EAAAA,gCACcvD,EACXgD,IAAK3B,EACLpB,UAAQ,EACRG,YAAaA,GAAekB,IAC5BnB,MAAOqD,EAAAA,WAAWC,mBAAmBtD,EAAOE,GAC5C4C,KAAK,WAAU,eACD/C,QAASwD,EAAS,gBACjB1D,QAAY0D,EAAS,gBACrBzD,QAAYyD,EAAS,kBACnB9C,EAAc,mBACbC,EAAe,iBACjBb,IAAaC,GAAWe,EAAc,cAElDjB,EAAK,GAAGA,wBAA2B,sBAEvCQ,QAASyB,EACT2B,QAAS/B,EACTgC,UAAWtB,EACX9B,OAAQyB,OAiCZ4B,eA5Be,EACnBC,SACAC,iBACAC,sBAEAvB,EAAAA,IAAA,MAAAK,OAAAC,OAAA,CACIC,IAAKe,EACLE,MAAOH,EACPb,KAAK,SAAQ,aACF,eACPe,IAAkB,CAAAV,SAEtBb,EAAAA,IAACyB,EAAAA,mBAAkB,CACfnE,GAAIA,EACJoE,KAAMnD,EACNb,MAAOA,EACPE,OAAQA,EACR+D,SAAUvC,EACVvB,SAAUwB,OAWduC,OAAQzC,EACR0C,QA5GY,KAChBrD,GAAU,GACVT,SAAAA,GAAU,EA2GN+D,UAAW1C,EACX2C,OAAQ,EACR/D,UAAWA,EACXgE,aAAc/D,EACdgE,SAAU/D,GACZ"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),t=require("../shared/input-wrapper/input-wrapper.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var
|
|
1
|
+
"use strict";var e=require("styled-components"),t=require("../shared/input-wrapper/input-wrapper.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(e);i.default.div`
|
|
2
2
|
position: relative;
|
|
3
|
-
`;const
|
|
3
|
+
`;const n=i.default(t.BasicInput)`
|
|
4
4
|
height: calc(3rem - 2px); // exclude top and bottom borders
|
|
5
|
-
|
|
5
|
+
cursor: inherit;
|
|
6
|
+
`;exports.InputSelectorElement=n;
|
|
6
7
|
//# sourceMappingURL=timepicker.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timepicker.styles.js","sources":["../../../src/timepicker/timepicker.styles.tsx"],"sourcesContent":["import styled from \"styled-components\";\nimport { BasicInput } from \"../shared/input-wrapper/input-wrapper\";\n\n// =============================================================================\n// STYLING\n// =============================================================================\nexport const Wrapper = styled.div`\n position: relative;\n`;\n\nexport const InputSelectorElement = styled(BasicInput)
|
|
1
|
+
{"version":3,"file":"timepicker.styles.js","sources":["../../../src/timepicker/timepicker.styles.tsx"],"sourcesContent":["import styled from \"styled-components\";\nimport { BasicInput } from \"../shared/input-wrapper/input-wrapper\";\n\n// =============================================================================\n// STYLING\n// =============================================================================\nexport const Wrapper = styled.div`\n position: relative;\n`;\n\nexport const InputSelectorElement = styled(BasicInput)<{\n $disabled?: boolean | undefined;\n}>`\n height: calc(3rem - 2px); // exclude top and bottom borders\n cursor: inherit;\n`;\n"],"names":["styled","div","InputSelectorElement","BasicInput"],"mappings":"yLAMuBA,EAAAA,QAAOC,GAAG;;QAIpBC,EAAuBF,EAAAA,QAAOG,EAAAA,WAEzC;;;"}
|
package/date-input/date-input.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e}from"../_virtual/_tslib.js";import{jsx as a}from"react/jsx-runtime";import t from"../external/dayjs/dayjs.min.js";import{useState as r,useRef as n,useEffect as o}from"react";import{ElementWithDropdown as i}from"../shared/dropdown-wrapper/element-with-dropdown.js";import{CalendarDropdown as l}from"../shared/internal-calendar/calendar-dropdown.js";import"../shared/internal-calendar/internal-calendar.js";import{StandaloneDateInput as d}from"../shared/standalone-date-input/standalone-date-input.js";import"../util/calendar-helper.js";import"../util/date-helper.js";import{DateInputHelper as s}from"../util/date-input-helper.js";import"../util/simple-id-generator.js";import"../util/string-helper.js";import"@react-aria/live-announcer";import{Container as u}from"./date-input.style.js";const c=c=>{var{minDate:p,maxDate:m,disabled:h,disabledDates:v,error:f,hideInputKeyboard:D,value:b,onChange:j,onFocus:w,onBlur:g,onYearMonthDisplayChange:y,withButton:I=!0,readOnly:x,id:Y,allowDisabledSelection:C,zIndex:B,dropdownRootNode:O}=c,z=e(c,["minDate","maxDate","disabled","disabledDates","error","hideInputKeyboard","value","onChange","onFocus","onBlur","onYearMonthDisplayChange","withButton","readOnly","id","allowDisabledSelection","zIndex","dropdownRootNode"]);const[M,F]=r(s.sanitizeInput(b)),[R,S]=r(s.sanitizeInput(b)),[$,K]=r(void 0),[N,V]=r(!1),[_,k]=r(!1),E=n(null),H=n(null),T=n(null);o((()=>{const e=s.sanitizeInput(b);F(e),S(e)}),[b]);const W=e=>{!C&&s.isDateDisabled(e,{disabledDates:v,minDate:p,maxDate:m})||(S(e),I||(L(e),F(e),e&&V(!1)))},Z=e=>{var a;S(e),I||(L(e),F(e),e&&(null===(a=H.current)||void 0===a||a.focusYearRef(),V(!1)),K(void 0))},q=()=>{x||h||(V(!0),_||(k(!0),w&&w()))},A=e=>{var a,t,r;const n=e.relatedTarget,o=T.current&&T.current.contains(n),i=E.current&&E.current.contains(n),l=(null===(a=null==n?void 0:n.matches)||void 0===a?void 0:a.call(n,"[data-floating-ui-focusable]"))||(null===(t=null==n?void 0:n.matches)||void 0===t?void 0:t.call(n,"[data-floating-ui-focus-guard]"));(_&&!N&&!i&&!l||N&&!i&&!o&&!l)&&(null===(r=H.current)||void 0===r||r.resetInput(),S(M),k(!1),V(!1),P())},G=e=>{K(e)},J=e=>{var a,r;switch(e){case"reset":S(M);break;case"confirmed":F(R),L(R)}t(R,"YYYY-MM-DD",!0).isValid()?null===(a=H.current)||void 0===a||a.focusYearRef():null===(r=E.current)||void 0===r||r.focus(),V(!1)},L=e=>{j&&j(e)},P=()=>{g&&g()};return a(i,{enabled:!x&&!h,isOpen:N,renderElement:()=>a(u,Object.assign({role:"group",tabIndex:0,ref:E,onBlur:A,onFocus:q,$disabled:h,$readOnly:x,$focused:_,$error:f,id:Y,"data-testid":z["data-testid"],"aria-disabled":h},z,{children:a(d,{ref:H,disabled:h,onChange:W,readOnly:x,focused:N,names:["start-day","start-month","start-year"],value:R,hoverValue:$,hideInputKeyboard:D})})),renderDropdown:({elementWidth:e})=>a(l,{variant:"single",ref:T,initialCalendarDate:R,withButton:I,value:R,disabledDates:v,minDate:p,maxDate:m,allowDisabledSelection:C,onHover:G,onSelect:Z,onDismiss:J,onYearMonthDisplayChange:y,width:e,isFocusable:!x&&!h}),onClose:()=>{var e;null===(e=H.current)||void 0===e||e.resetInput(),S(M),V(!1),k(!1),P(),K(void 0)},onDismiss:()=>{var e,a;null===(e=H.current)||void 0===e||e.resetInput(),null===(a=E.current)||void 0===a||a.focus(),S(M),V(!1)},customZIndex:B,offset:16,rootNode:O})};export{c as DateInput};
|
|
1
|
+
import{__rest as e}from"../_virtual/_tslib.js";import{jsx as a}from"react/jsx-runtime";import t from"../external/dayjs/dayjs.min.js";import{useState as r,useRef as n,useEffect as o}from"react";import{ElementWithDropdown as i}from"../shared/dropdown-wrapper/element-with-dropdown.js";import{CalendarDropdown as l}from"../shared/internal-calendar/calendar-dropdown.js";import"../shared/internal-calendar/internal-calendar.js";import{StandaloneDateInput as d}from"../shared/standalone-date-input/standalone-date-input.js";import"../util/calendar-helper.js";import"../util/date-helper.js";import{DateInputHelper as s}from"../util/date-input-helper.js";import"../util/simple-id-generator.js";import"../util/string-helper.js";import"@react-aria/live-announcer";import{Container as u}from"./date-input.style.js";const c=c=>{var{minDate:p,maxDate:m,disabled:h,disabledDates:v,error:f,hideInputKeyboard:D,value:b,onChange:j,onFocus:w,onBlur:g,onYearMonthDisplayChange:y,withButton:I=!0,readOnly:x,id:Y,allowDisabledSelection:C,zIndex:B,dropdownRootNode:O}=c,z=e(c,["minDate","maxDate","disabled","disabledDates","error","hideInputKeyboard","value","onChange","onFocus","onBlur","onYearMonthDisplayChange","withButton","readOnly","id","allowDisabledSelection","zIndex","dropdownRootNode"]);const[M,F]=r(s.sanitizeInput(b)),[R,S]=r(s.sanitizeInput(b)),[$,K]=r(void 0),[N,V]=r(!1),[_,k]=r(!1),E=n(null),H=n(null),T=n(null);o((()=>{const e=s.sanitizeInput(b);F(e),S(e)}),[b]);const W=e=>{!C&&s.isDateDisabled(e,{disabledDates:v,minDate:p,maxDate:m})||(S(e),I||(L(e),F(e),e&&V(!1)))},Z=e=>{var a;S(e),I||(L(e),F(e),e&&(null===(a=H.current)||void 0===a||a.focusYearRef(),V(!1)),K(void 0))},q=()=>{x||h||(V(!0),_||(k(!0),w&&w()))},A=e=>{var a,t,r;const n=e.relatedTarget,o=T.current&&T.current.contains(n),i=E.current&&E.current.contains(n),l=(null===(a=null==n?void 0:n.matches)||void 0===a?void 0:a.call(n,"[data-floating-ui-focusable]"))||(null===(t=null==n?void 0:n.matches)||void 0===t?void 0:t.call(n,"[data-floating-ui-focus-guard]"));(_&&!N&&!i&&!l||N&&!i&&!o&&!l)&&(null===(r=H.current)||void 0===r||r.resetInput(),S(M),k(!1),V(!1),P())},G=e=>{N&&K(e)},J=e=>{var a,r;switch(e){case"reset":S(M);break;case"confirmed":F(R),L(R)}t(R,"YYYY-MM-DD",!0).isValid()?null===(a=H.current)||void 0===a||a.focusYearRef():null===(r=E.current)||void 0===r||r.focus(),V(!1)},L=e=>{j&&j(e)},P=()=>{g&&g()};return a(i,{enabled:!x&&!h,isOpen:N,renderElement:()=>a(u,Object.assign({role:"group",tabIndex:0,ref:E,onBlur:A,onFocus:q,$disabled:h,$readOnly:x,$focused:_,$error:f,id:Y,"data-testid":z["data-testid"],"aria-disabled":h},z,{children:a(d,{ref:H,disabled:h,onChange:W,readOnly:x,focused:N,names:["start-day","start-month","start-year"],value:R,hoverValue:$,hideInputKeyboard:D})})),renderDropdown:({elementWidth:e})=>a(l,{variant:"single",ref:T,initialCalendarDate:R,withButton:I,value:R,disabledDates:v,minDate:p,maxDate:m,allowDisabledSelection:C,onHover:G,onSelect:Z,onDismiss:J,onYearMonthDisplayChange:y,width:e,isFocusable:!x&&!h}),onClose:()=>{var e;null===(e=H.current)||void 0===e||e.resetInput(),S(M),V(!1),k(!1),P(),K(void 0)},onDismiss:()=>{var e,a;null===(e=H.current)||void 0===e||e.resetInput(),null===(a=E.current)||void 0===a||a.focus(),S(M),V(!1)},customZIndex:B,offset:16,rootNode:O})};export{c as DateInput};
|
|
2
2
|
//# sourceMappingURL=date-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input.js","sources":["../../src/date-input/date-input.tsx"],"sourcesContent":["import dayjs from \"dayjs\";\nimport { useEffect, useRef, useState } from \"react\";\nimport {\n DropdownRenderProps,\n ElementWithDropdown,\n} from \"../shared/dropdown-wrapper\";\nimport {\n CalendarAction,\n CalendarDropdown,\n InternalCalendarRef,\n} from \"../shared/internal-calendar\";\nimport {\n StandaloneDateInput,\n StandaloneDateInputRef,\n} from \"../shared/standalone-date-input/standalone-date-input\";\nimport { DateInputHelper } from \"../util\";\nimport { Container } from \"./date-input.style\";\nimport { DateInputProps } from \"./types\";\n\nexport const DateInput = ({\n minDate,\n maxDate,\n disabled,\n disabledDates,\n error,\n hideInputKeyboard,\n value,\n onChange,\n onFocus,\n onBlur,\n onYearMonthDisplayChange,\n withButton = true,\n readOnly,\n id,\n allowDisabledSelection,\n zIndex,\n dropdownRootNode,\n ...otherProps\n}: DateInputProps) => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [initialDate, setInitialDate] = useState<string>(\n DateInputHelper.sanitizeInput(value)\n );\n const [selectedDate, setSelectedDate] = useState<string>(\n DateInputHelper.sanitizeInput(value)\n );\n const [hoveredDate, setHoveredDate] = useState<string | undefined>(\n undefined\n );\n const [calendarOpen, setCalendarOpen] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<StandaloneDateInputRef>(null);\n const calendarRef = useRef<InternalCalendarRef>(null);\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n const newValue = DateInputHelper.sanitizeInput(value);\n setInitialDate(newValue);\n setSelectedDate(newValue);\n }, [value]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleClose = () => {\n inputRef.current?.resetInput();\n setSelectedDate(initialDate);\n setCalendarOpen(false);\n setFocused(false);\n\n performOnBlurHandler();\n\n // clear hover value for mobile scrolling\n setHoveredDate(undefined);\n };\n\n const handleDismiss = () => {\n inputRef.current?.resetInput();\n nodeRef.current?.focus();\n setSelectedDate(initialDate);\n setCalendarOpen(false);\n };\n\n const handleChange = (val: string) => {\n if (\n !allowDisabledSelection &&\n DateInputHelper.isDateDisabled(val, {\n disabledDates,\n minDate,\n maxDate,\n })\n ) {\n return;\n }\n\n setSelectedDate(val);\n\n if (!withButton) {\n performOnChangeHandler(val);\n setInitialDate(val);\n if (val) {\n setCalendarOpen(false);\n }\n }\n };\n\n const handleSelect = (val: string) => {\n setSelectedDate(val);\n\n if (!withButton) {\n performOnChangeHandler(val);\n setInitialDate(val);\n if (val) {\n inputRef.current?.focusYearRef();\n setCalendarOpen(false);\n }\n\n // clear hover value for mobile when onMouseLeave={handleMouseLeaveCell} is not triggered due to touch input\n setHoveredDate(undefined);\n }\n };\n\n const handleFocus = () => {\n if (readOnly || disabled) return;\n\n setCalendarOpen(true);\n\n if (focused) return;\n\n setFocused(true);\n\n if (onFocus) {\n onFocus();\n }\n };\n\n const handleBlur = (e: React.FocusEvent) => {\n const target = e.relatedTarget as HTMLElement;\n\n const isInsideCalendar =\n calendarRef.current && calendarRef.current.contains(target);\n const isInsideNode =\n nodeRef.current && nodeRef.current.contains(target);\n const isFloatingElement =\n target?.matches?.(\"[data-floating-ui-focusable]\") ||\n target?.matches?.(\"[data-floating-ui-focus-guard]\");\n\n // Condition when the calendar is closed and focus moved outside the component\n const shouldBlurWhenClosed =\n focused && !calendarOpen && !isInsideNode && !isFloatingElement;\n\n // Condition when the calendar is open, and focus went outside both input and calendar\n const shouldBlurWhenOpenOutside =\n calendarOpen &&\n !isInsideNode &&\n !isInsideCalendar &&\n !isFloatingElement;\n\n if (shouldBlurWhenClosed || shouldBlurWhenOpenOutside) {\n inputRef.current?.resetInput();\n setSelectedDate(initialDate);\n setFocused(false);\n setCalendarOpen(false);\n performOnBlurHandler();\n }\n };\n\n const handleHoverDayCell = (value: string) => {\n setHoveredDate(value);\n };\n\n const handleCalendarAction = (buttonAction: CalendarAction) => {\n // handle button in day calendar view\n switch (buttonAction) {\n case \"reset\":\n setSelectedDate(initialDate);\n break;\n case \"confirmed\":\n setInitialDate(selectedDate);\n performOnChangeHandler(selectedDate);\n break;\n }\n\n const isValid = dayjs(selectedDate, \"YYYY-MM-DD\", true).isValid();\n\n // Focus on year input if the selected date is valid to avoid restarting entire tab order\n if (isValid) {\n inputRef.current?.focusYearRef();\n } else {\n nodeRef.current?.focus();\n }\n setCalendarOpen(false);\n };\n\n // =============================================================================\n // HELPER FUNCTIONS\n // =============================================================================\n const performOnChangeHandler = (changeValue: string) => {\n if (onChange) {\n onChange(changeValue);\n }\n };\n\n const performOnBlurHandler = () => {\n if (onBlur) {\n onBlur();\n }\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderInput = () => {\n return (\n <Container\n role=\"group\"\n tabIndex={0}\n ref={nodeRef}\n onBlur={handleBlur}\n onFocus={handleFocus}\n $disabled={disabled}\n $readOnly={readOnly}\n $focused={focused}\n $error={error}\n id={id}\n data-testid={otherProps[\"data-testid\"]}\n aria-disabled={disabled}\n {...otherProps}\n >\n <StandaloneDateInput\n ref={inputRef}\n disabled={disabled}\n onChange={handleChange}\n readOnly={readOnly}\n focused={calendarOpen}\n names={[\"start-day\", \"start-month\", \"start-year\"]}\n value={selectedDate}\n hoverValue={hoveredDate}\n hideInputKeyboard={hideInputKeyboard}\n />\n </Container>\n );\n };\n\n const renderCalendar = ({ elementWidth }: DropdownRenderProps) => {\n return (\n <CalendarDropdown\n variant=\"single\"\n ref={calendarRef}\n initialCalendarDate={selectedDate}\n withButton={withButton}\n value={selectedDate}\n disabledDates={disabledDates}\n minDate={minDate}\n maxDate={maxDate}\n allowDisabledSelection={allowDisabledSelection}\n onHover={handleHoverDayCell}\n onSelect={handleSelect}\n onDismiss={handleCalendarAction}\n onYearMonthDisplayChange={onYearMonthDisplayChange}\n width={elementWidth}\n isFocusable={!readOnly && !disabled}\n />\n );\n };\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={calendarOpen}\n renderElement={renderInput}\n renderDropdown={renderCalendar}\n onClose={handleClose}\n onDismiss={handleDismiss}\n customZIndex={zIndex}\n offset={16}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["DateInput","_a","minDate","maxDate","disabled","disabledDates","error","hideInputKeyboard","value","onChange","onFocus","onBlur","onYearMonthDisplayChange","withButton","readOnly","id","allowDisabledSelection","zIndex","dropdownRootNode","otherProps","__rest","initialDate","setInitialDate","useState","DateInputHelper","sanitizeInput","selectedDate","setSelectedDate","hoveredDate","setHoveredDate","undefined","calendarOpen","setCalendarOpen","focused","setFocused","nodeRef","useRef","inputRef","calendarRef","useEffect","newValue","handleChange","val","isDateDisabled","performOnChangeHandler","handleSelect","current","focusYearRef","handleFocus","handleBlur","e","target","relatedTarget","isInsideCalendar","contains","isInsideNode","isFloatingElement","matches","call","_b","_c","resetInput","performOnBlurHandler","handleHoverDayCell","handleCalendarAction","buttonAction","dayjs","isValid","focus","changeValue","_jsx","ElementWithDropdown","enabled","isOpen","renderElement","Container","Object","assign","role","tabIndex","ref","$disabled","$focused","$error","children","StandaloneDateInput","names","hoverValue","renderDropdown","elementWidth","CalendarDropdown","variant","initialCalendarDate","onHover","onSelect","onDismiss","width","isFocusable","onClose","customZIndex","offset","rootNode"],"mappings":"qyBAmBO,MAAMA,EAAaC,IAAA,IAAAC,QACtBA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,cACRA,EAAaC,MACbA,EAAKC,kBACLA,EAAiBC,MACjBA,EAAKC,SACLA,EAAQC,QACRA,EAAOC,OACPA,EAAMC,yBACNA,EAAwBC,WACxBA,GAAa,EAAIC,SACjBA,EAAQC,GACRA,EAAEC,uBACFA,EAAsBC,OACtBA,EAAMC,iBACNA,GAAgBjB,EACbkB,EAAUC,EAAAnB,EAlBS,iOAuBtB,MAAOoB,EAAaC,GAAkBC,EAClCC,EAAgBC,cAAcjB,KAE3BkB,EAAcC,GAAmBJ,EACpCC,EAAgBC,cAAcjB,KAE3BoB,EAAaC,GAAkBN,OAClCO,IAEGC,EAAcC,GAAmBT,GAAkB,IACnDU,EAASC,GAAcX,GAAkB,GAE1CY,EAAUC,EAAuB,MACjCC,EAAWD,EAA+B,MAC1CE,EAAcF,EAA4B,MAKhDG,GAAU,KACN,MAAMC,EAAWhB,EAAgBC,cAAcjB,GAC/Cc,EAAekB,GACfb,EAAgBa,EAAS,GAC1B,CAAChC,IAKJ,MAmBMiC,EAAgBC,KAEb1B,GACDQ,EAAgBmB,eAAeD,EAAK,CAChCrC,gBACAH,UACAC,cAMRwB,EAAgBe,GAEX7B,IACD+B,EAAuBF,GACvBpB,EAAeoB,GACXA,GACAV,GAAgB,IAExB,EAGEa,EAAgBH,UAClBf,EAAgBe,GAEX7B,IACD+B,EAAuBF,GACvBpB,EAAeoB,GACXA,IACgB,QAAhBzC,EAAAoC,EAASS,eAAO,IAAA7C,GAAAA,EAAE8C,eAClBf,GAAgB,IAIpBH,OAAeC,GACnB,EAGEkB,EAAc,KACZlC,GAAYV,IAEhB4B,GAAgB,GAEZC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EAAU,CAAAiE,SAEdd,EAACe,EAAmB,CAChBL,IAAK3C,EACLjC,SAAUA,EACVK,SAAUgC,EACV3B,SAAUA,EACVmB,QAASF,EACTuD,MAAO,CAAC,YAAa,cAAe,cACpC9E,MAAOkB,EACP6D,WAAY3D,EACZrB,kBAAmBA,OAiC3BiF,eA3Be,EAAGC,kBAElBnB,EAACoB,EAAgB,CACbC,QAAQ,SACRX,IAAK1C,EACLsD,oBAAqBlE,EACrBb,WAAYA,EACZL,MAAOkB,EACPrB,cAAeA,EACfH,QAASA,EACTC,QAASA,EACTa,uBAAwBA,EACxB6E,QAAS9B,EACT+B,SAAUjD,EACVkD,UAAW/B,EACXpD,yBAA0BA,EAC1BoF,MAAOP,EACPQ,aAAcnF,IAAaV,IAW/B8F,QAhNY,WACA,QAAhBjG,EAAAoC,EAASS,eAAO,IAAA7C,GAAAA,EAAE4D,aAClBlC,EAAgBN,GAChBW,GAAgB,GAChBE,GAAW,GAEX4B,IAGAjC,OAAeC,EAAU,EAwMrBiE,UArMc,aACF,QAAhB9F,EAAAoC,EAASS,eAAO,IAAA7C,GAAAA,EAAE4D,aACH,QAAfF,EAAAxB,EAAQW,eAAO,IAAAa,GAAAA,EAAES,QACjBzC,EAAgBN,GAChBW,GAAgB,EAAM,EAkMlBmE,aAAclF,EACdmF,OAAQ,GACRC,SAAUnF,GACZ"}
|
|
1
|
+
{"version":3,"file":"date-input.js","sources":["../../src/date-input/date-input.tsx"],"sourcesContent":["import dayjs from \"dayjs\";\nimport { useEffect, useRef, useState } from \"react\";\nimport {\n DropdownRenderProps,\n ElementWithDropdown,\n} from \"../shared/dropdown-wrapper\";\nimport {\n CalendarAction,\n CalendarDropdown,\n InternalCalendarRef,\n} from \"../shared/internal-calendar\";\nimport {\n StandaloneDateInput,\n StandaloneDateInputRef,\n} from \"../shared/standalone-date-input/standalone-date-input\";\nimport { DateInputHelper } from \"../util\";\nimport { Container } from \"./date-input.style\";\nimport { DateInputProps } from \"./types\";\n\nexport const DateInput = ({\n minDate,\n maxDate,\n disabled,\n disabledDates,\n error,\n hideInputKeyboard,\n value,\n onChange,\n onFocus,\n onBlur,\n onYearMonthDisplayChange,\n withButton = true,\n readOnly,\n id,\n allowDisabledSelection,\n zIndex,\n dropdownRootNode,\n ...otherProps\n}: DateInputProps) => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [initialDate, setInitialDate] = useState<string>(\n DateInputHelper.sanitizeInput(value)\n );\n const [selectedDate, setSelectedDate] = useState<string>(\n DateInputHelper.sanitizeInput(value)\n );\n const [hoveredDate, setHoveredDate] = useState<string | undefined>(\n undefined\n );\n const [calendarOpen, setCalendarOpen] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<StandaloneDateInputRef>(null);\n const calendarRef = useRef<InternalCalendarRef>(null);\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n const newValue = DateInputHelper.sanitizeInput(value);\n setInitialDate(newValue);\n setSelectedDate(newValue);\n }, [value]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleClose = () => {\n inputRef.current?.resetInput();\n setSelectedDate(initialDate);\n setCalendarOpen(false);\n setFocused(false);\n\n performOnBlurHandler();\n\n // clear hover value for mobile scrolling\n setHoveredDate(undefined);\n };\n\n const handleDismiss = () => {\n inputRef.current?.resetInput();\n nodeRef.current?.focus();\n setSelectedDate(initialDate);\n setCalendarOpen(false);\n };\n\n const handleChange = (val: string) => {\n if (\n !allowDisabledSelection &&\n DateInputHelper.isDateDisabled(val, {\n disabledDates,\n minDate,\n maxDate,\n })\n ) {\n return;\n }\n\n setSelectedDate(val);\n\n if (!withButton) {\n performOnChangeHandler(val);\n setInitialDate(val);\n if (val) {\n setCalendarOpen(false);\n }\n }\n };\n\n const handleSelect = (val: string) => {\n setSelectedDate(val);\n\n if (!withButton) {\n performOnChangeHandler(val);\n setInitialDate(val);\n if (val) {\n inputRef.current?.focusYearRef();\n setCalendarOpen(false);\n }\n\n // clear hover value for mobile when onMouseLeave={handleMouseLeaveCell} is not triggered due to touch input\n setHoveredDate(undefined);\n }\n };\n\n const handleFocus = () => {\n if (readOnly || disabled) return;\n\n setCalendarOpen(true);\n\n if (focused) return;\n\n setFocused(true);\n\n if (onFocus) {\n onFocus();\n }\n };\n\n const handleBlur = (e: React.FocusEvent) => {\n const target = e.relatedTarget as HTMLElement;\n\n const isInsideCalendar =\n calendarRef.current && calendarRef.current.contains(target);\n const isInsideNode =\n nodeRef.current && nodeRef.current.contains(target);\n const isFloatingElement =\n target?.matches?.(\"[data-floating-ui-focusable]\") ||\n target?.matches?.(\"[data-floating-ui-focus-guard]\");\n\n // Condition when the calendar is closed and focus moved outside the component\n const shouldBlurWhenClosed =\n focused && !calendarOpen && !isInsideNode && !isFloatingElement;\n\n // Condition when the calendar is open, and focus went outside both input and calendar\n const shouldBlurWhenOpenOutside =\n calendarOpen &&\n !isInsideNode &&\n !isInsideCalendar &&\n !isFloatingElement;\n\n if (shouldBlurWhenClosed || shouldBlurWhenOpenOutside) {\n inputRef.current?.resetInput();\n setSelectedDate(initialDate);\n setFocused(false);\n setCalendarOpen(false);\n performOnBlurHandler();\n }\n };\n\n const handleHoverDayCell = (value: string) => {\n if (!calendarOpen) return;\n setHoveredDate(value);\n };\n\n const handleCalendarAction = (buttonAction: CalendarAction) => {\n // handle button in day calendar view\n switch (buttonAction) {\n case \"reset\":\n setSelectedDate(initialDate);\n break;\n case \"confirmed\":\n setInitialDate(selectedDate);\n performOnChangeHandler(selectedDate);\n break;\n }\n\n const isValid = dayjs(selectedDate, \"YYYY-MM-DD\", true).isValid();\n\n // Focus on year input if the selected date is valid to avoid restarting entire tab order\n if (isValid) {\n inputRef.current?.focusYearRef();\n } else {\n nodeRef.current?.focus();\n }\n setCalendarOpen(false);\n };\n\n // =============================================================================\n // HELPER FUNCTIONS\n // =============================================================================\n const performOnChangeHandler = (changeValue: string) => {\n if (onChange) {\n onChange(changeValue);\n }\n };\n\n const performOnBlurHandler = () => {\n if (onBlur) {\n onBlur();\n }\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderInput = () => {\n return (\n <Container\n role=\"group\"\n tabIndex={0}\n ref={nodeRef}\n onBlur={handleBlur}\n onFocus={handleFocus}\n $disabled={disabled}\n $readOnly={readOnly}\n $focused={focused}\n $error={error}\n id={id}\n data-testid={otherProps[\"data-testid\"]}\n aria-disabled={disabled}\n {...otherProps}\n >\n <StandaloneDateInput\n ref={inputRef}\n disabled={disabled}\n onChange={handleChange}\n readOnly={readOnly}\n focused={calendarOpen}\n names={[\"start-day\", \"start-month\", \"start-year\"]}\n value={selectedDate}\n hoverValue={hoveredDate}\n hideInputKeyboard={hideInputKeyboard}\n />\n </Container>\n );\n };\n\n const renderCalendar = ({ elementWidth }: DropdownRenderProps) => {\n return (\n <CalendarDropdown\n variant=\"single\"\n ref={calendarRef}\n initialCalendarDate={selectedDate}\n withButton={withButton}\n value={selectedDate}\n disabledDates={disabledDates}\n minDate={minDate}\n maxDate={maxDate}\n allowDisabledSelection={allowDisabledSelection}\n onHover={handleHoverDayCell}\n onSelect={handleSelect}\n onDismiss={handleCalendarAction}\n onYearMonthDisplayChange={onYearMonthDisplayChange}\n width={elementWidth}\n isFocusable={!readOnly && !disabled}\n />\n );\n };\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={calendarOpen}\n renderElement={renderInput}\n renderDropdown={renderCalendar}\n onClose={handleClose}\n onDismiss={handleDismiss}\n customZIndex={zIndex}\n offset={16}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["DateInput","_a","minDate","maxDate","disabled","disabledDates","error","hideInputKeyboard","value","onChange","onFocus","onBlur","onYearMonthDisplayChange","withButton","readOnly","id","allowDisabledSelection","zIndex","dropdownRootNode","otherProps","__rest","initialDate","setInitialDate","useState","DateInputHelper","sanitizeInput","selectedDate","setSelectedDate","hoveredDate","setHoveredDate","undefined","calendarOpen","setCalendarOpen","focused","setFocused","nodeRef","useRef","inputRef","calendarRef","useEffect","newValue","handleChange","val","isDateDisabled","performOnChangeHandler","handleSelect","current","focusYearRef","handleFocus","handleBlur","e","target","relatedTarget","isInsideCalendar","contains","isInsideNode","isFloatingElement","matches","call","_b","_c","resetInput","performOnBlurHandler","handleHoverDayCell","handleCalendarAction","buttonAction","dayjs","isValid","focus","changeValue","_jsx","ElementWithDropdown","enabled","isOpen","renderElement","Container","Object","assign","role","tabIndex","ref","$disabled","$focused","$error","children","StandaloneDateInput","names","hoverValue","renderDropdown","elementWidth","CalendarDropdown","variant","initialCalendarDate","onHover","onSelect","onDismiss","width","isFocusable","onClose","customZIndex","offset","rootNode"],"mappings":"qyBAmBO,MAAMA,EAAaC,IAAA,IAAAC,QACtBA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,cACRA,EAAaC,MACbA,EAAKC,kBACLA,EAAiBC,MACjBA,EAAKC,SACLA,EAAQC,QACRA,EAAOC,OACPA,EAAMC,yBACNA,EAAwBC,WACxBA,GAAa,EAAIC,SACjBA,EAAQC,GACRA,EAAEC,uBACFA,EAAsBC,OACtBA,EAAMC,iBACNA,GAAgBjB,EACbkB,EAAUC,EAAAnB,EAlBS,iOAuBtB,MAAOoB,EAAaC,GAAkBC,EAClCC,EAAgBC,cAAcjB,KAE3BkB,EAAcC,GAAmBJ,EACpCC,EAAgBC,cAAcjB,KAE3BoB,EAAaC,GAAkBN,OAClCO,IAEGC,EAAcC,GAAmBT,GAAkB,IACnDU,EAASC,GAAcX,GAAkB,GAE1CY,EAAUC,EAAuB,MACjCC,EAAWD,EAA+B,MAC1CE,EAAcF,EAA4B,MAKhDG,GAAU,KACN,MAAMC,EAAWhB,EAAgBC,cAAcjB,GAC/Cc,EAAekB,GACfb,EAAgBa,EAAS,GAC1B,CAAChC,IAKJ,MAmBMiC,EAAgBC,KAEb1B,GACDQ,EAAgBmB,eAAeD,EAAK,CAChCrC,gBACAH,UACAC,cAMRw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