@flipdish/portal-library 1.0.69 → 1.0.71
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 +2 -0
- package/dist/components/index.js +1 -1
- package/dist/components/ui/Chip/Chip.cjs.js +1 -1
- package/dist/components/ui/Chip/Chip.cjs.js.map +1 -1
- package/dist/components/ui/Chip/Chip.d.ts +7 -3
- package/dist/components/ui/Chip/Chip.js +1 -1
- package/dist/components/ui/Chip/Chip.js.map +1 -1
- package/dist/components/ui/PageLayout/PageLayout.cjs.js +1 -1
- package/dist/components/ui/PageLayout/PageLayout.cjs.js.map +1 -1
- package/dist/components/ui/PageLayout/PageLayout.d.ts +1 -0
- package/dist/components/ui/PageLayout/PageLayout.js +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"),i=require("./ui/NotFoundPage/NotFoundPage.cjs.js"),r=require("./ui/FlipdishStaffContainer/FlipdishStaffContainer.cjs.js"),t=require("./ui/PageLayout/PageLayout.cjs.js"),s=require("./ui/PortalMock/PortalMock.cjs.js"),o=require("./ui/LazyComponent/LazyComponent.cjs.js"),c=require("./ui/Spacer/Spacer.cjs.js"),u=require("./ui/Chip/Chip.cjs.js"),n=require("./ui/Switch/Switch.cjs.js"),a=require("./ui/Form/utilities/formValidation.cjs.js"),
|
|
1
|
+
"use strict";var e=require("./themes/flipdishPublicTheme.cjs.js"),i=require("./ui/NotFoundPage/NotFoundPage.cjs.js"),r=require("./ui/FlipdishStaffContainer/FlipdishStaffContainer.cjs.js"),t=require("./ui/PageLayout/PageLayout.cjs.js"),s=require("./ui/PortalMock/PortalMock.cjs.js"),o=require("./ui/LazyComponent/LazyComponent.cjs.js"),c=require("./ui/Spacer/Spacer.cjs.js"),u=require("./ui/Chip/Chip.cjs.js"),n=require("./ui/Switch/Switch.cjs.js"),a=require("./ui/Form/utilities/formValidation.cjs.js"),l=require("./ui/Form/GenericAutocompleteField.cjs.js"),d=require("./ui/Form/GenericFormContainer.cjs.js"),p=require("./ui/Form/GenericTextField.cjs.js"),j=require("./ui/Form/PaginatedAutocompleteField.cjs.js"),m=require("./ui/GenericDatePickerField/GenericDatePickerField.cjs.js"),x=require("./ui/GenericDateTimePickerField/GenericDateTimePickerField.cjs.js"),q=require("./ui/GenericRadioButtons/GenericRadioButtons.cjs.js"),F=require("./ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.cjs.js"),T=require("./ui/GenericTable/GenericTable.cjs.js"),G=require("./ui/GenericTableBody/GenericTableBody.cjs.js"),L=require("./ui/GenericTableBodyRow/GenericTableBodyRow.cjs.js"),h=require("./ui/GenericTableTitle/GenericTableTitle.cjs.js"),P=require("./ui/ListItemLink/ListItemLink.cjs.js"),g=require("./ui/ListItemLinkButton/ListItemLinkButton.cjs.js"),b=require("./ui/NoResults/NoResults.cjs.js"),k=require("@mui/icons-material/Search"),I=require("@mui/icons-material/CalendarToday"),y=require("@mui/icons-material/AccessTime"),f=require("@mui/icons-material/Done"),B=require("./custom-hooks/useRenderValidText.cjs.js"),C=require("./custom-hooks/useMicroFrontendAttributes.cjs.js"),R=require("./renderUtilities/renderUtilities.cjs.js"),S=require("./genericUtilities/index.cjs.js");exports.flipdishPublicTheme=e,exports.NotFoundPage=i,exports.FlipdishStaffContainer=r,exports.PageLayout=t.default,exports.PortalMock=s,exports.LazyComponent=o,exports.Spacer=c,exports.Chip=u.default,exports.Switch=n,exports.formikValidate=a.formikValidate,exports.GenericAutocompleteField=l,exports.GenericFormContainer=d,exports.GenericTextField=p,exports.PaginatedAutocompleteField=j,exports.GenericDatePickerField=m,exports.GenericDateTimePickerField=x,exports.GenericRadioButtons=q,exports.DateTimeLocalizationProvider=F,exports.GenericTable=T,exports.GenericTableBody=G,exports.GenericTableBodyRow=L,exports.GenericTableTitle=h,exports.ListItemLink=P,exports.ListItemLinkButton=g.ListItemLinkButton,exports.NoResults=b,exports.SearchIcon=k,exports.CalendarTodayIcon=I,exports.AccessTimeIcon=y,exports.DoneIcon=f,exports.useRenderValidText=B,exports.useMicroFrontendAttributes=C,exports.getAppId=R.getAppId,exports.getBrandId=R.getBrandId,exports.getIsFlipdishStaff=R.getIsFlipdishStaff,exports.getMicroFrontendAttribute=R.getMicroFrontendAttribute,exports.getOrgId=R.getOrgId,exports.lazyWithRetry=R.lazyWithRetry,exports.debounce=S.debounce;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -26,6 +26,8 @@ export { default as ListItemLinkButton } from './ui/ListItemLinkButton/ListItemL
|
|
|
26
26
|
export { default as NoResults } from './ui/NoResults/NoResults.js';
|
|
27
27
|
export { default as SearchIcon } from '@mui/icons-material/Search';
|
|
28
28
|
export { default as CalendarTodayIcon } from '@mui/icons-material/CalendarToday';
|
|
29
|
+
export { default as AccessTimeIcon } from '@mui/icons-material/AccessTime';
|
|
30
|
+
export { default as DoneIcon } from '@mui/icons-material/Done';
|
|
29
31
|
export { default as useRenderValidText } from './custom-hooks/useRenderValidText.js';
|
|
30
32
|
export { default as useMicroFrontendAttributes } from './custom-hooks/useMicroFrontendAttributes.js';
|
|
31
33
|
export { getAppId, getBrandId, getIsFlipdishStaff, getMicroFrontendAttribute, getOrgId, lazyWithRetry } from './renderUtilities/renderUtilities.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 FlipdishStaffContainer}from"./ui/FlipdishStaffContainer/FlipdishStaffContainer.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";export{default as Switch}from"./ui/Switch/Switch.js";export{formikValidate}from"./ui/Form/utilities/formValidation.js";export{default as GenericAutocompleteField}from"./ui/Form/GenericAutocompleteField.js";export{default as GenericFormContainer}from"./ui/Form/GenericFormContainer.js";export{default as GenericTextField}from"./ui/Form/GenericTextField.js";export{default as PaginatedAutocompleteField}from"./ui/Form/PaginatedAutocompleteField.js";export{default as GenericDatePickerField}from"./ui/GenericDatePickerField/GenericDatePickerField.js";export{default as GenericDateTimePickerField}from"./ui/GenericDateTimePickerField/GenericDateTimePickerField.js";export{default as GenericRadioButtons}from"./ui/GenericRadioButtons/GenericRadioButtons.js";export{default as DateTimeLocalizationProvider}from"./ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.js";export{default as GenericTable}from"./ui/GenericTable/GenericTable.js";export{default as GenericTableBody}from"./ui/GenericTableBody/GenericTableBody.js";export{default as GenericTableBodyRow}from"./ui/GenericTableBodyRow/GenericTableBodyRow.js";export{default as GenericTableTitle}from"./ui/GenericTableTitle/GenericTableTitle.js";export{default as ListItemLink}from"./ui/ListItemLink/ListItemLink.js";export{ListItemLinkButton}from"./ui/ListItemLinkButton/ListItemLinkButton.js";export{default as NoResults}from"./ui/NoResults/NoResults.js";export{default as SearchIcon}from"@mui/icons-material/Search";export{default as CalendarTodayIcon}from"@mui/icons-material/CalendarToday";export{default as useRenderValidText}from"./custom-hooks/useRenderValidText.js";export{default as useMicroFrontendAttributes}from"./custom-hooks/useMicroFrontendAttributes.js";export{getAppId,getBrandId,getIsFlipdishStaff,getMicroFrontendAttribute,getOrgId,lazyWithRetry}from"./renderUtilities/renderUtilities.js";export{debounce}from"./genericUtilities/index.js";
|
|
1
|
+
export{default as flipdishPublicTheme}from"./themes/flipdishPublicTheme.js";export{default as NotFoundPage}from"./ui/NotFoundPage/NotFoundPage.js";export{default as FlipdishStaffContainer}from"./ui/FlipdishStaffContainer/FlipdishStaffContainer.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";export{default as Switch}from"./ui/Switch/Switch.js";export{formikValidate}from"./ui/Form/utilities/formValidation.js";export{default as GenericAutocompleteField}from"./ui/Form/GenericAutocompleteField.js";export{default as GenericFormContainer}from"./ui/Form/GenericFormContainer.js";export{default as GenericTextField}from"./ui/Form/GenericTextField.js";export{default as PaginatedAutocompleteField}from"./ui/Form/PaginatedAutocompleteField.js";export{default as GenericDatePickerField}from"./ui/GenericDatePickerField/GenericDatePickerField.js";export{default as GenericDateTimePickerField}from"./ui/GenericDateTimePickerField/GenericDateTimePickerField.js";export{default as GenericRadioButtons}from"./ui/GenericRadioButtons/GenericRadioButtons.js";export{default as DateTimeLocalizationProvider}from"./ui/DateTimeLocalizationProvider/DateTimeLocalizationProvider.js";export{default as GenericTable}from"./ui/GenericTable/GenericTable.js";export{default as GenericTableBody}from"./ui/GenericTableBody/GenericTableBody.js";export{default as GenericTableBodyRow}from"./ui/GenericTableBodyRow/GenericTableBodyRow.js";export{default as GenericTableTitle}from"./ui/GenericTableTitle/GenericTableTitle.js";export{default as ListItemLink}from"./ui/ListItemLink/ListItemLink.js";export{ListItemLinkButton}from"./ui/ListItemLinkButton/ListItemLinkButton.js";export{default as NoResults}from"./ui/NoResults/NoResults.js";export{default as SearchIcon}from"@mui/icons-material/Search";export{default as CalendarTodayIcon}from"@mui/icons-material/CalendarToday";export{default as AccessTimeIcon}from"@mui/icons-material/AccessTime";export{default as DoneIcon}from"@mui/icons-material/Done";export{default as useRenderValidText}from"./custom-hooks/useRenderValidText.js";export{default as useMicroFrontendAttributes}from"./custom-hooks/useMicroFrontendAttributes.js";export{getAppId,getBrandId,getIsFlipdishStaff,getMicroFrontendAttribute,getOrgId,lazyWithRetry}from"./renderUtilities/renderUtilities.js";export{debounce}from"./genericUtilities/index.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("@mui/material/Chip"),
|
|
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 o=["filled","outlined"],t=(e,r,l)=>({blue:{filled:{backgroundColor:r.palette.flippyBlue.light,color:r.palette.flippyBlue.dark},outlined:{borderColor:r.palette.flippyBlue.dark,color:r.palette.flippyBlue.dark}},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]),a=l.styled(r,{shouldForwardProp:e=>"colour"!==e&&"rounded"!==e})((({theme:e,colour:r,rounded:l,variant:a=o[0]})=>({borderRadius:l?"100px":"5px","& .MuiChip-icon":{color:"inherit"},...t(r,e,a)})));exports.CHIP_VARIANTS=o,exports.default=({label:r,color:l="default",size:o="medium",variant:t="filled",icon:i,rounded:d=!0})=>e.jsx(a,{icon:i,label:r,colour:l,size:o,variant:t,rounded:d});
|
|
2
2
|
//# sourceMappingURL=Chip.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.cjs.js","sources":["../../../../src/components/ui/Chip/Chip.tsx"],"sourcesContent":["import MuiChip, { type ChipProps as MuiChipProps } from '@mui/material/Chip';\nimport { styled } from '@mui/material/styles';\n\nexport type ChipProps = {\n label: string;\n color?:
|
|
1
|
+
{"version":3,"file":"Chip.cjs.js","sources":["../../../../src/components/ui/Chip/Chip.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.flippyBlue.light,\n color: theme.palette.flippyBlue.dark,\n },\n outlined: {\n borderColor: theme.palette.flippyBlue.dark,\n color: theme.palette.flippyBlue.dark,\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","flippyBlue","light","color","dark","outlined","borderColor","success","main","warning","error","default","StyledChip","styled","MuiChip","shouldForwardProp","prop","rounded","borderRadius","label","size","icon","_jsx"],"mappings":"+KAMaA,EAAgB,CAAC,SAAU,YAkBlCC,EAAiB,CAACC,EAAmBC,EAAcC,KACpC,CACbC,KAAM,CACFC,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQC,WAAWC,MAC1CC,MAAOR,EAAMK,QAAQC,WAAWG,MAEpCC,SAAU,CACNC,YAAaX,EAAMK,QAAQC,WAAWG,KACtCD,MAAOR,EAAMK,QAAQC,WAAWG,OAGxCG,QAAS,CACLT,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQO,QAAQL,MACvCC,MAAOR,EAAMK,QAAQO,QAAQH,MAEjCC,SAAU,CACNC,YAAaX,EAAMK,QAAQO,QAAQC,KACnCL,MAAOR,EAAMK,QAAQO,QAAQC,OAGrCC,QAAS,CACLX,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQS,QAAQP,MACvCC,MAAOR,EAAMK,QAAQS,QAAQL,MAEjCC,SAAU,CACNC,YAAaX,EAAMK,QAAQS,QAAQD,KACnCL,MAAOR,EAAMK,QAAQS,QAAQL,OAGrCM,MAAO,CACHZ,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQU,MAAMR,MACrCC,MAAOR,EAAMK,QAAQU,MAAMN,MAE/BC,SAAU,CACNC,YAAaX,EAAMK,QAAQU,MAAMF,KACjCL,MAAOR,EAAMK,QAAQU,MAAMF,OAGnCG,QAAS,CACLb,OAAQ,CAAE,EACVO,SAAU,CAAE,IAIJX,GAAQE,IAGtBgB,EAAaC,EAAMA,OAACC,EAAS,CAC/BC,kBAAoBC,GAAkB,WAATA,GAA8B,YAATA,GADnCH,EAEC,EAAGlB,QAAOD,SAAQuB,UAASrB,UAAUJ,EAAc,OAAU,CAC7E0B,aAAcD,EAAU,QAAU,MAClC,kBAAmB,CACfd,MAAO,cAERV,EAAeC,EAAQC,EAAOC,+CAGxB,EAAGuB,QAAOhB,QAAQ,UAAWiB,OAAO,SAAUxB,UAAU,SAAUyB,OAAMJ,WAAU,KAC3FK,MAACV,EAAU,CAACS,KAAMA,EAAMF,MAAOA,EAAOzB,OAAQS,EAAOiB,KAAMA,EAAMxB,QAASA,EAASqB,QAASA"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ChipProps as ChipProps$1 } from '@mui/material/Chip';
|
|
3
3
|
|
|
4
|
+
declare const CHIP_COLORS: readonly ["default", "blue", "success", "warning", "error"];
|
|
5
|
+
type ChipColor = (typeof CHIP_COLORS)[number];
|
|
6
|
+
declare const CHIP_VARIANTS: readonly ["filled", "outlined"];
|
|
7
|
+
type ChipVariant = (typeof CHIP_VARIANTS)[number];
|
|
4
8
|
type ChipProps = {
|
|
5
9
|
label: string;
|
|
6
|
-
color?:
|
|
10
|
+
color?: ChipColor;
|
|
7
11
|
size?: ChipProps$1['size'];
|
|
8
|
-
variant?:
|
|
12
|
+
variant?: ChipVariant;
|
|
9
13
|
icon?: ChipProps$1['icon'];
|
|
10
14
|
rounded?: boolean;
|
|
11
15
|
};
|
|
12
16
|
declare const Chip: ({ label, color, size, variant, icon, rounded }: ChipProps) => react_jsx_runtime.JSX.Element;
|
|
13
17
|
|
|
14
|
-
export { type ChipProps, Chip as default };
|
|
18
|
+
export { CHIP_COLORS, CHIP_VARIANTS, type ChipColor, type ChipProps, type ChipVariant, Chip as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import r from"@mui/material/Chip";import{styled as l}from"@mui/material/styles";const o=["filled","outlined"],t=(e,r,l)=>({blue:{filled:{backgroundColor:r.palette.flippyBlue.light,color:r.palette.flippyBlue.dark},outlined:{borderColor:r.palette.flippyBlue.dark,color:r.palette.flippyBlue.dark}},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]),a=l(r,{shouldForwardProp:e=>"colour"!==e&&"rounded"!==e})((({theme:e,colour:r,rounded:l,variant:a=o[0]})=>({borderRadius:l?"100px":"5px","& .MuiChip-icon":{color:"inherit"},...t(r,e,a)}))),i=({label:r,color:l="default",size:o="medium",variant:t="filled",icon:i,rounded:d=!0})=>e(a,{icon:i,label:r,colour:l,size:o,variant:t,rounded:d});export{o as CHIP_VARIANTS,i as default};
|
|
2
2
|
//# sourceMappingURL=Chip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.js","sources":["../../../../src/components/ui/Chip/Chip.tsx"],"sourcesContent":["import MuiChip, { type ChipProps as MuiChipProps } from '@mui/material/Chip';\nimport { styled } from '@mui/material/styles';\n\nexport type ChipProps = {\n label: string;\n color?:
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../../../src/components/ui/Chip/Chip.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.flippyBlue.light,\n color: theme.palette.flippyBlue.dark,\n },\n outlined: {\n borderColor: theme.palette.flippyBlue.dark,\n color: theme.palette.flippyBlue.dark,\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","flippyBlue","light","color","dark","outlined","borderColor","success","main","warning","error","default","StyledChip","styled","MuiChip","shouldForwardProp","prop","rounded","borderRadius","Chip","label","size","icon","_jsx"],"mappings":"8HAMaA,EAAgB,CAAC,SAAU,YAkBlCC,EAAiB,CAACC,EAAmBC,EAAcC,KACpC,CACbC,KAAM,CACFC,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQC,WAAWC,MAC1CC,MAAOR,EAAMK,QAAQC,WAAWG,MAEpCC,SAAU,CACNC,YAAaX,EAAMK,QAAQC,WAAWG,KACtCD,MAAOR,EAAMK,QAAQC,WAAWG,OAGxCG,QAAS,CACLT,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQO,QAAQL,MACvCC,MAAOR,EAAMK,QAAQO,QAAQH,MAEjCC,SAAU,CACNC,YAAaX,EAAMK,QAAQO,QAAQC,KACnCL,MAAOR,EAAMK,QAAQO,QAAQC,OAGrCC,QAAS,CACLX,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQS,QAAQP,MACvCC,MAAOR,EAAMK,QAAQS,QAAQL,MAEjCC,SAAU,CACNC,YAAaX,EAAMK,QAAQS,QAAQD,KACnCL,MAAOR,EAAMK,QAAQS,QAAQL,OAGrCM,MAAO,CACHZ,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQU,MAAMR,MACrCC,MAAOR,EAAMK,QAAQU,MAAMN,MAE/BC,SAAU,CACNC,YAAaX,EAAMK,QAAQU,MAAMF,KACjCL,MAAOR,EAAMK,QAAQU,MAAMF,OAGnCG,QAAS,CACLb,OAAQ,CAAE,EACVO,SAAU,CAAE,IAIJX,GAAQE,IAGtBgB,EAAaC,EAAOC,EAAS,CAC/BC,kBAAoBC,GAAkB,WAATA,GAA8B,YAATA,GADnCH,EAEC,EAAGlB,QAAOD,SAAQuB,UAASrB,UAAUJ,EAAc,OAAU,CAC7E0B,aAAcD,EAAU,QAAU,MAClC,kBAAmB,CACfd,MAAO,cAERV,EAAeC,EAAQC,EAAOC,OAG/BuB,EAAO,EAAGC,QAAOjB,QAAQ,UAAWkB,OAAO,SAAUzB,UAAU,SAAU0B,OAAML,WAAU,KAC3FM,EAACX,EAAU,CAACU,KAAMA,EAAMF,MAAOA,EAAO1B,OAAQS,EAAOkB,KAAMA,EAAMzB,QAASA,EAASqB,QAASA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),t=require("@mui/icons-material/Add"),n=require("@mui/icons-material/ArrowBack"),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"),m=require("../FDErrorBoundary/FDErrorBoundary.cjs.js"),p=require("@mui/material/Button"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),t=require("@mui/icons-material/Add"),n=require("@mui/icons-material/ArrowBack"),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"),m=require("../FDErrorBoundary/FDErrorBoundary.cjs.js"),p=require("@mui/material/Button"),g=require("../../renderUtilities/renderUtilities.cjs.js"),h=require("../../../utilities/validation.cjs.js"),u=require("../Spacer/Spacer.cjs.js"),x=require("@mui/material/Box"),j=require("@mui/material/Divider");const y=1112,f=s.styled("div")((({theme:e,fluid:i})=>({maxWidth:i?"none":y,[e.breakpoints.down("md")]:{maxWidth:"none"},margin:e.spacing(2,4),position:"relative",minHeight:"100vh"}))),v=s.styled(r)((({theme:e})=>({[e.breakpoints.down("sm")]:{width:"100%",paddingTop:e.spacing(2)}}))),b=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)}))),B=s.styled(r)((()=>({flexGrow:1}))),q=s.styled("div")((({theme:e})=>({maxWidth:y,paddingBottom:e.spacing(3),[e.breakpoints.down("md")]:{paddingBottom:e.spacing(2),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}))),w=s.styled(a,{shouldForwardProp:e=>"hasTitleComponent"!==e})((({theme:e,hasTitleComponent:i})=>({margin:i?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)}}))),T=s.styled("div")((({theme:e})=>({maxWidth:y,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"}}))),W=s.styled(r)((()=>({display:"flex",flexGrow:1,justifyContent:"flex-end"}))),C=s.styled(o)((()=>({lineHeight:"26px"}))),A=s.styled(o)((()=>({fontWeight:"bold"}))),F=s.styled(j)((({theme:e})=>({marginBottom:e.spacing(4)}))),L=({title:i})=>e.jsx(A,{variant:"h5",component:"h2",children:i});exports.PageTitle=L,exports.default=a=>{const{actionBtnTitle:o,caption:j,children:y,contextButtons:A,documentTitle:P,fluid:I=!1,fullWidth:D,header:R,hideHeader:z,actionButtonLink:H,openLinkInNewTab:_=!1,pageHeader:E,showActionButton:G,showAddIcon:M,title:U,titleComponent:S,toPrevious:N,toParent:O,strictToParent:Q,navigate:$,hideDivider:J=!1,customActionButtons:K,useAlternateBackground:V=!1,titleComponentAfter:X}=a,Y=s.useTheme(),Z=d(Y.breakpoints.down("md"));i.useEffect((()=>(V&&(document.body.style.backgroundColor=Y.palette.alternateBackground.main),()=>{V&&(document.body.style.backgroundColor=Y.palette.white.main)})),[V]);const ee=g.getMicroFrontendAttribute("data-portal-base-url")||"/",ie=H?.startsWith("https://"),te=ie?H:void 0!==H?h.joinUrlPaths(ee,H):"";return e.jsxs(f,{fluid:I,children:[P&&e.jsx(l,{children:P}),E||null,e.jsxs(T,{children:[E&&e.jsx(u,{size:16,variant:"vertical"}),!z&&e.jsxs(e.Fragment,{children:[e.jsxs(b,{container:!0,alignItems:"center",direction:"column",children:[e.jsx(r,{item:!0,container:!0,direction:"row",alignContent:"space-between",children:e.jsx(W,{item:!0,children:A&&A.map(((i,t)=>e.jsx("div",{children:i},t)))})}),e.jsxs(k,{item:!0,container:!0,children:[(O||N)&&e.jsx(x,{children:e.jsx(w,{"aria-label":"Back","data-testid":"back_button",hasTitleComponent:!!S,component:"button",onClick:()=>{N?$(-1):O&&Q||O&&history.length<3?$(O):$(-1)},children:e.jsx(n,{})})}),e.jsxs(B,{item:!0,children:[S?e.jsx(S,{}):e.jsx(e.Fragment,{children:e.jsxs(x,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(L,{title:U}),X]})}),j&&e.jsx(C,{variant:"caption",component:"h3",children:j})]}),G&&e.jsxs(e.Fragment,{children:[Z&&e.jsx(u,{size:56,variant:"vertical"}),e.jsx(v,{item:!0,children:e.jsxs(p,{variant:"contained",fullWidth:!0,"data-testid":`Action-button-${o}`,href:_||ie?te:"",target:_?"_blank":void 0,rel:_?"noopener noreferrer":void 0,onClick:_||ie?()=>{}:()=>$(H),children:[M&&e.jsx(t,{}),o]})})]}),K&&K.map(((i,t)=>e.jsxs("div",{children:[Z&&e.jsx(u,{size:56,variant:"vertical"}),!Z&&e.jsx(u,{size:16,variant:"vertical"}),e.jsx(v,{item:!0,children:i})]},t)))]})]}),!J&&e.jsx(F,{})]}),e.jsxs(c,{fullWidth:D,children:[R?e.jsx(q,{children:R}):null,e.jsx(m,{identifier:P,children:e.jsx(e.Fragment,{children:y})})]})]})]})},exports.maxWidth=y;
|
|
2
2
|
//# sourceMappingURL=PageLayout.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.cjs.js","sources":["../../../../src/components/ui/PageLayout/PageLayout.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode, useEffect } 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 { getMicroFrontendAttribute } from '../../renderUtilities';\nimport { joinUrlPaths } from '../../../utilities/validation';\nimport Spacer from '../Spacer/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 margin: 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 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\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 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};\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 } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n useEffect(() => {\n if (useAlternateBackground) {\n document.body.style.backgroundColor = theme.palette.alternateBackground.main;\n }\n\n return () => {\n if (useAlternateBackground) {\n document.body.style.backgroundColor = theme.palette.white.main;\n }\n };\n }, [useAlternateBackground]);\n\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 <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons && contextButtons.map((button, index) => <div key={index}>{button}</div>)}\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 <ArrowBackIcon />\n </StyledBackButton>\n </Box>\n )}\n\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}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons &&\n customActionButtons.map((button, index) => (\n <div key={index}>\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}>\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","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","only","marginLeft","StyledInnerWrapper","marginRight","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","useAlternateBackground","useTheme","isMobile","useMediaQuery","useEffect","document","body","style","backgroundColor","palette","alternateBackground","main","white","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","jsx","DocumentTitle","Spacer","size","_Fragment","container","direction","item","alignContent","map","button","index","Box","onClick","history","length","ArrowBackIcon","jsxs","Button","href","target","rel","Add","FullWidthContainer","FDErrorBoundary","identifier"],"mappings":"0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AACzB,EAAgB,CAAA4B,SAAEO,IAA6B,KAC1DV,EAAAA,IAACsE,EAAe,CAACC,WAAY/D,EACzBL,SAAAH,MAAAkD,EAAAA,SAAA,CAAA/C,SAAGA,cAKrB"}
|
|
1
|
+
{"version":3,"file":"PageLayout.cjs.js","sources":["../../../../src/components/ui/PageLayout/PageLayout.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode, useEffect } 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 { getMicroFrontendAttribute } from '../../renderUtilities';\nimport { joinUrlPaths } from '../../../utilities/validation';\nimport Spacer from '../Spacer/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 margin: 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 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\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};\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 } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n useEffect(() => {\n if (useAlternateBackground) {\n document.body.style.backgroundColor = theme.palette.alternateBackground.main;\n }\n\n return () => {\n if (useAlternateBackground) {\n document.body.style.backgroundColor = theme.palette.white.main;\n }\n };\n }, [useAlternateBackground]);\n\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 <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons && contextButtons.map((button, index) => <div key={index}>{button}</div>)}\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 <ArrowBackIcon />\n </StyledBackButton>\n </Box>\n )}\n\n <StyledTitleSection item>\n {TitleComponent ? (\n <TitleComponent />\n ) : (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n </>\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={!openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}}\n >\n {showAddIcon && <Add />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons &&\n customActionButtons.map((button, index) => (\n <div key={index}>\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}>\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","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","only","marginLeft","StyledInnerWrapper","marginRight","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","useAlternateBackground","titleComponentAfter","useTheme","isMobile","useMediaQuery","useEffect","document","body","style","backgroundColor","palette","alternateBackground","main","white","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","jsx","DocumentTitle","Spacer","size","_Fragment","container","direction","item","alignContent","map","button","index","Box","onClick","history","length","ArrowBackIcon","jsxs","Fragment","gap","Button","href","target","rel","Add","FullWidthContainer","FDErrorBoundary","identifier"],"mappings":"0vBAwBO,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,GACzBC,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,GAC7Be,YAAapB,EAAMK,QAAQ,GAC3BgB,aAAcrB,EAAMK,QAAQ,QAI9BiB,EAAmBvB,EAAMA,OAACwB,EAAY,CACxCC,kBAAoBC,GAAkB,sBAATA,GADR1B,EAG0B,EAAGC,Q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Y5B,MAACiD,EAAM,CAACC,KAAM,GAAIjD,QAAQ,cACrC2B,GAAY5B,EAAA+C,IAACE,EAAO,CAAAC,KAAM,GAAIjD,QAAQ,aACxCD,EAAAA,IAACpC,GAAuB0F,MAAI,EAAAnD,SAAEsD,MAHxBC,YAQxBnC,GAAevB,EAAC+C,IAAApD,EAAoB,OAG9CmD,EAAAA,KAAC0B,EAAmB,CAAA/D,UAAWA,EAASN,SAAA,CACnCO,EAASV,MAACzB,EAAgB,CAAA4B,SAAEO,IAA6B,KAC1DV,EAAAA,IAACyE,EAAe,CAACC,WAAYlE,EACzBL,SAAAH,MAAAmD,EAAAA,SAAA,CAAAhD,SAAGA,cAKrB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as i,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect as e}from"react";import r from"@mui/icons-material/Add";import
|
|
1
|
+
import{jsxs as i,jsx as t,Fragment as n}from"react/jsx-runtime";import{useEffect as e}from"react";import r from"@mui/icons-material/Add";import a from"@mui/icons-material/ArrowBack";import o from"@mui/material/Grid";import m from"@mui/material/IconButton";import{styled as d,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/FDErrorBoundary.js";import u from"@mui/material/Button";import{getMicroFrontendAttribute as f}from"../../renderUtilities/renderUtilities.js";import{joinUrlPaths as v}from"../../../utilities/validation.js";import b from"../Spacer/Spacer.js";import k from"@mui/material/Box";import x from"@mui/material/Divider";const B=1112,y=d("div")((({theme:i,fluid:t})=>({maxWidth:t?"none":B,[i.breakpoints.down("md")]:{maxWidth:"none"},margin:i.spacing(2,4),position:"relative",minHeight:"100vh"}))),w=d(o)((({theme:i})=>({[i.breakpoints.down("sm")]:{width:"100%",paddingTop:i.spacing(2)}}))),T=d(o)((({theme:i})=>({flexWrap:"nowrap",alignItems:"flex-start",paddingTop:i.spacing(3),paddingBottom:i.spacing(3),[i.breakpoints.down("md")]:{paddingTop:i.spacing(2),paddingBottom:i.spacing(3)}}))),W=d(o)((({theme:i})=>({paddingTop:i.spacing(2)}))),C=d(o)((()=>({flexGrow:1}))),L=d("div")((({theme:i})=>({maxWidth:B,paddingBottom:i.spacing(3),[i.breakpoints.down("md")]:{paddingBottom:i.spacing(2),paddingLeft:i.spacing(2),paddingRight:i.spacing(2)}}))),j=d(m,{shouldForwardProp:i=>"hasTitleComponent"!==i})((({theme:i,hasTitleComponent:t})=>({margin:t?i.spacing(-.75,2,-1.5,-1.5):i.spacing(-1.5,2,-1.5,-1.5),[i.breakpoints.only("sm")]:{marginLeft:i.spacing(-2)},[i.breakpoints.only("xs")]:{marginLeft:i.spacing(-2)}}))),A=d("div")((({theme:i})=>({maxWidth:B,marginLeft:i.spacing(6),marginRight:i.spacing(4),paddingBottom:i.spacing(2),[i.breakpoints.only("md")]:{marginLeft:12,marginRight:i.spacing(3)},[i.breakpoints.only("sm")]:{marginLeft:i.spacing(3),marginRight:i.spacing(3),maxWidth:"none"},[i.breakpoints.only("xs")]:{marginLeft:i.spacing(2),marginRight:i.spacing(2),maxWidth:"none"}}))),I=d(o)((()=>({display:"flex",flexGrow:1,justifyContent:"flex-end"}))),D=d(c)((()=>({lineHeight:"26px"}))),R=d(c)((()=>({fontWeight:"bold"}))),z=d(x)((({theme:i})=>({marginBottom:i.spacing(4)}))),F=({title:i})=>t(R,{variant:"h5",component:"h2",children:i}),H=m=>{const{actionBtnTitle:d,caption:c,children:x,contextButtons:B,documentTitle:R,fluid:H=!1,fullWidth:P,header:G,hideHeader:E,actionButtonLink:S,openLinkInNewTab:U=!1,pageHeader:_,showActionButton:M,showAddIcon:N,title:Q,titleComponent:$,toPrevious:q,toParent:J,strictToParent:K,navigate:O,hideDivider:V=!1,customActionButtons:X,useAlternateBackground:Y=!1,titleComponentAfter:Z}=m,ii=l(),ti=p(ii.breakpoints.down("md"));e((()=>(Y&&(document.body.style.backgroundColor=ii.palette.alternateBackground.main),()=>{Y&&(document.body.style.backgroundColor=ii.palette.white.main)})),[Y]);const ni=f("data-portal-base-url")||"/",ei=S?.startsWith("https://"),ri=ei?S:void 0!==S?v(ni,S):"";return i(y,{fluid:H,children:[R&&t(s,{children:R}),_||null,i(A,{children:[_&&t(b,{size:16,variant:"vertical"}),!E&&i(n,{children:[i(T,{container:!0,alignItems:"center",direction:"column",children:[t(o,{item:!0,container:!0,direction:"row",alignContent:"space-between",children:t(I,{item:!0,children:B&&B.map(((i,n)=>t("div",{children:i},n)))})}),i(W,{item:!0,container:!0,children:[(J||q)&&t(k,{children:t(j,{"aria-label":"Back","data-testid":"back_button",hasTitleComponent:!!$,component:"button",onClick:()=>{q?O(-1):J&&K||J&&history.length<3?O(J):O(-1)},children:t(a,{})})}),i(C,{item:!0,children:[$?t($,{}):t(n,{children:i(k,{display:"flex",alignItems:"center",gap:2,children:[t(F,{title:Q}),Z]})}),c&&t(D,{variant:"caption",component:"h3",children:c})]}),M&&i(n,{children:[ti&&t(b,{size:56,variant:"vertical"}),t(w,{item:!0,children:i(u,{variant:"contained",fullWidth:!0,"data-testid":`Action-button-${d}`,href:U||ei?ri:"",target:U?"_blank":void 0,rel:U?"noopener noreferrer":void 0,onClick:U||ei?()=>{}:()=>O(S),children:[N&&t(r,{}),d]})})]}),X&&X.map(((n,e)=>i("div",{children:[ti&&t(b,{size:56,variant:"vertical"}),!ti&&t(b,{size:16,variant:"vertical"}),t(w,{item:!0,children:n})]},e)))]})]}),!V&&t(z,{})]}),i(h,{fullWidth:P,children:[G?t(L,{children:G}):null,t(g,{identifier:R,children:t(n,{children:x})})]})]})]})};export{F as PageTitle,H as default,B as maxWidth};
|
|
2
2
|
//# sourceMappingURL=PageLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.js","sources":["../../../../src/components/ui/PageLayout/PageLayout.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode, useEffect } 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 { getMicroFrontendAttribute } from '../../renderUtilities';\nimport { joinUrlPaths } from '../../../utilities/validation';\nimport Spacer from '../Spacer/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 margin: 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 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\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 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};\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 } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n useEffect(() => {\n if (useAlternateBackground) {\n document.body.style.backgroundColor = theme.palette.alternateBackground.main;\n }\n\n return () => {\n if (useAlternateBackground) {\n document.body.style.backgroundColor = theme.palette.white.main;\n }\n };\n }, [useAlternateBackground]);\n\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 <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons && contextButtons.map((button, index) => <div key={index}>{button}</div>)}\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 <ArrowBackIcon />\n </StyledBackButton>\n </Box>\n )}\n\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}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons &&\n customActionButtons.map((button, index) => (\n <div key={index}>\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}>\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","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","only","marginLeft","StyledInnerWrapper","marginRight","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","PageLayout","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","useAlternateBackground","useTheme","isMobile","useMediaQuery","useEffect","document","body","style","backgroundColor","palette","alternateBackground","main","white","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","Spacer","size","_Fragment","container","direction","item","alignContent","map","button","index","Box","onClick","history","length","ArrowBackIcon","Button","href","target","rel","Add","FullWidthContainer","FDErrorBoundary","identifier"],"mappings":"+yBAwBO,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,GACzBC,SAAU,WACVC,UAAW,YAGTC,EAAyBT,EAAOU,EAAPV,EAAa,E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AAY5B,EAACgD,EAAO,CAAAC,KAAM,GAAIhD,QAAQ,aACvCD,EAACpC,EAAuB,CAAAyF,iBACpBP,EAACiB,GACG9D,QAAQ,YACRS,WAAW,gBACE,iBAAiBJ,IAC9B0D,KAAMlD,GAAoB2B,GAAwBE,GAAwB,GAC1EsB,OAAQnD,EAAmB,cAAW8B,EACtCsB,IAAKpD,EAAmB,2BAAwB8B,EAChDe,QAAU7C,GAAqB2B,GAA2D,OAAnC,IAAMlB,EAASV,GAA4BV,SAAA,CAEjGc,GAAejB,EAACmE,EAAG,CAAA,GACnB7D,UAKhBmB,GACGA,EAAoB8B,KAAI,CAACC,EAAQC,IAC7BX,mBACKlB,IAAY5B,EAACgD,EAAM,CAACC,KAAM,GAAIhD,QAAQ,cACrC2B,IAAY5B,EAACgD,EAAO,CAAAC,KAAM,GAAIhD,QAAQ,aACxCD,EAACpC,GAAuByF,MAAI,EAAAlD,SAAEqD,MAHxBC,YAQxBjC,GAAexB,EAACL,EAAoB,OAG9CmD,EAACsB,EAAmB,CAAA1D,UAAWA,EAASP,SAAA,CACnCQ,EAASX,EAACzB,EAAgB,CAAA4B,SAAEQ,IAA6B,KAC1DX,EAACqE,EAAe,CAACC,WAAY7D,EACzBN,SAAAH,EAAAkD,EAAA,CAAA/C,SAAGA,cAKrB"}
|
|
1
|
+
{"version":3,"file":"PageLayout.js","sources":["../../../../src/components/ui/PageLayout/PageLayout.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode, useEffect } 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 { getMicroFrontendAttribute } from '../../renderUtilities';\nimport { joinUrlPaths } from '../../../utilities/validation';\nimport Spacer from '../Spacer/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 margin: 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 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\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};\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 } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n useEffect(() => {\n if (useAlternateBackground) {\n document.body.style.backgroundColor = theme.palette.alternateBackground.main;\n }\n\n return () => {\n if (useAlternateBackground) {\n document.body.style.backgroundColor = theme.palette.white.main;\n }\n };\n }, [useAlternateBackground]);\n\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 <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons && contextButtons.map((button, index) => <div key={index}>{button}</div>)}\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 <ArrowBackIcon />\n </StyledBackButton>\n </Box>\n )}\n\n <StyledTitleSection item>\n {TitleComponent ? (\n <TitleComponent />\n ) : (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n </>\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={!openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}}\n >\n {showAddIcon && <Add />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons &&\n customActionButtons.map((button, index) => (\n <div key={index}>\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}>\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","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","only","marginLeft","StyledInnerWrapper","marginRight","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","PageLayout","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","useAlternateBackground","titleComponentAfter","useTheme","isMobile","useMediaQuery","useEffect","document","body","style","backgroundColor","palette","alternateBackground","main","white","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","Spacer","size","_Fragment","container","direction","item","alignContent","map","button","index","Box","onClick","history","length","ArrowBackIcon","gap","Button","href","target","rel","Add","FullWidthContainer","FDErrorBoundary","identifier"],"mappings":"+yBAwBO,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,GACzBC,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,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