@flipdish/portal-library 1.0.24 → 1.0.26
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/index.cjs.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/themes/flipdishPublicTheme.cjs.js +1 -1
- package/dist/components/themes/flipdishPublicTheme.cjs.js.map +1 -1
- package/dist/components/themes/flipdishPublicTheme.js +1 -1
- package/dist/components/themes/flipdishPublicTheme.js.map +1 -1
- package/dist/components/ui/Chip/Chip.cjs.js +2 -0
- package/dist/components/ui/Chip/Chip.cjs.js.map +1 -0
- package/dist/components/ui/Chip/Chip.d.ts +14 -0
- package/dist/components/ui/Chip/Chip.js +2 -0
- package/dist/components/ui/Chip/Chip.js.map +1 -0
- package/dist/components/ui/PageLayout/PageLayout.cjs.js.map +1 -1
- package/dist/components/ui/PageLayout/PageLayout.d.ts +1 -1
- package/dist/components/ui/PageLayout/PageLayout.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./themes/flipdishPublicTheme.cjs.js"),
|
|
1
|
+
"use strict";var e=require("./themes/flipdishPublicTheme.cjs.js"),r=require("./ui/NotFoundPage/NotFoundPage.cjs.js"),o=require("./ui/PageLayout/PageLayout.cjs.js"),s=require("./ui/PortalMock/PortalMock.cjs.js"),i=require("./ui/LazyComponent/LazyComponent.cjs.js"),t=require("./ui/Spacer/Spacer.cjs.js"),u=require("./ui/Chip/Chip.cjs.js");exports.flipdishPublicTheme=e,exports.NotFoundPage=r,exports.PageLayout=o.default,exports.PortalMock=s,exports.LazyComponent=i,exports.Spacer=t,exports.Chip=u;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -4,3 +4,4 @@ export { default as PageLayout } from './ui/PageLayout/PageLayout.js';
|
|
|
4
4
|
export { default as PortalMock } from './ui/PortalMock/PortalMock.js';
|
|
5
5
|
export { default as LazyComponent } from './ui/LazyComponent/LazyComponent.js';
|
|
6
6
|
export { default as Spacer } from './ui/Spacer/Spacer.js';
|
|
7
|
+
export { default as Chip } from './ui/Chip/Chip.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as flipdishPublicTheme}from"./themes/flipdishPublicTheme.js";export{default as NotFoundPage}from"./ui/NotFoundPage/NotFoundPage.js";export{default as PageLayout}from"./ui/PageLayout/PageLayout.js";export{default as PortalMock}from"./ui/PortalMock/PortalMock.js";export{default as LazyComponent}from"./ui/LazyComponent/LazyComponent.js";export{default as Spacer}from"./ui/Spacer/Spacer.js";
|
|
1
|
+
export{default as flipdishPublicTheme}from"./themes/flipdishPublicTheme.js";export{default as NotFoundPage}from"./ui/NotFoundPage/NotFoundPage.js";export{default as PageLayout}from"./ui/PageLayout/PageLayout.js";export{default as PortalMock}from"./ui/PortalMock/PortalMock.js";export{default as LazyComponent}from"./ui/LazyComponent/LazyComponent.js";export{default as Spacer}from"./ui/Spacer/Spacer.js";export{default as Chip}from"./ui/Chip/Chip.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@mui/material/styles/createTheme");const o=e({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"}},palette:{success:{main:"#20C26E",dark:"#137442",light:"#D2F3E2"},error:{main:"#CA0030",dark:"#79001D",light:"#FADBE2"},warning:{main:"#FFBC2C",dark:"#FF7A00",light:"#FFF2D5"}}}),
|
|
1
|
+
"use strict";var e=require("@mui/material/styles/createTheme");const o=e({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"}},palette:{success:{main:"#20C26E",dark:"#137442",light:"#D2F3E2"},error:{main:"#CA0030",dark:"#79001D",light:"#FADBE2"},warning:{main:"#FFBC2C",dark:"#FF7A00",light:"#FFF2D5"}}}),t=e(o,{palette:{black:o.palette.augmentColor({color:{main:"#000000"},name:"black"}),white:o.palette.augmentColor({color:{main:"#ffffff"},name:"white"}),flippyBlue:o.palette.augmentColor({color:{main:"#0b75d7",light:"#e3f2fe"},name:"flippyBlue"}),freezerBurn:o.palette.augmentColor({color:{main:"#a5e2f6"},name:"freezerBurn"}),spricyCarrot:o.palette.augmentColor({color:{main:"#f7742b"},name:"spricyCarrot"}),pebble:o.palette.augmentColor({color:{main:"#eeebe3"},name:"pebble"}),donutPanic:o.palette.augmentColor({color:{main:"#ffbae4"},name:"donutPanic"}),eletricLime:o.palette.augmentColor({color:{main:"#cff27d"},name:"eletricLime"}),pending:o.palette.augmentColor({color:{main:"#DEACFA",dark:"#A56AC6",light:"#FCF7FE"},name:"pending"})}});var r=e(t,{palette:{primary:{main:t.palette.flippyBlue.main},secondary:{main:t.palette.spricyCarrot.main}},shape:{borderRadius:"4px"},components:{MuiButton:{styleOverrides:{root:{padding:"12px 24px",textTransform:"none"}}},MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:"#999999"}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:"#eaf2ff"},"&:not(:last-child)":{borderBottom:`1px solid ${t.palette.divider}`}}}}}});module.exports=r;
|
|
2
2
|
//# sourceMappingURL=flipdishPublicTheme.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flipdishPublicTheme.cjs.js","sources":["../../../src/components/themes/flipdishPublicTheme.ts"],"sourcesContent":["import { Breakpoint } from '@mui/material/styles';\nimport createTheme, { ThemeOptions } from '@mui/material/styles/createTheme';\n\n// Colours and fonts as per our brand guidelines\nconst fontTheme = createTheme({\n 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 palette: {\n success: {\n main: '#20C26E',\n dark: '#137442',\n light: '#D2F3E2',\n },\n error: {\n main: '#CA0030',\n dark: '#79001D',\n light: '#FADBE2',\n },\n warning: {\n main: '#FFBC2C',\n dark: '#FF7A00',\n light: '#FFF2D5',\n },\n },\n});\n\nconst theme = createTheme(fontTheme as ThemeOptions, {\n palette: {\n // Primary\n black: fontTheme.palette.augmentColor({\n color: {\n main: '#000000',\n },\n name: 'black',\n }),\n white: fontTheme.palette.augmentColor({\n color: {\n main: '#ffffff',\n },\n name: 'white',\n }),\n flippyBlue: fontTheme.palette.augmentColor({\n color: {\n main: '#0b75d7',\n },\n name: 'flippyBlue',\n }),\n // Core\n freezerBurn: fontTheme.palette.augmentColor({\n color: {\n main: '#a5e2f6',\n },\n name: 'freezerBurn',\n }),\n spricyCarrot: fontTheme.palette.augmentColor({\n color: {\n main: '#f7742b',\n },\n name: 'spricyCarrot',\n }),\n pebble: fontTheme.palette.augmentColor({\n color: {\n main: '#eeebe3',\n },\n name: 'pebble',\n }),\n // Secondary\n donutPanic: fontTheme.palette.augmentColor({\n color: {\n main: '#ffbae4',\n },\n name: 'donutPanic',\n }),\n eletricLime: fontTheme.palette.augmentColor({\n color: {\n main: '#cff27d',\n },\n name: 'eletricLime',\n }),\n pending: fontTheme.palette.augmentColor({\n color: {\n main: '#DEACFA',\n dark: '#A56AC6',\n light: '#FCF7FE',\n },\n name: 'pending',\n }),\n },\n});\n\nexport default createTheme(theme as ThemeOptions, {\n palette: {\n primary: {\n main: theme.palette.flippyBlue.main,\n },\n secondary: {\n main: theme.palette.spricyCarrot.main,\n },\n },\n components: {\n MuiButton: {\n styleOverrides: {\n root: {\n padding: '
|
|
1
|
+
{"version":3,"file":"flipdishPublicTheme.cjs.js","sources":["../../../src/components/themes/flipdishPublicTheme.ts"],"sourcesContent":["import { Breakpoint } from '@mui/material/styles';\nimport createTheme, { ThemeOptions } from '@mui/material/styles/createTheme';\n\n// Colours and fonts as per our brand guidelines\nconst fontTheme = createTheme({\n 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 palette: {\n success: {\n main: '#20C26E',\n dark: '#137442',\n light: '#D2F3E2',\n },\n error: {\n main: '#CA0030',\n dark: '#79001D',\n light: '#FADBE2',\n },\n warning: {\n main: '#FFBC2C',\n dark: '#FF7A00',\n light: '#FFF2D5',\n },\n },\n});\n\nconst theme = createTheme(fontTheme as ThemeOptions, {\n palette: {\n // Primary\n black: fontTheme.palette.augmentColor({\n color: {\n main: '#000000',\n },\n name: 'black',\n }),\n white: fontTheme.palette.augmentColor({\n color: {\n main: '#ffffff',\n },\n name: 'white',\n }),\n flippyBlue: fontTheme.palette.augmentColor({\n color: {\n main: '#0b75d7',\n light: '#e3f2fe',\n },\n name: 'flippyBlue',\n }),\n // Core\n freezerBurn: fontTheme.palette.augmentColor({\n color: {\n main: '#a5e2f6',\n },\n name: 'freezerBurn',\n }),\n spricyCarrot: fontTheme.palette.augmentColor({\n color: {\n main: '#f7742b',\n },\n name: 'spricyCarrot',\n }),\n pebble: fontTheme.palette.augmentColor({\n color: {\n main: '#eeebe3',\n },\n name: 'pebble',\n }),\n // Secondary\n donutPanic: fontTheme.palette.augmentColor({\n color: {\n main: '#ffbae4',\n },\n name: 'donutPanic',\n }),\n eletricLime: fontTheme.palette.augmentColor({\n color: {\n main: '#cff27d',\n },\n name: 'eletricLime',\n }),\n pending: fontTheme.palette.augmentColor({\n color: {\n main: '#DEACFA',\n dark: '#A56AC6',\n light: '#FCF7FE',\n },\n name: 'pending',\n }),\n },\n});\n\nexport default createTheme(theme as ThemeOptions, {\n palette: {\n primary: {\n main: theme.palette.flippyBlue.main,\n },\n secondary: {\n main: theme.palette.spricyCarrot.main,\n },\n },\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: '#999999',\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: '#eaf2ff',\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${theme.palette.divider}`,\n },\n },\n },\n },\n },\n});\n\ndeclare module '@mui/material/styles' {\n interface Palette {\n black: Palette['primary'];\n white: Palette['primary'];\n flippyBlue: Palette['primary'];\n freezerBurn: Palette['primary'];\n spricyCarrot: Palette['primary'];\n pebble: Palette['primary'];\n donutPanic: Palette['primary'];\n eletricLime: Palette['primary'];\n pending: Palette['primary'];\n }\n interface Theme {\n breakpoints: {\n up: (key: number | Breakpoint) => string;\n down: (key: number | Breakpoint) => string;\n only: (key: number | Breakpoint) => string;\n };\n }\n}\n"],"names":["fontTheme","createTheme","typography","body1","fontFamily","body2","h1","h2","h3","h4","h5","h6","palette","success","main","dark","light","error","warning","theme","black","augmentColor","color","name","white","flippyBlue","freezerBurn","spricyCarrot","pebble","donutPanic","eletricLime","pending","flipdishPublicTheme","primary","secondary","shape","borderRadius","components","MuiButton","styleOverrides","root","padding","textTransform","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","MuiChip","fontWeight","MuiListItemButton","backgroundColor","borderBottom","divider"],"mappings":"+DAIA,MAAMA,EAAYC,EAAY,CAC1BC,WAAY,CACRC,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,oCAGpBQ,QAAS,CACLC,QAAS,CACLC,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXC,MAAO,CACHH,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXE,QAAS,CACLJ,KAAM,UACNC,KAAM,UACNC,MAAO,cAKbG,EAAQlB,EAAYD,EAA2B,CACjDY,QAAS,CAELQ,MAAOpB,EAAUY,QAAQS,aAAa,CAClCC,MAAO,CACHR,KAAM,WAEVS,KAAM,UAEVC,MAAOxB,EAAUY,QAAQS,aAAa,CAClCC,MAAO,CACHR,KAAM,WAEVS,KAAM,UAEVE,WAAYzB,EAAUY,QAAQS,aAAa,CACvCC,MAAO,CACHR,KAAM,UACNE,MAAO,WAEXO,KAAM,eAGVG,YAAa1B,EAAUY,QAAQS,aAAa,CACxCC,MAAO,CACHR,KAAM,WAEVS,KAAM,gBAEVI,aAAc3B,EAAUY,QAAQS,aAAa,CACzCC,MAAO,CACHR,KAAM,WAEVS,KAAM,iBAEVK,OAAQ5B,EAAUY,QAAQS,aAAa,CACnCC,MAAO,CACHR,KAAM,WAEVS,KAAM,WAGVM,WAAY7B,EAAUY,QAAQS,aAAa,CACvCC,MAAO,CACHR,KAAM,WAEVS,KAAM,eAEVO,YAAa9B,EAAUY,QAAQS,aAAa,CACxCC,MAAO,CACHR,KAAM,WAEVS,KAAM,gBAEVQ,QAAS/B,EAAUY,QAAQS,aAAa,CACpCC,MAAO,CACHR,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXO,KAAM,eAKlB,IAAeS,EAAA/B,EAAYkB,EAAuB,CAC9CP,QAAS,CACLqB,QAAS,CACLnB,KAAMK,EAAMP,QAAQa,WAAWX,MAEnCoB,UAAW,CACPpB,KAAMK,EAAMP,QAAQe,aAAab,OAGzCqB,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,YAAa,aAIzBC,QAAS,CACLT,eAAgB,CACZC,KAAM,CACFS,WAAY,UAIxBC,kBAAmB,CACfX,eAAgB,CACZC,KAAM,CACF,UAAW,CACPW,gBAAiB,WAErB,qBAAsB,CAClBC,aAAc,aAAajC,EAAMP,QAAQyC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@mui/material/styles/createTheme";const o=e({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"}},palette:{success:{main:"#20C26E",dark:"#137442",light:"#D2F3E2"},error:{main:"#CA0030",dark:"#79001D",light:"#FADBE2"},warning:{main:"#FFBC2C",dark:"#FF7A00",light:"#FFF2D5"}}}),
|
|
1
|
+
import e from"@mui/material/styles/createTheme";const o=e({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"}},palette:{success:{main:"#20C26E",dark:"#137442",light:"#D2F3E2"},error:{main:"#CA0030",dark:"#79001D",light:"#FADBE2"},warning:{main:"#FFBC2C",dark:"#FF7A00",light:"#FFF2D5"}}}),t=e(o,{palette:{black:o.palette.augmentColor({color:{main:"#000000"},name:"black"}),white:o.palette.augmentColor({color:{main:"#ffffff"},name:"white"}),flippyBlue:o.palette.augmentColor({color:{main:"#0b75d7",light:"#e3f2fe"},name:"flippyBlue"}),freezerBurn:o.palette.augmentColor({color:{main:"#a5e2f6"},name:"freezerBurn"}),spricyCarrot:o.palette.augmentColor({color:{main:"#f7742b"},name:"spricyCarrot"}),pebble:o.palette.augmentColor({color:{main:"#eeebe3"},name:"pebble"}),donutPanic:o.palette.augmentColor({color:{main:"#ffbae4"},name:"donutPanic"}),eletricLime:o.palette.augmentColor({color:{main:"#cff27d"},name:"eletricLime"}),pending:o.palette.augmentColor({color:{main:"#DEACFA",dark:"#A56AC6",light:"#FCF7FE"},name:"pending"})}});var r=e(t,{palette:{primary:{main:t.palette.flippyBlue.main},secondary:{main:t.palette.spricyCarrot.main}},shape:{borderRadius:"4px"},components:{MuiButton:{styleOverrides:{root:{padding:"12px 24px",textTransform:"none"}}},MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:"#999999"}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:"#eaf2ff"},"&:not(:last-child)":{borderBottom:`1px solid ${t.palette.divider}`}}}}}});export{r as default};
|
|
2
2
|
//# sourceMappingURL=flipdishPublicTheme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flipdishPublicTheme.js","sources":["../../../src/components/themes/flipdishPublicTheme.ts"],"sourcesContent":["import { Breakpoint } from '@mui/material/styles';\nimport createTheme, { ThemeOptions } from '@mui/material/styles/createTheme';\n\n// Colours and fonts as per our brand guidelines\nconst fontTheme = createTheme({\n 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 palette: {\n success: {\n main: '#20C26E',\n dark: '#137442',\n light: '#D2F3E2',\n },\n error: {\n main: '#CA0030',\n dark: '#79001D',\n light: '#FADBE2',\n },\n warning: {\n main: '#FFBC2C',\n dark: '#FF7A00',\n light: '#FFF2D5',\n },\n },\n});\n\nconst theme = createTheme(fontTheme as ThemeOptions, {\n palette: {\n // Primary\n black: fontTheme.palette.augmentColor({\n color: {\n main: '#000000',\n },\n name: 'black',\n }),\n white: fontTheme.palette.augmentColor({\n color: {\n main: '#ffffff',\n },\n name: 'white',\n }),\n flippyBlue: fontTheme.palette.augmentColor({\n color: {\n main: '#0b75d7',\n },\n name: 'flippyBlue',\n }),\n // Core\n freezerBurn: fontTheme.palette.augmentColor({\n color: {\n main: '#a5e2f6',\n },\n name: 'freezerBurn',\n }),\n spricyCarrot: fontTheme.palette.augmentColor({\n color: {\n main: '#f7742b',\n },\n name: 'spricyCarrot',\n }),\n pebble: fontTheme.palette.augmentColor({\n color: {\n main: '#eeebe3',\n },\n name: 'pebble',\n }),\n // Secondary\n donutPanic: fontTheme.palette.augmentColor({\n color: {\n main: '#ffbae4',\n },\n name: 'donutPanic',\n }),\n eletricLime: fontTheme.palette.augmentColor({\n color: {\n main: '#cff27d',\n },\n name: 'eletricLime',\n }),\n pending: fontTheme.palette.augmentColor({\n color: {\n main: '#DEACFA',\n dark: '#A56AC6',\n light: '#FCF7FE',\n },\n name: 'pending',\n }),\n },\n});\n\nexport default createTheme(theme as ThemeOptions, {\n palette: {\n primary: {\n main: theme.palette.flippyBlue.main,\n },\n secondary: {\n main: theme.palette.spricyCarrot.main,\n },\n },\n components: {\n MuiButton: {\n styleOverrides: {\n root: {\n padding: '
|
|
1
|
+
{"version":3,"file":"flipdishPublicTheme.js","sources":["../../../src/components/themes/flipdishPublicTheme.ts"],"sourcesContent":["import { Breakpoint } from '@mui/material/styles';\nimport createTheme, { ThemeOptions } from '@mui/material/styles/createTheme';\n\n// Colours and fonts as per our brand guidelines\nconst fontTheme = createTheme({\n 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 palette: {\n success: {\n main: '#20C26E',\n dark: '#137442',\n light: '#D2F3E2',\n },\n error: {\n main: '#CA0030',\n dark: '#79001D',\n light: '#FADBE2',\n },\n warning: {\n main: '#FFBC2C',\n dark: '#FF7A00',\n light: '#FFF2D5',\n },\n },\n});\n\nconst theme = createTheme(fontTheme as ThemeOptions, {\n palette: {\n // Primary\n black: fontTheme.palette.augmentColor({\n color: {\n main: '#000000',\n },\n name: 'black',\n }),\n white: fontTheme.palette.augmentColor({\n color: {\n main: '#ffffff',\n },\n name: 'white',\n }),\n flippyBlue: fontTheme.palette.augmentColor({\n color: {\n main: '#0b75d7',\n light: '#e3f2fe',\n },\n name: 'flippyBlue',\n }),\n // Core\n freezerBurn: fontTheme.palette.augmentColor({\n color: {\n main: '#a5e2f6',\n },\n name: 'freezerBurn',\n }),\n spricyCarrot: fontTheme.palette.augmentColor({\n color: {\n main: '#f7742b',\n },\n name: 'spricyCarrot',\n }),\n pebble: fontTheme.palette.augmentColor({\n color: {\n main: '#eeebe3',\n },\n name: 'pebble',\n }),\n // Secondary\n donutPanic: fontTheme.palette.augmentColor({\n color: {\n main: '#ffbae4',\n },\n name: 'donutPanic',\n }),\n eletricLime: fontTheme.palette.augmentColor({\n color: {\n main: '#cff27d',\n },\n name: 'eletricLime',\n }),\n pending: fontTheme.palette.augmentColor({\n color: {\n main: '#DEACFA',\n dark: '#A56AC6',\n light: '#FCF7FE',\n },\n name: 'pending',\n }),\n },\n});\n\nexport default createTheme(theme as ThemeOptions, {\n palette: {\n primary: {\n main: theme.palette.flippyBlue.main,\n },\n secondary: {\n main: theme.palette.spricyCarrot.main,\n },\n },\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: '#999999',\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: '#eaf2ff',\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${theme.palette.divider}`,\n },\n },\n },\n },\n },\n});\n\ndeclare module '@mui/material/styles' {\n interface Palette {\n black: Palette['primary'];\n white: Palette['primary'];\n flippyBlue: Palette['primary'];\n freezerBurn: Palette['primary'];\n spricyCarrot: Palette['primary'];\n pebble: Palette['primary'];\n donutPanic: Palette['primary'];\n eletricLime: Palette['primary'];\n pending: Palette['primary'];\n }\n interface Theme {\n breakpoints: {\n up: (key: number | Breakpoint) => string;\n down: (key: number | Breakpoint) => string;\n only: (key: number | Breakpoint) => string;\n };\n }\n}\n"],"names":["fontTheme","createTheme","typography","body1","fontFamily","body2","h1","h2","h3","h4","h5","h6","palette","success","main","dark","light","error","warning","theme","black","augmentColor","color","name","white","flippyBlue","freezerBurn","spricyCarrot","pebble","donutPanic","eletricLime","pending","flipdishPublicTheme","primary","secondary","shape","borderRadius","components","MuiButton","styleOverrides","root","padding","textTransform","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","MuiChip","fontWeight","MuiListItemButton","backgroundColor","borderBottom","divider"],"mappings":"gDAIA,MAAMA,EAAYC,EAAY,CAC1BC,WAAY,CACRC,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,oCAGpBQ,QAAS,CACLC,QAAS,CACLC,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXC,MAAO,CACHH,KAAM,UACNC,KAAM,UACNC,MAAO,WAEXE,QAAS,CACLJ,KAAM,UACNC,KAAM,UACNC,MAAO,cAKbG,EAAQlB,EAAYD,EA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AMP,QAAQyC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("@mui/material/Chip"),r=require("@mui/material/styles");const o=r.styled(l)((({theme:e,colour:l,rounded:r})=>({backgroundColor:"blue"===l?e.palette.flippyBlue.light:"default",borderRadius:r?"100px":"5px"}))),u=r.styled(l)((({theme:e,colour:l,rounded:r})=>({borderColor:"blue"===l?e.palette.flippyBlue.dark:"default",borderRadius:r?"100px":"5px"})));module.exports=({label:l,color:r="default",size:i="medium",variant:d="filled",icon:t,rounded:a=!0})=>"outlined"===d?e.jsx(u,{icon:t,label:l,colour:r,size:i,variant:"outlined",rounded:a}):e.jsx(o,{icon:t,label:l,colour:r,size:i,variant:"filled",rounded:a});
|
|
2
|
+
//# sourceMappingURL=Chip.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.cjs.js","sources":["../../../../src/components/ui/Chip/Chip.tsx"],"sourcesContent":["import MuiChip, { ChipProps as MuiChipProps } from '@mui/material/Chip';\nimport { styled } from '@mui/material/styles';\n\nexport type ChipProps = {\n label: string;\n color?: 'default' | 'blue';\n size?: MuiChipProps['size'];\n variant?: MuiChipProps['variant'];\n icon?: MuiChipProps['icon'];\n rounded?: boolean;\n};\n\nconst StyledFilledChip = styled(MuiChip)<{ colour: string; rounded: boolean }>(({ theme, colour, rounded }) => ({\n backgroundColor: colour === 'blue' ? theme.palette.flippyBlue.light : 'default',\n borderRadius: rounded ? '100px' : '5px',\n}));\n\nconst StyledOutlinedChip = styled(MuiChip)<{ colour: string; rounded: boolean }>(({ theme, colour, rounded }) => ({\n borderColor: colour === 'blue' ? theme.palette.flippyBlue.dark : 'default',\n borderRadius: rounded ? '100px' : '5px',\n}));\n\nconst Chip = ({ label, color = 'default', size = 'medium', variant = 'filled', icon = undefined, rounded = true }: ChipProps) => {\n if (variant === 'outlined') {\n return <StyledOutlinedChip icon={icon} label={label} colour={color} size={size} variant=\"outlined\" rounded={rounded} />;\n }\n return <StyledFilledChip icon={icon} label={label} colour={color} size={size} variant=\"filled\" rounded={rounded} />;\n};\n\nexport default Chip;\n"],"names":["StyledFilledChip","styled","MuiChip","theme","colour","rounded","backgroundColor","palette","flippyBlue","light","borderRadius","StyledOutlinedChip","borderColor","dark","label","color","size","variant","icon","_jsx"],"mappings":"kHAYA,MAAMA,EAAmBC,EAAMA,OAACC,EAAPD,EAAsD,EAAGE,QAAOC,SAAQC,cAAe,CAC5GC,gBAA4B,SAAXF,EAAoBD,EAAMI,QAAQC,WAAWC,MAAQ,UACtEC,aAAcL,EAAU,QAAU,UAGhCM,EAAqBV,EAAMA,OAACC,EAAPD,EAAsD,EAAGE,QAAOC,SAAQC,cAAe,CAC9GO,YAAwB,SAAXR,EAAoBD,EAAMI,QAAQC,WAAWK,KAAO,UACjEH,aAAcL,EAAU,QAAU,yBAGzB,EAAGS,QAAOC,QAAQ,UAAWC,OAAO,SAAUC,UAAU,SAAUC,OAAkBb,WAAU,KACvF,aAAZY,EACOE,EAAAA,IAACR,EAAkB,CAACO,KAAMA,EAAMJ,MAAOA,EAAOV,OAAQW,EAAOC,KAAMA,EAAMC,QAAQ,WAAWZ,QAASA,IAEzGc,EAAAA,IAACnB,EAAgB,CAACkB,KAAMA,EAAMJ,MAAOA,EAAOV,OAAQW,EAAOC,KAAMA,EAAMC,QAAQ,SAASZ,QAASA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ChipProps as ChipProps$1 } from '@mui/material/Chip';
|
|
3
|
+
|
|
4
|
+
type ChipProps = {
|
|
5
|
+
label: string;
|
|
6
|
+
color?: 'default' | 'blue';
|
|
7
|
+
size?: ChipProps$1['size'];
|
|
8
|
+
variant?: ChipProps$1['variant'];
|
|
9
|
+
icon?: ChipProps$1['icon'];
|
|
10
|
+
rounded?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const Chip: ({ label, color, size, variant, icon, rounded }: ChipProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { type ChipProps, Chip as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import o from"@mui/material/Chip";import{styled as l}from"@mui/material/styles";const r=l(o)((({theme:e,colour:o,rounded:l})=>({backgroundColor:"blue"===o?e.palette.flippyBlue.light:"default",borderRadius:l?"100px":"5px"}))),i=l(o)((({theme:e,colour:o,rounded:l})=>({borderColor:"blue"===o?e.palette.flippyBlue.dark:"default",borderRadius:l?"100px":"5px"}))),d=({label:o,color:l="default",size:d="medium",variant:t="filled",icon:u,rounded:a=!0})=>"outlined"===t?e(i,{icon:u,label:o,colour:l,size:d,variant:"outlined",rounded:a}):e(r,{icon:u,label:o,colour:l,size:d,variant:"filled",rounded:a});export{d as default};
|
|
2
|
+
//# sourceMappingURL=Chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../../../src/components/ui/Chip/Chip.tsx"],"sourcesContent":["import MuiChip, { ChipProps as MuiChipProps } from '@mui/material/Chip';\nimport { styled } from '@mui/material/styles';\n\nexport type ChipProps = {\n label: string;\n color?: 'default' | 'blue';\n size?: MuiChipProps['size'];\n variant?: MuiChipProps['variant'];\n icon?: MuiChipProps['icon'];\n rounded?: boolean;\n};\n\nconst StyledFilledChip = styled(MuiChip)<{ colour: string; rounded: boolean }>(({ theme, colour, rounded }) => ({\n backgroundColor: colour === 'blue' ? theme.palette.flippyBlue.light : 'default',\n borderRadius: rounded ? '100px' : '5px',\n}));\n\nconst StyledOutlinedChip = styled(MuiChip)<{ colour: string; rounded: boolean }>(({ theme, colour, rounded }) => ({\n borderColor: colour === 'blue' ? theme.palette.flippyBlue.dark : 'default',\n borderRadius: rounded ? '100px' : '5px',\n}));\n\nconst Chip = ({ label, color = 'default', size = 'medium', variant = 'filled', icon = undefined, rounded = true }: ChipProps) => {\n if (variant === 'outlined') {\n return <StyledOutlinedChip icon={icon} label={label} colour={color} size={size} variant=\"outlined\" rounded={rounded} />;\n }\n return <StyledFilledChip icon={icon} label={label} colour={color} size={size} variant=\"filled\" rounded={rounded} />;\n};\n\nexport default Chip;\n"],"names":["StyledFilledChip","styled","MuiChip","theme","colour","rounded","backgroundColor","palette","flippyBlue","light","borderRadius","StyledOutlinedChip","borderColor","dark","Chip","label","color","size","variant","icon","_jsx"],"mappings":"wHAYA,MAAMA,EAAmBC,EAAOC,EAAPD,EAAsD,EAAGE,QAAOC,SAAQC,cAAe,CAC5GC,gBAA4B,SAAXF,EAAoBD,EAAMI,QAAQC,WAAWC,MAAQ,UACtEC,aAAcL,EAAU,QAAU,UAGhCM,EAAqBV,EAAOC,EAAPD,EAAsD,EAAGE,QAAOC,SAAQC,cAAe,CAC9GO,YAAwB,SAAXR,EAAoBD,EAAMI,QAAQC,WAAWK,KAAO,UACjEH,aAAcL,EAAU,QAAU,UAGhCS,EAAO,EAAGC,QAAOC,QAAQ,UAAWC,OAAO,SAAUC,UAAU,SAAUC,OAAkBd,WAAU,KACvF,aAAZa,EACOE,EAACT,EAAkB,CAACQ,KAAMA,EAAMJ,MAAOA,EAAOX,OAAQY,EAAOC,KAAMA,EAAMC,QAAQ,WAAWb,QAASA,IAEzGe,EAACpB,EAAgB,CAACmB,KAAMA,EAAMJ,MAAOA,EAAOX,OAAQY,EAAOC,KAAMA,EAAMC,QAAQ,SAASb,QAASA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.cjs.js","sources":["../../../../src/components/ui/PageLayout/PageLayout.tsx"],"sourcesContent":["import React, { ComponentType, ReactNode } from 'react';\n\nimport Add from '@mui/icons-material/Add';\nimport ArrowBackIcon from '@mui/icons-material/ArrowBack';\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/FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { useTranslation } from '../../../providers/TranslationProvider';\nimport { getMicroFrontendAttribute } from '../../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../../utilities/validation';\nimport Spacer from '../Spacer/Spacer';\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 margin: theme.spacing(2, 4),\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst StyledBackButton = styled(IconButton)<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 0, -1.5, -1.5) : theme.spacing(-1.5, 0, -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\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <Typography variant=\"h5\" component=\"h2\">\n {title}\n </Typography>\n);\n\nexport type Props = {\n actionBtnTitle?: TranslationId;\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 strictToParent?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n toParent?: string;\n openLinkInNewTab?: boolean;\n navigate: (to: string | number) => void;\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 strictToParent,\n title,\n titleComponent: TitleComponent,\n toParent,\n navigate,\n } = props;\n const { translate } = useTranslation();\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const actionButtonLinkFinal = actionButtonWithHttps\n ? actionButtonLink\n : actionButtonLink !== undefined\n ? joinUrlPaths(baseUrl, actionButtonLink)\n : '';\n\n return (\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader ? pageHeader : null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n {toParent && (\n <Grid item>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n 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 <ArrowBackIcon />\n </StyledBackButton>\n </Grid>\n )}\n <StyledHeaderContainer item>{contextButtons && contextButtons.map((button) => <>{button}</>)}</StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n <StyledTitleSection item>\n {TitleComponent ? <TitleComponent /> : <PageTitle title={title} />}\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={!openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}}\n >\n {showAddIcon && <Add />}\n {actionBtnTitle && translate(actionBtnTitle)}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n </StyledTitleContainer>\n </StyledHeader>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n );\n};\n\nexport default PageLayout;\n"],"names":["maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","margin","spacing","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledBackButton","IconButton","hasTitleComponent","only","marginLeft","StyledInnerWrapper","marginRight","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","PageTitle","title","_jsx","variant","component","children","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","strictToParent","titleComponent","TitleComponent","toParent","navigate","translate","useTranslation","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","jsxs","Spacer","size","container","direction","item","alignContent","onClick","history","length","jsx","ArrowBackIcon","map","button","_Fragment","Button","href","target","rel","Add","FullWidthContainer","FDErrorBoundary","identifier","Fragment"],"mappings":"6tBAuBO,MAAMA,EAAW,KAGlBC,EAAgBC,EAAMA,OAAC,MAAPA,EAAkC,EA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,QAAQ,aACvCD,MAAC7B,EAAsB,CAACsE,MAAI,EAAAtC,SACxB+B,OAACiB,EAAM,CACHlD,QAAQ,YACRQ,WAAW,EAAI,cACF,iBAAiBJ,IAC9B+C,KAAMvC,GAAoBgB,EAAwBE,EAAwB,GAC1EsB,OAAQxC,EAAmB,cAAWmB,EACtCsB,IAAKzC,EAAmB,2BAAwBmB,EAChDW,QAAU9B,GAAqBgB,EAA2D,OAAnC,IAAMR,EAAST,GAA4BT,SAAA,CAEjGa,GAAehB,MAACuD,EAAM,CAAA,GACtBlD,GAAkBiB,EAAUjB,iBAQzD6B,EAAAA,KAACsB,EAAkB,CAAC/C,UAAWA,EAASN,SAAA,CACnCO,EAASV,MAAClB,EAAgB,CAAAqB,SAAEO,IAA6B,KAC1DV,MAACyD,EAAe,CAACC,WAAYlD,EAAaL,SACtCH,EAAG8C,IAAAI,EAAAS,SAAA,CAAAxD,SAAAA,cAKrB"}
|
|
1
|
+
{"version":3,"file":"PageLayout.cjs.js","sources":["../../../../src/components/ui/PageLayout/PageLayout.tsx"],"sourcesContent":["import React, { ComponentType, ReactNode } from 'react';\n\nimport Add from '@mui/icons-material/Add';\nimport ArrowBackIcon from '@mui/icons-material/ArrowBack';\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/FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { useTranslation } from '../../../providers/TranslationProvider';\nimport { getMicroFrontendAttribute } from '../../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../../utilities/validation';\nimport Spacer from '../Spacer/Spacer';\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 margin: theme.spacing(2, 4),\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst StyledBackButton = styled(IconButton)<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 0, -1.5, -1.5) : theme.spacing(-1.5, 0, -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\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <Typography variant=\"h5\" component=\"h2\">\n {title}\n </Typography>\n);\n\nexport type Props = {\n actionBtnTitle?: TranslationId;\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 strictToParent?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n toParent?: string;\n openLinkInNewTab?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n navigate: (to: any) => void;\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 strictToParent,\n title,\n titleComponent: TitleComponent,\n toParent,\n navigate,\n } = props;\n const { translate } = useTranslation();\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const actionButtonLinkFinal = actionButtonWithHttps\n ? actionButtonLink\n : actionButtonLink !== undefined\n ? joinUrlPaths(baseUrl, actionButtonLink)\n : '';\n\n return (\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader ? pageHeader : null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n {toParent && (\n <Grid item>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n 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 <ArrowBackIcon />\n </StyledBackButton>\n </Grid>\n )}\n <StyledHeaderContainer item>{contextButtons && contextButtons.map((button) => <>{button}</>)}</StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n <StyledTitleSection item>\n {TitleComponent ? <TitleComponent /> : <PageTitle title={title} />}\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={!openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}}\n >\n {showAddIcon && <Add />}\n {actionBtnTitle && translate(actionBtnTitle)}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n </StyledTitleContainer>\n </StyledHeader>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n );\n};\n\nexport default PageLayout;\n"],"names":["maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","margin","spacing","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledBackButton","IconButton","hasTitleComponent","only","marginLeft","StyledInnerWrapper","marginRight","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","PageTitle","title","_jsx","variant","component","children","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","strictToParent","titleComponent","TitleComponent","toParent","navigate","translate","useTranslation","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","jsxs","Spacer","size","container","direction","item","alignContent","onClick","history","length","jsx","ArrowBackIcon","map","button","_Fragment","Button","href","target","rel","Add","FullWidthContainer","FDErrorBoundary","identifier","Fragment"],"mappings":"6tBAuBO,MAAMA,EAAW,KAGlBC,EAAgBC,EAAMA,OAAC,MAAPA,EAAkC,EAAGC,QAAOC,YAAa,CAC3EJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,OAAQ,CAC5BN,SAAU,QAEdO,OAAQJ,EAAMK,QAAQ,EAAG,OAGvBC,EAAyBP,EAAAA,OAAOQ,EAAPR,EAAa,EAAGC,YAAa,CACxD,CAACA,EAAME,YAAYC,KAAK,OAAQ,CAC5BK,MAAO,OACPC,WAAYT,EAAMK,QAAQ,QAI5BK,EAAeX,EAAAA,OAAOQ,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,GAAehB,MAACuD,EAAM,CAAA,GACtBlD,GAAkBiB,EAAUjB,iBAQzD6B,EAAAA,KAACsB,EAAkB,CAAC/C,UAAWA,EAASN,SAAA,CACnCO,EAASV,MAAClB,EAAgB,CAAAqB,SAAEO,IAA6B,KAC1DV,MAACyD,EAAe,CAACC,WAAYlD,EAAaL,SACtCH,EAAG8C,IAAAI,EAAAS,SAAA,CAAAxD,SAAAA,cAKrB"}
|
|
@@ -20,7 +20,7 @@ type Props = {
|
|
|
20
20
|
titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;
|
|
21
21
|
toParent?: string;
|
|
22
22
|
openLinkInNewTab?: boolean;
|
|
23
|
-
navigate: (to:
|
|
23
|
+
navigate: (to: any) => void;
|
|
24
24
|
};
|
|
25
25
|
declare const PageLayout: (props: Props) => react_jsx_runtime.JSX.Element;
|
|
26
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.js","sources":["../../../../src/components/ui/PageLayout/PageLayout.tsx"],"sourcesContent":["import React, { ComponentType, ReactNode } from 'react';\n\nimport Add from '@mui/icons-material/Add';\nimport ArrowBackIcon from '@mui/icons-material/ArrowBack';\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/FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { useTranslation } from '../../../providers/TranslationProvider';\nimport { getMicroFrontendAttribute } from '../../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../../utilities/validation';\nimport Spacer from '../Spacer/Spacer';\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 margin: theme.spacing(2, 4),\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst StyledBackButton = styled(IconButton)<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 0, -1.5, -1.5) : theme.spacing(-1.5, 0, -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\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <Typography variant=\"h5\" component=\"h2\">\n {title}\n </Typography>\n);\n\nexport type Props = {\n actionBtnTitle?: TranslationId;\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 strictToParent?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n toParent?: string;\n openLinkInNewTab?: boolean;\n navigate: (to: string | number) => void;\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 strictToParent,\n title,\n titleComponent: TitleComponent,\n toParent,\n navigate,\n } = props;\n const { translate } = useTranslation();\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const actionButtonLinkFinal = actionButtonWithHttps\n ? actionButtonLink\n : actionButtonLink !== undefined\n ? joinUrlPaths(baseUrl, actionButtonLink)\n : '';\n\n return (\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader ? pageHeader : null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n {toParent && (\n <Grid item>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n 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 <ArrowBackIcon />\n </StyledBackButton>\n </Grid>\n )}\n <StyledHeaderContainer item>{contextButtons && contextButtons.map((button) => <>{button}</>)}</StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n <StyledTitleSection item>\n {TitleComponent ? <TitleComponent /> : <PageTitle title={title} />}\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={!openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}}\n >\n {showAddIcon && <Add />}\n {actionBtnTitle && translate(actionBtnTitle)}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n </StyledTitleContainer>\n </StyledHeader>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n );\n};\n\nexport default PageLayout;\n"],"names":["maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","margin","spacing","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledBackButton","IconButton","hasTitleComponent","only","marginLeft","StyledInnerWrapper","marginRight","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","PageTitle","title","_jsx","variant","component","children","PageLayout","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","strictToParent","titleComponent","TitleComponent","toParent","navigate","translate","useTranslation","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","Spacer","size","container","direction","item","alignContent","onClick","history","length","ArrowBackIcon","map","button","_Fragment","Button","href","target","rel","Add","FullWidthContainer","FDErrorBoundary","identifier"],"mappings":"+wBAuBO,MAAMA,EAAW,KAGlBC,EAAgBC,EAAO,MAAPA,EAAkC,EAAGC,QAAOC,YAAa,CAC3EJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,OAAQ,CAC5BN,SAAU,QAEdO,OAAQJ,EAAMK,QAAQ,EAAG,OAGvBC,EAAyBP,EAAOQ,EAAPR,EAAa,EAAGC,YAAa,CACxD,CAACA,EAAME,YAAYC,KAAK,OAAQ,CAC5BK,MAAO,OACPC,WAAYT,EAAMK,QAAQ,QAI5BK,EAAeX,EAAOQ,EAAPR,EAAa,EAAGC,YAAa,CAC9CW,SAAU,SACVC,WAAY,aACZH,WAAYT,EAAMK,QAAQ,GAC1BQ,cA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/components/ui/PageLayout/PageLayout.tsx"],"sourcesContent":["import React, { ComponentType, ReactNode } from 'react';\n\nimport Add from '@mui/icons-material/Add';\nimport ArrowBackIcon from '@mui/icons-material/ArrowBack';\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/FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { useTranslation } from '../../../providers/TranslationProvider';\nimport { getMicroFrontendAttribute } from '../../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../../utilities/validation';\nimport Spacer from '../Spacer/Spacer';\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 margin: theme.spacing(2, 4),\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst StyledBackButton = styled(IconButton)<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 0, -1.5, -1.5) : theme.spacing(-1.5, 0, -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\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <Typography variant=\"h5\" component=\"h2\">\n {title}\n </Typography>\n);\n\nexport type Props = {\n actionBtnTitle?: TranslationId;\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 strictToParent?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n toParent?: string;\n openLinkInNewTab?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n navigate: (to: any) => void;\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 strictToParent,\n title,\n titleComponent: TitleComponent,\n toParent,\n navigate,\n } = props;\n const { translate } = useTranslation();\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const actionButtonLinkFinal = actionButtonWithHttps\n ? actionButtonLink\n : actionButtonLink !== undefined\n ? joinUrlPaths(baseUrl, actionButtonLink)\n : '';\n\n return (\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader ? pageHeader : null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n {toParent && (\n <Grid item>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n 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 <ArrowBackIcon />\n </StyledBackButton>\n </Grid>\n )}\n <StyledHeaderContainer item>{contextButtons && contextButtons.map((button) => <>{button}</>)}</StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n <StyledTitleSection item>\n {TitleComponent ? <TitleComponent /> : <PageTitle title={title} />}\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={!openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}}\n >\n {showAddIcon && <Add />}\n {actionBtnTitle && translate(actionBtnTitle)}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n </StyledTitleContainer>\n </StyledHeader>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n );\n};\n\nexport default PageLayout;\n"],"names":["maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","margin","spacing","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledBackButton","IconButton","hasTitleComponent","only","marginLeft","StyledInnerWrapper","marginRight","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","PageTitle","title","_jsx","variant","component","children","PageLayout","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","strictToParent","titleComponent","TitleComponent","toParent","navigate","translate","useTranslation","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","Spacer","size","container","direction","item","alignContent","onClick","history","length","ArrowBackIcon","map","button","_Fragment","Button","href","target","rel","Add","FullWidthContainer","FDErrorBoundary","identifier"],"mappings":"+wBAuBO,MAAMA,EAAW,KAGlBC,EAAgBC,EAAO,MAAPA,EAAkC,EAAGC,QAAOC,YAAa,CAC3EJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,OAAQ,CAC5BN,SAAU,QAEdO,OAAQJ,EAAMK,QAAQ,EAAG,OAGvBC,EAAyBP,EAAOQ,EAAPR,EAAa,EAAGC,YAAa,CACxD,CAACA,EAAME,YAAYC,KAAK,OAAQ,CAC5BK,MAAO,OACPC,WAAYT,EAAMK,QAAQ,QAI5BK,EAAeX,EAAOQ,EAAPR,EAAa,EAAGC,YAAa,CAC9CW,SAAU,SACVC,WAAY,aACZH,WAAYT,EAAMK,QAAQ,GAC1BQ,cAAeb,EAAMK,QAAQ,GAE7B,CAACL,EAAME,YAAYC,KAAK,OAAQ,CAC5BM,WAAYT,EAAMK,QAAQ,GAC1BQ,cAAeb,EAAMK,QAAQ,QAI/BS,EAAuBf,EAAOQ,EAAPR,EAAa,EAAGC,YAAa,CACtDS,WAAYT,EAAMK,QAAQ,OAGxBU,EAAqBhB,EAAOQ,EAAPR,EAAa,KAAO,CAC3CiB,SAAU,MAGRC,EAAmBlB,EAAO,MAAPA,EAAc,EAAGC,YAAa,CACnDH,WACAgB,cAAeb,EAAMK,QAAQ,GAE7B,CAACL,EAAME,YAAYC,KAAK,OAAQ,CAC5BU,cAAeb,EAAMK,QAAQ,GAC7Ba,YAAalB,EAAMK,QAAQ,GAC3Bc,aAAcnB,EAAMK,QAAQ,QAK9Be,EAAmBrB,EAAOsB,EAAPtB,EAAmE,EAAGC,QAAOsB,wBAAyB,CAC3HlB,OAAQkB,EA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