@gen-epix/ui-client-common 4.6.0 → 4.6.1

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.
@@ -1,17 +1,19 @@
1
- import type {
2
- GenEpixUiClientCommonFooterTheme,
3
- GenEpixUiClientCommonNavbarTheme,
4
- GenEpixUiClientCommonTheme,
5
- } from '../models/theme.models';
1
+ /* eslint-disable @typescript-eslint/naming-convention */
2
+ import type { ApplicationBarActionsTheme } from '../components/ui/ApplicationBar/ApplicationBarActions';
3
+ import type { ApplicationBarNavigationMenuTheme } from '../components/ui/ApplicationBar/ApplicationBarNavigationMenu';
4
+ import type { ApplicationBarTheme } from '../components/ui/ApplicationBar/ApplicationBar';
5
+ import type { ApplicationFooterLinkSectionTheme } from '../components/ui/ApplicationFooter/ApplicationFooterLinkSection';
6
+ import type { ApplicationFooterLinkTheme } from '../components/ui/ApplicationFooter/ApplicationFooterLink';
7
+ import type { ApplicationFooterTheme } from '../components/ui/ApplicationFooter/ApplicationFooter';
6
8
 
7
9
  declare module '@mui/material/styles' {
8
10
  // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required to augment MUI's generic interface.
9
11
  interface Components<TTheme = unknown> {
10
- // eslint-disable-next-line @typescript-eslint/naming-convention
11
- GenEpixUiClientCommonFooter?: GenEpixUiClientCommonFooterTheme;
12
- // eslint-disable-next-line @typescript-eslint/naming-convention
13
- GenEpixUiClientCommonNavbar?: GenEpixUiClientCommonNavbarTheme;
12
+ GenEpixUiClientCommonApplicationBar?: ApplicationBarTheme;
13
+ GenEpixUiClientCommonApplicationBarActions?: ApplicationBarActionsTheme;
14
+ GenEpixUiClientCommonApplicationBarNavigationMenu?: ApplicationBarNavigationMenuTheme;
15
+ GenEpixUiClientCommonApplicationFooter?: ApplicationFooterTheme;
16
+ GenEpixUiClientCommonApplicationFooterLink?: ApplicationFooterLinkTheme;
17
+ GenEpixUiClientCommonApplicationFooterLinkSection?: ApplicationFooterLinkSectionTheme;
14
18
  }
15
-
16
- interface Theme extends GenEpixUiClientCommonTheme { }
17
19
  }
@@ -6,7 +6,10 @@ import { useTranslation as h } from "react-i18next";
6
6
  import g from "@mui/icons-material/Menu";
7
7
  // src/components/ui/ApplicationFooter/ApplicationFooterLink.tsx
8
8
  var _ = ({ children: e, href: n, onClick: r, ...a }) => {
9
- let s = o();
9
+ let s = o(), c = d(() => ({
10
+ color: s.palette.primary.contrastText,
11
+ ...s.components?.GenEpixUiClientCommonApplicationFooterLink ?? {}
12
+ }), [s]);
10
13
  return /* @__PURE__ */ m(t, {
11
14
  component: "li",
12
15
  ...a,
@@ -14,18 +17,22 @@ var _ = ({ children: e, href: n, onClick: r, ...a }) => {
14
17
  href: n,
15
18
  onClick: r,
16
19
  rel: "noreferrer",
17
- sx: { color: s.components.GenEpixUiClientCommonFooter.color },
20
+ sx: { color: c.color },
18
21
  target: "_blank",
19
22
  children: e
20
23
  }), !n && /* @__PURE__ */ p(i, {
21
24
  component: "button",
22
25
  onClick: r,
23
- sx: { color: s.components.GenEpixUiClientCommonFooter.color },
26
+ sx: { color: c.color },
24
27
  children: e
25
28
  })]
26
29
  });
27
30
  }, v = ({ children: e, header: n }) => {
28
- let r = o();
31
+ let r = o(), i = d(() => ({
32
+ color: r.palette.primary.contrastText,
33
+ sectionBorder: `1px solid ${r.palette.primary.contrastText}`,
34
+ ...r.components?.GenEpixUiClientCommonApplicationFooterLinkSection ?? {}
35
+ }), [r]);
29
36
  return s.forEach(e, (e) => {
30
37
  if (e?.type !== _) throw Error("ApplicationFooterLinkSection only accepts ApplicationFooterLink as children");
31
38
  }), /* @__PURE__ */ m(t, {
@@ -33,8 +40,8 @@ var _ = ({ children: e, href: n, onClick: r, ...a }) => {
33
40
  children: [/* @__PURE__ */ p(a, {
34
41
  component: "h2",
35
42
  sx: {
36
- borderBottom: `1px solid ${r.components.GenEpixUiClientCommonFooter.sectionBorderColor}`,
37
- color: r.components.GenEpixUiClientCommonFooter.color,
43
+ borderBottom: i.sectionBorder,
44
+ color: i.color,
38
45
  fontWeight: 500,
39
46
  marginBottom: r.spacing(1),
40
47
  paddingBottom: r.spacing(1)
@@ -52,31 +59,34 @@ var _ = ({ children: e, href: n, onClick: r, ...a }) => {
52
59
  })]
53
60
  });
54
61
  }, y = ({ fullWidth: i }) => {
55
- let a = o(), s = u(), { t: y } = h(), b = e(), [x, S] = f(!1);
62
+ let a = o(), s = d(() => ({
63
+ background: a.palette.primary.main,
64
+ ...a.components?.GenEpixUiClientCommonApplicationFooter ?? {}
65
+ }), [a]), y = u(), { t: b } = h(), x = e(), [S, C] = f(!1);
56
66
  l(() => {
57
- if (x) {
67
+ if (S) {
58
68
  let e = (e) => {
59
- e.key === "Escape" && S(!1);
69
+ e.key === "Escape" && C(!1);
60
70
  };
61
71
  return document.addEventListener("keydown", e), () => {
62
72
  document.removeEventListener("keydown", e);
63
73
  };
64
74
  }
65
- }, [x]);
66
- let C = c(() => {
67
- S((e) => !e);
68
- }, []), w = d(() => b.createFooter(), [b]);
75
+ }, [S]);
76
+ let w = c(() => {
77
+ C((e) => !e);
78
+ }, []), T = d(() => x.createFooter(), [x]);
69
79
  return /* @__PURE__ */ m(t, {
70
80
  component: "footer",
71
81
  sx: {
72
- background: a.components.GenEpixUiClientCommonFooter.background,
82
+ background: s.background,
73
83
  position: "relative",
74
84
  [a.breakpoints.up("md")]: { paddingBottom: a.spacing(1) }
75
85
  },
76
86
  children: [/* @__PURE__ */ p(r, {
77
- "aria-controls": s,
78
- "aria-label": y`Toggle footer menu`,
79
- onClick: C,
87
+ "aria-controls": y,
88
+ "aria-label": b`Toggle footer menu`,
89
+ onClick: w,
80
90
  sx: {
81
91
  color: a.palette.primary.contrastText,
82
92
  [a.breakpoints.up("md")]: { display: "none" }
@@ -90,18 +100,18 @@ var _ = ({ children: e, href: n, onClick: r, ...a }) => {
90
100
  paddingLeft: "0 !important",
91
101
  paddingRight: "0 !important",
92
102
  [a.breakpoints.down("md")]: {
93
- background: a.components.GenEpixUiClientCommonFooter.background,
103
+ background: s.background,
94
104
  bottom: a.spacing(5),
95
- display: x ? "block" : "none",
105
+ display: S ? "block" : "none",
96
106
  left: 0,
97
107
  position: "absolute",
98
108
  width: "100%",
99
109
  zIndex: a.zIndex.appBar - 1
100
110
  },
101
- [a.breakpoints.up("md")]: { gridTemplateColumns: `repeat(${w.sections.length}, 1fr)` },
111
+ [a.breakpoints.up("md")]: { gridTemplateColumns: `repeat(${T.sections.length}, 1fr)` },
102
112
  [a.breakpoints.up("sm")]: { gridTemplateColumns: "repeat(2, 1fr)" }
103
113
  },
104
- children: w.sections.map((e) => /* @__PURE__ */ p(v, {
114
+ children: T.sections.map((e) => /* @__PURE__ */ p(v, {
105
115
  header: e.header,
106
116
  children: e.items.map((e) => /* @__PURE__ */ p(_, {
107
117
  href: e.href,
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationFooter.js","names":["MenuIcon","ApplicationFooterLink","boxProps","theme","useTheme","Box","href","Link","ApplicationFooterLinkSection","Children","children","child","Typography","header","ApplicationFooter","navId","useId","useTranslation","config","useConfig","isMenuOpen","setIsMenuOpen","useState","handleKeyDown","event","onMenuButtonClick","useCallback","x","footer","useMemo","IconButton","Container","section","item"],"sources":["../../src/components/ui/ApplicationFooter/ApplicationFooterLink.tsx","../../src/components/ui/ApplicationFooter/ApplicationFooterLinkSection.tsx","../../src/components/ui/ApplicationFooter/ApplicationFooter.tsx"],"sourcesContent":["import type { BoxProps } from '@mui/material';\nimport {\n Box,\n Link,\n useTheme,\n} from '@mui/material';\nimport type { PropsWithChildren } from 'react';\n\nexport type ApplicationFooterLinkProps = BoxProps<'li'> & PropsWithChildren<{\n readonly href?: string;\n readonly onClick?: () => void;\n}>;\n\nexport const ApplicationFooterLink = ({ children, href, onClick, ...boxProps }: ApplicationFooterLinkProps) => {\n const theme = useTheme();\n\n return (\n <Box\n component={'li'}\n {...boxProps}\n >\n {href && (\n <Link\n href={href}\n onClick={onClick}\n rel={'noreferrer'}\n sx={{\n color: theme.components.GenEpixUiClientCommonFooter.color,\n }}\n target={'_blank'}\n >\n {children}\n </Link>\n )}\n {!href && (\n <Link\n component={'button'}\n onClick={onClick}\n sx={{\n color: theme.components.GenEpixUiClientCommonFooter.color,\n }}\n >\n {children}\n </Link>\n )}\n </Box>\n );\n};\n","import {\n Box,\n Typography,\n useTheme,\n} from '@mui/material';\nimport { Children } from 'react';\nimport type {\n PropsWithChildren,\n ReactElement,\n} from 'react';\n\nimport { ApplicationFooterLink } from './ApplicationFooterLink';\n\nexport type ApplicationFooterLinkSectionProps = PropsWithChildren<{\n readonly header: string;\n}>;\n\nexport const ApplicationFooterLinkSection = ({ children, header }: ApplicationFooterLinkSectionProps) => {\n const theme = useTheme();\n\n // eslint-disable-next-line @eslint-react/no-children-for-each\n Children.forEach(children, (child) => {\n if ((child as ReactElement)?.type !== ApplicationFooterLink) {\n throw Error('ApplicationFooterLinkSection only accepts ApplicationFooterLink as children');\n }\n });\n\n return (\n <Box\n sx={{ padding: 2 }}\n >\n <Typography\n component={'h2'}\n sx={{\n borderBottom: `1px solid ${theme.components.GenEpixUiClientCommonFooter.sectionBorderColor}`,\n color: theme.components.GenEpixUiClientCommonFooter.color,\n fontWeight: 500,\n marginBottom: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n }}\n variant={'h4'}\n >\n {header}\n </Typography>\n <Box\n component={'ul'}\n sx={{\n listStyle: 'none',\n margin: 0,\n padding: 0,\n }}\n >\n {children}\n </Box>\n </Box>\n );\n};\n","import {\n Box,\n Container,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport MenuIcon from '@mui/icons-material/Menu';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { useConfig } from '../../../hooks/useConfig';\n\nimport { ApplicationFooterLink } from './ApplicationFooterLink';\nimport { ApplicationFooterLinkSection } from './ApplicationFooterLinkSection';\n\nexport type ApplicationFooterProps = {\n readonly fullWidth?: boolean;\n};\n\nexport const ApplicationFooter = ({ fullWidth }: ApplicationFooterProps) => {\n const theme = useTheme();\n const navId = useId();\n const { t } = useTranslation();\n const config = useConfig();\n\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n useEffect(() => {\n if (isMenuOpen) {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsMenuOpen(false);\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [isMenuOpen]);\n\n const onMenuButtonClick = useCallback(() => {\n setIsMenuOpen(x => !x);\n }, []);\n\n const footer = useMemo(() => config.createFooter(), [config]);\n\n return (\n <Box\n component={'footer'}\n sx={{\n background: theme.components.GenEpixUiClientCommonFooter.background,\n position: 'relative',\n [theme.breakpoints.up('md')]: {\n paddingBottom: theme.spacing(1),\n },\n }}\n >\n <IconButton\n aria-controls={navId}\n aria-label={t`Toggle footer menu`}\n onClick={onMenuButtonClick}\n sx={{\n color: theme.palette.primary.contrastText,\n [theme.breakpoints.up('md')]: {\n display: 'none',\n },\n }}\n >\n <MenuIcon />\n </IconButton>\n <Container\n maxWidth={fullWidth ? false : 'xl'}\n sx={{\n display: 'grid',\n gridTemplateColumns: 'repeat(1, 1fr)',\n paddingLeft: '0 !important',\n paddingRight: '0 !important',\n [theme.breakpoints.down('md')]: {\n background: theme.components.GenEpixUiClientCommonFooter.background,\n bottom: theme.spacing(5),\n display: isMenuOpen ? 'block' : 'none',\n left: 0,\n position: 'absolute',\n width: '100%',\n zIndex: theme.zIndex.appBar - 1,\n },\n [theme.breakpoints.up('md')]: {\n gridTemplateColumns: `repeat(${footer.sections.length}, 1fr)`,\n },\n [theme.breakpoints.up('sm')]: {\n gridTemplateColumns: 'repeat(2, 1fr)',\n },\n }}\n >\n {footer.sections.map((section) => (\n <ApplicationFooterLinkSection\n header={section.header}\n key={section.header}\n >\n {section.items.map((item) => (\n <ApplicationFooterLink\n href={item.href}\n key={item.label}\n onClick={item.onClick}\n sx={{ mb: 0.5 }}\n >\n {item.label}\n </ApplicationFooterLink>\n ))}\n </ApplicationFooterLinkSection>\n ))}\n </Container>\n </Box>\n );\n};\n"],"mappings":";;;;;;;AAaA,IAAaC,KAAyB,EAAE,aAAU,SAAM,YAAS,GAAGC,QAA2C;CAC7G,IAAMC,IAAQC,EAAS;CAEvB,OACE,kBAACC,GAAD;EACE,WAAW;EACX,GAAIH;EAFN,UAAA,CAIGI,KACC,kBAACC,GAAD;GACQ;GACG;GACT,KAAK;GACL,IAAI,EACF,OAAOJ,EAAM,WAAW,4BAA4B,MACtD;GACA,QAAQ;GAEP;EACG,CAAA,GAEP,CAACG,KACA,kBAACC,GAAD;GACE,WAAW;GACF;GACT,IAAI,EACF,OAAOJ,EAAM,WAAW,4BAA4B,MACtD;GAEC;EACG,CAAA,CAEL;;AAET,GC9BaK,KAAgC,EAAE,aAAU,gBAAgD;CACvG,IAAML,IAAQC,EAAS;CASvB,OANAK,EAAS,QAAQC,IAAW,MAAU;EACpC,IAAKC,GAAwB,SAASV,GACpC,MAAM,MAAM,6EAA6E;CAE7F,CAAC,GAGC,kBAACI,GAAD;EACE,IAAI,EAAE,SAAS,EAAE;EADnB,UAAA,CAGE,kBAACO,GAAD;GACE,WAAW;GACX,IAAI;IACF,cAAc,aAAaT,EAAM,WAAW,4BAA4B;IACxE,OAAOA,EAAM,WAAW,4BAA4B;IACpD,YAAY;IACZ,cAAcA,EAAM,QAAQ,CAAC;IAC7B,eAAeA,EAAM,QAAQ,CAAC;GAChC;GACA,SAAS;GAER,UAAAU;EACS,CAAA,GACZ,kBAACR,GAAD;GACE,WAAW;GACX,IAAI;IACF,WAAW;IACX,QAAQ;IACR,SAAS;GACX;GAEC;EACE,CAAA,CACF;;AAET,GC/BaS,KAAqB,EAAE,mBAAwC;CAC1E,IAAMX,IAAQC,EAAS,GACjBW,IAAQC,EAAM,GACd,EAAE,SAAMC,EAAe,GACvBC,IAASC,EAAU,GAEnB,CAACC,GAAYC,KAAi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GAEC,UAAAyB,EAAO,SAAS,KAAK,MACpB,kBAACpB,GAAD;IACE,QAAQwB,EAAQ;IAGf,UAAAA,EAAQ,MAAM,KAAK,MAClB,kBAAC/B,GAAD;KACE,MAAMgC,EAAK;KAEX,SAASA,EAAK;KACd,IAAI,EAAE,IAAI,GAAI;KAEb,UAAAA,EAAK;IACe,GALhBA,EAAK,KAKW,CACxB;GAC2B,GAZvBD,EAAQ,MAYe,CAC/B;EACQ,CAAA,CACR;;AAET"}
1
+ {"version":3,"file":"ApplicationFooter.js","names":["MenuIcon","ApplicationFooterLink","boxProps","theme","useTheme","applicationFooterLinkTheme","useMemo","Box","href","Link","ApplicationFooterLinkSection","applicationFooterLinkSectionTheme","Children","children","child","Typography","header","ApplicationFooter","applicationFooterTheme","navId","useId","useTranslation","config","useConfig","isMenuOpen","setIsMenuOpen","useState","handleKeyDown","event","onMenuButtonClick","useCallback","x","footer","IconButton","Container","section","item"],"sources":["../../src/components/ui/ApplicationFooter/ApplicationFooterLink.tsx","../../src/components/ui/ApplicationFooter/ApplicationFooterLinkSection.tsx","../../src/components/ui/ApplicationFooter/ApplicationFooter.tsx"],"sourcesContent":["import type { BoxProps } from '@mui/material';\nimport {\n Box,\n Link,\n useTheme,\n} from '@mui/material';\nimport { useMemo } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nexport type ApplicationFooterLinkProps = BoxProps<'li'> & PropsWithChildren<{\n readonly href?: string;\n readonly onClick?: () => void;\n}>;\n\nexport type ApplicationFooterLinkTheme = {\n color: string;\n};\n\nexport const ApplicationFooterLink = ({ children, href, onClick, ...boxProps }: ApplicationFooterLinkProps) => {\n const theme = useTheme();\n const applicationFooterLinkTheme = useMemo<ApplicationFooterLinkTheme>(() => ({\n ...{\n color: theme.palette.primary.contrastText,\n } satisfies ApplicationFooterLinkTheme,\n ...(theme.components?.GenEpixUiClientCommonApplicationFooterLink ?? {}),\n }), [theme]);\n\n return (\n <Box\n component={'li'}\n {...boxProps}\n >\n {href && (\n <Link\n href={href}\n onClick={onClick}\n rel={'noreferrer'}\n sx={{\n color: applicationFooterLinkTheme.color,\n }}\n target={'_blank'}\n >\n {children}\n </Link>\n )}\n {!href && (\n <Link\n component={'button'}\n onClick={onClick}\n sx={{\n color: applicationFooterLinkTheme.color,\n }}\n >\n {children}\n </Link>\n )}\n </Box>\n );\n};\n","import {\n Box,\n Typography,\n useTheme,\n} from '@mui/material';\nimport {\n Children,\n useMemo,\n} from 'react';\nimport type {\n PropsWithChildren,\n ReactElement,\n} from 'react';\n\nimport { ApplicationFooterLink } from './ApplicationFooterLink';\n\nexport type ApplicationFooterLinkSectionProps = PropsWithChildren<{\n readonly header: string;\n}>;\n\nexport type ApplicationFooterLinkSectionTheme = {\n color: string;\n sectionBorder: string;\n};\n\nexport const ApplicationFooterLinkSection = ({ children, header }: ApplicationFooterLinkSectionProps) => {\n const theme = useTheme();\n const applicationFooterLinkSectionTheme = useMemo<ApplicationFooterLinkSectionTheme>(() => ({\n ...{\n color: theme.palette.primary.contrastText,\n sectionBorder: `1px solid ${theme.palette.primary.contrastText}`,\n } satisfies ApplicationFooterLinkSectionTheme,\n ...(theme.components?.GenEpixUiClientCommonApplicationFooterLinkSection ?? {}),\n }), [theme]);\n\n // eslint-disable-next-line @eslint-react/no-children-for-each\n Children.forEach(children, (child) => {\n if ((child as ReactElement)?.type !== ApplicationFooterLink) {\n throw Error('ApplicationFooterLinkSection only accepts ApplicationFooterLink as children');\n }\n });\n\n return (\n <Box\n sx={{ padding: 2 }}\n >\n <Typography\n component={'h2'}\n sx={{\n borderBottom: applicationFooterLinkSectionTheme.sectionBorder,\n color: applicationFooterLinkSectionTheme.color,\n fontWeight: 500,\n marginBottom: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n }}\n variant={'h4'}\n >\n {header}\n </Typography>\n <Box\n component={'ul'}\n sx={{\n listStyle: 'none',\n margin: 0,\n padding: 0,\n }}\n >\n {children}\n </Box>\n </Box>\n );\n};\n","import {\n Box,\n Container,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport MenuIcon from '@mui/icons-material/Menu';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { useConfig } from '../../../hooks/useConfig';\n\nimport { ApplicationFooterLink } from './ApplicationFooterLink';\nimport { ApplicationFooterLinkSection } from './ApplicationFooterLinkSection';\n\nexport type ApplicationFooterProps = {\n readonly fullWidth?: boolean;\n};\n\nexport type ApplicationFooterTheme = {\n background: string;\n};\n\nexport const ApplicationFooter = ({ fullWidth }: ApplicationFooterProps) => {\n const theme = useTheme();\n const applicationFooterTheme = useMemo<ApplicationFooterTheme>(() => ({\n ...{\n background: theme.palette.primary.main,\n } satisfies ApplicationFooterTheme,\n ...(theme.components?.GenEpixUiClientCommonApplicationFooter ?? {}),\n }), [theme]);\n\n const navId = useId();\n const { t } = useTranslation();\n const config = useConfig();\n\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n useEffect(() => {\n if (isMenuOpen) {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsMenuOpen(false);\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [isMenuOpen]);\n\n const onMenuButtonClick = useCallback(() => {\n setIsMenuOpen(x => !x);\n }, []);\n\n const footer = useMemo(() => config.createFooter(), [config]);\n\n return (\n <Box\n component={'footer'}\n sx={{\n background: applicationFooterTheme.background,\n position: 'relative',\n [theme.breakpoints.up('md')]: {\n paddingBottom: theme.spacing(1),\n },\n }}\n >\n <IconButton\n aria-controls={navId}\n aria-label={t`Toggle footer menu`}\n onClick={onMenuButtonClick}\n sx={{\n color: theme.palette.primary.contrastText,\n [theme.breakpoints.up('md')]: {\n display: 'none',\n },\n }}\n >\n <MenuIcon />\n </IconButton>\n <Container\n maxWidth={fullWidth ? false : 'xl'}\n sx={{\n display: 'grid',\n gridTemplateColumns: 'repeat(1, 1fr)',\n paddingLeft: '0 !important',\n paddingRight: '0 !important',\n [theme.breakpoints.down('md')]: {\n background: applicationFooterTheme.background,\n bottom: theme.spacing(5),\n display: isMenuOpen ? 'block' : 'none',\n left: 0,\n position: 'absolute',\n width: '100%',\n zIndex: theme.zIndex.appBar - 1,\n },\n [theme.breakpoints.up('md')]: {\n gridTemplateColumns: `repeat(${footer.sections.length}, 1fr)`,\n },\n [theme.breakpoints.up('sm')]: {\n gridTemplateColumns: 'repeat(2, 1fr)',\n },\n }}\n >\n {footer.sections.map((section) => (\n <ApplicationFooterLinkSection\n header={section.header}\n key={section.header}\n >\n {section.items.map((item) => (\n <ApplicationFooterLink\n href={item.href}\n key={item.label}\n onClick={item.onClick}\n sx={{ mb: 0.5 }}\n >\n {item.label}\n </ApplicationFooterLink>\n ))}\n </ApplicationFooterLinkSection>\n ))}\n </Container>\n </Box>\n );\n};\n"],"mappings":";;;;;;;AAkBA,IAAaC,KAAyB,EAAE,aAAU,SAAM,YAAS,GAAGC,QAA2C;CAC7G,IAAMC,IAAQC,EAAS,GACjBC,IAA6BC,SAA2C;EAE1E,OAAOH,EAAM,QAAQ,QAAQ;EAE/B,GAAIA,EAAM,YAAY,8CAA8C,CAAC;CACvE,IAAI,CAACA,CAAK,CAAC;CAEX,OACE,kBAACI,GAAD;EACE,WAAW;EACX,GAAIL;EAFN,UAAA,CAIGM,KACC,kBAACC,GAAD;GACQ;GACG;GACT,KAAK;GACL,IAAI,EACF,OAAOJ,EAA2B,MACpC;GACA,QAAQ;GAEP;EACG,CAAA,GAEP,CAACG,KACA,kBAACC,GAAD;GACE,WAAW;GACF;GACT,IAAI,EACF,OAAOJ,EAA2B,MACpC;GAEC;EACG,CAAA,CAEL;;AAET,GCjCaK,KAAgC,EAAE,aAAU,gBAAgD;CACvG,IAAMP,IAAQC,EAAS,GACjBO,IAAoCL,SAAkD;EAExF,OAAOH,EAAM,QAAQ,QAAQ;EAC7B,eAAe,aAAaA,EAAM,QAAQ,QAAQ;EAE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