@flipdish/portal-library 4.2.3 → 4.2.5
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/ListItemLinkButton/index.cjs.js +1 -1
- package/dist/components/ListItemLinkButton/index.cjs.js.map +1 -1
- package/dist/components/ListItemLinkButton/index.js +1 -1
- package/dist/components/ListItemLinkButton/index.js.map +1 -1
- package/dist/components/PageLayout/index.cjs.js.map +1 -1
- package/dist/components/PageLayout/index.js.map +1 -1
- package/dist/components/atoms/IconButton/getIconButtonStyles.cjs.js +1 -1
- package/dist/components/atoms/IconButton/getIconButtonStyles.cjs.js.map +1 -1
- package/dist/components/atoms/IconButton/getIconButtonStyles.js +1 -1
- package/dist/components/atoms/IconButton/getIconButtonStyles.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var t=require("@mui/material/IconButton"),i=require("@mui/material/ListItemIcon"),r=require("@mui/material/ListItemText"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var t=require("@mui/material/IconButton"),i=require("@mui/material/ListItemIcon"),r=require("@mui/material/ListItemText"),l=require("@mui/material/styles/styled"),o=require("@mui/material/styles/useTheme"),a=require("@mui/material/useMediaQuery"),s=require("../../icons/ArrowRight01/index.cjs.js");const n=l(require("../ListItemLink/index.cjs.js"),{shouldForwardProp:e=>!["borderBottom"].includes(e)&&!["disabled"].includes(e)&&!["selected"].includes(e)})((({theme:e,borderBottom:t,disabled:i,selected:r})=>({borderBottom:t??`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`,paddingLeft:e.spacing(4),paddingRight:e.spacing(4),"&:hover":{backgroundColor:i?e.palette.semantic.fill["fill-disabled"]:e.palette.semantic.fill["fill-primary-weak"],cursor:i?"default":"pointer"},"&:focus":{backgroundColor:i?e.palette.semantic.fill["fill-disabled"]:e.palette.semantic.fill["fill-primary-weak"],cursor:i?"default":"pointer"},color:e.palette.text.primary,textDecoration:"none",backgroundColor:r?e.palette.semantic.fill["fill-primary-weak"]:i?e.palette.semantic.fill["fill-disabled"]:"inherit",cursor:i?"default":"pointer"}))),d=l(i,{shouldForwardProp:e=>!["iconMargin"].includes(e)})((({iconMargin:e})=>({margin:e||"16px",marginLeft:"0",padding:"0px",minWidth:"0"}))),c=l(r)((({theme:e})=>({"& .MuiListItemText-primary":{color:e.palette.text.primary},"& .MuiListItemText-secondary":{color:e.palette.text.secondary}}))),u=({borderBottom:i,customTitle:r,customSubtitle:l,disabled:u=!1,onClick:m,title:p,subtitle:b,icon:x,iconMargin:f,hideIcon:g=!1,link:k="",isLast:y,customButton:h,iconComponent:j,dataFd:L="",isSelected:q=!1})=>{const I=o(),M=a(I.breakpoints.down("tablet")),w=!y||M,B=r||p,C=l||b;return e.jsxs(n,{button:!0,borderBottom:w?i:"none",disabled:u,divider:w,fdKey:L||`link-button-${p}`,onClick:m,selected:q,to:k,children:[x&&e.jsx(d,{iconMargin:f,children:e.jsx("img",{alt:"",src:x})}),j&&e.jsx(d,{iconMargin:f,children:j}),e.jsx(c,{primary:B,secondary:C,sx:{pr:"60px"}}),!g&&(h||e.jsx(t,{"aria-label":`link-button-${p}`,disabled:u,children:e.jsx(s,{})}))]})};exports.ListItemLinkButton=u,exports.default=u;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/ListItemLinkButton/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport IconButton from '@mui/material/IconButton';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport styled from '@mui/material/styles/styled';\nimport useTheme from '@mui/material/styles/useTheme';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport KeyboardArrowRight from '../../icons/ArrowRight01';\nimport ListItemLink from '../ListItemLink';\n\ntype MarginType = number | string;\n\n// Styled components\nconst StyledListItemLink = styled(ListItemLink, {\n shouldForwardProp: (prop) =>\n !['borderBottom'].includes(prop as string) &&\n !['disabled'].includes(prop as string) &&\n !['selected'].includes(prop as string),\n})<{ borderBottom?: string; disabled
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/ListItemLinkButton/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport IconButton from '@mui/material/IconButton';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport styled from '@mui/material/styles/styled';\nimport useTheme from '@mui/material/styles/useTheme';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport KeyboardArrowRight from '../../icons/ArrowRight01';\nimport ListItemLink from '../ListItemLink';\n\ntype MarginType = number | string;\n\n// Styled components\nconst StyledListItemLink = styled(ListItemLink, {\n shouldForwardProp: (prop) =>\n !['borderBottom'].includes(prop as string) &&\n !['disabled'].includes(prop as string) &&\n !['selected'].includes(prop as string),\n})<{ borderBottom?: string; disabled: boolean; selected: boolean }>(({ theme, borderBottom, disabled, selected }) => ({\n borderBottom: borderBottom ?? `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(4),\n '&:hover': {\n backgroundColor: disabled ? theme.palette.semantic.fill['fill-disabled'] : theme.palette.semantic.fill['fill-primary-weak'],\n cursor: disabled ? 'default' : 'pointer',\n },\n '&:focus': {\n backgroundColor: disabled ? theme.palette.semantic.fill['fill-disabled'] : theme.palette.semantic.fill['fill-primary-weak'],\n cursor: disabled ? 'default' : 'pointer',\n },\n // Override link color inheritance\n color: theme.palette.text.primary,\n textDecoration: 'none',\n backgroundColor: selected ? theme.palette.semantic.fill['fill-primary-weak'] : disabled ? theme.palette.semantic.fill['fill-disabled'] : 'inherit',\n // Ensure cursor is pointer when clickable, default when disabled\n cursor: disabled ? 'default' : 'pointer',\n}));\n\nconst StyledListItemIcon = styled(ListItemIcon, {\n shouldForwardProp: (prop) => !['iconMargin'].includes(prop as string),\n})<{ iconMargin?: MarginType }>(({ iconMargin }) => ({\n margin: iconMargin || '16px',\n marginLeft: '0',\n padding: '0px',\n minWidth: '0',\n}));\n\nconst StyledListItemText = styled(ListItemText)(({ theme }) => ({\n '& .MuiListItemText-primary': {\n color: theme.palette.text.primary,\n },\n '& .MuiListItemText-secondary': {\n color: theme.palette.text.secondary,\n },\n}));\n\ninterface ListItemLinkButtonProps {\n customTitle?: string;\n customSubtitle?: React.ReactNode;\n disabled?: boolean;\n title?: string;\n subtitle?: string;\n icon?: string;\n hideIcon?: boolean;\n link?: string;\n isLast?: boolean;\n onClick?: () => void;\n borderBottom?: string;\n customButton?: JSX.Element;\n iconComponent?: JSX.Element;\n iconMargin?: MarginType;\n dataFd?: string;\n isSelected?: boolean;\n}\n\nexport const ListItemLinkButton = ({\n borderBottom,\n customTitle,\n customSubtitle,\n disabled = false,\n onClick,\n title,\n subtitle,\n icon,\n iconMargin,\n hideIcon = false,\n link = '',\n isLast,\n customButton,\n iconComponent,\n dataFd = '',\n isSelected = false,\n}: ListItemLinkButtonProps) => {\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('tablet'));\n const hasDivider = !isLast || isMobile;\n\n const titleText = customTitle || title;\n const subtitleText = customSubtitle || subtitle;\n\n return (\n <StyledListItemLink\n button\n borderBottom={hasDivider ? borderBottom : 'none'}\n disabled={disabled}\n divider={hasDivider}\n fdKey={dataFd || `link-button-${title}`}\n onClick={onClick}\n selected={isSelected}\n to={link}\n >\n {icon && (\n <StyledListItemIcon iconMargin={iconMargin}>\n <img alt=\"\" src={icon} />\n </StyledListItemIcon>\n )}\n\n {iconComponent && <StyledListItemIcon iconMargin={iconMargin}>{iconComponent}</StyledListItemIcon>}\n\n <StyledListItemText primary={titleText} secondary={subtitleText} sx={{ pr: '60px' }} />\n\n {!hideIcon &&\n (customButton || (\n <IconButton aria-label={`link-button-${title}`} disabled={disabled}>\n <KeyboardArrowRight />\n </IconButton>\n ))}\n </StyledListItemLink>\n );\n};\n\nexport default ListItemLinkButton;\n"],"names":["StyledListItemLink","styled","shouldForwardProp","prop","includes","theme","borderBottom","disabled","selected","palette","semantic","stroke","paddingLeft","spacing","paddingRight","backgroundColor","fill","cursor","color","text","primary","textDecoration","StyledListItemIcon","ListItemIcon","iconMargin","margin","marginLeft","padding","minWidth","StyledListItemText","ListItemText","secondary","ListItemLinkButton","customTitle","customSubtitle","onClick","title","subtitle","icon","hideIcon","link","isLast","customButton","iconComponent","dataFd","isSelected","useTheme","isMobile","useMediaQuery","breakpoints","down","hasDivider","titleText","subtitleText","_jsxs","button","divider","fdKey","to","children","_jsx","alt","src","sx","pr","IconButton","KeyboardArrowRight"],"mappings":"kaAeA,MAAMA,EAAqBC,0CAAqB,CAC9CC,kBAAoBC,IACjB,CAAC,gBAAgBC,SAASD,KAC1B,CAAC,YAAYC,SAASD,KACtB,CAAC,YAAYC,SAASD,IAJAF,EAKyC,EAAGI,QAAOC,eAAcC,WAAUC,eAAU,CAC9GF,aAAcA,GAAgB,aAAaD,EAAMI,QAAQC,SAASC,OAAO,iBACzEC,YAAaP,EAAMQ,QAAQ,GAC3BC,aAAcT,EAAMQ,QAAQ,GAC5B,UAAW,CACTE,gBAAiBR,EAAWF,EAAMI,QAAQC,SAASM,KAAK,iBAAmBX,EAAMI,QAAQC,SAASM,KAAK,qBACvGC,OAAQV,EAAW,UAAY,WAEjC,UAAW,CACTQ,gBAAiBR,EAAWF,EAAMI,QAAQC,SAASM,KAAK,iBAAmBX,EAAMI,QAAQC,SAASM,KAAK,qBACvGC,OAAQV,EAAW,UAAY,WAGjCW,MAAOb,EAAMI,QAAQU,KAAKC,QAC1BC,eAAgB,OAChBN,gBAAiBP,EAAWH,EAAMI,QAAQC,SAASM,KAAK,qBAAuBT,EAAWF,EAAMI,QAAQC,SAASM,KAAK,iBAAmB,UAEzIC,OAAQV,EAAW,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x as e}from"react/jsx-runtime";import"react";import
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import"react";import i from"@mui/material/IconButton";import r from"@mui/material/ListItemIcon";import o from"@mui/material/ListItemText";import l from"@mui/material/styles/styled";import a from"@mui/material/styles/useTheme";import n from"@mui/material/useMediaQuery";import m from"../../icons/ArrowRight01/index.js";import d from"../ListItemLink/index.js";const s=l(d,{shouldForwardProp:t=>!["borderBottom"].includes(t)&&!["disabled"].includes(t)&&!["selected"].includes(t)})((({theme:t,borderBottom:e,disabled:i,selected:r})=>({borderBottom:e??`1px solid ${t.palette.semantic.stroke["stroke-weak"]}`,paddingLeft:t.spacing(4),paddingRight:t.spacing(4),"&:hover":{backgroundColor:i?t.palette.semantic.fill["fill-disabled"]:t.palette.semantic.fill["fill-primary-weak"],cursor:i?"default":"pointer"},"&:focus":{backgroundColor:i?t.palette.semantic.fill["fill-disabled"]:t.palette.semantic.fill["fill-primary-weak"],cursor:i?"default":"pointer"},color:t.palette.text.primary,textDecoration:"none",backgroundColor:r?t.palette.semantic.fill["fill-primary-weak"]:i?t.palette.semantic.fill["fill-disabled"]:"inherit",cursor:i?"default":"pointer"}))),c=l(r,{shouldForwardProp:t=>!["iconMargin"].includes(t)})((({iconMargin:t})=>({margin:t||"16px",marginLeft:"0",padding:"0px",minWidth:"0"}))),p=l(o)((({theme:t})=>({"& .MuiListItemText-primary":{color:t.palette.text.primary},"& .MuiListItemText-secondary":{color:t.palette.text.secondary}}))),u=({borderBottom:r,customTitle:o,customSubtitle:l,disabled:d=!1,onClick:u,title:f,subtitle:b,icon:g,iconMargin:k,hideIcon:x=!1,link:h="",isLast:y,customButton:L,iconComponent:w,dataFd:I="",isSelected:M=!1})=>{const B=a(),C=n(B.breakpoints.down("tablet")),T=!y||C,j=o||f,F=l||b;return t(s,{button:!0,borderBottom:T?r:"none",disabled:d,divider:T,fdKey:I||`link-button-${f}`,onClick:u,selected:M,to:h,children:[g&&e(c,{iconMargin:k,children:e("img",{alt:"",src:g})}),w&&e(c,{iconMargin:k,children:w}),e(p,{primary:j,secondary:F,sx:{pr:"60px"}}),!x&&(L||e(i,{"aria-label":`link-button-${f}`,disabled:d,children:e(m,{})}))]})};export{u as ListItemLinkButton,u as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/ListItemLinkButton/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport IconButton from '@mui/material/IconButton';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport styled from '@mui/material/styles/styled';\nimport useTheme from '@mui/material/styles/useTheme';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport KeyboardArrowRight from '../../icons/ArrowRight01';\nimport ListItemLink from '../ListItemLink';\n\ntype MarginType = number | string;\n\n// Styled components\nconst StyledListItemLink = styled(ListItemLink, {\n shouldForwardProp: (prop) =>\n !['borderBottom'].includes(prop as string) &&\n !['disabled'].includes(prop as string) &&\n !['selected'].includes(prop as string),\n})<{ borderBottom?: string; disabled
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/ListItemLinkButton/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport IconButton from '@mui/material/IconButton';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport styled from '@mui/material/styles/styled';\nimport useTheme from '@mui/material/styles/useTheme';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport KeyboardArrowRight from '../../icons/ArrowRight01';\nimport ListItemLink from '../ListItemLink';\n\ntype MarginType = number | string;\n\n// Styled components\nconst StyledListItemLink = styled(ListItemLink, {\n shouldForwardProp: (prop) =>\n !['borderBottom'].includes(prop as string) &&\n !['disabled'].includes(prop as string) &&\n !['selected'].includes(prop as string),\n})<{ borderBottom?: string; disabled: boolean; selected: boolean }>(({ theme, borderBottom, disabled, selected }) => ({\n borderBottom: borderBottom ?? `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(4),\n '&:hover': {\n backgroundColor: disabled ? theme.palette.semantic.fill['fill-disabled'] : theme.palette.semantic.fill['fill-primary-weak'],\n cursor: disabled ? 'default' : 'pointer',\n },\n '&:focus': {\n backgroundColor: disabled ? theme.palette.semantic.fill['fill-disabled'] : theme.palette.semantic.fill['fill-primary-weak'],\n cursor: disabled ? 'default' : 'pointer',\n },\n // Override link color inheritance\n color: theme.palette.text.primary,\n textDecoration: 'none',\n backgroundColor: selected ? theme.palette.semantic.fill['fill-primary-weak'] : disabled ? theme.palette.semantic.fill['fill-disabled'] : 'inherit',\n // Ensure cursor is pointer when clickable, default when disabled\n cursor: disabled ? 'default' : 'pointer',\n}));\n\nconst StyledListItemIcon = styled(ListItemIcon, {\n shouldForwardProp: (prop) => !['iconMargin'].includes(prop as string),\n})<{ iconMargin?: MarginType }>(({ iconMargin }) => ({\n margin: iconMargin || '16px',\n marginLeft: '0',\n padding: '0px',\n minWidth: '0',\n}));\n\nconst StyledListItemText = styled(ListItemText)(({ theme }) => ({\n '& .MuiListItemText-primary': {\n color: theme.palette.text.primary,\n },\n '& .MuiListItemText-secondary': {\n color: theme.palette.text.secondary,\n },\n}));\n\ninterface ListItemLinkButtonProps {\n customTitle?: string;\n customSubtitle?: React.ReactNode;\n disabled?: boolean;\n title?: string;\n subtitle?: string;\n icon?: string;\n hideIcon?: boolean;\n link?: string;\n isLast?: boolean;\n onClick?: () => void;\n borderBottom?: string;\n customButton?: JSX.Element;\n iconComponent?: JSX.Element;\n iconMargin?: MarginType;\n dataFd?: string;\n isSelected?: boolean;\n}\n\nexport const ListItemLinkButton = ({\n borderBottom,\n customTitle,\n customSubtitle,\n disabled = false,\n onClick,\n title,\n subtitle,\n icon,\n iconMargin,\n hideIcon = false,\n link = '',\n isLast,\n customButton,\n iconComponent,\n dataFd = '',\n isSelected = false,\n}: ListItemLinkButtonProps) => {\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('tablet'));\n const hasDivider = !isLast || isMobile;\n\n const titleText = customTitle || title;\n const subtitleText = customSubtitle || subtitle;\n\n return (\n <StyledListItemLink\n button\n borderBottom={hasDivider ? borderBottom : 'none'}\n disabled={disabled}\n divider={hasDivider}\n fdKey={dataFd || `link-button-${title}`}\n onClick={onClick}\n selected={isSelected}\n to={link}\n >\n {icon && (\n <StyledListItemIcon iconMargin={iconMargin}>\n <img alt=\"\" src={icon} />\n </StyledListItemIcon>\n )}\n\n {iconComponent && <StyledListItemIcon iconMargin={iconMargin}>{iconComponent}</StyledListItemIcon>}\n\n <StyledListItemText primary={titleText} secondary={subtitleText} sx={{ pr: '60px' }} />\n\n {!hideIcon &&\n (customButton || (\n <IconButton aria-label={`link-button-${title}`} disabled={disabled}>\n <KeyboardArrowRight />\n </IconButton>\n ))}\n </StyledListItemLink>\n );\n};\n\nexport default ListItemLinkButton;\n"],"names":["StyledListItemLink","styled","ListItemLink","shouldForwardProp","prop","includes","theme","borderBottom","disabled","selected","palette","semantic","stroke","paddingLeft","spacing","paddingRight","backgroundColor","fill","cursor","color","text","primary","textDecoration","StyledListItemIcon","ListItemIcon","iconMargin","margin","marginLeft","padding","minWidth","StyledListItemText","ListItemText","secondary","ListItemLinkButton","customTitle","customSubtitle","onClick","title","subtitle","icon","hideIcon","link","isLast","customButton","iconComponent","dataFd","isSelected","useTheme","isMobile","useMediaQuery","breakpoints","down","hasDivider","titleText","subtitleText","_jsxs","button","divider","fdKey","to","children","_jsx","alt","src","sx","pr","IconButton","KeyboardArrowRight"],"mappings":"wZAeA,MAAMA,EAAqBC,EAAOC,EAAc,CAC9CC,kBAAoBC,IACjB,CAAC,gBAAgBC,SAASD,KAC1B,CAAC,YAAYC,SAASD,KACtB,CAAC,YAAYC,SAASD,IAJAH,EAKyC,EAAGK,QAAOC,eAAcC,WAAUC,eAAU,CAC9GF,aAAcA,GAAgB,aAAaD,EAAMI,QAA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TM,MAAOb,GAAU,eAAeR,IAChCD,QAASA,EACT3B,SAAUqC,EACVa,GAAIlB,EAAImB,SAAA,CAEPrB,GACCsB,EAACtC,EAAkB,CAACE,WAAYA,EAAUmC,SACxCC,SAAKC,IAAI,GAAGC,IAAKxB,MAIpBK,GAAiBiB,EAACtC,EAAkB,CAACE,WAAYA,WAAamB,IAE/DiB,EAAC/B,GAAmBT,QAASgC,EAAWrB,UAAWsB,EAAcU,GAAI,CAAEC,GAAI,WAEzEzB,IACCG,GACCkB,EAACK,EAAU,CAAA,aAAa,eAAe7B,IAAS7B,SAAUA,EAAQoD,SAChEC,EAACM,EAAkB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport Divider from '@mui/material/Divider';\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 Add from '../../icons/Add';\nimport ArrowLeft02 from '../../icons/ArrowLeft02';\nimport { getMicroFrontendAttribute } from '../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../utilities/validation';\nimport FDErrorBoundary from '../FDErrorBoundary';\nimport Spacer from '../Spacer';\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\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('laptop')]: {\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('laptop')]: {\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('laptop')]: {\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('laptop')]: {\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('tablet')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('base')]: {\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('tablet')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('mobile')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('base')]: {\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: ReactNode | string }) => (\n <StyledPageTitle component=\"h2\" variant=\"h5\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(\n ({ 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);\n\nexport interface 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): JSX.Element => {\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('tablet'));\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 container item alignContent=\"space-between\" direction=\"row\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\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 container item>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n component={'button'}\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\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 alignItems=\"center\" display=\"flex\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption component=\"h3\" variant=\"caption\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n {/* @ts-expect-error - Button props type mismatch with href/target */}\n <Button\n data-testid={`Action-button-${actionBtnTitle}`}\n fullWidth={true}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n target={openLinkInNewTab ? '_blank' : undefined}\n variant=\"contained\"\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps\n ? () => navigate(actionButtonLink)\n : () => {}\n }\n >\n {showAddIcon && <StyledAdd size=\"sm\" />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\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\n identifier={documentTitle}\n somethingWentWrongText={errorBoundarySomethingWentWrongText}\n >\n {/* eslint-disable-next-line react/jsx-no-useless-fragment */}\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n </StyledPageContainer>\n );\n};\n\nexport default PageLayout;\n"],"names":["maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","padding","spacing","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledAdd","Add","marginRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","margin","only","marginLeft","StyledInnerWrapper","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","component","variant","children","StyledPageContainer","useAlternateBackground","backgroundColor","palette","semantic","background","height","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","titleComponentAfter","errorBoundarySomethingWentWrongText","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","Spacer","size","_Fragment","container","direction","item","alignContent","map","button","React","isValidElement","Box","onClick","history","length","ArrowLeft02","gap","Button","href","rel","target","FullWidthContainer","FDErrorBoundary","identifier","somethingWentWrongText"],"mappings":"kvBAoBO,MAIMA,EAAW,KAGlBC,EAAgBC,EAAAA,OAAO,MAAPA,EAAkC,EAAGC,QAAOC,YAAO,CACvEJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,WAAY,CAClCN,SAAU,QAEZO,QAASJ,EAAMK,QAAQ,EAAG,GAC1BC,SAAU,WACVC,UAAW,YAGPC,EAAyBT,EAAAA,OAAOU,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zB,wBAAwBC,EAAMC,eAAeF,GAAUA,EAAO3C,QAAQ,gBAAkB2C,EAAO3C,OAAOR,SAAW,uBAS5H2B,GAAe9B,EAAAA,IAACL,EAAiB,CAAA,MAGvCiD,EAAAA,KAACuB,EAAkB,CAACnD,UAAWA,EAASb,SAAA,CACrCc,EAASjB,EAAAA,IAAC5B,EAAgB,CAAA+B,SAAEc,IAA6B,KAC1DjB,EAAAA,IAACoE,EAAe,CACdC,WAAYtD,EACZuD,uBAAwBrC,EAAmC9B,SAG3DH,MAAAgD,EAAAA,SAAA,CAAA7C,SAAGA"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport Divider from '@mui/material/Divider';\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 Add from '../../icons/Add';\nimport ArrowLeft02 from '../../icons/ArrowLeft02';\nimport { getMicroFrontendAttribute } from '../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../utilities/validation';\nimport FDErrorBoundary from '../FDErrorBoundary';\nimport Spacer from '../Spacer';\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\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('laptop')]: {\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('laptop')]: {\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('laptop')]: {\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('laptop')]: {\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('tablet')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('base')]: {\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('tablet')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('mobile')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('base')]: {\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: ReactNode | string }) => (\n <StyledPageTitle component=\"h2\" variant=\"h5\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(\n ({ 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);\n\nexport interface 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): JSX.Element => {\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 \n const isMobile = useMediaQuery(theme.breakpoints.down('tablet'));\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 container item alignContent=\"space-between\" direction=\"row\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\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 container item>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n component={'button'}\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\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 alignItems=\"center\" display=\"flex\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption component=\"h3\" variant=\"caption\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n {/* @ts-expect-error - Button props type mismatch with href/target */}\n <Button\n data-testid={`Action-button-${actionBtnTitle}`}\n fullWidth={true}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n target={openLinkInNewTab ? '_blank' : undefined}\n variant=\"contained\"\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps\n ? () => navigate(actionButtonLink)\n : () => {}\n }\n >\n {showAddIcon && <StyledAdd size=\"sm\" />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\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\n identifier={documentTitle}\n somethingWentWrongText={errorBoundarySomethingWentWrongText}\n >\n {/* eslint-disable-next-line react/jsx-no-useless-fragment */}\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n </StyledPageContainer>\n );\n};\n\nexport default PageLayout;\n"],"names":["maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","padding","spacing","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledAdd","Add","marginRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","margin","only","marginLeft","StyledInnerWrapper","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","component","variant","children","StyledPageContainer","useAlternateBackground","backgroundColor","palette","semantic","background","height","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","titleComponentAfter","errorBoundarySomethingWentWrongText","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","DocumentTitle","Spacer","size","_Fragment","container","direction","item","alignContent","map","button","React","isValidElement","Box","onClick","history","length","ArrowLeft02","gap","Button","href","rel","target","FullWidthContainer","FDErrorBoundary","identifier","somethingWentWrongText"],"mappings":"kvBAoBO,MAIMA,EAAW,KAGlBC,EAAgBC,EAAAA,OAAO,MAAPA,EAAkC,EAAGC,QAAOC,YAAO,CACvEJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,WAAY,CAClCN,SAAU,QAEZO,QAASJ,EAAMK,QAAQ,EAAG,GAC1BC,SAAU,WACVC,UAAW,YAGPC,EAAyBT,EAAAA,OAAOU,EAAPV,EAAa,EAAGC,YAAO,CACpD,CAACA,EAAME,YAAYC,KAAK,W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C,EAAO3C,OAAOR,SAAW,uBAS5H2B,GAAe9B,EAAAA,IAACL,EAAiB,CAAA,MAGvCiD,EAAAA,KAACuB,EAAkB,CAACnD,UAAWA,EAASb,SAAA,CACrCc,EAASjB,EAAAA,IAAC5B,EAAgB,CAAA+B,SAAEc,IAA6B,KAC1DjB,EAAAA,IAACoE,EAAe,CACdC,WAAYtD,EACZuD,uBAAwBrC,EAAmC9B,SAG3DH,MAAAgD,EAAAA,SAAA,CAAA7C,SAAGA"}
|
|
@@ -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 Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport Divider from '@mui/material/Divider';\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 Add from '../../icons/Add';\nimport ArrowLeft02 from '../../icons/ArrowLeft02';\nimport { getMicroFrontendAttribute } from '../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../utilities/validation';\nimport FDErrorBoundary from '../FDErrorBoundary';\nimport Spacer from '../Spacer';\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\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('laptop')]: {\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('laptop')]: {\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('laptop')]: {\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('laptop')]: {\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('tablet')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('base')]: {\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('tablet')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('mobile')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('base')]: {\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: ReactNode | string }) => (\n <StyledPageTitle component=\"h2\" variant=\"h5\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(\n ({ 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);\n\nexport interface 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): JSX.Element => {\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('tablet'));\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 container item alignContent=\"space-between\" direction=\"row\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\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 container item>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n component={'button'}\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\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 alignItems=\"center\" display=\"flex\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption component=\"h3\" variant=\"caption\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n {/* @ts-expect-error - Button props type mismatch with href/target */}\n <Button\n data-testid={`Action-button-${actionBtnTitle}`}\n fullWidth={true}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n target={openLinkInNewTab ? '_blank' : undefined}\n variant=\"contained\"\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps\n ? () => navigate(actionButtonLink)\n : () => {}\n }\n >\n {showAddIcon && <StyledAdd size=\"sm\" />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\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\n identifier={documentTitle}\n somethingWentWrongText={errorBoundarySomethingWentWrongText}\n >\n {/* eslint-disable-next-line react/jsx-no-useless-fragment */}\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","component","variant","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","rel","target","FullWidthContainer","FDErrorBoundary","identifier","somethingWentWrongText"],"mappings":"kxBAoBO,MAAMA,EAA6B,2BAC7BC,EAAkC,gCAClCC,EAAmC,iCACnCC,EAA2B,yBAC3BC,EAAW,KAGlBC,EAAgBC,EAAO,MAAPA,EAAkC,EAAGC,QAAOC,YAAO,CACvEJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,WAAY,CAClCN,SAAU,QAEZO,QAASJ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C1DlB,EAACqE,EAAe,CACdC,WAAYtD,EACZuD,uBAAwBrC,GAAmC/B,SAG3DH,EAAAiD,EAAA,CAAA9C,SAAGA"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport Divider from '@mui/material/Divider';\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 Add from '../../icons/Add';\nimport ArrowLeft02 from '../../icons/ArrowLeft02';\nimport { getMicroFrontendAttribute } from '../../utilities/renderUtilities';\nimport { joinUrlPaths } from '../../utilities/validation';\nimport FDErrorBoundary from '../FDErrorBoundary';\nimport Spacer from '../Spacer';\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\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('laptop')]: {\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('laptop')]: {\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('laptop')]: {\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('laptop')]: {\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('tablet')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('base')]: {\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('tablet')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('mobile')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('base')]: {\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: ReactNode | string }) => (\n <StyledPageTitle component=\"h2\" variant=\"h5\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(\n ({ 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);\n\nexport interface 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): JSX.Element => {\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 \n const isMobile = useMediaQuery(theme.breakpoints.down('tablet'));\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 container item alignContent=\"space-between\" direction=\"row\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\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 container item>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n component={'button'}\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\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 alignItems=\"center\" display=\"flex\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption component=\"h3\" variant=\"caption\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n {/* @ts-expect-error - Button props type mismatch with href/target */}\n <Button\n data-testid={`Action-button-${actionBtnTitle}`}\n fullWidth={true}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n target={openLinkInNewTab ? '_blank' : undefined}\n variant=\"contained\"\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps\n ? () => navigate(actionButtonLink)\n : () => {}\n }\n >\n {showAddIcon && <StyledAdd size=\"sm\" />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\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\n identifier={documentTitle}\n somethingWentWrongText={errorBoundarySomethingWentWrongText}\n >\n {/* eslint-disable-next-line react/jsx-no-useless-fragment */}\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","component","variant","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","rel","target","FullWidthContainer","FDErrorBoundary","identifier","somethingWentWrongText"],"mappings":"kxBAoBO,MAAMA,EAA6B,2BAC7BC,EAAkC,gCAClCC,EAAmC,iCACnCC,EAA2B,yBAC3BC,EAAW,KAGlBC,EAAgBC,EAAO,MAAPA,EAAkC,EAAGC,QAAOC,YAAO,CACvEJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,WAAY,CAClCN,SAAU,QAEZO,QAASJ,EAAMK,QAAQ,EAAG,GAC1BC,SAAU,WACVC,UAAW,YAGPC,EAAyBT,EAAOU,EAAPV,EAAa,EAAGC,YAAO,CACpD,CAACA,EAAME,YAAYC,KAAK,WAAY,CAClCO,MAAO,OACPC,WAAYX,EAAMK,QAAQ,QAIxBO,EAAeb,EAAOU,EAAPV,EAAa,EAAGC,YAAO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CAC5CH,EAACF,EAAS,CAACC,MAAOA,IACjBkC,MAGJnB,GACCd,EAACV,EAAa,CAACW,UAAU,KAAKC,QAAQ,UAASC,SAC5CW,OAKNS,GACCsB,EAAAI,EAAA,CAAA9C,SAAA,CACGiC,IAAYpC,EAAC+C,EAAM,CAACC,KAAM,GAAI9C,QAAQ,aACvCF,EAACvC,EAAsB,CAAC2F,MAAI,EAAAjD,SAE1B0C,EAACmB,EAAM,CAAA,cACQ,iBAAiBnD,IAC9BI,WAAW,EACXgD,KAAM5C,GAAoBmB,GAAwBE,GAAwB,GAC1EwB,IAAK7C,EAAmB,2BAAwBsB,EAChDwB,OAAQ9C,EAAmB,cAAWsB,EACtCzC,QAAQ,YACRyD,QACGtC,GAAqBmB,GAElB,OADA,IAAMV,EAASV,GACPjB,SAAA,CAGbqB,GAAexB,EAACzB,EAAS,CAACyE,KAAK,OAC/BnC,UAKRmB,GAAqBsB,KAAKC,GACzBV,EAAA,MAAA,CAAA1C,SAAA,CAIGiC,IAAYpC,EAAC+C,EAAM,CAACC,KAAM,GAAI9C,QAAQ,cACrCkC,IAAYpC,EAAC+C,EAAM,CAACC,KAAM,GAAI9C,QAAQ,aACxCF,EAACvC,GAAuB2F,MAAI,EAAAjD,SAAEoD,MAJzB,wBAAwBC,EAAMC,eAAeF,GAAUA,EAAO3C,QAAQ,gBAAkB2C,EAAO3C,OAAOT,SAAW,uBAS5H4B,GAAe/B,EAACL,EAAiB,CAAA,MAGvCkD,EAACuB,EAAkB,CAACnD,UAAWA,EAASd,SAAA,CACrCe,EAASlB,EAAC5B,EAAgB,CAAA+B,SAAEe,IAA6B,KAC1DlB,EAACqE,EAAe,CACdC,WAAYtD,EACZuD,uBAAwBrC,GAAmC/B,SAG3DH,EAAAiD,EAAA,CAAA9C,SAAGA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var o=require("@mui/material/styles");module.exports=(r,i="primary",n="brand",e="medium")=>{const l="light"===r.palette.mode,
|
|
1
|
+
"use strict";var o=require("@mui/material/styles");module.exports=(r,i="primary",n="brand",e="medium")=>{const l="light"===r.palette.mode,s=r.palette.semantic,c="small"===e?32:48,t={borderRadius:r.radius["radius-8"]||8,width:c,height:c,boxShadow:r.customShadows?.raised||"0px 1px 2px 0px rgba(0,0,0,0.1), 0px 2px 6px 0px rgba(0,0,0,0.15)",minWidth:0,padding:0,position:"relative",transition:"all 0.2s ease-in-out"},d={generic:{focus:{outlineOffset:"2px",outline:`2px solid ${r.palette.semantic.stroke["stroke-focus"]}`,transition:"none"}},primary:{brand:{default:{...t,background:s.fill["fill-primary-strong"],color:s.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},hover:{...t,background:l?o.darken(s.fill["fill-primary-strong"],.1):o.lighten(s.fill["fill-primary-strong"],.1),color:s.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},press:{...t,background:l?o.darken(s.fill["fill-primary-strong"],.2):o.lighten(s.fill["fill-primary-strong"],.2),color:s.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},neutral:{default:{...t,background:s.fill["fill-strong"],color:s.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},hover:{...t,background:l?o.lighten(s.fill["fill-strong"],.1):o.darken(s.fill["fill-strong"],.1),color:s.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},press:{...t,background:l?o.lighten(s.fill["fill-strong"],.2):o.darken(s.fill["fill-strong"],.2),color:s.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},destructive:{default:{...t,background:s.fill["fill-error-strong"],color:s.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},hover:{...t,background:l?o.darken(s.fill["fill-error-strong"],.1):o.lighten(s.fill["fill-error-strong"],.1),color:s.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},press:{...t,background:l?o.darken(s.fill["fill-error-strong"],.2):o.lighten(s.fill["fill-error-strong"],.2),color:s.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},inverse:{default:{...t,background:s.fill["fill-inverse-strong"],color:s.icon["icon-strong"],border:"none",cursor:"pointer",opacity:1},hover:{...t,background:l?o.darken(s.fill["fill-inverse-strong"],.1):o.lighten(s.fill["fill-inverse-strong"],.1),color:s.icon["icon-inverse-strong"],border:"none",cursor:"pointer",opacity:1},press:{...t,background:l?o.darken(s.fill["fill-inverse-strong"],.2):o.lighten(s.fill["fill-inverse-strong"],.2),color:s.icon["icon-inverse-strong"],border:"none",cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}}},secondary:{brand:{default:{...t,background:s.fill["fill-inverse-strong"],color:s.icon["icon-primary"],border:`1px solid ${s.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},hover:{...t,background:s.fill["fill-hover"],color:s.icon["icon-primary"],border:`1px solid ${s.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},press:{...t,background:s.fill["fill-press"],color:s.icon["icon-primary"],border:`1px solid ${s.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:`1px solid ${s.stroke["stroke-disabled"]}`,cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},destructive:{default:{...t,background:s.fill["fill-inverse-strong"],color:s.icon["icon-error"],border:`1px solid ${s.stroke["stroke-error-strong"]}`,cursor:"pointer",opacity:1},hover:{...t,background:s.fill["fill-hover"],color:s.icon["icon-error"],border:`1px solid ${s.stroke["stroke-error-strong"]}`,cursor:"pointer",opacity:1},press:{...t,background:s.fill["fill-press"],color:s.icon["icon-error"],border:`1px solid ${s.stroke["stroke-error-strong"]}`,cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:`1px solid ${s.stroke["stroke-disabled"]}`,cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},neutral:{default:{...t,background:s.fill["fill-strong"],color:s.icon["icon-strong"],border:`1px solid ${s.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},hover:{...t,background:l?o.darken(s.fill["fill-strong"],.1):o.lighten(s.fill["fill-strong"],.1),color:s.icon["icon-strong"],border:`1px solid ${s.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},press:{...t,background:l?o.darken(s.fill["fill-strong"],.2):o.lighten(s.fill["fill-strong"],.2),color:s.icon["icon-strong"],border:`1px solid ${s.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:`1px solid ${s.stroke["stroke-disabled"]}`,cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},inverse:{default:{...t,background:s.fill["fill-inverse-strong"],color:s.icon["icon-inverse-strong"],border:`1px solid ${s.stroke["stroke-inverse-strong"]}`,cursor:"pointer",opacity:1},hover:{...t,background:l?o.darken(s.fill["fill-inverse-strong"],.1):o.lighten(s.fill["fill-inverse-strong"],.1),color:s.icon["icon-inverse-strong"],border:`1px solid ${s.stroke["stroke-inverse-strong"]}`,cursor:"pointer",opacity:1},press:{...t,background:l?o.darken(s.fill["fill-inverse-strong"],.2):o.lighten(s.fill["fill-inverse-strong"],.2),color:s.icon["icon-inverse-strong"],border:`1px solid ${s.stroke["stroke-inverse-strong"]}`,cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:`1px solid ${s.stroke["stroke-disabled"]}`,cursor:"not-allowed",opacity:.5}}},tertiary:{brand:{default:{...t,boxShadow:"none",background:"transparent",color:s.icon["icon-primary"],border:"none",cursor:"pointer",opacity:1},hover:{...t,background:s.fill["fill-hover"],color:s.icon["icon-primary"],border:"none",cursor:"pointer",opacity:1},press:{...t,background:s.fill["fill-press"],color:s.icon["icon-primary"],border:"none",cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},destructive:{default:{...t,boxShadow:"none",background:"transparent",color:s.icon["icon-error"],border:"none",cursor:"pointer",opacity:1},hover:{...t,background:s.fill["fill-hover"],color:s.icon["icon-error"],border:"none",cursor:"pointer",opacity:1},press:{...t,background:s.fill["fill-press"],color:s.icon["icon-error"],border:"none",cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:"none",cursor:"not-allowed",opacity:.5}},neutral:{default:{...t,boxShadow:"none",background:"transparent",color:s.icon["icon-strong"],border:"none",cursor:"pointer",opacity:1},hover:{...t,background:s.fill["fill-hover"],color:s.icon["icon-strong"],border:"none",cursor:"pointer",opacity:1},press:{...t,background:s.fill["fill-press"],color:s.icon["icon-strong"],border:"none",cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},inverse:{default:{...t,boxShadow:"none",background:"transparent",color:s.icon["icon-inverse-strong"],border:"none",cursor:"pointer",opacity:1},hover:{...t,background:s.fill["fill-hover"],color:s.icon["icon-inverse-strong"],border:"none",cursor:"pointer",opacity:1},press:{...t,background:s.fill["fill-press"],color:s.icon["icon-inverse-strong"],border:"none",cursor:"pointer",opacity:1},disabled:{...t,background:s.fill["fill-disabled"],color:s.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}}}};return{...d.generic,...d[i][n in d[i]?n:"brand"]}};
|
|
2
2
|
//# sourceMappingURL=getIconButtonStyles.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIconButtonStyles.cjs.js","sources":["../../../../src/components/atoms/IconButton/getIconButtonStyles.ts"],"sourcesContent":["import { darken, lighten, type Theme } from '@mui/material/styles';\n\nexport type IconButtonVariant = 'primary' | 'secondary' | 'tertiary';\nexport type IconButtonTone = 'brand' | 'destructive' | 'inverse' | 'neutral';\nexport type IconButtonState = 'default' | 'disabled' | 'focus' | 'hover' | 'press';\n\ninterface StyleObject {\n [property: string]: number | string | undefined;\n}\ninterface IconButtonStyles {\n default?: StyleObject;\n disabled?: StyleObject;\n focus?: StyleObject;\n hover?: StyleObject;\n press?: StyleObject;\n}\n\nconst getIconButtonStyles = (\n theme: Theme,\n variant: IconButtonVariant = 'primary',\n tone: IconButtonTone = 'brand',\n size: 'medium' | 'small' = 'medium'\n): IconButtonStyles => {\n const isLight = theme.palette.mode === 'light';\n const palette = theme.palette.semantic;\n const radius = theme.radius['radius-8'] || 8;\n const boxShadow = theme.customShadows?.raised || '0px 1px 2px 0px rgba(0,0,0,0.1), 0px 2px 6px 0px rgba(0,0,0,0.15)';\n const sizePx = size === 'small' ? 32 : 48;\n\n const shared = {\n borderRadius: radius,\n width: sizePx,\n height: sizePx,\n boxShadow,\n minWidth: 0,\n padding: 0,\n position: 'relative',\n transition: 'all 0.2s ease-in-out',\n };\n\n const variants = {\n generic: {\n focus: {\n outlineOffset: '2px',\n outline: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n transition: 'none',\n },\n },\n primary: {\n brand: {\n default: {\n ...shared,\n background: palette.fill['fill-primary-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-primary-strong'], 0.1) : lighten(palette.fill['fill-primary-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-primary-strong'], 0.2) : lighten(palette.fill['fill-primary-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n background: palette.fill['fill-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? lighten(palette.fill['fill-strong'], 0.1) : darken(palette.fill['fill-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? lighten(palette.fill['fill-strong'], 0.2) : darken(palette.fill['fill-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n background: palette.fill['fill-error-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-error-strong'], 0.1) : lighten(palette.fill['fill-error-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-error-strong'], 0.2) : lighten(palette.fill['fill-error-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.1) : lighten(palette.fill['fill-inverse-strong'], 0.1),\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.2) : lighten(palette.fill['fill-inverse-strong'], 0.2),\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n },\n secondary: {\n brand: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n background: palette.fill['fill-strong'],\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-strong'], 0.1) : lighten(palette.fill['fill-strong'], 0.1),\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-strong'], 0.2) : lighten(palette.fill['fill-strong'], 0.2),\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.1) : lighten(palette.fill['fill-inverse-strong'], 0.1),\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.2) : lighten(palette.fill['fill-inverse-strong'], 0.2),\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n },\n tertiary: {\n brand: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n },\n };\n\n // Fallback to brand if tone not found\n const toneKey: IconButtonTone = tone in variants[variant] ? tone : 'brand';\n return { ...variants.generic, ...variants[variant][toneKey] };\n};\n\nexport default getIconButtonStyles;"],"names":["theme","variant","tone","size","isLight","palette","mode","semantic","sizePx","shared","borderRadius","radius","width","height","boxShadow","customShadows","raised","minWidth","padding","position","transition","variants","generic","focus","outlineOffset","outline","stroke","primary","brand","default","background","fill","color","icon","border","cursor","opacity","hover","darken","lighten","press","disabled","neutral","destructive","inverse","secondary","tertiary"],"mappings":"kEAiB4B,CAC1BA,EACAC,EAA6B,UAC7BC,EAAuB,QACvBC,EAA2B,YAE3B,MAAMC,EAAiC,UAAvBJ,EAAMK,QAAQC,KACxBD,EAAUL,EAAMK,QAAQE,SAGxBC,EAAkB,UAATL,EAAmB,GAAK,GAEjCM,EAAS,CACbC,aALaV,EAAMW,OAAO,aAAe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AO3B,EAAQ4B,KAAK,uBACpBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,GAEXI,MAAO,IACF/B,EACHqB,WAAYzB,EAAQ0B,KAAK,cACzBC,MAAO3B,EAAQ4B,KAAK,uBACpBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,GAEXK,SAAU,IACLhC,EACHqB,WAAYzB,EAAQ0B,KAAK,iBACzBC,MAAO3B,EAAQ4B,KAAK,iBACpBC,OAAQ,OACRC,OAAQ,cACRC,QAAS,OAQjB,MAAO,IAAKf,EAASC,WAAYD,EAASpB,GADVC,KAAQmB,EAASpB,GAAWC,EAAO"}
|
|
1
|
+
{"version":3,"file":"getIconButtonStyles.cjs.js","sources":["../../../../src/components/atoms/IconButton/getIconButtonStyles.ts"],"sourcesContent":["import { darken, lighten, type Theme } from '@mui/material/styles';\n\nexport type IconButtonVariant = 'primary' | 'secondary' | 'tertiary';\nexport type IconButtonTone = 'brand' | 'destructive' | 'inverse' | 'neutral';\nexport type IconButtonState = 'default' | 'disabled' | 'focus' | 'hover' | 'press';\n\ninterface StyleObject {\n [property: string]: number | string | undefined;\n}\ninterface IconButtonStyles {\n default?: StyleObject;\n disabled?: StyleObject;\n focus?: StyleObject;\n hover?: StyleObject;\n press?: StyleObject;\n}\n\nconst getIconButtonStyles = (\n theme: Theme,\n variant: IconButtonVariant = 'primary',\n tone: IconButtonTone = 'brand',\n size: 'medium' | 'small' = 'medium'\n): IconButtonStyles => {\n const isLight = theme.palette.mode === 'light';\n const palette = theme.palette.semantic;\n const radius = theme.radius['radius-8'] || 8;\n const boxShadow = theme.customShadows?.raised || '0px 1px 2px 0px rgba(0,0,0,0.1), 0px 2px 6px 0px rgba(0,0,0,0.15)';\n const sizePx = size === 'small' ? 32 : 48;\n\n const shared = {\n borderRadius: radius,\n width: sizePx,\n height: sizePx,\n boxShadow,\n minWidth: 0,\n padding: 0,\n position: 'relative',\n transition: 'all 0.2s ease-in-out',\n };\n\n const variants = {\n generic: {\n focus: {\n outlineOffset: '2px',\n outline: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n transition: 'none',\n },\n },\n primary: {\n brand: {\n default: {\n ...shared,\n background: palette.fill['fill-primary-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-primary-strong'], 0.1) : lighten(palette.fill['fill-primary-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-primary-strong'], 0.2) : lighten(palette.fill['fill-primary-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n background: palette.fill['fill-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? lighten(palette.fill['fill-strong'], 0.1) : darken(palette.fill['fill-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? lighten(palette.fill['fill-strong'], 0.2) : darken(palette.fill['fill-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n background: palette.fill['fill-error-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-error-strong'], 0.1) : lighten(palette.fill['fill-error-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-error-strong'], 0.2) : lighten(palette.fill['fill-error-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.1) : lighten(palette.fill['fill-inverse-strong'], 0.1),\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.2) : lighten(palette.fill['fill-inverse-strong'], 0.2),\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n },\n secondary: {\n brand: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n background: palette.fill['fill-strong'],\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-strong'], 0.1) : lighten(palette.fill['fill-strong'], 0.1),\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-strong'], 0.2) : lighten(palette.fill['fill-strong'], 0.2),\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.1) : lighten(palette.fill['fill-inverse-strong'], 0.1),\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.2) : lighten(palette.fill['fill-inverse-strong'], 0.2),\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n },\n tertiary: {\n brand: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n },\n };\n\n // Fallback to brand if tone not found\n const toneKey: IconButtonTone = tone in variants[variant] ? tone : 'brand';\n return { ...variants.generic, ...variants[variant][toneKey] };\n};\n\nexport default getIconButtonStyles;"],"names":["theme","variant","tone","size","isLight","palette","mode","semantic","sizePx","shared","borderRadius","radius","width","height","boxShadow","customShadows","raised","minWidth","padding","position","transition","variants","generic","focus","outlineOffset","outline","stroke","primary","brand","default","background","fill","color","icon","border","cursor","opacity","hover","darken","lighten","press","disabled","pointerEvents","neutral","destructive","inverse","secondary","tertiary"],"mappings":"kEAiB4B,CAC1BA,EACAC,EAA6B,UAC7BC,EAAuB,QACvBC,EAA2B,YAE3B,MAAMC,EAAiC,UAAvBJ,EAAMK,QAAQC,KACxBD,EAAUL,EAAMK,QAAQE,SAGxBC,EAAkB,UAATL,EAAmB,GAAK,GAEjCM,EAAS,CACbC,aALaV,EAAMW,OAAO,aAAe,EAMzCC,MAAOJ,EACPK,OAAQL,EACRM,UAPgBd,EAAMe,eAAeC,QAAU,oEAQ/CC,SAAU,EACVC,QAAS,EACTC,SAAU,WACVC,WAAY,wBAGRC,EAAW,CACfC,QAAS,CACLC,MAAO,CACLC,cAAe,MACfC,QAAS,aAAazB,EAAMK,QAAQE,SAASmB,OAAO,kBACpDN,WAAY,SAGlBO,QAAS,CACPC,MAAO,CACLC,QAAS,IACJpB,EACHqB,WAAYzB,EAAQ0B,KAAK,uBACzBC,MAAO3B,EAAQ4B,KAAK,gBACpBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,GAEXC,MAAO,IACF5B,EACHqB,WAAY1B,EAAUkC,EAAAA,OAAOjC,EAAQ0B,KAAK,uBAAwB,IAAOQ,EAAAA,QAAQlC,EAAQ0B,KAAK,uBAAwB,IACtHC,MAAO3B,EAAQ4B,KAAK,gBACpBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,GAEXI,MAAO,IACF/B,EACHqB,WAAY1B,EAAUkC,EAAAA,OAAOjC,EAAQ0B,KAAK,uBAAwB,IAAOQ,EAAAA,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,OACXgB,WAAY,cACZE,MAAO3B,EAAQ4B,KAAK,eACpBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,GAEXC,MAAO,IACF5B,EACHqB,WAAYzB,EAAQ0B,KAAK,cACzBC,MAAO3B,EAAQ4B,KAAK,eACpBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,GAEXI,MAAO,IACF/B,EACHqB,WAAYzB,EAAQ0B,KAAK,cACzBC,MAAO3B,EAAQ4B,KAAK,eACpBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,GAEXK,SAAU,IACLhC,EACHqB,WAAYzB,EAAQ0B,KAAK,iBACzBC,MAAO3B,EAAQ4B,KAAK,iBACpBC,OAAQ,OACRC,OAAQ,cACRO,cAAe,OACfN,QAAS,KAGbS,QAAS,CACPhB,QAAS,IACJpB,EACHK,UAAW,OACXgB,WAAY,cACZE,MAAO3B,EAAQ4B,KAAK,uBACpBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,GAEXC,MAAO,IACF5B,EACHqB,WAAYzB,EAAQ0B,KAAK,cACzBC,MAAO3B,EAAQ4B,KAAK,uBACpBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,GAEXI,MAAO,IACF/B,EACHqB,WAAYzB,EAAQ0B,KAAK,cACzBC,MAAO3B,EAAQ4B,KAAK,uBACpBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,GAEXK,SAAU,IACLhC,EACHqB,WAAYzB,EAAQ0B,KAAK,iBACzBC,MAAO3B,EAAQ4B,KAAK,iBACpBC,OAAQ,OACRC,OAAQ,cACRO,cAAe,OACfN,QAAS,OAQjB,MAAO,IAAKf,EAASC,WAAYD,EAASpB,GADVC,KAAQmB,EAASpB,GAAWC,EAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{darken as o,lighten as r}from"@mui/material/styles";const i=(i,n="primary",e="brand",l="medium")=>{const
|
|
1
|
+
import{darken as o,lighten as r}from"@mui/material/styles";const i=(i,n="primary",e="brand",l="medium")=>{const s="light"===i.palette.mode,c=i.palette.semantic,t="small"===l?32:48,d={borderRadius:i.radius["radius-8"]||8,width:t,height:t,boxShadow:i.customShadows?.raised||"0px 1px 2px 0px rgba(0,0,0,0.1), 0px 2px 6px 0px rgba(0,0,0,0.15)",minWidth:0,padding:0,position:"relative",transition:"all 0.2s ease-in-out"},a={generic:{focus:{outlineOffset:"2px",outline:`2px solid ${i.palette.semantic.stroke["stroke-focus"]}`,transition:"none"}},primary:{brand:{default:{...d,background:c.fill["fill-primary-strong"],color:c.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},hover:{...d,background:s?o(c.fill["fill-primary-strong"],.1):r(c.fill["fill-primary-strong"],.1),color:c.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},press:{...d,background:s?o(c.fill["fill-primary-strong"],.2):r(c.fill["fill-primary-strong"],.2),color:c.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},neutral:{default:{...d,background:c.fill["fill-strong"],color:c.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},hover:{...d,background:s?r(c.fill["fill-strong"],.1):o(c.fill["fill-strong"],.1),color:c.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},press:{...d,background:s?r(c.fill["fill-strong"],.2):o(c.fill["fill-strong"],.2),color:c.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},destructive:{default:{...d,background:c.fill["fill-error-strong"],color:c.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},hover:{...d,background:s?o(c.fill["fill-error-strong"],.1):r(c.fill["fill-error-strong"],.1),color:c.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},press:{...d,background:s?o(c.fill["fill-error-strong"],.2):r(c.fill["fill-error-strong"],.2),color:c.icon["icon-inverse"],border:"none",cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},inverse:{default:{...d,background:c.fill["fill-inverse-strong"],color:c.icon["icon-strong"],border:"none",cursor:"pointer",opacity:1},hover:{...d,background:s?o(c.fill["fill-inverse-strong"],.1):r(c.fill["fill-inverse-strong"],.1),color:c.icon["icon-inverse-strong"],border:"none",cursor:"pointer",opacity:1},press:{...d,background:s?o(c.fill["fill-inverse-strong"],.2):r(c.fill["fill-inverse-strong"],.2),color:c.icon["icon-inverse-strong"],border:"none",cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}}},secondary:{brand:{default:{...d,background:c.fill["fill-inverse-strong"],color:c.icon["icon-primary"],border:`1px solid ${c.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},hover:{...d,background:c.fill["fill-hover"],color:c.icon["icon-primary"],border:`1px solid ${c.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},press:{...d,background:c.fill["fill-press"],color:c.icon["icon-primary"],border:`1px solid ${c.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:`1px solid ${c.stroke["stroke-disabled"]}`,cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},destructive:{default:{...d,background:c.fill["fill-inverse-strong"],color:c.icon["icon-error"],border:`1px solid ${c.stroke["stroke-error-strong"]}`,cursor:"pointer",opacity:1},hover:{...d,background:c.fill["fill-hover"],color:c.icon["icon-error"],border:`1px solid ${c.stroke["stroke-error-strong"]}`,cursor:"pointer",opacity:1},press:{...d,background:c.fill["fill-press"],color:c.icon["icon-error"],border:`1px solid ${c.stroke["stroke-error-strong"]}`,cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:`1px solid ${c.stroke["stroke-disabled"]}`,cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},neutral:{default:{...d,background:c.fill["fill-strong"],color:c.icon["icon-strong"],border:`1px solid ${c.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},hover:{...d,background:s?o(c.fill["fill-strong"],.1):r(c.fill["fill-strong"],.1),color:c.icon["icon-strong"],border:`1px solid ${c.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},press:{...d,background:s?o(c.fill["fill-strong"],.2):r(c.fill["fill-strong"],.2),color:c.icon["icon-strong"],border:`1px solid ${c.stroke["stroke-primary-strong"]}`,cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:`1px solid ${c.stroke["stroke-disabled"]}`,cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},inverse:{default:{...d,background:c.fill["fill-inverse-strong"],color:c.icon["icon-inverse-strong"],border:`1px solid ${c.stroke["stroke-inverse-strong"]}`,cursor:"pointer",opacity:1},hover:{...d,background:s?o(c.fill["fill-inverse-strong"],.1):r(c.fill["fill-inverse-strong"],.1),color:c.icon["icon-inverse-strong"],border:`1px solid ${c.stroke["stroke-inverse-strong"]}`,cursor:"pointer",opacity:1},press:{...d,background:s?o(c.fill["fill-inverse-strong"],.2):r(c.fill["fill-inverse-strong"],.2),color:c.icon["icon-inverse-strong"],border:`1px solid ${c.stroke["stroke-inverse-strong"]}`,cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:`1px solid ${c.stroke["stroke-disabled"]}`,cursor:"not-allowed",opacity:.5}}},tertiary:{brand:{default:{...d,boxShadow:"none",background:"transparent",color:c.icon["icon-primary"],border:"none",cursor:"pointer",opacity:1},hover:{...d,background:c.fill["fill-hover"],color:c.icon["icon-primary"],border:"none",cursor:"pointer",opacity:1},press:{...d,background:c.fill["fill-press"],color:c.icon["icon-primary"],border:"none",cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},destructive:{default:{...d,boxShadow:"none",background:"transparent",color:c.icon["icon-error"],border:"none",cursor:"pointer",opacity:1},hover:{...d,background:c.fill["fill-hover"],color:c.icon["icon-error"],border:"none",cursor:"pointer",opacity:1},press:{...d,background:c.fill["fill-press"],color:c.icon["icon-error"],border:"none",cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:"none",cursor:"not-allowed",opacity:.5}},neutral:{default:{...d,boxShadow:"none",background:"transparent",color:c.icon["icon-strong"],border:"none",cursor:"pointer",opacity:1},hover:{...d,background:c.fill["fill-hover"],color:c.icon["icon-strong"],border:"none",cursor:"pointer",opacity:1},press:{...d,background:c.fill["fill-press"],color:c.icon["icon-strong"],border:"none",cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}},inverse:{default:{...d,boxShadow:"none",background:"transparent",color:c.icon["icon-inverse-strong"],border:"none",cursor:"pointer",opacity:1},hover:{...d,background:c.fill["fill-hover"],color:c.icon["icon-inverse-strong"],border:"none",cursor:"pointer",opacity:1},press:{...d,background:c.fill["fill-press"],color:c.icon["icon-inverse-strong"],border:"none",cursor:"pointer",opacity:1},disabled:{...d,background:c.fill["fill-disabled"],color:c.icon["icon-disabled"],border:"none",cursor:"not-allowed",pointerEvents:"auto",opacity:.5}}}};return{...a.generic,...a[n][e in a[n]?e:"brand"]}};export{i as default};
|
|
2
2
|
//# sourceMappingURL=getIconButtonStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIconButtonStyles.js","sources":["../../../../src/components/atoms/IconButton/getIconButtonStyles.ts"],"sourcesContent":["import { darken, lighten, type Theme } from '@mui/material/styles';\n\nexport type IconButtonVariant = 'primary' | 'secondary' | 'tertiary';\nexport type IconButtonTone = 'brand' | 'destructive' | 'inverse' | 'neutral';\nexport type IconButtonState = 'default' | 'disabled' | 'focus' | 'hover' | 'press';\n\ninterface StyleObject {\n [property: string]: number | string | undefined;\n}\ninterface IconButtonStyles {\n default?: StyleObject;\n disabled?: StyleObject;\n focus?: StyleObject;\n hover?: StyleObject;\n press?: StyleObject;\n}\n\nconst getIconButtonStyles = (\n theme: Theme,\n variant: IconButtonVariant = 'primary',\n tone: IconButtonTone = 'brand',\n size: 'medium' | 'small' = 'medium'\n): IconButtonStyles => {\n const isLight = theme.palette.mode === 'light';\n const palette = theme.palette.semantic;\n const radius = theme.radius['radius-8'] || 8;\n const boxShadow = theme.customShadows?.raised || '0px 1px 2px 0px rgba(0,0,0,0.1), 0px 2px 6px 0px rgba(0,0,0,0.15)';\n const sizePx = size === 'small' ? 32 : 48;\n\n const shared = {\n borderRadius: radius,\n width: sizePx,\n height: sizePx,\n boxShadow,\n minWidth: 0,\n padding: 0,\n position: 'relative',\n transition: 'all 0.2s ease-in-out',\n };\n\n const variants = {\n generic: {\n focus: {\n outlineOffset: '2px',\n outline: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n transition: 'none',\n },\n },\n primary: {\n brand: {\n default: {\n ...shared,\n background: palette.fill['fill-primary-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-primary-strong'], 0.1) : lighten(palette.fill['fill-primary-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-primary-strong'], 0.2) : lighten(palette.fill['fill-primary-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n background: palette.fill['fill-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? lighten(palette.fill['fill-strong'], 0.1) : darken(palette.fill['fill-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? lighten(palette.fill['fill-strong'], 0.2) : darken(palette.fill['fill-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n background: palette.fill['fill-error-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-error-strong'], 0.1) : lighten(palette.fill['fill-error-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-error-strong'], 0.2) : lighten(palette.fill['fill-error-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.1) : lighten(palette.fill['fill-inverse-strong'], 0.1),\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.2) : lighten(palette.fill['fill-inverse-strong'], 0.2),\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n },\n secondary: {\n brand: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n background: palette.fill['fill-strong'],\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-strong'], 0.1) : lighten(palette.fill['fill-strong'], 0.1),\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-strong'], 0.2) : lighten(palette.fill['fill-strong'], 0.2),\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.1) : lighten(palette.fill['fill-inverse-strong'], 0.1),\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.2) : lighten(palette.fill['fill-inverse-strong'], 0.2),\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n },\n tertiary: {\n brand: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n },\n };\n\n // Fallback to brand if tone not found\n const toneKey: IconButtonTone = tone in variants[variant] ? tone : 'brand';\n return { ...variants.generic, ...variants[variant][toneKey] };\n};\n\nexport default getIconButtonStyles;"],"names":["getIconButtonStyles","theme","variant","tone","size","isLight","palette","mode","semantic","sizePx","shared","borderRadius","radius","width","height","boxShadow","customShadows","raised","minWidth","padding","position","transition","variants","generic","focus","outlineOffset","outline","stroke","primary","brand","default","background","fill","color","icon","border","cursor","opacity","hover","darken","lighten","press","disabled","neutral","destructive","inverse","secondary","tertiary"],"mappings":"2DAiBA,MAAMA,EAAsB,CAC1BC,EACAC,EAA6B,UAC7BC,EAAuB,QACvBC,EAA2B,YAE3B,MAAMC,EAAiC,UAAvBJ,EAAMK,QAAQC,KACxBD,EAAUL,EAAMK,QAAQE,SAGxBC,EAAkB,UAATL,EAAmB,GAAK,GAEjCM,EAAS,CACbC,aALaV,EAAMW,OAAO,aAAe,EAMzCC,MAAOJ,EACPK,OAAQL,EACRM,UAPgBd,EAAMe,eAAeC,QAAU,oEAQ/CC,SAAU,EACVC,QAAS,EACTC,SAAU,WACVC,WAAY,wBAGRC,EAAW,CACfC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OAQjB,MAAO,IAAKf,EAASC,WAAYD,EAASpB,GADVC,KAAQmB,EAASpB,GAAWC,EAAO"}
|
|
1
|
+
{"version":3,"file":"getIconButtonStyles.js","sources":["../../../../src/components/atoms/IconButton/getIconButtonStyles.ts"],"sourcesContent":["import { darken, lighten, type Theme } from '@mui/material/styles';\n\nexport type IconButtonVariant = 'primary' | 'secondary' | 'tertiary';\nexport type IconButtonTone = 'brand' | 'destructive' | 'inverse' | 'neutral';\nexport type IconButtonState = 'default' | 'disabled' | 'focus' | 'hover' | 'press';\n\ninterface StyleObject {\n [property: string]: number | string | undefined;\n}\ninterface IconButtonStyles {\n default?: StyleObject;\n disabled?: StyleObject;\n focus?: StyleObject;\n hover?: StyleObject;\n press?: StyleObject;\n}\n\nconst getIconButtonStyles = (\n theme: Theme,\n variant: IconButtonVariant = 'primary',\n tone: IconButtonTone = 'brand',\n size: 'medium' | 'small' = 'medium'\n): IconButtonStyles => {\n const isLight = theme.palette.mode === 'light';\n const palette = theme.palette.semantic;\n const radius = theme.radius['radius-8'] || 8;\n const boxShadow = theme.customShadows?.raised || '0px 1px 2px 0px rgba(0,0,0,0.1), 0px 2px 6px 0px rgba(0,0,0,0.15)';\n const sizePx = size === 'small' ? 32 : 48;\n\n const shared = {\n borderRadius: radius,\n width: sizePx,\n height: sizePx,\n boxShadow,\n minWidth: 0,\n padding: 0,\n position: 'relative',\n transition: 'all 0.2s ease-in-out',\n };\n\n const variants = {\n generic: {\n focus: {\n outlineOffset: '2px',\n outline: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n transition: 'none',\n },\n },\n primary: {\n brand: {\n default: {\n ...shared,\n background: palette.fill['fill-primary-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-primary-strong'], 0.1) : lighten(palette.fill['fill-primary-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-primary-strong'], 0.2) : lighten(palette.fill['fill-primary-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n background: palette.fill['fill-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? lighten(palette.fill['fill-strong'], 0.1) : darken(palette.fill['fill-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? lighten(palette.fill['fill-strong'], 0.2) : darken(palette.fill['fill-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n background: palette.fill['fill-error-strong'],\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-error-strong'], 0.1) : lighten(palette.fill['fill-error-strong'], 0.1),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-error-strong'], 0.2) : lighten(palette.fill['fill-error-strong'], 0.2),\n color: palette.icon['icon-inverse'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.1) : lighten(palette.fill['fill-inverse-strong'], 0.1),\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.2) : lighten(palette.fill['fill-inverse-strong'], 0.2),\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n },\n secondary: {\n brand: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-primary'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-error'],\n border: `1px solid ${palette.stroke['stroke-error-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n background: palette.fill['fill-strong'],\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-strong'], 0.1) : lighten(palette.fill['fill-strong'], 0.1),\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-strong'], 0.2) : lighten(palette.fill['fill-strong'], 0.2),\n color: palette.icon['icon-strong'],\n border: `1px solid ${palette.stroke['stroke-primary-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n background: palette.fill['fill-inverse-strong'],\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.1) : lighten(palette.fill['fill-inverse-strong'], 0.1),\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: isLight ? darken(palette.fill['fill-inverse-strong'], 0.2) : lighten(palette.fill['fill-inverse-strong'], 0.2),\n color: palette.icon['icon-inverse-strong'],\n border: `1px solid ${palette.stroke['stroke-inverse-strong']}`,\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: `1px solid ${palette.stroke['stroke-disabled']}`,\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n },\n tertiary: {\n brand: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-primary'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n destructive: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-error'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n opacity: 0.5,\n },\n },\n neutral: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n inverse: {\n default: {\n ...shared,\n boxShadow: 'none',\n background: 'transparent',\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n hover: {\n ...shared,\n background: palette.fill['fill-hover'],\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n press: {\n ...shared,\n background: palette.fill['fill-press'],\n color: palette.icon['icon-inverse-strong'],\n border: 'none',\n cursor: 'pointer',\n opacity: 1,\n },\n disabled: {\n ...shared,\n background: palette.fill['fill-disabled'],\n color: palette.icon['icon-disabled'],\n border: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n opacity: 0.5,\n },\n },\n },\n };\n\n // Fallback to brand if tone not found\n const toneKey: IconButtonTone = tone in variants[variant] ? tone : 'brand';\n return { ...variants.generic, ...variants[variant][toneKey] };\n};\n\nexport default getIconButtonStyles;"],"names":["getIconButtonStyles","theme","variant","tone","size","isLight","palette","mode","semantic","sizePx","shared","borderRadius","radius","width","height","boxShadow","customShadows","raised","minWidth","padding","position","transition","variants","generic","focus","outlineOffset","outline","stroke","primary","brand","default","background","fill","color","icon","border","cursor","opacity","hover","darken","lighten","press","disabled","pointerEvents","neutral","destruct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