@flipdish/portal-library 4.2.4 → 4.2.6
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/Select/index.cjs.js +1 -1
- package/dist/components/atoms/Select/index.cjs.js.map +1 -1
- package/dist/components/atoms/Select/index.d.ts +19 -2
- package/dist/components/atoms/Select/index.js +1 -1
- package/dist/components/atoms/Select/index.js.map +1 -1
- package/dist/components/atoms/TextField/index.cjs.js +1 -1
- package/dist/components/atoms/TextField/index.cjs.js.map +1 -1
- package/dist/components/atoms/TextField/index.d.ts +21 -2
- package/dist/components/atoms/TextField/index.js +1 -1
- package/dist/components/atoms/TextField/index.js.map +1 -1
- package/dist/themes/flipdishPublicTheme.cjs.js +1 -1
- package/dist/themes/flipdishPublicTheme.cjs.js.map +1 -1
- package/dist/themes/flipdishPublicTheme.js +1 -1
- package/dist/themes/flipdishPublicTheme.js.map +1 -1
- package/dist/themes/overrides/formHelperTextOverrides.cjs.js +2 -0
- package/dist/themes/overrides/formHelperTextOverrides.cjs.js.map +1 -0
- package/dist/themes/overrides/formHelperTextOverrides.d.ts +5 -0
- package/dist/themes/overrides/formHelperTextOverrides.js +2 -0
- package/dist/themes/overrides/formHelperTextOverrides.js.map +1 -0
- package/dist/themes/overrides/inputBaseOverrides.cjs.js +2 -0
- package/dist/themes/overrides/inputBaseOverrides.cjs.js.map +1 -0
- package/dist/themes/overrides/inputBaseOverrides.d.ts +5 -0
- package/dist/themes/overrides/inputBaseOverrides.js +2 -0
- package/dist/themes/overrides/inputBaseOverrides.js.map +1 -0
- package/dist/themes/overrides/inputLabelOverrides.cjs.js +2 -0
- package/dist/themes/overrides/inputLabelOverrides.cjs.js.map +1 -0
- package/dist/themes/overrides/inputLabelOverrides.d.ts +5 -0
- package/dist/themes/overrides/inputLabelOverrides.js +2 -0
- package/dist/themes/overrides/inputLabelOverrides.js.map +1 -0
- package/dist/themes/overrides/menuItemOverrides.cjs.js +2 -0
- package/dist/themes/overrides/menuItemOverrides.cjs.js.map +1 -0
- package/dist/themes/overrides/menuItemOverrides.d.ts +5 -0
- package/dist/themes/overrides/menuItemOverrides.js +2 -0
- package/dist/themes/overrides/menuItemOverrides.js.map +1 -0
- package/dist/themes/overrides/selectOverrides.cjs.js +2 -0
- package/dist/themes/overrides/selectOverrides.cjs.js.map +1 -0
- package/dist/themes/overrides/selectOverrides.d.ts +5 -0
- package/dist/themes/overrides/selectOverrides.js +2 -0
- package/dist/themes/overrides/selectOverrides.js.map +1 -0
- package/dist/themes/overrides/textFieldOverrides.cjs.js +2 -0
- package/dist/themes/overrides/textFieldOverrides.cjs.js.map +1 -0
- package/dist/themes/overrides/textFieldOverrides.d.ts +5 -0
- package/dist/themes/overrides/textFieldOverrides.js +2 -0
- package/dist/themes/overrides/textFieldOverrides.js.map +1 -0
- package/package.json +2 -2
|
@@ -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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AAmBT,QAASgC,EAAWrB,UAAWsB,EAAcU,GAAI,CAAEC,GAAI,WAEzEzB,IACCG,GACCkB,EAAAA,IAACK,EAAU,CAAA,aAAa,eAAe7B,IAAS7B,SAAUA,EAAQoD,SAChEC,EAAAA,IAACM,EAAkB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as t,jsx 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"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AAMxC,EAAQyC,IACRC,EAAWC,EAAc3C,EAAM4C,YAAYC,KAAK,WAChDC,GAAcV,GAAUM,EAExBK,EAAYnB,GAAeG,EAC3BiB,EAAenB,GAAkBG,EAEvC,OACEiB,EAACvD,EAAkB,CACjBwD,QAAM,EACNjD,aAAc6C,EAAa7C,EAAe,OAC1CC,SAAUA,EACViD,QAASL,EACTM,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,KAGlB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,KAAKC,GACzBV,OAAA,MAAA,CAAAzC,SAAA,CAIGgC,IAAYnC,EAAAA,IAAC8C,EAAM,CAACC,KAAM,GAAI7C,QAAQ,cACrCiC,IAAYnC,EAAAA,IAAC8C,EAAM,CAACC,KAAM,GAAI7C,QAAQ,aACxCF,EAAAA,IAACvC,GAAuB0F,MAAI,EAAAhD,SAAEmD,MAJzB,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,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EAAAA,IAAC8C,EAAM,CAACC,KAAM,GAAI7C,QAAQ,cACrCiC,IAAYnC,EAAAA,IAAC8C,EAAM,CAACC,KAAM,GAAI7C,QAAQ,aACxCF,EAAAA,IAACvC,GAAuB0F,MAAI,EAAAhD,SAAEmD,MAJzB,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 +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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,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
|
+
{"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,QAEZ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AA6B,KAC1DlB,EAACqE,EAAe,CACdC,WAAYtD,EACZuD,uBAAwBrC,GAAmC/B,SAG3DH,EAAAiD,EAAA,CAAA9C,SAAGA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@mui/material/Select");module.exports=e;
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material/Box"),l=require("@mui/material/FormHelperText"),t=require("@mui/material/InputLabel"),s=require("@mui/material/MenuItem"),d=require("@mui/material/Select"),a=require("@mui/material/styles"),o=require("../../../icons/ArrowDown01/index.cjs.js"),n=require("../../../icons/ArrowUp01/index.cjs.js"),u=require("../../../icons/CancelCircle/index.cjs.js");const c=a.styled(i,{shouldForwardProp:e=>"fullWidth"!==e})((({theme:e,fullWidth:r=!1})=>({display:"flex",flexDirection:"column",gap:e.spacing(.5),width:r?"100%":"min(364px, 100%)"}))),h=a.styled(d,{shouldForwardProp:e=>!["fullWidth","showPlaceholder"].includes(e)})((({theme:e,fullWidth:r=!1,showPlaceholder:i=!1})=>({display:"flex",width:r?"100%":"auto","& .MuiSelect-select":{color:i?e.palette.semantic.text["text-weak"]:e.palette.semantic.text["text-strong"]}}))),p=a.styled(i,{shouldForwardProp:e=>"disabled"!==e})((({theme:e,disabled:r=!1})=>({alignItems:"center",cursor:r?"not-allowed":"pointer",display:"flex",justifyContent:"center",pointerEvents:"auto","& svg":{color:r?e.palette.semantic.icon["icon-disabled"]:e.palette.semantic.icon["icon-strong"]}})));module.exports=({children:i,disabled:d=!1,errorText:a,fdKey:m,fullWidth:x=!1,helperText:j,label:b,onChange:f,options:q=[],placeholder:v,required:w=!1,value:g,...y})=>{const[C,P]=r.useState(!1),W=j?`${m}-helper-text`:void 0,F=a?`${m}-error-message`:void 0,I=[W,F].filter(Boolean).join(" ")||void 0,S=!!a&&!d,k=!(!v||g&&""!==g),M=()=>{d||P((e=>!e))},T=r.useMemo((()=>q.map((r=>e.jsx(s,{disabled:r.disabled,value:r.value,children:r.label},r.value)))),[q]);return e.jsxs(c,{fullWidth:x,children:[b&&e.jsx(t,{disabled:d,htmlFor:m,required:w,children:b}),j&&e.jsx(l,{disabled:d,id:W,children:j}),S&&e.jsxs(l,{error:!0,id:F,children:[e.jsx(u,{}),a]}),e.jsx(h,{"data-fd":m,disabled:d,error:S,fullWidth:x,IconComponent:()=>e.jsx(p,{disabled:d,onClick:e=>{d||(e.stopPropagation(),M())},children:C?e.jsx(n,{}):e.jsx(o,{})}),id:m,inputProps:{"aria-describedby":I},label:"",onChange:(e,r)=>{const i=r?.props?.disabled;i||f&&f(e,r)},onClick:M,open:C,required:w,showPlaceholder:k,value:k?v:String(g),variant:"outlined",...y,children:(()=>{const r=[];return k&&r.push(e.jsx(s,{disabled:!0,"aria-hidden":"true",sx:{display:"none"},value:v,children:v},"placeholder")),q?.length>0?r.push(...T):r.push(i),r})()})]})};
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/Select/index.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\n\nimport Box from '@mui/material/Box';\nimport MuiFormHelperText from '@mui/material/FormHelperText';\nimport MuiInputLabel from '@mui/material/InputLabel';\nimport MuiMenuItem from '@mui/material/MenuItem';\nimport MuiSelect, { type SelectChangeEvent, type SelectProps as MuiSelectProps } from '@mui/material/Select';\nimport { styled } from '@mui/material/styles';\n\nimport ArrowDown01Icon from '@fd/icons/ArrowDown01';\nimport ArrowUp01Icon from '@fd/icons/ArrowUp01';\nimport CancelCircleIcon from '@fd/icons/CancelCircle';\n\nexport interface SelectOption {\n value: number | string;\n label: string;\n disabled?: boolean;\n}\n\nexport type SelectProps = Omit<MuiSelectProps, 'error' | 'id' | 'value' | 'variant'> & {\n errorText?: string;\n fdKey: string;\n helperText?: string;\n options?: SelectOption[];\n placeholder?: string;\n value?: number | string;\n};\n\nconst StyledContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ theme, fullWidth = false }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(0.5),\n width: fullWidth ? '100%' : 'min(364px, 100%)', // Constrain minWidth to a maximum of 100% of the container width\n}));\n\nconst StyledSelect = styled(MuiSelect, {\n shouldForwardProp: (prop) => !['fullWidth', 'showPlaceholder'].includes(prop as string),\n})<{ fullWidth?: boolean; showPlaceholder?: boolean }>(\n ({ theme, fullWidth = false, showPlaceholder = false }) => ({\n display: 'flex',\n width: fullWidth ? '100%' : 'auto',\n\n '& .MuiSelect-select': {\n color: showPlaceholder\n ? theme.palette.semantic.text['text-weak']\n : theme.palette.semantic.text['text-strong'],\n },\n }),\n);\n\nconst StyledIconContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'disabled',\n})<{ disabled?: boolean }>(({ theme, disabled = false }) => ({\n alignItems: 'center',\n cursor: disabled ? 'not-allowed' : 'pointer',\n display: 'flex',\n justifyContent: 'center',\n pointerEvents: 'auto',\n\n '& svg': {\n color: disabled\n ? theme.palette.semantic.icon['icon-disabled']\n : theme.palette.semantic.icon['icon-strong'],\n },\n}));\n\nconst Select = ({\n children,\n disabled = false,\n errorText,\n fdKey,\n fullWidth = false,\n helperText,\n label,\n onChange,\n options = [],\n placeholder,\n required = false,\n value,\n ...props\n}: SelectProps): JSX.Element => {\n const [isOpen, setIsOpen] = useState<boolean>(false);\n\n const helperTextId = helperText ? `${fdKey}-helper-text` : undefined;\n const errorMessageId = errorText ? `${fdKey}-error-message` : undefined;\n\n // Combine helper text and error message IDs for aria-describedby\n const ariaDescribedBy = [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n const isError = !!errorText && !disabled;\n const showPlaceholder = !!placeholder && (!value || value === '');\n\n const handleOpen = (): void => {\n if (disabled) {\n return;\n }\n\n setIsOpen((open) => !open);\n };\n\n const handleChange = (event: SelectChangeEvent<unknown>, child?: React.ReactNode): void => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const isMenuItemDisabled = (child as React.ReactElement)?.props?.disabled;\n if (isMenuItemDisabled) {\n return;\n }\n\n // Call the original onChange handler if provided\n if (onChange) {\n onChange(event, child);\n }\n };\n\n const getDisplayValue = (): string => {\n if (showPlaceholder) {\n return placeholder;\n }\n\n return String(value);\n };\n\n const renderIcon = (): JSX.Element => {\n const handleIconClick = (event: React.MouseEvent): void => {\n if (disabled) {\n return;\n }\n\n event.stopPropagation();\n handleOpen();\n };\n\n return (\n <StyledIconContainer disabled={disabled} onClick={handleIconClick}>\n {isOpen ? <ArrowUp01Icon /> : <ArrowDown01Icon />}\n </StyledIconContainer>\n );\n };\n\n const optionsMenuItems = useMemo((): React.ReactNode[] => {\n return options.map((option) => (\n <MuiMenuItem key={option.value} disabled={option.disabled} value={option.value}>\n {option.label}\n </MuiMenuItem>\n ));\n }, [options]);\n\n const renderMenuItems = (): React.ReactNode => {\n const menuItems = [];\n\n // Workaround to get the placeholder to show up when no value is selected\n // Placeholder must be a menu item to be displayed\n if (showPlaceholder) {\n menuItems.push(\n <MuiMenuItem\n key=\"placeholder\"\n disabled\n aria-hidden=\"true\"\n sx={{ display: 'none' }}\n value={placeholder}\n >\n {placeholder}\n </MuiMenuItem>,\n );\n }\n\n // Add either options or children\n if (options?.length > 0) {\n menuItems.push(...optionsMenuItems);\n } else {\n // If no options are provided, use the children\n menuItems.push(children);\n }\n\n return menuItems;\n };\n\n return (\n <StyledContainer fullWidth={fullWidth}>\n {label && (\n <MuiInputLabel disabled={disabled} htmlFor={fdKey} required={required}>\n {label}\n </MuiInputLabel>\n )}\n\n {helperText && (\n <MuiFormHelperText disabled={disabled} id={helperTextId}>\n {helperText}\n </MuiFormHelperText>\n )}\n\n {isError && (\n <MuiFormHelperText error id={errorMessageId}>\n <CancelCircleIcon />\n\n {errorText}\n </MuiFormHelperText>\n )}\n\n <StyledSelect\n data-fd={fdKey}\n disabled={disabled}\n error={isError}\n fullWidth={fullWidth}\n IconComponent={renderIcon}\n id={fdKey}\n inputProps={{\n 'aria-describedby': ariaDescribedBy,\n }}\n label=\"\" // Remove label from Select since we're rendering it separately\n onChange={handleChange}\n onClick={handleOpen}\n open={isOpen}\n required={required}\n showPlaceholder={showPlaceholder}\n value={getDisplayValue()}\n variant=\"outlined\"\n {...props}\n >\n {renderMenuItems()}\n </StyledSelect>\n </StyledContainer>\n );\n};\n\nexport default Select;\n"],"names":["StyledContainer","styled","Box","shouldForwardProp","prop","theme","fullWidth","display","flexDirection","gap","spacing","width","StyledSelect","MuiSelect","includes","showPlaceholder","color","palette","semantic","text","StyledIconContainer","disabled","alignItems","cursor","justifyContent","pointerEvents","icon","children","errorText","fdKey","helperText","label","onChange","options","placeholder","required","value","props","isOpen","setIsOpen","useState","helperTextId","undefined","errorMessageId","ariaDescribedBy","filter","Boolean","join","isError","handleOpen","open","optionsMenuItems","useMemo","map","option","_jsx","MuiMenuItem","_jsxs","MuiInputLabel","htmlFor","MuiFormHelperText","id","error","CancelCircleIcon","IconComponent","onClick","event","stopPropagation","ArrowUp01Icon","ArrowDown01Icon","inputProps","child","isMenuItemDisabled","String","variant","menuItems","push","sx","length","renderMenuItems"],"mappings":"wbA4BA,MAAMA,EAAkBC,EAAAA,OAAOC,EAAK,CAClCC,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGI,QAAOC,aAAY,MAAO,CACvDC,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,IACnBC,MAAOL,EAAY,OAAS,uBAGxBM,EAAeX,EAAAA,OAAOY,EAAW,CACrCV,kBAAoBC,IAAU,CAAC,YAAa,mBAAmBU,SAASV,IADrDH,EAGnB,EAAGI,QAAOC,aAAY,EAAOS,mBAAkB,MAAO,CACpDR,QAAS,OACTI,MAAOL,EAAY,OAAS,OAE5B,sBAAuB,CACr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AAAA,IAACQ,MAEAnC,KAIL2B,EAAAA,IAAC3C,EAAY,CAAA,UACFiB,EACTR,SAAUA,EACVyC,MAAOd,EACP1C,UAAWA,EACX0D,cAlFa,IAWfT,EAAAA,IAACnC,EAAmB,CAACC,SAAUA,EAAU4C,QAVlBC,IACnB7C,IAIJ6C,EAAMC,kBACNlB,MAIiEtB,SAC9DW,EAASiB,EAAAA,IAACa,EAAa,IAAMb,EAAAA,IAACc,EAAe,CAAA,KAuE9CR,GAAIhC,EACJyC,WAAY,CACV,mBAAoB1B,GAEtBb,MAAM,GACNC,SA7Ge,CAACkC,EAAmCK,KAEvD,MAAMC,EAAsBD,GAA8BlC,OAAOhB,SAC7DmD,GAKAxC,GACFA,EAASkC,EAAOK,IAqGdN,QAAShB,EACTC,KAAMZ,EACNH,SAAUA,EACVpB,gBAAiBA,EACjBqB,MApGArB,EACKmB,EAGFuC,OAAOrC,GAiGVsC,QAAQ,cACJrC,WAtEc,MACtB,MAAMsC,EAAY,GA0BlB,OAtBI5D,GACF4D,EAAUC,KACRrB,EAAAA,IAACC,EAAW,CAEVnC,UAAQ,EAAA,cACI,OACZwD,GAAI,CAAEtE,QAAS,QACf6B,MAAOF,EAAWP,SAEjBO,GANG,gBAYND,GAAS6C,OAAS,EACpBH,EAAUC,QAAQzB,GAGlBwB,EAAUC,KAAKjD,GAGVgD,GA6CFI"}
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { SelectProps as SelectProps$1 } from '@mui/material/Select';
|
|
2
|
+
|
|
3
|
+
interface SelectOption {
|
|
4
|
+
value: number | string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
type SelectProps = Omit<SelectProps$1, 'error' | 'id' | 'value' | 'variant'> & {
|
|
9
|
+
errorText?: string;
|
|
10
|
+
fdKey: string;
|
|
11
|
+
helperText?: string;
|
|
12
|
+
options?: SelectOption[];
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
value?: number | string;
|
|
15
|
+
};
|
|
16
|
+
declare const Select: ({ children, disabled, errorText, fdKey, fullWidth, helperText, label, onChange, options, placeholder, required, value, ...props }: SelectProps) => JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { Select as default };
|
|
19
|
+
export type { SelectOption, SelectProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@mui/material/Select";
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useState as i,useMemo as l}from"react";import o from"@mui/material/Box";import t from"@mui/material/FormHelperText";import a from"@mui/material/InputLabel";import d from"@mui/material/MenuItem";import n from"@mui/material/Select";import{styled as s}from"@mui/material/styles";import m from"../../../icons/ArrowDown01/index.js";import c from"../../../icons/ArrowUp01/index.js";import p from"../../../icons/CancelCircle/index.js";const u=s(o,{shouldForwardProp:e=>"fullWidth"!==e})((({theme:e,fullWidth:r=!1})=>({display:"flex",flexDirection:"column",gap:e.spacing(.5),width:r?"100%":"min(364px, 100%)"}))),h=s(n,{shouldForwardProp:e=>!["fullWidth","showPlaceholder"].includes(e)})((({theme:e,fullWidth:r=!1,showPlaceholder:i=!1})=>({display:"flex",width:r?"100%":"auto","& .MuiSelect-select":{color:i?e.palette.semantic.text["text-weak"]:e.palette.semantic.text["text-strong"]}}))),f=s(o,{shouldForwardProp:e=>"disabled"!==e})((({theme:e,disabled:r=!1})=>({alignItems:"center",cursor:r?"not-allowed":"pointer",display:"flex",justifyContent:"center",pointerEvents:"auto","& svg":{color:r?e.palette.semantic.icon["icon-disabled"]:e.palette.semantic.icon["icon-strong"]}}))),x=({children:o,disabled:n=!1,errorText:s,fdKey:x,fullWidth:b=!1,helperText:w,label:g,onChange:v,options:y=[],placeholder:C,required:P=!1,value:W,...j})=>{const[F,I]=i(!1),k=w?`${x}-helper-text`:void 0,q=s?`${x}-error-message`:void 0,S=[k,q].filter(Boolean).join(" ")||void 0,T=!!s&&!n,A=!(!C||W&&""!==W),B=()=>{n||I((e=>!e))},D=l((()=>y.map((r=>e(d,{disabled:r.disabled,value:r.value,children:r.label},r.value)))),[y]);return r(u,{fullWidth:b,children:[g&&e(a,{disabled:n,htmlFor:x,required:P,children:g}),w&&e(t,{disabled:n,id:k,children:w}),T&&r(t,{error:!0,id:q,children:[e(p,{}),s]}),e(h,{"data-fd":x,disabled:n,error:T,fullWidth:b,IconComponent:()=>e(f,{disabled:n,onClick:e=>{n||(e.stopPropagation(),B())},children:e(F?c:m,{})}),id:x,inputProps:{"aria-describedby":S},label:"",onChange:(e,r)=>{const i=r?.props?.disabled;i||v&&v(e,r)},onClick:B,open:F,required:P,showPlaceholder:A,value:A?C:String(W),variant:"outlined",...j,children:(()=>{const r=[];return A&&r.push(e(d,{disabled:!0,"aria-hidden":"true",sx:{display:"none"},value:C,children:C},"placeholder")),y?.length>0?r.push(...D):r.push(o),r})()})]})};export{x as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Select/index.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\n\nimport Box from '@mui/material/Box';\nimport MuiFormHelperText from '@mui/material/FormHelperText';\nimport MuiInputLabel from '@mui/material/InputLabel';\nimport MuiMenuItem from '@mui/material/MenuItem';\nimport MuiSelect, { type SelectChangeEvent, type SelectProps as MuiSelectProps } from '@mui/material/Select';\nimport { styled } from '@mui/material/styles';\n\nimport ArrowDown01Icon from '@fd/icons/ArrowDown01';\nimport ArrowUp01Icon from '@fd/icons/ArrowUp01';\nimport CancelCircleIcon from '@fd/icons/CancelCircle';\n\nexport interface SelectOption {\n value: number | string;\n label: string;\n disabled?: boolean;\n}\n\nexport type SelectProps = Omit<MuiSelectProps, 'error' | 'id' | 'value' | 'variant'> & {\n errorText?: string;\n fdKey: string;\n helperText?: string;\n options?: SelectOption[];\n placeholder?: string;\n value?: number | string;\n};\n\nconst StyledContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ theme, fullWidth = false }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(0.5),\n width: fullWidth ? '100%' : 'min(364px, 100%)', // Constrain minWidth to a maximum of 100% of the container width\n}));\n\nconst StyledSelect = styled(MuiSelect, {\n shouldForwardProp: (prop) => !['fullWidth', 'showPlaceholder'].includes(prop as string),\n})<{ fullWidth?: boolean; showPlaceholder?: boolean }>(\n ({ theme, fullWidth = false, showPlaceholder = false }) => ({\n display: 'flex',\n width: fullWidth ? '100%' : 'auto',\n\n '& .MuiSelect-select': {\n color: showPlaceholder\n ? theme.palette.semantic.text['text-weak']\n : theme.palette.semantic.text['text-strong'],\n },\n }),\n);\n\nconst StyledIconContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'disabled',\n})<{ disabled?: boolean }>(({ theme, disabled = false }) => ({\n alignItems: 'center',\n cursor: disabled ? 'not-allowed' : 'pointer',\n display: 'flex',\n justifyContent: 'center',\n pointerEvents: 'auto',\n\n '& svg': {\n color: disabled\n ? theme.palette.semantic.icon['icon-disabled']\n : theme.palette.semantic.icon['icon-strong'],\n },\n}));\n\nconst Select = ({\n children,\n disabled = false,\n errorText,\n fdKey,\n fullWidth = false,\n helperText,\n label,\n onChange,\n options = [],\n placeholder,\n required = false,\n value,\n ...props\n}: SelectProps): JSX.Element => {\n const [isOpen, setIsOpen] = useState<boolean>(false);\n\n const helperTextId = helperText ? `${fdKey}-helper-text` : undefined;\n const errorMessageId = errorText ? `${fdKey}-error-message` : undefined;\n\n // Combine helper text and error message IDs for aria-describedby\n const ariaDescribedBy = [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n const isError = !!errorText && !disabled;\n const showPlaceholder = !!placeholder && (!value || value === '');\n\n const handleOpen = (): void => {\n if (disabled) {\n return;\n }\n\n setIsOpen((open) => !open);\n };\n\n const handleChange = (event: SelectChangeEvent<unknown>, child?: React.ReactNode): void => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const isMenuItemDisabled = (child as React.ReactElement)?.props?.disabled;\n if (isMenuItemDisabled) {\n return;\n }\n\n // Call the original onChange handler if provided\n if (onChange) {\n onChange(event, child);\n }\n };\n\n const getDisplayValue = (): string => {\n if (showPlaceholder) {\n return placeholder;\n }\n\n return String(value);\n };\n\n const renderIcon = (): JSX.Element => {\n const handleIconClick = (event: React.MouseEvent): void => {\n if (disabled) {\n return;\n }\n\n event.stopPropagation();\n handleOpen();\n };\n\n return (\n <StyledIconContainer disabled={disabled} onClick={handleIconClick}>\n {isOpen ? <ArrowUp01Icon /> : <ArrowDown01Icon />}\n </StyledIconContainer>\n );\n };\n\n const optionsMenuItems = useMemo((): React.ReactNode[] => {\n return options.map((option) => (\n <MuiMenuItem key={option.value} disabled={option.disabled} value={option.value}>\n {option.label}\n </MuiMenuItem>\n ));\n }, [options]);\n\n const renderMenuItems = (): React.ReactNode => {\n const menuItems = [];\n\n // Workaround to get the placeholder to show up when no value is selected\n // Placeholder must be a menu item to be displayed\n if (showPlaceholder) {\n menuItems.push(\n <MuiMenuItem\n key=\"placeholder\"\n disabled\n aria-hidden=\"true\"\n sx={{ display: 'none' }}\n value={placeholder}\n >\n {placeholder}\n </MuiMenuItem>,\n );\n }\n\n // Add either options or children\n if (options?.length > 0) {\n menuItems.push(...optionsMenuItems);\n } else {\n // If no options are provided, use the children\n menuItems.push(children);\n }\n\n return menuItems;\n };\n\n return (\n <StyledContainer fullWidth={fullWidth}>\n {label && (\n <MuiInputLabel disabled={disabled} htmlFor={fdKey} required={required}>\n {label}\n </MuiInputLabel>\n )}\n\n {helperText && (\n <MuiFormHelperText disabled={disabled} id={helperTextId}>\n {helperText}\n </MuiFormHelperText>\n )}\n\n {isError && (\n <MuiFormHelperText error id={errorMessageId}>\n <CancelCircleIcon />\n\n {errorText}\n </MuiFormHelperText>\n )}\n\n <StyledSelect\n data-fd={fdKey}\n disabled={disabled}\n error={isError}\n fullWidth={fullWidth}\n IconComponent={renderIcon}\n id={fdKey}\n inputProps={{\n 'aria-describedby': ariaDescribedBy,\n }}\n label=\"\" // Remove label from Select since we're rendering it separately\n onChange={handleChange}\n onClick={handleOpen}\n open={isOpen}\n required={required}\n showPlaceholder={showPlaceholder}\n value={getDisplayValue()}\n variant=\"outlined\"\n {...props}\n >\n {renderMenuItems()}\n </StyledSelect>\n </StyledContainer>\n );\n};\n\nexport default Select;\n"],"names":["StyledContainer","styled","Box","shouldForwardProp","prop","theme","fullWidth","display","flexDirection","gap","spacing","width","StyledSelect","MuiSelect","includes","showPlaceholder","color","palette","semantic","text","StyledIconContainer","disabled","alignItems","cursor","justifyContent","pointerEvents","icon","Select","children","errorText","fdKey","helperText","label","onChange","options","placeholder","required","value","props","isOpen","setIsOpen","useState","helperTextId","undefined","errorMessageId","ariaDescribedBy","filter","Boolean","join","isError","handleOpen","open","optionsMenuItems","useMemo","map","option","_jsx","MuiMenuItem","_jsxs","MuiInputLabel","htmlFor","MuiFormHelperText","id","error","CancelCircleIcon","IconComponent","onClick","event","stopPropagation","ArrowUp01Icon","ArrowDown01Icon","inputProps","child","isMenuItemDisabled","String","variant","menuItems","push","sx","length","renderMenuItems"],"mappings":"qeA4BA,MAAMA,EAAkBC,EAAOC,EAAK,CAClCC,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGI,QAAOC,aAAY,MAAO,CACvDC,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,IACnBC,MAAOL,EAAY,OAAS,uBAGxBM,EAAeX,EAAOY,EAAW,CACrCV,kBAAoBC,IAAU,CAAC,YAAa,mBAAmBU,SAASV,IADrDH,EAGnB,EAAGI,QAAOC,aAAY,EAAOS,mBAAkB,MAAO,CACpDR,QAAS,OACTI,MAAOL,EAAY,OAAS,OAE5B,sBAAuB,CACrBU,MAAOD,EACHV,EAAM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,MAAOd,EACP3C,UAAWA,EACX2D,cAlFa,IAWfT,EAACpC,EAAmB,CAACC,SAAUA,EAAU6C,QAVlBC,IACnB9C,IAIJ8C,EAAMC,kBACNlB,MAIiEtB,SACrD4B,EAATjB,EAAU8B,EAAoBC,EAAP,MAuExBR,GAAIhC,EACJyC,WAAY,CACV,mBAAoB1B,GAEtBb,MAAM,GACNC,SA7Ge,CAACkC,EAAmCK,KAEvD,MAAMC,EAAsBD,GAA8BlC,OAAOjB,SAC7DoD,GAKAxC,GACFA,EAASkC,EAAOK,IAqGdN,QAAShB,EACTC,KAAMZ,EACNH,SAAUA,EACVrB,gBAAiBA,EACjBsB,MApGAtB,EACKoB,EAGFuC,OAAOrC,GAiGVsC,QAAQ,cACJrC,WAtEc,MACtB,MAAMsC,EAAY,GA0BlB,OAtBI7D,GACF6D,EAAUC,KACRrB,EAACC,EAAW,CAEVpC,UAAQ,EAAA,cACI,OACZyD,GAAI,CAAEvE,QAAS,QACf8B,MAAOF,EAAWP,SAEjBO,GANG,gBAYND,GAAS6C,OAAS,EACpBH,EAAUC,QAAQzB,GAGlBwB,EAAUC,KAAKjD,GAGVgD,GA6CFI"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@mui/material/TextField");module.exports=e;
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material/Box"),l=require("@mui/material/FormHelperText"),t=require("@mui/material/InputAdornment"),d=require("@mui/material/InputLabel"),s=require("@mui/material/styles"),a=require("@mui/material/TextField"),n=require("../../../icons/CancelCircle/index.cjs.js"),u=require("../../../icons/View/index.cjs.js"),o=require("../../../icons/ViewOff/index.cjs.js"),x=require("../IconButton/index.cjs.js");const c=s.styled(i,{shouldForwardProp:e=>"fullWidth"!==e})((({theme:e,fullWidth:r=!1})=>({display:"flex",flexDirection:"column",gap:e.spacing(.5),width:r?"100%":"min(364px, 100%)"}))),m=s.styled(a,{shouldForwardProp:e=>"fullWidth"!==e})((({fullWidth:e=!1})=>({display:"flex",width:e?"100%":"auto"})));module.exports=({disabled:i=!1,errorText:s,fdKey:a,fullWidth:h=!1,helperText:p,hidePasswordAriaLabel:j,label:f,multiline:q=!1,required:b=!1,showPasswordAriaLabel:w,type:y="text",...W})=>{const[v,F]=r.useState(!1),I=p?`${a}-helper-text`:void 0,P=s?`${a}-error-message`:void 0,A=[I,P].filter(Boolean).join(" ")||void 0,B=!!s&&!i,T="password"===y,g=()=>F((e=>!e));return e.jsxs(c,{fullWidth:h,children:[f&&e.jsx(d,{disabled:i,htmlFor:a,required:b,children:f}),p&&e.jsx(l,{disabled:i,id:I,children:p}),B&&e.jsxs(l,{error:!0,id:P,children:[e.jsx(n,{}),s]}),e.jsx(m,{"data-fd":a,disabled:i,error:B,fullWidth:h,id:a,label:"",multiline:q,required:b,slotProps:{input:{endAdornment:(()=>{if(T){if(!w||!j)return;return e.jsx(t,{position:"end",children:e.jsx(x.IconButton,{"aria-label":v?j:w,disabled:i,onClick:g,size:"small",tone:"neutral",variant:"tertiary",children:v?e.jsx(o,{}):e.jsx(u,{})})})}})()},htmlInput:{"aria-describedby":A}},type:T?v?"text":"password":y,variant:"outlined",...W})]})};
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/TextField/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Box from '@mui/material/Box';\nimport MuiFormHelperText from '@mui/material/FormHelperText';\nimport MuiInputAdornment from '@mui/material/InputAdornment';\nimport MuiInputLabel from '@mui/material/InputLabel';\nimport { styled } from '@mui/material/styles';\nimport MuiTextField, { type TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';\n\nimport CancelCircleIcon from '@fd/icons/CancelCircle';\nimport ViewIcon from '@fd/icons/View';\nimport ViewOffIcon from '@fd/icons/ViewOff';\n\nimport IconButton from '../IconButton';\n\n// Common props for all TextField variants\ntype BaseTextFieldProps = Omit<MuiTextFieldProps, 'error' | 'id' | 'type' | 'variant'> & {\n errorText?: string;\n fdKey: string;\n};\n\n// Password TextField variant - requires aria labels\ntype PasswordTextFieldProps = BaseTextFieldProps & {\n type: 'password';\n showPasswordAriaLabel: string;\n hidePasswordAriaLabel: string;\n};\n\n// Generic TextField variant - for all other input types\ntype GenericTextFieldProps = BaseTextFieldProps & {\n type?: Exclude<MuiTextFieldProps['type'], 'password'>;\n showPasswordAriaLabel?: never;\n hidePasswordAriaLabel?: never;\n};\n\nexport type TextFieldProps = GenericTextFieldProps | PasswordTextFieldProps;\n\nconst StyledContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ theme, fullWidth = false }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(0.5),\n width: fullWidth ? '100%' : 'min(364px, 100%)', // Constrain minWidth to a maximum of 100% of the container width\n}));\n\nconst StyledTextField = styled(MuiTextField, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ fullWidth = false }) => ({\n display: 'flex',\n width: fullWidth ? '100%' : 'auto',\n}));\n\nconst TextField = ({\n disabled = false,\n errorText,\n fdKey,\n fullWidth = false,\n helperText,\n hidePasswordAriaLabel,\n label,\n multiline = false,\n required = false,\n showPasswordAriaLabel,\n type = 'text',\n ...props\n}: TextFieldProps): JSX.Element => {\n const [showPassword, setShowPassword] = useState<boolean>(false);\n\n const helperTextId = helperText ? `${fdKey}-helper-text` : undefined;\n const errorMessageId = errorText ? `${fdKey}-error-message` : undefined;\n\n // Combine helper text and error message IDs for aria-describedby\n const ariaDescribedBy = [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n const isError = !!errorText && !disabled;\n const isPassword = type === 'password';\n\n const handleClickShowPassword = (): void => setShowPassword((show) => !show);\n\n const getFieldType = (): MuiTextFieldProps['type'] => {\n if (isPassword) {\n return showPassword ? 'text' : 'password';\n }\n\n return type;\n };\n\n const renderEndAdornment = (): React.ReactNode => {\n if (isPassword) {\n if (!showPasswordAriaLabel || !hidePasswordAriaLabel) {\n return undefined;\n }\n\n return (\n <MuiInputAdornment position=\"end\">\n <IconButton\n aria-label={showPassword ? hidePasswordAriaLabel : showPasswordAriaLabel}\n disabled={disabled}\n onClick={handleClickShowPassword}\n size=\"small\"\n tone=\"neutral\"\n variant=\"tertiary\"\n >\n {showPassword ? <ViewOffIcon /> : <ViewIcon />}\n </IconButton>\n </MuiInputAdornment>\n );\n }\n\n return undefined;\n };\n\n return (\n <StyledContainer fullWidth={fullWidth}>\n {label && (\n <MuiInputLabel disabled={disabled} htmlFor={fdKey} required={required}>\n {label}\n </MuiInputLabel>\n )}\n\n {helperText && (\n <MuiFormHelperText disabled={disabled} id={helperTextId}>\n {helperText}\n </MuiFormHelperText>\n )}\n\n {isError && (\n <MuiFormHelperText error id={errorMessageId}>\n <CancelCircleIcon />\n\n {errorText}\n </MuiFormHelperText>\n )}\n\n <StyledTextField\n data-fd={fdKey}\n disabled={disabled}\n error={isError}\n fullWidth={fullWidth}\n id={fdKey}\n label=\"\" // Remove label from TextField since we're rendering it separately\n multiline={multiline}\n required={required}\n slotProps={{\n input: {\n endAdornment: renderEndAdornment(),\n },\n htmlInput: {\n 'aria-describedby': ariaDescribedBy,\n },\n }}\n type={getFieldType()}\n variant=\"outlined\"\n {...props}\n />\n </StyledContainer>\n );\n};\n\nexport default TextField;\n"],"names":["StyledContainer","styled","Box","shouldForwardProp","prop","theme","fullWidth","display","flexDirection","gap","spacing","width","StyledTextField","MuiTextField","disabled","errorText","fdKey","helperText","hidePasswordAriaLabel","label","multiline","required","showPasswordAriaLabel","type","props","showPassword","setShowPassword","useState","helperTextId","undefined","errorMessageId","ariaDescribedBy","filter","Boolean","join","isError","isPassword","handleClickShowPassword","show","_jsxs","_jsx","MuiInputLabel","htmlFor","MuiFormHelperText","id","error","children","CancelCircleIcon","slotProps","input","endAdornment","MuiInputAdornment","position","IconButton","onClick","size","tone","variant","ViewOffIcon","ViewIcon","renderEndAdornment","htmlInput"],"mappings":"geAqCA,MAAMA,EAAkBC,EAAAA,OAAOC,EAAK,CAClCC,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGI,QAAOC,aAAY,MAAO,CACvDC,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,IACnBC,MAAOL,EAAY,OAAS,uBAGxBM,EAAkBX,EAAAA,OAAOY,EAAc,CAC3CV,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGK,aAAY,MAAO,CAChDC,QAAS,OACTI,MAAOL,EAAY,OAAS,0BAGZ,EAChBQ,YAAW,EACXC,YACAC,QACAV,aAAY,EACZW,aACAC,wBACAC,QACAC,aAAY,EACZC,YAAW,EACXC,wBACAC,OAAO,UACJC,MAEH,MAAOC,EAAcC,GAAmBC,EAAAA,UAAkB,GAEpDC,EAAeX,EAAa,GAAGD,qBAAsBa,EACrDC,EAAiBf,EAAY,GAAGC,uBAAwBa,EAGxDE,EAAkB,CAACH,EAAcE,GAAgBE,OAAOC,SAASC,KAAK,WAAQL,EAE9EM,IAAYpB,IAAcD,EAC1BsB,EAAsB,aAATb,EAEbc,EAA0B,IAAYX,GAAiBY,IAAUA,IAmCvE,OACEC,EAAAA,KAACvC,EAAe,CAACM,UAAWA,YACzBa,GACCqB,EAAAA,IAACC,GAAc3B,SAAUA,EAAU4B,QAAS1B,EAAOK,SAAUA,WAC1DF,IAIJF,GACCuB,EAAAA,IAACG,EAAiB,CAAC7B,SAAUA,EAAU8B,GAAIhB,WACxCX,IAIJkB,GACCI,EAAAA,KAACI,EAAiB,CAACE,SAAMD,GAAId,EAAcgB,SAAA,CACzCN,EAAAA,IAACO,EAAgB,CAAA,GAEhBhC,KAILyB,EAAAA,IAAC5B,aACUI,EACTF,SAAUA,EACV+B,MAAOV,EACP7B,UAAWA,EACXsC,GAAI5B,EACJG,MAAM,GACNC,UAAWA,EACXC,SAAUA,EACV2B,UAAW,CACTC,MAAO,CACLC,aA1DiB,MACzB,GAAId,EAAY,CACd,IAAKd,IAA0BJ,EAC7B,OAGF,OACEsB,EAAAA,IAACW,EAAiB,CAACC,SAAS,MAAKN,SAC/BN,MAACa,EAAAA,WAAU,CAAA,aACG5B,EAAeP,EAAwBI,EACnDR,SAAUA,EACVwC,QAASjB,EACTkB,KAAK,QACLC,KAAK,UACLC,QAAQ,WAAUX,SAEjBrB,EAAee,EAAAA,IAACkB,EAAW,CAAA,GAAMlB,EAAAA,IAACmB,EAAQ,CAAA,MAInD,GAsCsBC,IAEhBC,UAAW,CACT,mBAAoB9B,IAGxBR,KAvEAa,EACKX,EAAe,OAAS,WAG1BF,EAoEHkC,QAAQ,cACJjC"}
|
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { TextFieldProps as TextFieldProps$1 } from '@mui/material/TextField';
|
|
2
|
+
|
|
3
|
+
type BaseTextFieldProps = Omit<TextFieldProps$1, 'error' | 'id' | 'type' | 'variant'> & {
|
|
4
|
+
errorText?: string;
|
|
5
|
+
fdKey: string;
|
|
6
|
+
};
|
|
7
|
+
type PasswordTextFieldProps = BaseTextFieldProps & {
|
|
8
|
+
type: 'password';
|
|
9
|
+
showPasswordAriaLabel: string;
|
|
10
|
+
hidePasswordAriaLabel: string;
|
|
11
|
+
};
|
|
12
|
+
type GenericTextFieldProps = BaseTextFieldProps & {
|
|
13
|
+
type?: Exclude<TextFieldProps$1['type'], 'password'>;
|
|
14
|
+
showPasswordAriaLabel?: never;
|
|
15
|
+
hidePasswordAriaLabel?: never;
|
|
16
|
+
};
|
|
17
|
+
type TextFieldProps = GenericTextFieldProps | PasswordTextFieldProps;
|
|
18
|
+
declare const TextField: ({ disabled, errorText, fdKey, fullWidth, helperText, hidePasswordAriaLabel, label, multiline, required, showPasswordAriaLabel, type, ...props }: TextFieldProps) => JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { TextField as default };
|
|
21
|
+
export type { TextFieldProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@mui/material/
|
|
1
|
+
import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as e}from"react";import t from"@mui/material/Box";import l from"@mui/material/FormHelperText";import o from"@mui/material/InputAdornment";import d from"@mui/material/InputLabel";import{styled as a}from"@mui/material/styles";import m from"@mui/material/TextField";import n from"../../../icons/CancelCircle/index.js";import s from"../../../icons/View/index.js";import u from"../../../icons/ViewOff/index.js";import{IconButton as p}from"../IconButton/index.js";const f=a(t,{shouldForwardProp:r=>"fullWidth"!==r})((({theme:r,fullWidth:i=!1})=>({display:"flex",flexDirection:"column",gap:r.spacing(.5),width:i?"100%":"min(364px, 100%)"}))),h=a(m,{shouldForwardProp:r=>"fullWidth"!==r})((({fullWidth:r=!1})=>({display:"flex",width:r?"100%":"auto"}))),c=({disabled:t=!1,errorText:a,fdKey:m,fullWidth:c=!1,helperText:x,hidePasswordAriaLabel:b,label:w,multiline:y=!1,required:W=!1,showPasswordAriaLabel:j,type:v="text",...F})=>{const[P,A]=e(!1),I=x?`${m}-helper-text`:void 0,T=a?`${m}-error-message`:void 0,g=[I,T].filter(Boolean).join(" ")||void 0,q=!!a&&!t,B="password"===v,C=()=>A((r=>!r));return r(f,{fullWidth:c,children:[w&&i(d,{disabled:t,htmlFor:m,required:W,children:w}),x&&i(l,{disabled:t,id:I,children:x}),q&&r(l,{error:!0,id:T,children:[i(n,{}),a]}),i(h,{"data-fd":m,disabled:t,error:q,fullWidth:c,id:m,label:"",multiline:y,required:W,slotProps:{input:{endAdornment:(()=>{if(B){if(!j||!b)return;return i(o,{position:"end",children:i(p,{"aria-label":P?b:j,disabled:t,onClick:C,size:"small",tone:"neutral",variant:"tertiary",children:i(P?u:s,{})})})}})()},htmlInput:{"aria-describedby":g}},type:B?P?"text":"password":v,variant:"outlined",...F})]})};export{c as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/TextField/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Box from '@mui/material/Box';\nimport MuiFormHelperText from '@mui/material/FormHelperText';\nimport MuiInputAdornment from '@mui/material/InputAdornment';\nimport MuiInputLabel from '@mui/material/InputLabel';\nimport { styled } from '@mui/material/styles';\nimport MuiTextField, { type TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';\n\nimport CancelCircleIcon from '@fd/icons/CancelCircle';\nimport ViewIcon from '@fd/icons/View';\nimport ViewOffIcon from '@fd/icons/ViewOff';\n\nimport IconButton from '../IconButton';\n\n// Common props for all TextField variants\ntype BaseTextFieldProps = Omit<MuiTextFieldProps, 'error' | 'id' | 'type' | 'variant'> & {\n errorText?: string;\n fdKey: string;\n};\n\n// Password TextField variant - requires aria labels\ntype PasswordTextFieldProps = BaseTextFieldProps & {\n type: 'password';\n showPasswordAriaLabel: string;\n hidePasswordAriaLabel: string;\n};\n\n// Generic TextField variant - for all other input types\ntype GenericTextFieldProps = BaseTextFieldProps & {\n type?: Exclude<MuiTextFieldProps['type'], 'password'>;\n showPasswordAriaLabel?: never;\n hidePasswordAriaLabel?: never;\n};\n\nexport type TextFieldProps = GenericTextFieldProps | PasswordTextFieldProps;\n\nconst StyledContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ theme, fullWidth = false }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(0.5),\n width: fullWidth ? '100%' : 'min(364px, 100%)', // Constrain minWidth to a maximum of 100% of the container width\n}));\n\nconst StyledTextField = styled(MuiTextField, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ fullWidth = false }) => ({\n display: 'flex',\n width: fullWidth ? '100%' : 'auto',\n}));\n\nconst TextField = ({\n disabled = false,\n errorText,\n fdKey,\n fullWidth = false,\n helperText,\n hidePasswordAriaLabel,\n label,\n multiline = false,\n required = false,\n showPasswordAriaLabel,\n type = 'text',\n ...props\n}: TextFieldProps): JSX.Element => {\n const [showPassword, setShowPassword] = useState<boolean>(false);\n\n const helperTextId = helperText ? `${fdKey}-helper-text` : undefined;\n const errorMessageId = errorText ? `${fdKey}-error-message` : undefined;\n\n // Combine helper text and error message IDs for aria-describedby\n const ariaDescribedBy = [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n const isError = !!errorText && !disabled;\n const isPassword = type === 'password';\n\n const handleClickShowPassword = (): void => setShowPassword((show) => !show);\n\n const getFieldType = (): MuiTextFieldProps['type'] => {\n if (isPassword) {\n return showPassword ? 'text' : 'password';\n }\n\n return type;\n };\n\n const renderEndAdornment = (): React.ReactNode => {\n if (isPassword) {\n if (!showPasswordAriaLabel || !hidePasswordAriaLabel) {\n return undefined;\n }\n\n return (\n <MuiInputAdornment position=\"end\">\n <IconButton\n aria-label={showPassword ? hidePasswordAriaLabel : showPasswordAriaLabel}\n disabled={disabled}\n onClick={handleClickShowPassword}\n size=\"small\"\n tone=\"neutral\"\n variant=\"tertiary\"\n >\n {showPassword ? <ViewOffIcon /> : <ViewIcon />}\n </IconButton>\n </MuiInputAdornment>\n );\n }\n\n return undefined;\n };\n\n return (\n <StyledContainer fullWidth={fullWidth}>\n {label && (\n <MuiInputLabel disabled={disabled} htmlFor={fdKey} required={required}>\n {label}\n </MuiInputLabel>\n )}\n\n {helperText && (\n <MuiFormHelperText disabled={disabled} id={helperTextId}>\n {helperText}\n </MuiFormHelperText>\n )}\n\n {isError && (\n <MuiFormHelperText error id={errorMessageId}>\n <CancelCircleIcon />\n\n {errorText}\n </MuiFormHelperText>\n )}\n\n <StyledTextField\n data-fd={fdKey}\n disabled={disabled}\n error={isError}\n fullWidth={fullWidth}\n id={fdKey}\n label=\"\" // Remove label from TextField since we're rendering it separately\n multiline={multiline}\n required={required}\n slotProps={{\n input: {\n endAdornment: renderEndAdornment(),\n },\n htmlInput: {\n 'aria-describedby': ariaDescribedBy,\n },\n }}\n type={getFieldType()}\n variant=\"outlined\"\n {...props}\n />\n </StyledContainer>\n );\n};\n\nexport default TextField;\n"],"names":["StyledContainer","styled","Box","shouldForwardProp","prop","theme","fullWidth","display","flexDirection","gap","spacing","width","StyledTextField","MuiTextField","TextField","disabled","errorText","fdKey","helperText","hidePasswordAriaLabel","label","multiline","required","showPasswordAriaLabel","type","props","showPassword","setShowPassword","useState","helperTextId","undefined","errorMessageId","ariaDescribedBy","filter","Boolean","join","isError","isPassword","handleClickShowPassword","show","_jsxs","_jsx","MuiInputLabel","htmlFor","MuiFormHelperText","id","error","children","CancelCircleIcon","slotProps","input","endAdornment","MuiInputAdornment","position","IconButton","onClick","size","tone","variant","ViewOffIcon","ViewIcon","renderEndAdornment","htmlInput"],"mappings":"4gBAqCA,MAAMA,EAAkBC,EAAOC,EAAK,CAClCC,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGI,QAAOC,aAAY,MAAO,CACvDC,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,IACnBC,MAAOL,EAAY,OAAS,uBAGxBM,EAAkBX,EAAOY,EAAc,CAC3CV,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGK,aAAY,MAAO,CAChDC,QAAS,OACTI,MAAOL,EAAY,OAAS,WAGxBQ,EAAY,EAChBC,YAAW,EACXC,YACAC,QACAX,aAAY,EACZY,aACAC,wBACAC,QACAC,aAAY,EACZC,YAAW,EACXC,wBACAC,OAAO,UACJC,MAEH,MAAOC,EAAcC,GAAmBC,GAAkB,GAEpDC,EAAeX,EAAa,GAAGD,qBAAsBa,EACrDC,EAAiBf,EAAY,GAAGC,uBAAwBa,EAGxDE,EAAkB,CAACH,EAAcE,GAAgBE,OAAOC,SAASC,KAAK,WAAQL,EAE9EM,IAAYpB,IAAcD,EAC1BsB,EAAsB,aAATb,EAEbc,EAA0B,IAAYX,GAAiBY,IAAUA,IAmCvE,OACEC,EAACxC,EAAe,CAACM,UAAWA,YACzBc,GACCqB,EAACC,GAAc3B,SAAUA,EAAU4B,QAAS1B,EAAOK,SAAUA,WAC1DF,IAIJF,GACCuB,EAACG,EAAiB,CAAC7B,SAAUA,EAAU8B,GAAIhB,WACxCX,IAIJkB,GACCI,EAACI,EAAiB,CAACE,SAAMD,GAAId,EAAcgB,SAAA,CACzCN,EAACO,EAAgB,CAAA,GAEhBhC,KAILyB,EAAC7B,aACUK,EACTF,SAAUA,EACV+B,MAAOV,EACP9B,UAAWA,EACXuC,GAAI5B,EACJG,MAAM,GACNC,UAAWA,EACXC,SAAUA,EACV2B,UAAW,CACTC,MAAO,CACLC,aA1DiB,MACzB,GAAId,EAAY,CACd,IAAKd,IAA0BJ,EAC7B,OAGF,OACEsB,EAACW,EAAiB,CAACC,SAAS,MAAKN,SAC/BN,EAACa,EAAU,CAAA,aACG5B,EAAeP,EAAwBI,EACnDR,SAAUA,EACVwC,QAASjB,EACTkB,KAAK,QACLC,KAAK,UACLC,QAAQ,WAAUX,SAEFN,EAAff,EAAgBiC,EAAkBC,EAAP,CAAA,MAIpC,GAsCsBC,IAEhBC,UAAW,CACT,mBAAoB9B,IAGxBR,KAvEAa,EACKX,EAAe,OAAS,WAG1BF,EAoEHkC,QAAQ,cACJjC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("@mui/material/styles/createTheme"),
|
|
1
|
+
"use strict";var e=require("@mui/material/styles/createTheme"),r=require("../components/atoms/Button/buttonThemeOverrides.cjs.js"),t=require("../components/atoms/IconButton/iconButtonThemeOverrides.cjs.js"),s=require("../icons/Cancel/index.cjs.js"),i=require("./overrides/formHelperTextOverrides.cjs.js"),o=require("./overrides/inputBaseOverrides.cjs.js"),a=require("./overrides/inputLabelOverrides.cjs.js"),n=require("./overrides/menuItemOverrides.cjs.js"),d=require("./overrides/selectOverrides.cjs.js"),p=require("./overrides/textFieldOverrides.cjs.js"),u=require("./tokens/breakpoints/breakpoints.cjs.js"),l=require("./tokens/colours/semantic.cjs.js"),c=require("./tokens/radius/radius.cjs.js"),h=require("./tokens/shadows/shadows.cjs.js"),v=require("./tokens/typography/variant-mapping.cjs.js"),y=require("./typography.cjs.js");const g=g=>{const m={typography:y.typography,palette:"light"===g?l.lightColours:l.darkColours,radius:c.radius,breakpoints:{values:u.breakpointValues}},j=e(m);return Object.keys(y.typography).forEach((e=>{const r=e.split(/(?=[A-Z])/)[0],t=e;j.typography[t]={...j.typography[t],[j.breakpoints.down("tablet")]:{...y.getMobileTextStyle(r)}}})),e({...m,typography:j.typography,shape:{borderRadius:4},customShadows:{...h.shadows},components:{MuiAlert:{defaultProps:{components:{CloseIcon:s}},styleOverrides:{root:{borderRadius:"8px",padding:"24px"},icon:{marginRight:"12px",padding:0},action:{padding:0,"& button":{marginTop:"-5px"}},message:{padding:0}}},MuiButton:r.buttonStyleOverrides(j),MuiIconButton:t.iconButtonStyleOverrides(),MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:j.palette.divider}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold",paddingLeft:"6px",paddingRight:"6px"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:j.palette.semantic.fill["fill-primary-weak"]},"&:not(:last-child)":{borderBottom:`1px solid ${j.palette.semantic.stroke["stroke-weak"]}`}}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:j.palette.semantic.fill["fill-secondary"],cursor:"pointer"}}}},MuiTypography:{defaultProps:{variantMapping:v.typographyVariantMapping}},MuiFormHelperText:i.formHelperTextOverrides(j),MuiInputBase:o.inputBaseOverrides(j),MuiInputLabel:a.inputLabelOverrides(j),MuiMenuItem:n.menuItemOverrides(j),MuiSelect:d.selectOverrides(j),MuiTextField:p.textFieldOverrides()}})},m=g("light"),j=g("dark");exports.darkTheme=j,exports.lightTheme=m;
|
|
2
2
|
//# sourceMappingURL=flipdishPublicTheme.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flipdishPublicTheme.cjs.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type Theme, type ThemeOptions } from '@mui/material/styles/createTheme';\n\nimport { buttonStyleOverrides } from '../components/atoms/Button/buttonThemeOverrides';\nimport { iconButtonStyleOverrides } from '../components/atoms/IconButton/iconButtonThemeOverrides';\nimport CancelIcon from '../icons/Cancel';\nimport { breakpointValues } from './tokens/breakpoints/breakpoints';\nimport { darkColours, lightColours } from './tokens/colours/semantic';\nimport { radius } from './tokens/radius/radius';\nimport { shadows } from './tokens/shadows/shadows';\nimport { fontSize } from './tokens/typography/font-size';\nimport { typographyVariantMapping } from './tokens/typography/variant-mapping';\nimport { getMobileTextStyle, typography } from './typography';\n\nconst createFlipdishThemeFactory = (mode: 'dark' | 'light'): Theme => {\n const themeOptions: ThemeOptions = {\n typography,\n palette: mode === 'light' ? lightColours : darkColours,\n radius,\n breakpoints: {\n values: breakpointValues,\n },\n };\n const baseTheme = createTheme(themeOptions);\n\n /*\n Add mobile text styles to typography\n Has to be done using media queries, otherwise it isn't responsive :(\n https://mui.com/material-ui/customization/typography/#responsive-font-sizes\n */\n Object.keys(typography).forEach((key) => {\n // only key before the suffix split by capital letter (h1Strong -> h1)\n const keyWithoutVariantSuffix = key.split(/(?=[A-Z])/)[0];\n const typographyKey = key as keyof typeof typography;\n baseTheme.typography[typographyKey] = {\n ...baseTheme.typography[typographyKey],\n [baseTheme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle(keyWithoutVariantSuffix as keyof (typeof fontSize)['mobile']),\n },\n };\n });\n\n // Create final theme with component overrides and additional configurations\n return createTheme({\n ...themeOptions,\n typography: baseTheme.typography,\n shape: {\n borderRadius: 4,\n },\n customShadows: {\n ...shadows,\n },\n components: {\n MuiAlert: {\n defaultProps: {\n components: {\n CloseIcon: CancelIcon,\n },\n },\n styleOverrides: {\n root: {\n // TODO: Replace with borderRadius from tokens when implemented\n borderRadius: '8px',\n // TODO: Replace with spacing from tokens when implemented\n padding: '24px',\n },\n icon: {\n // TODO: Replace with spacing from tokens when implemented\n marginRight: '12px',\n padding: 0,\n },\n action: {\n padding: 0,\n '& button': {\n marginTop: '-5px',\n },\n },\n message: {\n padding: 0,\n },\n },\n },\n MuiButton: buttonStyleOverrides(baseTheme),\n MuiIconButton: iconButtonStyleOverrides(),\n MuiCard: {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: baseTheme.palette.divider,\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n paddingLeft: '6px',\n paddingRight: '6px',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-primary-weak'],\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${baseTheme.palette.semantic.stroke['stroke-weak']}`,\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n '&.MuiTableRow-hover:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-secondary'],\n cursor: 'pointer',\n },\n },\n },\n },\n MuiTypography: {\n defaultProps: {\n variantMapping: typographyVariantMapping,\n },\n },\n },\n });\n};\n\nexport const lightTheme = createFlipdishThemeFactory('light');\nexport const darkTheme = createFlipdishThemeFactory('dark');\n"],"names":["createFlipdishThemeFactory","mode","themeOptions","typography","palette","lightColours","darkColours","radius","breakpoints","values","breakpointValues","baseTheme","createTheme","Object","keys","forEach","key","keyWithoutVariantSuffix","split","typographyKey","down","getMobileTextStyle","shape","borderRadius","customShadows","shadows","components","MuiAlert","defaultProps","CloseIcon","CancelIcon","styleOverrides","root","padding","icon","marginRight","action","marginTop","message","MuiButton","buttonStyleOverrides","MuiIconButton","iconButtonStyleOverrides","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","divider","MuiChip","fontWeight","paddingLeft","paddingRight","MuiListItemButton","backgroundColor","semantic","fill","borderBottom","stroke","MuiTableRow","cursor","MuiTypography","variantMapping","typographyVariantMapping","lightTheme","darkTheme"],"mappings":"
|
|
1
|
+
{"version":3,"file":"flipdishPublicTheme.cjs.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type Theme, type ThemeOptions } from '@mui/material/styles/createTheme';\n\nimport { buttonStyleOverrides } from '../components/atoms/Button/buttonThemeOverrides';\nimport { iconButtonStyleOverrides } from '../components/atoms/IconButton/iconButtonThemeOverrides';\nimport CancelIcon from '../icons/Cancel';\nimport { formHelperTextOverrides } from './overrides/formHelperTextOverrides';\nimport { inputBaseOverrides } from './overrides/inputBaseOverrides';\nimport { inputLabelOverrides } from './overrides/inputLabelOverrides';\nimport { menuItemOverrides } from './overrides/menuItemOverrides';\nimport { selectOverrides } from './overrides/selectOverrides';\nimport { textFieldOverrides } from './overrides/textFieldOverrides';\nimport { breakpointValues } from './tokens/breakpoints/breakpoints';\nimport { darkColours, lightColours } from './tokens/colours/semantic';\nimport { radius } from './tokens/radius/radius';\nimport { shadows } from './tokens/shadows/shadows';\nimport { fontSize } from './tokens/typography/font-size';\nimport { typographyVariantMapping } from './tokens/typography/variant-mapping';\nimport { getMobileTextStyle, typography } from './typography';\n\nconst createFlipdishThemeFactory = (mode: 'dark' | 'light'): Theme => {\n const themeOptions: ThemeOptions = {\n typography,\n palette: mode === 'light' ? lightColours : darkColours,\n radius,\n breakpoints: {\n values: breakpointValues,\n },\n };\n const baseTheme = createTheme(themeOptions);\n\n /*\n Add mobile text styles to typography\n Has to be done using media queries, otherwise it isn't responsive :(\n https://mui.com/material-ui/customization/typography/#responsive-font-sizes\n */\n Object.keys(typography).forEach((key) => {\n // only key before the suffix split by capital letter (h1Strong -> h1)\n const keyWithoutVariantSuffix = key.split(/(?=[A-Z])/)[0];\n const typographyKey = key as keyof typeof typography;\n baseTheme.typography[typographyKey] = {\n ...baseTheme.typography[typographyKey],\n [baseTheme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle(keyWithoutVariantSuffix as keyof (typeof fontSize)['mobile']),\n },\n };\n });\n\n // Create final theme with component overrides and additional configurations\n return createTheme({\n ...themeOptions,\n typography: baseTheme.typography,\n shape: {\n borderRadius: 4,\n },\n customShadows: {\n ...shadows,\n },\n components: {\n MuiAlert: {\n defaultProps: {\n components: {\n CloseIcon: CancelIcon,\n },\n },\n styleOverrides: {\n root: {\n // TODO: Replace with borderRadius from tokens when implemented\n borderRadius: '8px',\n // TODO: Replace with spacing from tokens when implemented\n padding: '24px',\n },\n icon: {\n // TODO: Replace with spacing from tokens when implemented\n marginRight: '12px',\n padding: 0,\n },\n action: {\n padding: 0,\n '& button': {\n marginTop: '-5px',\n },\n },\n message: {\n padding: 0,\n },\n },\n },\n MuiButton: buttonStyleOverrides(baseTheme),\n MuiIconButton: iconButtonStyleOverrides(),\n MuiCard: {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: baseTheme.palette.divider,\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n paddingLeft: '6px',\n paddingRight: '6px',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-primary-weak'],\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${baseTheme.palette.semantic.stroke['stroke-weak']}`,\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n '&.MuiTableRow-hover:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-secondary'],\n cursor: 'pointer',\n },\n },\n },\n },\n MuiTypography: {\n defaultProps: {\n variantMapping: typographyVariantMapping,\n },\n },\n MuiFormHelperText: formHelperTextOverrides(baseTheme),\n MuiInputBase: inputBaseOverrides(baseTheme),\n MuiInputLabel: inputLabelOverrides(baseTheme),\n MuiMenuItem: menuItemOverrides(baseTheme),\n MuiSelect: selectOverrides(baseTheme),\n MuiTextField: textFieldOverrides(),\n },\n });\n};\n\nexport const lightTheme = createFlipdishThemeFactory('light');\nexport const darkTheme = createFlipdishThemeFactory('dark');\n"],"names":["createFlipdishThemeFactory","mode","themeOptions","typography","palette","lightColours","darkColours","radius","breakpoints","values","breakpointValues","baseTheme","createTheme","Object","keys","forEach","key","keyWithoutVariantSuffix","split","typographyKey","down","getMobileTextStyle","shape","borderRadius","customShadows","shadows","components","MuiAlert","defaultProps","CloseIcon","CancelIcon","styleOverrides","root","padding","icon","marginRight","action","marginTop","message","MuiButton","buttonStyleOverrides","MuiIconButton","iconButtonStyleOverrides","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","divider","MuiChip","fontWeight","paddingLeft","paddingRight","MuiListItemButton","backgroundColor","semantic","fill","borderBottom","stroke","MuiTableRow","cursor","MuiTypography","variantMapping","typographyVariantMapping","MuiFormHelperText","formHelperTextOverrides","MuiInputBase","inputBaseOverrides","MuiInputLabel","inputLabelOverrides","MuiMenuItem","menuItemOverrides","MuiSelect","selectOverrides","MuiTextField","textFieldOverrides","lightTheme","darkTheme"],"mappings":"i0BAmBA,MAAMA,EAA8BC,IAClC,MAAMC,EAA6B,YACjCC,EAAAA,WACAC,QAAkB,UAATH,EAAmBI,EAAAA,aAAeC,EAAAA,mBAC3CC,EAAAA,OACAC,YAAa,CACXC,OAAQC,EAAAA,mBAGNC,EAAYC,EAAYV,GAoB9B,OAbAW,OAAOC,KAAKX,EAAAA,YAAYY,SAASC,IAE/B,MAAMC,EAA0BD,EAAIE,MAAM,aAAa,GACjDC,EAAgBH,EACtBL,EAAUR,WAAWgB,GAAiB,IACjCR,EAAUR,WAAWgB,GACxB,CAACR,EAAUH,YAAYY,KAAK,WAAY,IACnCC,EAAAA,mBAAmBJ,QAMrBL,EAAY,IACdV,EACHC,WAAYQ,EAAUR,WACtBmB,MAAO,CACLC,aAAc,GAEhBC,cAAe,IACVC,EAAAA,SAELC,WAAY,CACVC,SAAU,CACRC,aAAc,CACZF,WAAY,CACVG,UAAWC,IAGfC,eAAgB,CACdC,KAAM,CAEJT,aAAc,MAEdU,QAAS,QAEXC,KAAM,CAEJC,YAAa,OACbF,QAAS,GAEXG,OAAQ,CACNH,QAAS,EACT,WAAY,CACVI,UAAW,SAGfC,QAAS,CACPL,QAAS,KAIfM,UAAWC,EAAAA,qBAAqB7B,GAChC8B,cAAeC,EAAAA,2BACfC,QAAS,CACPZ,eAAgB,CACdC,KAAM,CACJY,UAAW,OACXC,YAAa,MACbC,YAAa,QACbC,YAAapC,EAAUP,QAAQ4C,WAIrCC,QAAS,CACPlB,eAAgB,CACdC,KAAM,CACJkB,WAAY,OACZC,YAAa,MACbC,aAAc,SAIpBC,kBAAmB,CACjBtB,eAAgB,CACdC,KAAM,CACJ,UAAW,CACTsB,gBAAiB3C,EAAUP,QAAQmD,SAASC,KAAK,sBAEnD,qBAAsB,CACpBC,aAAc,aAAa9C,EAAUP,QAAQmD,SAASG,OAAO,qBAKrEC,YAAa,CACX5B,eAAgB,CACdC,KAAM,CACJ,4BAA6B,CAC3BsB,gBAAiB3C,EAAUP,QAAQmD,SAASC,KAAK,kBACjDI,OAAQ,cAKhBC,cAAe,CACbjC,aAAc,CACZkC,eAAgBC,EAAAA,2BAGpBC,kBAAmBC,EAAAA,wBAAwBtD,GAC3CuD,aAAcC,EAAAA,mBAAmBxD,GACjCyD,cAAeC,EAAAA,oBAAoB1D,GACnC2D,YAAaC,EAAAA,kBAAkB5D,GAC/B6D,UAAWC,EAAAA,gBAAgB9D,GAC3B+D,aAAcC,EAAAA,yBAKPC,EAAa5E,EAA2B,SACxC6E,EAAY7E,EAA2B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"@mui/material/styles/createTheme";import{buttonStyleOverrides as
|
|
1
|
+
import o from"@mui/material/styles/createTheme";import{buttonStyleOverrides as e}from"../components/atoms/Button/buttonThemeOverrides.js";import{iconButtonStyleOverrides as r}from"../components/atoms/IconButton/iconButtonThemeOverrides.js";import t from"../icons/Cancel/index.js";import{formHelperTextOverrides as i}from"./overrides/formHelperTextOverrides.js";import{inputBaseOverrides as s}from"./overrides/inputBaseOverrides.js";import{inputLabelOverrides as p}from"./overrides/inputLabelOverrides.js";import{menuItemOverrides as a}from"./overrides/menuItemOverrides.js";import{selectOverrides as n}from"./overrides/selectOverrides.js";import{textFieldOverrides as d}from"./overrides/textFieldOverrides.js";import{breakpointValues as m}from"./tokens/breakpoints/breakpoints.js";import{lightColours as l,darkColours as u}from"./tokens/colours/semantic.js";import{radius as c}from"./tokens/radius/radius.js";import{shadows as h}from"./tokens/shadows/shadows.js";import{typographyVariantMapping as f}from"./tokens/typography/variant-mapping.js";import{typography as g,getMobileTextStyle as v}from"./typography.js";const y=y=>{const b={typography:g,palette:"light"===y?l:u,radius:c,breakpoints:{values:m}},k=o(b);return Object.keys(g).forEach((o=>{const e=o.split(/(?=[A-Z])/)[0],r=o;k.typography[r]={...k.typography[r],[k.breakpoints.down("tablet")]:{...v(e)}}})),o({...b,typography:k.typography,shape:{borderRadius:4},customShadows:{...h},components:{MuiAlert:{defaultProps:{components:{CloseIcon:t}},styleOverrides:{root:{borderRadius:"8px",padding:"24px"},icon:{marginRight:"12px",padding:0},action:{padding:0,"& button":{marginTop:"-5px"}},message:{padding:0}}},MuiButton:e(k),MuiIconButton:r(),MuiCard:{styleOverrides:{root:{boxShadow:"none",borderWidth:"1px",borderStyle:"solid",borderColor:k.palette.divider}}},MuiChip:{styleOverrides:{root:{fontWeight:"bold",paddingLeft:"6px",paddingRight:"6px"}}},MuiListItemButton:{styleOverrides:{root:{"&:hover":{backgroundColor:k.palette.semantic.fill["fill-primary-weak"]},"&:not(:last-child)":{borderBottom:`1px solid ${k.palette.semantic.stroke["stroke-weak"]}`}}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover:hover":{backgroundColor:k.palette.semantic.fill["fill-secondary"],cursor:"pointer"}}}},MuiTypography:{defaultProps:{variantMapping:f}},MuiFormHelperText:i(k),MuiInputBase:s(k),MuiInputLabel:p(k),MuiMenuItem:a(k),MuiSelect:n(k),MuiTextField:d()}})},b=y("light"),k=y("dark");export{k as darkTheme,b as lightTheme};
|
|
2
2
|
//# sourceMappingURL=flipdishPublicTheme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flipdishPublicTheme.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type Theme, type ThemeOptions } from '@mui/material/styles/createTheme';\n\nimport { buttonStyleOverrides } from '../components/atoms/Button/buttonThemeOverrides';\nimport { iconButtonStyleOverrides } from '../components/atoms/IconButton/iconButtonThemeOverrides';\nimport CancelIcon from '../icons/Cancel';\nimport { breakpointValues } from './tokens/breakpoints/breakpoints';\nimport { darkColours, lightColours } from './tokens/colours/semantic';\nimport { radius } from './tokens/radius/radius';\nimport { shadows } from './tokens/shadows/shadows';\nimport { fontSize } from './tokens/typography/font-size';\nimport { typographyVariantMapping } from './tokens/typography/variant-mapping';\nimport { getMobileTextStyle, typography } from './typography';\n\nconst createFlipdishThemeFactory = (mode: 'dark' | 'light'): Theme => {\n const themeOptions: ThemeOptions = {\n typography,\n palette: mode === 'light' ? lightColours : darkColours,\n radius,\n breakpoints: {\n values: breakpointValues,\n },\n };\n const baseTheme = createTheme(themeOptions);\n\n /*\n Add mobile text styles to typography\n Has to be done using media queries, otherwise it isn't responsive :(\n https://mui.com/material-ui/customization/typography/#responsive-font-sizes\n */\n Object.keys(typography).forEach((key) => {\n // only key before the suffix split by capital letter (h1Strong -> h1)\n const keyWithoutVariantSuffix = key.split(/(?=[A-Z])/)[0];\n const typographyKey = key as keyof typeof typography;\n baseTheme.typography[typographyKey] = {\n ...baseTheme.typography[typographyKey],\n [baseTheme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle(keyWithoutVariantSuffix as keyof (typeof fontSize)['mobile']),\n },\n };\n });\n\n // Create final theme with component overrides and additional configurations\n return createTheme({\n ...themeOptions,\n typography: baseTheme.typography,\n shape: {\n borderRadius: 4,\n },\n customShadows: {\n ...shadows,\n },\n components: {\n MuiAlert: {\n defaultProps: {\n components: {\n CloseIcon: CancelIcon,\n },\n },\n styleOverrides: {\n root: {\n // TODO: Replace with borderRadius from tokens when implemented\n borderRadius: '8px',\n // TODO: Replace with spacing from tokens when implemented\n padding: '24px',\n },\n icon: {\n // TODO: Replace with spacing from tokens when implemented\n marginRight: '12px',\n padding: 0,\n },\n action: {\n padding: 0,\n '& button': {\n marginTop: '-5px',\n },\n },\n message: {\n padding: 0,\n },\n },\n },\n MuiButton: buttonStyleOverrides(baseTheme),\n MuiIconButton: iconButtonStyleOverrides(),\n MuiCard: {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: baseTheme.palette.divider,\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n paddingLeft: '6px',\n paddingRight: '6px',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-primary-weak'],\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${baseTheme.palette.semantic.stroke['stroke-weak']}`,\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n '&.MuiTableRow-hover:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-secondary'],\n cursor: 'pointer',\n },\n },\n },\n },\n MuiTypography: {\n defaultProps: {\n variantMapping: typographyVariantMapping,\n },\n },\n },\n });\n};\n\nexport const lightTheme = createFlipdishThemeFactory('light');\nexport const darkTheme = createFlipdishThemeFactory('dark');\n"],"names":["createFlipdishThemeFactory","mode","themeOptions","typography","palette","lightColours","darkColours","radius","breakpoints","values","breakpointValues","baseTheme","createTheme","Object","keys","forEach","key","keyWithoutVariantSuffix","split","typographyKey","down","getMobileTextStyle","shape","borderRadius","customShadows","shadows","components","MuiAlert","defaultProps","CloseIcon","CancelIcon","styleOverrides","root","padding","icon","marginRight","action","marginTop","message","MuiButton","buttonStyleOverrides","MuiIconButton","iconButtonStyleOverrides","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","divider","MuiChip","fontWeight","paddingLeft","paddingRight","MuiListItemButton","backgroundColor","semantic","fill","borderBottom","stroke","MuiTableRow","cursor","MuiTypography","variantMapping","typographyVariantMapping","lightTheme","darkTheme"],"mappings":"
|
|
1
|
+
{"version":3,"file":"flipdishPublicTheme.js","sources":["../../src/themes/flipdishPublicTheme.ts"],"sourcesContent":["import createTheme, { type Theme, type ThemeOptions } from '@mui/material/styles/createTheme';\n\nimport { buttonStyleOverrides } from '../components/atoms/Button/buttonThemeOverrides';\nimport { iconButtonStyleOverrides } from '../components/atoms/IconButton/iconButtonThemeOverrides';\nimport CancelIcon from '../icons/Cancel';\nimport { formHelperTextOverrides } from './overrides/formHelperTextOverrides';\nimport { inputBaseOverrides } from './overrides/inputBaseOverrides';\nimport { inputLabelOverrides } from './overrides/inputLabelOverrides';\nimport { menuItemOverrides } from './overrides/menuItemOverrides';\nimport { selectOverrides } from './overrides/selectOverrides';\nimport { textFieldOverrides } from './overrides/textFieldOverrides';\nimport { breakpointValues } from './tokens/breakpoints/breakpoints';\nimport { darkColours, lightColours } from './tokens/colours/semantic';\nimport { radius } from './tokens/radius/radius';\nimport { shadows } from './tokens/shadows/shadows';\nimport { fontSize } from './tokens/typography/font-size';\nimport { typographyVariantMapping } from './tokens/typography/variant-mapping';\nimport { getMobileTextStyle, typography } from './typography';\n\nconst createFlipdishThemeFactory = (mode: 'dark' | 'light'): Theme => {\n const themeOptions: ThemeOptions = {\n typography,\n palette: mode === 'light' ? lightColours : darkColours,\n radius,\n breakpoints: {\n values: breakpointValues,\n },\n };\n const baseTheme = createTheme(themeOptions);\n\n /*\n Add mobile text styles to typography\n Has to be done using media queries, otherwise it isn't responsive :(\n https://mui.com/material-ui/customization/typography/#responsive-font-sizes\n */\n Object.keys(typography).forEach((key) => {\n // only key before the suffix split by capital letter (h1Strong -> h1)\n const keyWithoutVariantSuffix = key.split(/(?=[A-Z])/)[0];\n const typographyKey = key as keyof typeof typography;\n baseTheme.typography[typographyKey] = {\n ...baseTheme.typography[typographyKey],\n [baseTheme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle(keyWithoutVariantSuffix as keyof (typeof fontSize)['mobile']),\n },\n };\n });\n\n // Create final theme with component overrides and additional configurations\n return createTheme({\n ...themeOptions,\n typography: baseTheme.typography,\n shape: {\n borderRadius: 4,\n },\n customShadows: {\n ...shadows,\n },\n components: {\n MuiAlert: {\n defaultProps: {\n components: {\n CloseIcon: CancelIcon,\n },\n },\n styleOverrides: {\n root: {\n // TODO: Replace with borderRadius from tokens when implemented\n borderRadius: '8px',\n // TODO: Replace with spacing from tokens when implemented\n padding: '24px',\n },\n icon: {\n // TODO: Replace with spacing from tokens when implemented\n marginRight: '12px',\n padding: 0,\n },\n action: {\n padding: 0,\n '& button': {\n marginTop: '-5px',\n },\n },\n message: {\n padding: 0,\n },\n },\n },\n MuiButton: buttonStyleOverrides(baseTheme),\n MuiIconButton: iconButtonStyleOverrides(),\n MuiCard: {\n styleOverrides: {\n root: {\n boxShadow: 'none',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: baseTheme.palette.divider,\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n fontWeight: 'bold',\n paddingLeft: '6px',\n paddingRight: '6px',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n '&:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-primary-weak'],\n },\n '&:not(:last-child)': {\n borderBottom: `1px solid ${baseTheme.palette.semantic.stroke['stroke-weak']}`,\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n '&.MuiTableRow-hover:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-secondary'],\n cursor: 'pointer',\n },\n },\n },\n },\n MuiTypography: {\n defaultProps: {\n variantMapping: typographyVariantMapping,\n },\n },\n MuiFormHelperText: formHelperTextOverrides(baseTheme),\n MuiInputBase: inputBaseOverrides(baseTheme),\n MuiInputLabel: inputLabelOverrides(baseTheme),\n MuiMenuItem: menuItemOverrides(baseTheme),\n MuiSelect: selectOverrides(baseTheme),\n MuiTextField: textFieldOverrides(),\n },\n });\n};\n\nexport const lightTheme = createFlipdishThemeFactory('light');\nexport const darkTheme = createFlipdishThemeFactory('dark');\n"],"names":["createFlipdishThemeFactory","mode","themeOptions","typography","palette","lightColours","darkColours","radius","breakpoints","values","breakpointValues","baseTheme","createTheme","Object","keys","forEach","key","keyWithoutVariantSuffix","split","typographyKey","down","getMobileTextStyle","shape","borderRadius","customShadows","shadows","components","MuiAlert","defaultProps","CloseIcon","CancelIcon","styleOverrides","root","padding","icon","marginRight","action","marginTop","message","MuiButton","buttonStyleOverrides","MuiIconButton","iconButtonStyleOverrides","MuiCard","boxShadow","borderWidth","borderStyle","borderColor","divider","MuiChip","fontWeight","paddingLeft","paddingRight","MuiListItemButton","backgroundColor","semantic","fill","borderBottom","stroke","MuiTableRow","cursor","MuiTypography","variantMapping","typographyVariantMapping","MuiFormHelperText","formHelperTextOverrides","MuiInputBase","inputBaseOverrides","MuiInputLabel","inputLabelOverrides","MuiMenuItem","menuItemOverrides","MuiSelect","selectOverrides","MuiTextField","textFieldOverrides","lightTheme","darkTheme"],"mappings":"0lCAmBA,MAAMA,EAA8BC,IAClC,MAAMC,EAA6B,CACjCC,aACAC,QAAkB,UAATH,EAAmBI,EAAeC,EAC3CC,SACAC,YAAa,CACXC,OAAQC,IAGNC,EAAYC,EAAYV,GAoB9B,OAbAW,OAAOC,KAAKX,GAAYY,SAASC,IAE/B,MAAMC,EAA0BD,EAAIE,MAAM,aAAa,GACjDC,EAAgBH,EACtBL,EAAUR,WAAWgB,GAAiB,IACjCR,EAAUR,WAAWgB,GACxB,CAACR,EAAUH,YAAYY,KAAK,WAAY,IACnCC,EAAmBJ,QAMrBL,EAAY,IACdV,EACHC,WAAYQ,EAAUR,WACtBmB,MAAO,CACLC,aAAc,GAEhBC,cAAe,IACVC,GAELC,WAAY,CACVC,SAAU,CACRC,aAAc,CACZF,WAAY,CACVG,UAAWC,IAGfC,eAAgB,CACdC,KAAM,CAEJT,aAAc,MAEdU,QAAS,QAEXC,KAAM,CAEJC,YAAa,OACbF,QAAS,GAEXG,OAAQ,CACNH,QAAS,EACT,WAAY,CACVI,UAAW,SAGfC,QAAS,CACPL,QAAS,KAIfM,UAAWC,EAAqB7B,GAChC8B,cAAeC,IACfC,QAAS,CACPZ,eAAgB,CACdC,KAAM,CACJY,UAAW,OACXC,YAAa,MACbC,YAAa,QACbC,YAAapC,EAAUP,QAAQ4C,WAIrCC,QAAS,CACPlB,eAAgB,CACdC,KAAM,CACJkB,WAAY,OACZC,YAAa,MACbC,aAAc,SAIpBC,kBAAmB,CACjBtB,eAAgB,CACdC,KAAM,CACJ,UAAW,CACTsB,gBAAiB3C,EAAUP,QAAQmD,SAASC,KAAK,sBAEnD,qBAAsB,CACpBC,aAAc,aAAa9C,EAAUP,QAAQmD,SAASG,OAAO,qBAKrEC,YAAa,CACX5B,eAAgB,CACdC,KAAM,CACJ,4BAA6B,CAC3BsB,gBAAiB3C,EAAUP,QAAQmD,SAASC,KAAK,kBACjDI,OAAQ,cAKhBC,cAAe,CACbjC,aAAc,CACZkC,eAAgBC,IAGpBC,kBAAmBC,EAAwBtD,GAC3CuD,aAAcC,EAAmBxD,GACjCyD,cAAeC,EAAoB1D,GACnC2D,YAAaC,EAAkB5D,GAC/B6D,UAAWC,EAAgB9D,GAC3B+D,aAAcC,QAKPC,EAAa5E,EAA2B,SACxC6E,EAAY7E,EAA2B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@mui/material/styles");var e=require("../typography.cjs.js");const t=t=>({styleOverrides:{root:{...e.typography.captionWeak,alignItems:"center",color:t.palette.semantic.text["text-weak"],display:"flex",gap:t.spacing(.5),margin:0,"&.Mui-disabled":{color:t.palette.semantic.text["text-disabled"],"& svg":{color:t.palette.semantic.icon["icon-disabled"]}},"&.Mui-error":{color:t.palette.semantic.text["text-error"],fontWeight:600,"& svg":{color:t.palette.semantic.icon["icon-error"]}},[t.breakpoints.down("tablet")]:{...e.getMobileTextStyle("caption")}}}});exports.default=t,exports.formHelperTextOverrides=t;
|
|
2
|
+
//# sourceMappingURL=formHelperTextOverrides.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formHelperTextOverrides.cjs.js","sources":["../../../src/themes/overrides/formHelperTextOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nimport { getMobileTextStyle, typography } from '@fd/themes/typography';\n\nexport const formHelperTextOverrides = (baseTheme: Theme): Components<Theme>['MuiFormHelperText'] => ({\n styleOverrides: {\n root: {\n ...typography.captionWeak,\n alignItems: 'center',\n color: baseTheme.palette.semantic.text['text-weak'],\n display: 'flex',\n gap: baseTheme.spacing(0.5),\n margin: 0,\n\n '&.Mui-disabled': {\n color: baseTheme.palette.semantic.text['text-disabled'],\n\n '& svg': {\n color: baseTheme.palette.semantic.icon['icon-disabled'],\n },\n },\n '&.Mui-error': {\n color: baseTheme.palette.semantic.text['text-error'],\n fontWeight: 600,\n\n '& svg': {\n color: baseTheme.palette.semantic.icon['icon-error'],\n },\n },\n\n [baseTheme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle('caption'),\n },\n },\n },\n});\n\nexport default formHelperTextOverrides;\n"],"names":["formHelperTextOverrides","baseTheme","styleOverrides","root","typography","captionWeak","alignItems","color","palette","semantic","text","display","gap","spacing","margin","icon","fontWeight","breakpoints","down","getMobileTextStyle"],"mappings":"gJAIaA,EAA2BC,IAAgB,CACtDC,eAAgB,CACdC,KAAM,IACDC,EAAAA,WAAWC,YACdC,WAAY,SACZC,MAAON,EAAUO,QAAQC,SAASC,KAAK,aACvCC,QAAS,OACTC,IAAKX,EAAUY,QAAQ,IACvBC,OAAQ,EAER,iBAAkB,CAChBP,MAAON,EAAUO,QAAQC,SAASC,KAAK,iBAEvC,QAAS,CACPH,MAAON,EAAUO,QAAQC,SAASM,KAAK,mBAG3C,cAAe,CACbR,MAAON,EAAUO,QAAQC,SAASC,KAAK,cACvCM,WAAY,IAEZ,QAAS,CACPT,MAAON,EAAUO,QAAQC,SAASM,KAAK,gBAI3C,CAACd,EAAUgB,YAAYC,KAAK,WAAY,IACnCC,EAAAA,mBAAmB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"@mui/material/styles";import{getMobileTextStyle as t,typography as e}from"../typography.js";const o=o=>({styleOverrides:{root:{...e.captionWeak,alignItems:"center",color:o.palette.semantic.text["text-weak"],display:"flex",gap:o.spacing(.5),margin:0,"&.Mui-disabled":{color:o.palette.semantic.text["text-disabled"],"& svg":{color:o.palette.semantic.icon["icon-disabled"]}},"&.Mui-error":{color:o.palette.semantic.text["text-error"],fontWeight:600,"& svg":{color:o.palette.semantic.icon["icon-error"]}},[o.breakpoints.down("tablet")]:{...t("caption")}}}});export{o as default,o as formHelperTextOverrides};
|
|
2
|
+
//# sourceMappingURL=formHelperTextOverrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formHelperTextOverrides.js","sources":["../../../src/themes/overrides/formHelperTextOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nimport { getMobileTextStyle, typography } from '@fd/themes/typography';\n\nexport const formHelperTextOverrides = (baseTheme: Theme): Components<Theme>['MuiFormHelperText'] => ({\n styleOverrides: {\n root: {\n ...typography.captionWeak,\n alignItems: 'center',\n color: baseTheme.palette.semantic.text['text-weak'],\n display: 'flex',\n gap: baseTheme.spacing(0.5),\n margin: 0,\n\n '&.Mui-disabled': {\n color: baseTheme.palette.semantic.text['text-disabled'],\n\n '& svg': {\n color: baseTheme.palette.semantic.icon['icon-disabled'],\n },\n },\n '&.Mui-error': {\n color: baseTheme.palette.semantic.text['text-error'],\n fontWeight: 600,\n\n '& svg': {\n color: baseTheme.palette.semantic.icon['icon-error'],\n },\n },\n\n [baseTheme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle('caption'),\n },\n },\n },\n});\n\nexport default formHelperTextOverrides;\n"],"names":["formHelperTextOverrides","baseTheme","styleOverrides","root","typography","captionWeak","alignItems","color","palette","semantic","text","display","gap","spacing","margin","icon","fontWeight","breakpoints","down","getMobileTextStyle"],"mappings":"yGAIaA,EAA2BC,IAAgB,CACtDC,eAAgB,CACdC,KAAM,IACDC,EAAWC,YACdC,WAAY,SACZC,MAAON,EAAUO,QAAQC,SAASC,KAAK,aACvCC,QAAS,OACTC,IAAKX,EAAUY,QAAQ,IACvBC,OAAQ,EAER,iBAAkB,CAChBP,MAAON,EAAUO,QAAQC,SAASC,KAAK,iBAEvC,QAAS,CACPH,MAAON,EAAUO,QAAQC,SAASM,KAAK,mBAG3C,cAAe,CACbR,MAAON,EAAUO,QAAQC,SAASC,KAAK,cACvCM,WAAY,IAEZ,QAAS,CACPT,MAAON,EAAUO,QAAQC,SAASM,KAAK,gBAI3C,CAACd,EAAUgB,YAAYC,KAAK,WAAY,IACnCC,EAAmB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@mui/material/styles");var e=require("../typography.cjs.js");const t=t=>({styleOverrides:{root:{backgroundColor:t.palette.semantic.fill["fill-inverse-strong"],backgroundImage:"none",border:"1px solid",borderColor:t.palette.semantic.stroke["stroke-strong"],borderRadius:t.radius["radius-8"],minHeight:50,padding:t.spacing(0,2),"&.Mui-disabled":{borderColor:t.palette.semantic.stroke["stroke-disabled"],cursor:"not-allowed",opacity:1,pointerEvents:"auto"},"&.Mui-focused:not(.Mui-disabled)":{outline:`2px solid ${t.palette.semantic.stroke["stroke-focus"]}`,outlineOffset:"2px"},"&:hover:not(.Mui-disabled)":{backgroundImage:`linear-gradient(${t.palette.semantic.fill["fill-hover"]}, ${t.palette.semantic.fill["fill-hover"]})`},"&:active:not(.Mui-disabled)":{backgroundImage:`linear-gradient(${t.palette.semantic.fill["fill-press"]}, ${t.palette.semantic.fill["fill-press"]})`},"&.Mui-error":{backgroundColor:t.palette.semantic.fill["fill-error-weak"],border:"2px solid",borderColor:t.palette.semantic.stroke["stroke-error-strong"]}},input:{...e.typography.b1Weak,color:t.palette.semantic.text["text-strong"],"&.MuiOutlinedInput-input":{padding:0},"&::placeholder":{...e.typography.b1Weak,color:t.palette.semantic.text["text-weak"],opacity:1},"&.Mui-disabled":{color:t.palette.semantic.text["text-disabled"],cursor:"not-allowed",pointerEvents:"auto","-webkit-text-fill-color":t.palette.semantic.text["text-disabled"],"&::placeholder":{color:t.palette.semantic.text["text-disabled"],"-webkit-text-fill-color":t.palette.semantic.text["text-disabled"]}},[t.breakpoints.down("tablet")]:{...e.getMobileTextStyle("b1"),"&::placeholder":{...e.getMobileTextStyle("b1")}}},inputMultiline:{padding:t.spacing(1.5,2),"&.MuiOutlinedInput-input":{padding:0}}}});exports.default=t,exports.inputBaseOverrides=t;
|
|
2
|
+
//# sourceMappingURL=inputBaseOverrides.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputBaseOverrides.cjs.js","sources":["../../../src/themes/overrides/inputBaseOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nimport { getMobileTextStyle, typography } from '@fd/themes/typography';\n\nexport const inputBaseOverrides = (theme: Theme): Components<Theme>['MuiInputBase'] => ({\n styleOverrides: {\n root: {\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n backgroundImage: 'none',\n border: '1px solid',\n borderColor: theme.palette.semantic.stroke['stroke-strong'],\n borderRadius: theme.radius['radius-8'],\n minHeight: 50,\n padding: theme.spacing(0, 2),\n\n '&.Mui-disabled': {\n borderColor: theme.palette.semantic.stroke['stroke-disabled'],\n cursor: 'not-allowed',\n opacity: 1, // Override default MUI opacity\n pointerEvents: 'auto',\n },\n '&.Mui-focused:not(.Mui-disabled)': {\n outline: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n outlineOffset: '2px',\n },\n '&:hover:not(.Mui-disabled)': {\n backgroundImage: `linear-gradient(${theme.palette.semantic.fill['fill-hover']}, ${theme.palette.semantic.fill['fill-hover']})`,\n },\n '&:active:not(.Mui-disabled)': {\n backgroundImage: `linear-gradient(${theme.palette.semantic.fill['fill-press']}, ${theme.palette.semantic.fill['fill-press']})`,\n },\n '&.Mui-error': {\n backgroundColor: theme.palette.semantic.fill['fill-error-weak'],\n border: '2px solid',\n borderColor: theme.palette.semantic.stroke['stroke-error-strong'],\n },\n },\n input: {\n ...typography.b1Weak,\n color: theme.palette.semantic.text['text-strong'],\n\n '&.MuiOutlinedInput-input': {\n padding: 0,\n },\n '&::placeholder': {\n ...typography.b1Weak,\n color: theme.palette.semantic.text['text-weak'],\n opacity: 1,\n },\n '&.Mui-disabled': {\n color: theme.palette.semantic.text['text-disabled'],\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n '-webkit-text-fill-color': theme.palette.semantic.text['text-disabled'],\n\n '&::placeholder': {\n color: theme.palette.semantic.text['text-disabled'],\n '-webkit-text-fill-color': theme.palette.semantic.text['text-disabled'],\n },\n },\n\n [theme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle('b1'),\n\n '&::placeholder': {\n ...getMobileTextStyle('b1'),\n },\n },\n },\n inputMultiline: {\n padding: theme.spacing(1.5, 2),\n\n '&.MuiOutlinedInput-input': {\n padding: 0,\n },\n },\n },\n});\n\nexport default inputBaseOverrides;\n"],"names":["inputBaseOverrides","theme","styleOverrides","root","backgroundColor","palette","semantic","fill","backgroundImage","border","borderColor","stroke","borderRadius","radius","minHeight","padding","spacing","cursor","opacity","pointerEvents","outline","outlineOffset","input","typography","b1Weak","color","text","breakpoints","down","getMobileTextStyle","inputMultiline"],"mapp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AAAA,mBAAmB,MAEtB,iBAAkB,IACbA,EAAAA,mBAAmB,SAI5BC,eAAgB,CACdf,QAASd,EAAMe,QAAQ,IAAK,GAE5B,2BAA4B,CAC1BD,QAAS"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"@mui/material/styles";import{getMobileTextStyle as e,typography as t}from"../typography.js";const i=i=>({styleOverrides:{root:{backgroundColor:i.palette.semantic.fill["fill-inverse-strong"],backgroundImage:"none",border:"1px solid",borderColor:i.palette.semantic.stroke["stroke-strong"],borderRadius:i.radius["radius-8"],minHeight:50,padding:i.spacing(0,2),"&.Mui-disabled":{borderColor:i.palette.semantic.stroke["stroke-disabled"],cursor:"not-allowed",opacity:1,pointerEvents:"auto"},"&.Mui-focused:not(.Mui-disabled)":{outline:`2px solid ${i.palette.semantic.stroke["stroke-focus"]}`,outlineOffset:"2px"},"&:hover:not(.Mui-disabled)":{backgroundImage:`linear-gradient(${i.palette.semantic.fill["fill-hover"]}, ${i.palette.semantic.fill["fill-hover"]})`},"&:active:not(.Mui-disabled)":{backgroundImage:`linear-gradient(${i.palette.semantic.fill["fill-press"]}, ${i.palette.semantic.fill["fill-press"]})`},"&.Mui-error":{backgroundColor:i.palette.semantic.fill["fill-error-weak"],border:"2px solid",borderColor:i.palette.semantic.stroke["stroke-error-strong"]}},input:{...t.b1Weak,color:i.palette.semantic.text["text-strong"],"&.MuiOutlinedInput-input":{padding:0},"&::placeholder":{...t.b1Weak,color:i.palette.semantic.text["text-weak"],opacity:1},"&.Mui-disabled":{color:i.palette.semantic.text["text-disabled"],cursor:"not-allowed",pointerEvents:"auto","-webkit-text-fill-color":i.palette.semantic.text["text-disabled"],"&::placeholder":{color:i.palette.semantic.text["text-disabled"],"-webkit-text-fill-color":i.palette.semantic.text["text-disabled"]}},[i.breakpoints.down("tablet")]:{...e("b1"),"&::placeholder":{...e("b1")}}},inputMultiline:{padding:i.spacing(1.5,2),"&.MuiOutlinedInput-input":{padding:0}}}});export{i as default,i as inputBaseOverrides};
|
|
2
|
+
//# sourceMappingURL=inputBaseOverrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputBaseOverrides.js","sources":["../../../src/themes/overrides/inputBaseOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nimport { getMobileTextStyle, typography } from '@fd/themes/typography';\n\nexport const inputBaseOverrides = (theme: Theme): Components<Theme>['MuiInputBase'] => ({\n styleOverrides: {\n root: {\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n backgroundImage: 'none',\n border: '1px solid',\n borderColor: theme.palette.semantic.stroke['stroke-strong'],\n borderRadius: theme.radius['radius-8'],\n minHeight: 50,\n padding: theme.spacing(0, 2),\n\n '&.Mui-disabled': {\n borderColor: theme.palette.semantic.stroke['stroke-disabled'],\n cursor: 'not-allowed',\n opacity: 1, // Override default MUI opacity\n pointerEvents: 'auto',\n },\n '&.Mui-focused:not(.Mui-disabled)': {\n outline: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n outlineOffset: '2px',\n },\n '&:hover:not(.Mui-disabled)': {\n backgroundImage: `linear-gradient(${theme.palette.semantic.fill['fill-hover']}, ${theme.palette.semantic.fill['fill-hover']})`,\n },\n '&:active:not(.Mui-disabled)': {\n backgroundImage: `linear-gradient(${theme.palette.semantic.fill['fill-press']}, ${theme.palette.semantic.fill['fill-press']})`,\n },\n '&.Mui-error': {\n backgroundColor: theme.palette.semantic.fill['fill-error-weak'],\n border: '2px solid',\n borderColor: theme.palette.semantic.stroke['stroke-error-strong'],\n },\n },\n input: {\n ...typography.b1Weak,\n color: theme.palette.semantic.text['text-strong'],\n\n '&.MuiOutlinedInput-input': {\n padding: 0,\n },\n '&::placeholder': {\n ...typography.b1Weak,\n color: theme.palette.semantic.text['text-weak'],\n opacity: 1,\n },\n '&.Mui-disabled': {\n color: theme.palette.semantic.text['text-disabled'],\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n '-webkit-text-fill-color': theme.palette.semantic.text['text-disabled'],\n\n '&::placeholder': {\n color: theme.palette.semantic.text['text-disabled'],\n '-webkit-text-fill-color': theme.palette.semantic.text['text-disabled'],\n },\n },\n\n [theme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle('b1'),\n\n '&::placeholder': {\n ...getMobileTextStyle('b1'),\n },\n },\n },\n inputMultiline: {\n padding: theme.spacing(1.5, 2),\n\n '&.MuiOutlinedInput-input': {\n padding: 0,\n },\n },\n },\n});\n\nexport default inputBaseOverrides;\n"],"names":["inputBaseOverrides","theme","styleOverrides","root","backgroundColor","palette","semantic","fill","backgroundImage","border","borderColor","stroke","borderRadius","radius","minHeight","padding","spacing","cursor","opacity","pointerEvents","outline","outlineOffset","input","typography","b1Weak","color","text","breakpoints","down","getMobileTextStyle","inputMultiline"],"mappings":"yGAIaA,EAAsBC,IAAY,CAC7CC,eAAgB,CACdC,KAAM,CACJC,gBAAiBH,EAAMI,QAAQC,SAASC,KAAK,uBAC7CC,gBAAiB,OACjBC,OAAQ,YACRC,YAAaT,EAAMI,QAAQC,SAASK,OAAO,iBAC3CC,aAAcX,EAAMY,OAAO,YAC3BC,UAAW,GACXC,QAASd,EAAMe,QAAQ,EAAG,GAE1B,iBAAkB,CAChBN,YAAaT,EAAMI,QAAQC,SAASK,OAAO,mBAC3CM,OAAQ,cACRC,QAAS,EACTC,cAAe,QAEjB,mCAAoC,CAClCC,QAAS,aAAanB,EAAMI,QAAQC,SAASK,OAAO,kBACpDU,cAAe,OAEjB,6BAA8B,CAC5Bb,gBAAiB,mBAAmBP,EAAMI,QAAQC,SAASC,KAAK,kBAAkBN,EAAMI,QAAQC,SAASC,KAAK,kBAEhH,8BAA+B,CAC7BC,gBAAiB,mBAAmBP,EAAMI,QAAQC,SAASC,KAAK,kBAAkBN,EAAMI,QAAQC,SAASC,KAAK,kBAEhH,cAAe,CACbH,gBAAiBH,EAAMI,QAAQC,SAASC,KAAK,mBAC7CE,OAAQ,YACRC,YAAaT,EAAMI,QAAQC,SAASK,OAAO,yBAG/CW,MAAO,IACFC,EAAWC,OACdC,MAAOxB,EAAMI,QAAQC,SAASoB,KAAK,eAEnC,2BAA4B,CAC1BX,QAAS,GAEX,iBAAkB,IACbQ,EAAWC,OACdC,MAAOxB,EAAMI,QAAQC,SAASoB,KAAK,aACnCR,QAAS,GAEX,iBAAkB,CAChBO,MAAOxB,EAAMI,QAAQC,SAASoB,KAAK,iBACnCT,OAAQ,cACRE,cAAe,OACf,0BAA2BlB,EAAMI,QAAQC,SAASoB,KAAK,iBAEvD,iBAAkB,CAChBD,MAAOxB,EAAMI,QAAQC,SAASoB,KAAK,iBACnC,0BAA2BzB,EAAMI,QAAQC,SAASoB,KAAK,mBAI3D,CAACzB,EAAM0B,YAAYC,KAAK,WAAY,IAC/BC,EAAmB,MAEtB,iBAAkB,IACbA,EAAmB,SAI5BC,eAAgB,CACdf,QAASd,EAAMe,QAAQ,IAAK,GAE5B,2BAA4B,CAC1BD,QAAS"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@mui/material/styles");var e=require("../typography.cjs.js");const t=t=>({styleOverrides:{root:{...e.typography.b1Weak,color:t.palette.semantic.text["text-strong"],"&.Mui-disabled":{color:t.palette.semantic.text["text-disabled"],"& .MuiInputLabel-asterisk":{color:t.palette.semantic.text["text-disabled"]}},"&.Mui-error":{color:t.palette.semantic.text["text-error"],"& .MuiInputLabel-asterisk":{color:t.palette.semantic.text["text-error"]}},"& .MuiInputLabel-asterisk":{color:t.palette.semantic.text["text-weak"]},[t.breakpoints.down("tablet")]:{...e.getMobileTextStyle("b1")}}}});exports.default=t,exports.inputLabelOverrides=t;
|
|
2
|
+
//# sourceMappingURL=inputLabelOverrides.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputLabelOverrides.cjs.js","sources":["../../../src/themes/overrides/inputLabelOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nimport { getMobileTextStyle, typography } from '@fd/themes/typography';\n\nexport const inputLabelOverrides = (baseTheme: Theme): Components<Theme>['MuiInputLabel'] => ({\n styleOverrides: {\n root: {\n ...typography.b1Weak,\n color: baseTheme.palette.semantic.text['text-strong'],\n\n '&.Mui-disabled': {\n color: baseTheme.palette.semantic.text['text-disabled'],\n\n '& .MuiInputLabel-asterisk': {\n color: baseTheme.palette.semantic.text['text-disabled'],\n },\n },\n '&.Mui-error': {\n color: baseTheme.palette.semantic.text['text-error'],\n\n '& .MuiInputLabel-asterisk': {\n color: baseTheme.palette.semantic.text['text-error'],\n },\n },\n '& .MuiInputLabel-asterisk': {\n color: baseTheme.palette.semantic.text['text-weak'],\n },\n\n [baseTheme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle('b1'),\n },\n },\n },\n});\n\nexport default inputLabelOverrides;\n"],"names":["inputLabelOverrides","baseTheme","styleOverrides","root","typography","b1Weak","color","palette","semantic","text","breakpoints","down","getMobileTextStyle"],"mappings":"gJAIaA,EAAuBC,IAAgB,CAClDC,eAAgB,CACdC,KAAM,IACDC,EAAAA,WAAWC,OACdC,MAAOL,EAAUM,QAAQC,SAASC,KAAK,eAEvC,iBAAkB,CAChBH,MAAOL,EAAUM,QAAQC,SAASC,KAAK,iBAEvC,4BAA6B,CAC3BH,MAAOL,EAAUM,QAAQC,SAASC,KAAK,mBAG3C,cAAe,CACbH,MAAOL,EAAUM,QAAQC,SAASC,KAAK,cAEvC,4BAA6B,CAC3BH,MAAOL,EAAUM,QAAQC,SAASC,KAAK,gBAG3C,4BAA6B,CAC3BH,MAAOL,EAAUM,QAAQC,SAASC,KAAK,cAGzC,CAACR,EAAUS,YAAYC,KAAK,WAAY,IACnCC,EAAAA,mBAAmB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"@mui/material/styles";import{getMobileTextStyle as t,typography as e}from"../typography.js";const a=a=>({styleOverrides:{root:{...e.b1Weak,color:a.palette.semantic.text["text-strong"],"&.Mui-disabled":{color:a.palette.semantic.text["text-disabled"],"& .MuiInputLabel-asterisk":{color:a.palette.semantic.text["text-disabled"]}},"&.Mui-error":{color:a.palette.semantic.text["text-error"],"& .MuiInputLabel-asterisk":{color:a.palette.semantic.text["text-error"]}},"& .MuiInputLabel-asterisk":{color:a.palette.semantic.text["text-weak"]},[a.breakpoints.down("tablet")]:{...t("b1")}}}});export{a as default,a as inputLabelOverrides};
|
|
2
|
+
//# sourceMappingURL=inputLabelOverrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputLabelOverrides.js","sources":["../../../src/themes/overrides/inputLabelOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nimport { getMobileTextStyle, typography } from '@fd/themes/typography';\n\nexport const inputLabelOverrides = (baseTheme: Theme): Components<Theme>['MuiInputLabel'] => ({\n styleOverrides: {\n root: {\n ...typography.b1Weak,\n color: baseTheme.palette.semantic.text['text-strong'],\n\n '&.Mui-disabled': {\n color: baseTheme.palette.semantic.text['text-disabled'],\n\n '& .MuiInputLabel-asterisk': {\n color: baseTheme.palette.semantic.text['text-disabled'],\n },\n },\n '&.Mui-error': {\n color: baseTheme.palette.semantic.text['text-error'],\n\n '& .MuiInputLabel-asterisk': {\n color: baseTheme.palette.semantic.text['text-error'],\n },\n },\n '& .MuiInputLabel-asterisk': {\n color: baseTheme.palette.semantic.text['text-weak'],\n },\n\n [baseTheme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle('b1'),\n },\n },\n },\n});\n\nexport default inputLabelOverrides;\n"],"names":["inputLabelOverrides","baseTheme","styleOverrides","root","typography","b1Weak","color","palette","semantic","text","breakpoints","down","getMobileTextStyle"],"mappings":"yGAIaA,EAAuBC,IAAgB,CAClDC,eAAgB,CACdC,KAAM,IACDC,EAAWC,OACdC,MAAOL,EAAUM,QAAQC,SAASC,KAAK,eAEvC,iBAAkB,CAChBH,MAAOL,EAAUM,QAAQC,SAASC,KAAK,iBAEvC,4BAA6B,CAC3BH,MAAOL,EAAUM,QAAQC,SAASC,KAAK,mBAG3C,cAAe,CACbH,MAAOL,EAAUM,QAAQC,SAASC,KAAK,cAEvC,4BAA6B,CAC3BH,MAAOL,EAAUM,QAAQC,SAASC,KAAK,gBAG3C,4BAA6B,CAC3BH,MAAOL,EAAUM,QAAQC,SAASC,KAAK,cAGzC,CAACR,EAAUS,YAAYC,KAAK,WAAY,IACnCC,EAAmB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@mui/material/styles");var e=require("../typography.cjs.js");const t=t=>({styleOverrides:{root:{...e.typography.b1Weak,backgroundColor:t.palette.semantic.fill["fill-inverse-strong"],color:t.palette.semantic.text["text-strong"],padding:t.spacing(1.5,2),"&.Mui-disabled":{color:t.palette.semantic.text["text-disabled"],cursor:"not-allowed",opacity:1,pointerEvents:"auto","&:hover":{backgroundColor:t.palette.semantic.fill["fill-inverse-strong"],color:t.palette.semantic.text["text-disabled"]}},"&.Mui-selected":{backgroundColor:t.palette.semantic.fill["fill-weak"],color:t.palette.semantic.text["text-primary"],"&:hover":{backgroundColor:t.palette.semantic.fill["fill-weak"],color:t.palette.semantic.text["text-primary"]}},"&:hover:not(.Mui-disabled):not(.Mui-selected)":{backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-strong"]},"&:active:not(.Mui-disabled):not(.Mui-selected)":{backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-strong"]},[t.breakpoints.down("tablet")]:{...e.getMobileTextStyle("b1")}}}});exports.default=t,exports.menuItemOverrides=t;
|
|
2
|
+
//# sourceMappingURL=menuItemOverrides.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuItemOverrides.cjs.js","sources":["../../../src/themes/overrides/menuItemOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nimport { getMobileTextStyle, typography } from '@fd/themes/typography';\n\nexport const menuItemOverrides = (baseTheme: Theme): Components<Theme>['MuiMenuItem'] => ({\n styleOverrides: {\n root: {\n ...typography.b1Weak,\n backgroundColor: baseTheme.palette.semantic.fill['fill-inverse-strong'],\n color: baseTheme.palette.semantic.text['text-strong'],\n padding: baseTheme.spacing(1.5, 2),\n\n '&.Mui-disabled': {\n color: baseTheme.palette.semantic.text['text-disabled'],\n cursor: 'not-allowed',\n opacity: 1, // Override default MUI opacity\n pointerEvents: 'auto',\n\n '&:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-inverse-strong'],\n color: baseTheme.palette.semantic.text['text-disabled'],\n },\n },\n '&.Mui-selected': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-weak'],\n color: baseTheme.palette.semantic.text['text-primary'],\n\n '&:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-weak'],\n color: baseTheme.palette.semantic.text['text-primary'],\n },\n },\n '&:hover:not(.Mui-disabled):not(.Mui-selected)': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-hover'],\n color: baseTheme.palette.semantic.text['text-strong'],\n },\n '&:active:not(.Mui-disabled):not(.Mui-selected)': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-press'],\n color: baseTheme.palette.semantic.text['text-strong'],\n },\n\n [baseTheme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle('b1'),\n },\n },\n },\n});\n\nexport default menuItemOverrides;\n"],"names":["menuItemOverrides","baseTheme","styleOverrides","root","typography","b1Weak","backgroundColor","palette","semantic","fill","color","text","padding","spacing","cursor","opacity","pointerEvents","breakpoints","down","getMobileTextStyle"],"mappings":"gJAIaA,EAAqBC,IAAgB,CAChDC,eAAgB,CACdC,KAAM,IACDC,EAAAA,WAAWC,OACdC,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,uBACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,eACvCC,QAASX,EAAUY,QAAQ,IAAK,GAEhC,iBAAkB,CAChBH,MAAOT,EAAUM,QAAQC,SAASG,KAAK,iBACvCG,OAAQ,cACRC,QAAS,EACTC,cAAe,OAEf,UAAW,CACTV,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,uBACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,mBAG3C,iBAAkB,CAChBL,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,aACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,gBAEvC,UAAW,CACTL,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,aACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,kBAG3C,gDAAiD,CAC/CL,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,cACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,gBAEzC,iDAAkD,CAChDL,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,cACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,gBAGzC,CAACV,EAAUgB,YAAYC,KAAK,WAAY,IACnCC,EAAAA,mBAAmB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"@mui/material/styles";import{getMobileTextStyle as t,typography as e}from"../typography.js";const l=l=>({styleOverrides:{root:{...e.b1Weak,backgroundColor:l.palette.semantic.fill["fill-inverse-strong"],color:l.palette.semantic.text["text-strong"],padding:l.spacing(1.5,2),"&.Mui-disabled":{color:l.palette.semantic.text["text-disabled"],cursor:"not-allowed",opacity:1,pointerEvents:"auto","&:hover":{backgroundColor:l.palette.semantic.fill["fill-inverse-strong"],color:l.palette.semantic.text["text-disabled"]}},"&.Mui-selected":{backgroundColor:l.palette.semantic.fill["fill-weak"],color:l.palette.semantic.text["text-primary"],"&:hover":{backgroundColor:l.palette.semantic.fill["fill-weak"],color:l.palette.semantic.text["text-primary"]}},"&:hover:not(.Mui-disabled):not(.Mui-selected)":{backgroundColor:l.palette.semantic.fill["fill-hover"],color:l.palette.semantic.text["text-strong"]},"&:active:not(.Mui-disabled):not(.Mui-selected)":{backgroundColor:l.palette.semantic.fill["fill-press"],color:l.palette.semantic.text["text-strong"]},[l.breakpoints.down("tablet")]:{...t("b1")}}}});export{l as default,l as menuItemOverrides};
|
|
2
|
+
//# sourceMappingURL=menuItemOverrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuItemOverrides.js","sources":["../../../src/themes/overrides/menuItemOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nimport { getMobileTextStyle, typography } from '@fd/themes/typography';\n\nexport const menuItemOverrides = (baseTheme: Theme): Components<Theme>['MuiMenuItem'] => ({\n styleOverrides: {\n root: {\n ...typography.b1Weak,\n backgroundColor: baseTheme.palette.semantic.fill['fill-inverse-strong'],\n color: baseTheme.palette.semantic.text['text-strong'],\n padding: baseTheme.spacing(1.5, 2),\n\n '&.Mui-disabled': {\n color: baseTheme.palette.semantic.text['text-disabled'],\n cursor: 'not-allowed',\n opacity: 1, // Override default MUI opacity\n pointerEvents: 'auto',\n\n '&:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-inverse-strong'],\n color: baseTheme.palette.semantic.text['text-disabled'],\n },\n },\n '&.Mui-selected': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-weak'],\n color: baseTheme.palette.semantic.text['text-primary'],\n\n '&:hover': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-weak'],\n color: baseTheme.palette.semantic.text['text-primary'],\n },\n },\n '&:hover:not(.Mui-disabled):not(.Mui-selected)': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-hover'],\n color: baseTheme.palette.semantic.text['text-strong'],\n },\n '&:active:not(.Mui-disabled):not(.Mui-selected)': {\n backgroundColor: baseTheme.palette.semantic.fill['fill-press'],\n color: baseTheme.palette.semantic.text['text-strong'],\n },\n\n [baseTheme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle('b1'),\n },\n },\n },\n});\n\nexport default menuItemOverrides;\n"],"names":["menuItemOverrides","baseTheme","styleOverrides","root","typography","b1Weak","backgroundColor","palette","semantic","fill","color","text","padding","spacing","cursor","opacity","pointerEvents","breakpoints","down","getMobileTextStyle"],"mappings":"yGAIaA,EAAqBC,IAAgB,CAChDC,eAAgB,CACdC,KAAM,IACDC,EAAWC,OACdC,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,uBACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,eACvCC,QAASX,EAAUY,QAAQ,IAAK,GAEhC,iBAAkB,CAChBH,MAAOT,EAAUM,QAAQC,SAASG,KAAK,iBACvCG,OAAQ,cACRC,QAAS,EACTC,cAAe,OAEf,UAAW,CACTV,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,uBACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,mBAG3C,iBAAkB,CAChBL,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,aACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,gBAEvC,UAAW,CACTL,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,aACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,kBAG3C,gDAAiD,CAC/CL,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,cACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,gBAEzC,iDAAkD,CAChDL,gBAAiBL,EAAUM,QAAQC,SAASC,KAAK,cACjDC,MAAOT,EAAUM,QAAQC,SAASG,KAAK,gBAGzC,CAACV,EAAUgB,YAAYC,KAAK,WAAY,IACnCC,EAAmB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@mui/material/styles");const e=e=>({defaultProps:{MenuProps:{PaperProps:{style:{boxShadow:e.customShadows?.overlay,marginBottom:e.spacing(.5),marginTop:e.spacing(.5)}}}},styleOverrides:{root:{"& .MuiSelect-select":{paddingRight:`${e.spacing(1)} !important`},"&.MuiOutlinedInput-root":{"& fieldset":{border:"none"},"&.Mui-disabled fieldset":{border:"none"},"&.Mui-focused fieldset":{border:"none"},"&:hover fieldset":{border:"none"}}}}});exports.default=e,exports.selectOverrides=e;
|
|
2
|
+
//# sourceMappingURL=selectOverrides.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectOverrides.cjs.js","sources":["../../../src/themes/overrides/selectOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nexport const selectOverrides = (theme: Theme): Components<Theme>['MuiSelect'] => ({\n defaultProps: {\n MenuProps: {\n PaperProps: {\n style: {\n boxShadow: theme.customShadows?.overlay,\n marginBottom: theme.spacing(0.5),\n marginTop: theme.spacing(0.5),\n },\n },\n },\n },\n styleOverrides: {\n root: {\n '& .MuiSelect-select': {\n paddingRight: `${theme.spacing(1)} !important`, // Override the default 32px padding-right\n },\n '&.MuiOutlinedInput-root': {\n '& fieldset': {\n border: 'none',\n },\n '&.Mui-disabled fieldset': {\n border: 'none',\n },\n '&.Mui-focused fieldset': {\n border: 'none',\n },\n '&:hover fieldset': {\n border: 'none',\n },\n },\n },\n },\n});\n\nexport default selectOverrides;\n"],"names":["selectOverrides","theme","defaultProps","MenuProps","PaperProps","style","boxShadow","customShadows","overlay","marginBottom","spacing","marginTop","styleOverrides","root","paddingRight","border"],"mappings":"0GAEaA,EAAmBC,IAAY,CAC1CC,aAAc,CACZC,UAAW,CACTC,WAAY,CACVC,MAAO,CACLC,UAAWL,EAAMM,eAAeC,QAChCC,aAAcR,EAAMS,QAAQ,IAC5BC,UAAWV,EAAMS,QAAQ,QAKjCE,eAAgB,CACdC,KAAM,CACJ,sBAAuB,CACrBC,aAAc,GAAGb,EAAMS,QAAQ,iBAEjC,0BAA2B,CACzB,aAAc,CACZK,OAAQ,QAEV,0BAA2B,CACzBA,OAAQ,QAEV,yBAA0B,CACxBA,OAAQ,QAEV,mBAAoB,CAClBA,OAAQ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"@mui/material/styles";const e=e=>({defaultProps:{MenuProps:{PaperProps:{style:{boxShadow:e.customShadows?.overlay,marginBottom:e.spacing(.5),marginTop:e.spacing(.5)}}}},styleOverrides:{root:{"& .MuiSelect-select":{paddingRight:`${e.spacing(1)} !important`},"&.MuiOutlinedInput-root":{"& fieldset":{border:"none"},"&.Mui-disabled fieldset":{border:"none"},"&.Mui-focused fieldset":{border:"none"},"&:hover fieldset":{border:"none"}}}}});export{e as default,e as selectOverrides};
|
|
2
|
+
//# sourceMappingURL=selectOverrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectOverrides.js","sources":["../../../src/themes/overrides/selectOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nexport const selectOverrides = (theme: Theme): Components<Theme>['MuiSelect'] => ({\n defaultProps: {\n MenuProps: {\n PaperProps: {\n style: {\n boxShadow: theme.customShadows?.overlay,\n marginBottom: theme.spacing(0.5),\n marginTop: theme.spacing(0.5),\n },\n },\n },\n },\n styleOverrides: {\n root: {\n '& .MuiSelect-select': {\n paddingRight: `${theme.spacing(1)} !important`, // Override the default 32px padding-right\n },\n '&.MuiOutlinedInput-root': {\n '& fieldset': {\n border: 'none',\n },\n '&.Mui-disabled fieldset': {\n border: 'none',\n },\n '&.Mui-focused fieldset': {\n border: 'none',\n },\n '&:hover fieldset': {\n border: 'none',\n },\n },\n },\n },\n});\n\nexport default selectOverrides;\n"],"names":["selectOverrides","theme","defaultProps","MenuProps","PaperProps","style","boxShadow","customShadows","overlay","marginBottom","spacing","marginTop","styleOverrides","root","paddingRight","border"],"mappings":"mCAEaA,EAAmBC,IAAY,CAC1CC,aAAc,CACZC,UAAW,CACTC,WAAY,CACVC,MAAO,CACLC,UAAWL,EAAMM,eAAeC,QAChCC,aAAcR,EAAMS,QAAQ,IAC5BC,UAAWV,EAAMS,QAAQ,QAKjCE,eAAgB,CACdC,KAAM,CACJ,sBAAuB,CACrBC,aAAc,GAAGb,EAAMS,QAAQ,iBAEjC,0BAA2B,CACzB,aAAc,CACZK,OAAQ,QAEV,0BAA2B,CACzBA,OAAQ,QAEV,yBAA0B,CACxBA,OAAQ,QAEV,mBAAoB,CAClBA,OAAQ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@mui/material/styles");const e=()=>({styleOverrides:{root:{"& .MuiOutlinedInput-root":{"& fieldset":{border:"none"},"&.Mui-disabled fieldset":{border:"none"},"&.Mui-focused fieldset":{border:"none"},"&:hover fieldset":{border:"none"}}}}});exports.default=e,exports.textFieldOverrides=e;
|
|
2
|
+
//# sourceMappingURL=textFieldOverrides.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textFieldOverrides.cjs.js","sources":["../../../src/themes/overrides/textFieldOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nexport const textFieldOverrides = (): Components<Theme>['MuiTextField'] => ({\n styleOverrides: {\n root: {\n '& .MuiOutlinedInput-root': {\n '& fieldset': {\n border: 'none',\n },\n '&.Mui-disabled fieldset': {\n border: 'none',\n },\n '&.Mui-focused fieldset': {\n border: 'none',\n },\n '&:hover fieldset': {\n border: 'none',\n },\n },\n },\n },\n});\n\nexport default textFieldOverrides;\n"],"names":["textFieldOverrides","styleOverrides","root","border"],"mappings":"oGAEO,MAAMA,EAAqB,KAAA,CAChCC,eAAgB,CACdC,KAAM,CACJ,2BAA4B,CAC1B,aAAc,CACZC,OAAQ,QAEV,0BAA2B,CACzBA,OAAQ,QAEV,yBAA0B,CACxBA,OAAQ,QAEV,mBAAoB,CAClBA,OAAQ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"@mui/material/styles";const e=()=>({styleOverrides:{root:{"& .MuiOutlinedInput-root":{"& fieldset":{border:"none"},"&.Mui-disabled fieldset":{border:"none"},"&.Mui-focused fieldset":{border:"none"},"&:hover fieldset":{border:"none"}}}}});export{e as default,e as textFieldOverrides};
|
|
2
|
+
//# sourceMappingURL=textFieldOverrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textFieldOverrides.js","sources":["../../../src/themes/overrides/textFieldOverrides.ts"],"sourcesContent":["import { type Components, type Theme } from '@mui/material/styles';\n\nexport const textFieldOverrides = (): Components<Theme>['MuiTextField'] => ({\n styleOverrides: {\n root: {\n '& .MuiOutlinedInput-root': {\n '& fieldset': {\n border: 'none',\n },\n '&.Mui-disabled fieldset': {\n border: 'none',\n },\n '&.Mui-focused fieldset': {\n border: 'none',\n },\n '&:hover fieldset': {\n border: 'none',\n },\n },\n },\n },\n});\n\nexport default textFieldOverrides;\n"],"names":["textFieldOverrides","styleOverrides","root","border"],"mappings":"6BAEO,MAAMA,EAAqB,KAAA,CAChCC,eAAgB,CACdC,KAAM,CACJ,2BAA4B,CAC1B,aAAc,CACZC,OAAQ,QAEV,0BAA2B,CACzBA,OAAQ,QAEV,yBAA0B,CACxBA,OAAQ,QAEV,mBAAoB,CAClBA,OAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flipdish/portal-library",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.6",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@types/react-imgix": "^9.5.4",
|
|
89
89
|
"@typescript-eslint/eslint-plugin": "7.18.0",
|
|
90
90
|
"@typescript-eslint/parser": "7.18.0",
|
|
91
|
-
"@vitejs/plugin-react-swc": "3.
|
|
91
|
+
"@vitejs/plugin-react-swc": "3.11.0",
|
|
92
92
|
"chromatic": "^11.25.2",
|
|
93
93
|
"dotenv": "^16.4.5",
|
|
94
94
|
"eslint": "^8.56.0",
|