@flipdish/portal-library 2.0.10 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Chip/index.cjs.js +1 -1
- package/dist/components/Chip/index.cjs.js.map +1 -1
- package/dist/components/Chip/index.d.ts +2 -1
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/Chip/index.js.map +1 -1
- package/dist/components/FlipdishLogoLoader/index.cjs.js +1 -1
- package/dist/components/FlipdishLogoLoader/index.cjs.js.map +1 -1
- package/dist/components/FlipdishLogoLoader/index.js +1 -1
- package/dist/components/FlipdishLogoLoader/index.js.map +1 -1
- package/dist/components/Form/FormItemLayout/index.d.ts +2 -1
- package/dist/components/Form/GenericAutocompleteField/index.d.ts +2 -1
- package/dist/components/GenericDatePickerField/GenericDateFieldBase.d.ts +2 -1
- package/dist/components/GenericTable/index.cjs.js +3 -3
- package/dist/components/GenericTable/index.cjs.js.map +1 -1
- package/dist/components/GenericTable/index.js +3 -3
- package/dist/components/GenericTable/index.js.map +1 -1
- package/dist/components/GenericTableBody/index.d.ts +2 -1
- package/dist/components/GenericTableBodyRow/index.cjs.js +1 -1
- package/dist/components/GenericTableBodyRow/index.cjs.js.map +1 -1
- package/dist/components/GenericTableBodyRow/index.d.ts +2 -1
- package/dist/components/GenericTableBodyRow/index.js +1 -1
- package/dist/components/GenericTableBodyRow/index.js.map +1 -1
- package/dist/components/PageLayout/index.cjs.js +1 -1
- package/dist/components/PageLayout/index.cjs.js.map +1 -1
- package/dist/components/PageLayout/index.d.ts +2 -1
- package/dist/components/PageLayout/index.js +1 -1
- package/dist/components/PageLayout/index.js.map +1 -1
- package/dist/components/PortalMock/index.cjs.js +22 -1
- package/dist/components/PortalMock/index.cjs.js.map +1 -1
- package/dist/components/PortalMock/index.js +22 -1
- package/dist/components/PortalMock/index.js.map +1 -1
- package/dist/components/Spacer/index.d.ts +2 -1
- package/dist/components/Switch/index.d.ts +2 -1
- package/dist/components/Tooltip/index.d.ts +2 -1
- package/dist/components/atoms/IconContainer/index.cjs.js +2 -0
- package/dist/components/atoms/IconContainer/index.cjs.js.map +1 -0
- package/dist/components/atoms/IconContainer/index.d.ts +31 -0
- package/dist/components/atoms/IconContainer/index.js +2 -0
- package/dist/components/atoms/IconContainer/index.js.map +1 -0
- package/dist/custom-hooks/useToasts.d.ts +2 -1
- package/dist/icons/helpers/withSvgIcon.d.ts +2 -1
- package/dist/providers/ToastProvider.cjs.js +1 -1
- package/dist/providers/ToastProvider.cjs.js.map +1 -1
- package/dist/providers/ToastProvider.js +1 -1
- package/dist/providers/ToastProvider.js.map +1 -1
- package/dist/themes/ThemeProvider.cjs.js +2 -0
- package/dist/themes/ThemeProvider.cjs.js.map +1 -0
- package/dist/themes/ThemeProvider.d.ts +9 -0
- package/dist/themes/ThemeProvider.js +2 -0
- package/dist/themes/ThemeProvider.js.map +1 -0
- package/dist/themes/flipdishPublicTheme.cjs.js +1 -1
- package/dist/themes/flipdishPublicTheme.cjs.js.map +1 -1
- package/dist/themes/flipdishPublicTheme.d.ts +3 -2
- package/dist/themes/flipdishPublicTheme.js +1 -1
- package/dist/themes/flipdishPublicTheme.js.map +1 -1
- package/dist/themes/tokens/colours/colours-stories-utils.cjs.js +2 -0
- package/dist/themes/tokens/colours/colours-stories-utils.cjs.js.map +1 -0
- package/dist/themes/tokens/colours/colours-stories-utils.d.ts +16 -0
- package/dist/themes/tokens/colours/colours-stories-utils.js +2 -0
- package/dist/themes/tokens/colours/colours-stories-utils.js.map +1 -0
- package/dist/themes/tokens/colours/index.cjs.js +2 -0
- package/dist/themes/tokens/colours/index.cjs.js.map +1 -0
- package/dist/themes/tokens/colours/index.d.ts +3 -0
- package/dist/themes/tokens/colours/index.js +2 -0
- package/dist/themes/tokens/colours/index.js.map +1 -0
- package/dist/themes/tokens/colours/primitives.cjs.js +2 -0
- package/dist/themes/tokens/colours/primitives.cjs.js.map +1 -0
- package/dist/themes/tokens/colours/primitives.d.ts +5 -0
- package/dist/themes/tokens/colours/primitives.js +2 -0
- package/dist/themes/tokens/colours/primitives.js.map +1 -0
- package/dist/themes/tokens/colours/semantic.cjs.js +2 -0
- package/dist/themes/tokens/colours/semantic.cjs.js.map +1 -0
- package/dist/themes/tokens/colours/semantic.d.ts +6 -0
- package/dist/themes/tokens/colours/semantic.js +2 -0
- package/dist/themes/tokens/colours/semantic.js.map +1 -0
- package/dist/themes/tokens/colours/types.cjs.js +2 -0
- package/dist/themes/tokens/colours/types.cjs.js.map +1 -0
- package/dist/themes/tokens/{colours.d.ts → colours/types.d.ts} +2 -4
- package/dist/themes/tokens/colours/types.js +2 -0
- package/dist/themes/tokens/colours/types.js.map +1 -0
- package/package.json +14 -5
- package/dist/themes/tokens/colours.cjs.js +0 -2
- package/dist/themes/tokens/colours.cjs.js.map +0 -1
- package/dist/themes/tokens/colours.js +0 -2
- package/dist/themes/tokens/colours.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as i,Fragment as n}from"react/jsx-runtime";import e from"react";import a from"../../icons/Add/index.js";import o from"../../icons/ArrowLeft02/index.js";import r from"@mui/material/Grid";import d from"@mui/material/IconButton";import{styled as m,useTheme as l}from"@mui/material/styles";import c from"@mui/material/Typography";import p from"@mui/material/useMediaQuery";import s from"./DocumentTitle.js";import h from"./FullWidthContainer.js";import g from"../FDErrorBoundary/index.js";import u from"@mui/material/Button";import{getMicroFrontendAttribute as f}from"../../utilities/renderUtilities.js";import{joinUrlPaths as b}from"../../utilities/validation.js";import v from"../Spacer/index.js";import k from"@mui/material/Box";import x from"@mui/material/Divider";const B="horizontal-content-space",w="left-horizontal-content-space",W="right-horizontal-content-space",y="vertical-content-space",T=1112,C=m("div")((({theme:t,fluid:i})=>({maxWidth:i?"none":T,[t.breakpoints.down("md")]:{maxWidth:"none"},padding:t.spacing(2,4),position:"relative",minHeight:"100vh"}))),j=m(r)((({theme:t})=>({[t.breakpoints.down("sm")]:{width:"100%",paddingTop:t.spacing(2)}}))),A=m(r)((({theme:t})=>({flexWrap:"nowrap",alignItems:"flex-start",paddingTop:t.spacing(3),paddingBottom:t.spacing(3),[t.breakpoints.down("md")]:{paddingTop:t.spacing(2),paddingBottom:t.spacing(3)}}))),L=m(r)((({theme:t})=>({paddingTop:t.spacing(2)}))),z=m(r)((()=>({flexGrow:1}))),I=m("div")((({theme:t})=>({maxWidth:T,paddingBottom:t.spacing(3),[t.breakpoints.down("md")]:{paddingBottom:t.spacing(2),paddingLeft:t.spacing(2),paddingRight:t.spacing(2)}}))),R=m(a)((({theme:t})=>({marginRight:t.spacing(1)}))),D=m(d,{shouldForwardProp:t=>"hasTitleComponent"!==t})((({theme:t,hasTitleComponent:i})=>({margin:i?t.spacing(-.75,2,-1.5,-1.5):t.spacing(-1.5,2,-1.5,-1.5),[t.breakpoints.only("sm")]:{marginLeft:t.spacing(-2)},[t.breakpoints.only("xs")]:{marginLeft:t.spacing(-2)}}))),H=m("div")((({theme:t})=>({maxWidth:T,marginLeft:t.spacing(6),marginRight:t.spacing(4),paddingBottom:t.spacing(2),[t.breakpoints.only("md")]:{marginLeft:12,marginRight:t.spacing(3)},[t.breakpoints.only("sm")]:{marginLeft:t.spacing(3),marginRight:t.spacing(3),maxWidth:"none"},[t.breakpoints.only("xs")]:{marginLeft:t.spacing(2),marginRight:t.spacing(2),maxWidth:"none"}}))),P=m(r)((()=>({display:"flex",flexGrow:1,justifyContent:"flex-end"}))),E=m(c)((()=>({lineHeight:"26px"}))),F=m(c)((()=>({fontWeight:"bold"}))),G=m(x)((({theme:t})=>({marginBottom:t.spacing(4)}))),$=({title:i})=>t(F,{variant:"h5",component:"h2",children:i}),S=m("div")((({useAlternateBackground:t,theme:i})=>({backgroundColor:t?i.palette.semantic.
|
|
1
|
+
import{jsx as t,jsxs as i,Fragment as n}from"react/jsx-runtime";import e from"react";import a from"../../icons/Add/index.js";import o from"../../icons/ArrowLeft02/index.js";import r from"@mui/material/Grid";import d from"@mui/material/IconButton";import{styled as m,useTheme as l}from"@mui/material/styles";import c from"@mui/material/Typography";import p from"@mui/material/useMediaQuery";import s from"./DocumentTitle.js";import h from"./FullWidthContainer.js";import g from"../FDErrorBoundary/index.js";import u from"@mui/material/Button";import{getMicroFrontendAttribute as f}from"../../utilities/renderUtilities.js";import{joinUrlPaths as b}from"../../utilities/validation.js";import v from"../Spacer/index.js";import k from"@mui/material/Box";import x from"@mui/material/Divider";const B="horizontal-content-space",w="left-horizontal-content-space",W="right-horizontal-content-space",y="vertical-content-space",T=1112,C=m("div")((({theme:t,fluid:i})=>({maxWidth:i?"none":T,[t.breakpoints.down("md")]:{maxWidth:"none"},padding:t.spacing(2,4),position:"relative",minHeight:"100vh"}))),j=m(r)((({theme:t})=>({[t.breakpoints.down("sm")]:{width:"100%",paddingTop:t.spacing(2)}}))),A=m(r)((({theme:t})=>({flexWrap:"nowrap",alignItems:"flex-start",paddingTop:t.spacing(3),paddingBottom:t.spacing(3),[t.breakpoints.down("md")]:{paddingTop:t.spacing(2),paddingBottom:t.spacing(3)}}))),L=m(r)((({theme:t})=>({paddingTop:t.spacing(2)}))),z=m(r)((()=>({flexGrow:1}))),I=m("div")((({theme:t})=>({maxWidth:T,paddingBottom:t.spacing(3),[t.breakpoints.down("md")]:{paddingBottom:t.spacing(2),paddingLeft:t.spacing(2),paddingRight:t.spacing(2)}}))),R=m(a)((({theme:t})=>({marginRight:t.spacing(1)}))),D=m(d,{shouldForwardProp:t=>"hasTitleComponent"!==t})((({theme:t,hasTitleComponent:i})=>({margin:i?t.spacing(-.75,2,-1.5,-1.5):t.spacing(-1.5,2,-1.5,-1.5),[t.breakpoints.only("sm")]:{marginLeft:t.spacing(-2)},[t.breakpoints.only("xs")]:{marginLeft:t.spacing(-2)}}))),H=m("div")((({theme:t})=>({maxWidth:T,marginLeft:t.spacing(6),marginRight:t.spacing(4),paddingBottom:t.spacing(2),[t.breakpoints.only("md")]:{marginLeft:12,marginRight:t.spacing(3)},[t.breakpoints.only("sm")]:{marginLeft:t.spacing(3),marginRight:t.spacing(3),maxWidth:"none"},[t.breakpoints.only("xs")]:{marginLeft:t.spacing(2),marginRight:t.spacing(2),maxWidth:"none"}}))),P=m(r)((()=>({display:"flex",flexGrow:1,justifyContent:"flex-end"}))),E=m(c)((()=>({lineHeight:"26px"}))),F=m(c)((()=>({fontWeight:"bold"}))),G=m(x)((({theme:t})=>({marginBottom:t.spacing(4)}))),$=({title:i})=>t(F,{variant:"h5",component:"h2",children:i}),S=m("div")((({useAlternateBackground:t,theme:i})=>({backgroundColor:t?i.palette.semantic.background["background-alternate"]:i.palette.semantic.background["background-base"],width:"100%",height:"100%"}))),V=a=>{const{actionBtnTitle:d,caption:m,children:c,contextButtons:x,documentTitle:B,fluid:w=!1,fullWidth:W,header:y,hideHeader:T,actionButtonLink:F,openLinkInNewTab:V=!1,pageHeader:_,showActionButton:M,showAddIcon:N,title:Q,titleComponent:U,toPrevious:q,toParent:J,strictToParent:K,navigate:O,hideDivider:X=!1,customActionButtons:Y,useAlternateBackground:Z=!1,titleComponentAfter:tt,errorBoundarySomethingWentWrongText:it}=a,nt=l(),et=p(nt.breakpoints.down("md")),at=f("data-portal-base-url")||"/",ot=F?.startsWith("https://"),rt=ot?F:void 0!==F?b(at,F):"";return t(S,{useAlternateBackground:Z,children:i(C,{fluid:w,children:[B&&t(s,{children:B}),_||null,i(H,{children:[_&&t(v,{size:16,variant:"vertical"}),!T&&i(n,{children:[i(A,{container:!0,alignItems:"center",direction:"column",children:[t(r,{item:!0,container:!0,direction:"row",alignContent:"space-between",children:t(P,{item:!0,children:x?.map((i=>t("div",{children:i},`context-button-${e.isValidElement(i)?i.props?.["data-testid"]||i.props?.children:"fallback"}`)))})}),i(L,{item:!0,container:!0,children:[(J||q)&&t(k,{children:t(D,{"aria-label":"Back","data-testid":"back_button",hasTitleComponent:!!U,component:"button",onClick:()=>{q?O(-1):J&&K||J&&history.length<3?O(J):O(-1)},children:t(o,{})})}),i(z,{item:!0,children:[U?t(U,{}):i(k,{display:"flex",alignItems:"center",gap:2,children:[t($,{title:Q}),tt]}),m&&t(E,{variant:"caption",component:"h3",children:m})]}),M&&i(n,{children:[et&&t(v,{size:56,variant:"vertical"}),t(j,{item:!0,children:i(u,{variant:"contained",fullWidth:!0,"data-testid":`Action-button-${d}`,href:V||ot?rt:"",target:V?"_blank":void 0,rel:V?"noopener noreferrer":void 0,onClick:V||ot?()=>{}:()=>O(F),children:[N&&t(R,{size:"sm"}),d]})})]}),Y?.map((n=>i("div",{children:[et&&t(v,{size:56,variant:"vertical"}),!et&&t(v,{size:16,variant:"vertical"}),t(j,{item:!0,children:n})]},`custom-action-button-${e.isValidElement(n)?n.props?.["data-testid"]||n.props?.children:"fallback"}`)))]})]}),!X&&t(G,{})]}),i(h,{fullWidth:W,children:[y?t(I,{children:y}):null,t(g,{identifier:B,somethingWentWrongText:it,children:t(n,{children:c})})]})]})]})})};export{B as HORIZONTAL_SPACE_CLASSNAME,w as LEFT_HORIZONTAL_SPACE_CLASSNAME,$ as PageTitle,W as RIGHT_HORIZONTAL_SPACE_CLASSNAME,y as VERTICAL_SPACE_CLASSNAME,V as default,T as maxWidth};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Add from '../../icons/Add';\nimport ArrowLeft02 from '../../icons/ArrowLeft02';\nimport Grid from '@mui/material/Grid';\nimport IconButton from '@mui/material/IconButton';\nimport { styled, useTheme } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\nimport FDErrorBoundary from '../FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { getMicroFrontendAttribute } from '../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../utilities/validation';\nimport Spacer from '../Spacer';\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\n\nexport const HORIZONTAL_SPACE_CLASSNAME = 'horizontal-content-space';\nexport const LEFT_HORIZONTAL_SPACE_CLASSNAME = 'left-horizontal-content-space';\nexport const RIGHT_HORIZONTAL_SPACE_CLASSNAME = 'right-horizontal-content-space';\nexport const VERTICAL_SPACE_CLASSNAME = 'vertical-content-space';\nexport const maxWidth = 1112;\nconst historyMinLength = 3;\n\nconst StyledWrapper = styled('div')<{ fluid: boolean }>(({ theme, fluid }) => ({\n maxWidth: fluid ? 'none' : maxWidth,\n [theme.breakpoints.down('md')]: {\n maxWidth: 'none',\n },\n padding: theme.spacing(2, 4),\n position: 'relative',\n minHeight: '100vh',\n}));\n\nconst StyledActionButtonGrid = styled(Grid)(({ theme }) => ({\n [theme.breakpoints.down('sm')]: {\n width: '100%',\n paddingTop: theme.spacing(2),\n },\n}));\n\nconst StyledHeader = styled(Grid)(({ theme }) => ({\n flexWrap: 'nowrap',\n alignItems: 'flex-start',\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst StyledTitleContainer = styled(Grid)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n}));\n\nconst StyledTitleSection = styled(Grid)(() => ({\n flexGrow: 1,\n}));\n\nconst StyledTopSection = styled('div')(({ theme }) => ({\n maxWidth,\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingBottom: theme.spacing(2),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n}));\n\nconst StyledAdd = styled(Add)(({ theme }) => ({\n marginRight: theme.spacing(1),\n}));\n\nconst StyledBackButton = styled(IconButton, {\n shouldForwardProp: (prop) => prop !== 'hasTitleComponent',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n})<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 2, -1.5, -1.5) : theme.spacing(-1.5, 2, -1.5, -1.5),\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(-2),\n },\n}));\n\nconst StyledInnerWrapper = styled('div')(({ theme }) => ({\n maxWidth,\n marginLeft: theme.spacing(6),\n marginRight: theme.spacing(4),\n paddingBottom: theme.spacing(2),\n\n [theme.breakpoints.only('md')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n maxWidth: 'none',\n },\n}));\n\nconst StyledHeaderContainer = styled(Grid)(() => ({\n display: 'flex',\n flexGrow: 1,\n justifyContent: 'flex-end',\n}));\nconst StyledCaption = styled(Typography)<{ component: string }>(() => ({\n lineHeight: '26px',\n}));\n\nconst StyledPageTitle = styled(Typography)<{ component: string }>(() => ({\n fontWeight: 'bold',\n}));\n\nconst StyledPageDivider = styled(Divider)(({ theme }) => ({\n marginBottom: theme.spacing(4),\n}));\n\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <StyledPageTitle variant=\"h5\" component=\"h2\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(({ useAlternateBackground, theme }) => ({\n backgroundColor: useAlternateBackground\n ? theme.palette.semantic.light.background['background-alternate']\n : theme.palette.semantic.light.background['background-base'],\n width: '100%',\n height: '100%',\n}));\n\nexport type Props = {\n actionBtnTitle?: string;\n caption?: ReactNode;\n children: ReactNode;\n contextButtons?: ReactNode[];\n documentTitle: string;\n fluid?: boolean;\n fullWidth?: boolean;\n header?: ReactNode;\n hideHeader?: boolean;\n actionButtonLink?: string;\n pageHeader?: ReactNode;\n showActionButton?: boolean;\n showAddIcon?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n titleComponentAfter?: ReactNode;\n toPrevious?: boolean;\n toParent?: string;\n strictToParent?: boolean;\n openLinkInNewTab?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n navigate: (to: any) => void;\n hideDivider?: boolean;\n customActionButtons?: ReactNode[];\n useAlternateBackground?: boolean;\n errorBoundarySomethingWentWrongText: string;\n};\n\nconst PageLayout = (props: Props) => {\n const {\n actionBtnTitle,\n caption,\n children,\n contextButtons,\n documentTitle,\n fluid = false,\n fullWidth,\n header,\n hideHeader,\n actionButtonLink,\n openLinkInNewTab = false,\n pageHeader,\n showActionButton,\n showAddIcon,\n title,\n titleComponent: TitleComponent,\n toPrevious,\n toParent,\n strictToParent,\n navigate,\n hideDivider = false,\n customActionButtons,\n useAlternateBackground = false,\n titleComponentAfter,\n errorBoundarySomethingWentWrongText,\n } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const getActionButtonLink = () => {\n if (actionButtonWithHttps) {\n return actionButtonLink;\n }\n if (actionButtonLink !== undefined) {\n return joinUrlPaths(baseUrl, actionButtonLink);\n }\n return '';\n };\n const actionButtonLinkFinal = getActionButtonLink();\n\n return (\n <StyledPageContainer useAlternateBackground={useAlternateBackground}>\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader || null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n key={`context-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {button}\n </div>\n ))}\n </StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n if (toPrevious) {\n navigate(-1);\n } else if (toParent && strictToParent) {\n navigate(toParent);\n } else if (toParent && history.length < historyMinLength) {\n navigate(toParent);\n } else {\n navigate(-1);\n }\n }}\n >\n <ArrowLeft02 />\n </StyledBackButton>\n </Box>\n )}\n\n <StyledTitleSection item>\n {TitleComponent ? (\n <TitleComponent />\n ) : (\n <Box display=\"flex\" alignItems=\"center\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption variant=\"caption\" component=\"h3\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n <Button\n variant=\"contained\"\n fullWidth={true}\n data-testid={`Action-button-${actionBtnTitle}`}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n target={openLinkInNewTab ? '_blank' : undefined}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}\n }\n >\n {showAddIcon && <StyledAdd size=\"sm\" />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n key={`custom-action-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n {!isMobile && <Spacer size={16} variant=\"vertical\" />}\n <StyledActionButtonGrid item>{button}</StyledActionButtonGrid>\n </div>\n ))}\n </StyledTitleContainer>\n </StyledHeader>\n {!hideDivider && <StyledPageDivider />}\n </>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle} somethingWentWrongText={errorBoundarySomethingWentWrongText}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n </StyledPageContainer>\n );\n};\n\nexport default PageLayout;\n"],"names":["HORIZONTAL_SPACE_CLASSNAME","LEFT_HORIZONTAL_SPACE_CLASSNAME","RIGHT_HORIZONTAL_SPACE_CLASSNAME","VERTICAL_SPACE_CLASSNAME","maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","padding","spacing","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledAdd","Add","marginRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","margin","only","marginLeft","StyledInnerWrapper","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","StyledPageContainer","useAlternateBackground","backgroundColor","palette","semantic","light","background","height","PageLayout","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","titleComponentAfter","errorBoundarySomethingWentWrongText","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","Spacer","size","_Fragment","container","direction","item","alignContent","map","button","React","isValidElement","Box","onClick","history","length","ArrowLeft02","gap","Button","href","target","rel","FullWidthContainer","FDErrorBoundary","identifier","somethingWentWrong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D,SAAAqD,MAJzB,wBAAwBC,EAAMC,eAAeF,GAAUA,EAAO3C,QAAQ,gBAAkB2C,EAAO3C,OAAOV,SAAW,uBASpI6B,GAAehC,EAACL,SAG1BmD,EAACuB,EAAmB,CAAAnD,UAAWA,EAASf,SAAA,CACnCgB,EAASnB,EAAC5B,EAAgB,CAAA+B,SAAEgB,IAA6B,KAC1DnB,EAACsE,EAAe,CAACC,WAAYtD,EAAeuD,uBAAwBrC,GAAmChC,SACnGH,EAAGkD,EAAA,CAAA/C,SAAAA,gBAKD"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Add from '../../icons/Add';\nimport ArrowLeft02 from '../../icons/ArrowLeft02';\nimport Grid from '@mui/material/Grid';\nimport IconButton from '@mui/material/IconButton';\nimport { styled, useTheme } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\nimport FDErrorBoundary from '../FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { getMicroFrontendAttribute } from '../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../utilities/validation';\nimport Spacer from '../Spacer';\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\n\nexport const HORIZONTAL_SPACE_CLASSNAME = 'horizontal-content-space';\nexport const LEFT_HORIZONTAL_SPACE_CLASSNAME = 'left-horizontal-content-space';\nexport const RIGHT_HORIZONTAL_SPACE_CLASSNAME = 'right-horizontal-content-space';\nexport const VERTICAL_SPACE_CLASSNAME = 'vertical-content-space';\nexport const maxWidth = 1112;\nconst historyMinLength = 3;\n\nconst StyledWrapper = styled('div')<{ fluid: boolean }>(({ theme, fluid }) => ({\n maxWidth: fluid ? 'none' : maxWidth,\n [theme.breakpoints.down('md')]: {\n maxWidth: 'none',\n },\n padding: theme.spacing(2, 4),\n position: 'relative',\n minHeight: '100vh',\n}));\n\nconst StyledActionButtonGrid = styled(Grid)(({ theme }) => ({\n [theme.breakpoints.down('sm')]: {\n width: '100%',\n paddingTop: theme.spacing(2),\n },\n}));\n\nconst StyledHeader = styled(Grid)(({ theme }) => ({\n flexWrap: 'nowrap',\n alignItems: 'flex-start',\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst StyledTitleContainer = styled(Grid)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n}));\n\nconst StyledTitleSection = styled(Grid)(() => ({\n flexGrow: 1,\n}));\n\nconst StyledTopSection = styled('div')(({ theme }) => ({\n maxWidth,\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingBottom: theme.spacing(2),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n}));\n\nconst StyledAdd = styled(Add)(({ theme }) => ({\n marginRight: theme.spacing(1),\n}));\n\nconst StyledBackButton = styled(IconButton, {\n shouldForwardProp: (prop) => prop !== 'hasTitleComponent',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n})<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 2, -1.5, -1.5) : theme.spacing(-1.5, 2, -1.5, -1.5),\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(-2),\n },\n}));\n\nconst StyledInnerWrapper = styled('div')(({ theme }) => ({\n maxWidth,\n marginLeft: theme.spacing(6),\n marginRight: theme.spacing(4),\n paddingBottom: theme.spacing(2),\n\n [theme.breakpoints.only('md')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n maxWidth: 'none',\n },\n}));\n\nconst StyledHeaderContainer = styled(Grid)(() => ({\n display: 'flex',\n flexGrow: 1,\n justifyContent: 'flex-end',\n}));\nconst StyledCaption = styled(Typography)<{ component: string }>(() => ({\n lineHeight: '26px',\n}));\n\nconst StyledPageTitle = styled(Typography)<{ component: string }>(() => ({\n fontWeight: 'bold',\n}));\n\nconst StyledPageDivider = styled(Divider)(({ theme }) => ({\n marginBottom: theme.spacing(4),\n}));\n\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <StyledPageTitle variant=\"h5\" component=\"h2\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(({ useAlternateBackground, theme }) => ({\n backgroundColor: useAlternateBackground\n ? theme.palette.semantic.background['background-alternate']\n : theme.palette.semantic.background['background-base'],\n width: '100%',\n height: '100%',\n}));\n\nexport type Props = {\n actionBtnTitle?: string;\n caption?: ReactNode;\n children: ReactNode;\n contextButtons?: ReactNode[];\n documentTitle: string;\n fluid?: boolean;\n fullWidth?: boolean;\n header?: ReactNode;\n hideHeader?: boolean;\n actionButtonLink?: string;\n pageHeader?: ReactNode;\n showActionButton?: boolean;\n showAddIcon?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n titleComponentAfter?: ReactNode;\n toPrevious?: boolean;\n toParent?: string;\n strictToParent?: boolean;\n openLinkInNewTab?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n navigate: (to: any) => void;\n hideDivider?: boolean;\n customActionButtons?: ReactNode[];\n useAlternateBackground?: boolean;\n errorBoundarySomethingWentWrongText: string;\n};\n\nconst PageLayout = (props: Props) => {\n const {\n actionBtnTitle,\n caption,\n children,\n contextButtons,\n documentTitle,\n fluid = false,\n fullWidth,\n header,\n hideHeader,\n actionButtonLink,\n openLinkInNewTab = false,\n pageHeader,\n showActionButton,\n showAddIcon,\n title,\n titleComponent: TitleComponent,\n toPrevious,\n toParent,\n strictToParent,\n navigate,\n hideDivider = false,\n customActionButtons,\n useAlternateBackground = false,\n titleComponentAfter,\n errorBoundarySomethingWentWrongText,\n } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const getActionButtonLink = () => {\n if (actionButtonWithHttps) {\n return actionButtonLink;\n }\n if (actionButtonLink !== undefined) {\n return joinUrlPaths(baseUrl, actionButtonLink);\n }\n return '';\n };\n const actionButtonLinkFinal = getActionButtonLink();\n\n return (\n <StyledPageContainer useAlternateBackground={useAlternateBackground}>\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader || null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n key={`context-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {button}\n </div>\n ))}\n </StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n if (toPrevious) {\n navigate(-1);\n } else if (toParent && strictToParent) {\n navigate(toParent);\n } else if (toParent && history.length < historyMinLength) {\n navigate(toParent);\n } else {\n navigate(-1);\n }\n }}\n >\n <ArrowLeft02 />\n </StyledBackButton>\n </Box>\n )}\n\n <StyledTitleSection item>\n {TitleComponent ? (\n <TitleComponent />\n ) : (\n <Box display=\"flex\" alignItems=\"center\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption variant=\"caption\" component=\"h3\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n <Button\n variant=\"contained\"\n fullWidth={true}\n data-testid={`Action-button-${actionBtnTitle}`}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n target={openLinkInNewTab ? '_blank' : undefined}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}\n }\n >\n {showAddIcon && <StyledAdd size=\"sm\" />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n key={`custom-action-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n {!isMobile && <Spacer size={16} variant=\"vertical\" />}\n <StyledActionButtonGrid item>{button}</StyledActionButtonGrid>\n </div>\n ))}\n </StyledTitleContainer>\n </StyledHeader>\n {!hideDivider && <StyledPageDivider />}\n </>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle} somethingWentWrongText={errorBoundarySomethingWentWrongText}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n </StyledPageContainer>\n );\n};\n\nexport default PageLayout;\n"],"names":["HORIZONTAL_SPACE_CLASSNAME","LEFT_HORIZONTAL_SPACE_CLASSNAME","RIGHT_HORIZONTAL_SPACE_CLASSNAME","VERTICAL_SPACE_CLASSNAME","maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","padding","spacing","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledAdd","Add","marginRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","margin","only","marginLeft","StyledInnerWrapper","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","StyledPageContainer","useAlternateBackground","backgroundColor","palette","semantic","background","height","PageLayout","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","titleComponentAfter","errorBoundarySomethingWentWrongText","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","Spacer","size","_Fragment","container","direction","item","alignContent","map","button","React","isValidElement","Box","onClick","history","length","ArrowLeft02","gap","Button","href","target","rel","FullWidthContainer","FDErrorBoundary","identifier","somethingWentWrongText"],"mappings":"kxBAoBO,MAAMA,EAA6B,2BAC7BC,EAAkC,gCAClCC,EAAmC,iCACnCC,EAA2B,yBAC3BC,EAAW,KAGlBC,EAAgBC,EAAO,MAAPA,EAAkC,EAAGC,QAAOC,YAAa,CAC3EJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,OAAQ,CAC5BN,SAAU,QAEdO,QAASJ,EAAMK,QAAQ,EAAG,GAC1BC,SAAU,WACVC,UAAW,YAGTC,EAAyBT,EAAOU,EAAPV,EAAa,EAAGC,YAAa,CACxD,CAACA,EAAME,YAAYC,KAAK,OAAQ,CAC5BO,MAAO,OACPC,WAAYX,EAAMK,QAA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=require("@mui/material/styles"),r=require("@mui/material/AppBar"),i=require("@mui/material/Box"),a=require("@mui/material/CssBaseline"),s=require("@mui/material/Drawer"),n=require("@mui/material/Typography");const l=198,o=t.styled("div")((({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:e.palette.semantic.background["background-sunken"],height:"65px",color:e.palette.semantic.text["text-weak"],borderBottom:`2px solid ${e.palette.semantic.stroke["stroke-weak"]}`}))),d=t.styled("div")((({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:e.palette.semantic.background["background-sunken"],height:"100%",color:e.palette.semantic.text["text-weak"]}))),m=t.styled(r)`
|
|
2
|
+
width: ${({theme:e})=>e.breakpoints.up("sm")?"calc(100% - 198px)":"100%"};
|
|
3
|
+
margin-left: ${({theme:e})=>e.breakpoints.up("sm")?"198px":"0"};
|
|
4
|
+
box-shadow: none;
|
|
5
|
+
`,p=t.styled(s)`
|
|
6
|
+
display: ${({theme:e})=>e.breakpoints.up("sm")?"block":"none"};
|
|
7
|
+
& .MuiDrawer-paper {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
width: ${l}px;
|
|
10
|
+
border-color: ${({theme:e})=>e.palette.semantic.stroke["stroke-weak"]};
|
|
11
|
+
border-width: 2px;
|
|
12
|
+
}
|
|
13
|
+
`,c=t.styled(i)`
|
|
14
|
+
width: ${({theme:e})=>e.breakpoints.up("sm")?"198px":"0"};
|
|
15
|
+
flex-shrink: ${({theme:e})=>e.breakpoints.up("sm")?"0":"1"};
|
|
16
|
+
`,x=t.styled(i)`
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
width: ${({theme:e})=>e.breakpoints.up("sm")?"calc(100% - 198px)":"100%"};
|
|
19
|
+
margin-top: 65px;
|
|
20
|
+
`,u=t.styled(n)`
|
|
21
|
+
font-weight: bold;
|
|
22
|
+
`;module.exports=({children:t,loadedFromPortal:r})=>{if(r)return e.jsx(e.Fragment,{children:t});const s=e.jsx(d,{children:e.jsx(u,{children:"Sidebar"})});return e.jsxs(i,{sx:{display:"flex"},children:[e.jsx(a,{}),e.jsx(m,{position:"fixed",children:e.jsx(o,{children:e.jsx(u,{children:"Header"})})}),e.jsx(c,{as:"nav","aria-label":"mailbox folders",children:e.jsx(p,{variant:"permanent",open:!0,children:s})}),e.jsx(x,{as:"main",children:t})]})};
|
|
2
23
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/PortalMock/index.tsx"],"sourcesContent":["import { styled
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/PortalMock/index.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport AppBar from '@mui/material/AppBar';\nimport Box from '@mui/material/Box';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport Drawer from '@mui/material/Drawer';\nimport Typography from '@mui/material/Typography';\n\nconst drawerWidth = 198;\n\nconst StyledHeader = styled('div')(({ theme }) => ({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: theme.palette.semantic.background['background-sunken'],\n height: '65px',\n color: theme.palette.semantic.text['text-weak'],\n borderBottom: `2px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n}));\n\nconst StyledSidebar = styled('div')(({ theme }) => ({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: theme.palette.semantic.background['background-sunken'],\n height: '100%',\n color: theme.palette.semantic.text['text-weak'],\n}));\n\nconst StyledAppBar = styled(AppBar)`\n width: ${({ theme }) => (theme.breakpoints.up('sm') ? `calc(100% - ${drawerWidth}px)` : '100%')};\n margin-left: ${({ theme }) => (theme.breakpoints.up('sm') ? `${drawerWidth}px` : '0')};\n box-shadow: none;\n`;\n\nconst StyledDrawer = styled(Drawer)`\n display: ${({ theme }) => (theme.breakpoints.up('sm') ? 'block' : 'none')};\n & .MuiDrawer-paper {\n box-sizing: border-box;\n width: ${drawerWidth}px;\n border-color: ${({ theme }) => theme.palette.semantic.stroke['stroke-weak']};\n border-width: 2px;\n }\n`;\n\nconst StyledNavBox = styled(Box)`\n width: ${({ theme }) => (theme.breakpoints.up('sm') ? `${drawerWidth}px` : '0')};\n flex-shrink: ${({ theme }) => (theme.breakpoints.up('sm') ? '0' : '1')};\n`;\n\nconst StyledMainBox = styled(Box)`\n flex-grow: 1;\n width: ${({ theme }) => (theme.breakpoints.up('sm') ? `calc(100% - ${drawerWidth}px)` : '100%')};\n margin-top: 65px;\n`;\n\nconst StyledBoldTypography = styled(Typography)`\n font-weight: bold;\n`;\n\ntype Props = {\n loadedFromPortal: boolean;\n children: React.ReactNode;\n};\n\nconst PortalMock = ({ children, loadedFromPortal }: Props) => {\n if (loadedFromPortal) {\n return <>{children}</>;\n }\n\n const drawer = (\n <StyledSidebar>\n <StyledBoldTypography>Sidebar</StyledBoldTypography>\n </StyledSidebar>\n );\n\n return (\n <Box sx={{ display: 'flex' }}>\n <CssBaseline />\n <StyledAppBar position=\"fixed\">\n <StyledHeader>\n <StyledBoldTypography>Header</StyledBoldTypography>\n </StyledHeader>\n </StyledAppBar>\n <StyledNavBox as=\"nav\" aria-label=\"mailbox folders\">\n <StyledDrawer variant=\"permanent\" open>\n {drawer}\n </StyledDrawer>\n </StyledNavBox>\n <StyledMainBox as=\"main\">{children}</StyledMainBox>\n </Box>\n );\n};\n\nexport default PortalMock;\n"],"names":["drawerWidth","StyledHeader","styled","theme","display","justifyContent","alignItems","backgroundColor","palette","semantic","background","height","color","text","borderBottom","stroke","StyledSidebar","StyledAppBar","AppBar","breakpoints","up","StyledDrawer","Drawer","StyledNavBox","Box","StyledMainBox","StyledBoldTypography","Typography","children","loadedFromPortal","_jsx","jsx","_Fragment","Fragment","drawer","_jsxs","jsxs","sx","CssBaseline","position","as","variant","open"],"mappings":"kQAOA,MAAMA,EAAc,IAEdC,EAAeC,EAAAA,OAAO,MAAPA,EAAc,EAAGC,YAAa,CAC/CC,QAAS,OACTC,eAAgB,SAChBC,WA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AA,GACZR,EAAAC,IAACd,EAAY,CAACsB,SAAS,QAAOX,SAC1BE,EAAAA,IAAC7B,EACG,CAAA2B,SAAAE,EAAAA,IAACJ,EAAoB,CAAAE,SAAA,eAG7BE,EAACC,IAAAR,EAAa,CAAAiB,GAAG,MAAiB,aAAA,kBAC9BZ,SAAAE,EAAAA,IAACT,EAAY,CAACoB,QAAQ,YAAYC,MAC7B,EAAAd,SAAAM,MAGTJ,EAAAA,IAACL,EAAc,CAAAe,GAAG,OAAQZ,SAAAA,MACxB"}
|
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import{styled as i}from"@mui/material/styles";import a from"@mui/material/AppBar";import o from"@mui/material/Box";import n from"@mui/material/CssBaseline";import m from"@mui/material/Drawer";import l from"@mui/material/Typography";const s=198,p=i("div")((({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:e.palette.semantic.background["background-sunken"],height:"65px",color:e.palette.semantic.text["text-weak"],borderBottom:`2px solid ${e.palette.semantic.stroke["stroke-weak"]}`}))),d=i("div")((({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:e.palette.semantic.background["background-sunken"],height:"100%",color:e.palette.semantic.text["text-weak"]}))),c=i(a)`
|
|
2
|
+
width: ${({theme:e})=>e.breakpoints.up("sm")?"calc(100% - 198px)":"100%"};
|
|
3
|
+
margin-left: ${({theme:e})=>e.breakpoints.up("sm")?"198px":"0"};
|
|
4
|
+
box-shadow: none;
|
|
5
|
+
`,h=i(m)`
|
|
6
|
+
display: ${({theme:e})=>e.breakpoints.up("sm")?"block":"none"};
|
|
7
|
+
& .MuiDrawer-paper {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
width: ${s}px;
|
|
10
|
+
border-color: ${({theme:e})=>e.palette.semantic.stroke["stroke-weak"]};
|
|
11
|
+
border-width: 2px;
|
|
12
|
+
}
|
|
13
|
+
`,u=i(o)`
|
|
14
|
+
width: ${({theme:e})=>e.breakpoints.up("sm")?"198px":"0"};
|
|
15
|
+
flex-shrink: ${({theme:e})=>e.breakpoints.up("sm")?"0":"1"};
|
|
16
|
+
`,x=i(o)`
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
width: ${({theme:e})=>e.breakpoints.up("sm")?"calc(100% - 198px)":"100%"};
|
|
19
|
+
margin-top: 65px;
|
|
20
|
+
`,b=i(l)`
|
|
21
|
+
font-weight: bold;
|
|
22
|
+
`,k=({children:i,loadedFromPortal:a})=>{if(a)return e(t,{children:i});const m=e(d,{children:e(b,{children:"Sidebar"})});return r(o,{sx:{display:"flex"},children:[e(n,{}),e(c,{position:"fixed",children:e(p,{children:e(b,{children:"Header"})})}),e(u,{as:"nav","aria-label":"mailbox folders",children:e(h,{variant:"permanent",open:!0,children:m})}),e(x,{as:"main",children:i})]})};export{k as default};
|
|
2
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/PortalMock/index.tsx"],"sourcesContent":["import { styled
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/PortalMock/index.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport AppBar from '@mui/material/AppBar';\nimport Box from '@mui/material/Box';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport Drawer from '@mui/material/Drawer';\nimport Typography from '@mui/material/Typography';\n\nconst drawerWidth = 198;\n\nconst StyledHeader = styled('div')(({ theme }) => ({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: theme.palette.semantic.background['background-sunken'],\n height: '65px',\n color: theme.palette.semantic.text['text-weak'],\n borderBottom: `2px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n}));\n\nconst StyledSidebar = styled('div')(({ theme }) => ({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: theme.palette.semantic.background['background-sunken'],\n height: '100%',\n color: theme.palette.semantic.text['text-weak'],\n}));\n\nconst StyledAppBar = styled(AppBar)`\n width: ${({ theme }) => (theme.breakpoints.up('sm') ? `calc(100% - ${drawerWidth}px)` : '100%')};\n margin-left: ${({ theme }) => (theme.breakpoints.up('sm') ? `${drawerWidth}px` : '0')};\n box-shadow: none;\n`;\n\nconst StyledDrawer = styled(Drawer)`\n display: ${({ theme }) => (theme.breakpoints.up('sm') ? 'block' : 'none')};\n & .MuiDrawer-paper {\n box-sizing: border-box;\n width: ${drawerWidth}px;\n border-color: ${({ theme }) => theme.palette.semantic.stroke['stroke-weak']};\n border-width: 2px;\n }\n`;\n\nconst StyledNavBox = styled(Box)`\n width: ${({ theme }) => (theme.breakpoints.up('sm') ? `${drawerWidth}px` : '0')};\n flex-shrink: ${({ theme }) => (theme.breakpoints.up('sm') ? '0' : '1')};\n`;\n\nconst StyledMainBox = styled(Box)`\n flex-grow: 1;\n width: ${({ theme }) => (theme.breakpoints.up('sm') ? `calc(100% - ${drawerWidth}px)` : '100%')};\n margin-top: 65px;\n`;\n\nconst StyledBoldTypography = styled(Typography)`\n font-weight: bold;\n`;\n\ntype Props = {\n loadedFromPortal: boolean;\n children: React.ReactNode;\n};\n\nconst PortalMock = ({ children, loadedFromPortal }: Props) => {\n if (loadedFromPortal) {\n return <>{children}</>;\n }\n\n const drawer = (\n <StyledSidebar>\n <StyledBoldTypography>Sidebar</StyledBoldTypography>\n </StyledSidebar>\n );\n\n return (\n <Box sx={{ display: 'flex' }}>\n <CssBaseline />\n <StyledAppBar position=\"fixed\">\n <StyledHeader>\n <StyledBoldTypography>Header</StyledBoldTypography>\n </StyledHeader>\n </StyledAppBar>\n <StyledNavBox as=\"nav\" aria-label=\"mailbox folders\">\n <StyledDrawer variant=\"permanent\" open>\n {drawer}\n </StyledDrawer>\n </StyledNavBox>\n <StyledMainBox as=\"main\">{children}</StyledMainBox>\n </Box>\n );\n};\n\nexport default PortalMock;\n"],"names":["drawerWidth","StyledHeader","styled","theme","display","justifyContent","alignItems","backgroundColor","palette","semantic","background","height","color","text","borderBottom","stroke","StyledSidebar","StyledAppBar","AppBar","breakpoints","up","StyledDrawer","Drawer","StyledNavBox","Box","StyledMainBox","StyledBoldTypography","Typography","PortalMock","children","loadedFromPortal","_jsx","_Fragment","drawer","_jsxs","sx","CssBaseline","position","as","variant","open"],"mappings":"wSAOA,MAAMA,EAAc,IAEdC,EAAeC,EAAO,MAAPA,EAAc,EAAGC,YAAa,CAC/CC,QAAS,OACTC,eAAgB,SAChBC,WAAY,SACZC,gBAAiBJ,EAAMK,QAAQC,SAASC,WAAW,qBACnDC,OAAQ,OACRC,MAAOT,EAAMK,QAAQC,SAASI,KAAK,aACnCC,aAAc,aAAaX,EAAMK,QAAQC,SAASM,OAAO,qBAGvDC,EAAgBd,EAAO,MAAPA,EAAc,EAAGC,YAAa,CAChDC,QAAS,OACTC,eAAgB,SAChBC,WAAY,SACZC,gBAAiBJ,EAAMK,QAAQC,SAASC,WAAW,qBACnDC,OAAQ,OACRC,MAAOT,EAAMK,QAAQC,SAASI,KAAK,iBAGjCI,EAAef,EAAOgB,EAAO;aACtB,EAAGf,WAAaA,EAAMgB,YAAYC,GAAG,MAAQ,qBAAkC;mBACzE,EAAGjB,WAAaA,EAAMgB,YAAYC,GAAG,MAAQ,QAAqB;;EAI/EC,EAAenB,EAAOoB,EAAO;eACpB,EAAGnB,WAAaA,EAAMgB,YAAYC,GAAG,MAAQ,QAAU;;;iBAGrDpB;wBACO,EAAGG,WAAYA,EAAMK,QAAQC,SAASM,OAAO;;;EAK/DQ,EAAerB,EAAOsB,EAAI;aACnB,EAAGrB,WAAaA,EAAMgB,YAAYC,GAAG,MAAQ,QAAqB;mBAC5D,EAAGjB,WAAaA,EAAMgB,YAAYC,GAAG,MAAQ,IAAM;EAGhEK,EAAgBvB,EAAOsB,EAAI;;aAEpB,EAAGrB,WAAaA,EAAMgB,YAAYC,GAAG,MAAQ,qBAAkC;;EAItFM,EAAuBxB,EAAOyB,EAAW;;EASzCC,EAAa,EAAGC,WAAUC,uBAC5B,GAAIA,EACA,OAAOC,EAAAC,EAAA,CAAAH,SAAGA,IAGd,MAAMI,EACFF,EAACf,EACG,CAAAa,SAAAE,EAACL,EAAoB,CAAAG,SAAA,cAI7B,OACIK,EAACV,EAAG,CAACW,GAAI,CAAE/B,QAAS,QAAQyB,SAAA,CACxBE,EAACK,EAAW,CAAA,GACZL,EAACd,EAAY,CAACoB,SAAS,QAAOR,SAC1BE,EAAC9B,EACG,CAAA4B,SAAAE,EAACL,EAAoB,CAAAG,SAAA,eAG7BE,EAACR,EAAa,CAAAe,GAAG,MAAiB,aAAA,kBAC9BT,SAAAE,EAACV,EAAY,CAACkB,QAAQ,YAAYC,MAC7B,EAAAX,SAAAI,MAGTF,EAACN,EAAc,CAAAa,GAAG,OAAQT,SAAAA,MACxB"}
|
|
@@ -13,4 +13,5 @@ type SwitchProps = {
|
|
|
13
13
|
};
|
|
14
14
|
declare const Switch: ({ label, checked, onChange, labelPlacement, size, disabled, testId }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
15
15
|
|
|
16
|
-
export {
|
|
16
|
+
export { Switch as default };
|
|
17
|
+
export type { SwitchProps };
|
|
@@ -8,4 +8,5 @@ type TooltipProps = {
|
|
|
8
8
|
};
|
|
9
9
|
declare const Tooltip: ({ text, iconSize }: TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
10
10
|
|
|
11
|
-
export { ICON_SIZES,
|
|
11
|
+
export { ICON_SIZES, Tooltip as default };
|
|
12
|
+
export type { TooltipProps, TooltopIconSize };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material/Box"),a=require("@mui/material/styles");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=n(t);const s={background:{filled:{brand:e=>e.palette.semantic.fill["fill-primary-weak"],destructive:e=>e.palette.semantic.fill["fill-error-weak"],warning:e=>e.palette.semantic.fill["fill-warning-weak"],success:e=>e.palette.semantic.fill["fill-success-weak"],information:e=>e.palette.semantic.fill["fill-information-weak"],neutral:e=>e.palette.semantic.fill["fill-weak"]},stroked:{brand:()=>"transparent",destructive:()=>"transparent",warning:()=>"transparent",success:()=>"transparent",information:()=>"transparent",neutral:()=>"transparent"}},border:{filled:{brand:()=>"transparent",destructive:()=>"transparent",warning:()=>"transparent",success:()=>"transparent",information:()=>"transparent",neutral:()=>"transparent"},stroked:{brand:e=>e.palette.semantic.stroke["stroke-primary-weak"],destructive:e=>e.palette.semantic.stroke["stroke-error-weak"],warning:e=>e.palette.semantic.stroke["stroke-warning-weak"],success:e=>e.palette.semantic.stroke["stroke-success-weak"],information:e=>e.palette.semantic.stroke["stroke-information-weak"],neutral:e=>e.palette.semantic.stroke["stroke-weak"]}},icon:{brand:e=>e.palette.semantic.icon["icon-primary"],destructive:e=>e.palette.semantic.icon["icon-error"],warning:e=>e.palette.semantic.icon["icon-warning"],success:e=>e.palette.semantic.icon["icon-success"],information:e=>e.palette.semantic.icon["icon-information"],neutral:e=>e.palette.semantic.icon["icon-strong"]}},o=(e,t,r)=>s.background[r][t](e),l=(e,t,r)=>s.border[r][t](e),c=(e,t)=>s.icon[t](e),d=a.styled(r,{shouldForwardProp:e=>!["tone","containerStyle"].includes(e)})((({theme:e,tone:t,containerStyle:r})=>({display:"flex",alignItems:"center",justifyContent:"center",width:"48px",height:"48px",borderRadius:"50%",backgroundColor:o(e,t,r),border:"stroked"===r?"1px solid":"none",borderColor:l(e,t,r),boxSizing:"border-box",color:c(e,t)}))),u=i.memo((({icon:t,tone:r="neutral",style:a="filled",ariaLabel:n,className:i,"data-testid":s})=>{const o=n?{"aria-label":n,role:"graphics-symbol"}:{"aria-hidden":!0};return e.jsx(d,{tone:r,containerStyle:a,className:i,"data-testid":s,...o,children:t})}));u.displayName="IconContainer",module.exports=u;
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/IconContainer/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport Box from '@mui/material/Box';\nimport { styled, type Theme } from '@mui/material/styles';\n\nexport type IconContainerTones = 'neutral' | 'brand' | 'destructive' | 'warning' | 'success' | 'information';\nexport type IconContainerStyle = 'filled' | 'stroked';\n\nexport interface IconContainerProps {\n /** Icon element to display in the container */\n icon: React.ReactNode;\n /** Visual tone of the container */\n tone?: IconContainerTones;\n /** Visual style of the container */\n style?: IconContainerStyle;\n /** Accessible description of the icon (for screen readers) */\n ariaLabel?: string;\n /** Additional class names */\n className?: string;\n /** Test ID for testing and automation */\n 'data-testid'?: string;\n}\n\n/** Color mapping for different tones and styles */\nconst COLORS = {\n background: {\n filled: {\n brand: (theme: Theme) => theme.palette.semantic.fill['fill-primary-weak'],\n destructive: (theme: Theme) => theme.palette.semantic.fill['fill-error-weak'],\n warning: (theme: Theme) => theme.palette.semantic.fill['fill-warning-weak'],\n success: (theme: Theme) => theme.palette.semantic.fill['fill-success-weak'],\n information: (theme: Theme) => theme.palette.semantic.fill['fill-information-weak'],\n neutral: (theme: Theme) => theme.palette.semantic.fill['fill-weak'],\n },\n stroked: {\n brand: () => 'transparent',\n destructive: () => 'transparent',\n warning: () => 'transparent',\n success: () => 'transparent',\n information: () => 'transparent',\n neutral: () => 'transparent',\n },\n },\n border: {\n filled: {\n brand: () => 'transparent',\n destructive: () => 'transparent',\n warning: () => 'transparent',\n success: () => 'transparent',\n information: () => 'transparent',\n neutral: () => 'transparent',\n },\n stroked: {\n brand: (theme: Theme) => theme.palette.semantic.stroke['stroke-primary-weak'],\n destructive: (theme: Theme) => theme.palette.semantic.stroke['stroke-error-weak'],\n warning: (theme: Theme) => theme.palette.semantic.stroke['stroke-warning-weak'],\n success: (theme: Theme) => theme.palette.semantic.stroke['stroke-success-weak'],\n information: (theme: Theme) => theme.palette.semantic.stroke['stroke-information-weak'],\n neutral: (theme: Theme) => theme.palette.semantic.stroke['stroke-weak'],\n },\n },\n icon: {\n brand: (theme: Theme) => theme.palette.semantic.icon['icon-primary'],\n destructive: (theme: Theme) => theme.palette.semantic.icon['icon-error'],\n warning: (theme: Theme) => theme.palette.semantic.icon['icon-warning'],\n success: (theme: Theme) => theme.palette.semantic.icon['icon-success'],\n information: (theme: Theme) => theme.palette.semantic.icon['icon-information'],\n neutral: (theme: Theme) => theme.palette.semantic.icon['icon-strong'],\n },\n};\n\nconst getBackgroundColor = (theme: Theme, tone: IconContainerTones, style: IconContainerStyle): string => {\n return COLORS.background[style][tone](theme);\n};\n\nconst getBorderColor = (theme: Theme, tone: IconContainerTones, style: IconContainerStyle): string => {\n return COLORS.border[style][tone](theme);\n};\n\nconst getIconColor = (theme: Theme, tone: IconContainerTones): string => {\n return COLORS.icon[tone](theme);\n};\n\ninterface StyledBoxProps {\n tone: IconContainerTones;\n containerStyle: IconContainerStyle;\n}\n\nconst StyledBox = styled(Box, {\n shouldForwardProp: (prop) => !['tone', 'containerStyle'].includes(prop as string),\n})<StyledBoxProps>(({ theme, tone, containerStyle }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '48px',\n height: '48px',\n borderRadius: '50%',\n backgroundColor: getBackgroundColor(theme, tone, containerStyle),\n border: containerStyle === 'stroked' ? '1px solid' : 'none',\n borderColor: getBorderColor(theme, tone, containerStyle),\n boxSizing: 'border-box',\n color: getIconColor(theme, tone),\n}));\n\n/**\n * IconContainer component is used to make icons appear larger and more prominent while \ngiving them a consistent shape.\n *\n * React.memo is used to optimize performance by preventing unnecessary re-renders\n * when the component's props haven't changed, which is beneficial for components\n * that may be used frequently throughout the application.\n */\nconst IconContainer = React.memo(\n ({ icon, tone = 'neutral', style = 'filled', ariaLabel, className, 'data-testid': dataTestId }: IconContainerProps) => {\n // Only set aria-hidden if no ariaLabel is provided\n const ariaProps = ariaLabel ? { 'aria-label': ariaLabel, role: 'graphics-symbol' } : { 'aria-hidden': true };\n\n return (\n <StyledBox tone={tone} containerStyle={style} className={className} data-testid={dataTestId} {...ariaProps}>\n {icon}\n </StyledBox>\n );\n },\n);\n\nIconContainer.displayName = 'IconContainer';\n\nexport default IconContainer;\n"],"names":["COLORS","background","filled","brand","theme","palette","semantic","fill","destructive","warning","success","information","neutral","stroked","border","stroke","icon","getBackgroundColor","tone","style","getBorderColor","getIconColor","StyledBox","styled","Box","shouldForwardProp","prop","includes","containerStyle","display","alignItems","justifyContent","width","height","borderRadius","backgroundColor","borderColor","boxSizing","color","IconContainer","React","memo","ariaLabel","className","dataTestId","ariaProps","role","_jsx","children","displayName"],"mappings":"kZAuBA,MAAMA,EAAS,CACXC,WAAY,CACRC,OAAQ,CACJC,MAAQC,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,qBACrDC,YAAcJ,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,mBAC3DE,QAAUL,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,qBACvDG,QAAUN,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,qBACvDI,YAAcP,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,yBAC3DK,QAAUR,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,cAE3DM,QAAS,CACLV,MAAO,IAAM,cACbK,YAAa,IAAM,cACnBC,QAAS,IAAM,cACfC,QAAS,IAAM,cACfC,YAAa,IAAM,cACnBC,QAAS,IAAM,gBAGvBE,OAAQ,CACJZ,OAAQ,CACJC,MAAO,IAAM,cACbK,YAAa,IAAM,cACnBC,QAAS,IAAM,cACfC,QAAS,IAAM,cACfC,YAAa,IAAM,cACnBC,QAAS,IAAM,eAEnBC,QAAS,CACLV,MAAQC,GAAiBA,EAAMC,QAAQC,SAASS,OAAO,uBACvDP,YAAcJ,GAAiBA,EAAMC,QAAQC,SAASS,OAAO,qBAC7DN,QAAUL,G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KAAM,mBAAsB,CAAE,eAAe,GAEtG,OACIC,EAAAA,IAACzB,EAAS,CAACJ,KAAMA,EAAMU,eAAgBT,EAAOwB,UAAWA,EAAS,cAAeC,KAAgBC,EAC5FG,SAAAhC,GACO,IAKxBuB,EAAcU,YAAc"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
|
|
4
|
+
type IconContainerTones = 'neutral' | 'brand' | 'destructive' | 'warning' | 'success' | 'information';
|
|
5
|
+
type IconContainerStyle = 'filled' | 'stroked';
|
|
6
|
+
interface IconContainerProps {
|
|
7
|
+
/** Icon element to display in the container */
|
|
8
|
+
icon: react.ReactNode;
|
|
9
|
+
/** Visual tone of the container */
|
|
10
|
+
tone?: IconContainerTones;
|
|
11
|
+
/** Visual style of the container */
|
|
12
|
+
style?: IconContainerStyle;
|
|
13
|
+
/** Accessible description of the icon (for screen readers) */
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
/** Additional class names */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Test ID for testing and automation */
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* IconContainer component is used to make icons appear larger and more prominent while
|
|
22
|
+
giving them a consistent shape.
|
|
23
|
+
*
|
|
24
|
+
* React.memo is used to optimize performance by preventing unnecessary re-renders
|
|
25
|
+
* when the component's props haven't changed, which is beneficial for components
|
|
26
|
+
* that may be used frequently throughout the application.
|
|
27
|
+
*/
|
|
28
|
+
declare const IconContainer: react.MemoExoticComponent<({ icon, tone, style, ariaLabel, className, "data-testid": dataTestId }: IconContainerProps) => react_jsx_runtime.JSX.Element>;
|
|
29
|
+
|
|
30
|
+
export { IconContainer as default };
|
|
31
|
+
export type { IconContainerProps, IconContainerStyle, IconContainerTones };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import*as t from"react";import a from"@mui/material/Box";import{styled as r}from"@mui/material/styles";const n={background:{filled:{brand:e=>e.palette.semantic.fill["fill-primary-weak"],destructive:e=>e.palette.semantic.fill["fill-error-weak"],warning:e=>e.palette.semantic.fill["fill-warning-weak"],success:e=>e.palette.semantic.fill["fill-success-weak"],information:e=>e.palette.semantic.fill["fill-information-weak"],neutral:e=>e.palette.semantic.fill["fill-weak"]},stroked:{brand:()=>"transparent",destructive:()=>"transparent",warning:()=>"transparent",success:()=>"transparent",information:()=>"transparent",neutral:()=>"transparent"}},border:{filled:{brand:()=>"transparent",destructive:()=>"transparent",warning:()=>"transparent",success:()=>"transparent",information:()=>"transparent",neutral:()=>"transparent"},stroked:{brand:e=>e.palette.semantic.stroke["stroke-primary-weak"],destructive:e=>e.palette.semantic.stroke["stroke-error-weak"],warning:e=>e.palette.semantic.stroke["stroke-warning-weak"],success:e=>e.palette.semantic.stroke["stroke-success-weak"],information:e=>e.palette.semantic.stroke["stroke-information-weak"],neutral:e=>e.palette.semantic.stroke["stroke-weak"]}},icon:{brand:e=>e.palette.semantic.icon["icon-primary"],destructive:e=>e.palette.semantic.icon["icon-error"],warning:e=>e.palette.semantic.icon["icon-warning"],success:e=>e.palette.semantic.icon["icon-success"],information:e=>e.palette.semantic.icon["icon-information"],neutral:e=>e.palette.semantic.icon["icon-strong"]}},i=(e,t,a)=>n.background[a][t](e),s=(e,t,a)=>n.border[a][t](e),o=(e,t)=>n.icon[t](e),l=r(a,{shouldForwardProp:e=>!["tone","containerStyle"].includes(e)})((({theme:e,tone:t,containerStyle:a})=>({display:"flex",alignItems:"center",justifyContent:"center",width:"48px",height:"48px",borderRadius:"50%",backgroundColor:i(e,t,a),border:"stroked"===a?"1px solid":"none",borderColor:s(e,t,a),boxSizing:"border-box",color:o(e,t)}))),c=t.memo((({icon:t,tone:a="neutral",style:r="filled",ariaLabel:n,className:i,"data-testid":s})=>e(l,{tone:a,containerStyle:r,className:i,"data-testid":s,...n?{"aria-label":n,role:"graphics-symbol"}:{"aria-hidden":!0},children:t})));c.displayName="IconContainer";export{c as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/IconContainer/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport Box from '@mui/material/Box';\nimport { styled, type Theme } from '@mui/material/styles';\n\nexport type IconContainerTones = 'neutral' | 'brand' | 'destructive' | 'warning' | 'success' | 'information';\nexport type IconContainerStyle = 'filled' | 'stroked';\n\nexport interface IconContainerProps {\n /** Icon element to display in the container */\n icon: React.ReactNode;\n /** Visual tone of the container */\n tone?: IconContainerTones;\n /** Visual style of the container */\n style?: IconContainerStyle;\n /** Accessible description of the icon (for screen readers) */\n ariaLabel?: string;\n /** Additional class names */\n className?: string;\n /** Test ID for testing and automation */\n 'data-testid'?: string;\n}\n\n/** Color mapping for different tones and styles */\nconst COLORS = {\n background: {\n filled: {\n brand: (theme: Theme) => theme.palette.semantic.fill['fill-primary-weak'],\n destructive: (theme: Theme) => theme.palette.semantic.fill['fill-error-weak'],\n warning: (theme: Theme) => theme.palette.semantic.fill['fill-warning-weak'],\n success: (theme: Theme) => theme.palette.semantic.fill['fill-success-weak'],\n information: (theme: Theme) => theme.palette.semantic.fill['fill-information-weak'],\n neutral: (theme: Theme) => theme.palette.semantic.fill['fill-weak'],\n },\n stroked: {\n brand: () => 'transparent',\n destructive: () => 'transparent',\n warning: () => 'transparent',\n success: () => 'transparent',\n information: () => 'transparent',\n neutral: () => 'transparent',\n },\n },\n border: {\n filled: {\n brand: () => 'transparent',\n destructive: () => 'transparent',\n warning: () => 'transparent',\n success: () => 'transparent',\n information: () => 'transparent',\n neutral: () => 'transparent',\n },\n stroked: {\n brand: (theme: Theme) => theme.palette.semantic.stroke['stroke-primary-weak'],\n destructive: (theme: Theme) => theme.palette.semantic.stroke['stroke-error-weak'],\n warning: (theme: Theme) => theme.palette.semantic.stroke['stroke-warning-weak'],\n success: (theme: Theme) => theme.palette.semantic.stroke['stroke-success-weak'],\n information: (theme: Theme) => theme.palette.semantic.stroke['stroke-information-weak'],\n neutral: (theme: Theme) => theme.palette.semantic.stroke['stroke-weak'],\n },\n },\n icon: {\n brand: (theme: Theme) => theme.palette.semantic.icon['icon-primary'],\n destructive: (theme: Theme) => theme.palette.semantic.icon['icon-error'],\n warning: (theme: Theme) => theme.palette.semantic.icon['icon-warning'],\n success: (theme: Theme) => theme.palette.semantic.icon['icon-success'],\n information: (theme: Theme) => theme.palette.semantic.icon['icon-information'],\n neutral: (theme: Theme) => theme.palette.semantic.icon['icon-strong'],\n },\n};\n\nconst getBackgroundColor = (theme: Theme, tone: IconContainerTones, style: IconContainerStyle): string => {\n return COLORS.background[style][tone](theme);\n};\n\nconst getBorderColor = (theme: Theme, tone: IconContainerTones, style: IconContainerStyle): string => {\n return COLORS.border[style][tone](theme);\n};\n\nconst getIconColor = (theme: Theme, tone: IconContainerTones): string => {\n return COLORS.icon[tone](theme);\n};\n\ninterface StyledBoxProps {\n tone: IconContainerTones;\n containerStyle: IconContainerStyle;\n}\n\nconst StyledBox = styled(Box, {\n shouldForwardProp: (prop) => !['tone', 'containerStyle'].includes(prop as string),\n})<StyledBoxProps>(({ theme, tone, containerStyle }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '48px',\n height: '48px',\n borderRadius: '50%',\n backgroundColor: getBackgroundColor(theme, tone, containerStyle),\n border: containerStyle === 'stroked' ? '1px solid' : 'none',\n borderColor: getBorderColor(theme, tone, containerStyle),\n boxSizing: 'border-box',\n color: getIconColor(theme, tone),\n}));\n\n/**\n * IconContainer component is used to make icons appear larger and more prominent while \ngiving them a consistent shape.\n *\n * React.memo is used to optimize performance by preventing unnecessary re-renders\n * when the component's props haven't changed, which is beneficial for components\n * that may be used frequently throughout the application.\n */\nconst IconContainer = React.memo(\n ({ icon, tone = 'neutral', style = 'filled', ariaLabel, className, 'data-testid': dataTestId }: IconContainerProps) => {\n // Only set aria-hidden if no ariaLabel is provided\n const ariaProps = ariaLabel ? { 'aria-label': ariaLabel, role: 'graphics-symbol' } : { 'aria-hidden': true };\n\n return (\n <StyledBox tone={tone} containerStyle={style} className={className} data-testid={dataTestId} {...ariaProps}>\n {icon}\n </StyledBox>\n );\n },\n);\n\nIconContainer.displayName = 'IconContainer';\n\nexport default IconContainer;\n"],"names":["COLORS","background","filled","brand","theme","palette","semantic","fill","destructive","warning","success","information","neutral","stroked","border","stroke","icon","getBackgroundColor","tone","style","getBorderColor","getIconColor","StyledBox","styled","Box","shouldForwardProp","prop","includes","containerStyle","display","alignItems","justifyContent","width","height","borderRadius","backgroundColor","borderColor","boxSizing","color","IconContainer","React","memo","ariaLabel","className","dataTestId","_jsx","role","children","displayName"],"mappings":"+IAuBA,MAAMA,EAAS,CACXC,WAAY,CACRC,OAAQ,CACJC,MAAQC,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,qBACrDC,YAAcJ,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,mBAC3DE,QAAUL,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,qBACvDG,QAAUN,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,qBACvDI,YAAcP,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,yBAC3DK,QAAUR,GAAiBA,EAAMC,QAAQC,SAASC,KAAK,cAE3DM,QAAS,CACLV,MAAO,IAAM,cACbK,YAAa,IAAM,cACnBC,QAAS,IAAM,cACfC,QAAS,IAAM,cACfC,YAAa,IAAM,cACnBC,QAAS,IAAM,gBAGvBE,OAAQ,CACJZ,OAAQ,CACJC,MAAO,IAAM,cACbK,YAAa,IAAM,cACnBC,QAAS,IAAM,cACfC,QAAS,IAAM,cACfC,YAAa,IAAM,cACnBC,QAAS,IAAM,eAEnBC,QAAS,CACLV,MAAQC,GAAiBA,EAAMC,QAAQC,SAASS,OAAO,uBACvDP,YAAcJ,GAAiBA,EAAMC,QAAQC,SAASS,OAAO,qBAC7DN,QAAUL,GAA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wB,UAAWA,EAAS,cAAeC,KAHnEF,EAAY,CAAE,aAAcA,EAAWI,KAAM,mBAAsB,CAAE,eAAe,GAI7FC,SAAA/B,MAMjBuB,EAAcS,YAAc"}
|
|
@@ -56,4 +56,5 @@ interface UseToastsReturn {
|
|
|
56
56
|
*/
|
|
57
57
|
declare const useToasts: () => UseToastsReturn;
|
|
58
58
|
|
|
59
|
-
export {
|
|
59
|
+
export { useToasts as default };
|
|
60
|
+
export type { ToastKey, ToastOptions, UseToastsReturn };
|
|
@@ -7,4 +7,5 @@ interface WithSvgIconProps {
|
|
|
7
7
|
}
|
|
8
8
|
declare const withSvgIcon: (WrappedComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>) => react.FC<WithSvgIconProps>;
|
|
9
9
|
|
|
10
|
-
export {
|
|
10
|
+
export { withSvgIcon as default };
|
|
11
|
+
export type { IconSize, WithSvgIconProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/styles"),r=require("notistack");const n=t.styled(r.MaterialDesignContent)((({theme:e})=>({"&.notistack-MuiContent-default":{backgroundColor:e.palette.semantic.
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/styles"),r=require("notistack");const n=t.styled(r.MaterialDesignContent)((({theme:e})=>({"&.notistack-MuiContent-default":{backgroundColor:e.palette.semantic.fill["fill-black"]},"&.notistack-MuiContent-success":{backgroundColor:e.palette.success.main},"&.notistack-MuiContent-error":{backgroundColor:e.palette.error.main}})));module.exports=({children:t})=>e.jsx(r.SnackbarProvider,{maxSnack:3,anchorOrigin:{vertical:"bottom",horizontal:"center"},Components:{success:n,error:n,default:n},children:t});
|
|
2
2
|
//# sourceMappingURL=ToastProvider.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastProvider.cjs.js","sources":["../../src/providers/ToastProvider.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport { SnackbarProvider, MaterialDesignContent } from 'notistack';\n\nconst StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({\n '&.notistack-MuiContent-default': {\n backgroundColor: theme.palette.semantic.
|
|
1
|
+
{"version":3,"file":"ToastProvider.cjs.js","sources":["../../src/providers/ToastProvider.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport { SnackbarProvider, MaterialDesignContent } from 'notistack';\n\nconst StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({\n '&.notistack-MuiContent-default': {\n backgroundColor: theme.palette.semantic.fill['fill-black'],\n },\n '&.notistack-MuiContent-success': {\n backgroundColor: theme.palette.success.main,\n },\n '&.notistack-MuiContent-error': {\n backgroundColor: theme.palette.error.main,\n },\n}));\n\n/**\n * ToastProvider component that wraps the application with notistack's SnackbarProvider.\n * Provides a centralized toast notification system with custom styling.\n *\n * Features:\n * - Maximum of 3 notifications displayed simultaneously\n * - Notifications appear at the bottom center of the scree\n *\n * @param {Object} props - Component props\n * @param {React.ReactNode} props.children - Child components to be wrapped by the provider\n * @returns {JSX.Element} ToastProvider component\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * </ToastProvider>\n * ```\n */\nconst ToastProvider = ({ children }: { children: React.ReactNode }) => {\n return (\n <SnackbarProvider\n maxSnack={3}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n Components={{\n success: StyledMaterialDesignContent,\n error: StyledMaterialDesignContent,\n default: StyledMaterialDesignContent,\n }}\n >\n {children}\n </SnackbarProvider>\n );\n};\n\nexport default ToastProvider;\n"],"names":["StyledMaterialDesignContent","styled","MaterialDesignContent","theme","backgroundColor","palette","semantic","fill","success","main","error","children","_jsx","SnackbarProvider","maxSnack","anchorOrigin","vertical","horizontal","Components","default"],"mappings":"yGAGA,MAAMA,EAA8BC,EAAAA,OAAOC,EAAAA,sBAAPD,EAA8B,EAAGE,YAAa,CAC9E,iCAAkC,CAC9BC,gBAAiBD,EAAME,QAAQC,SAASC,KAAK,eAEjD,iCAAkC,CAC9BH,gBAAiBD,EAAME,QAAQG,QAAQC,MAE3C,+BAAgC,CAC5BL,gBAAiBD,EAAME,QAAQK,MAAMD,yBAuBvB,EAAGE,cAEjBC,MAACC,EAAgBA,iBAAA,CACbC,SAAU,EACVC,aAAc,CACVC,SAAU,SACVC,WAAY,UAEhBC,WAAY,CACRV,QAASR,EACTU,MAAOV,EACPmB,QAASnB,GAGZW,SAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{styled as o}from"@mui/material/styles";import{MaterialDesignContent as e,SnackbarProvider as r}from"notistack";const n=o(e)((({theme:t})=>({"&.notistack-MuiContent-default":{backgroundColor:t.palette.semantic.
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{styled as o}from"@mui/material/styles";import{MaterialDesignContent as e,SnackbarProvider as r}from"notistack";const n=o(e)((({theme:t})=>({"&.notistack-MuiContent-default":{backgroundColor:t.palette.semantic.fill["fill-black"]},"&.notistack-MuiContent-success":{backgroundColor:t.palette.success.main},"&.notistack-MuiContent-error":{backgroundColor:t.palette.error.main}}))),a=({children:o})=>t(r,{maxSnack:3,anchorOrigin:{vertical:"bottom",horizontal:"center"},Components:{success:n,error:n,default:n},children:o});export{a as default};
|
|
2
2
|
//# sourceMappingURL=ToastProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastProvider.js","sources":["../../src/providers/ToastProvider.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport { SnackbarProvider, MaterialDesignContent } from 'notistack';\n\nconst StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({\n '&.notistack-MuiContent-default': {\n backgroundColor: theme.palette.semantic.
|
|
1
|
+
{"version":3,"file":"ToastProvider.js","sources":["../../src/providers/ToastProvider.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport { SnackbarProvider, MaterialDesignContent } from 'notistack';\n\nconst StyledMaterialDesignContent = styled(MaterialDesignContent)(({ theme }) => ({\n '&.notistack-MuiContent-default': {\n backgroundColor: theme.palette.semantic.fill['fill-black'],\n },\n '&.notistack-MuiContent-success': {\n backgroundColor: theme.palette.success.main,\n },\n '&.notistack-MuiContent-error': {\n backgroundColor: theme.palette.error.main,\n },\n}));\n\n/**\n * ToastProvider component that wraps the application with notistack's SnackbarProvider.\n * Provides a centralized toast notification system with custom styling.\n *\n * Features:\n * - Maximum of 3 notifications displayed simultaneously\n * - Notifications appear at the bottom center of the scree\n *\n * @param {Object} props - Component props\n * @param {React.ReactNode} props.children - Child components to be wrapped by the provider\n * @returns {JSX.Element} ToastProvider component\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * </ToastProvider>\n * ```\n */\nconst ToastProvider = ({ children }: { children: React.ReactNode }) => {\n return (\n <SnackbarProvider\n maxSnack={3}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n Components={{\n success: StyledMaterialDesignContent,\n error: StyledMaterialDesignContent,\n default: StyledMaterialDesignContent,\n }}\n >\n {children}\n </SnackbarProvider>\n );\n};\n\nexport default ToastProvider;\n"],"names":["StyledMaterialDesignContent","styled","MaterialDesignContent","theme","backgroundColor","palette","semantic","fill","success","main","error","ToastProvider","children","_jsx","SnackbarProvider","maxSnack","anchorOrigin","vertical","horizontal","Components","default"],"mappings":"8JAGA,MAAMA,EAA8BC,EAAOC,EAAPD,EAA8B,EAAGE,YAAa,CAC9E,iCAAkC,CAC9BC,gBAAiBD,EAAME,QAAQC,SAASC,KAAK,eAEjD,iCAAkC,CAC9BH,gBAAiBD,EAAME,QAAQG,QAAQC,MAE3C,+BAAgC,CAC5BL,gBAAiBD,EAAME,QAAQK,MAAMD,UAuBvCE,EAAgB,EAAGC,cAEjBC,EAACC,EAAgB,CACbC,SAAU,EACVC,aAAc,CACVC,SAAU,SACVC,WAAY,UAEhBC,WAAY,CACRX,QAASR,EACTU,MAAOV,EACPoB,QAASpB,GAGZY,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@mui/material/styles"),i=require("@mui/material/CssBaseline"),s=require("./flipdishPublicTheme.cjs.js");module.exports=({children:m,themeModeOverride:t})=>{const{mode:u}=r.useColorScheme(),h="dark"===(t||u)?s.darkTheme:s.lightTheme;return e.jsxs(r.ThemeProvider,{theme:h,children:[e.jsx(i,{}),m]})};
|
|
2
|
+
//# sourceMappingURL=ThemeProvider.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeProvider.cjs.js","sources":["../../src/themes/ThemeProvider.tsx"],"sourcesContent":["import { ThemeProvider as MuiThemeProvider, useColorScheme } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { lightTheme, darkTheme } from './flipdishPublicTheme';\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n themeModeOverride?: 'light' | 'dark';\n}\n\nconst ThemeProvider = ({ children, themeModeOverride }: ThemeProviderProps) => {\n const { mode } = useColorScheme();\n const themeMode = themeModeOverride || mode;\n const theme = themeMode === 'dark' ? darkTheme : lightTheme;\n\n return (\n <MuiThemeProvider theme={theme}>\n <CssBaseline />\n {children}\n </MuiThemeProvider>\n );\n};\n\nexport default ThemeProvider;\n"],"names":["children","themeModeOverride","mode","useColorScheme","theme","darkTheme","lightTheme","_jsxs","MuiThemeProvider","_jsx","CssBaseline"],"mappings":"kLASsB,EAAGA,WAAUC,wBAC/B,MAAMC,KAAEA,GAASC,mBAEXC,EAAsB,UADVH,GAAqBC,GACFG,EAASA,UAAGC,EAAUA,WAE3D,OACIC,OAACC,EAAAA,cAAgB,CAACJ,MAAOA,EACrBJ,SAAA,CAAAS,EAAAA,IAACC,EAAc,CAAA,GACdV,IACc"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface ThemeProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
themeModeOverride?: 'light' | 'dark';
|
|
6
|
+
}
|
|
7
|
+
declare const ThemeProvider: ({ children, themeModeOverride }: ThemeProviderProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { ThemeProvider as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useColorScheme as m,ThemeProvider as i}from"@mui/material/styles";import t from"@mui/material/CssBaseline";import{darkTheme as o,lightTheme as s}from"./flipdishPublicTheme.js";const a=({children:a,themeModeOverride:d})=>{const{mode:l}=m();return e(i,{theme:"dark"===(d||l)?o:s,children:[r(t,{}),a]})};export{a as default};
|
|
2
|
+
//# sourceMappingURL=ThemeProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","sources":["../../src/themes/ThemeProvider.tsx"],"sourcesContent":["import { ThemeProvider as MuiThemeProvider, useColorScheme } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { lightTheme, darkTheme } from './flipdishPublicTheme';\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n themeModeOverride?: 'light' | 'dark';\n}\n\nconst ThemeProvider = ({ children, themeModeOverride }: ThemeProviderProps) => {\n const { mode } = useColorScheme();\n const themeMode = themeModeOverride || mode;\n const theme = themeMode === 'dark' ? darkTheme : lightTheme;\n\n return (\n <MuiThemeProvider theme={theme}>\n <CssBaseline />\n {children}\n </MuiThemeProvider>\n );\n};\n\nexport default ThemeProvider;\n"],"names":["ThemeProvider","children","themeModeOverride","mode","useColorScheme","_jsxs","MuiThemeProvider","theme","darkTheme","lightTheme","_jsx","CssBaseline"],"mappings":"yOASM,MAAAA,EAAgB,EAAGC,WAAUC,wBAC/B,MAAMC,KAAEA,GAASC,IAIjB,OACIC,EAACC,EAAgB,CAACC,MAHM,UADVL,GAAqBC,GACFK,EAAYC,EAIzCR,SAAA,CAAAS,EAACC,EAAc,CAAA,GACdV,IACc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@mui/material/styles/createTheme")
|
|
1
|
+
"use strict";var e=require("@mui/material/styles/createTheme");require("./tokens/colours/primitives.cjs.js");var r=require("./tokens/colours/semantic.cjs.js"),o=require("./typography.cjs.js");const t=t=>{const i=e({typography:o.typography,palette:"light"===t?r.lightColours:r.darkColours});return e(i,{shape:{borderRadius:"4px"},components:{MuiButton:{styleOverrides:{root:{padding:"12px 24px",textTransform:"none"}}},MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:i.palette.divider}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold",paddingLeft:"6px",paddingRight:"6px"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:i.palette.semantic.fill["fill-primary-weak"]},"&:not(:last-child)":{borderBottom:`1px solid ${i.palette.semantic.stroke["stroke-weak"]}`}}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:i.palette.semantic.fill["fill-secondary"],cursor:"pointer"}}}}}})},i=t("light"),s=t("dark");exports.darkTheme=s,exports.lightTheme=i;
|
|
2
2
|
//# sourceMappingURL=flipdishPublicTheme.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flipdishPublicTheme.cjs.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type ThemeOptions } from '@mui/material/styles/createTheme';\nimport {
|
|
1
|
+
{"version":3,"file":"flipdishPublicTheme.cjs.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type ThemeOptions } from '@mui/material/styles/createTheme';\nimport { lightColours, darkColours } from './tokens/colours';\nimport { typography } from './typography';\n\nconst createFlipdishThemeFactory = (mode: 'light' | 'dark') => {\n const baseTheme = createTheme({\n typography,\n palette: mode === 'light' ? lightColours : darkColours,\n });\n\n // Create final theme with component overrides and additional configurations\n return createTheme(baseTheme as ThemeOptions, {\n shape: {\n borderRadius: '4px',\n },\n components: {\n MuiButton: {\n styleOverrides: {\n root: {\n padding: '12px 24px',\n textTransform: 'none',\n },\n },\n },\n MuiCard: {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: baseTheme.palette.divider,\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n paddingLeft: '6px',\n paddingRight: '6px',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-primary-weak'],\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${baseTheme.palette.semantic.stroke['stroke-weak']}`,\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n '&.MuiTableRow-hover:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-secondary'],\n cursor: 'pointer',\n },\n },\n },\n },\n },\n });\n};\n\nexport const lightTheme = createFlipdishThemeFactory('light');\nexport const darkTheme = createFlipdishThemeFactory('dark');\n"],"names":["createFlipdishThemeFactory","mode","baseTheme","createTheme","typography","palette","lightColours","darkColours","shape","borderRadius","components","MuiButton","styleOverrides","root","padding","textTransform","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","divider","MuiChip","fontWeight","paddingLeft","paddingRight","MuiListItemButton","backgroundColor","semantic","fill","borderBottom","stroke","MuiTableRow","cursor","lightTheme","darkTheme"],"mappings":"gMAIA,MAAMA,EAA8BC,IAChC,MAAMC,EAAYC,EAAY,YAC1BC,EAAUA,WACVC,QAAkB,UAATJ,EAAmBK,EAAAA,aAAeC,EAAWA,cAI1D,OAAOJ,EAAYD,EAA2B,CAC1CM,MAAO,CACHC,aAAc,OAElBC,WAAY,CACRC,UAAW,CACPC,eAAgB,CACZC,KAAM,CACFC,QAAS,YACTC,cAAe,UAI3BC,QAAS,CACLJ,eAAgB,CACZC,KAAM,CACFI,UAAW,OACXC,YAAa,MACbC,YAAa,QACbC,YAAalB,EAAUG,QAAQgB,WAI3CC,QAAS,CACLV,eAAgB,CACZC,KAAM,CACFU,WAAY,OACZC,YAAa,MACbC,aAAc,SAI1BC,kBAAmB,CACfd,eAAgB,CACZC,KAAM,CACF,UAAW,CACPc,gBAAiBzB,EAAUG,QAAQuB,SAASC,KAAK,sBAErD,qBAAsB,CAClBC,aAAc,aAAa5B,EAAUG,QAAQuB,SAASG,OAAO,qBAK7EC,YAAa,CACTpB,eAAgB,CACZC,KAAM,CACF,4BAA6B,CACzBc,gBAAiBzB,EAAUG,QAAQuB,SAASC,KAAK,kBACjDI,OAAQ,gBAM9B,EAGOC,EAAalC,EAA2B,SACxCmC,EAAYnC,EAA2B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _mui_material_styles_createThemeNoVars from '@mui/material/styles/createThemeNoVars';
|
|
2
2
|
|
|
3
|
-
declare const
|
|
3
|
+
declare const lightTheme: _mui_material_styles_createThemeNoVars.Theme;
|
|
4
|
+
declare const darkTheme: _mui_material_styles_createThemeNoVars.Theme;
|
|
4
5
|
|
|
5
|
-
export {
|
|
6
|
+
export { darkTheme, lightTheme };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"@mui/material/styles/createTheme";import{
|
|
1
|
+
import o from"@mui/material/styles/createTheme";import"./tokens/colours/primitives.js";import{lightColours as e,darkColours as t}from"./tokens/colours/semantic.js";import{typography as r}from"./typography.js";const i=i=>{const s=o({typography:r,palette:"light"===i?e:t});return o(s,{shape:{borderRadius:"4px"},components:{MuiButton:{styleOverrides:{root:{padding:"12px 24px",textTransform:"none"}}},MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:s.palette.divider}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold",paddingLeft:"6px",paddingRight:"6px"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:s.palette.semantic.fill["fill-primary-weak"]},"&:not(:last-child)":{borderBottom:`1px solid ${s.palette.semantic.stroke["stroke-weak"]}`}}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:s.palette.semantic.fill["fill-secondary"],cursor:"pointer"}}}}}})},s=i("light"),l=i("dark");export{l as darkTheme,s as lightTheme};
|
|
2
2
|
//# sourceMappingURL=flipdishPublicTheme.js.map
|