@flipdish/portal-library 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Chip/index.cjs.js +1 -1
- package/dist/components/Chip/index.cjs.js.map +1 -1
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/Chip/index.js.map +1 -1
- package/dist/components/FlipdishLogoLoader/index.cjs.js +1 -1
- package/dist/components/FlipdishLogoLoader/index.cjs.js.map +1 -1
- package/dist/components/FlipdishLogoLoader/index.js +1 -1
- package/dist/components/FlipdishLogoLoader/index.js.map +1 -1
- package/dist/components/PageLayout/index.cjs.js +1 -1
- package/dist/components/PageLayout/index.cjs.js.map +1 -1
- package/dist/components/PageLayout/index.js +1 -1
- package/dist/components/PageLayout/index.js.map +1 -1
- package/dist/providers/ToastProvider.cjs.js +1 -1
- package/dist/providers/ToastProvider.cjs.js.map +1 -1
- package/dist/providers/ToastProvider.js +1 -1
- package/dist/providers/ToastProvider.js.map +1 -1
- package/dist/themes/flipdishPublicTheme.cjs.js +1 -1
- package/dist/themes/flipdishPublicTheme.cjs.js.map +1 -1
- package/dist/themes/flipdishPublicTheme.js +1 -1
- package/dist/themes/flipdishPublicTheme.js.map +1 -1
- package/dist/themes/tokens/colours.cjs.js +2 -0
- package/dist/themes/tokens/colours.cjs.js.map +1 -0
- package/dist/themes/tokens/colours.d.ts +67 -0
- package/dist/themes/tokens/colours.js +2 -0
- package/dist/themes/tokens/colours.js.map +1 -0
- package/dist/themes/typography.cjs.js +2 -0
- package/dist/themes/typography.cjs.js.map +1 -0
- package/dist/themes/typography.d.ts +5 -0
- package/dist/themes/typography.js +2 -0
- package/dist/themes/typography.js.map +1 -0
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@mui/material/Chip"),l=require("@mui/material/styles");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@mui/material/Chip"),l=require("@mui/material/styles");const t=["filled","outlined"],o=(e,r,l)=>({blue:{filled:{backgroundColor:r.palette.semantic.light.fill["fill-primary-weak"],color:r.palette.semantic.light.text["text-primary"]},outlined:{borderColor:r.palette.semantic.light.stroke["stroke-primary-strong"],color:r.palette.semantic.light.text["text-primary"]}},success:{filled:{backgroundColor:r.palette.success.light,color:r.palette.success.dark},outlined:{borderColor:r.palette.success.main,color:r.palette.success.main}},warning:{filled:{backgroundColor:r.palette.warning.light,color:r.palette.warning.dark},outlined:{borderColor:r.palette.warning.main,color:r.palette.warning.dark}},error:{filled:{backgroundColor:r.palette.error.light,color:r.palette.error.dark},outlined:{borderColor:r.palette.error.main,color:r.palette.error.main}},default:{filled:{},outlined:{}}}[e][l]),i=l.styled(r,{shouldForwardProp:e=>"colour"!==e&&"rounded"!==e})((({theme:e,colour:r,rounded:l,variant:i=t[0]})=>({borderRadius:l?"100px":"5px","& .MuiChip-icon":{color:"inherit"},...o(r,e,i)})));exports.CHIP_COLORS=["default","blue","success","warning","error"],exports.CHIP_VARIANTS=t,exports.default=({label:r,color:l="default",size:t="medium",variant:o="filled",icon:a,rounded:n=!0})=>e.jsx(i,{icon:a,label:r,colour:l,size:t,variant:o,rounded:n});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/Chip/index.tsx"],"sourcesContent":["import MuiChip, { type ChipProps as MuiChipProps } from '@mui/material/Chip';\nimport { styled, type Theme } from '@mui/material/styles';\n\nexport const CHIP_COLORS = ['default', 'blue', 'success', 'warning', 'error'] as const;\nexport type ChipColor = (typeof CHIP_COLORS)[number];\n\nexport const CHIP_VARIANTS = ['filled', 'outlined'] as const;\nexport type ChipVariant = (typeof CHIP_VARIANTS)[number];\n\nexport type ChipProps = {\n label: string;\n color?: ChipColor;\n size?: MuiChipProps['size'];\n variant?: ChipVariant;\n icon?: MuiChipProps['icon'];\n rounded?: boolean;\n};\n\ntype StyledChipProps = {\n colour: ChipColor;\n rounded: boolean;\n variant?: ChipVariant;\n};\n\nconst getColorStyles = (colour: ChipColor, theme: Theme, variant: ChipVariant) => {\n const colorMap = {\n blue: {\n filled: {\n backgroundColor: theme.palette.
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/Chip/index.tsx"],"sourcesContent":["import MuiChip, { type ChipProps as MuiChipProps } from '@mui/material/Chip';\nimport { styled, type Theme } from '@mui/material/styles';\n\nexport const CHIP_COLORS = ['default', 'blue', 'success', 'warning', 'error'] as const;\nexport type ChipColor = (typeof CHIP_COLORS)[number];\n\nexport const CHIP_VARIANTS = ['filled', 'outlined'] as const;\nexport type ChipVariant = (typeof CHIP_VARIANTS)[number];\n\nexport type ChipProps = {\n label: string;\n color?: ChipColor;\n size?: MuiChipProps['size'];\n variant?: ChipVariant;\n icon?: MuiChipProps['icon'];\n rounded?: boolean;\n};\n\ntype StyledChipProps = {\n colour: ChipColor;\n rounded: boolean;\n variant?: ChipVariant;\n};\n\nconst getColorStyles = (colour: ChipColor, theme: Theme, variant: ChipVariant) => {\n const colorMap = {\n blue: {\n filled: {\n backgroundColor: theme.palette.semantic.light.fill['fill-primary-weak'],\n color: theme.palette.semantic.light.text['text-primary'],\n },\n outlined: {\n borderColor: theme.palette.semantic.light.stroke['stroke-primary-strong'],\n color: theme.palette.semantic.light.text['text-primary'],\n },\n },\n success: {\n filled: {\n backgroundColor: theme.palette.success.light,\n color: theme.palette.success.dark,\n },\n outlined: {\n borderColor: theme.palette.success.main,\n color: theme.palette.success.main,\n },\n },\n warning: {\n filled: {\n backgroundColor: theme.palette.warning.light,\n color: theme.palette.warning.dark,\n },\n outlined: {\n borderColor: theme.palette.warning.main,\n color: theme.palette.warning.dark,\n },\n },\n error: {\n filled: {\n backgroundColor: theme.palette.error.light,\n color: theme.palette.error.dark,\n },\n outlined: {\n borderColor: theme.palette.error.main,\n color: theme.palette.error.main,\n },\n },\n default: {\n filled: {},\n outlined: {},\n },\n } satisfies Record<ChipColor, Record<ChipVariant, object>>;\n\n return colorMap[colour][variant];\n};\n\nconst StyledChip = styled(MuiChip, {\n shouldForwardProp: (prop) => prop !== 'colour' && prop !== 'rounded',\n})<StyledChipProps>(({ theme, colour, rounded, variant = CHIP_VARIANTS[0] }) => ({\n borderRadius: rounded ? '100px' : '5px',\n '& .MuiChip-icon': {\n color: 'inherit',\n },\n ...getColorStyles(colour, theme, variant),\n}));\n\nconst Chip = ({ label, color = 'default', size = 'medium', variant = 'filled', icon, rounded = true }: ChipProps) => (\n <StyledChip icon={icon} label={label} colour={color} size={size} variant={variant} rounded={rounded} />\n);\n\nexport default Chip;\n"],"names":["CHIP_VARIANTS","getColorStyles","colour","theme","variant","blue","filled","backgroundColor","palette","semantic","light","fill","color","text","outlined","borderColor","stroke","success","dark","main","warning","error","default","StyledChip","styled","MuiChip","shouldForwardProp","prop","rounded","borderRadius","label","size","icon","_jsx"],"mappings":"yKAGO,MAGMA,EAAgB,CAAC,SAAU,YAkBlCC,EAAiB,CAACC,EAAmBC,EAAcC,KACpC,CACbC,KAAM,CACFC,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQC,SAASC,MAAMC,KAAK,qBACnDC,MAAOT,EAAMK,QAAQC,SAASC,MAAMG,KAAK,iBAE7CC,SAAU,CACNC,YAAaZ,EAAMK,QAAQC,SAASC,MAAMM,OAAO,yBACjDJ,MAAOT,EAAMK,QAAQC,SAASC,MAAMG,KAAK,kBAGjDI,QAAS,CACLX,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQS,QAAQP,MACvCE,MAAOT,EAAMK,QAAQS,QAAQC,MAEjCJ,SAAU,CACNC,YAAaZ,EAAMK,QAAQS,QAAQE,KACnCP,MAAOT,EAAMK,QAAQS,QAAQE,OAGrCC,QAAS,CACLd,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQY,QAAQV,MACvCE,MAAOT,EAAMK,QAAQY,QAAQF,MAEjCJ,SAAU,CACNC,YAAaZ,EAAMK,QAAQY,QAAQD,KACnCP,MAAOT,EAAMK,QAAQY,QAAQF,OAGrCG,MAAO,CACHf,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQa,MAAMX,MACrCE,MAAOT,EAAMK,QAAQa,MAAMH,MAE/BJ,SAAU,CACNC,YAAaZ,EAAMK,QAAQa,MAAMF,KACjCP,MAAOT,EAAMK,QAAQa,MAAMF,OAGnCG,QAAS,CACLhB,OAAQ,CAAE,EACVQ,SAAU,CAAE,IAIJZ,GAAQE,IAGtBmB,EAAaC,EAAMA,OAACC,EAAS,CAC/BC,kBAAoBC,GAAkB,WAATA,GAA8B,YAATA,GADnCH,EAEC,EAAGrB,QAAOD,SAAQ0B,UAASxB,UAAUJ,EAAc,OAAU,CAC7E6B,aAAcD,EAAU,QAAU,MAClC,kBAAmB,CACfhB,MAAO,cAERX,EAAeC,EAAQC,EAAOC,2BA/EV,CAAC,UAAW,OAAQ,UAAW,UAAW,iDAkFxD,EAAG0B,QAAOlB,QAAQ,UAAWmB,OAAO,SAAU3B,UAAU,SAAU4B,OAAMJ,WAAU,KAC3FK,MAACV,EAAU,CAACS,KAAMA,EAAMF,MAAOA,EAAO5B,OAAQU,EAAOmB,KAAMA,EAAM3B,QAASA,EAASwB,QAASA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import r from"@mui/material/Chip";import{styled as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import r from"@mui/material/Chip";import{styled as o}from"@mui/material/styles";const l=["default","blue","success","warning","error"],t=["filled","outlined"],a=(e,r,o)=>({blue:{filled:{backgroundColor:r.palette.semantic.light.fill["fill-primary-weak"],color:r.palette.semantic.light.text["text-primary"]},outlined:{borderColor:r.palette.semantic.light.stroke["stroke-primary-strong"],color:r.palette.semantic.light.text["text-primary"]}},success:{filled:{backgroundColor:r.palette.success.light,color:r.palette.success.dark},outlined:{borderColor:r.palette.success.main,color:r.palette.success.main}},warning:{filled:{backgroundColor:r.palette.warning.light,color:r.palette.warning.dark},outlined:{borderColor:r.palette.warning.main,color:r.palette.warning.dark}},error:{filled:{backgroundColor:r.palette.error.light,color:r.palette.error.dark},outlined:{borderColor:r.palette.error.main,color:r.palette.error.main}},default:{filled:{},outlined:{}}}[e][o]),i=o(r,{shouldForwardProp:e=>"colour"!==e&&"rounded"!==e})((({theme:e,colour:r,rounded:o,variant:l=t[0]})=>({borderRadius:o?"100px":"5px","& .MuiChip-icon":{color:"inherit"},...a(r,e,l)}))),n=({label:r,color:o="default",size:l="medium",variant:t="filled",icon:a,rounded:n=!0})=>e(i,{icon:a,label:r,colour:o,size:l,variant:t,rounded:n});export{l as CHIP_COLORS,t as CHIP_VARIANTS,n as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Chip/index.tsx"],"sourcesContent":["import MuiChip, { type ChipProps as MuiChipProps } from '@mui/material/Chip';\nimport { styled, type Theme } from '@mui/material/styles';\n\nexport const CHIP_COLORS = ['default', 'blue', 'success', 'warning', 'error'] as const;\nexport type ChipColor = (typeof CHIP_COLORS)[number];\n\nexport const CHIP_VARIANTS = ['filled', 'outlined'] as const;\nexport type ChipVariant = (typeof CHIP_VARIANTS)[number];\n\nexport type ChipProps = {\n label: string;\n color?: ChipColor;\n size?: MuiChipProps['size'];\n variant?: ChipVariant;\n icon?: MuiChipProps['icon'];\n rounded?: boolean;\n};\n\ntype StyledChipProps = {\n colour: ChipColor;\n rounded: boolean;\n variant?: ChipVariant;\n};\n\nconst getColorStyles = (colour: ChipColor, theme: Theme, variant: ChipVariant) => {\n const colorMap = {\n blue: {\n filled: {\n backgroundColor: theme.palette.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Chip/index.tsx"],"sourcesContent":["import MuiChip, { type ChipProps as MuiChipProps } from '@mui/material/Chip';\nimport { styled, type Theme } from '@mui/material/styles';\n\nexport const CHIP_COLORS = ['default', 'blue', 'success', 'warning', 'error'] as const;\nexport type ChipColor = (typeof CHIP_COLORS)[number];\n\nexport const CHIP_VARIANTS = ['filled', 'outlined'] as const;\nexport type ChipVariant = (typeof CHIP_VARIANTS)[number];\n\nexport type ChipProps = {\n label: string;\n color?: ChipColor;\n size?: MuiChipProps['size'];\n variant?: ChipVariant;\n icon?: MuiChipProps['icon'];\n rounded?: boolean;\n};\n\ntype StyledChipProps = {\n colour: ChipColor;\n rounded: boolean;\n variant?: ChipVariant;\n};\n\nconst getColorStyles = (colour: ChipColor, theme: Theme, variant: ChipVariant) => {\n const colorMap = {\n blue: {\n filled: {\n backgroundColor: theme.palette.semantic.light.fill['fill-primary-weak'],\n color: theme.palette.semantic.light.text['text-primary'],\n },\n outlined: {\n borderColor: theme.palette.semantic.light.stroke['stroke-primary-strong'],\n color: theme.palette.semantic.light.text['text-primary'],\n },\n },\n success: {\n filled: {\n backgroundColor: theme.palette.success.light,\n color: theme.palette.success.dark,\n },\n outlined: {\n borderColor: theme.palette.success.main,\n color: theme.palette.success.main,\n },\n },\n warning: {\n filled: {\n backgroundColor: theme.palette.warning.light,\n color: theme.palette.warning.dark,\n },\n outlined: {\n borderColor: theme.palette.warning.main,\n color: theme.palette.warning.dark,\n },\n },\n error: {\n filled: {\n backgroundColor: theme.palette.error.light,\n color: theme.palette.error.dark,\n },\n outlined: {\n borderColor: theme.palette.error.main,\n color: theme.palette.error.main,\n },\n },\n default: {\n filled: {},\n outlined: {},\n },\n } satisfies Record<ChipColor, Record<ChipVariant, object>>;\n\n return colorMap[colour][variant];\n};\n\nconst StyledChip = styled(MuiChip, {\n shouldForwardProp: (prop) => prop !== 'colour' && prop !== 'rounded',\n})<StyledChipProps>(({ theme, colour, rounded, variant = CHIP_VARIANTS[0] }) => ({\n borderRadius: rounded ? '100px' : '5px',\n '& .MuiChip-icon': {\n color: 'inherit',\n },\n ...getColorStyles(colour, theme, variant),\n}));\n\nconst Chip = ({ label, color = 'default', size = 'medium', variant = 'filled', icon, rounded = true }: ChipProps) => (\n <StyledChip icon={icon} label={label} colour={color} size={size} variant={variant} rounded={rounded} />\n);\n\nexport default Chip;\n"],"names":["CHIP_COLORS","CHIP_VARIANTS","getColorStyles","colour","theme","variant","blue","filled","backgroundColor","palette","semantic","light","fill","color","text","outlined","borderColor","stroke","success","dark","main","warning","error","default","StyledChip","styled","MuiChip","shouldForwardProp","prop","rounded","borderRadius","Chip","label","size","icon","_jsx"],"mappings":"wHAGO,MAAMA,EAAc,CAAC,UAAW,OAAQ,UAAW,UAAW,SAGxDC,EAAgB,CAAC,SAAU,YAkBlCC,EAAiB,CAACC,EAAmBC,EAAcC,KACpC,CACbC,KAAM,CACFC,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQC,SAASC,MAAMC,KAAK,qBACnDC,MAAOT,EAAMK,QAAQC,SAASC,MAAMG,KAAK,iBAE7CC,SAAU,CACNC,YAAaZ,EAAMK,QAAQC,SAASC,MAAMM,OAAO,yBACjDJ,MAAOT,EAAMK,QAAQC,SAASC,MAAMG,KAAK,kBAGjDI,QAAS,CACLX,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQS,QAAQP,MACvCE,MAAOT,EAAMK,QAAQS,QAAQC,MAEjCJ,SAAU,CACNC,YAAaZ,EAAMK,QAAQS,QAAQE,KACnCP,MAAOT,EAAMK,QAAQS,QAAQE,OAGrCC,QAAS,CACLd,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQY,QAAQV,MACvCE,MAAOT,EAAMK,QAAQY,QAAQF,MAEjCJ,SAAU,CACNC,YAAaZ,EAAMK,QAAQY,QAAQD,KACnCP,MAAOT,EAAMK,QAAQY,QAAQF,OAGrCG,MAAO,CACHf,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQa,MAAMX,MACrCE,MAAOT,EAAMK,QAAQa,MAAMH,MAE/BJ,SAAU,CACNC,YAAaZ,EAAMK,QAAQa,MAAMF,KACjCP,MAAOT,EAAMK,QAAQa,MAAMF,OAGnCG,QAAS,CACLhB,OAAQ,CAAE,EACVQ,SAAU,CAAE,IAIJZ,GAAQE,IAGtBmB,EAAaC,EAAOC,EAAS,CAC/BC,kBAAoBC,GAAkB,WAATA,GAA8B,YAATA,GADnCH,EAEC,EAAGrB,QAAOD,SAAQ0B,UAASxB,UAAUJ,EAAc,OAAU,CAC7E6B,aAAcD,EAAU,QAAU,MAClC,kBAAmB,CACfhB,MAAO,cAERX,EAAeC,EAAQC,EAAOC,OAG/B0B,EAAO,EAAGC,QAAOnB,QAAQ,UAAWoB,OAAO,SAAU5B,UAAU,SAAU6B,OAAML,WAAU,KAC3FM,EAACX,EAAU,CAACU,KAAMA,EAAMF,MAAOA,EAAO7B,OAAQU,EAAOoB,KAAMA,EAAM5B,QAASA,EAASwB,QAASA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/styles"),i=require("../../assets/images/fd-loader.gif.cjs.js"),r=require("@mui/material/Typography");const
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/styles"),i=require("../../assets/images/fd-loader.gif.cjs.js"),r=require("@mui/material/Typography");const a=t.styled("div")((({theme:e,fullscreen:t})=>({display:"flex",alignItems:"center",justifyContent:"center",background:e.palette.semantic.light.background["background-base"],flexDirection:"column",...t&&{width:"100vw",height:"100vh",position:"absolute",top:0,left:0}}))),l=t.styled("div")((({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:"160px",height:"160px",borderRadius:"80px",background:e.palette.semantic.light.background["background-base"],boxShadow:"0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 8px 10px 1px rgba(0, 0, 0, 0.14)",marginBottom:"32px"}))),s=t.styled("img")({height:"96px",width:"96px"}),n=t.styled(r)((({theme:e})=>({color:e.palette.semantic.light.text["text-primary"],lineHeight:"1.2",marginBottom:"4px"}))),o=t.styled(r)({fontSize:"20px",color:"rgba(0, 0, 0, 0.54)",lineHeight:"1.4",letterSpacing:"normal"});module.exports=({headline:t,subHeadline:r,fullscreen:d=!1})=>e.jsxs(a,{fullscreen:d,"data-testid":"FlipdishLogoLoader",children:[e.jsx(l,{children:e.jsx(s,{src:i,alt:"Flipdish Logo Loader"})}),e.jsx(n,{variant:"h2",children:t}),r&&e.jsx(o,{children:r})]});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/FlipdishLogoLoader/index.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport FdLoader from '../../assets/images/fd-loader.gif';\nimport Typography from '@mui/material/Typography';\n\nconst StyledContainer = styled('div')<{ fullscreen?: boolean }>(({ theme, fullscreen }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: theme.palette.
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/FlipdishLogoLoader/index.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport FdLoader from '../../assets/images/fd-loader.gif';\nimport Typography from '@mui/material/Typography';\n\nconst StyledContainer = styled('div')<{ fullscreen?: boolean }>(({ theme, fullscreen }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: theme.palette.semantic.light.background['background-base'],\n flexDirection: 'column',\n ...(fullscreen && {\n width: '100vw',\n height: '100vh',\n position: 'absolute',\n top: 0,\n left: 0,\n }),\n}));\n\nconst ImageContainer = styled('div')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '160px',\n height: '160px',\n borderRadius: '80px',\n background: theme.palette.semantic.light.background['background-base'],\n boxShadow: '0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 8px 10px 1px rgba(0, 0, 0, 0.14)',\n marginBottom: '32px',\n}));\n\nconst StyledImage = styled('img')({\n height: '96px',\n width: '96px',\n});\n\nconst StyledHeadline = styled(Typography)(({ theme }) => ({\n color: theme.palette.semantic.light.text['text-primary'],\n lineHeight: '1.2',\n marginBottom: '4px',\n}));\n\nconst StyledSubHeadline = styled(Typography)({\n fontSize: '20px',\n color: 'rgba(0, 0, 0, 0.54)',\n lineHeight: '1.4',\n letterSpacing: 'normal',\n});\n\ntype FlipdishLogoLoaderProps = {\n headline: string;\n subHeadline?: string;\n fullscreen?: boolean;\n};\n\nconst FlipdishLogoLoader = ({ headline, subHeadline, fullscreen = false }: FlipdishLogoLoaderProps) => {\n return (\n <StyledContainer fullscreen={fullscreen} data-testid=\"FlipdishLogoLoader\">\n <ImageContainer>\n <StyledImage src={FdLoader} alt=\"Flipdish Logo Loader\" />\n </ImageContainer>\n <StyledHeadline variant=\"h2\">{headline}</StyledHeadline>\n {subHeadline && <StyledSubHeadline>{subHeadline}</StyledSubHeadline>}\n </StyledContainer>\n );\n};\n\nexport default FlipdishLogoLoader;\n"],"names":["StyledContainer","styled","theme","fullscreen","display","alignItems","justifyContent","background","palette","semantic","light","flexDirection","width","height","position","top","left","ImageContainer","borderRadius","boxShadow","marginBottom","StyledImage","StyledHeadline","Typography","color","text","lineHeight","StyledSubHeadline","fontSize","letterSpacing","headline","subHeadline","_jsxs","children","_jsx","src","FdLoader","alt","variant","jsx"],"mappings":"8KAIA,MAAMA,EAAkBC,EAAMA,OAAC,MAAPA,EAAwC,EAAGC,QAAOC,iBAAkB,CACxFC,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBC,WAAYL,EAAMM,QAAQC,SAASC,MAAMH,WAAW,mBACpDI,cAAe,YACXR,GAAc,CACdS,MAAO,QACPC,OAAQ,QACRC,SAAU,WACVC,IAAK,EACLC,KAAM,OAIRC,EAAiBhB,EAAAA,OAAO,MAAPA,EAAc,EAAGC,YAAa,CACjDE,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBM,MAAO,QACPC,OAAQ,QACRK,aAAc,OACdX,WAAYL,EAAMM,QAAQC,SAASC,MAAMH,WAAW,mBACpDY,UAAW,4GACXC,aAAc,WAGZC,EAAcpB,EAAAA,OAAO,MAAPA,CAAc,CAC9BY,OAAQ,OACRD,MAAO,SAGLU,EAAiBrB,EAAAA,OAAOsB,EAAPtB,EAAmB,EAAGC,YAAa,CACtDsB,MAAOtB,EAAMM,QAAQC,SAASC,MAAMe,KAAK,gBACzCC,WAAY,MACZN,aAAc,UAGZO,EAAoB1B,EAAAA,OAAOsB,EAAPtB,CAAmB,CACzC2B,SAAU,OACVJ,MAAO,sBACPE,WAAY,MACZG,cAAe,0BASQ,EAAGC,WAAUC,cAAa5B,cAAa,KAE1D6B,EAAAA,KAAChC,EAAe,CAACG,WAAYA,gBAAwB,qBAAoB8B,SAAA,CACrEC,EAAAA,IAACjB,EAAc,CAAAgB,SACXC,EAAAA,IAACb,EAAW,CAACc,IAAKC,EAAUC,IAAI,2BAEpCH,MAACZ,GAAegB,QAAQ,KAAML,SAAAH,IAC7BC,GAAeG,EAACK,IAAAZ,YAAmBI"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{styled as i}from"@mui/material/styles";import r from"../../assets/images/fd-loader.gif.js";import a from"@mui/material/Typography";const
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{styled as i}from"@mui/material/styles";import r from"../../assets/images/fd-loader.gif.js";import a from"@mui/material/Typography";const o=i("div")((({theme:e,fullscreen:t})=>({display:"flex",alignItems:"center",justifyContent:"center",background:e.palette.semantic.light.background["background-base"],flexDirection:"column",...t&&{width:"100vw",height:"100vh",position:"absolute",top:0,left:0}}))),l=i("div")((({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:"160px",height:"160px",borderRadius:"80px",background:e.palette.semantic.light.background["background-base"],boxShadow:"0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 8px 10px 1px rgba(0, 0, 0, 0.14)",marginBottom:"32px"}))),n=i("img")({height:"96px",width:"96px"}),p=i(a)((({theme:e})=>({color:e.palette.semantic.light.text["text-primary"],lineHeight:"1.2",marginBottom:"4px"}))),s=i(a)({fontSize:"20px",color:"rgba(0, 0, 0, 0.54)",lineHeight:"1.4",letterSpacing:"normal"}),d=({headline:i,subHeadline:a,fullscreen:d=!1})=>e(o,{fullscreen:d,"data-testid":"FlipdishLogoLoader",children:[t(l,{children:t(n,{src:r,alt:"Flipdish Logo Loader"})}),t(p,{variant:"h2",children:i}),a&&t(s,{children:a})]});export{d as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/FlipdishLogoLoader/index.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport FdLoader from '../../assets/images/fd-loader.gif';\nimport Typography from '@mui/material/Typography';\n\nconst StyledContainer = styled('div')<{ fullscreen?: boolean }>(({ theme, fullscreen }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: theme.palette.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/FlipdishLogoLoader/index.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport FdLoader from '../../assets/images/fd-loader.gif';\nimport Typography from '@mui/material/Typography';\n\nconst StyledContainer = styled('div')<{ fullscreen?: boolean }>(({ theme, fullscreen }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: theme.palette.semantic.light.background['background-base'],\n flexDirection: 'column',\n ...(fullscreen && {\n width: '100vw',\n height: '100vh',\n position: 'absolute',\n top: 0,\n left: 0,\n }),\n}));\n\nconst ImageContainer = styled('div')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '160px',\n height: '160px',\n borderRadius: '80px',\n background: theme.palette.semantic.light.background['background-base'],\n boxShadow: '0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 8px 10px 1px rgba(0, 0, 0, 0.14)',\n marginBottom: '32px',\n}));\n\nconst StyledImage = styled('img')({\n height: '96px',\n width: '96px',\n});\n\nconst StyledHeadline = styled(Typography)(({ theme }) => ({\n color: theme.palette.semantic.light.text['text-primary'],\n lineHeight: '1.2',\n marginBottom: '4px',\n}));\n\nconst StyledSubHeadline = styled(Typography)({\n fontSize: '20px',\n color: 'rgba(0, 0, 0, 0.54)',\n lineHeight: '1.4',\n letterSpacing: 'normal',\n});\n\ntype FlipdishLogoLoaderProps = {\n headline: string;\n subHeadline?: string;\n fullscreen?: boolean;\n};\n\nconst FlipdishLogoLoader = ({ headline, subHeadline, fullscreen = false }: FlipdishLogoLoaderProps) => {\n return (\n <StyledContainer fullscreen={fullscreen} data-testid=\"FlipdishLogoLoader\">\n <ImageContainer>\n <StyledImage src={FdLoader} alt=\"Flipdish Logo Loader\" />\n </ImageContainer>\n <StyledHeadline variant=\"h2\">{headline}</StyledHeadline>\n {subHeadline && <StyledSubHeadline>{subHeadline}</StyledSubHeadline>}\n </StyledContainer>\n );\n};\n\nexport default FlipdishLogoLoader;\n"],"names":["StyledContainer","styled","theme","fullscreen","display","alignItems","justifyContent","background","palette","semantic","light","flexDirection","width","height","position","top","left","ImageContainer","borderRadius","boxShadow","marginBottom","StyledImage","StyledHeadline","Typography","color","text","lineHeight","StyledSubHeadline","fontSize","letterSpacing","FlipdishLogoLoader","headline","subHeadline","_jsxs","children","_jsx","src","FdLoader","alt","variant"],"mappings":"4LAIA,MAAMA,EAAkBC,EAAO,MAAPA,EAAwC,EAAGC,QAAOC,iBAAkB,CACxFC,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBC,WAAYL,EAAMM,QAAQC,SAASC,MAAMH,WAAW,mBACpDI,cAAe,YACXR,GAAc,CACdS,MAAO,QACPC,OAAQ,QACRC,SAAU,WACVC,IAAK,EACLC,KAAM,OAIRC,EAAiBhB,EAAO,MAAPA,EAAc,EAAGC,YAAa,CACjDE,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBM,MAAO,QACPC,OAAQ,QACRK,aAAc,OACdX,WAAYL,EAAMM,QAAQC,SAASC,MAAMH,WAAW,mBACpDY,UAAW,4GACXC,aAAc,WAGZC,EAAcpB,EAAO,MAAPA,CAAc,CAC9BY,OAAQ,OACRD,MAAO,SAGLU,EAAiBrB,EAAOsB,EAAPtB,EAAmB,EAAGC,YAAa,CACtDsB,MAAOtB,EAAMM,QAAQC,SAASC,MAAMe,KAAK,gBACzCC,WAAY,MACZN,aAAc,UAGZO,EAAoB1B,EAAOsB,EAAPtB,CAAmB,CACzC2B,SAAU,OACVJ,MAAO,sBACPE,WAAY,MACZG,cAAe,WASbC,EAAqB,EAAGC,WAAUC,cAAa7B,cAAa,KAE1D8B,EAACjC,EAAe,CAACG,WAAYA,gBAAwB,qBAAoB+B,SAAA,CACrEC,EAAClB,EAAc,CAAAiB,SACXC,EAACd,EAAW,CAACe,IAAKC,EAAUC,IAAI,2BAEpCH,EAACb,GAAeiB,QAAQ,KAAML,SAAAH,IAC7BC,GAAeG,EAACR,YAAmBK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../../icons/Add/index.cjs.js"),n=require("../../icons/ArrowLeft02/index.cjs.js"),r=require("@mui/material/Grid"),a=require("@mui/material/IconButton"),s=require("@mui/material/styles"),o=require("@mui/material/Typography"),d=require("@mui/material/useMediaQuery"),l=require("./DocumentTitle.cjs.js"),c=require("./FullWidthContainer.cjs.js"),p=require("../FDErrorBoundary/index.cjs.js"),m=require("@mui/material/Button"),h=require("../../utilities/renderUtilities.cjs.js"),g=require("../../utilities/validation.cjs.js"),u=require("../Spacer/index.cjs.js"),x=require("@mui/material/Box"),j=require("@mui/material/Divider");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../../icons/Add/index.cjs.js"),n=require("../../icons/ArrowLeft02/index.cjs.js"),r=require("@mui/material/Grid"),a=require("@mui/material/IconButton"),s=require("@mui/material/styles"),o=require("@mui/material/Typography"),d=require("@mui/material/useMediaQuery"),l=require("./DocumentTitle.cjs.js"),c=require("./FullWidthContainer.cjs.js"),p=require("../FDErrorBoundary/index.cjs.js"),m=require("@mui/material/Button"),h=require("../../utilities/renderUtilities.cjs.js"),g=require("../../utilities/validation.cjs.js"),u=require("../Spacer/index.cjs.js"),x=require("@mui/material/Box"),j=require("@mui/material/Divider");const b=1112,f=s.styled("div")((({theme:e,fluid:t})=>({maxWidth:t?"none":b,[e.breakpoints.down("md")]:{maxWidth:"none"},padding:e.spacing(2,4),position:"relative",minHeight:"100vh"}))),v=s.styled(r)((({theme:e})=>({[e.breakpoints.down("sm")]:{width:"100%",paddingTop:e.spacing(2)}}))),y=s.styled(r)((({theme:e})=>({flexWrap:"nowrap",alignItems:"flex-start",paddingTop:e.spacing(3),paddingBottom:e.spacing(3),[e.breakpoints.down("md")]:{paddingTop:e.spacing(2),paddingBottom:e.spacing(3)}}))),k=s.styled(r)((({theme:e})=>({paddingTop:e.spacing(2)}))),A=s.styled(r)((()=>({flexGrow:1}))),T=s.styled("div")((({theme:e})=>({maxWidth:b,paddingBottom:e.spacing(3),[e.breakpoints.down("md")]:{paddingBottom:e.spacing(2),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}))),B=s.styled(i)((({theme:e})=>({marginRight:e.spacing(1)}))),C=s.styled(a,{shouldForwardProp:e=>"hasTitleComponent"!==e})((({theme:e,hasTitleComponent:t})=>({margin:t?e.spacing(-.75,2,-1.5,-1.5):e.spacing(-1.5,2,-1.5,-1.5),[e.breakpoints.only("sm")]:{marginLeft:e.spacing(-2)},[e.breakpoints.only("xs")]:{marginLeft:e.spacing(-2)}}))),L=s.styled("div")((({theme:e})=>({maxWidth:b,marginLeft:e.spacing(6),marginRight:e.spacing(4),paddingBottom:e.spacing(2),[e.breakpoints.only("md")]:{marginLeft:12,marginRight:e.spacing(3)},[e.breakpoints.only("sm")]:{marginLeft:e.spacing(3),marginRight:e.spacing(3),maxWidth:"none"},[e.breakpoints.only("xs")]:{marginLeft:e.spacing(2),marginRight:e.spacing(2),maxWidth:"none"}}))),q=s.styled(r)((()=>({display:"flex",flexGrow:1,justifyContent:"flex-end"}))),W=s.styled(o)((()=>({lineHeight:"26px"}))),w=s.styled(o)((()=>({fontWeight:"bold"}))),S=s.styled(j)((({theme:e})=>({marginBottom:e.spacing(4)}))),_=({title:t})=>e.jsx(w,{variant:"h5",component:"h2",children:t}),E=s.styled("div")((({useAlternateBackground:e,theme:t})=>({backgroundColor:e?t.palette.semantic.light.background["background-alternate"]:t.palette.semantic.light.background["background-base"],width:"100%",height:"100%"})));exports.HORIZONTAL_SPACE_CLASSNAME="horizontal-content-space",exports.LEFT_HORIZONTAL_SPACE_CLASSNAME="left-horizontal-content-space",exports.PageTitle=_,exports.RIGHT_HORIZONTAL_SPACE_CLASSNAME="right-horizontal-content-space",exports.VERTICAL_SPACE_CLASSNAME="vertical-content-space",exports.default=i=>{const{actionBtnTitle:a,caption:o,children:j,contextButtons:b,documentTitle:w,fluid:I=!1,fullWidth:P,header:R,hideHeader:z,actionButtonLink:F,openLinkInNewTab:H=!1,pageHeader:N,showActionButton:M,showAddIcon:O,title:D,titleComponent:G,toPrevious:V,toParent:Z,strictToParent:$,navigate:U,hideDivider:Q=!1,customActionButtons:J,useAlternateBackground:K=!1,titleComponentAfter:X,errorBoundarySomethingWentWrongText:Y}=i,ee=s.useTheme(),te=d(ee.breakpoints.down("md")),ie=h.getMicroFrontendAttribute("data-portal-base-url")||"/",ne=F?.startsWith("https://"),re=ne?F:void 0!==F?g.joinUrlPaths(ie,F):"";return e.jsx(E,{useAlternateBackground:K,children:e.jsxs(f,{fluid:I,children:[w&&e.jsx(l,{children:w}),N||null,e.jsxs(L,{children:[N&&e.jsx(u,{size:16,variant:"vertical"}),!z&&e.jsxs(e.Fragment,{children:[e.jsxs(y,{container:!0,alignItems:"center",direction:"column",children:[e.jsx(r,{item:!0,container:!0,direction:"row",alignContent:"space-between",children:e.jsx(q,{item:!0,children:b?.map((i=>e.jsx("div",{children:i},`context-button-${t.isValidElement(i)?i.props?.["data-testid"]||i.props?.children:"fallback"}`)))})}),e.jsxs(k,{item:!0,container:!0,children:[(Z||V)&&e.jsx(x,{children:e.jsx(C,{"aria-label":"Back","data-testid":"back_button",hasTitleComponent:!!G,component:"button",onClick:()=>{V?U(-1):Z&&$||Z&&history.length<3?U(Z):U(-1)},children:e.jsx(n,{})})}),e.jsxs(A,{item:!0,children:[G?e.jsx(G,{}):e.jsxs(x,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(_,{title:D}),X]}),o&&e.jsx(W,{variant:"caption",component:"h3",children:o})]}),M&&e.jsxs(e.Fragment,{children:[te&&e.jsx(u,{size:56,variant:"vertical"}),e.jsx(v,{item:!0,children:e.jsxs(m,{variant:"contained",fullWidth:!0,"data-testid":`Action-button-${a}`,href:H||ne?re:"",target:H?"_blank":void 0,rel:H?"noopener noreferrer":void 0,onClick:H||ne?()=>{}:()=>U(F),children:[O&&e.jsx(B,{size:"sm"}),a]})})]}),J?.map((i=>e.jsxs("div",{children:[te&&e.jsx(u,{size:56,variant:"vertical"}),!te&&e.jsx(u,{size:16,variant:"vertical"}),e.jsx(v,{item:!0,children:i})]},`custom-action-button-${t.isValidElement(i)?i.props?.["data-testid"]||i.props?.children:"fallback"}`)))]})]}),!Q&&e.jsx(S,{})]}),e.jsxs(c,{fullWidth:P,children:[R?e.jsx(T,{children:R}):null,e.jsx(p,{identifier:w,somethingWentWrongText:Y,children:e.jsx(e.Fragment,{children:j})})]})]})]})})},exports.maxWidth=b;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Add from '../../icons/Add';\nimport ArrowLeft02 from '../../icons/ArrowLeft02';\nimport Grid from '@mui/material/Grid';\nimport IconButton from '@mui/material/IconButton';\nimport { styled, useTheme } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\nimport FDErrorBoundary from '../FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { getMicroFrontendAttribute } from '../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../utilities/validation';\nimport Spacer from '../Spacer';\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\n\nexport const HORIZONTAL_SPACE_CLASSNAME = 'horizontal-content-space';\nexport const LEFT_HORIZONTAL_SPACE_CLASSNAME = 'left-horizontal-content-space';\nexport const RIGHT_HORIZONTAL_SPACE_CLASSNAME = 'right-horizontal-content-space';\nexport const VERTICAL_SPACE_CLASSNAME = 'vertical-content-space';\nexport const maxWidth = 1112;\nconst historyMinLength = 3;\n\nconst StyledWrapper = styled('div')<{ fluid: boolean }>(({ theme, fluid }) => ({\n maxWidth: fluid ? 'none' : maxWidth,\n [theme.breakpoints.down('md')]: {\n maxWidth: 'none',\n },\n padding: theme.spacing(2, 4),\n position: 'relative',\n minHeight: '100vh',\n}));\n\nconst StyledActionButtonGrid = styled(Grid)(({ theme }) => ({\n [theme.breakpoints.down('sm')]: {\n width: '100%',\n paddingTop: theme.spacing(2),\n },\n}));\n\nconst StyledHeader = styled(Grid)(({ theme }) => ({\n flexWrap: 'nowrap',\n alignItems: 'flex-start',\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst StyledTitleContainer = styled(Grid)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n}));\n\nconst StyledTitleSection = styled(Grid)(() => ({\n flexGrow: 1,\n}));\n\nconst StyledTopSection = styled('div')(({ theme }) => ({\n maxWidth,\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingBottom: theme.spacing(2),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n}));\n\nconst StyledAdd = styled(Add)(({ theme }) => ({\n marginRight: theme.spacing(1),\n}));\n\nconst StyledBackButton = styled(IconButton, {\n shouldForwardProp: (prop) => prop !== 'hasTitleComponent',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n})<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 2, -1.5, -1.5) : theme.spacing(-1.5, 2, -1.5, -1.5),\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(-2),\n },\n}));\n\nconst StyledInnerWrapper = styled('div')(({ theme }) => ({\n maxWidth,\n marginLeft: theme.spacing(6),\n marginRight: theme.spacing(4),\n paddingBottom: theme.spacing(2),\n\n [theme.breakpoints.only('md')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n maxWidth: 'none',\n },\n}));\n\nconst StyledHeaderContainer = styled(Grid)(() => ({\n display: 'flex',\n flexGrow: 1,\n justifyContent: 'flex-end',\n}));\nconst StyledCaption = styled(Typography)<{ component: string }>(() => ({\n lineHeight: '26px',\n}));\n\nconst StyledPageTitle = styled(Typography)<{ component: string }>(() => ({\n fontWeight: 'bold',\n}));\n\nconst StyledPageDivider = styled(Divider)(({ theme }) => ({\n marginBottom: theme.spacing(4),\n}));\n\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <StyledPageTitle variant=\"h5\" component=\"h2\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(({ useAlternateBackground, theme }) => ({\n backgroundColor: useAlternateBackground ? theme.palette.alternateBackground.main : theme.palette.white.main,\n width: '100%',\n height: '100%',\n}));\n\nexport type Props = {\n actionBtnTitle?: string;\n caption?: ReactNode;\n children: ReactNode;\n contextButtons?: ReactNode[];\n documentTitle: string;\n fluid?: boolean;\n fullWidth?: boolean;\n header?: ReactNode;\n hideHeader?: boolean;\n actionButtonLink?: string;\n pageHeader?: ReactNode;\n showActionButton?: boolean;\n showAddIcon?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n titleComponentAfter?: ReactNode;\n toPrevious?: boolean;\n toParent?: string;\n strictToParent?: boolean;\n openLinkInNewTab?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n navigate: (to: any) => void;\n hideDivider?: boolean;\n customActionButtons?: ReactNode[];\n useAlternateBackground?: boolean;\n errorBoundarySomethingWentWrongText: string;\n};\n\nconst PageLayout = (props: Props) => {\n const {\n actionBtnTitle,\n caption,\n children,\n contextButtons,\n documentTitle,\n fluid = false,\n fullWidth,\n header,\n hideHeader,\n actionButtonLink,\n openLinkInNewTab = false,\n pageHeader,\n showActionButton,\n showAddIcon,\n title,\n titleComponent: TitleComponent,\n toPrevious,\n toParent,\n strictToParent,\n navigate,\n hideDivider = false,\n customActionButtons,\n useAlternateBackground = false,\n titleComponentAfter,\n errorBoundarySomethingWentWrongText,\n } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const getActionButtonLink = () => {\n if (actionButtonWithHttps) {\n return actionButtonLink;\n }\n if (actionButtonLink !== undefined) {\n return joinUrlPaths(baseUrl, actionButtonLink);\n }\n return '';\n };\n const actionButtonLinkFinal = getActionButtonLink();\n\n return (\n <StyledPageContainer useAlternateBackground={useAlternateBackground}>\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader || null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n key={`context-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {button}\n </div>\n ))}\n </StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n if (toPrevious) {\n navigate(-1);\n } else if (toParent && strictToParent) {\n navigate(toParent);\n } else if (toParent && history.length < historyMinLength) {\n navigate(toParent);\n } else {\n navigate(-1);\n }\n }}\n >\n <ArrowLeft02 />\n </StyledBackButton>\n </Box>\n )}\n\n <StyledTitleSection item>\n {TitleComponent ? (\n <TitleComponent />\n ) : (\n <Box display=\"flex\" alignItems=\"center\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption variant=\"caption\" component=\"h3\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n <Button\n variant=\"contained\"\n fullWidth={true}\n data-testid={`Action-button-${actionBtnTitle}`}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n target={openLinkInNewTab ? '_blank' : undefined}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}\n }\n >\n {showAddIcon && <StyledAdd size=\"sm\" />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n key={`custom-action-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n {!isMobile && <Spacer size={16} variant=\"vertical\" />}\n <StyledActionButtonGrid item>{button}</StyledActionButtonGrid>\n </div>\n ))}\n </StyledTitleContainer>\n </StyledHeader>\n {!hideDivider && <StyledPageDivider />}\n </>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle} somethingWentWrongText={errorBoundarySomethingWentWrongText}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n </StyledPageContainer>\n );\n};\n\nexport default PageLayout;\n"],"names":["maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","padding","spacing","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledAdd","Add","marginRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","margin","only","marginLeft","StyledInnerWrapper","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","StyledPageContainer","useAlternateBackground","backgroundColor","palette","alternateBackground","main","white","height","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","titleComponentAfter","errorBoundarySomethingWentWrongText","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","jsx","_jsxs","DocumentTitle","Spacer","size","_Fragment","jsxs","container","direction","item","alignContent","map","button","React","isValidElement","Box","onClick","history","length","ArrowLeft02","gap","Fragment","Button","href","target","rel","FullWidthContainer","FDErrorBoundary","identifier","somethingWentWrongText"],"mappings":"kvBAoBO,MAIMA,EAAW,KAGlBC,EAAgBC,EAAMA,OAAC,MAAPA,EAAkC,EAAGC,QAAOC,YAAa,CAC3EJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,OAAQ,CAC5BN,SAAU,QAEdO,QAASJ,EAAMK,QAAQ,EAAG,GAC1BC,SAAU,WACVC,UAAW,YAGTC,EAAyBT,EAAAA,OAAOU,EAAPV,EAAa,EAAGC,YAAa,CACxD,CAACA,EAAME,YAAYC,KAAK,OAAQ,CAC5BO,MAAO,OACPC,WAAYX,EAAMK,QAAQ,QAI5BO,EAAeb,EAAAA,OAAOU,EAAPV,EAAa,EAAGC,YAAa,CAC9Ca,SAAU,SACVC,WAAY,aACZH,WAAYX,EAAMK,QAAQ,GAC1BU,cAAef,EAAMK,QAAQ,GAE7B,CAACL,EAAME,YAAYC,KAAK,OAAQ,CAC5BQ,WAAYX,EAAMK,QAAQ,GAC1BU,cAAef,EAAMK,QAAQ,QAI/BW,EAAuBjB,EAAAA,OAAOU,EAAPV,EAAa,EAAGC,YAAa,CACtDW,WAAYX,EAAMK,QAAQ,OAGxBY,EAAqBlB,EAAAA,OAAOU,EAAPV,EAAa,KAAO,CAC3CmB,SAAU,MAGRC,EAAmBpB,EAAAA,OAAO,MAAPA,EAAc,EAAGC,YAAa,CACnDH,WACAkB,cAAef,EAAMK,QAAQ,GAE7B,CAACL,EAAME,YAAYC,KAAK,OAAQ,CAC5BY,cAAef,EAAMK,QAAQ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AAAnD,SAAA2C,EAAAK,KAACgB,EACG,CAAAlE,QAAQ,YACRgB,WAAW,EAAI,cACF,iBAAiBJ,IAC9BuD,KAAM/C,GAAoBmB,GAAwBE,GAAwB,GAC1E2B,OAAQhD,EAAmB,cAAWsB,EACtC2B,IAAKjD,EAAmB,2BAAwBsB,EAChDkB,QACKxC,GAAqBmB,GAA2D,OAAnC,IAAMV,EAASV,aAGhEI,GAAexB,EAAC6C,IAAAtE,GAAU0E,KAAK,OAC/BpC,UAKhBmB,GAAqBwB,KAAKC,GACvBX,EAAAA,KAAA,MAAA,CAAA3C,SAAA,CAGKiC,IAAYpC,EAAAA,IAACgD,EAAM,CAACC,KAAM,GAAIhD,QAAQ,cACrCmC,IAAYpC,MAACgD,EAAM,CAACC,KAAM,GAAIhD,QAAQ,aACxCD,EAAA6C,IAACpF,EAAsB,CAAC6F,MAAM,EAAAnD,SAAAsD,MAJzB,wBAAwBC,EAAMC,eAAeF,GAAUA,EAAO7C,QAAQ,gBAAkB6C,EAAO7C,OAAOT,SAAW,uBASpI4B,GAAe/B,MAACL,SAG1BmD,EAACK,KAAAoB,EAAmB,CAAAtD,UAAWA,EAASd,SAAA,CACnCe,EAASlB,EAAAA,IAAC5B,EAAgB,CAAA+B,SAAEe,IAA6B,KAC1DlB,EAAAA,IAACwE,EAAe,CAACC,WAAYzD,EAAe0D,uBAAwBxC,EAAmC/B,SACnGH,EAAG6C,IAAAK,WAAA,CAAA/C,SAAAA,gBAMzB"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Add from '../../icons/Add';\nimport ArrowLeft02 from '../../icons/ArrowLeft02';\nimport Grid from '@mui/material/Grid';\nimport IconButton from '@mui/material/IconButton';\nimport { styled, useTheme } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\nimport FDErrorBoundary from '../FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { getMicroFrontendAttribute } from '../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../utilities/validation';\nimport Spacer from '../Spacer';\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\n\nexport const HORIZONTAL_SPACE_CLASSNAME = 'horizontal-content-space';\nexport const LEFT_HORIZONTAL_SPACE_CLASSNAME = 'left-horizontal-content-space';\nexport const RIGHT_HORIZONTAL_SPACE_CLASSNAME = 'right-horizontal-content-space';\nexport const VERTICAL_SPACE_CLASSNAME = 'vertical-content-space';\nexport const maxWidth = 1112;\nconst historyMinLength = 3;\n\nconst StyledWrapper = styled('div')<{ fluid: boolean }>(({ theme, fluid }) => ({\n maxWidth: fluid ? 'none' : maxWidth,\n [theme.breakpoints.down('md')]: {\n maxWidth: 'none',\n },\n padding: theme.spacing(2, 4),\n position: 'relative',\n minHeight: '100vh',\n}));\n\nconst StyledActionButtonGrid = styled(Grid)(({ theme }) => ({\n [theme.breakpoints.down('sm')]: {\n width: '100%',\n paddingTop: theme.spacing(2),\n },\n}));\n\nconst StyledHeader = styled(Grid)(({ theme }) => ({\n flexWrap: 'nowrap',\n alignItems: 'flex-start',\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst StyledTitleContainer = styled(Grid)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n}));\n\nconst StyledTitleSection = styled(Grid)(() => ({\n flexGrow: 1,\n}));\n\nconst StyledTopSection = styled('div')(({ theme }) => ({\n maxWidth,\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingBottom: theme.spacing(2),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n}));\n\nconst StyledAdd = styled(Add)(({ theme }) => ({\n marginRight: theme.spacing(1),\n}));\n\nconst StyledBackButton = styled(IconButton, {\n shouldForwardProp: (prop) => prop !== 'hasTitleComponent',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n})<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 2, -1.5, -1.5) : theme.spacing(-1.5, 2, -1.5, -1.5),\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(-2),\n },\n}));\n\nconst StyledInnerWrapper = styled('div')(({ theme }) => ({\n maxWidth,\n marginLeft: theme.spacing(6),\n marginRight: theme.spacing(4),\n paddingBottom: theme.spacing(2),\n\n [theme.breakpoints.only('md')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n maxWidth: 'none',\n },\n}));\n\nconst StyledHeaderContainer = styled(Grid)(() => ({\n display: 'flex',\n flexGrow: 1,\n justifyContent: 'flex-end',\n}));\nconst StyledCaption = styled(Typography)<{ component: string }>(() => ({\n lineHeight: '26px',\n}));\n\nconst StyledPageTitle = styled(Typography)<{ component: string }>(() => ({\n fontWeight: 'bold',\n}));\n\nconst StyledPageDivider = styled(Divider)(({ theme }) => ({\n marginBottom: theme.spacing(4),\n}));\n\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <StyledPageTitle variant=\"h5\" component=\"h2\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(({ useAlternateBackground, theme }) => ({\n backgroundColor: useAlternateBackground\n ? theme.palette.semantic.light.background['background-alternate']\n : theme.palette.semantic.light.background['background-base'],\n width: '100%',\n height: '100%',\n}));\n\nexport type Props = {\n actionBtnTitle?: string;\n caption?: ReactNode;\n children: ReactNode;\n contextButtons?: ReactNode[];\n documentTitle: string;\n fluid?: boolean;\n fullWidth?: boolean;\n header?: ReactNode;\n hideHeader?: boolean;\n actionButtonLink?: string;\n pageHeader?: ReactNode;\n showActionButton?: boolean;\n showAddIcon?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n titleComponentAfter?: ReactNode;\n toPrevious?: boolean;\n toParent?: string;\n strictToParent?: boolean;\n openLinkInNewTab?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n navigate: (to: any) => void;\n hideDivider?: boolean;\n customActionButtons?: ReactNode[];\n useAlternateBackground?: boolean;\n errorBoundarySomethingWentWrongText: string;\n};\n\nconst PageLayout = (props: Props) => {\n const {\n actionBtnTitle,\n caption,\n children,\n contextButtons,\n documentTitle,\n fluid = false,\n fullWidth,\n header,\n hideHeader,\n actionButtonLink,\n openLinkInNewTab = false,\n pageHeader,\n showActionButton,\n showAddIcon,\n title,\n titleComponent: TitleComponent,\n toPrevious,\n toParent,\n strictToParent,\n navigate,\n hideDivider = false,\n customActionButtons,\n useAlternateBackground = false,\n titleComponentAfter,\n errorBoundarySomethingWentWrongText,\n } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const getActionButtonLink = () => {\n if (actionButtonWithHttps) {\n return actionButtonLink;\n }\n if (actionButtonLink !== undefined) {\n return joinUrlPaths(baseUrl, actionButtonLink);\n }\n return '';\n };\n const actionButtonLinkFinal = getActionButtonLink();\n\n return (\n <StyledPageContainer useAlternateBackground={useAlternateBackground}>\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader || null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n key={`context-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {button}\n </div>\n ))}\n </StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n if (toPrevious) {\n navigate(-1);\n } else if (toParent && strictToParent) {\n navigate(toParent);\n } else if (toParent && history.length < historyMinLength) {\n navigate(toParent);\n } else {\n navigate(-1);\n }\n }}\n >\n <ArrowLeft02 />\n </StyledBackButton>\n </Box>\n )}\n\n <StyledTitleSection item>\n {TitleComponent ? (\n <TitleComponent />\n ) : (\n <Box display=\"flex\" alignItems=\"center\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption variant=\"caption\" component=\"h3\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n <Button\n variant=\"contained\"\n fullWidth={true}\n data-testid={`Action-button-${actionBtnTitle}`}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n target={openLinkInNewTab ? '_blank' : undefined}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}\n }\n >\n {showAddIcon && <StyledAdd size=\"sm\" />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n key={`custom-action-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n {!isMobile && <Spacer size={16} variant=\"vertical\" />}\n <StyledActionButtonGrid item>{button}</StyledActionButtonGrid>\n </div>\n ))}\n </StyledTitleContainer>\n </StyledHeader>\n {!hideDivider && <StyledPageDivider />}\n </>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle} somethingWentWrongText={errorBoundarySomethingWentWrongText}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n </StyledPageContainer>\n );\n};\n\nexport default PageLayout;\n"],"names":["maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","padding","spacing","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledAdd","Add","marginRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","margin","only","marginLeft","StyledInnerWrapper","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","StyledPageContainer","useAlternateBackground","backgroundColor","palette","semantic","light","background","height","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","titleComponentAfter","errorBoundarySomethingWentWrongText","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","jsx","_jsxs","DocumentTitle","Spacer","size","_Fragment","jsxs","container","direction","item","alignContent","map","button","React","isValidElement","Box","onClick","history","length","ArrowLeft02","gap","F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mB,GAA2D,OAAnC,IAAMV,EAASV,aAGhEI,GAAexB,EAAC6C,IAAAtE,GAAU0E,KAAK,OAC/BpC,UAKhBmB,GAAqBwB,KAAKC,GACvBX,EAAAA,KAAA,MAAA,CAAA3C,SAAA,CAGKiC,IAAYpC,EAAAA,IAACgD,EAAM,CAACC,KAAM,GAAIhD,QAAQ,cACrCmC,IAAYpC,MAACgD,EAAM,CAACC,KAAM,GAAIhD,QAAQ,aACxCD,EAAA6C,IAACpF,EAAsB,CAAC6F,MAAM,EAAAnD,SAAAsD,MAJzB,wBAAwBC,EAAMC,eAAeF,GAAUA,EAAO7C,QAAQ,gBAAkB6C,EAAO7C,OAAOT,SAAW,uBASpI4B,GAAe/B,MAACL,SAG1BmD,EAACK,KAAAoB,EAAmB,CAAAtD,UAAWA,EAASd,SAAA,CACnCe,EAASlB,EAAAA,IAAC5B,EAAgB,CAAA+B,SAAEe,IAA6B,KAC1DlB,EAAAA,IAACwE,EAAe,CAACC,WAAYzD,EAAe0D,uBAAwBxC,EAAmC/B,SACnGH,EAAG6C,IAAAK,WAAA,CAAA/C,SAAAA,gBAMzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as i,Fragment as n}from"react/jsx-runtime";import e from"react";import a from"../../icons/Add/index.js";import o from"../../icons/ArrowLeft02/index.js";import r from"@mui/material/Grid";import d from"@mui/material/IconButton";import{styled as m,useTheme as l}from"@mui/material/styles";import c from"@mui/material/Typography";import p from"@mui/material/useMediaQuery";import s from"./DocumentTitle.js";import h from"./FullWidthContainer.js";import g from"../FDErrorBoundary/index.js";import u from"@mui/material/Button";import{getMicroFrontendAttribute as f}from"../../utilities/renderUtilities.js";import{joinUrlPaths as b}from"../../utilities/validation.js";import v from"../Spacer/index.js";import k from"@mui/material/Box";import x from"@mui/material/Divider";const B="horizontal-content-space",w="left-horizontal-content-space",W="right-horizontal-content-space",y="vertical-content-space",T=1112,C=m("div")((({theme:t,fluid:i})=>({maxWidth:i?"none":T,[t.breakpoints.down("md")]:{maxWidth:"none"},padding:t.spacing(2,4),position:"relative",minHeight:"100vh"}))),j=m(r)((({theme:t})=>({[t.breakpoints.down("sm")]:{width:"100%",paddingTop:t.spacing(2)}}))),A=m(r)((({theme:t})=>({flexWrap:"nowrap",alignItems:"flex-start",paddingTop:t.spacing(3),paddingBottom:t.spacing(3),[t.breakpoints.down("md")]:{paddingTop:t.spacing(2),paddingBottom:t.spacing(3)}}))),L=m(r)((({theme:t})=>({paddingTop:t.spacing(2)}))),z=m(r)((()=>({flexGrow:1}))),I=m("div")((({theme:t})=>({maxWidth:T,paddingBottom:t.spacing(3),[t.breakpoints.down("md")]:{paddingBottom:t.spacing(2),paddingLeft:t.spacing(2),paddingRight:t.spacing(2)}}))),R=m(a)((({theme:t})=>({marginRight:t.spacing(1)}))),D=m(d,{shouldForwardProp:t=>"hasTitleComponent"!==t})((({theme:t,hasTitleComponent:i})=>({margin:i?t.spacing(-.75,2,-1.5,-1.5):t.spacing(-1.5,2,-1.5,-1.5),[t.breakpoints.only("sm")]:{marginLeft:t.spacing(-2)},[t.breakpoints.only("xs")]:{marginLeft:t.spacing(-2)}}))),H=m("div")((({theme:t})=>({maxWidth:T,marginLeft:t.spacing(6),marginRight:t.spacing(4),paddingBottom:t.spacing(2),[t.breakpoints.only("md")]:{marginLeft:12,marginRight:t.spacing(3)},[t.breakpoints.only("sm")]:{marginLeft:t.spacing(3),marginRight:t.spacing(3),maxWidth:"none"},[t.breakpoints.only("xs")]:{marginLeft:t.spacing(2),marginRight:t.spacing(2),maxWidth:"none"}}))),P=m(r)((()=>({display:"flex",flexGrow:1,justifyContent:"flex-end"}))),E=m(c)((()=>({lineHeight:"26px"}))),F=m(c)((()=>({fontWeight:"bold"}))),G=m(x)((({theme:t})=>({marginBottom:t.spacing(4)}))),$=({title:i})=>t(F,{variant:"h5",component:"h2",children:i}),S=m("div")((({useAlternateBackground:t,theme:i})=>({backgroundColor:t?i.palette.semantic.light.background["background-alternate"]:i.palette.semantic.light.background["background-base"],width:"100%",height:"100%"}))),V=a=>{const{actionBtnTitle:d,caption:m,children:c,contextButtons:x,documentTitle:B,fluid:w=!1,fullWidth:W,header:y,hideHeader:T,actionButtonLink:F,openLinkInNewTab:V=!1,pageHeader:_,showActionButton:M,showAddIcon:N,title:Q,titleComponent:U,toPrevious:q,toParent:J,strictToParent:K,navigate:O,hideDivider:X=!1,customActionButtons:Y,useAlternateBackground:Z=!1,titleComponentAfter:tt,errorBoundarySomethingWentWrongText:it}=a,nt=l(),et=p(nt.breakpoints.down("md")),at=f("data-portal-base-url")||"/",ot=F?.startsWith("https://"),rt=ot?F:void 0!==F?b(at,F):"";return t(S,{useAlternateBackground:Z,children:i(C,{fluid:w,children:[B&&t(s,{children:B}),_||null,i(H,{children:[_&&t(v,{size:16,variant:"vertical"}),!T&&i(n,{children:[i(A,{container:!0,alignItems:"center",direction:"column",children:[t(r,{item:!0,container:!0,direction:"row",alignContent:"space-between",children:t(P,{item:!0,children:x?.map((i=>t("div",{children:i},`context-button-${e.isValidElement(i)?i.props?.["data-testid"]||i.props?.children:"fallback"}`)))})}),i(L,{item:!0,container:!0,children:[(J||q)&&t(k,{children:t(D,{"aria-label":"Back","data-testid":"back_button",hasTitleComponent:!!U,component:"button",onClick:()=>{q?O(-1):J&&K||J&&history.length<3?O(J):O(-1)},children:t(o,{})})}),i(z,{item:!0,children:[U?t(U,{}):i(k,{display:"flex",alignItems:"center",gap:2,children:[t($,{title:Q}),tt]}),m&&t(E,{variant:"caption",component:"h3",children:m})]}),M&&i(n,{children:[et&&t(v,{size:56,variant:"vertical"}),t(j,{item:!0,children:i(u,{variant:"contained",fullWidth:!0,"data-testid":`Action-button-${d}`,href:V||ot?rt:"",target:V?"_blank":void 0,rel:V?"noopener noreferrer":void 0,onClick:V||ot?()=>{}:()=>O(F),children:[N&&t(R,{size:"sm"}),d]})})]}),Y?.map((n=>i("div",{children:[et&&t(v,{size:56,variant:"vertical"}),!et&&t(v,{size:16,variant:"vertical"}),t(j,{item:!0,children:n})]},`custom-action-button-${e.isValidElement(n)?n.props?.["data-testid"]||n.props?.children:"fallback"}`)))]})]}),!X&&t(G,{})]}),i(h,{fullWidth:W,children:[y?t(I,{children:y}):null,t(g,{identifier:B,somethingWentWrongText:it,children:t(n,{children:c})})]})]})]})})};export{B as HORIZONTAL_SPACE_CLASSNAME,w as LEFT_HORIZONTAL_SPACE_CLASSNAME,$ as PageTitle,W as RIGHT_HORIZONTAL_SPACE_CLASSNAME,y as VERTICAL_SPACE_CLASSNAME,V as default,T as maxWidth};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Add from '../../icons/Add';\nimport ArrowLeft02 from '../../icons/ArrowLeft02';\nimport Grid from '@mui/material/Grid';\nimport IconButton from '@mui/material/IconButton';\nimport { styled, useTheme } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\nimport FDErrorBoundary from '../FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { getMicroFrontendAttribute } from '../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../utilities/validation';\nimport Spacer from '../Spacer';\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\n\nexport const HORIZONTAL_SPACE_CLASSNAME = 'horizontal-content-space';\nexport const LEFT_HORIZONTAL_SPACE_CLASSNAME = 'left-horizontal-content-space';\nexport const RIGHT_HORIZONTAL_SPACE_CLASSNAME = 'right-horizontal-content-space';\nexport const VERTICAL_SPACE_CLASSNAME = 'vertical-content-space';\nexport const maxWidth = 1112;\nconst historyMinLength = 3;\n\nconst StyledWrapper = styled('div')<{ fluid: boolean }>(({ theme, fluid }) => ({\n maxWidth: fluid ? 'none' : maxWidth,\n [theme.breakpoints.down('md')]: {\n maxWidth: 'none',\n },\n padding: theme.spacing(2, 4),\n position: 'relative',\n minHeight: '100vh',\n}));\n\nconst StyledActionButtonGrid = styled(Grid)(({ theme }) => ({\n [theme.breakpoints.down('sm')]: {\n width: '100%',\n paddingTop: theme.spacing(2),\n },\n}));\n\nconst StyledHeader = styled(Grid)(({ theme }) => ({\n flexWrap: 'nowrap',\n alignItems: 'flex-start',\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst StyledTitleContainer = styled(Grid)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n}));\n\nconst StyledTitleSection = styled(Grid)(() => ({\n flexGrow: 1,\n}));\n\nconst StyledTopSection = styled('div')(({ theme }) => ({\n maxWidth,\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingBottom: theme.spacing(2),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n}));\n\nconst StyledAdd = styled(Add)(({ theme }) => ({\n marginRight: theme.spacing(1),\n}));\n\nconst StyledBackButton = styled(IconButton, {\n shouldForwardProp: (prop) => prop !== 'hasTitleComponent',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n})<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 2, -1.5, -1.5) : theme.spacing(-1.5, 2, -1.5, -1.5),\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(-2),\n },\n}));\n\nconst StyledInnerWrapper = styled('div')(({ theme }) => ({\n maxWidth,\n marginLeft: theme.spacing(6),\n marginRight: theme.spacing(4),\n paddingBottom: theme.spacing(2),\n\n [theme.breakpoints.only('md')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n maxWidth: 'none',\n },\n}));\n\nconst StyledHeaderContainer = styled(Grid)(() => ({\n display: 'flex',\n flexGrow: 1,\n justifyContent: 'flex-end',\n}));\nconst StyledCaption = styled(Typography)<{ component: string }>(() => ({\n lineHeight: '26px',\n}));\n\nconst StyledPageTitle = styled(Typography)<{ component: string }>(() => ({\n fontWeight: 'bold',\n}));\n\nconst StyledPageDivider = styled(Divider)(({ theme }) => ({\n marginBottom: theme.spacing(4),\n}));\n\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <StyledPageTitle variant=\"h5\" component=\"h2\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(({ useAlternateBackground, theme }) => ({\n backgroundColor: useAlternateBackground ? theme.palette.alternateBackground.main : theme.palette.white.main,\n width: '100%',\n height: '100%',\n}));\n\nexport type Props = {\n actionBtnTitle?: string;\n caption?: ReactNode;\n children: ReactNode;\n contextButtons?: ReactNode[];\n documentTitle: string;\n fluid?: boolean;\n fullWidth?: boolean;\n header?: ReactNode;\n hideHeader?: boolean;\n actionButtonLink?: string;\n pageHeader?: ReactNode;\n showActionButton?: boolean;\n showAddIcon?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n titleComponentAfter?: ReactNode;\n toPrevious?: boolean;\n toParent?: string;\n strictToParent?: boolean;\n openLinkInNewTab?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n navigate: (to: any) => void;\n hideDivider?: boolean;\n customActionButtons?: ReactNode[];\n useAlternateBackground?: boolean;\n errorBoundarySomethingWentWrongText: string;\n};\n\nconst PageLayout = (props: Props) => {\n const {\n actionBtnTitle,\n caption,\n children,\n contextButtons,\n documentTitle,\n fluid = false,\n fullWidth,\n header,\n hideHeader,\n actionButtonLink,\n openLinkInNewTab = false,\n pageHeader,\n showActionButton,\n showAddIcon,\n title,\n titleComponent: TitleComponent,\n toPrevious,\n toParent,\n strictToParent,\n navigate,\n hideDivider = false,\n customActionButtons,\n useAlternateBackground = false,\n titleComponentAfter,\n errorBoundarySomethingWentWrongText,\n } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const getActionButtonLink = () => {\n if (actionButtonWithHttps) {\n return actionButtonLink;\n }\n if (actionButtonLink !== undefined) {\n return joinUrlPaths(baseUrl, actionButtonLink);\n }\n return '';\n };\n const actionButtonLinkFinal = getActionButtonLink();\n\n return (\n <StyledPageContainer useAlternateBackground={useAlternateBackground}>\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader || null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n key={`context-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {button}\n </div>\n ))}\n </StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n if (toPrevious) {\n navigate(-1);\n } else if (toParent && strictToParent) {\n navigate(toParent);\n } else if (toParent && history.length < historyMinLength) {\n navigate(toParent);\n } else {\n navigate(-1);\n }\n }}\n >\n <ArrowLeft02 />\n </StyledBackButton>\n </Box>\n )}\n\n <StyledTitleSection item>\n {TitleComponent ? (\n <TitleComponent />\n ) : (\n <Box display=\"flex\" alignItems=\"center\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption variant=\"caption\" component=\"h3\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n <Button\n variant=\"contained\"\n fullWidth={true}\n data-testid={`Action-button-${actionBtnTitle}`}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n target={openLinkInNewTab ? '_blank' : undefined}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}\n }\n >\n {showAddIcon && <StyledAdd size=\"sm\" />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n key={`custom-action-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n {!isMobile && <Spacer size={16} variant=\"vertical\" />}\n <StyledActionButtonGrid item>{button}</StyledActionButtonGrid>\n </div>\n ))}\n </StyledTitleContainer>\n </StyledHeader>\n {!hideDivider && <StyledPageDivider />}\n </>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle} somethingWentWrongText={errorBoundarySomethingWentWrongText}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n </StyledPageContainer>\n );\n};\n\nexport default PageLayout;\n"],"names":["HORIZONTAL_SPACE_CLASSNAME","LEFT_HORIZONTAL_SPACE_CLASSNAME","RIGHT_HORIZONTAL_SPACE_CLASSNAME","VERTICAL_SPACE_CLASSNAME","maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","padding","spacing","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledAdd","Add","marginRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","margin","only","marginLeft","StyledInnerWrapper","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","StyledPageContainer","useAlternateBackground","backgroundColor","palette","alternateBackground","main","white","height","PageLayout","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","titleComponentAfter","errorBoundarySomethingWentWrongText","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","Spacer","size","_Fragment","container","direction","item","alignContent","map","button","React","isValidElement","Box","onClick","history","length","ArrowLeft02","gap","Button","href","target","rel","FullWidthContainer","FDErrorBoundary","identifier","somethingWentWrongText"],"mappings":"kxBAoBO,MAAMA,EAA6B,2BAC7BC,EAAkC,gCAClCC,EAAmC,iCACnCC,EAA2B,yBAC3BC,EAAW,KAGlBC,EAAgBC,EAAO,MAAPA,EAAkC,EAAGC,QAAOC,YAAa,CAC3EJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,OAAQ,CAC5BN,SAAU,QAEdO,QAASJ,EAAMK,QAAQ,EAAG,GAC1BC,SAAU,WACVC,UAAW,YAGTC,EAAyBT,EAAOU,EAAPV,EAAa,EAAGC,YAAa,CACx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.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Add from '../../icons/Add';\nimport ArrowLeft02 from '../../icons/ArrowLeft02';\nimport Grid from '@mui/material/Grid';\nimport IconButton from '@mui/material/IconButton';\nimport { styled, useTheme } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\nimport FDErrorBoundary from '../FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { getMicroFrontendAttribute } from '../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../utilities/validation';\nimport Spacer from '../Spacer';\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\n\nexport const HORIZONTAL_SPACE_CLASSNAME = 'horizontal-content-space';\nexport const LEFT_HORIZONTAL_SPACE_CLASSNAME = 'left-horizontal-content-space';\nexport const RIGHT_HORIZONTAL_SPACE_CLASSNAME = 'right-horizontal-content-space';\nexport const VERTICAL_SPACE_CLASSNAME = 'vertical-content-space';\nexport const maxWidth = 1112;\nconst historyMinLength = 3;\n\nconst StyledWrapper = styled('div')<{ fluid: boolean }>(({ theme, fluid }) => ({\n maxWidth: fluid ? 'none' : maxWidth,\n [theme.breakpoints.down('md')]: {\n maxWidth: 'none',\n },\n padding: theme.spacing(2, 4),\n position: 'relative',\n minHeight: '100vh',\n}));\n\nconst StyledActionButtonGrid = styled(Grid)(({ theme }) => ({\n [theme.breakpoints.down('sm')]: {\n width: '100%',\n paddingTop: theme.spacing(2),\n },\n}));\n\nconst StyledHeader = styled(Grid)(({ theme }) => ({\n flexWrap: 'nowrap',\n alignItems: 'flex-start',\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst StyledTitleContainer = styled(Grid)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n}));\n\nconst StyledTitleSection = styled(Grid)(() => ({\n flexGrow: 1,\n}));\n\nconst StyledTopSection = styled('div')(({ theme }) => ({\n maxWidth,\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingBottom: theme.spacing(2),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n}));\n\nconst StyledAdd = styled(Add)(({ theme }) => ({\n marginRight: theme.spacing(1),\n}));\n\nconst StyledBackButton = styled(IconButton, {\n shouldForwardProp: (prop) => prop !== 'hasTitleComponent',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n})<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 2, -1.5, -1.5) : theme.spacing(-1.5, 2, -1.5, -1.5),\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(-2),\n },\n}));\n\nconst StyledInnerWrapper = styled('div')(({ theme }) => ({\n maxWidth,\n marginLeft: theme.spacing(6),\n marginRight: theme.spacing(4),\n paddingBottom: theme.spacing(2),\n\n [theme.breakpoints.only('md')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n maxWidth: 'none',\n },\n}));\n\nconst StyledHeaderContainer = styled(Grid)(() => ({\n display: 'flex',\n flexGrow: 1,\n justifyContent: 'flex-end',\n}));\nconst StyledCaption = styled(Typography)<{ component: string }>(() => ({\n lineHeight: '26px',\n}));\n\nconst StyledPageTitle = styled(Typography)<{ component: string }>(() => ({\n fontWeight: 'bold',\n}));\n\nconst StyledPageDivider = styled(Divider)(({ theme }) => ({\n marginBottom: theme.spacing(4),\n}));\n\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <StyledPageTitle variant=\"h5\" component=\"h2\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(({ useAlternateBackground, theme }) => ({\n backgroundColor: useAlternateBackground\n ? theme.palette.semantic.light.background['background-alternate']\n : theme.palette.semantic.light.background['background-base'],\n width: '100%',\n height: '100%',\n}));\n\nexport type Props = {\n actionBtnTitle?: string;\n caption?: ReactNode;\n children: ReactNode;\n contextButtons?: ReactNode[];\n documentTitle: string;\n fluid?: boolean;\n fullWidth?: boolean;\n header?: ReactNode;\n hideHeader?: boolean;\n actionButtonLink?: string;\n pageHeader?: ReactNode;\n showActionButton?: boolean;\n showAddIcon?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n titleComponentAfter?: ReactNode;\n toPrevious?: boolean;\n toParent?: string;\n strictToParent?: boolean;\n openLinkInNewTab?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n navigate: (to: any) => void;\n hideDivider?: boolean;\n customActionButtons?: ReactNode[];\n useAlternateBackground?: boolean;\n errorBoundarySomethingWentWrongText: string;\n};\n\nconst PageLayout = (props: Props) => {\n const {\n actionBtnTitle,\n caption,\n children,\n contextButtons,\n documentTitle,\n fluid = false,\n fullWidth,\n header,\n hideHeader,\n actionButtonLink,\n openLinkInNewTab = false,\n pageHeader,\n showActionButton,\n showAddIcon,\n title,\n titleComponent: TitleComponent,\n toPrevious,\n toParent,\n strictToParent,\n navigate,\n hideDivider = false,\n customActionButtons,\n useAlternateBackground = false,\n titleComponentAfter,\n errorBoundarySomethingWentWrongText,\n } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const getActionButtonLink = () => {\n if (actionButtonWithHttps) {\n return actionButtonLink;\n }\n if (actionButtonLink !== undefined) {\n return joinUrlPaths(baseUrl, actionButtonLink);\n }\n return '';\n };\n const actionButtonLinkFinal = getActionButtonLink();\n\n return (\n <StyledPageContainer useAlternateBackground={useAlternateBackground}>\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader || null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n key={`context-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {button}\n </div>\n ))}\n </StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n if (toPrevious) {\n navigate(-1);\n } else if (toParent && strictToParent) {\n navigate(toParent);\n } else if (toParent && history.length < historyMinLength) {\n navigate(toParent);\n } else {\n navigate(-1);\n }\n }}\n >\n <ArrowLeft02 />\n </StyledBackButton>\n </Box>\n )}\n\n <StyledTitleSection item>\n {TitleComponent ? (\n <TitleComponent />\n ) : (\n <Box display=\"flex\" alignItems=\"center\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption variant=\"caption\" component=\"h3\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n <Button\n variant=\"contained\"\n fullWidth={true}\n data-testid={`Action-button-${actionBtnTitle}`}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n target={openLinkInNewTab ? '_blank' : undefined}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}\n }\n >\n {showAddIcon && <StyledAdd size=\"sm\" />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n key={`custom-action-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n {!isMobile && <Spacer size={16} variant=\"vertical\" />}\n <StyledActionButtonGrid item>{button}</StyledActionButtonGrid>\n </div>\n ))}\n </StyledTitleContainer>\n </StyledHeader>\n {!hideDivider && <StyledPageDivider />}\n </>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle} somethingWentWrongText={errorBoundarySomethingWentWrongText}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n </StyledPageContainer>\n );\n};\n\nexport default PageLayout;\n"],"names":["HORIZONTAL_SPACE_CLASSNAME","LEFT_HORIZONTAL_SPACE_CLASSNAME","RIGHT_HORIZONTAL_SPACE_CLASSNAME","VERTICAL_SPACE_CLASSNAME","maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","padding","spacing","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledAdd","Add","marginRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","margin","only","marginLeft","StyledInnerWrapper","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","StyledPageContainer","useAlternateBackground","backgroundColor","palette","semantic","light","background","height","PageLayout","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","titleComponentAfter","errorBoundarySomethingWentWrongText","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","Spacer","size","_Fragment","container","direction","item","alignContent","map","button","React","isValidElement","Box","onClick","history","length","ArrowLeft02","gap","Button","href","target","rel","FullWidthContainer","FDErrorBoundary","identifier","somethingWentWrongText"],"mappings":"kxBAoBO,MAAMA,EAA6B,2BAC7BC,EAAkC,gCAClCC,EAAmC,iCACnCC,EAA2B,yBAC3BC,EAAW,KAGlBC,EAAgBC,EAAO,MAAPA,EAAkC,EAAGC,QAAOC,YAAa,CAC3EJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,OAAQ,CAC5BN,SAAU,QAEdO,QAASJ,EAAMK,QAAQ,EAAG,GAC1BC,SAAU,WACVC,UAAW,YAGTC,EAAyBT,EAAOU,EAAPV,EAAa,EAAGC,YAAa,CACxD,CAACA,EAAME,YAAYC,KAAK,OAAQ,CAC5BO,MAAO,OACPC,WAAYX,EAAMK,QAAQ,QAI5BO,EAAeb,EAAOU,EAAPV,EAAa,EAAGC,YAAa,CAC9Ca,SAAU,SACVC,WAAY,aACZH,WAAYX,EAAMK,QAAQ,GAC1BU,cAAef,EAAMK,QAAQ,GAE7B,CAACL,EAAME,YAAYC,KAAK,OAAQ,CAC5BQ,WAAYX,EAAMK,QAAQ,GAC1BU,cAAef,EAAMK,QAAQ,QAI/BW,EAAuBjB,EAAOU,EAAPV,EAAa,EAAGC,YAAa,CACtDW,WAAYX,EAAMK,QAAQ,OAGxBY,EAAqBlB,EAAOU,EAAPV,EAAa,K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WAAW,EAAI,cACF,iBAAiBJ,IAC9BoD,KAAM5C,GAAoBmB,GAAwBE,GAAwB,GAC1EwB,OAAQ7C,EAAmB,cAAWsB,EACtCwB,IAAK9C,EAAmB,2BAAwBsB,EAChDgB,QACKtC,GAAqBmB,GAA2D,OAAnC,IAAMV,EAASV,aAGhEI,GAAezB,EAACzB,GAAU0E,KAAK,OAC/BnC,UAKhBmB,GAAqBsB,KAAKC,GACvBV,EAAA,MAAA,CAAA3C,SAAA,CAGKkC,IAAYrC,EAACgD,EAAM,CAACC,KAAM,GAAIhD,QAAQ,cACrCoC,IAAYrC,EAACgD,EAAM,CAACC,KAAM,GAAIhD,QAAQ,aACxCD,EAACvC,EAAsB,CAAC4F,MAAM,EAAAlD,SAAAqD,MAJzB,wBAAwBC,EAAMC,eAAeF,GAAUA,EAAO3C,QAAQ,gBAAkB2C,EAAO3C,OAAOV,SAAW,uBASpI6B,GAAehC,EAACL,SAG1BmD,EAACuB,EAAmB,CAAAnD,UAAWA,EAASf,SAAA,CACnCgB,EAASnB,EAAC5B,EAAgB,CAAA+B,SAAEgB,IAA6B,KAC1DnB,EAACsE,EAAe,CAACC,WAAYtD,EAAeuD,uBAAwBrC,GAAmChC,SACnGH,EAAGkD,EAAA,CAAA/C,SAAAA,gBAMzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/styles"),r=require("notistack");const n=t.styled(r.MaterialDesignContent)((({theme:e})=>({"&.notistack-MuiContent-default":{backgroundColor:e.palette.black
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/styles"),r=require("notistack");const n=t.styled(r.MaterialDesignContent)((({theme:e})=>({"&.notistack-MuiContent-default":{backgroundColor:e.palette.semantic.light.fill["fill-black"]},"&.notistack-MuiContent-success":{backgroundColor:e.palette.success.main},"&.notistack-MuiContent-error":{backgroundColor:e.palette.error.main}})));module.exports=({children:t})=>e.jsx(r.SnackbarProvider,{maxSnack:3,anchorOrigin:{vertical:"bottom",horizontal:"center"},Components:{success:n,error:n,default:n},children:t});
|
|
2
2
|
//# sourceMappingURL=ToastProvider.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastProvider.cjs.js","sources":["../../src/providers/ToastProvider.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport { SnackbarProvider, MaterialDesignContent } from 'notistack';\n\nconst StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({\n '&.notistack-MuiContent-default': {\n backgroundColor: theme.palette.black
|
|
1
|
+
{"version":3,"file":"ToastProvider.cjs.js","sources":["../../src/providers/ToastProvider.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport { SnackbarProvider, MaterialDesignContent } from 'notistack';\n\nconst StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({\n '&.notistack-MuiContent-default': {\n backgroundColor: theme.palette.semantic.light.fill['fill-black'],\n },\n '&.notistack-MuiContent-success': {\n backgroundColor: theme.palette.success.main,\n },\n '&.notistack-MuiContent-error': {\n backgroundColor: theme.palette.error.main,\n },\n}));\n\n/**\n * ToastProvider component that wraps the application with notistack's SnackbarProvider.\n * Provides a centralized toast notification system with custom styling.\n *\n * Features:\n * - Maximum of 3 notifications displayed simultaneously\n * - Notifications appear at the bottom center of the scree\n *\n * @param {Object} props - Component props\n * @param {React.ReactNode} props.children - Child components to be wrapped by the provider\n * @returns {JSX.Element} ToastProvider component\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * </ToastProvider>\n * ```\n */\nconst ToastProvider = ({ children }: { children: React.ReactNode }) => {\n return (\n <SnackbarProvider\n maxSnack={3}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n Components={{\n success: StyledMaterialDesignContent,\n error: StyledMaterialDesignContent,\n default: StyledMaterialDesignContent,\n }}\n >\n {children}\n </SnackbarProvider>\n );\n};\n\nexport default ToastProvider;\n"],"names":["StyledMaterialDesignContent","styled","MaterialDesignContent","theme","backgroundColor","palette","semantic","light","fill","success","main","error","children","_jsx","SnackbarProvider","maxSnack","anchorOrigin","vertical","horizontal","Components","default"],"mappings":"yGAGA,MAAMA,EAA8BC,EAAAA,OAAOC,EAAAA,sBAAPD,EAA8B,EAAGE,YAAa,CAC9E,iCAAkC,CAC9BC,gBAAiBD,EAAME,QAAQC,SAASC,MAAMC,KAAK,eAEvD,iCAAkC,CAC9BJ,gBAAiBD,EAAME,QAAQI,QAAQC,MAE3C,+BAAgC,CAC5BN,gBAAiBD,EAAME,QAAQM,MAAMD,yBAuBvB,EAAGE,cAEjBC,MAACC,EAAgBA,iBAAA,CACbC,SAAU,EACVC,aAAc,CACVC,SAAU,SACVC,WAAY,UAEhBC,WAAY,CACRV,QAAST,EACTW,MAAOX,EACPoB,QAASpB,GAGZY,SAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{styled as o}from"@mui/material/styles";import{MaterialDesignContent as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{styled as o}from"@mui/material/styles";import{MaterialDesignContent as e,SnackbarProvider as r}from"notistack";const n=o(e)((({theme:t})=>({"&.notistack-MuiContent-default":{backgroundColor:t.palette.semantic.light.fill["fill-black"]},"&.notistack-MuiContent-success":{backgroundColor:t.palette.success.main},"&.notistack-MuiContent-error":{backgroundColor:t.palette.error.main}}))),a=({children:o})=>t(r,{maxSnack:3,anchorOrigin:{vertical:"bottom",horizontal:"center"},Components:{success:n,error:n,default:n},children:o});export{a as default};
|
|
2
2
|
//# sourceMappingURL=ToastProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastProvider.js","sources":["../../src/providers/ToastProvider.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport { SnackbarProvider, MaterialDesignContent } from 'notistack';\n\nconst StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({\n '&.notistack-MuiContent-default': {\n backgroundColor: theme.palette.black
|
|
1
|
+
{"version":3,"file":"ToastProvider.js","sources":["../../src/providers/ToastProvider.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport { SnackbarProvider, MaterialDesignContent } from 'notistack';\n\nconst StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({\n '&.notistack-MuiContent-default': {\n backgroundColor: theme.palette.semantic.light.fill['fill-black'],\n },\n '&.notistack-MuiContent-success': {\n backgroundColor: theme.palette.success.main,\n },\n '&.notistack-MuiContent-error': {\n backgroundColor: theme.palette.error.main,\n },\n}));\n\n/**\n * ToastProvider component that wraps the application with notistack's SnackbarProvider.\n * Provides a centralized toast notification system with custom styling.\n *\n * Features:\n * - Maximum of 3 notifications displayed simultaneously\n * - Notifications appear at the bottom center of the scree\n *\n * @param {Object} props - Component props\n * @param {React.ReactNode} props.children - Child components to be wrapped by the provider\n * @returns {JSX.Element} ToastProvider component\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * </ToastProvider>\n * ```\n */\nconst ToastProvider = ({ children }: { children: React.ReactNode }) => {\n return (\n <SnackbarProvider\n maxSnack={3}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n Components={{\n success: StyledMaterialDesignContent,\n error: StyledMaterialDesignContent,\n default: StyledMaterialDesignContent,\n }}\n >\n {children}\n </SnackbarProvider>\n );\n};\n\nexport default ToastProvider;\n"],"names":["StyledMaterialDesignContent","styled","MaterialDesignContent","theme","backgroundColor","palette","semantic","light","fill","success","main","error","ToastProvider","children","_jsx","SnackbarProvider","maxSnack","anchorOrigin","vertical","horizontal","Components","default"],"mappings":"8JAGA,MAAMA,EAA8BC,EAAOC,EAAPD,EAA8B,EAAGE,YAAa,CAC9E,iCAAkC,CAC9BC,gBAAiBD,EAAME,QAAQC,SAASC,MAAMC,KAAK,eAEvD,iCAAkC,CAC9BJ,gBAAiBD,EAAME,QAAQI,QAAQC,MAE3C,+BAAgC,CAC5BN,gBAAiBD,EAAME,QAAQM,MAAMD,UAuBvCE,EAAgB,EAAGC,cAEjBC,EAACC,EAAgB,CACbC,SAAU,EACVC,aAAc,CACVC,SAAU,SACVC,WAAY,UAEhBC,WAAY,CACRX,QAAST,EACTW,MAAOX,EACPqB,QAASrB,GAGZa,SAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@mui/material/styles/createTheme")
|
|
1
|
+
"use strict";var e=require("@mui/material/styles/createTheme"),r=require("./tokens/colours.cjs.js");const o=e({typography:require("./typography.cjs.js").typography,palette:r.colours});var t=e(o,{shape:{borderRadius:"4px"},components:{MuiButton:{styleOverrides:{root:{padding:"12px 24px",textTransform:"none"}}},MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:o.palette.divider}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold",paddingLeft:"6px",paddingRight:"6px"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:"#eaf2ff"},"&:not(:last-child)":{borderBottom:`1px solid ${o.palette.divider}`}}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:o.palette.semantic.light.fill["fill-secondary"],cursor:"pointer"}}}}}});module.exports=t;
|
|
2
2
|
//# sourceMappingURL=flipdishPublicTheme.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flipdishPublicTheme.cjs.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type ThemeOptions } from '@mui/material/styles/createTheme';\
|
|
1
|
+
{"version":3,"file":"flipdishPublicTheme.cjs.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type ThemeOptions } from '@mui/material/styles/createTheme';\nimport { colours } from './tokens/colours';\nimport { typography } from './typography';\n\n// Create base theme with typography and colors\nconst baseTheme = createTheme({\n typography,\n palette: colours,\n});\n\n// Create final theme with component overrides and additional configurations\nexport default createTheme(baseTheme as ThemeOptions, {\n shape: {\n borderRadius: '4px',\n },\n components: {\n MuiButton: {\n styleOverrides: {\n root: {\n padding: '12px 24px',\n textTransform: 'none',\n },\n },\n },\n MuiCard: {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: baseTheme.palette.divider,\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n paddingLeft: '6px',\n paddingRight: '6px',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: '#eaf2ff',\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${baseTheme.palette.divider}`,\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n '&.MuiTableRow-hover:hover': {\n backgroundColor: baseTheme.palette.semantic.light.fill['fill-secondary'],\n cursor: 'pointer',\n },\n },\n },\n },\n },\n});\n"],"names":["baseTheme","createTheme","typography","palette","colours","flipdishPublicTheme","shape","borderRadius","components","MuiButton","styleOverrides","root","padding","textTransform","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","divider","MuiChip","fontWeight","paddingLeft","paddingRight","MuiListItemButton","backgroundColor","borderBottom","MuiTableRow","semantic","light","fill","cursor"],"mappings":"oGAKA,MAAMA,EAAYC,EAAY,2CAChBC,WACVC,QAASC,EAAOA,UAIpB,IAAeC,EAAAJ,EAAYD,EAA2B,CAClDM,MAAO,CACHC,aAAc,OAElBC,WAAY,CACRC,UAAW,CACPC,eAAgB,CACZC,KAAM,CACFC,QAAS,YACTC,cAAe,UAI3BC,QAAS,CACLJ,eAAgB,CACZC,KAAM,CACFI,UAAW,OACXC,YAAa,MACbC,YAAa,QACbC,YAAalB,EAAUG,QAAQgB,WAI3CC,QAAS,CACLV,eAAgB,CACZC,KAAM,CACFU,WAAY,OACZC,YAAa,MACbC,aAAc,SAI1BC,kBAAmB,CACfd,eAAgB,CACZC,KAAM,CACF,UAAW,CACPc,gBAAiB,WAErB,qBAAsB,CAClBC,aAAc,aAAa1B,EAAUG,QAAQgB,cAK7DQ,YAAa,CACTjB,eAAgB,CACZC,KAAM,CACF,4BAA6B,CACzBc,gBAAiBzB,EAAUG,QAAQyB,SAASC,MAAMC,KAAK,kBACvDC,OAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"@mui/material/styles/createTheme";import{colours as e}from"./tokens/colours.js";import{typography as r}from"./typography.js";const t=o({typography:r,palette:e});var i=o(t,{shape:{borderRadius:"4px"},components:{MuiButton:{styleOverrides:{root:{padding:"12px 24px",textTransform:"none"}}},MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:t.palette.divider}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold",paddingLeft:"6px",paddingRight:"6px"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:"#eaf2ff"},"&:not(:last-child)":{borderBottom:`1px solid ${t.palette.divider}`}}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:t.palette.semantic.light.fill["fill-secondary"],cursor:"pointer"}}}}}});export{i as default};
|
|
2
2
|
//# sourceMappingURL=flipdishPublicTheme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flipdishPublicTheme.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type ThemeOptions } from '@mui/material/styles/createTheme';\
|
|
1
|
+
{"version":3,"file":"flipdishPublicTheme.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type ThemeOptions } from '@mui/material/styles/createTheme';\nimport { colours } from './tokens/colours';\nimport { typography } from './typography';\n\n// Create base theme with typography and colors\nconst baseTheme = createTheme({\n typography,\n palette: colours,\n});\n\n// Create final theme with component overrides and additional configurations\nexport default createTheme(baseTheme as ThemeOptions, {\n shape: {\n borderRadius: '4px',\n },\n components: {\n MuiButton: {\n styleOverrides: {\n root: {\n padding: '12px 24px',\n textTransform: 'none',\n },\n },\n },\n MuiCard: {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: baseTheme.palette.divider,\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n paddingLeft: '6px',\n paddingRight: '6px',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: '#eaf2ff',\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${baseTheme.palette.divider}`,\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n '&.MuiTableRow-hover:hover': {\n backgroundColor: baseTheme.palette.semantic.light.fill['fill-secondary'],\n cursor: 'pointer',\n },\n },\n },\n },\n },\n});\n"],"names":["baseTheme","createTheme","typography","palette","colours","flipdishPublicTheme","shape","borderRadius","components","MuiButton","styleOverrides","root","padding","textTransform","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","divider","MuiChip","fontWeight","paddingLeft","paddingRight","MuiListItemButton","backgroundColor","borderBottom","MuiTableRow","semantic","light","fill","cursor"],"mappings":"2IAKA,MAAMA,EAAYC,EAAY,CAC1BC,aACAC,QAASC,IAIb,IAAeC,EAAAJ,EAAYD,EAA2B,CAClDM,MAAO,CACHC,aAAc,OAElBC,WAAY,CACRC,UAAW,CACPC,eAAgB,CACZC,KAAM,CACFC,QAAS,YACTC,cAAe,UAI3BC,QAAS,CACLJ,eAAgB,CACZC,KAAM,CACFI,UAAW,OACXC,YAAa,MACbC,YAAa,QACbC,YAAalB,EAAUG,QAAQgB,WAI3CC,QAAS,CACLV,eAAgB,CACZC,KAAM,CACFU,WAAY,OACZC,YAAa,MACbC,aAAc,SAI1BC,kBAAmB,CACfd,eAAgB,CACZC,KAAM,CACF,UAAW,CACPc,gBAAiB,WAErB,qBAAsB,CAClBC,aAAc,aAAa1B,EAAUG,QAAQgB,cAK7DQ,YAAa,CACTjB,eAAgB,CACZC,KAAM,CACF,4BAA6B,CACzBc,gBAAiBzB,EAAUG,QAAQyB,SAASC,MAAMC,KAAK,kBACvDC,OAAQ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("@mui/material/styles");const r={grey:{light:{1e3:e.alpha("#000000",.9),700:e.alpha("#000000",.6),500:e.alpha("#000000",.45),100:e.alpha("#000000",.1),50:e.alpha("#000000",.04),25:e.alpha("#000000",.02)}},primary:{light:{1e3:"#095FB0",800:e.alpha("#095FB0",.8),200:e.alpha("#095FB0",.2),50:e.alpha("#095FB0",.05)}},secondary:{light:{1e3:"#A5E2F6"}},tertiary:{light:{1e3:"#F7742B"}},red:{light:{1e3:"#B80022",800:e.alpha("#B80022",.8),200:e.alpha("#B80022",.2),50:e.alpha("#B80022",.05)}},amber:{light:{1e3:"#825900",800:e.alpha("#825900",.8),200:e.alpha("#825900",.2),50:e.alpha("#825900",.05)}},green:{light:{1e3:"#006E3E",800:e.alpha("#006E3E",.8),200:e.alpha("#006E3E",.2),50:e.alpha("#006E3E",.05)}},purple:{light:{1e3:"#8C0BD6",800:e.alpha("#8C0BD6",.8),200:e.alpha("#8C0BD6",.2),50:e.alpha("#8C0BD6",.05)}},solid:{grey:{1e3:"#000000",900:"#1A1A1A",850:"#262626",800:"#333333",50:"#FAFAFA ",0:"#FFFFFF"},yellow:{1e3:"#FFBC2C"},lightGrey:{1e3:"#EEEBE9"},lime:{1e3:"#CFF27D"},pink:{1e3:"#FFBAE4"}},greyShadow:{150:e.alpha("#000000",.15),100:e.alpha("#000000",.1)}},l={success:{main:r.green.light[1e3]},error:{main:r.red.light[1e3]},warning:{main:r.solid.yellow[1e3]},semantic:{light:{text:{"text-strong":r.grey.light[1e3],"text-weak":r.grey.light[700],"text-primary":r.primary.light[1e3],"text-disabled":r.grey.light[100],"text-error":r.red.light[1e3],"text-warning":r.amber.light[1e3],"text-success":r.green.light[1e3],"text-information":r.purple.light[1e3]},stroke:{"stroke-strong":r.grey.light[500],"stroke-weak":r.grey.light[100],"stroke-selected":r.primary.light[1e3],"stroke-focus":r.primary.light[1e3],"stroke-disabled":r.grey.light[100],"stroke-primary-strong":r.primary.light[800],"stroke-primary-weak":r.primary.light[200],"stroke-secondary":r.secondary.light[1e3],"stroke-tertiary":r.tertiary.light[1e3],"stroke-error-strong":r.red.light[800],"stroke-error-weak":r.red.light[200],"stroke-warning-strong":r.amber.light[800],"stroke-warning-weak":r.amber.light[200],"stroke-success-strong":r.green.light[800],"stroke-success-weak":r.green.light[200],"stroke-information-strong":r.purple.light[800],"stroke-information-weak":r.purple.light[200]},icon:{"icon-strong":r.grey.light[500],"icon-primary":r.primary.light[800],"icon-disabled":r.grey.light[100],"icon-error":r.red.light[800],"icon-warning":r.amber.light[800],"icon-success":r.green.light[800],"icon-information":r.purple.light[800]},fill:{"fill-strong":r.grey.light[1e3],"fill-weak":r.grey.light[50],"fill-weaker":r.grey.light[25],"fill-hover":r.grey.light[50],"fill-press":r.grey.light[100],"fill-selected":r.primary.light[1e3],"fill-disabled":r.grey.light[100],"fill-overlay":r.grey.light[500],"fill-primary-strong":r.primary.light[1e3],"fill-primary-weak":r.primary.light[50],"fill-secondary":r.secondary.light[1e3],"fill-tertiary":r.tertiary.light[1e3],"fill-error-strong":r.red.light[1e3],"fill-error-weak":r.red.light[50],"fill-warning-strong":r.amber.light[1e3],"fill-warning-weak":r.amber.light[50],"fill-success-strong":r.green.light[1e3],"fill-success-weak":r.green.light[50],"fill-information-strong":r.purple.light[1e3],"fill-information-weak":r.purple.light[50],"fill-flipdishlogo":r.solid.lightGrey[1e3],"fill-black":r.solid.grey[1e3],"fill-white":r.solid.grey[0],"fill-yellow":r.solid.yellow[1e3],"fill-lightgrey":r.solid.lightGrey[1e3],"fill-lime":r.solid.lime[1e3],"fill-pink":r.solid.pink[1e3]},background:{"background-base":r.solid.grey[0],"background-raised":r.solid.grey[0],"background-overlay":r.solid.grey[0],"background-sunken":r.solid.grey[50],"background-alternate":r.solid.lightGrey[1e3],"background-primary":r.primary.light[1e3],"background-secondary":r.secondary.light[1e3],"background-tertiary":r.tertiary.light[1e3]},shadow:{"shadow-strong":r.greyShadow[150],"shadow-weak":r.greyShadow[100]}}}};exports.colours=l,exports.primativeColours=r;
|
|
2
|
+
//# sourceMappingURL=colours.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colours.cjs.js","sources":["../../../src/themes/tokens/colours.ts"],"sourcesContent":["import type { ThemeOptions } from '@mui/material/styles/createTheme';\nimport { alpha, type PaletteColor } from '@mui/material/styles';\n\nexport interface SimplePaletteColourOptions extends Partial<PaletteColor> {\n main: string;\n light?: string;\n dark?: string;\n}\n\nexport type LightDarkPrimitives<T> = {\n light: T;\n // Not used yet\n // dark: T;\n};\n\nexport type GreyPrimitives = {\n 1000: string;\n 700: string;\n 500: string;\n 100: string;\n 50: string;\n 25: string;\n};\n\nexport type PrimaryPrimitives = {\n 1000: string;\n 800: string;\n 200: string;\n 50: string;\n};\n\nexport type SinglePrimitive = {\n 1000: string;\n};\n\nexport type SystemPrimitives = {\n 1000: string;\n 800: string;\n 200: string;\n 50: string;\n};\n\nexport type SolidGreyPrimitives = {\n 1000: string;\n 900: string;\n 850: string;\n 800: string;\n 50: string;\n 0: string;\n};\n\nexport type PrimativeColours = {\n grey: LightDarkPrimitives<GreyPrimitives>;\n primary: LightDarkPrimitives<PrimaryPrimitives>;\n secondary: LightDarkPrimitives<SinglePrimitive>;\n tertiary: LightDarkPrimitives<SinglePrimitive>;\n red: LightDarkPrimitives<SystemPrimitives>;\n amber: LightDarkPrimitives<SystemPrimitives>;\n green: LightDarkPrimitives<SystemPrimitives>;\n purple: LightDarkPrimitives<SystemPrimitives>;\n solid: {\n grey: SolidGreyPrimitives;\n yellow: SinglePrimitive;\n lightGrey: SinglePrimitive;\n lime: SinglePrimitive;\n pink: SinglePrimitive;\n };\n greyShadow: {\n 150: string;\n 100: string;\n };\n};\n\nexport const primativeColours: PrimativeColours = {\n grey: {\n light: {\n 1000: alpha('#000000', 0.9),\n 700: alpha('#000000', 0.6),\n 500: alpha('#000000', 0.45),\n 100: alpha('#000000', 0.1),\n 50: alpha('#000000', 0.04),\n 25: alpha('#000000', 0.02),\n },\n },\n primary: {\n light: {\n 1000: '#095FB0',\n 800: alpha('#095FB0', 0.8),\n 200: alpha('#095FB0', 0.2),\n 50: alpha('#095FB0', 0.05),\n },\n },\n secondary: {\n light: {\n 1000: '#A5E2F6',\n },\n },\n tertiary: {\n light: {\n 1000: '#F7742B',\n },\n },\n red: {\n light: {\n 1000: '#B80022',\n 800: alpha('#B80022', 0.8),\n 200: alpha('#B80022', 0.2),\n 50: alpha('#B80022', 0.05),\n },\n },\n amber: {\n light: {\n 1000: '#825900',\n 800: alpha('#825900', 0.8),\n 200: alpha('#825900', 0.2),\n 50: alpha('#825900', 0.05),\n },\n },\n green: {\n light: {\n 1000: '#006E3E',\n 800: alpha('#006E3E', 0.8),\n 200: alpha('#006E3E', 0.2),\n 50: alpha('#006E3E', 0.05),\n },\n },\n purple: {\n light: {\n 1000: '#8C0BD6',\n 800: alpha('#8C0BD6', 0.8),\n 200: alpha('#8C0BD6', 0.2),\n 50: alpha('#8C0BD6', 0.05),\n },\n },\n solid: {\n grey: {\n 1000: '#000000',\n 900: '#1A1A1A',\n 850: '#262626',\n 800: '#333333',\n 50: '#FAFAFA ',\n 0: '#FFFFFF',\n },\n yellow: {\n 1000: '#FFBC2C',\n },\n lightGrey: {\n 1000: '#EEEBE9',\n },\n lime: {\n 1000: '#CFF27D',\n },\n pink: {\n 1000: '#FFBAE4',\n },\n },\n greyShadow: {\n 150: alpha('#000000', 0.15),\n 100: alpha('#000000', 0.1),\n },\n};\n\nexport const colours: ThemeOptions['palette'] = {\n // Status colours\n success: {\n main: primativeColours.green.light['1000'],\n },\n error: {\n main: primativeColours.red.light['1000'],\n },\n warning: {\n main: primativeColours.solid.yellow['1000'],\n },\n // Colour tokens (semantic colours) are a way of naming and organising primitive colours based on how they're used.\n semantic: {\n light: {\n text: {\n 'text-strong': primativeColours.grey.light['1000'],\n 'text-weak': primativeColours.grey.light['700'],\n 'text-primary': primativeColours.primary.light['1000'],\n 'text-disabled': primativeColours.grey.light['100'],\n 'text-error': primativeColours.red.light['1000'],\n 'text-warning': primativeColours.amber.light['1000'],\n 'text-success': primativeColours.green.light['1000'],\n 'text-information': primativeColours.purple.light['1000'],\n // 'text-inverse-strong': '';\n // 'text-inverse-weak': ';\n // 'text-inverse-disabled': ';\n },\n stroke: {\n 'stroke-strong': primativeColours.grey.light['500'],\n 'stroke-weak': primativeColours.grey.light['100'],\n 'stroke-selected': primativeColours.primary.light['1000'],\n 'stroke-focus': primativeColours.primary.light['1000'],\n 'stroke-disabled': primativeColours.grey.light['100'],\n 'stroke-primary-strong': primativeColours.primary.light['800'],\n 'stroke-primary-weak': primativeColours.primary.light['200'],\n 'stroke-secondary': primativeColours.secondary.light['1000'],\n 'stroke-tertiary': primativeColours.tertiary.light['1000'],\n 'stroke-error-strong': primativeColours.red.light['800'],\n 'stroke-error-weak': primativeColours.red.light['200'],\n 'stroke-warning-strong': primativeColours.amber.light['800'],\n 'stroke-warning-weak': primativeColours.amber.light['200'],\n 'stroke-success-strong': primativeColours.green.light['800'],\n 'stroke-success-weak': primativeColours.green.light['200'],\n 'stroke-information-strong': primativeColours.purple.light['800'],\n 'stroke-information-weak': primativeColours.purple.light['200'],\n // 'stroke-inverse-strong': '',\n // 'stroke-inverse-weak': '',\n // 'stroke-inverse-disabled': '',\n },\n icon: {\n 'icon-strong': primativeColours.grey.light['500'],\n 'icon-primary': primativeColours.primary.light['800'],\n 'icon-disabled': primativeColours.grey.light['100'],\n 'icon-error': primativeColours.red.light['800'],\n 'icon-warning': primativeColours.amber.light['800'],\n 'icon-success': primativeColours.green.light['800'],\n 'icon-information': primativeColours.purple.light['800'],\n // 'icon-inverse': '',\n // 'icon-inverse-strong': '',\n // 'icon-inverse-disabled': '',\n },\n fill: {\n 'fill-strong': primativeColours.grey.light['1000'],\n 'fill-weak': primativeColours.grey.light['50'],\n 'fill-weaker': primativeColours.grey.light['25'],\n 'fill-hover': primativeColours.grey.light['50'],\n 'fill-press': primativeColours.grey.light['100'],\n 'fill-selected': primativeColours.primary.light['1000'],\n 'fill-disabled': primativeColours.grey.light['100'],\n 'fill-overlay': primativeColours.grey.light['500'],\n 'fill-primary-strong': primativeColours.primary.light['1000'],\n 'fill-primary-weak': primativeColours.primary.light['50'],\n 'fill-secondary': primativeColours.secondary.light['1000'],\n 'fill-tertiary': primativeColours.tertiary.light['1000'],\n 'fill-error-strong': primativeColours.red.light['1000'],\n 'fill-error-weak': primativeColours.red.light['50'],\n 'fill-warning-strong': primativeColours.amber.light['1000'],\n 'fill-warning-weak': primativeColours.amber.light['50'],\n 'fill-success-strong': primativeColours.green.light['1000'],\n 'fill-success-weak': primativeColours.green.light['50'],\n 'fill-information-strong': primativeColours.purple.light['1000'],\n 'fill-information-weak': primativeColours.purple.light['50'],\n // 'fill-inverse-strong': '',\n // 'fill-inverse-weak': '',\n // 'fill-inverse-hover': '',\n // 'fill-inverse-press': '',\n // 'fill-inverse-disabled': '',\n 'fill-flipdishlogo': primativeColours.solid.lightGrey['1000'],\n 'fill-black': primativeColours.solid.grey['1000'],\n 'fill-white': primativeColours.solid.grey['0'],\n 'fill-yellow': primativeColours.solid.yellow['1000'],\n 'fill-lightgrey': primativeColours.solid.lightGrey['1000'],\n 'fill-lime': primativeColours.solid.lime['1000'],\n 'fill-pink': primativeColours.solid.pink['1000'],\n },\n background: {\n 'background-base': primativeColours.solid.grey['0'],\n 'background-raised': primativeColours.solid.grey['0'],\n 'background-overlay': primativeColours.solid.grey['0'],\n 'background-sunken': primativeColours.solid.grey['50'],\n 'background-alternate': primativeColours.solid.lightGrey['1000'],\n 'background-primary': primativeColours.primary.light['1000'],\n 'background-secondary': primativeColours.secondary.light['1000'],\n 'background-tertiary': primativeColours.tertiary.light['1000'],\n // 'background-inverse': '',\n },\n shadow: {\n 'shadow-strong': primativeColours.greyShadow['150'],\n 'shadow-weak': primativeColours.greyShadow['100'],\n },\n },\n },\n};\n"],"names":["primativeColours","grey","light","alpha","primary","secondary","tertiary","red","amber","green","purple","solid","yellow","lightGrey","lime","pink","greyShadow","colours","success","main","error","warning","semantic","text","stroke","icon","fill","background","shadow"],"mappings":"mDAyEa,MAAAA,EAAqC,CAC9CC,KAAM,CACFC,MAAO,CACH,IAAMC,EAAAA,MAAM,UAAW,IACvB,IAAKA,EAAAA,MAAM,UAAW,IACtB,IAAKA,EAAAA,MAAM,UAAW,KACtB,IAAKA,EAAAA,MAAM,UAAW,IACtB,GAAIA,EAAAA,MAAM,UAAW,KACrB,GAAIA,EAAAA,MAAM,UAAW,OAG7BC,QAAS,CACLF,MAAO,CACH,IAAM,UACN,IAAKC,EAAAA,MAAM,UAAW,IACtB,IAAKA,EAAAA,MAAM,UAAW,IACtB,GAAIA,EAAAA,MAAM,UAAW,OAG7BE,UAAW,CACPH,MAAO,CACH,IAAM,YAGdI,SAAU,CACNJ,MAAO,CACH,IAAM,YAGdK,IAAK,CACDL,MAAO,CACH,IAAM,UACN,IAAKC,EAAAA,MAAM,UAAW,IACtB,IAAKA,EAAAA,MAAM,UAAW,IACtB,GAAIA,EAAAA,MAAM,UAAW,OAG7BK,MAAO,CACHN,MAAO,CACH,IAAM,UACN,IAAKC,EAAAA,MAAM,UAAW,IACtB,IAAKA,EAAAA,MAAM,UAAW,IACtB,GAAIA,EAAAA,MAAM,UAAW,OAG7BM,MAAO,CACHP,MAAO,CACH,IAAM,UACN,IAAKC,EAAAA,MAAM,UAAW,IACtB,IAAKA,EAAAA,MAAM,UAAW,IACtB,GAAIA,EAAAA,MAAM,UAAW,OAG7BO,OAAQ,CACJR,MAAO,CACH,IAAM,UACN,IAAKC,EAAAA,MAAM,UAAW,IACtB,IAAKA,EAAAA,MAAM,UAAW,IACtB,GAAIA,EAAAA,MAAM,UAAW,OAG7BQ,MAAO,CACHV,KA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MAAME,UAAU,KACtD,aAAcb,EAAiBW,MAAMV,KAAK,KAC1C,aAAcD,EAAiBW,MAAMV,KAAK,GAC1C,cAAeD,EAAiBW,MAAMC,OAAO,KAC7C,iBAAkBZ,EAAiBW,MAAME,UAAU,KACnD,YAAab,EAAiBW,MAAMG,KAAK,KACzC,YAAad,EAAiBW,MAAMI,KAAK,MAE7CY,WAAY,CACR,kBAAmB3B,EAAiBW,MAAMV,KAAK,GAC/C,oBAAqBD,EAAiBW,MAAMV,KAAK,GACjD,qBAAsBD,EAAiBW,MAAMV,KAAK,GAClD,oBAAqBD,EAAiBW,MAAMV,KAAK,IACjD,uBAAwBD,EAAiBW,MAAME,UAAU,KACzD,qBAAsBb,EAAiBI,QAAQF,MAAM,KACrD,uBAAwBF,EAAiBK,UAAUH,MAAM,KACzD,sBAAuBF,EAAiBM,SAASJ,MAAM,MAG3D0B,OAAQ,CACJ,gBAAiB5B,EAAiBgB,WAAW,KAC7C,cAAehB,EAAiBgB,WAAW"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ThemeOptions } from '@mui/material/styles/createTheme';
|
|
2
|
+
import { PaletteColor } from '@mui/material/styles';
|
|
3
|
+
|
|
4
|
+
interface SimplePaletteColourOptions extends Partial<PaletteColor> {
|
|
5
|
+
main: string;
|
|
6
|
+
light?: string;
|
|
7
|
+
dark?: string;
|
|
8
|
+
}
|
|
9
|
+
type LightDarkPrimitives<T> = {
|
|
10
|
+
light: T;
|
|
11
|
+
};
|
|
12
|
+
type GreyPrimitives = {
|
|
13
|
+
1000: string;
|
|
14
|
+
700: string;
|
|
15
|
+
500: string;
|
|
16
|
+
100: string;
|
|
17
|
+
50: string;
|
|
18
|
+
25: string;
|
|
19
|
+
};
|
|
20
|
+
type PrimaryPrimitives = {
|
|
21
|
+
1000: string;
|
|
22
|
+
800: string;
|
|
23
|
+
200: string;
|
|
24
|
+
50: string;
|
|
25
|
+
};
|
|
26
|
+
type SinglePrimitive = {
|
|
27
|
+
1000: string;
|
|
28
|
+
};
|
|
29
|
+
type SystemPrimitives = {
|
|
30
|
+
1000: string;
|
|
31
|
+
800: string;
|
|
32
|
+
200: string;
|
|
33
|
+
50: string;
|
|
34
|
+
};
|
|
35
|
+
type SolidGreyPrimitives = {
|
|
36
|
+
1000: string;
|
|
37
|
+
900: string;
|
|
38
|
+
850: string;
|
|
39
|
+
800: string;
|
|
40
|
+
50: string;
|
|
41
|
+
0: string;
|
|
42
|
+
};
|
|
43
|
+
type PrimativeColours = {
|
|
44
|
+
grey: LightDarkPrimitives<GreyPrimitives>;
|
|
45
|
+
primary: LightDarkPrimitives<PrimaryPrimitives>;
|
|
46
|
+
secondary: LightDarkPrimitives<SinglePrimitive>;
|
|
47
|
+
tertiary: LightDarkPrimitives<SinglePrimitive>;
|
|
48
|
+
red: LightDarkPrimitives<SystemPrimitives>;
|
|
49
|
+
amber: LightDarkPrimitives<SystemPrimitives>;
|
|
50
|
+
green: LightDarkPrimitives<SystemPrimitives>;
|
|
51
|
+
purple: LightDarkPrimitives<SystemPrimitives>;
|
|
52
|
+
solid: {
|
|
53
|
+
grey: SolidGreyPrimitives;
|
|
54
|
+
yellow: SinglePrimitive;
|
|
55
|
+
lightGrey: SinglePrimitive;
|
|
56
|
+
lime: SinglePrimitive;
|
|
57
|
+
pink: SinglePrimitive;
|
|
58
|
+
};
|
|
59
|
+
greyShadow: {
|
|
60
|
+
150: string;
|
|
61
|
+
100: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
declare const primativeColours: PrimativeColours;
|
|
65
|
+
declare const colours: ThemeOptions['palette'];
|
|
66
|
+
|
|
67
|
+
export { type GreyPrimitives, type LightDarkPrimitives, type PrimaryPrimitives, type PrimativeColours, type SimplePaletteColourOptions, type SinglePrimitive, type SolidGreyPrimitives, type SystemPrimitives, colours, primativeColours };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{alpha as e}from"@mui/material/styles";const r={grey:{light:{1e3:e("#000000",.9),700:e("#000000",.6),500:e("#000000",.45),100:e("#000000",.1),50:e("#000000",.04),25:e("#000000",.02)}},primary:{light:{1e3:"#095FB0",800:e("#095FB0",.8),200:e("#095FB0",.2),50:e("#095FB0",.05)}},secondary:{light:{1e3:"#A5E2F6"}},tertiary:{light:{1e3:"#F7742B"}},red:{light:{1e3:"#B80022",800:e("#B80022",.8),200:e("#B80022",.2),50:e("#B80022",.05)}},amber:{light:{1e3:"#825900",800:e("#825900",.8),200:e("#825900",.2),50:e("#825900",.05)}},green:{light:{1e3:"#006E3E",800:e("#006E3E",.8),200:e("#006E3E",.2),50:e("#006E3E",.05)}},purple:{light:{1e3:"#8C0BD6",800:e("#8C0BD6",.8),200:e("#8C0BD6",.2),50:e("#8C0BD6",.05)}},solid:{grey:{1e3:"#000000",900:"#1A1A1A",850:"#262626",800:"#333333",50:"#FAFAFA ",0:"#FFFFFF"},yellow:{1e3:"#FFBC2C"},lightGrey:{1e3:"#EEEBE9"},lime:{1e3:"#CFF27D"},pink:{1e3:"#FFBAE4"}},greyShadow:{150:e("#000000",.15),100:e("#000000",.1)}},i={success:{main:r.green.light[1e3]},error:{main:r.red.light[1e3]},warning:{main:r.solid.yellow[1e3]},semantic:{light:{text:{"text-strong":r.grey.light[1e3],"text-weak":r.grey.light[700],"text-primary":r.primary.light[1e3],"text-disabled":r.grey.light[100],"text-error":r.red.light[1e3],"text-warning":r.amber.light[1e3],"text-success":r.green.light[1e3],"text-information":r.purple.light[1e3]},stroke:{"stroke-strong":r.grey.light[500],"stroke-weak":r.grey.light[100],"stroke-selected":r.primary.light[1e3],"stroke-focus":r.primary.light[1e3],"stroke-disabled":r.grey.light[100],"stroke-primary-strong":r.primary.light[800],"stroke-primary-weak":r.primary.light[200],"stroke-secondary":r.secondary.light[1e3],"stroke-tertiary":r.tertiary.light[1e3],"stroke-error-strong":r.red.light[800],"stroke-error-weak":r.red.light[200],"stroke-warning-strong":r.amber.light[800],"stroke-warning-weak":r.amber.light[200],"stroke-success-strong":r.green.light[800],"stroke-success-weak":r.green.light[200],"stroke-information-strong":r.purple.light[800],"stroke-information-weak":r.purple.light[200]},icon:{"icon-strong":r.grey.light[500],"icon-primary":r.primary.light[800],"icon-disabled":r.grey.light[100],"icon-error":r.red.light[800],"icon-warning":r.amber.light[800],"icon-success":r.green.light[800],"icon-information":r.purple.light[800]},fill:{"fill-strong":r.grey.light[1e3],"fill-weak":r.grey.light[50],"fill-weaker":r.grey.light[25],"fill-hover":r.grey.light[50],"fill-press":r.grey.light[100],"fill-selected":r.primary.light[1e3],"fill-disabled":r.grey.light[100],"fill-overlay":r.grey.light[500],"fill-primary-strong":r.primary.light[1e3],"fill-primary-weak":r.primary.light[50],"fill-secondary":r.secondary.light[1e3],"fill-tertiary":r.tertiary.light[1e3],"fill-error-strong":r.red.light[1e3],"fill-error-weak":r.red.light[50],"fill-warning-strong":r.amber.light[1e3],"fill-warning-weak":r.amber.light[50],"fill-success-strong":r.green.light[1e3],"fill-success-weak":r.green.light[50],"fill-information-strong":r.purple.light[1e3],"fill-information-weak":r.purple.light[50],"fill-flipdishlogo":r.solid.lightGrey[1e3],"fill-black":r.solid.grey[1e3],"fill-white":r.solid.grey[0],"fill-yellow":r.solid.yellow[1e3],"fill-lightgrey":r.solid.lightGrey[1e3],"fill-lime":r.solid.lime[1e3],"fill-pink":r.solid.pink[1e3]},background:{"background-base":r.solid.grey[0],"background-raised":r.solid.grey[0],"background-overlay":r.solid.grey[0],"background-sunken":r.solid.grey[50],"background-alternate":r.solid.lightGrey[1e3],"background-primary":r.primary.light[1e3],"background-secondary":r.secondary.light[1e3],"background-tertiary":r.tertiary.light[1e3]},shadow:{"shadow-strong":r.greyShadow[150],"shadow-weak":r.greyShadow[100]}}}};export{i as colours,r as primativeColours};
|
|
2
|
+
//# sourceMappingURL=colours.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colours.js","sources":["../../../src/themes/tokens/colours.ts"],"sourcesContent":["import type { ThemeOptions } from '@mui/material/styles/createTheme';\nimport { alpha, type PaletteColor } from '@mui/material/styles';\n\nexport interface SimplePaletteColourOptions extends Partial<PaletteColor> {\n main: string;\n light?: string;\n dark?: string;\n}\n\nexport type LightDarkPrimitives<T> = {\n light: T;\n // Not used yet\n // dark: T;\n};\n\nexport type GreyPrimitives = {\n 1000: string;\n 700: string;\n 500: string;\n 100: string;\n 50: string;\n 25: string;\n};\n\nexport type PrimaryPrimitives = {\n 1000: string;\n 800: string;\n 200: string;\n 50: string;\n};\n\nexport type SinglePrimitive = {\n 1000: string;\n};\n\nexport type SystemPrimitives = {\n 1000: string;\n 800: string;\n 200: string;\n 50: string;\n};\n\nexport type SolidGreyPrimitives = {\n 1000: string;\n 900: string;\n 850: string;\n 800: string;\n 50: string;\n 0: string;\n};\n\nexport type PrimativeColours = {\n grey: LightDarkPrimitives<GreyPrimitives>;\n primary: LightDarkPrimitives<PrimaryPrimitives>;\n secondary: LightDarkPrimitives<SinglePrimitive>;\n tertiary: LightDarkPrimitives<SinglePrimitive>;\n red: LightDarkPrimitives<SystemPrimitives>;\n amber: LightDarkPrimitives<SystemPrimitives>;\n green: LightDarkPrimitives<SystemPrimitives>;\n purple: LightDarkPrimitives<SystemPrimitives>;\n solid: {\n grey: SolidGreyPrimitives;\n yellow: SinglePrimitive;\n lightGrey: SinglePrimitive;\n lime: SinglePrimitive;\n pink: SinglePrimitive;\n };\n greyShadow: {\n 150: string;\n 100: string;\n };\n};\n\nexport const primativeColours: PrimativeColours = {\n grey: {\n light: {\n 1000: alpha('#000000', 0.9),\n 700: alpha('#000000', 0.6),\n 500: alpha('#000000', 0.45),\n 100: alpha('#000000', 0.1),\n 50: alpha('#000000', 0.04),\n 25: alpha('#000000', 0.02),\n },\n },\n primary: {\n light: {\n 1000: '#095FB0',\n 800: alpha('#095FB0', 0.8),\n 200: alpha('#095FB0', 0.2),\n 50: alpha('#095FB0', 0.05),\n },\n },\n secondary: {\n light: {\n 1000: '#A5E2F6',\n },\n },\n tertiary: {\n light: {\n 1000: '#F7742B',\n },\n },\n red: {\n light: {\n 1000: '#B80022',\n 800: alpha('#B80022', 0.8),\n 200: alpha('#B80022', 0.2),\n 50: alpha('#B80022', 0.05),\n },\n },\n amber: {\n light: {\n 1000: '#825900',\n 800: alpha('#825900', 0.8),\n 200: alpha('#825900', 0.2),\n 50: alpha('#825900', 0.05),\n },\n },\n green: {\n light: {\n 1000: '#006E3E',\n 800: alpha('#006E3E', 0.8),\n 200: alpha('#006E3E', 0.2),\n 50: alpha('#006E3E', 0.05),\n },\n },\n purple: {\n light: {\n 1000: '#8C0BD6',\n 800: alpha('#8C0BD6', 0.8),\n 200: alpha('#8C0BD6', 0.2),\n 50: alpha('#8C0BD6', 0.05),\n },\n },\n solid: {\n grey: {\n 1000: '#000000',\n 900: '#1A1A1A',\n 850: '#262626',\n 800: '#333333',\n 50: '#FAFAFA ',\n 0: '#FFFFFF',\n },\n yellow: {\n 1000: '#FFBC2C',\n },\n lightGrey: {\n 1000: '#EEEBE9',\n },\n lime: {\n 1000: '#CFF27D',\n },\n pink: {\n 1000: '#FFBAE4',\n },\n },\n greyShadow: {\n 150: alpha('#000000', 0.15),\n 100: alpha('#000000', 0.1),\n },\n};\n\nexport const colours: ThemeOptions['palette'] = {\n // Status colours\n success: {\n main: primativeColours.green.light['1000'],\n },\n error: {\n main: primativeColours.red.light['1000'],\n },\n warning: {\n main: primativeColours.solid.yellow['1000'],\n },\n // Colour tokens (semantic colours) are a way of naming and organising primitive colours based on how they're used.\n semantic: {\n light: {\n text: {\n 'text-strong': primativeColours.grey.light['1000'],\n 'text-weak': primativeColours.grey.light['700'],\n 'text-primary': primativeColours.primary.light['1000'],\n 'text-disabled': primativeColours.grey.light['100'],\n 'text-error': primativeColours.red.light['1000'],\n 'text-warning': primativeColours.amber.light['1000'],\n 'text-success': primativeColours.green.light['1000'],\n 'text-information': primativeColours.purple.light['1000'],\n // 'text-inverse-strong': '';\n // 'text-inverse-weak': ';\n // 'text-inverse-disabled': ';\n },\n stroke: {\n 'stroke-strong': primativeColours.grey.light['500'],\n 'stroke-weak': primativeColours.grey.light['100'],\n 'stroke-selected': primativeColours.primary.light['1000'],\n 'stroke-focus': primativeColours.primary.light['1000'],\n 'stroke-disabled': primativeColours.grey.light['100'],\n 'stroke-primary-strong': primativeColours.primary.light['800'],\n 'stroke-primary-weak': primativeColours.primary.light['200'],\n 'stroke-secondary': primativeColours.secondary.light['1000'],\n 'stroke-tertiary': primativeColours.tertiary.light['1000'],\n 'stroke-error-strong': primativeColours.red.light['800'],\n 'stroke-error-weak': primativeColours.red.light['200'],\n 'stroke-warning-strong': primativeColours.amber.light['800'],\n 'stroke-warning-weak': primativeColours.amber.light['200'],\n 'stroke-success-strong': primativeColours.green.light['800'],\n 'stroke-success-weak': primativeColours.green.light['200'],\n 'stroke-information-strong': primativeColours.purple.light['800'],\n 'stroke-information-weak': primativeColours.purple.light['200'],\n // 'stroke-inverse-strong': '',\n // 'stroke-inverse-weak': '',\n // 'stroke-inverse-disabled': '',\n },\n icon: {\n 'icon-strong': primativeColours.grey.light['500'],\n 'icon-primary': primativeColours.primary.light['800'],\n 'icon-disabled': primativeColours.grey.light['100'],\n 'icon-error': primativeColours.red.light['800'],\n 'icon-warning': primativeColours.amber.light['800'],\n 'icon-success': primativeColours.green.light['800'],\n 'icon-information': primativeColours.purple.light['800'],\n // 'icon-inverse': '',\n // 'icon-inverse-strong': '',\n // 'icon-inverse-disabled': '',\n },\n fill: {\n 'fill-strong': primativeColours.grey.light['1000'],\n 'fill-weak': primativeColours.grey.light['50'],\n 'fill-weaker': primativeColours.grey.light['25'],\n 'fill-hover': primativeColours.grey.light['50'],\n 'fill-press': primativeColours.grey.light['100'],\n 'fill-selected': primativeColours.primary.light['1000'],\n 'fill-disabled': primativeColours.grey.light['100'],\n 'fill-overlay': primativeColours.grey.light['500'],\n 'fill-primary-strong': primativeColours.primary.light['1000'],\n 'fill-primary-weak': primativeColours.primary.light['50'],\n 'fill-secondary': primativeColours.secondary.light['1000'],\n 'fill-tertiary': primativeColours.tertiary.light['1000'],\n 'fill-error-strong': primativeColours.red.light['1000'],\n 'fill-error-weak': primativeColours.red.light['50'],\n 'fill-warning-strong': primativeColours.amber.light['1000'],\n 'fill-warning-weak': primativeColours.amber.light['50'],\n 'fill-success-strong': primativeColours.green.light['1000'],\n 'fill-success-weak': primativeColours.green.light['50'],\n 'fill-information-strong': primativeColours.purple.light['1000'],\n 'fill-information-weak': primativeColours.purple.light['50'],\n // 'fill-inverse-strong': '',\n // 'fill-inverse-weak': '',\n // 'fill-inverse-hover': '',\n // 'fill-inverse-press': '',\n // 'fill-inverse-disabled': '',\n 'fill-flipdishlogo': primativeColours.solid.lightGrey['1000'],\n 'fill-black': primativeColours.solid.grey['1000'],\n 'fill-white': primativeColours.solid.grey['0'],\n 'fill-yellow': primativeColours.solid.yellow['1000'],\n 'fill-lightgrey': primativeColours.solid.lightGrey['1000'],\n 'fill-lime': primativeColours.solid.lime['1000'],\n 'fill-pink': primativeColours.solid.pink['1000'],\n },\n background: {\n 'background-base': primativeColours.solid.grey['0'],\n 'background-raised': primativeColours.solid.grey['0'],\n 'background-overlay': primativeColours.solid.grey['0'],\n 'background-sunken': primativeColours.solid.grey['50'],\n 'background-alternate': primativeColours.solid.lightGrey['1000'],\n 'background-primary': primativeColours.primary.light['1000'],\n 'background-secondary': primativeColours.secondary.light['1000'],\n 'background-tertiary': primativeColours.tertiary.light['1000'],\n // 'background-inverse': '',\n },\n shadow: {\n 'shadow-strong': primativeColours.greyShadow['150'],\n 'shadow-weak': primativeColours.greyShadow['100'],\n },\n },\n },\n};\n"],"names":["primativeColours","grey","light","alpha","primary","secondary","tertiary","red","amber","green","purple","solid","yellow","lightGrey","lime","pink","greyShadow","colours","success","main","error","warning","semantic","text","stroke","icon","fill","background","shadow"],"mappings":"6CAyEa,MAAAA,EAAqC,CAC9CC,KAAM,CACFC,MAAO,CACH,IAAMC,EAAM,UAAW,IACvB,IAAKA,EAAM,UAAW,IACtB,IAAKA,EAAM,UAA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AuBF,EAAiBM,SAASJ,MAAM,MAG3D0B,OAAQ,CACJ,gBAAiB5B,EAAiBgB,WAAW,KAC7C,cAAehB,EAAiBgB,WAAW"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";exports.typography={body1:{fontFamily:"'Roboto', sans-serif"},body2:{fontFamily:"'Roboto', sans-serif"},h1:{fontFamily:"clarendon-text-pro,Domine,serif"},h2:{fontFamily:"clarendon-text-pro,Domine,serif"},h3:{fontFamily:"clarendon-text-pro,Domine,serif"},h4:{fontFamily:"clarendon-text-pro,Domine,serif"},h5:{fontFamily:"clarendon-text-pro,Domine,serif"},h6:{fontFamily:"clarendon-text-pro,Domine,serif"}};
|
|
2
|
+
//# sourceMappingURL=typography.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.cjs.js","sources":["../../src/themes/typography.ts"],"sourcesContent":["import type { ThemeOptions } from '@mui/material/styles/createTheme';\n\nexport const typography: ThemeOptions['typography'] = {\n body1: {\n fontFamily: \"'Roboto', sans-serif\",\n },\n body2: {\n fontFamily: \"'Roboto', sans-serif\",\n },\n h1: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h2: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h3: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h4: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h5: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h6: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n};\n"],"names":["body1","fontFamily","body2","h1","h2","h3","h4","h5","h6"],"mappings":"gCAEsD,CAClDA,MAAO,CACHC,WAAY,wBAEhBC,MAAO,CACHD,WAAY,wBAEhBE,GAAI,CACAF,WAAY,mCAEhBG,GAAI,CACAH,WAAY,mCAEhBI,GAAI,CACAJ,WAAY,mCAEhBK,GAAI,CACAL,WAAY,mCAEhBM,GAAI,CACAN,WAAY,mCAEhBO,GAAI,CACAP,WAAY"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const o={body1:{fontFamily:"'Roboto', sans-serif"},body2:{fontFamily:"'Roboto', sans-serif"},h1:{fontFamily:"clarendon-text-pro,Domine,serif"},h2:{fontFamily:"clarendon-text-pro,Domine,serif"},h3:{fontFamily:"clarendon-text-pro,Domine,serif"},h4:{fontFamily:"clarendon-text-pro,Domine,serif"},h5:{fontFamily:"clarendon-text-pro,Domine,serif"},h6:{fontFamily:"clarendon-text-pro,Domine,serif"}};export{o as typography};
|
|
2
|
+
//# sourceMappingURL=typography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.js","sources":["../../src/themes/typography.ts"],"sourcesContent":["import type { ThemeOptions } from '@mui/material/styles/createTheme';\n\nexport const typography: ThemeOptions['typography'] = {\n body1: {\n fontFamily: \"'Roboto', sans-serif\",\n },\n body2: {\n fontFamily: \"'Roboto', sans-serif\",\n },\n h1: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h2: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h3: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h4: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h5: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n h6: {\n fontFamily: 'clarendon-text-pro,Domine,serif',\n },\n};\n"],"names":["typography","body1","fontFamily","body2","h1","h2","h3","h4","h5","h6"],"mappings":"AAEa,MAAAA,EAAyC,CAClDC,MAAO,CACHC,WAAY,wBAEhBC,MAAO,CACHD,WAAY,wBAEhBE,GAAI,CACAF,WAAY,mCAEhBG,GAAI,CACAH,WAAY,mCAEhBI,GAAI,CACAJ,WAAY,mCAEhBK,GAAI,CACAL,WAAY,mCAEhBM,GAAI,CACAN,WAAY,mCAEhBO,GAAI,CACAP,WAAY"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flipdish/portal-library",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
"@vitejs/plugin-react-swc": "3.8.1",
|
|
86
86
|
"chromatic": "^11.25.2",
|
|
87
87
|
"dotenv": "^16.4.5",
|
|
88
|
-
"eslint": "9.
|
|
88
|
+
"eslint": "9.23.0",
|
|
89
89
|
"eslint-plugin-react-hooks": "4.6.2",
|
|
90
90
|
"eslint-plugin-react-refresh": "0.4.19",
|
|
91
|
-
"eslint-plugin-storybook": "^0.
|
|
91
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
92
92
|
"jsdom": "24.1.3",
|
|
93
93
|
"lodash.debounce": "^4.0.8",
|
|
94
94
|
"prompt-sync": "^4.2.0",
|