@flipdish/portal-library 8.5.5 → 8.5.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.
@@ -1,2 +1,2 @@
1
- "use strict";require("@mui/material/styles");var e=require("../../../themes/tokens/typography/font-family.cjs.js"),t=require("../../../themes/tokens/typography/font-size.cjs.js"),i=require("../../../themes/tokens/typography/letter-spacing.cjs.js"),n=require("../../../themes/tokens/typography/line-height.cjs.js");exports.buttonStyleOverrides=o=>({styleOverrides:{root:{textAlign:"center",textTransform:"none",display:"flex",alignItems:"center",justifyContent:"center"},sizeSmall:{height:"32px",padding:"0px 12px",fontStyle:"normal",fontFamily:e.fontFamily.desktop.body,fontSize:t.fontSize.desktop.caption,lineHeight:"normal",letterSpacing:i.letterSpacing.desktop.caption,fontWeight:"600",[o.breakpoints.down("tablet")]:{fontFamily:e.fontFamily.mobile.body,fontSize:t.fontSize.mobile.caption,lineHeight:n.lineHeight.mobile.caption,letterSpacing:i.letterSpacing.mobile.caption}},sizeMedium:{height:"48px",gap:"4px",padding:"0px 16px",fontStyle:"normal",fontFamily:e.fontFamily.desktop.body,fontSize:t.fontSize.desktop.b1,lineHeight:"normal",letterSpacing:i.letterSpacing.desktop.b1,fontWeight:"600",[o.breakpoints.down("tablet")]:{fontFamily:e.fontFamily.mobile.body,fontSize:t.fontSize.mobile.b1,lineHeight:n.lineHeight.mobile.b1,letterSpacing:i.letterSpacing.mobile.b1}},sizeLarge:{height:"64px",display:"flex",alignItems:"center",justifyContent:"center",flex:"1 0 0",alignSelf:"stretch",gap:"4px",padding:"0px 24px",fontStyle:"normal",fontFamily:e.fontFamily.desktop.heading,fontSize:t.fontSize.desktop.h4,lineHeight:"normal",letterSpacing:i.letterSpacing.desktop.h4,fontWeight:"600",[o.breakpoints.down("tablet")]:{fontFamily:e.fontFamily.mobile.heading,fontSize:t.fontSize.mobile.h4,lineHeight:n.lineHeight.mobile.h4,letterSpacing:i.letterSpacing.mobile.h4}}}});
1
+ "use strict";require("@mui/material/styles");var e=require("../../../themes/tokens/typography/font-family.cjs.js"),t=require("../../../themes/tokens/typography/font-size.cjs.js"),i=require("../../../themes/tokens/typography/letter-spacing.cjs.js"),o=require("../../../themes/tokens/typography/line-height.cjs.js");exports.buttonStyleOverrides=n=>({styleOverrides:{root:{textAlign:"center",textTransform:"none",display:"flex",alignItems:"center",justifyContent:"center",'&[data-tone="inverse"] .MuiButton-loadingIndicator .MuiCircularProgress-root':{color:"dark"===n.palette.mode?n.palette.common.black:n.palette.common.white}},sizeSmall:{height:"32px",padding:"0px 12px",fontStyle:"normal",fontFamily:e.fontFamily.desktop.body,fontSize:t.fontSize.desktop.caption,lineHeight:"normal",letterSpacing:i.letterSpacing.desktop.caption,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:e.fontFamily.mobile.body,fontSize:t.fontSize.mobile.caption,lineHeight:o.lineHeight.mobile.caption,letterSpacing:i.letterSpacing.mobile.caption}},sizeMedium:{height:"48px",gap:"4px",padding:"0px 16px",fontStyle:"normal",fontFamily:e.fontFamily.desktop.body,fontSize:t.fontSize.desktop.b1,lineHeight:"normal",letterSpacing:i.letterSpacing.desktop.b1,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:e.fontFamily.mobile.body,fontSize:t.fontSize.mobile.b1,lineHeight:o.lineHeight.mobile.b1,letterSpacing:i.letterSpacing.mobile.b1}},sizeLarge:{height:"64px",display:"flex",alignItems:"center",justifyContent:"center",flex:"1 0 0",alignSelf:"stretch",gap:"4px",padding:"0px 24px",fontStyle:"normal",fontFamily:e.fontFamily.desktop.heading,fontSize:t.fontSize.desktop.h4,lineHeight:"normal",letterSpacing:i.letterSpacing.desktop.h4,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:e.fontFamily.mobile.heading,fontSize:t.fontSize.mobile.h4,lineHeight:o.lineHeight.mobile.h4,letterSpacing:i.letterSpacing.mobile.h4}},loadingIndicator:{"& .MuiCircularProgress-root":{color:n.palette.semantic.text["text-strong"]}}}});
2
2
  //# sourceMappingURL=buttonThemeOverrides.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buttonThemeOverrides.cjs.js","sources":["../../../../src/components/atoms/Button/buttonThemeOverrides.ts"],"sourcesContent":["import { type Theme } from '@mui/material/styles';\n\nimport { fontFamily } from '@fd/themes/tokens/typography/font-family';\nimport { fontSize } from '@fd/themes/tokens/typography/font-size';\nimport { letterSpacing } from '@fd/themes/tokens/typography/letter-spacing';\nimport { lineHeight } from '@fd/themes/tokens/typography/line-height';\n\ninterface ButtonStyleOverrides {\n styleOverrides: {\n root: Record<string, string | { [key: string]: string }>;\n sizeSmall: Record<string, string | { [key: string]: string }>;\n sizeMedium: Record<string, string | { [key: string]: string }>;\n sizeLarge: Record<string, string | { [key: string]: string }>;\n };\n}\n\nexport const buttonStyleOverrides = (baseTheme: Theme): ButtonStyleOverrides => ({\n styleOverrides: {\n root: {\n textAlign: 'center',\n textTransform: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n sizeSmall: {\n height: '32px',\n padding: '0px 12px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSize.desktop.caption,\n lineHeight: 'normal', // normal vs lineHeight.desktop.caption due to mui issue with text alignment https://github.com/mui/material-ui/issues/29965\n letterSpacing: letterSpacing.desktop.caption,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.body,\n fontSize: fontSize.mobile.caption,\n lineHeight: lineHeight.mobile.caption,\n letterSpacing: letterSpacing.mobile.caption,\n },\n },\n sizeMedium: {\n height: '48px',\n gap: '4px',\n padding: '0px 16px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSize.desktop.b1,\n lineHeight: 'normal',\n letterSpacing: letterSpacing.desktop.b1,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.body,\n fontSize: fontSize.mobile.b1,\n lineHeight: lineHeight.mobile.b1,\n letterSpacing: letterSpacing.mobile.b1,\n },\n },\n sizeLarge: {\n height: '64px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flex: '1 0 0',\n alignSelf: 'stretch',\n gap: '4px',\n padding: '0px 24px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.heading,\n fontSize: fontSize.desktop.h4,\n lineHeight: 'normal',\n letterSpacing: letterSpacing.desktop.h4,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.heading,\n fontSize: fontSize.mobile.h4,\n lineHeight: lineHeight.mobile.h4,\n letterSpacing: letterSpacing.mobile.h4,\n },\n },\n },\n});\n"],"names":["baseTheme","styleOverrides","root","textAlign","textTransform","display","alignItems","justifyContent","sizeSmall","height","padding","fontStyle","fontFamily","desktop","body","fontSize","caption","lineHeight","letterSpacing","fontWeight","breakpoints","down","mobile","sizeMedium","gap","b1","sizeLarge","flex","alignSelf","heading","h4"],"mappings":"uVAgBqCA,IAAgB,CACnDC,eAAgB,CACdC,KAAM,CACJC,UAAW,SACXC,cAAe,OACfC,QAAS,OACTC,WAAY,SACZC,eAAgB,UAElBC,UAAW,CACTC,OAAQ,OACRC,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAAA,WAAWC,QAAQC,KAC/BC,SAAUA,EAAAA,SAASF,QAAQG,QAC3BC,WAAY,SACZC,cAAeA,EAAAA,cAAcL,QAAQG,QACrCG,WAAY,MACZ,CAACnB,EAAUoB,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAAA,WAAWU,OAAOR,KAC9BC,SAAUA,EAAAA,SAASO,OAAON,QAC1BC,WAAYA,EAAAA,WAAWK,OAAON,QAC9BE,cAAeA,EAAAA,cAAcI,OAAON,UAGxCO,WAAY,CACVd,OAAQ,OACRe,IAAK,MACLd,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAAA,WAAWC,QAAQC,KAC/BC,SAAUA,EAAAA,SAASF,QAAQY,GAC3BR,WAAY,SACZC,cAAeA,EAAAA,cAAcL,QAAQY,GACrCN,WAAY,MACZ,CAACnB,EAAUoB,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAAA,WAAWU,OAAOR,KAC9BC,SAAUA,EAAAA,SAASO,OAAOG,GAC1BR,WAAYA,EAAAA,WAAWK,OAAOG,GAC9BP,cAAeA,EAAAA,cAAcI,OAAOG,KAGxCC,UAAW,CACTjB,OAAQ,OACRJ,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBoB,KAAM,QACNC,UAAW,UACXJ,IAAK,MACLd,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAAA,WAAWC,QAAQgB,QAC/Bd,SAAUA,EAAAA,SAASF,QAAQiB,GAC3Bb,WAAY,SACZC,cAAeA,EAAAA,cAAcL,QAAQiB,GACrCX,WAAY,MACZ,CAACnB,EAAUoB,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAAA,WAAWU,OAAOO,QAC9Bd,SAAUA,EAAAA,SAASO,OAAOQ,GAC1Bb,WAAYA,EAAAA,WAAWK,OAAOQ,GAC9BZ,cAAeA,EAAAA,cAAcI,OAAOQ"}
1
+ {"version":3,"file":"buttonThemeOverrides.cjs.js","sources":["../../../../src/components/atoms/Button/buttonThemeOverrides.ts"],"sourcesContent":["import { type Theme } from '@mui/material/styles';\n\nimport { fontFamily } from '@fd/themes/tokens/typography/font-family';\nimport { fontSize } from '@fd/themes/tokens/typography/font-size';\nimport { letterSpacing } from '@fd/themes/tokens/typography/letter-spacing';\nimport { lineHeight } from '@fd/themes/tokens/typography/line-height';\n\ninterface ButtonStyleOverrides {\n styleOverrides: {\n root: Record<string, string | { [key: string]: string }>;\n sizeSmall: Record<string, string | { [key: string]: string }>;\n sizeMedium: Record<string, string | { [key: string]: string }>;\n sizeLarge: Record<string, string | { [key: string]: string }>;\n loadingIndicator?: Record<string, string | { [key: string]: string }>;\n };\n}\n\nexport const buttonStyleOverrides = (baseTheme: Theme): ButtonStyleOverrides => ({\n styleOverrides: {\n root: {\n textAlign: 'center',\n textTransform: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n // Inverse tone: spinner white in light mode (dark bg), black in dark mode (light bg)\n '&[data-tone=\"inverse\"] .MuiButton-loadingIndicator .MuiCircularProgress-root': {\n color:\n baseTheme.palette.mode === 'dark' ? baseTheme.palette.common.black : baseTheme.palette.common.white,\n },\n },\n sizeSmall: {\n height: '32px',\n padding: '0px 12px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSize.desktop.caption,\n lineHeight: 'normal', // normal vs lineHeight.desktop.caption due to mui issue with text alignment https://github.com/mui/material-ui/issues/29965\n letterSpacing: letterSpacing.desktop.caption,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.body,\n fontSize: fontSize.mobile.caption,\n lineHeight: lineHeight.mobile.caption,\n letterSpacing: letterSpacing.mobile.caption,\n },\n },\n sizeMedium: {\n height: '48px',\n gap: '4px',\n padding: '0px 16px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSize.desktop.b1,\n lineHeight: 'normal',\n letterSpacing: letterSpacing.desktop.b1,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.body,\n fontSize: fontSize.mobile.b1,\n lineHeight: lineHeight.mobile.b1,\n letterSpacing: letterSpacing.mobile.b1,\n },\n },\n sizeLarge: {\n height: '64px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flex: '1 0 0',\n alignSelf: 'stretch',\n gap: '4px',\n padding: '0px 24px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.heading,\n fontSize: fontSize.desktop.h4,\n lineHeight: 'normal',\n letterSpacing: letterSpacing.desktop.h4,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.heading,\n fontSize: fontSize.mobile.h4,\n lineHeight: lineHeight.mobile.h4,\n letterSpacing: letterSpacing.mobile.h4,\n },\n },\n // Default: loading spinner black in light mode, white in dark mode (inverse overridden on root for data-tone=\"inverse\")\n loadingIndicator: {\n '& .MuiCircularProgress-root': {\n color: baseTheme.palette.semantic.text['text-strong'],\n },\n },\n },\n});\n"],"names":["baseTheme","styleOverrides","root","textAlign","textTransform","display","alignItems","justifyContent","color","palette","mode","common","black","white","sizeSmall","height","padding","fontStyle","fontFamily","desktop","body","fontSize","caption","lineHeight","letterSpacing","fontWeight","breakpoints","down","mobile","sizeMedium","gap","b1","sizeLarge","flex","alignSelf","heading","h4","loadingIndicator","semantic","text"],"mappings":"uVAiBqCA,IAAgB,CACnDC,eAAgB,CACdC,KAAM,CACJC,UAAW,SACXC,cAAe,OACfC,QAAS,OACTC,WAAY,SACZC,eAAgB,SAEhB,+EAAgF,CAC9EC,MAC6B,SAA3BR,EAAUS,QAAQC,KAAkBV,EAAUS,QAAQE,OAAOC,MAAQZ,EAAUS,QAAQE,OAAOE,QAGpGC,UAAW,CACTC,OAAQ,OACRC,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAAA,WAAWC,QAAQC,KAC/BC,SAAUA,EAAAA,SAASF,QAAQG,QAC3BC,WAAY,SACZC,cAAeA,EAAAA,cAAcL,QAAQG,QACrCG,WAAY,MACZ,CAACzB,EAAU0B,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAAA,WAAWU,OAAOR,KAC9BC,SAAUA,EAAAA,SAASO,OAAON,QAC1BC,WAAYA,EAAAA,WAAWK,OAAON,QAC9BE,cAAeA,EAAAA,cAAcI,OAAON,UAGxCO,WAAY,CACVd,OAAQ,OACRe,IAAK,MACLd,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAAA,WAAWC,QAAQC,KAC/BC,SAAUA,EAAAA,SAASF,QAAQY,GAC3BR,WAAY,SACZC,cAAeA,EAAAA,cAAcL,QAAQY,GACrCN,WAAY,MACZ,CAACzB,EAAU0B,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAAA,WAAWU,OAAOR,KAC9BC,SAAUA,EAAAA,SAASO,OAAOG,GAC1BR,WAAYA,EAAAA,WAAWK,OAAOG,GAC9BP,cAAeA,EAAAA,cAAcI,OAAOG,KAGxCC,UAAW,CACTjB,OAAQ,OACRV,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChB0B,KAAM,QACNC,UAAW,UACXJ,IAAK,MACLd,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAAA,WAAWC,QAAQgB,QAC/Bd,SAAUA,EAAAA,SAASF,QAAQiB,GAC3Bb,WAAY,SACZC,cAAeA,EAAAA,cAAcL,QAAQiB,GACrCX,WAAY,MACZ,CAACzB,EAAU0B,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAAA,WAAWU,OAAOO,QAC9Bd,SAAUA,EAAAA,SAASO,OAAOQ,GAC1Bb,WAAYA,EAAAA,WAAWK,OAAOQ,GAC9BZ,cAAeA,EAAAA,cAAcI,OAAOQ,KAIxCC,iBAAkB,CAChB,8BAA+B,CAC7B7B,MAAOR,EAAUS,QAAQ6B,SAASC,KAAK"}
@@ -14,6 +14,9 @@ interface ButtonStyleOverrides {
14
14
  sizeLarge: Record<string, string | {
15
15
  [key: string]: string;
16
16
  }>;
17
+ loadingIndicator?: Record<string, string | {
18
+ [key: string]: string;
19
+ }>;
17
20
  };
18
21
  }
19
22
  declare const buttonStyleOverrides: (baseTheme: Theme) => ButtonStyleOverrides;
@@ -1,2 +1,2 @@
1
- import"@mui/material/styles";import{fontFamily as e}from"../../../themes/tokens/typography/font-family.js";import{fontSize as t}from"../../../themes/tokens/typography/font-size.js";import{letterSpacing as o}from"../../../themes/tokens/typography/letter-spacing.js";import{lineHeight as i}from"../../../themes/tokens/typography/line-height.js";const n=n=>({styleOverrides:{root:{textAlign:"center",textTransform:"none",display:"flex",alignItems:"center",justifyContent:"center"},sizeSmall:{height:"32px",padding:"0px 12px",fontStyle:"normal",fontFamily:e.desktop.body,fontSize:t.desktop.caption,lineHeight:"normal",letterSpacing:o.desktop.caption,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:e.mobile.body,fontSize:t.mobile.caption,lineHeight:i.mobile.caption,letterSpacing:o.mobile.caption}},sizeMedium:{height:"48px",gap:"4px",padding:"0px 16px",fontStyle:"normal",fontFamily:e.desktop.body,fontSize:t.desktop.b1,lineHeight:"normal",letterSpacing:o.desktop.b1,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:e.mobile.body,fontSize:t.mobile.b1,lineHeight:i.mobile.b1,letterSpacing:o.mobile.b1}},sizeLarge:{height:"64px",display:"flex",alignItems:"center",justifyContent:"center",flex:"1 0 0",alignSelf:"stretch",gap:"4px",padding:"0px 24px",fontStyle:"normal",fontFamily:e.desktop.heading,fontSize:t.desktop.h4,lineHeight:"normal",letterSpacing:o.desktop.h4,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:e.mobile.heading,fontSize:t.mobile.h4,lineHeight:i.mobile.h4,letterSpacing:o.mobile.h4}}}});export{n as buttonStyleOverrides};
1
+ import"@mui/material/styles";import{fontFamily as t}from"../../../themes/tokens/typography/font-family.js";import{fontSize as e}from"../../../themes/tokens/typography/font-size.js";import{letterSpacing as o}from"../../../themes/tokens/typography/letter-spacing.js";import{lineHeight as i}from"../../../themes/tokens/typography/line-height.js";const n=n=>({styleOverrides:{root:{textAlign:"center",textTransform:"none",display:"flex",alignItems:"center",justifyContent:"center",'&[data-tone="inverse"] .MuiButton-loadingIndicator .MuiCircularProgress-root':{color:"dark"===n.palette.mode?n.palette.common.black:n.palette.common.white}},sizeSmall:{height:"32px",padding:"0px 12px",fontStyle:"normal",fontFamily:t.desktop.body,fontSize:e.desktop.caption,lineHeight:"normal",letterSpacing:o.desktop.caption,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:t.mobile.body,fontSize:e.mobile.caption,lineHeight:i.mobile.caption,letterSpacing:o.mobile.caption}},sizeMedium:{height:"48px",gap:"4px",padding:"0px 16px",fontStyle:"normal",fontFamily:t.desktop.body,fontSize:e.desktop.b1,lineHeight:"normal",letterSpacing:o.desktop.b1,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:t.mobile.body,fontSize:e.mobile.b1,lineHeight:i.mobile.b1,letterSpacing:o.mobile.b1}},sizeLarge:{height:"64px",display:"flex",alignItems:"center",justifyContent:"center",flex:"1 0 0",alignSelf:"stretch",gap:"4px",padding:"0px 24px",fontStyle:"normal",fontFamily:t.desktop.heading,fontSize:e.desktop.h4,lineHeight:"normal",letterSpacing:o.desktop.h4,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:t.mobile.heading,fontSize:e.mobile.h4,lineHeight:i.mobile.h4,letterSpacing:o.mobile.h4}},loadingIndicator:{"& .MuiCircularProgress-root":{color:n.palette.semantic.text["text-strong"]}}}});export{n as buttonStyleOverrides};
2
2
  //# sourceMappingURL=buttonThemeOverrides.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buttonThemeOverrides.js","sources":["../../../../src/components/atoms/Button/buttonThemeOverrides.ts"],"sourcesContent":["import { type Theme } from '@mui/material/styles';\n\nimport { fontFamily } from '@fd/themes/tokens/typography/font-family';\nimport { fontSize } from '@fd/themes/tokens/typography/font-size';\nimport { letterSpacing } from '@fd/themes/tokens/typography/letter-spacing';\nimport { lineHeight } from '@fd/themes/tokens/typography/line-height';\n\ninterface ButtonStyleOverrides {\n styleOverrides: {\n root: Record<string, string | { [key: string]: string }>;\n sizeSmall: Record<string, string | { [key: string]: string }>;\n sizeMedium: Record<string, string | { [key: string]: string }>;\n sizeLarge: Record<string, string | { [key: string]: string }>;\n };\n}\n\nexport const buttonStyleOverrides = (baseTheme: Theme): ButtonStyleOverrides => ({\n styleOverrides: {\n root: {\n textAlign: 'center',\n textTransform: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n sizeSmall: {\n height: '32px',\n padding: '0px 12px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSize.desktop.caption,\n lineHeight: 'normal', // normal vs lineHeight.desktop.caption due to mui issue with text alignment https://github.com/mui/material-ui/issues/29965\n letterSpacing: letterSpacing.desktop.caption,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.body,\n fontSize: fontSize.mobile.caption,\n lineHeight: lineHeight.mobile.caption,\n letterSpacing: letterSpacing.mobile.caption,\n },\n },\n sizeMedium: {\n height: '48px',\n gap: '4px',\n padding: '0px 16px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSize.desktop.b1,\n lineHeight: 'normal',\n letterSpacing: letterSpacing.desktop.b1,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.body,\n fontSize: fontSize.mobile.b1,\n lineHeight: lineHeight.mobile.b1,\n letterSpacing: letterSpacing.mobile.b1,\n },\n },\n sizeLarge: {\n height: '64px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flex: '1 0 0',\n alignSelf: 'stretch',\n gap: '4px',\n padding: '0px 24px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.heading,\n fontSize: fontSize.desktop.h4,\n lineHeight: 'normal',\n letterSpacing: letterSpacing.desktop.h4,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.heading,\n fontSize: fontSize.mobile.h4,\n lineHeight: lineHeight.mobile.h4,\n letterSpacing: letterSpacing.mobile.h4,\n },\n },\n },\n});\n"],"names":["buttonStyleOverrides","baseTheme","styleOverrides","root","textAlign","textTransform","display","alignItems","justifyContent","sizeSmall","height","padding","fontStyle","fontFamily","desktop","body","fontSize","caption","lineHeight","letterSpacing","fontWeight","breakpoints","down","mobile","sizeMedium","gap","b1","sizeLarge","flex","alignSelf","heading","h4"],"mappings":"6VAgBaA,EAAwBC,IAAgB,CACnDC,eAAgB,CACdC,KAAM,CACJC,UAAW,SACXC,cAAe,OACfC,QAAS,OACTC,WAAY,SACZC,eAAgB,UAElBC,UAAW,CACTC,OAAQ,OACRC,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAWC,QAAQC,KAC/BC,SAAUA,EAASF,QAAQG,QAC3BC,WAAY,SACZC,cAAeA,EAAcL,QAAQG,QACrCG,WAAY,MACZ,CAACnB,EAAUoB,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAWU,OAAOR,KAC9BC,SAAUA,EAASO,OAAON,QAC1BC,WAAYA,EAAWK,OAAON,QAC9BE,cAAeA,EAAcI,OAAON,UAGxCO,WAAY,CACVd,OAAQ,OACRe,IAAK,MACLd,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAWC,QAAQC,KAC/BC,SAAUA,EAASF,QAAQY,GAC3BR,WAAY,SACZC,cAAeA,EAAcL,QAAQY,GACrCN,WAAY,MACZ,CAACnB,EAAUoB,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAWU,OAAOR,KAC9BC,SAAUA,EAASO,OAAOG,GAC1BR,WAAYA,EAAWK,OAAOG,GAC9BP,cAAeA,EAAcI,OAAOG,KAGxCC,UAAW,CACTjB,OAAQ,OACRJ,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBoB,KAAM,QACNC,UAAW,UACXJ,IAAK,MACLd,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAWC,QAAQgB,QAC/Bd,SAAUA,EAASF,QAAQiB,GAC3Bb,WAAY,SACZC,cAAeA,EAAcL,QAAQiB,GACrCX,WAAY,MACZ,CAACnB,EAAUoB,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAWU,OAAOO,QAC9Bd,SAAUA,EAASO,OAAOQ,GAC1Bb,WAAYA,EAAWK,OAAOQ,GAC9BZ,cAAeA,EAAcI,OAAOQ"}
1
+ {"version":3,"file":"buttonThemeOverrides.js","sources":["../../../../src/components/atoms/Button/buttonThemeOverrides.ts"],"sourcesContent":["import { type Theme } from '@mui/material/styles';\n\nimport { fontFamily } from '@fd/themes/tokens/typography/font-family';\nimport { fontSize } from '@fd/themes/tokens/typography/font-size';\nimport { letterSpacing } from '@fd/themes/tokens/typography/letter-spacing';\nimport { lineHeight } from '@fd/themes/tokens/typography/line-height';\n\ninterface ButtonStyleOverrides {\n styleOverrides: {\n root: Record<string, string | { [key: string]: string }>;\n sizeSmall: Record<string, string | { [key: string]: string }>;\n sizeMedium: Record<string, string | { [key: string]: string }>;\n sizeLarge: Record<string, string | { [key: string]: string }>;\n loadingIndicator?: Record<string, string | { [key: string]: string }>;\n };\n}\n\nexport const buttonStyleOverrides = (baseTheme: Theme): ButtonStyleOverrides => ({\n styleOverrides: {\n root: {\n textAlign: 'center',\n textTransform: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n // Inverse tone: spinner white in light mode (dark bg), black in dark mode (light bg)\n '&[data-tone=\"inverse\"] .MuiButton-loadingIndicator .MuiCircularProgress-root': {\n color:\n baseTheme.palette.mode === 'dark' ? baseTheme.palette.common.black : baseTheme.palette.common.white,\n },\n },\n sizeSmall: {\n height: '32px',\n padding: '0px 12px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSize.desktop.caption,\n lineHeight: 'normal', // normal vs lineHeight.desktop.caption due to mui issue with text alignment https://github.com/mui/material-ui/issues/29965\n letterSpacing: letterSpacing.desktop.caption,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.body,\n fontSize: fontSize.mobile.caption,\n lineHeight: lineHeight.mobile.caption,\n letterSpacing: letterSpacing.mobile.caption,\n },\n },\n sizeMedium: {\n height: '48px',\n gap: '4px',\n padding: '0px 16px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSize.desktop.b1,\n lineHeight: 'normal',\n letterSpacing: letterSpacing.desktop.b1,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.body,\n fontSize: fontSize.mobile.b1,\n lineHeight: lineHeight.mobile.b1,\n letterSpacing: letterSpacing.mobile.b1,\n },\n },\n sizeLarge: {\n height: '64px',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flex: '1 0 0',\n alignSelf: 'stretch',\n gap: '4px',\n padding: '0px 24px',\n fontStyle: 'normal',\n fontFamily: fontFamily.desktop.heading,\n fontSize: fontSize.desktop.h4,\n lineHeight: 'normal',\n letterSpacing: letterSpacing.desktop.h4,\n fontWeight: '600',\n [baseTheme.breakpoints.down('tablet')]: {\n fontFamily: fontFamily.mobile.heading,\n fontSize: fontSize.mobile.h4,\n lineHeight: lineHeight.mobile.h4,\n letterSpacing: letterSpacing.mobile.h4,\n },\n },\n // Default: loading spinner black in light mode, white in dark mode (inverse overridden on root for data-tone=\"inverse\")\n loadingIndicator: {\n '& .MuiCircularProgress-root': {\n color: baseTheme.palette.semantic.text['text-strong'],\n },\n },\n },\n});\n"],"names":["buttonStyleOverrides","baseTheme","styleOverrides","root","textAlign","textTransform","display","alignItems","justifyContent","color","palette","mode","common","black","white","sizeSmall","height","padding","fontStyle","fontFamily","desktop","body","fontSize","caption","lineHeight","letterSpacing","fontWeight","breakpoints","down","mobile","sizeMedium","gap","b1","sizeLarge","flex","alignSelf","heading","h4","loadingIndicator","semantic","text"],"mappings":"6VAiBaA,EAAwBC,IAAgB,CACnDC,eAAgB,CACdC,KAAM,CACJC,UAAW,SACXC,cAAe,OACfC,QAAS,OACTC,WAAY,SACZC,eAAgB,SAEhB,+EAAgF,CAC9EC,MAC6B,SAA3BR,EAAUS,QAAQC,KAAkBV,EAAUS,QAAQE,OAAOC,MAAQZ,EAAUS,QAAQE,OAAOE,QAGpGC,UAAW,CACTC,OAAQ,OACRC,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAWC,QAAQC,KAC/BC,SAAUA,EAASF,QAAQG,QAC3BC,WAAY,SACZC,cAAeA,EAAcL,QAAQG,QACrCG,WAAY,MACZ,CAACzB,EAAU0B,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAWU,OAAOR,KAC9BC,SAAUA,EAASO,OAAON,QAC1BC,WAAYA,EAAWK,OAAON,QAC9BE,cAAeA,EAAcI,OAAON,UAGxCO,WAAY,CACVd,OAAQ,OACRe,IAAK,MACLd,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAWC,QAAQC,KAC/BC,SAAUA,EAASF,QAAQY,GAC3BR,WAAY,SACZC,cAAeA,EAAcL,QAAQY,GACrCN,WAAY,MACZ,CAACzB,EAAU0B,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAWU,OAAOR,KAC9BC,SAAUA,EAASO,OAAOG,GAC1BR,WAAYA,EAAWK,OAAOG,GAC9BP,cAAeA,EAAcI,OAAOG,KAGxCC,UAAW,CACTjB,OAAQ,OACRV,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChB0B,KAAM,QACNC,UAAW,UACXJ,IAAK,MACLd,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAWC,QAAQgB,QAC/Bd,SAAUA,EAASF,QAAQiB,GAC3Bb,WAAY,SACZC,cAAeA,EAAcL,QAAQiB,GACrCX,WAAY,MACZ,CAACzB,EAAU0B,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAWU,OAAOO,QAC9Bd,SAAUA,EAASO,OAAOQ,GAC1Bb,WAAYA,EAAWK,OAAOQ,GAC9BZ,cAAeA,EAAcI,OAAOQ,KAIxCC,iBAAkB,CAChB,8BAA+B,CAC7B7B,MAAOR,EAAUS,QAAQ6B,SAASC,KAAK"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@mui/material/styles");module.exports=(t,r="primary",o="brand")=>{const a="light"===t.palette.mode,s={generic:{focus:{outlineOffset:"2px",outline:`2px solid ${t.palette.semantic.stroke["stroke-focus"]}`,transition:"none"}},primary:{brand:{default:{backgroundColor:t.palette.semantic.fill["fill-primary-strong"],color:t.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:t.customShadows?.raised},hover:{backgroundColor:a?e.darken(t.palette.semantic.fill["fill-primary-strong"],.1):e.lighten(t.palette.semantic.fill["fill-primary-strong"],.1),color:t.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:t.customShadows?.raised},press:{backgroundColor:a?e.darken(t.palette.semantic.fill["fill-primary-strong"],.2):e.lighten(t.palette.semantic.fill["fill-primary-strong"],.2),color:t.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:t.customShadows?.raised},disabled:{backgroundColor:t.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed"}},neutral:{default:{borderRadius:t.radius["radius-8"],backgroundColor:t.palette.semantic.fill["fill-strong"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.lighten(t.palette.semantic.fill["fill-strong"],.1):e.darken(t.palette.semantic.fill["fill-strong"],.1),color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.lighten(t.palette.semantic.fill["fill-strong"],.2):e.darken(t.palette.semantic.fill["fill-strong"],.2),color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},disabled:{backgroundColor:t.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},inverse:{default:{borderRadius:t.radius["radius-8"],backgroundColor:t.palette.semantic.fill["fill-inverse-strong"],color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.darken(t.palette.semantic.fill["fill-inverse-strong"],.1):e.lighten(t.palette.semantic.fill["fill-inverse-strong"],.1),color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.darken(t.palette.semantic.fill["fill-inverse-strong"],.2):e.lighten(t.palette.semantic.fill["fill-inverse-strong"],.2),color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},focus:{borderRadius:t.radius["radius-8"],outlineOffset:"2px",outline:`2px solid ${a?e.lighten(t.palette.semantic.stroke["stroke-inverse-strong"],.4):e.darken(t.palette.semantic.stroke["stroke-inverse-strong"],.4)}`,transition:"none"},disabled:{backgroundColor:t.palette.semantic.fill["fill-inverse-disabled"],color:t.palette.semantic.text["text-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},destructive:{default:{borderRadius:t.radius["radius-8"],backgroundColor:t.palette.semantic.fill["fill-error-strong"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.darken(t.palette.semantic.fill["fill-error-strong"],.1):e.lighten(t.palette.semantic.fill["fill-error-strong"],.1),color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.darken(t.palette.semantic.fill["fill-error-strong"],.2):e.lighten(t.palette.semantic.fill["fill-error-strong"],.2),color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},disabled:{backgroundColor:t.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}},secondary:{brand:{default:{border:`1px solid ${t.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:t.radius["radius-8"],backgroundColor:"transparent",color:t.palette.semantic.text["text-primary"],boxShadow:t.customShadows?.raised},hover:{border:`1px solid ${t.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:t.radius["radius-8"],backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-primary"],boxShadow:t.customShadows?.raised},press:{border:`1px solid ${t.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:t.radius["radius-8"],backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-primary"],boxShadow:t.customShadows?.raised},disabled:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-disabled"]}`,backgroundColor:t.palette.semantic.fill["fill-white"],color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},neutral:{default:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-strong"]}`,color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},disabled:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-disabled"]}`,backgroundColor:t.palette.semantic.fill["fill-white"],color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},inverse:{default:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:"transparent",color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-inverse-hover"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-inverse-press"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},disabled:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-inverse-disabled"]}`,backgroundColor:t.palette.semantic.fill["fill-inverse-hover"],color:t.palette.semantic.stroke["stroke-inverse-disabled"],boxShadow:"none",cursor:"not-allowed"}},destructive:{default:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:"transparent",color:t.palette.semantic.text["text-error"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-error"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-error"],boxShadow:t.customShadows?.raised},disabled:{backgroundColor:t.palette.semantic.fill["fill-white"],border:`1px solid ${t.palette.semantic.stroke["stroke-disabled"]}`,color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}},tertiary:{brand:{default:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:t.palette.semantic.text["text-primary"],boxShadow:"none"},hover:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-primary"],boxShadow:"none"},press:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-primary"],boxShadow:"none"},disabled:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-white"],color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},neutral:{default:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:t.palette.semantic.text["text-strong"],boxShadow:"none"},hover:{backgroundColor:t.palette.semantic.fill["fill-hover"],borderColor:t.palette.semantic.stroke["stroke-strong"],color:t.palette.semantic.text["text-strong"],boxShadow:"none"},press:{backgroundColor:t.palette.semantic.fill["fill-press"],borderColor:t.palette.semantic.stroke["stroke-strong"],color:t.palette.semantic.text["text-strong"],boxShadow:"none"},disabled:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-white"],color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},inverse:{default:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},hover:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-inverse-hover"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},press:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-inverse-press"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},disabled:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-strong"],color:t.palette.semantic.stroke["stroke-inverse-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"},focus:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-inverse-hover"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none"}},destructive:{default:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:t.palette.semantic.text["text-error"],boxShadow:"none"},hover:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-error"],boxShadow:"none"},press:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-error"],boxShadow:"none"},disabled:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-white"],color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}}};return{...s.generic,...s[r][o]}};
1
+ "use strict";var e=require("@mui/material/styles");module.exports=(t,r="primary",o="brand")=>{const a="light"===t.palette.mode,s={generic:{focus:{outlineOffset:"2px",outline:`2px solid ${t.palette.semantic.stroke["stroke-focus"]}`,transition:"none"}},primary:{brand:{default:{backgroundColor:t.palette.semantic.fill["fill-primary-strong"],color:t.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:t.customShadows?.raised},hover:{backgroundColor:a?e.darken(t.palette.semantic.fill["fill-primary-strong"],.1):e.lighten(t.palette.semantic.fill["fill-primary-strong"],.1),color:t.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:t.customShadows?.raised},press:{backgroundColor:a?e.darken(t.palette.semantic.fill["fill-primary-strong"],.2):e.lighten(t.palette.semantic.fill["fill-primary-strong"],.2),color:t.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:t.customShadows?.raised},disabled:{backgroundColor:t.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},neutral:{default:{borderRadius:t.radius["radius-8"],backgroundColor:t.palette.semantic.fill["fill-strong"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.lighten(t.palette.semantic.fill["fill-strong"],.1):e.darken(t.palette.semantic.fill["fill-strong"],.1),color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.lighten(t.palette.semantic.fill["fill-strong"],.2):e.darken(t.palette.semantic.fill["fill-strong"],.2),color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},disabled:{backgroundColor:t.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},inverse:{default:{borderRadius:t.radius["radius-8"],backgroundColor:t.palette.semantic.fill["fill-inverse-strong"],color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.darken(t.palette.semantic.fill["fill-inverse-strong"],.1):e.lighten(t.palette.semantic.fill["fill-inverse-strong"],.1),color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.darken(t.palette.semantic.fill["fill-inverse-strong"],.2):e.lighten(t.palette.semantic.fill["fill-inverse-strong"],.2),color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},focus:{borderRadius:t.radius["radius-8"],outlineOffset:"2px",outline:`2px solid ${a?e.lighten(t.palette.semantic.stroke["stroke-inverse-strong"],.4):e.darken(t.palette.semantic.stroke["stroke-inverse-strong"],.4)}`,transition:"none"},disabled:{backgroundColor:t.palette.semantic.fill["fill-inverse-disabled"],color:t.palette.semantic.text["text-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},destructive:{default:{borderRadius:t.radius["radius-8"],backgroundColor:t.palette.semantic.fill["fill-error-strong"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.darken(t.palette.semantic.fill["fill-error-strong"],.1):e.lighten(t.palette.semantic.fill["fill-error-strong"],.1),color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],backgroundColor:a?e.darken(t.palette.semantic.fill["fill-error-strong"],.2):e.lighten(t.palette.semantic.fill["fill-error-strong"],.2),color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},disabled:{backgroundColor:t.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}},secondary:{brand:{default:{border:`1px solid ${t.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:t.radius["radius-8"],backgroundColor:"transparent",color:t.palette.semantic.text["text-primary"],boxShadow:t.customShadows?.raised},hover:{border:`1px solid ${t.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:t.radius["radius-8"],backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-primary"],boxShadow:t.customShadows?.raised},press:{border:`1px solid ${t.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:t.radius["radius-8"],backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-primary"],boxShadow:t.customShadows?.raised},disabled:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-disabled"]}`,backgroundColor:"transparent",color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},neutral:{default:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-strong"]}`,color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-strong"],boxShadow:t.customShadows?.raised},disabled:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-disabled"]}`,backgroundColor:"transparent",color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},inverse:{default:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:"transparent",color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-inverse-hover"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-inverse-press"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:t.customShadows?.raised},disabled:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-inverse-disabled"]}`,backgroundColor:t.palette.semantic.fill["fill-inverse-hover"],color:t.palette.semantic.stroke["stroke-inverse-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},destructive:{default:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:"transparent",color:t.palette.semantic.text["text-error"],boxShadow:t.customShadows?.raised},hover:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-error"],boxShadow:t.customShadows?.raised},press:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-error"],boxShadow:t.customShadows?.raised},disabled:{backgroundColor:"transparent",border:`1px solid ${t.palette.semantic.stroke["stroke-disabled"]}`,color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}},tertiary:{brand:{default:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:t.palette.semantic.text["text-primary"],boxShadow:"none"},hover:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-primary"],boxShadow:"none"},press:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-primary"],boxShadow:"none"},disabled:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:"transparent",color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto",textDecoration:"underline"}},neutral:{default:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:t.palette.semantic.text["text-strong"],boxShadow:"none"},hover:{backgroundColor:t.palette.semantic.fill["fill-hover"],borderColor:t.palette.semantic.stroke["stroke-strong"],color:t.palette.semantic.text["text-strong"],boxShadow:"none"},press:{backgroundColor:t.palette.semantic.fill["fill-press"],borderColor:t.palette.semantic.stroke["stroke-strong"],color:t.palette.semantic.text["text-strong"],boxShadow:"none"},disabled:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:"transparent",color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",textDecoration:"underline",pointerEvents:"auto"}},inverse:{default:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},hover:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-inverse-hover"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},press:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-inverse-press"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},disabled:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-strong"],color:t.palette.semantic.stroke["stroke-inverse-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto",textDecoration:"underline"},focus:{borderRadius:t.radius["radius-8"],border:`1px solid ${t.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:t.palette.semantic.fill["fill-inverse-hover"],color:t.palette.semantic.text["text-inverse-strong"],boxShadow:"none"}},destructive:{default:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:t.palette.semantic.text["text-error"],boxShadow:"none"},hover:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-hover"],color:t.palette.semantic.text["text-error"],boxShadow:"none"},press:{borderRadius:t.radius["radius-8"],border:"none",backgroundColor:t.palette.semantic.fill["fill-press"],color:t.palette.semantic.text["text-error"],boxShadow:"none"},disabled:{borderRadius:t.radius["radius-8"],textDecoration:"underline",border:"none",backgroundColor:"transparent",color:t.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}}};return{...s.generic,...s[r][o]}};
2
2
  //# sourceMappingURL=getButtonStyles.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getButtonStyles.cjs.js","sources":["../../../../src/components/atoms/Button/getButtonStyles.ts"],"sourcesContent":["import { darken, lighten, type Theme } from '@mui/material/styles';\n\nexport type ButtonType = 'primary' | 'secondary' | 'tertiary';\nexport type ButtonTone = 'brand' | 'destructive' | 'inverse' | 'neutral' | undefined;\ntype ButtonState = 'default' | 'disabled' | 'focus' | 'hover' | 'press';\n\ninterface StyleObject {\n [property: string]: number | string | undefined;\n}\n\ntype ButtonStyles = {\n [state in ButtonState]?: StyleObject;\n};\nconst getButtonStyles = (theme: Theme, variant: ButtonType = 'primary', tone: ButtonTone = 'brand'): ButtonStyles => {\n const isLight = theme.palette.mode === 'light';\n const variants = {\n generic: {\n focus: {\n outlineOffset: '2px',\n outline: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n transition: 'none',\n },\n },\n primary: {\n brand: {\n default: {\n backgroundColor: theme.palette.semantic.fill['fill-primary-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-primary-strong'], 0.1) : lighten(theme.palette.semantic.fill['fill-primary-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised\n },\n press: {\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-primary-strong'], 0.2) : lighten(theme.palette.semantic.fill['fill-primary-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? lighten(theme.palette.semantic.fill['fill-strong'], 0.1) : darken(theme.palette.semantic.fill['fill-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? lighten(theme.palette.semantic.fill['fill-strong'], 0.2) : darken(theme.palette.semantic.fill['fill-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-inverse-strong'], 0.1) : lighten(theme.palette.semantic.fill['fill-inverse-strong'], 0.1),\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-inverse-strong'], 0.2) : lighten(theme.palette.semantic.fill['fill-inverse-strong'], 0.2),\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n focus: {\n borderRadius: theme.radius['radius-8'],\n outlineOffset: '2px',\n outline: `2px solid ${isLight ? lighten(theme.palette.semantic.stroke['stroke-inverse-strong'], 0.4) : darken(theme.palette.semantic.stroke['stroke-inverse-strong'], 0.4)}`,\n transition: 'none',\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-inverse-disabled'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-error-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-error-strong'], 0.1) : lighten(theme.palette.semantic.fill['fill-error-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-error-strong'], 0.2) : lighten(theme.palette.semantic.fill['fill-error-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n secondary: {\n brand: {\n default: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-press'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-disabled']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.stroke['stroke-inverse-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n\n tertiary: {\n brand: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none'\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none'\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none'\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none'\n },\n hover: {\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n borderColor: theme.palette.semantic.stroke['stroke-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none'\n },\n press: {\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n borderColor: theme.palette.semantic.stroke['stroke-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none'\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border:'none',\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none'\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none'\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-inverse-press'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none'\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-strong'],\n color: theme.palette.semantic.stroke['stroke-inverse-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n focus: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none'\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none',\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none'\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none'\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n };\n return { ...variants.generic, ...variants[variant][tone] };\n};\n\nexport default getButtonStyles;\n"],"names":["theme","variant","tone","isLight","palette","mode","variants","generic","focus","outlineOffset","outline","semantic","stroke","transition","primary","brand","default","backgroundColor","fill","color","text","borderRadius","boxShadow","customShadows","raised","hover","darken","lighten","press","disabled","borderColor","cursor","neutral","radius","pointerEvents","inverse","destructive","secondary","border","tertiary","textDecoration","textUnderlineOffset","textUnderlinePosition"],"mappings":"kEAawB,CAACA,EAAcC,EAAsB,UAAWC,EAAmB,WACzF,MAAMC,EAAiC,UAAvBH,EAAMI,QAAQC,KACxBC,EAAW,CACfC,QAAS,CACPC,MAAO,CACLC,cAAe,MACfC,QAAS,aAAaV,EAAMI,QAAQO,SAASC,OAAO,kBACpDC,WAAY,SAGhBC,QAAS,CACPC,MAAO,CACLC,QAAS,CACPC,gBAAiBjB,EAAMI,QAAQO,SAASO,KAAK,uBAC7CC,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,uBACnCC,aAAc,MACdC,UAAWtB,EAAMuB,eAAeC,Q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AC7CC,MAAOnB,EAAMI,QAAQO,SAASC,OAAO,2BACrCU,UAAW,OACXS,OAAQ,cACRG,cAAe,QAEjB1B,MAAO,CACLa,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,aAAatC,EAAMI,QAAQO,SAASC,OAAO,2BACnDK,gBAAiBjB,EAAMI,QAAQO,SAASO,KAAK,sBAC7CC,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,uBACnCE,UAAW,SAGfc,YAAa,CACXpB,QAAS,CACPK,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,OACRrB,gBAAiB,cACjBuB,eAAgB,YAChBC,oBAAqB,MACrBC,sBAAuB,YACvBvB,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,cACnCE,UAAW,QAEbG,MAAO,CACLJ,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,OACRrB,gBAAiBjB,EAAMI,QAAQO,SAASO,KAAK,cAC7CC,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,cACnCE,UAAW,QAEbM,MAAO,CACLP,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,OACRrB,gBAAiBjB,EAAMI,QAAQO,SAASO,KAAK,cAC7CC,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,cACnCE,UAAW,QAEbO,SAAU,CACRR,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,OACRrB,gBAAiBjB,EAAMI,QAAQO,SAASO,KAAK,cAC7CC,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,iBACnCE,UAAW,OACXS,OAAQ,cACRG,cAAe,WAKvB,MAAO,IAAK5B,EAASC,WAAYD,EAASL,GAASC"}
1
+ {"version":3,"file":"getButtonStyles.cjs.js","sources":["../../../../src/components/atoms/Button/getButtonStyles.ts"],"sourcesContent":["import { darken, lighten, type Theme } from '@mui/material/styles';\n\nexport type ButtonType = 'primary' | 'secondary' | 'tertiary';\nexport type ButtonTone = 'brand' | 'destructive' | 'inverse' | 'neutral' | undefined;\ntype ButtonState = 'default' | 'disabled' | 'focus' | 'hover' | 'press';\n\ninterface StyleObject {\n [property: string]: number | string | undefined;\n}\n\ntype ButtonStyles = {\n [state in ButtonState]?: StyleObject;\n};\nconst getButtonStyles = (\n theme: Theme,\n variant: ButtonType = 'primary',\n tone: ButtonTone = 'brand',\n): ButtonStyles => {\n const isLight = theme.palette.mode === 'light';\n const variants = {\n generic: {\n focus: {\n outlineOffset: '2px',\n outline: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n transition: 'none',\n },\n },\n primary: {\n brand: {\n default: {\n backgroundColor: theme.palette.semantic.fill['fill-primary-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-primary-strong'], 0.1)\n : lighten(theme.palette.semantic.fill['fill-primary-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-primary-strong'], 0.2)\n : lighten(theme.palette.semantic.fill['fill-primary-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? lighten(theme.palette.semantic.fill['fill-strong'], 0.1)\n : darken(theme.palette.semantic.fill['fill-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? lighten(theme.palette.semantic.fill['fill-strong'], 0.2)\n : darken(theme.palette.semantic.fill['fill-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-inverse-strong'], 0.1)\n : lighten(theme.palette.semantic.fill['fill-inverse-strong'], 0.1),\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-inverse-strong'], 0.2)\n : lighten(theme.palette.semantic.fill['fill-inverse-strong'], 0.2),\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n focus: {\n borderRadius: theme.radius['radius-8'],\n outlineOffset: '2px',\n outline: `2px solid ${isLight ? lighten(theme.palette.semantic.stroke['stroke-inverse-strong'], 0.4) : darken(theme.palette.semantic.stroke['stroke-inverse-strong'], 0.4)}`,\n transition: 'none',\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-inverse-disabled'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-error-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-error-strong'], 0.1)\n : lighten(theme.palette.semantic.fill['fill-error-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-error-strong'], 0.2)\n : lighten(theme.palette.semantic.fill['fill-error-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n secondary: {\n brand: {\n default: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-press'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-disabled']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.stroke['stroke-inverse-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n backgroundColor: 'transparent',\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n\n tertiary: {\n brand: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none',\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none',\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none',\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n textDecoration: 'underline',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none',\n },\n hover: {\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n borderColor: theme.palette.semantic.stroke['stroke-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none',\n },\n press: {\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n borderColor: theme.palette.semantic.stroke['stroke-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none',\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n textDecoration: 'underline',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-inverse-press'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-strong'],\n color: theme.palette.semantic.stroke['stroke-inverse-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n textDecoration: 'underline',\n },\n focus: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none',\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none',\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none',\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n textDecoration: 'underline',\n border: 'none',\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n };\n return { ...variants.generic, ...variants[variant][tone] };\n};\n\nexport default getButtonStyles;\n"],"names":["theme","variant","tone","isLight","palette","mode","variants","generic","focus","outlineOffset","outline","semantic","stroke","transition","primary","brand","default","backgroundColor","fill","color","text","borderRadius","boxShadow","customShadows","raised","hover","darken","lighten","press","disabled","borderColor","cursor","pointerEvents","neutral","radius","inverse","destructive","secondary","border","tertiary","textDecoration","textUnderlineOffset","textUnderlinePosition"],"mappings":"kEAawB,CACtBA,EACAC,EAAsB,UACtBC,EAAmB,WAEnB,MAAMC,EAAiC,UAAvBH,EAAMI,QAAQC,KACxBC,EAAW,CACfC,QAAS,CACPC,M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 -1,2 +1,2 @@
1
- import{darken as e,lighten as t}from"@mui/material/styles";const o=(o,r="primary",a="brand")=>{const s="light"===o.palette.mode,i={generic:{focus:{outlineOffset:"2px",outline:`2px solid ${o.palette.semantic.stroke["stroke-focus"]}`,transition:"none"}},primary:{brand:{default:{backgroundColor:o.palette.semantic.fill["fill-primary-strong"],color:o.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:o.customShadows?.raised},hover:{backgroundColor:s?e(o.palette.semantic.fill["fill-primary-strong"],.1):t(o.palette.semantic.fill["fill-primary-strong"],.1),color:o.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:o.customShadows?.raised},press:{backgroundColor:s?e(o.palette.semantic.fill["fill-primary-strong"],.2):t(o.palette.semantic.fill["fill-primary-strong"],.2),color:o.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:o.customShadows?.raised},disabled:{backgroundColor:o.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:o.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed"}},neutral:{default:{borderRadius:o.radius["radius-8"],backgroundColor:o.palette.semantic.fill["fill-strong"],color:o.palette.semantic.text["text-inverse-strong"],boxShadow:o.customShadows?.raised},hover:{borderRadius:o.radius["radius-8"],backgroundColor:s?t(o.palette.semantic.fill["fill-strong"],.1):e(o.palette.semantic.fill["fill-strong"],.1),color:o.palette.semantic.text["text-inverse-strong"],boxShadow:o.customShadows?.raised},press:{borderRadius:o.radius["radius-8"],backgroundColor:s?t(o.palette.semantic.fill["fill-strong"],.2):e(o.palette.semantic.fill["fill-strong"],.2),color:o.palette.semantic.text["text-inverse-strong"],boxShadow:o.customShadows?.raised},disabled:{backgroundColor:o.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:o.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},inverse:{default:{borderRadius:o.radius["radius-8"],backgroundColor:o.palette.semantic.fill["fill-inverse-strong"],color:o.palette.semantic.text["text-strong"],boxShadow:o.customShadows?.raised},hover:{borderRadius:o.radius["radius-8"],backgroundColor:s?e(o.palette.semantic.fill["fill-inverse-strong"],.1):t(o.palette.semantic.fill["fill-inverse-strong"],.1),color:o.palette.semantic.text["text-strong"],boxShadow:o.customShadows?.raised},press:{borderRadius:o.radius["radius-8"],backgroundColor:s?e(o.palette.semantic.fill["fill-inverse-strong"],.2):t(o.palette.semantic.fill["fill-inverse-strong"],.2),color:o.palette.semantic.text["text-strong"],boxShadow:o.customShadows?.raised},focus:{borderRadius:o.radius["radius-8"],outlineOffset:"2px",outline:`2px solid ${s?t(o.palette.semantic.stroke["stroke-inverse-strong"],.4):e(o.palette.semantic.stroke["stroke-inverse-strong"],.4)}`,transition:"none"},disabled:{backgroundColor:o.palette.semantic.fill["fill-inverse-disabled"],color:o.palette.semantic.text["text-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},destructive:{default:{borderRadius:o.radius["radius-8"],backgroundColor:o.palette.semantic.fill["fill-error-strong"],color:o.palette.semantic.text["text-inverse-strong"],boxShadow:o.customShadows?.raised},hover:{borderRadius:o.radius["radius-8"],backgroundColor:s?e(o.palette.semantic.fill["fill-error-strong"],.1):t(o.palette.semantic.fill["fill-error-strong"],.1),color:o.palette.semantic.text["text-inverse-strong"],boxShadow:o.customShadows?.raised},press:{borderRadius:o.radius["radius-8"],backgroundColor:s?e(o.palette.semantic.fill["fill-error-strong"],.2):t(o.palette.semantic.fill["fill-error-strong"],.2),color:o.palette.semantic.text["text-inverse-strong"],boxShadow:o.customShadows?.raised},disabled:{backgroundColor:o.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:o.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}},secondary:{brand:{default:{border:`1px solid ${o.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:o.radius["radius-8"],backgroundColor:"transparent",color:o.palette.semantic.text["text-primary"],boxShadow:o.customShadows?.raised},hover:{border:`1px solid ${o.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:o.radius["radius-8"],backgroundColor:o.palette.semantic.fill["fill-hover"],color:o.palette.semantic.text["text-primary"],boxShadow:o.customShadows?.raised},press:{border:`1px solid ${o.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:o.radius["radius-8"],backgroundColor:o.palette.semantic.fill["fill-press"],color:o.palette.semantic.text["text-primary"],boxShadow:o.customShadows?.raised},disabled:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-disabled"]}`,backgroundColor:o.palette.semantic.fill["fill-white"],color:o.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},neutral:{default:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-strong"]}`,color:o.palette.semantic.text["text-strong"],boxShadow:o.customShadows?.raised},hover:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-strong"]}`,backgroundColor:o.palette.semantic.fill["fill-hover"],color:o.palette.semantic.text["text-strong"],boxShadow:o.customShadows?.raised},press:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-strong"]}`,backgroundColor:o.palette.semantic.fill["fill-press"],color:o.palette.semantic.text["text-strong"],boxShadow:o.customShadows?.raised},disabled:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-disabled"]}`,backgroundColor:o.palette.semantic.fill["fill-white"],color:o.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},inverse:{default:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:"transparent",color:o.palette.semantic.text["text-inverse-strong"],boxShadow:o.customShadows?.raised},hover:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:o.palette.semantic.fill["fill-inverse-hover"],color:o.palette.semantic.text["text-inverse-strong"],boxShadow:o.customShadows?.raised},press:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:o.palette.semantic.fill["fill-inverse-press"],color:o.palette.semantic.text["text-inverse-strong"],boxShadow:o.customShadows?.raised},disabled:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-inverse-disabled"]}`,backgroundColor:o.palette.semantic.fill["fill-inverse-hover"],color:o.palette.semantic.stroke["stroke-inverse-disabled"],boxShadow:"none",cursor:"not-allowed"}},destructive:{default:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:"transparent",color:o.palette.semantic.text["text-error"],boxShadow:o.customShadows?.raised},hover:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:o.palette.semantic.fill["fill-hover"],color:o.palette.semantic.text["text-error"],boxShadow:o.customShadows?.raised},press:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:o.palette.semantic.fill["fill-press"],color:o.palette.semantic.text["text-error"],boxShadow:o.customShadows?.raised},disabled:{backgroundColor:o.palette.semantic.fill["fill-white"],border:`1px solid ${o.palette.semantic.stroke["stroke-disabled"]}`,color:o.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}},tertiary:{brand:{default:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:o.palette.semantic.text["text-primary"],boxShadow:"none"},hover:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:o.palette.semantic.fill["fill-hover"],color:o.palette.semantic.text["text-primary"],boxShadow:"none"},press:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:o.palette.semantic.fill["fill-press"],color:o.palette.semantic.text["text-primary"],boxShadow:"none"},disabled:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:o.palette.semantic.fill["fill-white"],color:o.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},neutral:{default:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:o.palette.semantic.text["text-strong"],boxShadow:"none"},hover:{backgroundColor:o.palette.semantic.fill["fill-hover"],borderColor:o.palette.semantic.stroke["stroke-strong"],color:o.palette.semantic.text["text-strong"],boxShadow:"none"},press:{backgroundColor:o.palette.semantic.fill["fill-press"],borderColor:o.palette.semantic.stroke["stroke-strong"],color:o.palette.semantic.text["text-strong"],boxShadow:"none"},disabled:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:o.palette.semantic.fill["fill-white"],color:o.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},inverse:{default:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:o.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},hover:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:o.palette.semantic.fill["fill-inverse-hover"],color:o.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},press:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:o.palette.semantic.fill["fill-inverse-press"],color:o.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},disabled:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:o.palette.semantic.fill["fill-strong"],color:o.palette.semantic.stroke["stroke-inverse-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"},focus:{borderRadius:o.radius["radius-8"],border:`1px solid ${o.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:o.palette.semantic.fill["fill-inverse-hover"],color:o.palette.semantic.text["text-inverse-strong"],boxShadow:"none"}},destructive:{default:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:o.palette.semantic.text["text-error"],boxShadow:"none"},hover:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:o.palette.semantic.fill["fill-hover"],color:o.palette.semantic.text["text-error"],boxShadow:"none"},press:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:o.palette.semantic.fill["fill-press"],color:o.palette.semantic.text["text-error"],boxShadow:"none"},disabled:{borderRadius:o.radius["radius-8"],border:"none",backgroundColor:o.palette.semantic.fill["fill-white"],color:o.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}}};return{...i.generic,...i[r][a]}};export{o as default};
1
+ import{darken as e,lighten as t}from"@mui/material/styles";const r=(r,o="primary",a="brand")=>{const s="light"===r.palette.mode,i={generic:{focus:{outlineOffset:"2px",outline:`2px solid ${r.palette.semantic.stroke["stroke-focus"]}`,transition:"none"}},primary:{brand:{default:{backgroundColor:r.palette.semantic.fill["fill-primary-strong"],color:r.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:r.customShadows?.raised},hover:{backgroundColor:s?e(r.palette.semantic.fill["fill-primary-strong"],.1):t(r.palette.semantic.fill["fill-primary-strong"],.1),color:r.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:r.customShadows?.raised},press:{backgroundColor:s?e(r.palette.semantic.fill["fill-primary-strong"],.2):t(r.palette.semantic.fill["fill-primary-strong"],.2),color:r.palette.semantic.text["text-inverse-strong"],borderRadius:"8px",boxShadow:r.customShadows?.raised},disabled:{backgroundColor:r.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:r.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},neutral:{default:{borderRadius:r.radius["radius-8"],backgroundColor:r.palette.semantic.fill["fill-strong"],color:r.palette.semantic.text["text-inverse-strong"],boxShadow:r.customShadows?.raised},hover:{borderRadius:r.radius["radius-8"],backgroundColor:s?t(r.palette.semantic.fill["fill-strong"],.1):e(r.palette.semantic.fill["fill-strong"],.1),color:r.palette.semantic.text["text-inverse-strong"],boxShadow:r.customShadows?.raised},press:{borderRadius:r.radius["radius-8"],backgroundColor:s?t(r.palette.semantic.fill["fill-strong"],.2):e(r.palette.semantic.fill["fill-strong"],.2),color:r.palette.semantic.text["text-inverse-strong"],boxShadow:r.customShadows?.raised},disabled:{backgroundColor:r.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:r.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},inverse:{default:{borderRadius:r.radius["radius-8"],backgroundColor:r.palette.semantic.fill["fill-inverse-strong"],color:r.palette.semantic.text["text-strong"],boxShadow:r.customShadows?.raised},hover:{borderRadius:r.radius["radius-8"],backgroundColor:s?e(r.palette.semantic.fill["fill-inverse-strong"],.1):t(r.palette.semantic.fill["fill-inverse-strong"],.1),color:r.palette.semantic.text["text-strong"],boxShadow:r.customShadows?.raised},press:{borderRadius:r.radius["radius-8"],backgroundColor:s?e(r.palette.semantic.fill["fill-inverse-strong"],.2):t(r.palette.semantic.fill["fill-inverse-strong"],.2),color:r.palette.semantic.text["text-strong"],boxShadow:r.customShadows?.raised},focus:{borderRadius:r.radius["radius-8"],outlineOffset:"2px",outline:`2px solid ${s?t(r.palette.semantic.stroke["stroke-inverse-strong"],.4):e(r.palette.semantic.stroke["stroke-inverse-strong"],.4)}`,transition:"none"},disabled:{backgroundColor:r.palette.semantic.fill["fill-inverse-disabled"],color:r.palette.semantic.text["text-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},destructive:{default:{borderRadius:r.radius["radius-8"],backgroundColor:r.palette.semantic.fill["fill-error-strong"],color:r.palette.semantic.text["text-inverse-strong"],boxShadow:r.customShadows?.raised},hover:{borderRadius:r.radius["radius-8"],backgroundColor:s?e(r.palette.semantic.fill["fill-error-strong"],.1):t(r.palette.semantic.fill["fill-error-strong"],.1),color:r.palette.semantic.text["text-inverse-strong"],boxShadow:r.customShadows?.raised},press:{borderRadius:r.radius["radius-8"],backgroundColor:s?e(r.palette.semantic.fill["fill-error-strong"],.2):t(r.palette.semantic.fill["fill-error-strong"],.2),color:r.palette.semantic.text["text-inverse-strong"],boxShadow:r.customShadows?.raised},disabled:{backgroundColor:r.palette.semantic.fill["fill-disabled"],borderColor:"transparent",color:r.palette.semantic.text["text-inverse-strong"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}},secondary:{brand:{default:{border:`1px solid ${r.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:r.radius["radius-8"],backgroundColor:"transparent",color:r.palette.semantic.text["text-primary"],boxShadow:r.customShadows?.raised},hover:{border:`1px solid ${r.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:r.radius["radius-8"],backgroundColor:r.palette.semantic.fill["fill-hover"],color:r.palette.semantic.text["text-primary"],boxShadow:r.customShadows?.raised},press:{border:`1px solid ${r.palette.semantic.stroke["stroke-primary-strong"]}`,borderRadius:r.radius["radius-8"],backgroundColor:r.palette.semantic.fill["fill-press"],color:r.palette.semantic.text["text-primary"],boxShadow:r.customShadows?.raised},disabled:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-disabled"]}`,backgroundColor:"transparent",color:r.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},neutral:{default:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-strong"]}`,color:r.palette.semantic.text["text-strong"],boxShadow:r.customShadows?.raised},hover:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-strong"]}`,backgroundColor:r.palette.semantic.fill["fill-hover"],color:r.palette.semantic.text["text-strong"],boxShadow:r.customShadows?.raised},press:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-strong"]}`,backgroundColor:r.palette.semantic.fill["fill-press"],color:r.palette.semantic.text["text-strong"],boxShadow:r.customShadows?.raised},disabled:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-disabled"]}`,backgroundColor:"transparent",color:r.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},inverse:{default:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:"transparent",color:r.palette.semantic.text["text-inverse-strong"],boxShadow:r.customShadows?.raised},hover:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:r.palette.semantic.fill["fill-inverse-hover"],color:r.palette.semantic.text["text-inverse-strong"],boxShadow:r.customShadows?.raised},press:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:r.palette.semantic.fill["fill-inverse-press"],color:r.palette.semantic.text["text-inverse-strong"],boxShadow:r.customShadows?.raised},disabled:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-inverse-disabled"]}`,backgroundColor:r.palette.semantic.fill["fill-inverse-hover"],color:r.palette.semantic.stroke["stroke-inverse-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}},destructive:{default:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:"transparent",color:r.palette.semantic.text["text-error"],boxShadow:r.customShadows?.raised},hover:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:r.palette.semantic.fill["fill-hover"],color:r.palette.semantic.text["text-error"],boxShadow:r.customShadows?.raised},press:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:r.palette.semantic.fill["fill-press"],color:r.palette.semantic.text["text-error"],boxShadow:r.customShadows?.raised},disabled:{backgroundColor:"transparent",border:`1px solid ${r.palette.semantic.stroke["stroke-disabled"]}`,color:r.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}},tertiary:{brand:{default:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:r.palette.semantic.text["text-primary"],boxShadow:"none"},hover:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:r.palette.semantic.fill["fill-hover"],color:r.palette.semantic.text["text-primary"],boxShadow:"none"},press:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:r.palette.semantic.fill["fill-press"],color:r.palette.semantic.text["text-primary"],boxShadow:"none"},disabled:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:"transparent",color:r.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto",textDecoration:"underline"}},neutral:{default:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:r.palette.semantic.text["text-strong"],boxShadow:"none"},hover:{backgroundColor:r.palette.semantic.fill["fill-hover"],borderColor:r.palette.semantic.stroke["stroke-strong"],color:r.palette.semantic.text["text-strong"],boxShadow:"none"},press:{backgroundColor:r.palette.semantic.fill["fill-press"],borderColor:r.palette.semantic.stroke["stroke-strong"],color:r.palette.semantic.text["text-strong"],boxShadow:"none"},disabled:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:"transparent",color:r.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",textDecoration:"underline",pointerEvents:"auto"}},inverse:{default:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:r.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},hover:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:r.palette.semantic.fill["fill-inverse-hover"],color:r.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},press:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:r.palette.semantic.fill["fill-inverse-press"],color:r.palette.semantic.text["text-inverse-strong"],boxShadow:"none"},disabled:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:r.palette.semantic.fill["fill-strong"],color:r.palette.semantic.stroke["stroke-inverse-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto",textDecoration:"underline"},focus:{borderRadius:r.radius["radius-8"],border:`1px solid ${r.palette.semantic.stroke["stroke-inverse-strong"]}`,backgroundColor:r.palette.semantic.fill["fill-inverse-hover"],color:r.palette.semantic.text["text-inverse-strong"],boxShadow:"none"}},destructive:{default:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:"transparent",textDecoration:"underline",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",color:r.palette.semantic.text["text-error"],boxShadow:"none"},hover:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:r.palette.semantic.fill["fill-hover"],color:r.palette.semantic.text["text-error"],boxShadow:"none"},press:{borderRadius:r.radius["radius-8"],border:"none",backgroundColor:r.palette.semantic.fill["fill-press"],color:r.palette.semantic.text["text-error"],boxShadow:"none"},disabled:{borderRadius:r.radius["radius-8"],textDecoration:"underline",border:"none",backgroundColor:"transparent",color:r.palette.semantic.text["text-disabled"],boxShadow:"none",cursor:"not-allowed",pointerEvents:"auto"}}}};return{...i.generic,...i[o][a]}};export{r as default};
2
2
  //# sourceMappingURL=getButtonStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getButtonStyles.js","sources":["../../../../src/components/atoms/Button/getButtonStyles.ts"],"sourcesContent":["import { darken, lighten, type Theme } from '@mui/material/styles';\n\nexport type ButtonType = 'primary' | 'secondary' | 'tertiary';\nexport type ButtonTone = 'brand' | 'destructive' | 'inverse' | 'neutral' | undefined;\ntype ButtonState = 'default' | 'disabled' | 'focus' | 'hover' | 'press';\n\ninterface StyleObject {\n [property: string]: number | string | undefined;\n}\n\ntype ButtonStyles = {\n [state in ButtonState]?: StyleObject;\n};\nconst getButtonStyles = (theme: Theme, variant: ButtonType = 'primary', tone: ButtonTone = 'brand'): ButtonStyles => {\n const isLight = theme.palette.mode === 'light';\n const variants = {\n generic: {\n focus: {\n outlineOffset: '2px',\n outline: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n transition: 'none',\n },\n },\n primary: {\n brand: {\n default: {\n backgroundColor: theme.palette.semantic.fill['fill-primary-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-primary-strong'], 0.1) : lighten(theme.palette.semantic.fill['fill-primary-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised\n },\n press: {\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-primary-strong'], 0.2) : lighten(theme.palette.semantic.fill['fill-primary-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? lighten(theme.palette.semantic.fill['fill-strong'], 0.1) : darken(theme.palette.semantic.fill['fill-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? lighten(theme.palette.semantic.fill['fill-strong'], 0.2) : darken(theme.palette.semantic.fill['fill-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-inverse-strong'], 0.1) : lighten(theme.palette.semantic.fill['fill-inverse-strong'], 0.1),\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-inverse-strong'], 0.2) : lighten(theme.palette.semantic.fill['fill-inverse-strong'], 0.2),\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n focus: {\n borderRadius: theme.radius['radius-8'],\n outlineOffset: '2px',\n outline: `2px solid ${isLight ? lighten(theme.palette.semantic.stroke['stroke-inverse-strong'], 0.4) : darken(theme.palette.semantic.stroke['stroke-inverse-strong'], 0.4)}`,\n transition: 'none',\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-inverse-disabled'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-error-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-error-strong'], 0.1) : lighten(theme.palette.semantic.fill['fill-error-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight ? darken(theme.palette.semantic.fill['fill-error-strong'], 0.2) : lighten(theme.palette.semantic.fill['fill-error-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n secondary: {\n brand: {\n default: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-press'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-disabled']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.stroke['stroke-inverse-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n\n tertiary: {\n brand: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none'\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none'\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none'\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none'\n },\n hover: {\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n borderColor: theme.palette.semantic.stroke['stroke-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none'\n },\n press: {\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n borderColor: theme.palette.semantic.stroke['stroke-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none'\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border:'none',\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none'\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none'\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-inverse-press'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none'\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-strong'],\n color: theme.palette.semantic.stroke['stroke-inverse-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n focus: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none'\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none',\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none'\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none'\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-white'],\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n };\n return { ...variants.generic, ...variants[variant][tone] };\n};\n\nexport default getButtonStyles;\n"],"names":["getButtonStyles","theme","variant","tone","isLight","palette","mode","variants","generic","focus","outlineOffset","outline","semantic","stroke","transition","primary","brand","default","backgroundColor","fill","color","text","borderRadius","boxShadow","customShadows","raised","hover","darken","lighten","press","disabled","borderColor","cursor","neutral","radius","pointerEvents","inverse","destructive","secondary","border","tertiary","textDecoration","textUnderlineOffset","textUnderlinePosition"],"mappings":"2DAaA,MAAMA,EAAkB,CAACC,EAAcC,EAAsB,UAAWC,EAAmB,WACzF,MAAMC,EAAiC,UAAvBH,EAAMI,QAAQC,KACxBC,EAAW,CACfC,QAAS,CACPC,MAAO,CACLC,cAAe,MACfC,QAAS,aAAaV,EAAMI,QAAQO,SAASC,OAAO,kBACpDC,WAAY,S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O,SAAU,CACRR,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,OACRrB,gBAAiBjB,EAAMI,QAAQO,SAASO,KAAK,eAC7CC,MAAOnB,EAAMI,QAAQO,SAASC,OAAO,2BACrCU,UAAW,OACXS,OAAQ,cACRG,cAAe,QAEjB1B,MAAO,CACLa,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,aAAatC,EAAMI,QAAQO,SAASC,OAAO,2BACnDK,gBAAiBjB,EAAMI,QAAQO,SAASO,KAAK,sBAC7CC,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,uBACnCE,UAAW,SAGfc,YAAa,CACXpB,QAAS,CACPK,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,OACRrB,gBAAiB,cACjBuB,eAAgB,YAChBC,oBAAqB,MACrBC,sBAAuB,YACvBvB,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,cACnCE,UAAW,QAEbG,MAAO,CACLJ,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,OACRrB,gBAAiBjB,EAAMI,QAAQO,SAASO,KAAK,cAC7CC,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,cACnCE,UAAW,QAEbM,MAAO,CACLP,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,OACRrB,gBAAiBjB,EAAMI,QAAQO,SAASO,KAAK,cAC7CC,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,cACnCE,UAAW,QAEbO,SAAU,CACRR,aAAcrB,EAAMiC,OAAO,YAC3BK,OAAQ,OACRrB,gBAAiBjB,EAAMI,QAAQO,SAASO,KAAK,cAC7CC,MAAOnB,EAAMI,QAAQO,SAASS,KAAK,iBACnCE,UAAW,OACXS,OAAQ,cACRG,cAAe,WAKvB,MAAO,IAAK5B,EAASC,WAAYD,EAASL,GAASC"}
1
+ {"version":3,"file":"getButtonStyles.js","sources":["../../../../src/components/atoms/Button/getButtonStyles.ts"],"sourcesContent":["import { darken, lighten, type Theme } from '@mui/material/styles';\n\nexport type ButtonType = 'primary' | 'secondary' | 'tertiary';\nexport type ButtonTone = 'brand' | 'destructive' | 'inverse' | 'neutral' | undefined;\ntype ButtonState = 'default' | 'disabled' | 'focus' | 'hover' | 'press';\n\ninterface StyleObject {\n [property: string]: number | string | undefined;\n}\n\ntype ButtonStyles = {\n [state in ButtonState]?: StyleObject;\n};\nconst getButtonStyles = (\n theme: Theme,\n variant: ButtonType = 'primary',\n tone: ButtonTone = 'brand',\n): ButtonStyles => {\n const isLight = theme.palette.mode === 'light';\n const variants = {\n generic: {\n focus: {\n outlineOffset: '2px',\n outline: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n transition: 'none',\n },\n },\n primary: {\n brand: {\n default: {\n backgroundColor: theme.palette.semantic.fill['fill-primary-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-primary-strong'], 0.1)\n : lighten(theme.palette.semantic.fill['fill-primary-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-primary-strong'], 0.2)\n : lighten(theme.palette.semantic.fill['fill-primary-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n borderRadius: '8px',\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? lighten(theme.palette.semantic.fill['fill-strong'], 0.1)\n : darken(theme.palette.semantic.fill['fill-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? lighten(theme.palette.semantic.fill['fill-strong'], 0.2)\n : darken(theme.palette.semantic.fill['fill-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-inverse-strong'], 0.1)\n : lighten(theme.palette.semantic.fill['fill-inverse-strong'], 0.1),\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-inverse-strong'], 0.2)\n : lighten(theme.palette.semantic.fill['fill-inverse-strong'], 0.2),\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n focus: {\n borderRadius: theme.radius['radius-8'],\n outlineOffset: '2px',\n outline: `2px solid ${isLight ? lighten(theme.palette.semantic.stroke['stroke-inverse-strong'], 0.4) : darken(theme.palette.semantic.stroke['stroke-inverse-strong'], 0.4)}`,\n transition: 'none',\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-inverse-disabled'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-error-strong'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-error-strong'], 0.1)\n : lighten(theme.palette.semantic.fill['fill-error-strong'], 0.1),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n backgroundColor: isLight\n ? darken(theme.palette.semantic.fill['fill-error-strong'], 0.2)\n : lighten(theme.palette.semantic.fill['fill-error-strong'], 0.2),\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n backgroundColor: theme.palette.semantic.fill['fill-disabled'],\n borderColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n secondary: {\n brand: {\n default: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n border: `1px solid ${theme.palette.semantic.stroke['stroke-primary-strong']}`,\n borderRadius: theme.radius['radius-8'],\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-press'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-disabled']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.stroke['stroke-inverse-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised,\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised,\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-error-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: theme.customShadows?.raised,\n },\n disabled: {\n backgroundColor: 'transparent',\n border: `1px solid ${theme.palette.semantic.stroke['stroke-disabled']}`,\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n\n tertiary: {\n brand: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none',\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none',\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-primary'],\n boxShadow: 'none',\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n textDecoration: 'underline',\n },\n },\n neutral: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none',\n },\n hover: {\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n borderColor: theme.palette.semantic.stroke['stroke-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none',\n },\n press: {\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n borderColor: theme.palette.semantic.stroke['stroke-strong'],\n color: theme.palette.semantic.text['text-strong'],\n boxShadow: 'none',\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n textDecoration: 'underline',\n pointerEvents: 'auto',\n },\n },\n inverse: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-inverse-press'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-strong'],\n color: theme.palette.semantic.stroke['stroke-inverse-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n textDecoration: 'underline',\n },\n focus: {\n borderRadius: theme.radius['radius-8'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-inverse-strong']}`,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-hover'],\n color: theme.palette.semantic.text['text-inverse-strong'],\n boxShadow: 'none',\n },\n },\n destructive: {\n default: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none',\n },\n hover: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-hover'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none',\n },\n press: {\n borderRadius: theme.radius['radius-8'],\n border: 'none',\n backgroundColor: theme.palette.semantic.fill['fill-press'],\n color: theme.palette.semantic.text['text-error'],\n boxShadow: 'none',\n },\n disabled: {\n borderRadius: theme.radius['radius-8'],\n textDecoration: 'underline',\n border: 'none',\n backgroundColor: 'transparent',\n color: theme.palette.semantic.text['text-disabled'],\n boxShadow: 'none',\n cursor: 'not-allowed',\n pointerEvents: 'auto',\n },\n },\n },\n };\n return { ...variants.generic, ...variants[variant][tone] };\n};\n\nexport default getButtonStyles;\n"],"names":["getButtonStyles","theme","variant","tone","isLight","palette","mode","variants","generic","focus","outlineOffset","outline","semantic","stroke","transition","primary","brand","default","backgroundColor","fill","color","text","borderRadius","boxShadow","customShadows","raised","hover","darken","lighten","press","disabled","borderColor","cursor","pointerEvents","neutral","radius","inverse","destructive","secondary","border","tertiary","textDecoration","textUnderlineOffset","textUnderlinePosition"],"mappings":"2DAaA,MAAMA,E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 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var t=require("@mui/material/Button"),r=require("@mui/material/styles"),i=require("./getButtonStyles.cjs.js");const a=r.styled(t,{shouldForwardProp:e=>!["casingOverride","customVariant","tone"].includes(e)})((({theme:e,customVariant:t="primary",tone:r="brand",casingOverride:a="none",fullWidth:n=!1})=>{const s=i(e,t,r);return{...s.default,width:n?"100%":"fit-content",maxWidth:n?"100%":"fit-content",textTransform:a,transition:"all 0.2s ease-in-out","&:hover":{...s.hover},"&:focus":{outline:"none"},"&:focus-visible":{...s.focus},"&:active":{...s.press},"&:disabled":{...s.disabled,cursor:"not-allowed"}}})),n={primary:"contained",secondary:"outlined",tertiary:"text"},s=({casingOverride:t="none",children:r,className:i,disabled:s=!1,endIcon:o,fdKey:d,form:l,fullWidth:u=!1,href:c,onKeyDown:m,size:f="medium",startIcon:h,target:p,tone:v,type:y="button",variant:b="primary",...x})=>e.jsx(a,{...x,disableRipple:!0,casingOverride:t,className:i,customVariant:b,"data-fd":d,disabled:s,endIcon:o,form:l,fullWidth:u,href:c,size:f,startIcon:h,target:p,tone:v,type:y,variant:n[b],children:r});exports.Button=s,exports.default=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var t=require("@mui/material/Button"),r=require("@mui/material/styles"),i=require("./getButtonStyles.cjs.js");const a=r.styled(t,{shouldForwardProp:e=>!["casingOverride","customVariant","tone"].includes(e)})((({theme:e,customVariant:t="primary",tone:r="brand",casingOverride:a="none",fullWidth:n=!1})=>{const o=i(e,t,r);return{...o.default,width:n?"100%":"fit-content",maxWidth:n?"100%":"fit-content",textTransform:a,transition:"all 0.2s ease-in-out","&:hover":{...o.hover},"&:focus":{outline:"none"},"&:focus-visible":{...o.focus},"&:active":{...o.press},"&:disabled":{...o.disabled,cursor:"not-allowed"}}})),n={primary:"contained",secondary:"outlined",tertiary:"text"},o=({casingOverride:t="none",children:r,className:i,disabled:o=!1,endIcon:s,fdKey:d,form:l,fullWidth:u=!1,href:c,loading:m=!1,onKeyDown:f,size:h="medium",startIcon:p,target:v,tone:y,type:g="button",variant:b="primary",...x})=>e.jsx(a,{...x,disableRipple:!0,casingOverride:t,className:i,customVariant:b,"data-fd":d,"data-tone":y,disabled:o,endIcon:s,form:l,fullWidth:u,href:c,loading:m,loadingPosition:"start",size:h,startIcon:p,target:v,tone:y,type:g,variant:n[b],children:r});exports.Button=o,exports.default=o;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport MuiButton, { type ButtonProps as MuiButtonProps } from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport getButtonStyles, { type ButtonTone, type ButtonType } from './getButtonStyles';\n\ntype CasingOverride = 'capitalize' | 'lowercase' | 'none' | 'uppercase';\n\nexport interface ButtonProps extends Omit<MuiButtonProps, 'variant'> {\n className?: string;\n children: React.ReactNode;\n disabled?: boolean;\n form?: string;\n fullWidth?: boolean;\n casingOverride?: CasingOverride;\n type?: 'button' | 'reset' | 'submit';\n fdKey: string;\n variant?: ButtonType;\n tone?: ButtonTone;\n target?: '_blank';\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n}\n\nconst StyledButton = styled(MuiButton, {\n shouldForwardProp: (prop) => !['casingOverride', 'customVariant', 'tone'].includes(prop as string),\n})<{ casingOverride?: CasingOverride; customVariant?: ButtonType; tone?: ButtonTone }>(({\n theme,\n customVariant = 'primary',\n tone = 'brand',\n casingOverride = 'none',\n fullWidth = false,\n}) => {\n const styles = getButtonStyles(theme, customVariant, tone);\n\n return {\n ...styles.default,\n width: fullWidth ? '100%' : 'fit-content',\n maxWidth: fullWidth ? '100%' : 'fit-content',\n textTransform: casingOverride,\n transition: 'all 0.2s ease-in-out',\n\n '&:hover': { ...styles.hover },\n '&:focus': {\n outline: 'none', // Removes the focus ring on click\n },\n // focus visible so that the focus ring only shows for keyboard users\n '&:focus-visible': { ...styles.focus },\n '&:active': { ...styles.press },\n '&:disabled': { ...styles.disabled, cursor: 'not-allowed' },\n };\n});\n\nconst MUI_VARIANT_MAP = {\n primary: 'contained',\n secondary: 'outlined',\n tertiary: 'text',\n};\n\nexport const Button = ({\n casingOverride = 'none',\n children,\n className,\n disabled = false,\n endIcon,\n fdKey,\n form,\n fullWidth = false,\n href,\n onKeyDown,\n size = 'medium',\n startIcon,\n target,\n tone,\n type = 'button',\n variant = 'primary',\n ...props\n}: ButtonProps): JSX.Element => {\n return (\n <StyledButton\n {...props}\n disableRipple\n casingOverride={casingOverride}\n className={className}\n customVariant={variant}\n data-fd={fdKey}\n disabled={disabled}\n endIcon={endIcon}\n form={form}\n fullWidth={fullWidth}\n href={href}\n size={size}\n startIcon={startIcon}\n // @ts-expect-error - target is not a valid prop for MuiButton\n target={target}\n tone={tone}\n type={type}\n variant={MUI_VARIANT_MAP[variant] as MuiButtonProps['variant']}\n >\n {children}\n </StyledButton>\n );\n};\n\nexport default Button;\n"],"names":["StyledButton","styled","MuiButton","shouldForwardProp","prop","includes","theme","customVariant","tone","casingOverride","fullWidth","styles","getButtonStyles","default","width","maxWidth","textTransform","transition","hover","outline","focus","press","disabled","cursor","MUI_VARIANT_MAP","primary","secondary","tertiary","Button","children","className","endIcon","fdKey","form","href","onKeyDown","size","startIcon","target","type","variant","props","_jsx","disableRipple"],"mappings":"sOAyBA,MAAMA,EAAeC,EAAAA,OAAOC,EAAW,CACrCC,kBAAoBC,IAAU,CAAC,iBAAkB,gBAAiB,QAAQC,SAASD,IADhEH,EAEkE,EACrFK,QACAC,gBAAgB,UAChBC,OAAO,QACPC,iBAAiB,OACjBC,aAAY,MAEZ,MAAMC,EAASC,EAAgBN,EAAOC,EAAeC,GAErD,MAAO,IACFG,EAAOE,QACVC,MAAOJ,EAAY,OAAS,cAC5BK,SAAUL,EAAY,OAAS,cAC/BM,cAAeP,EACfQ,WAAY,uBAEZ,UAAW,IAAKN,EAAOO,OACvB,UAAW,CACTC,QAAS,QAGX,kBAAmB,IAAKR,EAAOS,OAC/B,WAAY,IAAKT,EAAOU,OACxB,aAAc,IAAKV,EAAOW,SAAUC,OAAQ,mBAI1CC,EAAkB,CACtBC,QAAS,YACTC,UAAW,WACXC,SAAU,QAGCC,EAAS,EACpBnB,iBAAiB,OACjBoB,WACAC,YACAR,YAAW,EACXS,UACAC,QACAC,OACAvB,aAAY,EACZwB,OACAC,YACAC,OAAO,SACPC,YACAC,SACA9B,OACA+B,OAAO,SACPC,UAAU,aACPC,KAGDC,EAAAA,IAAC1C,EAAY,IACPyC,EACJE,eAAa,EACblC,eAAgBA,EAChBqB,UAAWA,EACXvB,cAAeiC,EAAO,UACbR,EACTV,SAAUA,EACVS,QAASA,EACTE,KAAMA,EACNvB,UAAWA,EACXwB,KAAMA,EACNE,KAAMA,EACNC,UAAWA,EAEXC,OAAQA,EACR9B,KAAMA,EACN+B,KAAMA,EACNC,QAAShB,EAAgBgB,GAAqCX,SAE7DA"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport MuiButton, { type ButtonProps as MuiButtonProps } from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport getButtonStyles, { type ButtonTone, type ButtonType } from './getButtonStyles';\n\ntype CasingOverride = 'capitalize' | 'lowercase' | 'none' | 'uppercase';\n\nexport interface ButtonProps extends Omit<MuiButtonProps, 'variant'> {\n className?: string;\n children: React.ReactNode;\n disabled?: boolean;\n form?: string;\n fullWidth?: boolean;\n casingOverride?: CasingOverride;\n type?: 'button' | 'reset' | 'submit';\n fdKey: string;\n variant?: ButtonType;\n tone?: ButtonTone;\n target?: '_blank';\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n loading?: boolean;\n}\n\nconst StyledButton = styled(MuiButton, {\n shouldForwardProp: (prop) => !['casingOverride', 'customVariant', 'tone'].includes(prop as string),\n})<{ casingOverride?: CasingOverride; customVariant?: ButtonType; tone?: ButtonTone }>(({\n theme,\n customVariant = 'primary',\n tone = 'brand',\n casingOverride = 'none',\n fullWidth = false,\n}) => {\n const styles = getButtonStyles(theme, customVariant, tone);\n\n return {\n ...styles.default,\n width: fullWidth ? '100%' : 'fit-content',\n maxWidth: fullWidth ? '100%' : 'fit-content',\n textTransform: casingOverride,\n transition: 'all 0.2s ease-in-out',\n\n '&:hover': { ...styles.hover },\n '&:focus': {\n outline: 'none', // Removes the focus ring on click\n },\n // focus visible so that the focus ring only shows for keyboard users\n '&:focus-visible': { ...styles.focus },\n '&:active': { ...styles.press },\n '&:disabled': { ...styles.disabled, cursor: 'not-allowed' },\n };\n});\n\nconst MUI_VARIANT_MAP = {\n primary: 'contained',\n secondary: 'outlined',\n tertiary: 'text',\n};\n\nexport const Button = ({\n casingOverride = 'none',\n children,\n className,\n disabled = false,\n endIcon,\n fdKey,\n form,\n fullWidth = false,\n href,\n loading = false,\n onKeyDown,\n size = 'medium',\n startIcon,\n target,\n tone,\n type = 'button',\n variant = 'primary',\n ...props\n}: ButtonProps): JSX.Element => {\n return (\n <StyledButton\n {...props}\n disableRipple\n casingOverride={casingOverride}\n className={className}\n customVariant={variant}\n data-fd={fdKey}\n data-tone={tone}\n disabled={disabled}\n endIcon={endIcon}\n form={form}\n fullWidth={fullWidth}\n href={href}\n loading={loading}\n loadingPosition=\"start\"\n size={size}\n startIcon={startIcon}\n // @ts-expect-error - target is not a valid prop for MuiButton\n target={target}\n tone={tone}\n type={type}\n variant={MUI_VARIANT_MAP[variant] as MuiButtonProps['variant']}\n >\n {children}\n </StyledButton>\n );\n};\n\nexport default Button;\n"],"names":["StyledButton","styled","MuiButton","shouldForwardProp","prop","includes","theme","customVariant","tone","casingOverride","fullWidth","styles","getButtonStyles","default","width","maxWidth","textTransform","transition","hover","outline","focus","press","disabled","cursor","MUI_VARIANT_MAP","primary","secondary","tertiary","Button","children","className","endIcon","fdKey","form","href","loading","onKeyDown","size","startIcon","target","type","variant","props","_jsx","disableRipple","loadingPosition"],"mappings":"sOA0BA,MAAMA,EAAeC,EAAAA,OAAOC,EAAW,CACrCC,kBAAoBC,IAAU,CAAC,iBAAkB,gBAAiB,QAAQC,SAASD,IADhEH,EAEkE,EACrFK,QACAC,gBAAgB,UAChBC,OAAO,QACPC,iBAAiB,OACjBC,aAAY,MAEZ,MAAMC,EAASC,EAAgBN,EAAOC,EAAeC,GAErD,MAAO,IACFG,EAAOE,QACVC,MAAOJ,EAAY,OAAS,cAC5BK,SAAUL,EAAY,OAAS,cAC/BM,cAAeP,EACfQ,WAAY,uBAEZ,UAAW,IAAKN,EAAOO,OACvB,UAAW,CACTC,QAAS,QAGX,kBAAmB,IAAKR,EAAOS,OAC/B,WAAY,IAAKT,EAAOU,OACxB,aAAc,IAAKV,EAAOW,SAAUC,OAAQ,mBAI1CC,EAAkB,CACtBC,QAAS,YACTC,UAAW,WACXC,SAAU,QAGCC,EAAS,EACpBnB,iBAAiB,OACjBoB,WACAC,YACAR,YAAW,EACXS,UACAC,QACAC,OACAvB,aAAY,EACZwB,OACAC,WAAU,EACVC,YACAC,OAAO,SACPC,YACAC,SACA/B,OACAgC,OAAO,SACPC,UAAU,aACPC,KAGDC,EAAAA,IAAC3C,EAAY,IACP0C,EACJE,eAAa,EACbnC,eAAgBA,EAChBqB,UAAWA,EACXvB,cAAekC,EAAO,UACbT,EAAK,YACHxB,EACXc,SAAUA,EACVS,QAASA,EACTE,KAAMA,EACNvB,UAAWA,EACXwB,KAAMA,EACNC,QAASA,EACTU,gBAAgB,QAChBR,KAAMA,EACNC,UAAWA,EAEXC,OAAQA,EACR/B,KAAMA,EACNgC,KAAMA,EACNC,QAASjB,EAAgBiB,GAAqCZ,SAE7DA"}
@@ -17,8 +17,9 @@ interface ButtonProps extends Omit<ButtonProps$1, 'variant'> {
17
17
  target?: '_blank';
18
18
  startIcon?: react__default.ReactNode;
19
19
  endIcon?: react__default.ReactNode;
20
+ loading?: boolean;
20
21
  }
21
- declare const Button: ({ casingOverride, children, className, disabled, endIcon, fdKey, form, fullWidth, href, onKeyDown, size, startIcon, target, tone, type, variant, ...props }: ButtonProps) => JSX.Element;
22
+ declare const Button: ({ casingOverride, children, className, disabled, endIcon, fdKey, form, fullWidth, href, loading, onKeyDown, size, startIcon, target, tone, type, variant, ...props }: ButtonProps) => JSX.Element;
22
23
 
23
24
  export { Button, Button as default };
24
25
  export type { ButtonProps };
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import"react";import e from"@mui/material/Button";import{styled as r}from"@mui/material/styles";import i from"./getButtonStyles.js";const a=r(e,{shouldForwardProp:t=>!["casingOverride","customVariant","tone"].includes(t)})((({theme:t,customVariant:e="primary",tone:r="brand",casingOverride:a="none",fullWidth:o=!1})=>{const n=i(t,e,r);return{...n.default,width:o?"100%":"fit-content",maxWidth:o?"100%":"fit-content",textTransform:a,transition:"all 0.2s ease-in-out","&:hover":{...n.hover},"&:focus":{outline:"none"},"&:focus-visible":{...n.focus},"&:active":{...n.press},"&:disabled":{...n.disabled,cursor:"not-allowed"}}})),o={primary:"contained",secondary:"outlined",tertiary:"text"},n=({casingOverride:e="none",children:r,className:i,disabled:n=!1,endIcon:s,fdKey:d,form:l,fullWidth:c=!1,href:m,onKeyDown:u,size:f="medium",startIcon:p,target:h,tone:y,type:v="button",variant:b="primary",...g})=>t(a,{...g,disableRipple:!0,casingOverride:e,className:i,customVariant:b,"data-fd":d,disabled:n,endIcon:s,form:l,fullWidth:c,href:m,size:f,startIcon:p,target:h,tone:y,type:v,variant:o[b],children:r});export{n as Button,n as default};
1
+ import{jsx as t}from"react/jsx-runtime";import"react";import e from"@mui/material/Button";import{styled as r}from"@mui/material/styles";import i from"./getButtonStyles.js";const a=r(e,{shouldForwardProp:t=>!["casingOverride","customVariant","tone"].includes(t)})((({theme:t,customVariant:e="primary",tone:r="brand",casingOverride:a="none",fullWidth:o=!1})=>{const n=i(t,e,r);return{...n.default,width:o?"100%":"fit-content",maxWidth:o?"100%":"fit-content",textTransform:a,transition:"all 0.2s ease-in-out","&:hover":{...n.hover},"&:focus":{outline:"none"},"&:focus-visible":{...n.focus},"&:active":{...n.press},"&:disabled":{...n.disabled,cursor:"not-allowed"}}})),o={primary:"contained",secondary:"outlined",tertiary:"text"},n=({casingOverride:e="none",children:r,className:i,disabled:n=!1,endIcon:s,fdKey:d,form:l,fullWidth:c=!1,href:m,loading:u=!1,onKeyDown:f,size:p="medium",startIcon:h,target:y,tone:g,type:v="button",variant:b="primary",...x})=>t(a,{...x,disableRipple:!0,casingOverride:e,className:i,customVariant:b,"data-fd":d,"data-tone":g,disabled:n,endIcon:s,form:l,fullWidth:c,href:m,loading:u,loadingPosition:"start",size:p,startIcon:h,target:y,tone:g,type:v,variant:o[b],children:r});export{n as Button,n as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport MuiButton, { type ButtonProps as MuiButtonProps } from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport getButtonStyles, { type ButtonTone, type ButtonType } from './getButtonStyles';\n\ntype CasingOverride = 'capitalize' | 'lowercase' | 'none' | 'uppercase';\n\nexport interface ButtonProps extends Omit<MuiButtonProps, 'variant'> {\n className?: string;\n children: React.ReactNode;\n disabled?: boolean;\n form?: string;\n fullWidth?: boolean;\n casingOverride?: CasingOverride;\n type?: 'button' | 'reset' | 'submit';\n fdKey: string;\n variant?: ButtonType;\n tone?: ButtonTone;\n target?: '_blank';\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n}\n\nconst StyledButton = styled(MuiButton, {\n shouldForwardProp: (prop) => !['casingOverride', 'customVariant', 'tone'].includes(prop as string),\n})<{ casingOverride?: CasingOverride; customVariant?: ButtonType; tone?: ButtonTone }>(({\n theme,\n customVariant = 'primary',\n tone = 'brand',\n casingOverride = 'none',\n fullWidth = false,\n}) => {\n const styles = getButtonStyles(theme, customVariant, tone);\n\n return {\n ...styles.default,\n width: fullWidth ? '100%' : 'fit-content',\n maxWidth: fullWidth ? '100%' : 'fit-content',\n textTransform: casingOverride,\n transition: 'all 0.2s ease-in-out',\n\n '&:hover': { ...styles.hover },\n '&:focus': {\n outline: 'none', // Removes the focus ring on click\n },\n // focus visible so that the focus ring only shows for keyboard users\n '&:focus-visible': { ...styles.focus },\n '&:active': { ...styles.press },\n '&:disabled': { ...styles.disabled, cursor: 'not-allowed' },\n };\n});\n\nconst MUI_VARIANT_MAP = {\n primary: 'contained',\n secondary: 'outlined',\n tertiary: 'text',\n};\n\nexport const Button = ({\n casingOverride = 'none',\n children,\n className,\n disabled = false,\n endIcon,\n fdKey,\n form,\n fullWidth = false,\n href,\n onKeyDown,\n size = 'medium',\n startIcon,\n target,\n tone,\n type = 'button',\n variant = 'primary',\n ...props\n}: ButtonProps): JSX.Element => {\n return (\n <StyledButton\n {...props}\n disableRipple\n casingOverride={casingOverride}\n className={className}\n customVariant={variant}\n data-fd={fdKey}\n disabled={disabled}\n endIcon={endIcon}\n form={form}\n fullWidth={fullWidth}\n href={href}\n size={size}\n startIcon={startIcon}\n // @ts-expect-error - target is not a valid prop for MuiButton\n target={target}\n tone={tone}\n type={type}\n variant={MUI_VARIANT_MAP[variant] as MuiButtonProps['variant']}\n >\n {children}\n </StyledButton>\n );\n};\n\nexport default Button;\n"],"names":["StyledButton","styled","MuiButton","shouldForwardProp","prop","includes","theme","customVariant","tone","casingOverride","fullWidth","styles","getButtonStyles","default","width","maxWidth","textTransform","transition","hover","outline","focus","press","disabled","cursor","MUI_VARIANT_MAP","primary","secondary","tertiary","Button","children","className","endIcon","fdKey","form","href","onKeyDown","size","startIcon","target","type","variant","props","_jsx","disableRipple"],"mappings":"4KAyBA,MAAMA,EAAeC,EAAOC,EAAW,CACrCC,kBAAoBC,IAAU,CAAC,iBAAkB,gBAAiB,QAAQC,SAASD,IADhEH,EAEkE,EACrFK,QACAC,gBAAgB,UAChBC,OAAO,QACPC,iBAAiB,OACjBC,aAAY,MAEZ,MAAMC,EAASC,EAAgBN,EAAOC,EAAeC,GAErD,MAAO,IACFG,EAAOE,QACVC,MAAOJ,EAAY,OAAS,cAC5BK,SAAUL,EAAY,OAAS,cAC/BM,cAAeP,EACfQ,WAAY,uBAEZ,UAAW,IAAKN,EAAOO,OACvB,UAAW,CACTC,QAAS,QAGX,kBAAmB,IAAKR,EAAOS,OAC/B,WAAY,IAAKT,EAAOU,OACxB,aAAc,IAAKV,EAAOW,SAAUC,OAAQ,mBAI1CC,EAAkB,CACtBC,QAAS,YACTC,UAAW,WACXC,SAAU,QAGCC,EAAS,EACpBnB,iBAAiB,OACjBoB,WACAC,YACAR,YAAW,EACXS,UACAC,QACAC,OACAvB,aAAY,EACZwB,OACAC,YACAC,OAAO,SACPC,YACAC,SACA9B,OACA+B,OAAO,SACPC,UAAU,aACPC,KAGDC,EAAC1C,EAAY,IACPyC,EACJE,eAAa,EACblC,eAAgBA,EAChBqB,UAAWA,EACXvB,cAAeiC,EAAO,UACbR,EACTV,SAAUA,EACVS,QAASA,EACTE,KAAMA,EACNvB,UAAWA,EACXwB,KAAMA,EACNE,KAAMA,EACNC,UAAWA,EAEXC,OAAQA,EACR9B,KAAMA,EACN+B,KAAMA,EACNC,QAAShB,EAAgBgB,GAAqCX,SAE7DA"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport MuiButton, { type ButtonProps as MuiButtonProps } from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport getButtonStyles, { type ButtonTone, type ButtonType } from './getButtonStyles';\n\ntype CasingOverride = 'capitalize' | 'lowercase' | 'none' | 'uppercase';\n\nexport interface ButtonProps extends Omit<MuiButtonProps, 'variant'> {\n className?: string;\n children: React.ReactNode;\n disabled?: boolean;\n form?: string;\n fullWidth?: boolean;\n casingOverride?: CasingOverride;\n type?: 'button' | 'reset' | 'submit';\n fdKey: string;\n variant?: ButtonType;\n tone?: ButtonTone;\n target?: '_blank';\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n loading?: boolean;\n}\n\nconst StyledButton = styled(MuiButton, {\n shouldForwardProp: (prop) => !['casingOverride', 'customVariant', 'tone'].includes(prop as string),\n})<{ casingOverride?: CasingOverride; customVariant?: ButtonType; tone?: ButtonTone }>(({\n theme,\n customVariant = 'primary',\n tone = 'brand',\n casingOverride = 'none',\n fullWidth = false,\n}) => {\n const styles = getButtonStyles(theme, customVariant, tone);\n\n return {\n ...styles.default,\n width: fullWidth ? '100%' : 'fit-content',\n maxWidth: fullWidth ? '100%' : 'fit-content',\n textTransform: casingOverride,\n transition: 'all 0.2s ease-in-out',\n\n '&:hover': { ...styles.hover },\n '&:focus': {\n outline: 'none', // Removes the focus ring on click\n },\n // focus visible so that the focus ring only shows for keyboard users\n '&:focus-visible': { ...styles.focus },\n '&:active': { ...styles.press },\n '&:disabled': { ...styles.disabled, cursor: 'not-allowed' },\n };\n});\n\nconst MUI_VARIANT_MAP = {\n primary: 'contained',\n secondary: 'outlined',\n tertiary: 'text',\n};\n\nexport const Button = ({\n casingOverride = 'none',\n children,\n className,\n disabled = false,\n endIcon,\n fdKey,\n form,\n fullWidth = false,\n href,\n loading = false,\n onKeyDown,\n size = 'medium',\n startIcon,\n target,\n tone,\n type = 'button',\n variant = 'primary',\n ...props\n}: ButtonProps): JSX.Element => {\n return (\n <StyledButton\n {...props}\n disableRipple\n casingOverride={casingOverride}\n className={className}\n customVariant={variant}\n data-fd={fdKey}\n data-tone={tone}\n disabled={disabled}\n endIcon={endIcon}\n form={form}\n fullWidth={fullWidth}\n href={href}\n loading={loading}\n loadingPosition=\"start\"\n size={size}\n startIcon={startIcon}\n // @ts-expect-error - target is not a valid prop for MuiButton\n target={target}\n tone={tone}\n type={type}\n variant={MUI_VARIANT_MAP[variant] as MuiButtonProps['variant']}\n >\n {children}\n </StyledButton>\n );\n};\n\nexport default Button;\n"],"names":["StyledButton","styled","MuiButton","shouldForwardProp","prop","includes","theme","customVariant","tone","casingOverride","fullWidth","styles","getButtonStyles","default","width","maxWidth","textTransform","transition","hover","outline","focus","press","disabled","cursor","MUI_VARIANT_MAP","primary","secondary","tertiary","Button","children","className","endIcon","fdKey","form","href","loading","onKeyDown","size","startIcon","target","type","variant","props","_jsx","disableRipple","loadingPosition"],"mappings":"4KA0BA,MAAMA,EAAeC,EAAOC,EAAW,CACrCC,kBAAoBC,IAAU,CAAC,iBAAkB,gBAAiB,QAAQC,SAASD,IADhEH,EAEkE,EACrFK,QACAC,gBAAgB,UAChBC,OAAO,QACPC,iBAAiB,OACjBC,aAAY,MAEZ,MAAMC,EAASC,EAAgBN,EAAOC,EAAeC,GAErD,MAAO,IACFG,EAAOE,QACVC,MAAOJ,EAAY,OAAS,cAC5BK,SAAUL,EAAY,OAAS,cAC/BM,cAAeP,EACfQ,WAAY,uBAEZ,UAAW,IAAKN,EAAOO,OACvB,UAAW,CACTC,QAAS,QAGX,kBAAmB,IAAKR,EAAOS,OAC/B,WAAY,IAAKT,EAAOU,OACxB,aAAc,IAAKV,EAAOW,SAAUC,OAAQ,mBAI1CC,EAAkB,CACtBC,QAAS,YACTC,UAAW,WACXC,SAAU,QAGCC,EAAS,EACpBnB,iBAAiB,OACjBoB,WACAC,YACAR,YAAW,EACXS,UACAC,QACAC,OACAvB,aAAY,EACZwB,OACAC,WAAU,EACVC,YACAC,OAAO,SACPC,YACAC,SACA/B,OACAgC,OAAO,SACPC,UAAU,aACPC,KAGDC,EAAC3C,EAAY,IACP0C,EACJE,eAAa,EACbnC,eAAgBA,EAChBqB,UAAWA,EACXvB,cAAekC,EAAO,UACbT,EAAK,YACHxB,EACXc,SAAUA,EACVS,QAASA,EACTE,KAAMA,EACNvB,UAAWA,EACXwB,KAAMA,EACNC,QAASA,EACTU,gBAAgB,QAChBR,KAAMA,EACNC,UAAWA,EAEXC,OAAQA,EACR/B,KAAMA,EACNgC,KAAMA,EACNC,QAASjB,EAAgBiB,GAAqCZ,SAE7DA"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),a=require("react"),s=require("@mui/material/styles"),r=require("@mui/material/Box"),l=require("../../atoms/Tab/index.cjs.js"),i=require("../../molecules/Modal/index.cjs.js"),t=require("../../molecules/Tabs/index.cjs.js"),n=require("../../../providers/TranslationProvider.cjs.js"),o=require("@tanstack/react-query"),d=require("./hooks/useAssetSelection.cjs.js"),c=require("./hooks/useAssetUploadManager.cjs.js"),u=require("./hooks/useGetAssets.cjs.js"),p=require("./LibraryTabContent/index.cjs.js"),g=require("./UploadTabContent/index.cjs.js");const m=s.styled(r)((({theme:e})=>({height:"calc(70vh - 200px)",overflowY:"auto",marginTop:e.spacing(2),marginRight:e.spacing(-2),marginLeft:e.spacing(-1),marginBottom:e.spacing(-1),paddingRight:e.spacing(2),paddingLeft:e.spacing(1),paddingBottom:e.spacing(1)}))),j=new o.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:2}}}),b=({open:s,onClose:r,onSelect:o,orgId:j,brandId:b,maxSelect:y=1})=>{const[h,x]=a.useState("library"),{translate:v}=n.useTranslation(),{data:q,isLoading:C,error:S}=u.useGetAssets(j,s,b),{selectedAssetsMap:A,handleAssetClick:f,clearSelection:k,addAssetsToSelection:U}=d.useAssetSelection({maxSelect:y}),{uploadedFiles:T,uploadError:_,isUploading:I,handleUpload:L,handleRemove:M,handleSave:E,clearUploadedFiles:F,clearSaveUploadError:R}=c.useAssetUploadManager({orgId:j,brandId:b,onUploadSuccess:e=>{U(e),x("library")},getErrorMessage:()=>v("Failed_to_upload_assets_try_again")});a.useEffect((()=>{s||(k(),F(),R())}),[s,k,F,R]);const w=a.useCallback((()=>{k(),r()}),[r,k]),B=a.useCallback((()=>{if(0===A.size)return void r();const e=Array.from(A.values());o&&e.length>0&&o(e),k(),r()}),[o,A,r,k]),z=a.useMemo((()=>{const e={label:v("Cancel"),onClick:w,variant:"secondary",tone:"neutral",id:"asset-manager-cancel"},a={library:[e,{label:v("Select"),onClick:B,variant:"primary",id:"asset-manager-select"}],upload:[e,{label:v("Save"),onClick:E,disabled:I,variant:"primary",id:"asset-manager-upload"}]};return a[h]??a.library}),[h,I,w,B,E,v]);return e.jsxs(i,{actions:z,onClose:w,open:s,size:"large",title:v("library"===h?"Select_Images":"Upload_Images"),children:[e.jsxs(t,{fdKey:"asset-manager-tabs",onChange:(e,a)=>{x(a),F()},value:h,children:[e.jsx(l,{label:v("Upload"),value:"upload"}),e.jsx(l,{label:v("Library"),value:"library"})]}),e.jsx(m,{children:"library"===h?e.jsx(p,{assets:q?.data,error:S,isLoading:C,onAssetClick:f,selectedAssets:A}):e.jsx(g,{error:_,files:T,onRemove:M,onUpload:L})})]})};module.exports=a=>e.jsx(o.QueryClientProvider,{client:j,children:e.jsx(b,{...a})});
1
+ "use strict";var e=require("react/jsx-runtime"),a=require("react"),s=require("@mui/material/styles"),r=require("@mui/material/Box"),l=require("../../atoms/Tab/index.cjs.js"),i=require("../../molecules/Modal/index.cjs.js"),t=require("../../molecules/Tabs/index.cjs.js"),n=require("../../../providers/TranslationProvider.cjs.js"),o=require("@tanstack/react-query"),d=require("./hooks/useAssetSelection.cjs.js"),c=require("./hooks/useAssetUploadManager.cjs.js"),u=require("./hooks/useGetAssets.cjs.js"),g=require("./LibraryTabContent/index.cjs.js"),p=require("./UploadTabContent/index.cjs.js");const m=s.styled(r)((({theme:e})=>({height:"calc(70vh - 200px)",overflowY:"auto",marginTop:e.spacing(2),marginRight:e.spacing(-2),marginLeft:e.spacing(-1),marginBottom:e.spacing(-1),paddingRight:e.spacing(2),paddingLeft:e.spacing(1),paddingBottom:e.spacing(1)}))),j=new o.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:2}}}),b=({open:s,onClose:r,onSelect:o,orgId:j,brandId:b,maxSelect:y=1})=>{const[h,x]=a.useState("library"),{translate:v}=n.useTranslation(),{data:q,isLoading:C,error:S}=u.useGetAssets(j,s,b),{selectedAssetsMap:A,handleAssetClick:f,clearSelection:k,addAssetsToSelection:U}=d.useAssetSelection({maxSelect:y}),{uploadedFiles:T,uploadError:_,isUploading:I,handleUpload:L,handleRemove:M,handleSave:E,clearUploadedFiles:F,clearSaveUploadError:R}=c.useAssetUploadManager({orgId:j,brandId:b,onUploadSuccess:e=>{U(e),x("library")},getErrorMessage:()=>v("Failed_to_upload_assets_try_again")});a.useEffect((()=>{s||(k(),F(),R())}),[s,k,F,R]);const w=a.useCallback((()=>{k(),r()}),[r,k]),B=a.useCallback((()=>{if(0===A.size)return void r();const e=Array.from(A.values());o&&e.length>0&&o(e),k(),r()}),[o,A,r,k]),z=a.useMemo((()=>{const e={label:v("Cancel"),onClick:w,variant:"secondary",tone:"neutral",id:"asset-manager-cancel"},a={library:[e,{label:v("Select"),onClick:B,variant:"primary",id:"asset-manager-select"}],upload:[e,{label:v("Save"),onClick:E,loading:I,variant:"primary",id:"asset-manager-upload"}]};return a[h]??a.library}),[h,I,w,B,E,v]);return e.jsxs(i,{actions:z,onClose:w,open:s,size:"large",title:v("library"===h?"Select_Images":"Upload_Images"),children:[e.jsxs(t,{fdKey:"asset-manager-tabs",onChange:(e,a)=>{x(a),F()},value:h,children:[e.jsx(l,{label:v("Upload"),value:"upload"}),e.jsx(l,{label:v("Library"),value:"library"})]}),e.jsx(m,{children:"library"===h?e.jsx(g,{assets:q?.data,error:S,isLoading:C,onAssetClick:f,selectedAssets:A}):e.jsx(p,{error:_,files:T,onRemove:M,onUpload:L})})]})};module.exports=a=>e.jsx(o.QueryClientProvider,{client:j,children:e.jsx(b,{...a})});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/organisms/AssetManager/index.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport Box from '@fd/components/atoms/Box';\nimport Tab from '@fd/components/atoms/Tab';\nimport Modal, { type ModalAction } from '@fd/components/molecules/Modal';\nimport Tabs from '@fd/components/molecules/Tabs';\nimport { useTranslation } from '@fd/providers/TranslationProvider';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n\nimport { useAssetSelection } from './hooks/useAssetSelection';\nimport { useAssetUploadManager } from './hooks/useAssetUploadManager';\nimport { useGetAssets } from './hooks/useGetAssets';\nimport LibraryTabContent from './LibraryTabContent';\nimport type { Asset } from './types/assets.type';\nimport UploadAssetContent from './UploadTabContent';\n/**\n * Scrollable container for the tab content.\n * Allows the asset list to scroll while keeping the modal title, tabs, and actions visible.\n * Uses fixed height to prevent modal resizing when switching tabs.\n */\nconst StyledScrollableContent = styled(Box)(({ theme }) => ({\n height: 'calc(70vh - 200px)', // Fixed height for consistent modal size across tabs\n overflowY: 'auto',\n marginTop: theme.spacing(2),\n marginRight: theme.spacing(-2), // Extend to edge for scrollbar\n marginLeft: theme.spacing(-1), // Allow space for shadows on left\n marginBottom: theme.spacing(-1), // Allow space for shadows on bottom\n paddingRight: theme.spacing(2), // Compensate for negative margin\n paddingLeft: theme.spacing(1), // Compensate for negative margin\n paddingBottom: theme.spacing(1), // Compensate for negative margin\n}));\n\n/**\n * Props for the AssetManager component.\n * Provides a modal interface for selecting images from a grid display.\n * It supports both single and multiple image selection modes with configurable limits.\n *\n * import AssetManager from '@flipdish/portal-library/components/organisms/AssetManager';\n *\n * ```tsx\n * import AssetManager from '@flipdish/portal-library/components/organisms/AssetManager';\n */\nexport interface AssetManagerProps {\n /** Whether the asset manager modal is open */\n open: boolean;\n /** Callback function when the modal is closed or cancelled */\n onClose: () => void;\n /** Callback function when assets are selected */\n onSelect?: (selectedAssets: Asset[]) => void;\n /**\n * Organization ID for fetching assets\n */\n orgId: string;\n /** Brand ID for fetching assets */\n brandId?: string;\n /** Maximum number of assets that can be selected. Defaults to 1 */\n maxSelect?: number;\n}\n\n// Create a QueryClient instance for the AssetManager component\n// This allows the component to be used without requiring clients to wrap it in QueryClientProvider\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n retry: 2,\n },\n },\n});\n\n/**\n * Inner component that contains the AssetManager logic.\n * Must be rendered inside QueryClientProvider to use React Query hooks.\n */\nconst AssetManagerContent: React.FC<AssetManagerProps> = ({\n open,\n onClose,\n onSelect,\n orgId,\n brandId,\n maxSelect = 1,\n}) => {\n const [selectedTab, setSelectedTab] = useState<string>('library');\n const { translate } = useTranslation();\n\n // Fetch assets at the parent level to enable future reuse across tabs\n const {\n data: assetResponse,\n isLoading: isLoadingAssets,\n error: assetsError,\n } = useGetAssets(orgId, open, brandId);\n\n // Asset selection hook - manages selected assets from library\n const { selectedAssetsMap, handleAssetClick, clearSelection, addAssetsToSelection } = useAssetSelection({\n maxSelect,\n });\n\n // Asset upload hook - manages file uploads and upload state\n const {\n uploadedFiles,\n uploadError,\n isUploading,\n handleUpload,\n handleRemove,\n handleSave,\n clearUploadedFiles,\n clearSaveUploadError,\n } = useAssetUploadManager({\n orgId,\n brandId,\n onUploadSuccess: (uploadedAssets) => {\n // Add uploaded assets to selection and switch to library tab\n addAssetsToSelection(uploadedAssets);\n setSelectedTab('library');\n },\n getErrorMessage: () => translate('Failed_to_upload_assets_try_again'),\n });\n\n // Reset state when modal opens/closes\n useEffect(() => {\n if (!open) {\n clearSelection();\n clearUploadedFiles();\n clearSaveUploadError();\n }\n }, [open, clearSelection, clearUploadedFiles, clearSaveUploadError]);\n\n const handleCancel = useCallback((): void => {\n clearSelection();\n onClose();\n }, [onClose, clearSelection]);\n\n const handleSelectAssets = useCallback((): void => {\n if (selectedAssetsMap.size === 0) {\n onClose();\n return;\n }\n const selectedAssets = Array.from(selectedAssetsMap.values());\n if (onSelect && selectedAssets.length > 0) {\n onSelect(selectedAssets);\n }\n clearSelection();\n onClose();\n }, [onSelect, selectedAssetsMap, onClose, clearSelection]);\n\n const getTitle = (): string => {\n switch (selectedTab) {\n case 'library':\n return translate('Select_Images');\n default:\n return translate('Upload_Images');\n }\n };\n\n // Tab-specific action button configurations\n const actionButtons = useMemo<ModalAction[]>(() => {\n // Common cancel button configuration\n const cancelButton: ModalAction = {\n label: translate('Cancel'),\n onClick: handleCancel,\n variant: 'secondary',\n tone: 'neutral',\n id: 'asset-manager-cancel',\n };\n\n const tabActions: Record<string, ModalAction[]> = {\n library: [\n cancelButton,\n {\n label: translate('Select'),\n onClick: handleSelectAssets,\n variant: 'primary',\n id: 'asset-manager-select',\n },\n ],\n upload: [\n cancelButton,\n {\n label: translate('Save'),\n onClick: handleSave,\n disabled: isUploading,\n variant: 'primary',\n id: 'asset-manager-upload',\n },\n ],\n };\n\n return tabActions[selectedTab] ?? (tabActions['library'] as ModalAction[]);\n }, [selectedTab, isUploading, handleCancel, handleSelectAssets, handleSave, translate]);\n\n return (\n <Modal actions={actionButtons} onClose={handleCancel} open={open} size=\"large\" title={getTitle()}>\n <Tabs\n fdKey=\"asset-manager-tabs\"\n onChange={(_, value: string) => {\n setSelectedTab(value);\n clearUploadedFiles();\n }}\n value={selectedTab}\n >\n <Tab label={translate('Upload')} value=\"upload\" />\n <Tab label={translate('Library')} value=\"library\" />\n </Tabs>\n <StyledScrollableContent>\n {selectedTab === 'library' ? (\n <LibraryTabContent\n assets={assetResponse?.data}\n error={assetsError}\n isLoading={isLoadingAssets}\n onAssetClick={handleAssetClick}\n selectedAssets={selectedAssetsMap}\n />\n ) : (\n <UploadAssetContent\n error={uploadError}\n files={uploadedFiles}\n onRemove={handleRemove}\n onUpload={handleUpload}\n />\n )}\n </StyledScrollableContent>\n </Modal>\n );\n};\n\n/**\n * AssetManager component used to select assets from the library or upload new assets.\n * Can manage assets at a organization or brand level.\n *\n * @example\n * ```tsx\n * <AssetManager\n * open={isOpen}\n * onClose={() => setIsOpen(false)}\n * onSelect={(assets) => console.log(assets)}\n * orgId=\"org123\"\n * brandId=\"brand456\"\n * maxSelect={3}\n * />\n * ```\n */\nconst AssetManager: React.FC<AssetManagerProps> = (props) => {\n return (\n <QueryClientProvider client={queryClient}>\n <AssetManagerContent {...props} />\n </QueryClientProvider>\n );\n};\n\nexport type { Asset, AssetMetadata, AssetMetadataDimensions, AssetType } from './types/assets.type';\nexport default AssetManager;\n"],"names":["StyledScrollableContent","styled","Box","theme","height","overflowY","marginTop","spacing","marginRight","marginLeft","marginBottom","paddingRight","paddingLeft","paddingBottom","queryClient","QueryClient","defaultOptions","queries","refetchOnWindowFocus","retry","AssetManagerContent","open","onClose","onSelect","orgId","brandId","maxSelect","selectedTab","setSelectedTab","useState","translate","useTranslation","data","assetResponse","isLoading","isLoadingAssets","error","assetsError","useGetAssets","selectedAssetsMap","handleAssetClick","clearSelection","addAssetsToSelection","useAssetSelection","uploadedFiles","uploadError","isUploading","handleUpload","handleRemove","handleSave","clearUploadedFiles","clearSaveUploadError","useAssetUploadManager","onUploadSuccess","uploadedAssets","getErrorMessage","useEffect","handleCancel","useCallback","handleSelectAssets","size","selectedAssets","Array","from","values","length","actionButtons","useMemo","cancelButton","label","onClick","variant","tone","id","tabActions","library","upload","disabled","_jsxs","Modal","actions","title","Tabs","fdKey","onChange","_","value","_jsx","Tab","children","LibraryTabContent","assets","onAssetClick","UploadAssetContent","files","onRemove","onUpload","props","QueryClientProvider","client"],"mappings":"+kBAsBA,MAAMA,EAA0BC,EAAAA,OAAOC,EAAPD,EAAY,EAAGE,YAAO,CACpDC,OAAQ,qBACRC,UAAW,OACXC,UAAWH,EAAMI,QAAQ,GACzBC,YAAaL,EAAMI,YACnBE,WAAYN,EAAMI,YAClBG,aAAcP,EAAMI,YACpBI,aAAcR,EAAMI,QAAQ,GAC5BK,YAAaT,EAAMI,QAAQ,GAC3BM,cAAeV,EAAMI,QAAQ,OAgCzBO,EAAc,IAAIC,EAAAA,YAAY,CAClCC,eAAgB,CACdC,QAAS,CACPC,sBAAsB,EACtBC,MAAO,MASPC,EAAmD,EACvDC,OACAC,UACAC,WACAC,QACAC,UACAC,YAAY,MAEZ,MAAOC,EAAaC,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,EAAYnB,IAE5E,OACEgD,OAACC,EAAK,CAACC,QAASd,EAAe5C,QAASmC,EAAcpC,KAAMA,EAAMuC,KAAK,QAAQqB,MA3CpEnD,EADJ,YADCH,EAEa,gBAEA,2BA0CnBmD,EAAAA,KAACI,GACCC,MAAM,qBACNC,SAAU,CAACC,EAAGC,KACZ1D,EAAe0D,GACfpC,KAEFoC,MAAO3D,YAEP4D,EAAAA,IAACC,GAAInB,MAAOvC,EAAU,UAAWwD,MAAM,WACvCC,MAACC,EAAG,CAACnB,MAAOvC,EAAU,WAAYwD,MAAM,eAE1CC,EAAAA,IAACvF,EAAuB,CAAAyF,SACL,YAAhB9D,EACC4D,EAAAA,IAACG,EAAiB,CAChBC,OAAQ1D,GAAeD,KACvBI,MAAOC,EACPH,UAAWC,EACXyD,aAAcpD,EACdqB,eAAgBtB,IAGlBgD,EAAAA,IAACM,GACCzD,MAAOS,EACPiD,MAAOlD,EACPmD,SAAU/C,EACVgD,SAAUjD,yBAwB6BkD,GAE/CV,MAACW,EAAAA,oBAAmB,CAACC,OAAQrF,EAAW2E,SACtCF,EAAAA,IAACnE,EAAmB,IAAK6E"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/organisms/AssetManager/index.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport Box from '@fd/components/atoms/Box';\nimport Tab from '@fd/components/atoms/Tab';\nimport Modal, { type ModalAction } from '@fd/components/molecules/Modal';\nimport Tabs from '@fd/components/molecules/Tabs';\nimport { useTranslation } from '@fd/providers/TranslationProvider';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n\nimport { useAssetSelection } from './hooks/useAssetSelection';\nimport { useAssetUploadManager } from './hooks/useAssetUploadManager';\nimport { useGetAssets } from './hooks/useGetAssets';\nimport LibraryTabContent from './LibraryTabContent';\nimport type { Asset } from './types/assets.type';\nimport UploadAssetContent from './UploadTabContent';\n/**\n * Scrollable container for the tab content.\n * Allows the asset list to scroll while keeping the modal title, tabs, and actions visible.\n * Uses fixed height to prevent modal resizing when switching tabs.\n */\nconst StyledScrollableContent = styled(Box)(({ theme }) => ({\n height: 'calc(70vh - 200px)', // Fixed height for consistent modal size across tabs\n overflowY: 'auto',\n marginTop: theme.spacing(2),\n marginRight: theme.spacing(-2), // Extend to edge for scrollbar\n marginLeft: theme.spacing(-1), // Allow space for shadows on left\n marginBottom: theme.spacing(-1), // Allow space for shadows on bottom\n paddingRight: theme.spacing(2), // Compensate for negative margin\n paddingLeft: theme.spacing(1), // Compensate for negative margin\n paddingBottom: theme.spacing(1), // Compensate for negative margin\n}));\n\n/**\n * Props for the AssetManager component.\n * Provides a modal interface for selecting images from a grid display.\n * It supports both single and multiple image selection modes with configurable limits.\n *\n * import AssetManager from '@flipdish/portal-library/components/organisms/AssetManager';\n *\n * ```tsx\n * import AssetManager from '@flipdish/portal-library/components/organisms/AssetManager';\n */\nexport interface AssetManagerProps {\n /** Whether the asset manager modal is open */\n open: boolean;\n /** Callback function when the modal is closed or cancelled */\n onClose: () => void;\n /** Callback function when assets are selected */\n onSelect?: (selectedAssets: Asset[]) => void;\n /**\n * Organization ID for fetching assets\n */\n orgId: string;\n /** Brand ID for fetching assets */\n brandId?: string;\n /** Maximum number of assets that can be selected. Defaults to 1 */\n maxSelect?: number;\n}\n\n// Create a QueryClient instance for the AssetManager component\n// This allows the component to be used without requiring clients to wrap it in QueryClientProvider\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n retry: 2,\n },\n },\n});\n\n/**\n * Inner component that contains the AssetManager logic.\n * Must be rendered inside QueryClientProvider to use React Query hooks.\n */\nconst AssetManagerContent: React.FC<AssetManagerProps> = ({\n open,\n onClose,\n onSelect,\n orgId,\n brandId,\n maxSelect = 1,\n}) => {\n const [selectedTab, setSelectedTab] = useState<string>('library');\n const { translate } = useTranslation();\n\n // Fetch assets at the parent level to enable future reuse across tabs\n const {\n data: assetResponse,\n isLoading: isLoadingAssets,\n error: assetsError,\n } = useGetAssets(orgId, open, brandId);\n\n // Asset selection hook - manages selected assets from library\n const { selectedAssetsMap, handleAssetClick, clearSelection, addAssetsToSelection } = useAssetSelection({\n maxSelect,\n });\n\n // Asset upload hook - manages file uploads and upload state\n const {\n uploadedFiles,\n uploadError,\n isUploading,\n handleUpload,\n handleRemove,\n handleSave,\n clearUploadedFiles,\n clearSaveUploadError,\n } = useAssetUploadManager({\n orgId,\n brandId,\n onUploadSuccess: (uploadedAssets) => {\n // Add uploaded assets to selection and switch to library tab\n addAssetsToSelection(uploadedAssets);\n setSelectedTab('library');\n },\n getErrorMessage: () => translate('Failed_to_upload_assets_try_again'),\n });\n\n // Reset state when modal opens/closes\n useEffect(() => {\n if (!open) {\n clearSelection();\n clearUploadedFiles();\n clearSaveUploadError();\n }\n }, [open, clearSelection, clearUploadedFiles, clearSaveUploadError]);\n\n const handleCancel = useCallback((): void => {\n clearSelection();\n onClose();\n }, [onClose, clearSelection]);\n\n const handleSelectAssets = useCallback((): void => {\n if (selectedAssetsMap.size === 0) {\n onClose();\n return;\n }\n const selectedAssets = Array.from(selectedAssetsMap.values());\n if (onSelect && selectedAssets.length > 0) {\n onSelect(selectedAssets);\n }\n clearSelection();\n onClose();\n }, [onSelect, selectedAssetsMap, onClose, clearSelection]);\n\n const getTitle = (): string => {\n switch (selectedTab) {\n case 'library':\n return translate('Select_Images');\n default:\n return translate('Upload_Images');\n }\n };\n\n // Tab-specific action button configurations\n const actionButtons = useMemo<ModalAction[]>(() => {\n // Common cancel button configuration\n const cancelButton: ModalAction = {\n label: translate('Cancel'),\n onClick: handleCancel,\n variant: 'secondary',\n tone: 'neutral',\n id: 'asset-manager-cancel',\n };\n\n const tabActions: Record<string, ModalAction[]> = {\n library: [\n cancelButton,\n {\n label: translate('Select'),\n onClick: handleSelectAssets,\n variant: 'primary',\n id: 'asset-manager-select',\n },\n ],\n upload: [\n cancelButton,\n {\n label: translate('Save'),\n onClick: handleSave,\n loading: isUploading,\n variant: 'primary',\n id: 'asset-manager-upload',\n },\n ],\n };\n\n return tabActions[selectedTab] ?? (tabActions['library'] as ModalAction[]);\n }, [selectedTab, isUploading, handleCancel, handleSelectAssets, handleSave, translate]);\n\n return (\n <Modal actions={actionButtons} onClose={handleCancel} open={open} size=\"large\" title={getTitle()}>\n <Tabs\n fdKey=\"asset-manager-tabs\"\n onChange={(_, value: string) => {\n setSelectedTab(value);\n clearUploadedFiles();\n }}\n value={selectedTab}\n >\n <Tab label={translate('Upload')} value=\"upload\" />\n <Tab label={translate('Library')} value=\"library\" />\n </Tabs>\n <StyledScrollableContent>\n {selectedTab === 'library' ? (\n <LibraryTabContent\n assets={assetResponse?.data}\n error={assetsError}\n isLoading={isLoadingAssets}\n onAssetClick={handleAssetClick}\n selectedAssets={selectedAssetsMap}\n />\n ) : (\n <UploadAssetContent\n error={uploadError}\n files={uploadedFiles}\n onRemove={handleRemove}\n onUpload={handleUpload}\n />\n )}\n </StyledScrollableContent>\n </Modal>\n );\n};\n\n/**\n * AssetManager component used to select assets from the library or upload new assets.\n * Can manage assets at a organization or brand level.\n *\n * @example\n * ```tsx\n * <AssetManager\n * open={isOpen}\n * onClose={() => setIsOpen(false)}\n * onSelect={(assets) => console.log(assets)}\n * orgId=\"org123\"\n * brandId=\"brand456\"\n * maxSelect={3}\n * />\n * ```\n */\nconst AssetManager: React.FC<AssetManagerProps> = (props) => {\n return (\n <QueryClientProvider client={queryClient}>\n <AssetManagerContent {...props} />\n </QueryClientProvider>\n );\n};\n\nexport type { Asset, AssetMetadata, AssetMetadataDimensions, AssetType } from './types/assets.type';\nexport default AssetManager;\n"],"names":["StyledScrollableContent","styled","Box","theme","height","overflowY","marginTop","spacing","marginRight","marginLeft","marginBottom","paddingRight","paddingLeft","paddingBottom","queryClient","QueryClient","defaultOptions","queries","refetchOnWindowFocus","retry","AssetManagerContent","open","onClose","onSelect","orgId","brandId","maxSelect","selectedTab","setSelectedTab","useState","translate","useTranslation","data","assetResponse","isLoading","isLoadingAssets","error","assetsError","useGetAssets","selectedAssetsMap","handleAssetClick","clearSelection","addAssetsToSelection","useAssetSelection","uploadedFiles","uploadError","isUploading","handleUpload","handleRemove","handleSave","clearUploadedFiles","clearSaveUploadError","useAssetUploadManager","onUploadSuccess","uploadedAssets","getErrorMessage","useEffect","handleCancel","useCallback","handleSelectAssets","size","selectedAssets","Array","from","values","length","actionButtons","useMemo","cancelButton","label","onClick","variant","tone","id","tabActions","library","upload","loading","_jsxs","Modal","actions","title","Tabs","fdKey","onChange","_","value","_jsx","Tab","children","LibraryTabContent","assets","onAssetClick","UploadAssetContent","files","onRemove","onUpload","props","QueryClientProvider","client"],"mappings":"+kBAsBA,MAAMA,EAA0BC,EAAAA,OAAOC,EAAPD,EAAY,EAAGE,YAAO,CACpDC,OAAQ,qBACRC,UAAW,OACXC,UAAWH,EAAMI,QAAQ,GACzBC,YAAaL,EAAMI,YACnBE,WAAYN,EAAMI,YAClBG,aAAcP,EAAMI,YACpBI,aAAcR,EAAMI,QAAQ,GAC5BK,YAAaT,EAAMI,QAAQ,GAC3BM,cAAeV,EAAMI,QAAQ,OAgCzBO,EAAc,IAAIC,EAAAA,YAAY,CAClCC,eAAgB,CACdC,QAAS,CACPC,sBAAsB,EACtBC,MAAO,MASPC,EAAmD,EACvDC,OACAC,UACAC,WACAC,QACAC,UACAC,YAAY,MAEZ,MAAOC,EAAaC,GAAkBC,EAAAA,SAAiB,YACjDC,UAAEA,GAAcC,oBAIpBC,KAAMC,EACNC,UAAWC,EACXC,MAAOC,GACLC,EAAAA,aAAad,EAAOH,EAAMI,IAGxBc,kBAAEA,EAAiBC,iBAAEA,EAAgBC,eAAEA,EAAcC,qBAAEA,GAAyBC,EAAAA,kBAAkB,CACtGjB,eAIIkB,cACJA,EAAaC,YACbA,EAAWC,YACXA,EAAWC,aACXA,EAAYC,aACZA,EAAYC,WACZA,EAAUC,mBACVA,EAAkBC,qBAClBA,GACEC,wBAAsB,CACxB5B,QAC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eAE1CC,EAAAA,IAACvF,EAAuB,CAAAyF,SACL,YAAhB9D,EACC4D,EAAAA,IAACG,EAAiB,CAChBC,OAAQ1D,GAAeD,KACvBI,MAAOC,EACPH,UAAWC,EACXyD,aAAcpD,EACdqB,eAAgBtB,IAGlBgD,EAAAA,IAACM,GACCzD,MAAOS,EACPiD,MAAOlD,EACPmD,SAAU/C,EACVgD,SAAUjD,yBAwB6BkD,GAE/CV,MAACW,EAAAA,oBAAmB,CAACC,OAAQrF,EAAW2E,SACtCF,EAAAA,IAACnE,EAAmB,IAAK6E"}
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useState as r,useEffect as o,useCallback as s,useMemo as t}from"react";import{styled as i}from"@mui/material/styles";import l from"@mui/material/Box";import n from"../../atoms/Tab/index.js";import d from"../../molecules/Modal/index.js";import m from"../../molecules/Tabs/index.js";import{useTranslation as c}from"../../../providers/TranslationProvider.js";import{QueryClient as p,QueryClientProvider as g}from"@tanstack/react-query";import{useAssetSelection as u}from"./hooks/useAssetSelection.js";import{useAssetUploadManager as f}from"./hooks/useAssetUploadManager.js";import{useGetAssets as b}from"./hooks/useGetAssets.js";import h from"./LibraryTabContent/index.js";import y from"./UploadTabContent/index.js";const v=i(l)((({theme:e})=>({height:"calc(70vh - 200px)",overflowY:"auto",marginTop:e.spacing(2),marginRight:e.spacing(-2),marginLeft:e.spacing(-1),marginBottom:e.spacing(-1),paddingRight:e.spacing(2),paddingLeft:e.spacing(1),paddingBottom:e.spacing(1)}))),S=new p({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:2}}}),x=({open:i,onClose:l,onSelect:p,orgId:g,brandId:S,maxSelect:x=1})=>{const[C,j]=r("library"),{translate:U}=c(),{data:k,isLoading:A,error:T}=b(g,i,S),{selectedAssetsMap:_,handleAssetClick:I,clearSelection:L,addAssetsToSelection:F}=u({maxSelect:x}),{uploadedFiles:M,uploadError:R,isUploading:w,handleUpload:B,handleRemove:E,handleSave:q,clearUploadedFiles:z,clearSaveUploadError:O}=f({orgId:g,brandId:S,onUploadSuccess:e=>{F(e),j("library")},getErrorMessage:()=>U("Failed_to_upload_assets_try_again")});o((()=>{i||(L(),z(),O())}),[i,L,z,O]);const G=s((()=>{L(),l()}),[l,L]),K=s((()=>{if(0===_.size)return void l();const e=Array.from(_.values());p&&e.length>0&&p(e),L(),l()}),[p,_,l,L]),P=t((()=>{const e={label:U("Cancel"),onClick:G,variant:"secondary",tone:"neutral",id:"asset-manager-cancel"},a={library:[e,{label:U("Select"),onClick:K,variant:"primary",id:"asset-manager-select"}],upload:[e,{label:U("Save"),onClick:q,disabled:w,variant:"primary",id:"asset-manager-upload"}]};return a[C]??a.library}),[C,w,G,K,q,U]);return a(d,{actions:P,onClose:G,open:i,size:"large",title:U("library"===C?"Select_Images":"Upload_Images"),children:[a(m,{fdKey:"asset-manager-tabs",onChange:(e,a)=>{j(a),z()},value:C,children:[e(n,{label:U("Upload"),value:"upload"}),e(n,{label:U("Library"),value:"library"})]}),e(v,{children:"library"===C?e(h,{assets:k?.data,error:T,isLoading:A,onAssetClick:I,selectedAssets:_}):e(y,{error:R,files:M,onRemove:E,onUpload:B})})]})},C=a=>e(g,{client:S,children:e(x,{...a})});export{C as default};
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useState as r,useEffect as o,useCallback as s,useMemo as t}from"react";import{styled as i}from"@mui/material/styles";import l from"@mui/material/Box";import n from"../../atoms/Tab/index.js";import d from"../../molecules/Modal/index.js";import m from"../../molecules/Tabs/index.js";import{useTranslation as c}from"../../../providers/TranslationProvider.js";import{QueryClient as p,QueryClientProvider as g}from"@tanstack/react-query";import{useAssetSelection as u}from"./hooks/useAssetSelection.js";import{useAssetUploadManager as f}from"./hooks/useAssetUploadManager.js";import{useGetAssets as b}from"./hooks/useGetAssets.js";import h from"./LibraryTabContent/index.js";import y from"./UploadTabContent/index.js";const v=i(l)((({theme:e})=>({height:"calc(70vh - 200px)",overflowY:"auto",marginTop:e.spacing(2),marginRight:e.spacing(-2),marginLeft:e.spacing(-1),marginBottom:e.spacing(-1),paddingRight:e.spacing(2),paddingLeft:e.spacing(1),paddingBottom:e.spacing(1)}))),S=new p({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:2}}}),x=({open:i,onClose:l,onSelect:p,orgId:g,brandId:S,maxSelect:x=1})=>{const[C,j]=r("library"),{translate:U}=c(),{data:k,isLoading:A,error:T}=b(g,i,S),{selectedAssetsMap:_,handleAssetClick:I,clearSelection:L,addAssetsToSelection:F}=u({maxSelect:x}),{uploadedFiles:M,uploadError:R,isUploading:w,handleUpload:B,handleRemove:E,handleSave:q,clearUploadedFiles:z,clearSaveUploadError:O}=f({orgId:g,brandId:S,onUploadSuccess:e=>{F(e),j("library")},getErrorMessage:()=>U("Failed_to_upload_assets_try_again")});o((()=>{i||(L(),z(),O())}),[i,L,z,O]);const G=s((()=>{L(),l()}),[l,L]),K=s((()=>{if(0===_.size)return void l();const e=Array.from(_.values());p&&e.length>0&&p(e),L(),l()}),[p,_,l,L]),P=t((()=>{const e={label:U("Cancel"),onClick:G,variant:"secondary",tone:"neutral",id:"asset-manager-cancel"},a={library:[e,{label:U("Select"),onClick:K,variant:"primary",id:"asset-manager-select"}],upload:[e,{label:U("Save"),onClick:q,loading:w,variant:"primary",id:"asset-manager-upload"}]};return a[C]??a.library}),[C,w,G,K,q,U]);return a(d,{actions:P,onClose:G,open:i,size:"large",title:U("library"===C?"Select_Images":"Upload_Images"),children:[a(m,{fdKey:"asset-manager-tabs",onChange:(e,a)=>{j(a),z()},value:C,children:[e(n,{label:U("Upload"),value:"upload"}),e(n,{label:U("Library"),value:"library"})]}),e(v,{children:"library"===C?e(h,{assets:k?.data,error:T,isLoading:A,onAssetClick:I,selectedAssets:_}):e(y,{error:R,files:M,onRemove:E,onUpload:B})})]})},C=a=>e(g,{client:S,children:e(x,{...a})});export{C as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/organisms/AssetManager/index.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport Box from '@fd/components/atoms/Box';\nimport Tab from '@fd/components/atoms/Tab';\nimport Modal, { type ModalAction } from '@fd/components/molecules/Modal';\nimport Tabs from '@fd/components/molecules/Tabs';\nimport { useTranslation } from '@fd/providers/TranslationProvider';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n\nimport { useAssetSelection } from './hooks/useAssetSelection';\nimport { useAssetUploadManager } from './hooks/useAssetUploadManager';\nimport { useGetAssets } from './hooks/useGetAssets';\nimport LibraryTabContent from './LibraryTabContent';\nimport type { Asset } from './types/assets.type';\nimport UploadAssetContent from './UploadTabContent';\n/**\n * Scrollable container for the tab content.\n * Allows the asset list to scroll while keeping the modal title, tabs, and actions visible.\n * Uses fixed height to prevent modal resizing when switching tabs.\n */\nconst StyledScrollableContent = styled(Box)(({ theme }) => ({\n height: 'calc(70vh - 200px)', // Fixed height for consistent modal size across tabs\n overflowY: 'auto',\n marginTop: theme.spacing(2),\n marginRight: theme.spacing(-2), // Extend to edge for scrollbar\n marginLeft: theme.spacing(-1), // Allow space for shadows on left\n marginBottom: theme.spacing(-1), // Allow space for shadows on bottom\n paddingRight: theme.spacing(2), // Compensate for negative margin\n paddingLeft: theme.spacing(1), // Compensate for negative margin\n paddingBottom: theme.spacing(1), // Compensate for negative margin\n}));\n\n/**\n * Props for the AssetManager component.\n * Provides a modal interface for selecting images from a grid display.\n * It supports both single and multiple image selection modes with configurable limits.\n *\n * import AssetManager from '@flipdish/portal-library/components/organisms/AssetManager';\n *\n * ```tsx\n * import AssetManager from '@flipdish/portal-library/components/organisms/AssetManager';\n */\nexport interface AssetManagerProps {\n /** Whether the asset manager modal is open */\n open: boolean;\n /** Callback function when the modal is closed or cancelled */\n onClose: () => void;\n /** Callback function when assets are selected */\n onSelect?: (selectedAssets: Asset[]) => void;\n /**\n * Organization ID for fetching assets\n */\n orgId: string;\n /** Brand ID for fetching assets */\n brandId?: string;\n /** Maximum number of assets that can be selected. Defaults to 1 */\n maxSelect?: number;\n}\n\n// Create a QueryClient instance for the AssetManager component\n// This allows the component to be used without requiring clients to wrap it in QueryClientProvider\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n retry: 2,\n },\n },\n});\n\n/**\n * Inner component that contains the AssetManager logic.\n * Must be rendered inside QueryClientProvider to use React Query hooks.\n */\nconst AssetManagerContent: React.FC<AssetManagerProps> = ({\n open,\n onClose,\n onSelect,\n orgId,\n brandId,\n maxSelect = 1,\n}) => {\n const [selectedTab, setSelectedTab] = useState<string>('library');\n const { translate } = useTranslation();\n\n // Fetch assets at the parent level to enable future reuse across tabs\n const {\n data: assetResponse,\n isLoading: isLoadingAssets,\n error: assetsError,\n } = useGetAssets(orgId, open, brandId);\n\n // Asset selection hook - manages selected assets from library\n const { selectedAssetsMap, handleAssetClick, clearSelection, addAssetsToSelection } = useAssetSelection({\n maxSelect,\n });\n\n // Asset upload hook - manages file uploads and upload state\n const {\n uploadedFiles,\n uploadError,\n isUploading,\n handleUpload,\n handleRemove,\n handleSave,\n clearUploadedFiles,\n clearSaveUploadError,\n } = useAssetUploadManager({\n orgId,\n brandId,\n onUploadSuccess: (uploadedAssets) => {\n // Add uploaded assets to selection and switch to library tab\n addAssetsToSelection(uploadedAssets);\n setSelectedTab('library');\n },\n getErrorMessage: () => translate('Failed_to_upload_assets_try_again'),\n });\n\n // Reset state when modal opens/closes\n useEffect(() => {\n if (!open) {\n clearSelection();\n clearUploadedFiles();\n clearSaveUploadError();\n }\n }, [open, clearSelection, clearUploadedFiles, clearSaveUploadError]);\n\n const handleCancel = useCallback((): void => {\n clearSelection();\n onClose();\n }, [onClose, clearSelection]);\n\n const handleSelectAssets = useCallback((): void => {\n if (selectedAssetsMap.size === 0) {\n onClose();\n return;\n }\n const selectedAssets = Array.from(selectedAssetsMap.values());\n if (onSelect && selectedAssets.length > 0) {\n onSelect(selectedAssets);\n }\n clearSelection();\n onClose();\n }, [onSelect, selectedAssetsMap, onClose, clearSelection]);\n\n const getTitle = (): string => {\n switch (selectedTab) {\n case 'library':\n return translate('Select_Images');\n default:\n return translate('Upload_Images');\n }\n };\n\n // Tab-specific action button configurations\n const actionButtons = useMemo<ModalAction[]>(() => {\n // Common cancel button configuration\n const cancelButton: ModalAction = {\n label: translate('Cancel'),\n onClick: handleCancel,\n variant: 'secondary',\n tone: 'neutral',\n id: 'asset-manager-cancel',\n };\n\n const tabActions: Record<string, ModalAction[]> = {\n library: [\n cancelButton,\n {\n label: translate('Select'),\n onClick: handleSelectAssets,\n variant: 'primary',\n id: 'asset-manager-select',\n },\n ],\n upload: [\n cancelButton,\n {\n label: translate('Save'),\n onClick: handleSave,\n disabled: isUploading,\n variant: 'primary',\n id: 'asset-manager-upload',\n },\n ],\n };\n\n return tabActions[selectedTab] ?? (tabActions['library'] as ModalAction[]);\n }, [selectedTab, isUploading, handleCancel, handleSelectAssets, handleSave, translate]);\n\n return (\n <Modal actions={actionButtons} onClose={handleCancel} open={open} size=\"large\" title={getTitle()}>\n <Tabs\n fdKey=\"asset-manager-tabs\"\n onChange={(_, value: string) => {\n setSelectedTab(value);\n clearUploadedFiles();\n }}\n value={selectedTab}\n >\n <Tab label={translate('Upload')} value=\"upload\" />\n <Tab label={translate('Library')} value=\"library\" />\n </Tabs>\n <StyledScrollableContent>\n {selectedTab === 'library' ? (\n <LibraryTabContent\n assets={assetResponse?.data}\n error={assetsError}\n isLoading={isLoadingAssets}\n onAssetClick={handleAssetClick}\n selectedAssets={selectedAssetsMap}\n />\n ) : (\n <UploadAssetContent\n error={uploadError}\n files={uploadedFiles}\n onRemove={handleRemove}\n onUpload={handleUpload}\n />\n )}\n </StyledScrollableContent>\n </Modal>\n );\n};\n\n/**\n * AssetManager component used to select assets from the library or upload new assets.\n * Can manage assets at a organization or brand level.\n *\n * @example\n * ```tsx\n * <AssetManager\n * open={isOpen}\n * onClose={() => setIsOpen(false)}\n * onSelect={(assets) => console.log(assets)}\n * orgId=\"org123\"\n * brandId=\"brand456\"\n * maxSelect={3}\n * />\n * ```\n */\nconst AssetManager: React.FC<AssetManagerProps> = (props) => {\n return (\n <QueryClientProvider client={queryClient}>\n <AssetManagerContent {...props} />\n </QueryClientProvider>\n );\n};\n\nexport type { Asset, AssetMetadata, AssetMetadataDimensions, AssetType } from './types/assets.type';\nexport default AssetManager;\n"],"names":["StyledScrollableContent","styled","Box","theme","height","overflowY","marginTop","spacing","marginRight","marginLeft","marginBottom","paddingRight","paddingLeft","paddingBottom","queryClient","QueryClient","defaultOptions","queries","refetchOnWindowFocus","retry","AssetManagerContent","open","onClose","onSelect","orgId","brandId","maxSelect","selectedTab","setSelectedTab","useState","translate","useTranslation","data","assetResponse","isLoading","isLoadingAssets","error","assetsError","useGetAssets","selectedAssetsMap","handleAssetClick","clearSelection","addAssetsToSelection","useAssetSelection","uploadedFiles","uploadError","isUploading","handleUpload","handleRemove","handleSave","clearUploadedFiles","clearSaveUploadError","useAssetUploadManager","onUploadSuccess","uploadedAssets","getErrorMessage","useEffect","handleCancel","useCallback","handleSelectAssets","size","selectedAssets","Array","from","values","length","actionButtons","useMemo","cancelButton","label","onClick","variant","tone","id","tabActions","library","upload","disabled","_jsxs","Modal","actions","title","Tabs","fdKey","onChange","_","value","_jsx","Tab","children","LibraryTabContent","assets","onAssetClick","UploadAssetContent","files","onRemove","onUpload","AssetManager","props","QueryClientProvider","client"],"mappings":"kwBAsBA,MAAMA,EAA0BC,EAAOC,EAAPD,EAAY,EAAGE,YAAO,CACpDC,OAAQ,qBACRC,UAAW,OACXC,UAAWH,EAAMI,QAAQ,GACzBC,YAAaL,EAAMI,YACnBE,WAAYN,EAAMI,YAClBG,aAAcP,EAAMI,YACpBI,aAAcR,EAAMI,QAAQ,GAC5BK,YAAaT,EAAMI,QAAQ,GAC3BM,cAAeV,EAAMI,QAAQ,OAgCzBO,EAAc,IAAIC,EAAY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KV,OAAOC,EAAW/C,IAAiB+C,EAAoB,UACtD,CAAC/C,EAAamB,EAAaW,EAAcE,EAAoBV,EAAYnB,IAE5E,OACEgD,EAACC,EAAK,CAACC,QAASd,EAAe5C,QAASmC,EAAcpC,KAAMA,EAAMuC,KAAK,QAAQqB,MA3CpEnD,EADJ,YADCH,EAEa,gBAEA,2BA0CnBmD,EAACI,GACCC,MAAM,qBACNC,SAAU,CAACC,EAAGC,KACZ1D,EAAe0D,GACfpC,KAEFoC,MAAO3D,YAEP4D,EAACC,GAAInB,MAAOvC,EAAU,UAAWwD,MAAM,WACvCC,EAACC,EAAG,CAACnB,MAAOvC,EAAU,WAAYwD,MAAM,eAE1CC,EAACvF,EAAuB,CAAAyF,SACL,YAAhB9D,EACC4D,EAACG,EAAiB,CAChBC,OAAQ1D,GAAeD,KACvBI,MAAOC,EACPH,UAAWC,EACXyD,aAAcpD,EACdqB,eAAgBtB,IAGlBgD,EAACM,GACCzD,MAAOS,EACPiD,MAAOlD,EACPmD,SAAU/C,EACVgD,SAAUjD,UAwBhBkD,EAA6CC,GAE/CX,EAACY,EAAmB,CAACC,OAAQtF,EAAW2E,SACtCF,EAACnE,EAAmB,IAAK8E"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/organisms/AssetManager/index.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport Box from '@fd/components/atoms/Box';\nimport Tab from '@fd/components/atoms/Tab';\nimport Modal, { type ModalAction } from '@fd/components/molecules/Modal';\nimport Tabs from '@fd/components/molecules/Tabs';\nimport { useTranslation } from '@fd/providers/TranslationProvider';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n\nimport { useAssetSelection } from './hooks/useAssetSelection';\nimport { useAssetUploadManager } from './hooks/useAssetUploadManager';\nimport { useGetAssets } from './hooks/useGetAssets';\nimport LibraryTabContent from './LibraryTabContent';\nimport type { Asset } from './types/assets.type';\nimport UploadAssetContent from './UploadTabContent';\n/**\n * Scrollable container for the tab content.\n * Allows the asset list to scroll while keeping the modal title, tabs, and actions visible.\n * Uses fixed height to prevent modal resizing when switching tabs.\n */\nconst StyledScrollableContent = styled(Box)(({ theme }) => ({\n height: 'calc(70vh - 200px)', // Fixed height for consistent modal size across tabs\n overflowY: 'auto',\n marginTop: theme.spacing(2),\n marginRight: theme.spacing(-2), // Extend to edge for scrollbar\n marginLeft: theme.spacing(-1), // Allow space for shadows on left\n marginBottom: theme.spacing(-1), // Allow space for shadows on bottom\n paddingRight: theme.spacing(2), // Compensate for negative margin\n paddingLeft: theme.spacing(1), // Compensate for negative margin\n paddingBottom: theme.spacing(1), // Compensate for negative margin\n}));\n\n/**\n * Props for the AssetManager component.\n * Provides a modal interface for selecting images from a grid display.\n * It supports both single and multiple image selection modes with configurable limits.\n *\n * import AssetManager from '@flipdish/portal-library/components/organisms/AssetManager';\n *\n * ```tsx\n * import AssetManager from '@flipdish/portal-library/components/organisms/AssetManager';\n */\nexport interface AssetManagerProps {\n /** Whether the asset manager modal is open */\n open: boolean;\n /** Callback function when the modal is closed or cancelled */\n onClose: () => void;\n /** Callback function when assets are selected */\n onSelect?: (selectedAssets: Asset[]) => void;\n /**\n * Organization ID for fetching assets\n */\n orgId: string;\n /** Brand ID for fetching assets */\n brandId?: string;\n /** Maximum number of assets that can be selected. Defaults to 1 */\n maxSelect?: number;\n}\n\n// Create a QueryClient instance for the AssetManager component\n// This allows the component to be used without requiring clients to wrap it in QueryClientProvider\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n retry: 2,\n },\n },\n});\n\n/**\n * Inner component that contains the AssetManager logic.\n * Must be rendered inside QueryClientProvider to use React Query hooks.\n */\nconst AssetManagerContent: React.FC<AssetManagerProps> = ({\n open,\n onClose,\n onSelect,\n orgId,\n brandId,\n maxSelect = 1,\n}) => {\n const [selectedTab, setSelectedTab] = useState<string>('library');\n const { translate } = useTranslation();\n\n // Fetch assets at the parent level to enable future reuse across tabs\n const {\n data: assetResponse,\n isLoading: isLoadingAssets,\n error: assetsError,\n } = useGetAssets(orgId, open, brandId);\n\n // Asset selection hook - manages selected assets from library\n const { selectedAssetsMap, handleAssetClick, clearSelection, addAssetsToSelection } = useAssetSelection({\n maxSelect,\n });\n\n // Asset upload hook - manages file uploads and upload state\n const {\n uploadedFiles,\n uploadError,\n isUploading,\n handleUpload,\n handleRemove,\n handleSave,\n clearUploadedFiles,\n clearSaveUploadError,\n } = useAssetUploadManager({\n orgId,\n brandId,\n onUploadSuccess: (uploadedAssets) => {\n // Add uploaded assets to selection and switch to library tab\n addAssetsToSelection(uploadedAssets);\n setSelectedTab('library');\n },\n getErrorMessage: () => translate('Failed_to_upload_assets_try_again'),\n });\n\n // Reset state when modal opens/closes\n useEffect(() => {\n if (!open) {\n clearSelection();\n clearUploadedFiles();\n clearSaveUploadError();\n }\n }, [open, clearSelection, clearUploadedFiles, clearSaveUploadError]);\n\n const handleCancel = useCallback((): void => {\n clearSelection();\n onClose();\n }, [onClose, clearSelection]);\n\n const handleSelectAssets = useCallback((): void => {\n if (selectedAssetsMap.size === 0) {\n onClose();\n return;\n }\n const selectedAssets = Array.from(selectedAssetsMap.values());\n if (onSelect && selectedAssets.length > 0) {\n onSelect(selectedAssets);\n }\n clearSelection();\n onClose();\n }, [onSelect, selectedAssetsMap, onClose, clearSelection]);\n\n const getTitle = (): string => {\n switch (selectedTab) {\n case 'library':\n return translate('Select_Images');\n default:\n return translate('Upload_Images');\n }\n };\n\n // Tab-specific action button configurations\n const actionButtons = useMemo<ModalAction[]>(() => {\n // Common cancel button configuration\n const cancelButton: ModalAction = {\n label: translate('Cancel'),\n onClick: handleCancel,\n variant: 'secondary',\n tone: 'neutral',\n id: 'asset-manager-cancel',\n };\n\n const tabActions: Record<string, ModalAction[]> = {\n library: [\n cancelButton,\n {\n label: translate('Select'),\n onClick: handleSelectAssets,\n variant: 'primary',\n id: 'asset-manager-select',\n },\n ],\n upload: [\n cancelButton,\n {\n label: translate('Save'),\n onClick: handleSave,\n loading: isUploading,\n variant: 'primary',\n id: 'asset-manager-upload',\n },\n ],\n };\n\n return tabActions[selectedTab] ?? (tabActions['library'] as ModalAction[]);\n }, [selectedTab, isUploading, handleCancel, handleSelectAssets, handleSave, translate]);\n\n return (\n <Modal actions={actionButtons} onClose={handleCancel} open={open} size=\"large\" title={getTitle()}>\n <Tabs\n fdKey=\"asset-manager-tabs\"\n onChange={(_, value: string) => {\n setSelectedTab(value);\n clearUploadedFiles();\n }}\n value={selectedTab}\n >\n <Tab label={translate('Upload')} value=\"upload\" />\n <Tab label={translate('Library')} value=\"library\" />\n </Tabs>\n <StyledScrollableContent>\n {selectedTab === 'library' ? (\n <LibraryTabContent\n assets={assetResponse?.data}\n error={assetsError}\n isLoading={isLoadingAssets}\n onAssetClick={handleAssetClick}\n selectedAssets={selectedAssetsMap}\n />\n ) : (\n <UploadAssetContent\n error={uploadError}\n files={uploadedFiles}\n onRemove={handleRemove}\n onUpload={handleUpload}\n />\n )}\n </StyledScrollableContent>\n </Modal>\n );\n};\n\n/**\n * AssetManager component used to select assets from the library or upload new assets.\n * Can manage assets at a organization or brand level.\n *\n * @example\n * ```tsx\n * <AssetManager\n * open={isOpen}\n * onClose={() => setIsOpen(false)}\n * onSelect={(assets) => console.log(assets)}\n * orgId=\"org123\"\n * brandId=\"brand456\"\n * maxSelect={3}\n * />\n * ```\n */\nconst AssetManager: React.FC<AssetManagerProps> = (props) => {\n return (\n <QueryClientProvider client={queryClient}>\n <AssetManagerContent {...props} />\n </QueryClientProvider>\n );\n};\n\nexport type { Asset, AssetMetadata, AssetMetadataDimensions, AssetType } from './types/assets.type';\nexport default AssetManager;\n"],"names":["StyledScrollableContent","styled","Box","theme","height","overflowY","marginTop","spacing","marginRight","marginLeft","marginBottom","paddingRight","paddingLeft","paddingBottom","queryClient","QueryClient","defaultOptions","queries","refetchOnWindowFocus","retry","AssetManagerContent","open","onClose","onSelect","orgId","brandId","maxSelect","selectedTab","setSelectedTab","useState","translate","useTranslation","data","assetResponse","isLoading","isLoadingAssets","error","assetsError","useGetAssets","selectedAssetsMap","handleAssetClick","clearSelection","addAssetsToSelection","useAssetSelection","uploadedFiles","uploadError","isUploading","handleUpload","handleRemove","handleSave","clearUploadedFiles","clearSaveUploadError","useAssetUploadManager","onUploadSuccess","uploadedAssets","getErrorMessage","useEffect","handleCancel","useCallback","handleSelectAssets","size","selectedAssets","Array","from","values","length","actionButtons","useMemo","cancelButton","label","onClick","variant","tone","id","tabActions","library","upload","loading","_jsxs","Modal","actions","title","Tabs","fdKey","onChange","_","value","_jsx","Tab","children","LibraryTabContent","assets","onAssetClick","UploadAssetContent","files","onRemove","onUpload","AssetManager","props","QueryClientProvider","client"],"mappings":"kwBAsBA,MAAMA,EAA0BC,EAAOC,EAAPD,EAAY,EAAGE,YAAO,CACpDC,OAAQ,qBACRC,UAAW,OACXC,UAAWH,EAAMI,QAAQ,GACzBC,YAAaL,EAAMI,YACnBE,WAAYN,EAAMI,YAClBG,aAAcP,EAAMI,YACpBI,aAAcR,EAAMI,QAAQ,GAC5BK,YAAaT,EAAMI,QAAQ,GAC3BM,cAAeV,EAAMI,QAAQ,OAgCzBO,EAAc,IAAIC,EAAY,CAClCC,eAAgB,CACdC,QAAS,CACPC,sBAAsB,EACtBC,MAAO,MASPC,EAAmD,EACvDC,OACAC,UACAC,WACAC,QACAC,UACAC,YAAY,MAEZ,MAAOC,EAAaC,GAAkBC,EAAiB,YACjDC,UAAEA,GAAcC,KAIpBC,KAAMC,EACNC,UAAWC,EACXC,MAAOC,GACLC,EAAad,EAAOH,EAAMI,IAGxBc,kBAAEA,EAAiBC,iBAAEA,EAAgBC,eAAEA,EAAcC,qBAAEA,GAAyBC,EAAkB,CACtGjB,eAIIkB,cACJA,EAAaC,YACbA,EAAWC,YACXA,EAAWC,aACXA,EAAYC,aACZA,EAAYC,WACZA,EAAUC,mBACVA,EAAkBC,qBAClBA,GACEC,EAAsB,CACxB5B,QACAC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EACC4D,EAACG,EAAiB,CAChBC,OAAQ1D,GAAeD,KACvBI,MAAOC,EACPH,UAAWC,EACXyD,aAAcpD,EACdqB,eAAgBtB,IAGlBgD,EAACM,GACCzD,MAAOS,EACPiD,MAAOlD,EACPmD,SAAU/C,EACVgD,SAAUjD,UAwBhBkD,EAA6CC,GAE/CX,EAACY,EAAmB,CAACC,OAAQtF,EAAW2E,SACtCF,EAACnE,EAAmB,IAAK8E"}
@@ -1,2 +1,2 @@
1
- "use strict";require("../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/index.cjs.js");var e=require("../../components/organisms/AssetManager/__mocks__/mockAssets.cjs.js"),s=require("../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/http.cjs.js"),t=require("../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/HttpResponse.cjs.js");const o=[...[s.http.get("*/assets/orgs/:orgId/assets",(({request:s,params:o})=>(console.log("[MSW] Intercepted GET assets request:",s.url,"orgId:",o.orgId),t.HttpResponse.json(e.mockAssets)))),s.http.post("*/assets/orgs/:orgId/assets/upload",(async({request:s,params:o})=>{console.log("[MSW] Intercepted POST upload request:",s.url,"orgId:",o.orgId);const r=(await s.formData()).getAll("files").map((s=>e.createMockAsset({id:"asset_e3454351fw5",fileName:s.name,contentType:s.type||"image/jpeg",createdBy:"Test User",updatedBy:"Test User"})));return t.HttpResponse.json(r)}))]];exports.handlers=o;
1
+ "use strict";require("../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/index.cjs.js");var e=require("../../components/organisms/AssetManager/__mocks__/mockAssets.cjs.js"),s=require("../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/http.cjs.js"),t=require("../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/HttpResponse.cjs.js");const o=[...[s.http.get("*/assets/orgs/:orgId/assets",(({request:s,params:o})=>(console.log("[MSW] Intercepted GET assets request:",s.url,"orgId:",o.orgId),t.HttpResponse.json(e.mockAssets)))),s.http.post("*/assets/orgs/:orgId/assets/upload",(async({request:s,params:o})=>{console.log("[MSW] Intercepted POST upload request:",s.url,"orgId:",o.orgId),await new Promise((e=>setTimeout(e,2e3)));const r=(await s.formData()).getAll("files").map((s=>e.createMockAsset({id:"asset_e3454351fw5",fileName:s.name,contentType:s.type||"image/jpeg",createdBy:"Test User",updatedBy:"Test User"})));return t.HttpResponse.json(r)}))]];exports.handlers=o;
2
2
  //# sourceMappingURL=handlers.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handlers.cjs.js","sources":["../../../src/mocks/msw/handlers.ts"],"sourcesContent":["import { http, HttpResponse } from 'msw';\n\nimport { createMockAsset, mockAssets } from '../../components/organisms/AssetManager/__mocks__/mockAssets';\n\nconst assetManagementHandlers = [\n // GET assets handler\n http.get('*/assets/orgs/:orgId/assets', ({ request, params }) => {\n // eslint-disable-next-line no-console\n console.log('[MSW] Intercepted GET assets request:', request.url, 'orgId:', params['orgId']);\n return HttpResponse.json(mockAssets);\n }),\n\n // POST upload handler\n http.post('*/assets/orgs/:orgId/assets/upload', async ({ request, params }) => {\n // eslint-disable-next-line no-console\n console.log('[MSW] Intercepted POST upload request:', request.url, 'orgId:', params['orgId']);\n const formData = await request.formData();\n const files = formData.getAll('files') as File[];\n\n const uploadedAssets = files.map((file) =>\n createMockAsset({\n id: `asset_e3454351fw5`,\n fileName: file.name,\n contentType: file.type || 'image/jpeg',\n createdBy: 'Test User',\n updatedBy: 'Test User',\n }),\n );\n\n return HttpResponse.json(uploadedAssets);\n }),\n];\n\nexport const handlers = [...assetManagementHandlers];\n"],"names":["handlers","http","get","request","params","console","log","url","HttpResponse","json","mockAssets","post","async","uploadedAssets","formData","getAll","map","file","createMockAsset","id","fileName","name","contentType","type","createdBy","updatedBy"],"mappings":"meAIA,MA6BaA,EAAW,IA7BQ,CAE9BC,EAAAA,KAAKC,IAAI,+BAA+B,EAAGC,UAASC,aAElDC,QAAQC,IAAI,wCAAyCH,EAAQI,IAAK,SAAUH,EAAc,OACnFI,EAAAA,aAAaC,KAAKC,iBAI3BT,EAAAA,KAAKU,KAAK,sCAAsCC,OAAST,UAASC,aAEhEC,QAAQC,IAAI,yCAA0CH,EAAQI,IAAK,SAAUH,EAAc,OAC3F,MAGMS,SAHiBV,EAAQW,YACRC,OAAO,SAEDC,KAAKC,GAChCC,EAAAA,gBAAgB,CACdC,GAAI,oBACJC,SAAUH,EAAKI,KACfC,YAAaL,EAAKM,MAAQ,aAC1BC,UAAW,YACXC,UAAW,gBAIf,OAAOjB,EAAAA,aAAaC,KAAKI"}
1
+ {"version":3,"file":"handlers.cjs.js","sources":["../../../src/mocks/msw/handlers.ts"],"sourcesContent":["import { http, HttpResponse } from 'msw';\n\nimport { createMockAsset, mockAssets } from '../../components/organisms/AssetManager/__mocks__/mockAssets';\n\n/** Mock delay (ms) for upload so loading indicator is visible in Storybook */\nconst UPLOAD_MOCK_DELAY_MS = 2000;\n\nconst assetManagementHandlers = [\n // GET assets handler\n http.get('*/assets/orgs/:orgId/assets', ({ request, params }) => {\n // eslint-disable-next-line no-console\n console.log('[MSW] Intercepted GET assets request:', request.url, 'orgId:', params['orgId']);\n return HttpResponse.json(mockAssets);\n }),\n\n // POST upload handler\n http.post('*/assets/orgs/:orgId/assets/upload', async ({ request, params }) => {\n // eslint-disable-next-line no-console\n console.log('[MSW] Intercepted POST upload request:', request.url, 'orgId:', params['orgId']);\n await new Promise((resolve) => setTimeout(resolve, UPLOAD_MOCK_DELAY_MS));\n const formData = await request.formData();\n const files = formData.getAll('files') as File[];\n\n const uploadedAssets = files.map((file) =>\n createMockAsset({\n id: `asset_e3454351fw5`,\n fileName: file.name,\n contentType: file.type || 'image/jpeg',\n createdBy: 'Test User',\n updatedBy: 'Test User',\n }),\n );\n\n return HttpResponse.json(uploadedAssets);\n }),\n];\n\nexport const handlers = [...assetManagementHandlers];\n"],"names":["handlers","http","get","request","params","console","log","url","HttpResponse","json","mockAssets","post","async","Promise","resolve","setTimeout","uploadedAssets","formData","getAll","map","file","createMockAsset","id","fileName","name","contentType","type","createdBy","updatedBy"],"mappings":"meAKA,MAgCaA,EAAW,IA9BQ,CAE9BC,EAAAA,KAAKC,IAAI,+BAA+B,EAAGC,UAASC,aAElDC,QAAQC,IAAI,wCAAyCH,EAAQI,IAAK,SAAUH,EAAc,OACnFI,EAAAA,aAAaC,KAAKC,iBAI3BT,EAAAA,KAAKU,KAAK,sCAAsCC,OAAST,UAASC,aAEhEC,QAAQC,IAAI,yCAA0CH,EAAQI,IAAK,SAAUH,EAAc,aACrF,IAAIS,SAASC,GAAYC,WAAWD,EAdjB,OAezB,MAGME,SAHiBb,EAAQc,YACRC,OAAO,SAEDC,KAAKC,GAChCC,EAAAA,gBAAgB,CACdC,GAAI,oBACJC,SAAUH,EAAKI,KACfC,YAAaL,EAAKM,MAAQ,aAC1BC,UAAW,YACXC,UAAW,gBAIf,OAAOpB,EAAAA,aAAaC,KAAKO"}
@@ -1,2 +1,2 @@
1
- import"../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/index.js";import{mockAssets as e,createMockAsset as s}from"../../components/organisms/AssetManager/__mocks__/mockAssets.js";import{http as o}from"../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/http.js";import{HttpResponse as t}from"../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/HttpResponse.js";const r=[...[o.get("*/assets/orgs/:orgId/assets",(({request:s,params:o})=>(console.log("[MSW] Intercepted GET assets request:",s.url,"orgId:",o.orgId),t.json(e)))),o.post("*/assets/orgs/:orgId/assets/upload",(async({request:e,params:o})=>{console.log("[MSW] Intercepted POST upload request:",e.url,"orgId:",o.orgId);const r=(await e.formData()).getAll("files").map((e=>s({id:"asset_e3454351fw5",fileName:e.name,contentType:e.type||"image/jpeg",createdBy:"Test User",updatedBy:"Test User"})));return t.json(r)}))]];export{r as handlers};
1
+ import"../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/index.js";import{mockAssets as e,createMockAsset as s}from"../../components/organisms/AssetManager/__mocks__/mockAssets.js";import{http as o}from"../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/http.js";import{HttpResponse as t}from"../../node_modules/.pnpm/msw@2.12.10_@types_node@20.19.34_typescript@5.4.5/node_modules/msw/lib/core/HttpResponse.js";const r=[...[o.get("*/assets/orgs/:orgId/assets",(({request:s,params:o})=>(console.log("[MSW] Intercepted GET assets request:",s.url,"orgId:",o.orgId),t.json(e)))),o.post("*/assets/orgs/:orgId/assets/upload",(async({request:e,params:o})=>{console.log("[MSW] Intercepted POST upload request:",e.url,"orgId:",o.orgId),await new Promise((e=>setTimeout(e,2e3)));const r=(await e.formData()).getAll("files").map((e=>s({id:"asset_e3454351fw5",fileName:e.name,contentType:e.type||"image/jpeg",createdBy:"Test User",updatedBy:"Test User"})));return t.json(r)}))]];export{r as handlers};
2
2
  //# sourceMappingURL=handlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handlers.js","sources":["../../../src/mocks/msw/handlers.ts"],"sourcesContent":["import { http, HttpResponse } from 'msw';\n\nimport { createMockAsset, mockAssets } from '../../components/organisms/AssetManager/__mocks__/mockAssets';\n\nconst assetManagementHandlers = [\n // GET assets handler\n http.get('*/assets/orgs/:orgId/assets', ({ request, params }) => {\n // eslint-disable-next-line no-console\n console.log('[MSW] Intercepted GET assets request:', request.url, 'orgId:', params['orgId']);\n return HttpResponse.json(mockAssets);\n }),\n\n // POST upload handler\n http.post('*/assets/orgs/:orgId/assets/upload', async ({ request, params }) => {\n // eslint-disable-next-line no-console\n console.log('[MSW] Intercepted POST upload request:', request.url, 'orgId:', params['orgId']);\n const formData = await request.formData();\n const files = formData.getAll('files') as File[];\n\n const uploadedAssets = files.map((file) =>\n createMockAsset({\n id: `asset_e3454351fw5`,\n fileName: file.name,\n contentType: file.type || 'image/jpeg',\n createdBy: 'Test User',\n updatedBy: 'Test User',\n }),\n );\n\n return HttpResponse.json(uploadedAssets);\n }),\n];\n\nexport const handlers = [...assetManagementHandlers];\n"],"names":["handlers","http","get","request","params","console","log","url","HttpResponse","json","mockAssets","post","async","uploadedAssets","formData","getAll","map","file","createMockAsset","id","fileName","name","contentType","type","createdBy","updatedBy"],"mappings":"ggBAIA,MA6BaA,EAAW,IA7BQ,CAE9BC,EAAKC,IAAI,+BAA+B,EAAGC,UAASC,aAElDC,QAAQC,IAAI,wCAAyCH,EAAQI,IAAK,SAAUH,EAAc,OACnFI,EAAaC,KAAKC,MAI3BT,EAAKU,KAAK,sCAAsCC,OAAST,UAASC,aAEhEC,QAAQC,IAAI,yCAA0CH,EAAQI,IAAK,SAAUH,EAAc,OAC3F,MAGMS,SAHiBV,EAAQW,YACRC,OAAO,SAEDC,KAAKC,GAChCC,EAAgB,CACdC,GAAI,oBACJC,SAAUH,EAAKI,KACfC,YAAaL,EAAKM,MAAQ,aAC1BC,UAAW,YACXC,UAAW,gBAIf,OAAOjB,EAAaC,KAAKI"}
1
+ {"version":3,"file":"handlers.js","sources":["../../../src/mocks/msw/handlers.ts"],"sourcesContent":["import { http, HttpResponse } from 'msw';\n\nimport { createMockAsset, mockAssets } from '../../components/organisms/AssetManager/__mocks__/mockAssets';\n\n/** Mock delay (ms) for upload so loading indicator is visible in Storybook */\nconst UPLOAD_MOCK_DELAY_MS = 2000;\n\nconst assetManagementHandlers = [\n // GET assets handler\n http.get('*/assets/orgs/:orgId/assets', ({ request, params }) => {\n // eslint-disable-next-line no-console\n console.log('[MSW] Intercepted GET assets request:', request.url, 'orgId:', params['orgId']);\n return HttpResponse.json(mockAssets);\n }),\n\n // POST upload handler\n http.post('*/assets/orgs/:orgId/assets/upload', async ({ request, params }) => {\n // eslint-disable-next-line no-console\n console.log('[MSW] Intercepted POST upload request:', request.url, 'orgId:', params['orgId']);\n await new Promise((resolve) => setTimeout(resolve, UPLOAD_MOCK_DELAY_MS));\n const formData = await request.formData();\n const files = formData.getAll('files') as File[];\n\n const uploadedAssets = files.map((file) =>\n createMockAsset({\n id: `asset_e3454351fw5`,\n fileName: file.name,\n contentType: file.type || 'image/jpeg',\n createdBy: 'Test User',\n updatedBy: 'Test User',\n }),\n );\n\n return HttpResponse.json(uploadedAssets);\n }),\n];\n\nexport const handlers = [...assetManagementHandlers];\n"],"names":["handlers","http","get","request","params","console","log","url","HttpResponse","json","mockAssets","post","async","Promise","resolve","setTimeout","uploadedAssets","formData","getAll","map","file","createMockAsset","id","fileName","name","contentType","type","createdBy","updatedBy"],"mappings":"ggBAKA,MAgCaA,EAAW,IA9BQ,CAE9BC,EAAKC,IAAI,+BAA+B,EAAGC,UAASC,aAElDC,QAAQC,IAAI,wCAAyCH,EAAQI,IAAK,SAAUH,EAAc,OACnFI,EAAaC,KAAKC,MAI3BT,EAAKU,KAAK,sCAAsCC,OAAST,UAASC,aAEhEC,QAAQC,IAAI,yCAA0CH,EAAQI,IAAK,SAAUH,EAAc,aACrF,IAAIS,SAASC,GAAYC,WAAWD,EAdjB,OAezB,MAGME,SAHiBb,EAAQc,YACRC,OAAO,SAEDC,KAAKC,GAChCC,EAAgB,CACdC,GAAI,oBACJC,SAAUH,EAAKI,KACfC,YAAaL,EAAKM,MAAQ,aAC1BC,UAAW,YACXC,UAAW,gBAIf,OAAOpB,EAAaC,KAAKO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flipdish/portal-library",
3
- "version": "8.5.5",
3
+ "version": "8.5.6",
4
4
  "files": [
5
5
  "dist"
6
6
  ],