@flipdish/portal-library 7.5.2 → 7.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +0 -6
  2. package/dist/components/atoms/Avatar/index.cjs.js +1 -1
  3. package/dist/components/atoms/Avatar/index.cjs.js.map +1 -1
  4. package/dist/components/atoms/Avatar/index.d.ts +2 -0
  5. package/dist/components/atoms/Avatar/index.js +1 -1
  6. package/dist/components/atoms/Avatar/index.js.map +1 -1
  7. package/dist/components/atoms/Button/buttonThemeOverrides.cjs.js +1 -1
  8. package/dist/components/atoms/Button/buttonThemeOverrides.cjs.js.map +1 -1
  9. package/dist/components/atoms/Button/buttonThemeOverrides.js +1 -1
  10. package/dist/components/atoms/Button/buttonThemeOverrides.js.map +1 -1
  11. package/dist/components/atoms/Button/index.cjs.js +1 -1
  12. package/dist/components/atoms/Button/index.cjs.js.map +1 -1
  13. package/dist/components/atoms/Button/index.d.ts +1 -1
  14. package/dist/components/atoms/Button/index.js +1 -1
  15. package/dist/components/atoms/Button/index.js.map +1 -1
  16. package/dist/components/atoms/Card/index.cjs.js +1 -1
  17. package/dist/components/atoms/Card/index.cjs.js.map +1 -1
  18. package/dist/components/atoms/Card/index.d.ts +3 -2
  19. package/dist/components/atoms/Card/index.js +1 -1
  20. package/dist/components/atoms/Card/index.js.map +1 -1
  21. package/dist/components/atoms/Checkbox/index.cjs.js +1 -1
  22. package/dist/components/atoms/Checkbox/index.cjs.js.map +1 -1
  23. package/dist/components/atoms/Checkbox/index.js +1 -1
  24. package/dist/components/atoms/Checkbox/index.js.map +1 -1
  25. package/dist/components/atoms/MenuItem/index.cjs.js +1 -1
  26. package/dist/components/atoms/MenuItem/index.cjs.js.map +1 -1
  27. package/dist/components/atoms/MenuItem/index.d.ts +45 -13
  28. package/dist/components/atoms/MenuItem/index.js +1 -1
  29. package/dist/components/atoms/MenuItem/index.js.map +1 -1
  30. package/dist/components/molecules/AlertGlobal/index.cjs.js +1 -1
  31. package/dist/components/molecules/AlertGlobal/index.cjs.js.map +1 -1
  32. package/dist/components/molecules/AlertGlobal/index.js +1 -1
  33. package/dist/components/molecules/AlertGlobal/index.js.map +1 -1
  34. package/dist/components/molecules/Autocomplete/index.cjs.js +1 -1
  35. package/dist/components/molecules/Autocomplete/index.cjs.js.map +1 -1
  36. package/dist/components/molecules/Autocomplete/index.js +1 -1
  37. package/dist/components/molecules/Autocomplete/index.js.map +1 -1
  38. package/dist/components/molecules/DropdownMenu/index.cjs.js +2 -0
  39. package/dist/components/molecules/DropdownMenu/index.cjs.js.map +1 -0
  40. package/dist/components/molecules/DropdownMenu/index.d.ts +120 -0
  41. package/dist/components/molecules/DropdownMenu/index.js +2 -0
  42. package/dist/components/molecules/DropdownMenu/index.js.map +1 -0
  43. package/dist/components/molecules/Tooltip/index.cjs.js +2 -0
  44. package/dist/components/molecules/Tooltip/index.cjs.js.map +1 -0
  45. package/dist/components/molecules/Tooltip/index.d.ts +37 -0
  46. package/dist/components/molecules/Tooltip/index.js +2 -0
  47. package/dist/components/molecules/Tooltip/index.js.map +1 -0
  48. package/dist/components/organisms/AssetManager/index.cjs.js +2 -0
  49. package/dist/components/organisms/AssetManager/index.cjs.js.map +1 -0
  50. package/dist/components/organisms/AssetManager/index.d.ts +29 -0
  51. package/dist/components/organisms/AssetManager/index.js +2 -0
  52. package/dist/components/organisms/AssetManager/index.js.map +1 -0
  53. package/dist/components/organisms/AssetManager/types/index.cjs.js +2 -0
  54. package/dist/components/organisms/AssetManager/types/index.cjs.js.map +1 -0
  55. package/dist/components/organisms/AssetManager/types/index.d.ts +29 -0
  56. package/dist/components/organisms/AssetManager/types/index.js +2 -0
  57. package/dist/components/organisms/AssetManager/types/index.js.map +1 -0
  58. package/dist/components/organisms/FileUpload/components/FileDropZone.cjs.js.map +1 -1
  59. package/dist/components/organisms/FileUpload/components/FileDropZone.js.map +1 -1
  60. package/dist/components/organisms/FileUpload/components/FileItem.cjs.js.map +1 -1
  61. package/dist/components/organisms/FileUpload/components/FileItem.js.map +1 -1
  62. package/dist/components/organisms/FileUpload/components/FileThumbnail.cjs.js.map +1 -1
  63. package/dist/components/organisms/FileUpload/components/FileThumbnail.js.map +1 -1
  64. package/dist/components/organisms/FileUpload/index.cjs.js.map +1 -1
  65. package/dist/components/organisms/FileUpload/index.js.map +1 -1
  66. package/dist/components/organisms/ImageUploadWidget/components/FlipdishFonts.cjs.js +2 -2
  67. package/dist/components/organisms/ImageUploadWidget/components/FlipdishFonts.cjs.js.map +1 -1
  68. package/dist/components/organisms/ImageUploadWidget/components/FlipdishFonts.js +2 -2
  69. package/dist/components/organisms/ImageUploadWidget/components/FlipdishFonts.js.map +1 -1
  70. package/dist/components/organisms/ImageUploadWidget/components/ImageDisplay.cjs.js.map +1 -1
  71. package/dist/components/organisms/ImageUploadWidget/components/ImageDisplay.js.map +1 -1
  72. package/dist/components/organisms/ImageUploadWidget/components/ImageDropZone.cjs.js.map +1 -1
  73. package/dist/components/organisms/ImageUploadWidget/components/ImageDropZone.js.map +1 -1
  74. package/dist/components/organisms/ImageUploadWidget/index.cjs.js.map +1 -1
  75. package/dist/components/organisms/ImageUploadWidget/index.js.map +1 -1
  76. package/dist/icons/CheckmarkCircleSolid/checkmark-circle-solid.svg.cjs.js +1 -1
  77. package/dist/icons/CheckmarkCircleSolid/checkmark-circle-solid.svg.cjs.js.map +1 -1
  78. package/dist/icons/CheckmarkCircleSolid/checkmark-circle-solid.svg.js +1 -1
  79. package/dist/icons/CheckmarkCircleSolid/checkmark-circle-solid.svg.js.map +1 -1
  80. package/dist/icons/KitchenDisplaySystem/index.cjs.js +2 -0
  81. package/dist/icons/KitchenDisplaySystem/index.cjs.js.map +1 -0
  82. package/dist/icons/KitchenDisplaySystem/index.d.ts +6 -0
  83. package/dist/icons/KitchenDisplaySystem/index.js +2 -0
  84. package/dist/icons/KitchenDisplaySystem/index.js.map +1 -0
  85. package/dist/icons/{KitchenDisplayScreen/kitchen-display-screen.svg.cjs.js → KitchenDisplaySystem/kitchen-display-system.svg.cjs.js} +1 -1
  86. package/dist/icons/{KitchenDisplayScreen/kitchen-display-screen.svg.cjs.js.map → KitchenDisplaySystem/kitchen-display-system.svg.cjs.js.map} +1 -1
  87. package/dist/icons/{KitchenDisplayScreen/kitchen-display-screen.svg.js → KitchenDisplaySystem/kitchen-display-system.svg.js} +1 -1
  88. package/dist/icons/{KitchenDisplayScreen/kitchen-display-screen.svg.js.map → KitchenDisplaySystem/kitchen-display-system.svg.js.map} +1 -1
  89. package/dist/icons/helpers/withSvgIcon.cjs.js.map +1 -1
  90. package/dist/icons/helpers/withSvgIcon.js.map +1 -1
  91. package/dist/themes/flipdishPublicTheme.cjs.js +1 -1
  92. package/dist/themes/flipdishPublicTheme.cjs.js.map +1 -1
  93. package/dist/themes/flipdishPublicTheme.js +1 -1
  94. package/dist/themes/flipdishPublicTheme.js.map +1 -1
  95. package/dist/themes/overrides/listSubheaderOverrides.cjs.js +2 -0
  96. package/dist/themes/overrides/listSubheaderOverrides.cjs.js.map +1 -0
  97. package/dist/themes/overrides/listSubheaderOverrides.d.ts +5 -0
  98. package/dist/themes/overrides/listSubheaderOverrides.js +2 -0
  99. package/dist/themes/overrides/listSubheaderOverrides.js.map +1 -0
  100. package/dist/themes/overrides/menuItemOverrides.cjs.js +1 -1
  101. package/dist/themes/overrides/menuItemOverrides.cjs.js.map +1 -1
  102. package/dist/themes/overrides/menuItemOverrides.js +1 -1
  103. package/dist/themes/overrides/menuItemOverrides.js.map +1 -1
  104. package/dist/themes/overrides/menuOverrides.cjs.js +1 -1
  105. package/dist/themes/overrides/menuOverrides.cjs.js.map +1 -1
  106. package/dist/themes/overrides/menuOverrides.js +1 -1
  107. package/dist/themes/overrides/menuOverrides.js.map +1 -1
  108. package/package.json +1 -1
  109. package/dist/icons/KitchenDisplayScreen/index.cjs.js +0 -2
  110. package/dist/icons/KitchenDisplayScreen/index.cjs.js.map +0 -1
  111. package/dist/icons/KitchenDisplayScreen/index.d.ts +0 -6
  112. package/dist/icons/KitchenDisplayScreen/index.js +0 -2
  113. package/dist/icons/KitchenDisplayScreen/index.js.map +0 -1
package/README.md CHANGED
@@ -76,12 +76,6 @@ import FlipdishUIThemeProvider from '@flipdish/portal-library/themes/ThemeProvid
76
76
  </FlipdishUIThemeProvider>;
77
77
  ```
78
78
 
79
- ## Contributing
80
-
81
- Start with the contributing guide for editor setup, conventions, and component guidelines:
82
-
83
- - [CONTRIBUTING.md](./CONTRIBUTING.md)
84
-
85
79
  ## Using Icons
86
80
 
87
81
  To use an icon in your project, import the icon and use it like any other component. You can specify the size using the `size` prop.
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/Avatar"),r=require("../../../themes/tokens/typography/font-family.cjs.js"),o=require("../../../themes/tokens/typography/font-size.cjs.js"),i=require("../../../themes/typography.cjs.js");const s=require("@mui/material/styles").styled(t,{shouldForwardProp:e=>"size"!==e&&"type"!==e})((({theme:e,size:t="medium",type:s})=>{const a={small:o.fontSize.desktop.caption,medium:o.fontSize.desktop.h4,large:o.fontSize.desktop.h3},l={small:"32",medium:"48",large:"64"}[t],n="photo"!==s?{borderRadius:"8px"}:{};return{fontStyle:"normal",fontWeight:600,fontFamily:r.fontFamily.desktop.body,fontSize:a[t],color:e.palette.grey[700],backgroundColor:"#f5f5f5",width:`${l}px`,height:`${l}px`,border:"1px solid #ddd",...n,[e.breakpoints.down("tablet")]:{...i.getMobileTextStyle({small:"caption",medium:"h4",large:"h3"}[t])}}}));module.exports=t=>{const{type:r,fdKey:o}=t;return e.jsx(s,{alt:t.alt||t.type,"data-fd":o,size:t.size,src:(()=>{switch(r){case"logo":case"photo":return t.src;default:return}})(),type:t.type,variant:"photo"===r?"circular":"rounded",children:(()=>{switch(r){case"icon":return t.icon;case"initials":return t.initials;default:return null}})()})};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/Avatar"),r=require("../../../themes/tokens/typography/font-family.cjs.js"),i=require("../../../themes/tokens/typography/font-size.cjs.js"),o=require("../../../themes/typography.cjs.js");const a=require("@mui/material/styles").styled(t,{shouldForwardProp:e=>"size"!==e&&"type"!==e})((({theme:e,size:t="medium",type:a})=>{const s={small:i.fontSize.desktop.caption,medium:i.fontSize.desktop.h4,large:i.fontSize.desktop.h3},l={small:"32",medium:"48",large:"64"}[t],n="photo"!==a?{borderRadius:"8px"}:{};return{fontStyle:"normal",fontWeight:600,fontFamily:r.fontFamily.desktop.body,fontSize:s[t],color:e.palette.grey[700],backgroundColor:"#f5f5f5",width:`${l}px`,height:`${l}px`,border:"1px solid #ddd",...n,[e.breakpoints.down("tablet")]:{...o.getMobileTextStyle({small:"caption",medium:"h4",large:"h3"}[t])}}}));module.exports=t=>{const{type:r,fdKey:i}=t;return e.jsx(a,{alt:t.alt,"aria-hidden":"icon"===t.type,"aria-label":(()=>{if("initials"===r)return t.ariaLabel})(),"data-fd":i,size:t.size,src:(()=>{switch(r){case"logo":case"photo":return t.src;default:return}})(),type:t.type,variant:"photo"===r?"circular":"rounded",children:(()=>{switch(r){case"icon":return t.icon;case"initials":return t.initials;default:return null}})()})};
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/Avatar/index.tsx"],"sourcesContent":["import MuiAvatar, { type AvatarProps as MuiAvatarProps } from '@mui/material/Avatar';\nimport type { CSSObject } from '@mui/material/styles';\n\nimport { fontFamily } from '@fd/themes/tokens/typography/font-family';\nimport { fontSize } from '@fd/themes/tokens/typography/font-size';\nimport { getMobileTextStyle } from '@fd/themes/typography';\nimport styled from '@fd/utilities/styledUtilities';\n\ntype Size = 'large' | 'medium' | 'small' | undefined;\ntype Type = 'icon' | 'initials' | 'logo' | 'photo' | undefined;\n\ninterface CommonProps {\n /** Size of the avatar, defaults to 'medium' */\n size?: Size;\n /** Test ID for testing and automation */\n fdKey?: string;\n /** Alternative text for the avatar image */\n alt?: string;\n}\n\ninterface LogoProps {\n /** Type of avatar - displays a logo image */\n type: 'logo';\n /** Source URL for the logo image */\n src: string;\n /** Alternative text for the logo image */\n alt: string;\n}\n\ninterface PhotoProps {\n /** Type of avatar - displays a photo image */\n type: 'photo';\n /** Source URL for the photo image */\n src: string;\n /** Alternative text for the photo image */\n alt: string;\n}\n\ninterface InitialsProps {\n /** Type of avatar - displays initials text */\n type: 'initials';\n /** Initials text to display in the avatar */\n initials: string;\n}\n\ninterface IconProps {\n /** Type of avatar - displays an icon */\n type?: 'icon';\n /** Icon component to display in the avatar */\n icon?: React.ReactNode;\n}\n\n/** Props for the Avatar component */\nexport type AvatarProps = CommonProps & (IconProps | InitialsProps | LogoProps | PhotoProps);\n\ntype StyledAvatarProps = MuiAvatarProps & {\n size: Size;\n type: Type;\n};\n\nconst StyledAvatar = styled(MuiAvatar, {\n shouldForwardProp: (prop) => prop !== 'size' && prop !== 'type',\n})<StyledAvatarProps>(({ theme, size = 'medium', type }): CSSObject => {\n const pixels = {\n small: '32',\n medium: '48',\n large: '64',\n } as const;\n\n const fontSizes = {\n small: fontSize.desktop.caption,\n medium: fontSize.desktop.h4,\n large: fontSize.desktop.h3,\n };\n\n const mobileKeys = {\n small: 'caption',\n medium: 'h4',\n large: 'h3',\n } as const;\n\n const dim = pixels[size];\n\n const customBorderRadius =\n type !== 'photo'\n ? {\n borderRadius: '8px',\n }\n : {};\n\n return {\n fontStyle: 'normal',\n fontWeight: 600,\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSizes[size],\n color: theme.palette.grey[700],\n backgroundColor: '#f5f5f5',\n width: `${dim}px`,\n height: `${dim}px`,\n border: `1px solid #ddd`,\n ...customBorderRadius,\n [theme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle(mobileKeys[size]), // mobile typography override\n },\n };\n});\n\n/**\n * Avatar component displays user avatars in different formats: photos, logos, initials, or icons.\n * The component automatically adjusts styling based on the avatar type - photos use circular shape\n * while logos use rounded corners. Size can be controlled via the size prop (small, medium, large).\n */\nconst Avatar: React.FC<AvatarProps> = (props) => {\n const { type, fdKey } = props;\n\n const getVariant = (): MuiAvatarProps['variant'] => {\n switch (type) {\n case 'photo':\n return 'circular';\n case 'logo':\n default:\n return 'rounded';\n }\n };\n\n const getChildren = (): React.ReactNode => {\n switch (type) {\n case 'icon':\n return props.icon;\n case 'initials':\n return props.initials;\n default:\n return null;\n }\n };\n\n const getSrc = (): string | undefined => {\n switch (type) {\n case 'logo':\n case 'photo':\n return props.src;\n default:\n return undefined;\n }\n };\n\n return (\n <StyledAvatar\n alt={props.alt || props.type}\n data-fd={fdKey}\n size={props.size}\n src={getSrc()}\n type={props.type}\n variant={getVariant()}\n >\n {getChildren()}\n </StyledAvatar>\n );\n};\n\nexport default Avatar;\n"],"names":["StyledAvatar","styled","MuiAvatar","shouldForwardProp","prop","theme","size","type","fontSizes","small","fontSize","desktop","caption","medium","h4","large","h3","dim","customBorderRadius","borderRadius","fontStyle","fontWeight","fontFamily","body","color","palette","grey","backgroundColor","width","height","border","breakpoints","down","getMobileTextStyle","props","fdKey","_jsx","alt","src","getSrc","variant","children","icon","initials","getChildren"],"mappings":"mQA4DA,MAAMA,kCAAeC,OAAOC,EAAW,CACrCC,kBAAoBC,GAAkB,SAATA,GAA4B,SAATA,GAD7BH,EAEC,EAAGI,QAAOC,OAAO,SAAUC,WAC/C,MAMMC,EAAY,CAChBC,MAAOC,EAAAA,SAASC,QAAQC,QACxBC,OAAQH,EAAAA,SAASC,QAAQG,GACzBC,MAAOL,EAAAA,SAASC,QAAQK,IASpBC,EAlBS,CACbR,MAAO,KACPI,OAAQ,KACRE,MAAO,MAeUT,GAEbY,EACK,UAATX,EACI,CACEY,aAAc,OAEhB,CAAA,EAEN,MAAO,CACLC,UAAW,SACXC,WAAY,IACZC,WAAYA,EAAAA,WAAWX,QAAQY,KAC/Bb,SAAUF,EAAUF,GACpBkB,MAAOnB,EAAMoB,QAAQC,KAAK,KAC1BC,gBAAiB,UACjBC,MAAO,GAAGX,MACVY,OAAQ,GAAGZ,MACXa,OAAQ,oBACLZ,EACH,CAACb,EAAM0B,YAAYC,KAAK,WAAY,IAC/BC,EAAAA,mBA3BY,CACjBxB,MAAO,UACPI,OAAQ,KACRE,MAAO,MAwB4BT,wBAUA4B,IACrC,MAAM3B,KAAEA,EAAI4B,MAAEA,GAAUD,EAiCxB,OACEE,MAACpC,GACCqC,IAAKH,EAAMG,KAAOH,EAAM3B,KAAI,UACnB4B,EACT7B,KAAM4B,EAAM5B,KACZgC,IAfW,MACb,OAAQ/B,GACN,IAAK,OACL,IAAK,QACH,OAAO2B,EAAMI,IACf,QACE,SASGC,GACLhC,KAAM2B,EAAM3B,KACZiC,QApCK,UADCjC,EAEG,WAGA,UAgCYkC,SA5BL,MAClB,OAAQlC,GACN,IAAK,OACH,OAAO2B,EAAMQ,KACf,IAAK,WACH,OAAOR,EAAMS,SACf,QACE,OAAO,OAuBRC"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/Avatar/index.tsx"],"sourcesContent":["import MuiAvatar, { type AvatarProps as MuiAvatarProps } from '@mui/material/Avatar';\nimport type { CSSObject } from '@mui/material/styles';\n\nimport { fontFamily } from '@fd/themes/tokens/typography/font-family';\nimport { fontSize } from '@fd/themes/tokens/typography/font-size';\nimport { getMobileTextStyle } from '@fd/themes/typography';\nimport styled from '@fd/utilities/styledUtilities';\n\ntype Size = 'large' | 'medium' | 'small' | undefined;\ntype Type = 'icon' | 'initials' | 'logo' | 'photo' | undefined;\n\ninterface CommonProps {\n /** Size of the avatar, defaults to 'medium' */\n size?: Size;\n /** Test ID for testing and automation */\n fdKey?: string;\n /** Alternative text for the avatar image */\n alt?: string;\n}\n\ninterface LogoProps {\n /** Type of avatar - displays a logo image */\n type: 'logo';\n /** Source URL for the logo image */\n src: string;\n /** Alternative text for the logo image */\n alt: string;\n}\n\ninterface PhotoProps {\n /** Type of avatar - displays a photo image */\n type: 'photo';\n /** Source URL for the photo image */\n src: string;\n /** Alternative text for the photo image */\n alt: string;\n}\n\ninterface InitialsProps {\n /** Aria-label for full name of the displayed initials */\n ariaLabel?: string;\n /** Type of avatar - displays initials text */\n type: 'initials';\n /** Initials text to display in the avatar */\n initials: string;\n}\n\ninterface IconProps {\n /** Type of avatar - displays an icon */\n type?: 'icon';\n /** Icon component to display in the avatar */\n icon?: React.ReactNode;\n}\n\n/** Props for the Avatar component */\nexport type AvatarProps = CommonProps & (IconProps | InitialsProps | LogoProps | PhotoProps);\n\ntype StyledAvatarProps = MuiAvatarProps & {\n size: Size;\n type: Type;\n};\n\nconst StyledAvatar = styled(MuiAvatar, {\n shouldForwardProp: (prop) => prop !== 'size' && prop !== 'type',\n})<StyledAvatarProps>(({ theme, size = 'medium', type }): CSSObject => {\n const pixels = {\n small: '32',\n medium: '48',\n large: '64',\n } as const;\n\n const fontSizes = {\n small: fontSize.desktop.caption,\n medium: fontSize.desktop.h4,\n large: fontSize.desktop.h3,\n };\n\n const mobileKeys = {\n small: 'caption',\n medium: 'h4',\n large: 'h3',\n } as const;\n\n const dim = pixels[size];\n\n const customBorderRadius =\n type !== 'photo'\n ? {\n borderRadius: '8px',\n }\n : {};\n\n return {\n fontStyle: 'normal',\n fontWeight: 600,\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSizes[size],\n color: theme.palette.grey[700],\n backgroundColor: '#f5f5f5',\n width: `${dim}px`,\n height: `${dim}px`,\n border: `1px solid #ddd`,\n ...customBorderRadius,\n\n [theme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle(mobileKeys[size]), // mobile typography override\n },\n };\n});\n\n/**\n * Avatar component displays user avatars in different formats: photos, logos, initials, or icons.\n * The component automatically adjusts styling based on the avatar type - photos use circular shape\n * while logos use rounded corners. Size can be controlled via the size prop (small, medium, large).\n */\nconst Avatar: React.FC<AvatarProps> = (props) => {\n const { type, fdKey } = props;\n\n const getAriaLabel = (): string | undefined => {\n switch (type) {\n case 'initials':\n return props.ariaLabel;\n default:\n return undefined;\n }\n };\n\n const getVariant = (): MuiAvatarProps['variant'] => {\n switch (type) {\n case 'photo':\n return 'circular';\n case 'logo':\n default:\n return 'rounded';\n }\n };\n\n const getChildren = (): React.ReactNode => {\n switch (type) {\n case 'icon':\n return props.icon;\n case 'initials':\n return props.initials;\n default:\n return null;\n }\n };\n\n const getSrc = (): string | undefined => {\n switch (type) {\n case 'logo':\n case 'photo':\n return props.src;\n default:\n return undefined;\n }\n };\n\n return (\n <StyledAvatar\n alt={props.alt}\n aria-hidden={props.type === 'icon'}\n aria-label={getAriaLabel()}\n data-fd={fdKey}\n size={props.size}\n src={getSrc()}\n type={props.type}\n variant={getVariant()}\n >\n {getChildren()}\n </StyledAvatar>\n );\n};\n\nexport default Avatar;\n"],"names":["StyledAvatar","styled","MuiAvatar","shouldForwardProp","prop","theme","size","type","fontSizes","small","fontSize","desktop","caption","medium","h4","large","h3","dim","customBorderRadius","borderRadius","fontStyle","fontWeight","fontFamily","body","color","palette","grey","backgroundColor","width","height","border","breakpoints","down","getMobileTextStyle","props","fdKey","_jsx","alt","ariaLabel","getAriaLabel","src","getSrc","variant","icon","initials","getChildren"],"mappings":"mQA8DA,MAAMA,kCAAeC,OAAOC,EAAW,CACrCC,kBAAoBC,GAAkB,SAATA,GAA4B,SAATA,GAD7BH,EAEC,EAAGI,QAAOC,OAAO,SAAUC,WAC/C,MAMMC,EAAY,CAChBC,MAAOC,EAAAA,SAASC,QAAQC,QACxBC,OAAQH,EAAAA,SAASC,QAAQG,GACzBC,MAAOL,EAAAA,SAASC,QAAQK,IASpBC,EAlBS,CACbR,MAAO,KACPI,OAAQ,KACRE,MAAO,MAeUT,GAEbY,EACK,UAATX,EACI,CACEY,aAAc,OAEhB,CAAA,EAEN,MAAO,CACLC,UAAW,SACXC,WAAY,IACZC,WAAYA,EAAAA,WAAWX,QAAQY,KAC/Bb,SAAUF,EAAUF,GACpBkB,MAAOnB,EAAMoB,QAAQC,KAAK,KAC1BC,gBAAiB,UACjBC,MAAO,GAAGX,MACVY,OAAQ,GAAGZ,MACXa,OAAQ,oBACLZ,EAEH,CAACb,EAAM0B,YAAYC,KAAK,WAAY,IAC/BC,EAAAA,mBA5BY,CACjBxB,MAAO,UACPI,OAAQ,KACRE,MAAO,MAyB4BT,wBAUA4B,IACrC,MAAM3B,KAAEA,EAAI4B,MAAEA,GAAUD,EA0CxB,OACEE,EAAAA,IAACpC,EAAY,CACXqC,IAAKH,EAAMG,IAAG,cACc,SAAfH,EAAM3B,KAAe,aA3CjB,MACnB,GACO,aADCA,EAEJ,OAAO2B,EAAMI,WAyCHC,GAAc,UACjBJ,EACT7B,KAAM4B,EAAM5B,KACZkC,IAjBW,MACb,OAAQjC,GACN,IAAK,OACL,IAAK,QACH,OAAO2B,EAAMM,IACf,QACE,SAWGC,GACLlC,KAAM2B,EAAM3B,KACZmC,QAtCK,UADCnC,EAEG,WAGA,mBAIO,MAClB,OAAQA,GACN,IAAK,OACH,OAAO2B,EAAMS,KACf,IAAK,WACH,OAAOT,EAAMU,SACf,QACE,OAAO,OAyBRC"}
@@ -24,6 +24,8 @@ interface PhotoProps {
24
24
  alt: string;
25
25
  }
26
26
  interface InitialsProps {
27
+ /** Aria-label for full name of the displayed initials */
28
+ ariaLabel?: string;
27
29
  /** Type of avatar - displays initials text */
28
30
  type: 'initials';
29
31
  /** Initials text to display in the avatar */
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import e from"@mui/material/Avatar";import{fontFamily as o}from"../../../themes/tokens/typography/font-family.js";import{fontSize as r}from"../../../themes/tokens/typography/font-size.js";import{getMobileTextStyle as a}from"../../../themes/typography.js";import{styled as i}from"@mui/material/styles";const s=i(e,{shouldForwardProp:t=>"size"!==t&&"type"!==t})((({theme:t,size:e="medium",type:i})=>{const s={small:r.desktop.caption,medium:r.desktop.h4,large:r.desktop.h3},m={small:"32",medium:"48",large:"64"}[e],p="photo"!==i?{borderRadius:"8px"}:{};return{fontStyle:"normal",fontWeight:600,fontFamily:o.desktop.body,fontSize:s[e],color:t.palette.grey[700],backgroundColor:"#f5f5f5",width:`${m}px`,height:`${m}px`,border:"1px solid #ddd",...p,[t.breakpoints.down("tablet")]:{...a({small:"caption",medium:"h4",large:"h3"}[e])}}})),m=e=>{const{type:o,fdKey:r}=e;return t(s,{alt:e.alt||e.type,"data-fd":r,size:e.size,src:(()=>{switch(o){case"logo":case"photo":return e.src;default:return}})(),type:e.type,variant:"photo"===o?"circular":"rounded",children:(()=>{switch(o){case"icon":return e.icon;case"initials":return e.initials;default:return null}})()})};export{m as default};
1
+ import{jsx as t}from"react/jsx-runtime";import e from"@mui/material/Avatar";import{fontFamily as r}from"../../../themes/tokens/typography/font-family.js";import{fontSize as o}from"../../../themes/tokens/typography/font-size.js";import{getMobileTextStyle as a}from"../../../themes/typography.js";import{styled as i}from"@mui/material/styles";const s=i(e,{shouldForwardProp:t=>"size"!==t&&"type"!==t})((({theme:t,size:e="medium",type:i})=>{const s={small:o.desktop.caption,medium:o.desktop.h4,large:o.desktop.h3},l={small:"32",medium:"48",large:"64"}[e],n="photo"!==i?{borderRadius:"8px"}:{};return{fontStyle:"normal",fontWeight:600,fontFamily:r.desktop.body,fontSize:s[e],color:t.palette.grey[700],backgroundColor:"#f5f5f5",width:`${l}px`,height:`${l}px`,border:"1px solid #ddd",...n,[t.breakpoints.down("tablet")]:{...a({small:"caption",medium:"h4",large:"h3"}[e])}}})),l=e=>{const{type:r,fdKey:o}=e;return t(s,{alt:e.alt,"aria-hidden":"icon"===e.type,"aria-label":(()=>{if("initials"===r)return e.ariaLabel})(),"data-fd":o,size:e.size,src:(()=>{switch(r){case"logo":case"photo":return e.src;default:return}})(),type:e.type,variant:"photo"===r?"circular":"rounded",children:(()=>{switch(r){case"icon":return e.icon;case"initials":return e.initials;default:return null}})()})};export{l as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Avatar/index.tsx"],"sourcesContent":["import MuiAvatar, { type AvatarProps as MuiAvatarProps } from '@mui/material/Avatar';\nimport type { CSSObject } from '@mui/material/styles';\n\nimport { fontFamily } from '@fd/themes/tokens/typography/font-family';\nimport { fontSize } from '@fd/themes/tokens/typography/font-size';\nimport { getMobileTextStyle } from '@fd/themes/typography';\nimport styled from '@fd/utilities/styledUtilities';\n\ntype Size = 'large' | 'medium' | 'small' | undefined;\ntype Type = 'icon' | 'initials' | 'logo' | 'photo' | undefined;\n\ninterface CommonProps {\n /** Size of the avatar, defaults to 'medium' */\n size?: Size;\n /** Test ID for testing and automation */\n fdKey?: string;\n /** Alternative text for the avatar image */\n alt?: string;\n}\n\ninterface LogoProps {\n /** Type of avatar - displays a logo image */\n type: 'logo';\n /** Source URL for the logo image */\n src: string;\n /** Alternative text for the logo image */\n alt: string;\n}\n\ninterface PhotoProps {\n /** Type of avatar - displays a photo image */\n type: 'photo';\n /** Source URL for the photo image */\n src: string;\n /** Alternative text for the photo image */\n alt: string;\n}\n\ninterface InitialsProps {\n /** Type of avatar - displays initials text */\n type: 'initials';\n /** Initials text to display in the avatar */\n initials: string;\n}\n\ninterface IconProps {\n /** Type of avatar - displays an icon */\n type?: 'icon';\n /** Icon component to display in the avatar */\n icon?: React.ReactNode;\n}\n\n/** Props for the Avatar component */\nexport type AvatarProps = CommonProps & (IconProps | InitialsProps | LogoProps | PhotoProps);\n\ntype StyledAvatarProps = MuiAvatarProps & {\n size: Size;\n type: Type;\n};\n\nconst StyledAvatar = styled(MuiAvatar, {\n shouldForwardProp: (prop) => prop !== 'size' && prop !== 'type',\n})<StyledAvatarProps>(({ theme, size = 'medium', type }): CSSObject => {\n const pixels = {\n small: '32',\n medium: '48',\n large: '64',\n } as const;\n\n const fontSizes = {\n small: fontSize.desktop.caption,\n medium: fontSize.desktop.h4,\n large: fontSize.desktop.h3,\n };\n\n const mobileKeys = {\n small: 'caption',\n medium: 'h4',\n large: 'h3',\n } as const;\n\n const dim = pixels[size];\n\n const customBorderRadius =\n type !== 'photo'\n ? {\n borderRadius: '8px',\n }\n : {};\n\n return {\n fontStyle: 'normal',\n fontWeight: 600,\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSizes[size],\n color: theme.palette.grey[700],\n backgroundColor: '#f5f5f5',\n width: `${dim}px`,\n height: `${dim}px`,\n border: `1px solid #ddd`,\n ...customBorderRadius,\n [theme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle(mobileKeys[size]), // mobile typography override\n },\n };\n});\n\n/**\n * Avatar component displays user avatars in different formats: photos, logos, initials, or icons.\n * The component automatically adjusts styling based on the avatar type - photos use circular shape\n * while logos use rounded corners. Size can be controlled via the size prop (small, medium, large).\n */\nconst Avatar: React.FC<AvatarProps> = (props) => {\n const { type, fdKey } = props;\n\n const getVariant = (): MuiAvatarProps['variant'] => {\n switch (type) {\n case 'photo':\n return 'circular';\n case 'logo':\n default:\n return 'rounded';\n }\n };\n\n const getChildren = (): React.ReactNode => {\n switch (type) {\n case 'icon':\n return props.icon;\n case 'initials':\n return props.initials;\n default:\n return null;\n }\n };\n\n const getSrc = (): string | undefined => {\n switch (type) {\n case 'logo':\n case 'photo':\n return props.src;\n default:\n return undefined;\n }\n };\n\n return (\n <StyledAvatar\n alt={props.alt || props.type}\n data-fd={fdKey}\n size={props.size}\n src={getSrc()}\n type={props.type}\n variant={getVariant()}\n >\n {getChildren()}\n </StyledAvatar>\n );\n};\n\nexport default Avatar;\n"],"names":["StyledAvatar","styled","MuiAvatar","shouldForwardProp","prop","theme","size","type","fontSizes","small","fontSize","desktop","caption","medium","h4","large","h3","dim","customBorderRadius","borderRadius","fontStyle","fontWeight","fontFamily","body","color","palette","grey","backgroundColor","width","height","border","breakpoints","down","getMobileTextStyle","Avatar","props","fdKey","_jsx","alt","src","getSrc","variant","children","icon","initials","getChildren"],"mappings":"qVA4DA,MAAMA,EAAeC,EAAOC,EAAW,CACrCC,kBAAoBC,GAAkB,SAATA,GAA4B,SAATA,GAD7BH,EAEC,EAAGI,QAAOC,OAAO,SAAUC,WAC/C,MAMMC,EAAY,CAChBC,MAAOC,EAASC,QAAQC,QACxBC,OAAQH,EAASC,QAAQG,GACzBC,MAAOL,EAASC,QAAQK,IASpBC,EAlBS,CACbR,MAAO,KACPI,OAAQ,KACRE,MAAO,MAeUT,GAEbY,EACK,UAATX,EACI,CACEY,aAAc,OAEhB,CAAA,EAEN,MAAO,CACLC,UAAW,SACXC,WAAY,IACZC,WAAYA,EAAWX,QAAQY,KAC/Bb,SAAUF,EAAUF,GACpBkB,MAAOnB,EAAMoB,QAAQC,KAAK,KAC1BC,gBAAiB,UACjBC,MAAO,GAAGX,MACVY,OAAQ,GAAGZ,MACXa,OAAQ,oBACLZ,EACH,CAACb,EAAM0B,YAAYC,KAAK,WAAY,IAC/BC,EA3BY,CACjBxB,MAAO,UACPI,OAAQ,KACRE,MAAO,MAwB4BT,SAUjC4B,EAAiCC,IACrC,MAAM5B,KAAEA,EAAI6B,MAAEA,GAAUD,EAiCxB,OACEE,EAACrC,GACCsC,IAAKH,EAAMG,KAAOH,EAAM5B,KAAI,UACnB6B,EACT9B,KAAM6B,EAAM7B,KACZiC,IAfW,MACb,OAAQhC,GACN,IAAK,OACL,IAAK,QACH,OAAO4B,EAAMI,IACf,QACE,SASGC,GACLjC,KAAM4B,EAAM5B,KACZkC,QApCK,UADClC,EAEG,WAGA,UAgCYmC,SA5BL,MAClB,OAAQnC,GACN,IAAK,OACH,OAAO4B,EAAMQ,KACf,IAAK,WACH,OAAOR,EAAMS,SACf,QACE,OAAO,OAuBRC"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Avatar/index.tsx"],"sourcesContent":["import MuiAvatar, { type AvatarProps as MuiAvatarProps } from '@mui/material/Avatar';\nimport type { CSSObject } from '@mui/material/styles';\n\nimport { fontFamily } from '@fd/themes/tokens/typography/font-family';\nimport { fontSize } from '@fd/themes/tokens/typography/font-size';\nimport { getMobileTextStyle } from '@fd/themes/typography';\nimport styled from '@fd/utilities/styledUtilities';\n\ntype Size = 'large' | 'medium' | 'small' | undefined;\ntype Type = 'icon' | 'initials' | 'logo' | 'photo' | undefined;\n\ninterface CommonProps {\n /** Size of the avatar, defaults to 'medium' */\n size?: Size;\n /** Test ID for testing and automation */\n fdKey?: string;\n /** Alternative text for the avatar image */\n alt?: string;\n}\n\ninterface LogoProps {\n /** Type of avatar - displays a logo image */\n type: 'logo';\n /** Source URL for the logo image */\n src: string;\n /** Alternative text for the logo image */\n alt: string;\n}\n\ninterface PhotoProps {\n /** Type of avatar - displays a photo image */\n type: 'photo';\n /** Source URL for the photo image */\n src: string;\n /** Alternative text for the photo image */\n alt: string;\n}\n\ninterface InitialsProps {\n /** Aria-label for full name of the displayed initials */\n ariaLabel?: string;\n /** Type of avatar - displays initials text */\n type: 'initials';\n /** Initials text to display in the avatar */\n initials: string;\n}\n\ninterface IconProps {\n /** Type of avatar - displays an icon */\n type?: 'icon';\n /** Icon component to display in the avatar */\n icon?: React.ReactNode;\n}\n\n/** Props for the Avatar component */\nexport type AvatarProps = CommonProps & (IconProps | InitialsProps | LogoProps | PhotoProps);\n\ntype StyledAvatarProps = MuiAvatarProps & {\n size: Size;\n type: Type;\n};\n\nconst StyledAvatar = styled(MuiAvatar, {\n shouldForwardProp: (prop) => prop !== 'size' && prop !== 'type',\n})<StyledAvatarProps>(({ theme, size = 'medium', type }): CSSObject => {\n const pixels = {\n small: '32',\n medium: '48',\n large: '64',\n } as const;\n\n const fontSizes = {\n small: fontSize.desktop.caption,\n medium: fontSize.desktop.h4,\n large: fontSize.desktop.h3,\n };\n\n const mobileKeys = {\n small: 'caption',\n medium: 'h4',\n large: 'h3',\n } as const;\n\n const dim = pixels[size];\n\n const customBorderRadius =\n type !== 'photo'\n ? {\n borderRadius: '8px',\n }\n : {};\n\n return {\n fontStyle: 'normal',\n fontWeight: 600,\n fontFamily: fontFamily.desktop.body,\n fontSize: fontSizes[size],\n color: theme.palette.grey[700],\n backgroundColor: '#f5f5f5',\n width: `${dim}px`,\n height: `${dim}px`,\n border: `1px solid #ddd`,\n ...customBorderRadius,\n\n [theme.breakpoints.down('tablet')]: {\n ...getMobileTextStyle(mobileKeys[size]), // mobile typography override\n },\n };\n});\n\n/**\n * Avatar component displays user avatars in different formats: photos, logos, initials, or icons.\n * The component automatically adjusts styling based on the avatar type - photos use circular shape\n * while logos use rounded corners. Size can be controlled via the size prop (small, medium, large).\n */\nconst Avatar: React.FC<AvatarProps> = (props) => {\n const { type, fdKey } = props;\n\n const getAriaLabel = (): string | undefined => {\n switch (type) {\n case 'initials':\n return props.ariaLabel;\n default:\n return undefined;\n }\n };\n\n const getVariant = (): MuiAvatarProps['variant'] => {\n switch (type) {\n case 'photo':\n return 'circular';\n case 'logo':\n default:\n return 'rounded';\n }\n };\n\n const getChildren = (): React.ReactNode => {\n switch (type) {\n case 'icon':\n return props.icon;\n case 'initials':\n return props.initials;\n default:\n return null;\n }\n };\n\n const getSrc = (): string | undefined => {\n switch (type) {\n case 'logo':\n case 'photo':\n return props.src;\n default:\n return undefined;\n }\n };\n\n return (\n <StyledAvatar\n alt={props.alt}\n aria-hidden={props.type === 'icon'}\n aria-label={getAriaLabel()}\n data-fd={fdKey}\n size={props.size}\n src={getSrc()}\n type={props.type}\n variant={getVariant()}\n >\n {getChildren()}\n </StyledAvatar>\n );\n};\n\nexport default Avatar;\n"],"names":["StyledAvatar","styled","MuiAvatar","shouldForwardProp","prop","theme","size","type","fontSizes","small","fontSize","desktop","caption","medium","h4","large","h3","dim","customBorderRadius","borderRadius","fontStyle","fontWeight","fontFamily","body","color","palette","grey","backgroundColor","width","height","border","breakpoints","down","getMobileTextStyle","Avatar","props","fdKey","_jsx","alt","ariaLabel","getAriaLabel","src","getSrc","variant","icon","initials","getChildren"],"mappings":"qVA8DA,MAAMA,EAAeC,EAAOC,EAAW,CACrCC,kBAAoBC,GAAkB,SAATA,GAA4B,SAATA,GAD7BH,EAEC,EAAGI,QAAOC,OAAO,SAAUC,WAC/C,MAMMC,EAAY,CAChBC,MAAOC,EAASC,QAAQC,QACxBC,OAAQH,EAASC,QAAQG,GACzBC,MAAOL,EAASC,QAAQK,IASpBC,EAlBS,CACbR,MAAO,KACPI,OAAQ,KACRE,MAAO,MAeUT,GAEbY,EACK,UAATX,EACI,CACEY,aAAc,OAEhB,CAAA,EAEN,MAAO,CACLC,UAAW,SACXC,WAAY,IACZC,WAAYA,EAAWX,QAAQY,KAC/Bb,SAAUF,EAAUF,GACpBkB,MAAOnB,EAAMoB,QAAQC,KAAK,KAC1BC,gBAAiB,UACjBC,MAAO,GAAGX,MACVY,OAAQ,GAAGZ,MACXa,OAAQ,oBACLZ,EAEH,CAACb,EAAM0B,YAAYC,KAAK,WAAY,IAC/BC,EA5BY,CACjBxB,MAAO,UACPI,OAAQ,KACRE,MAAO,MAyB4BT,SAUjC4B,EAAiCC,IACrC,MAAM5B,KAAEA,EAAI6B,MAAEA,GAAUD,EA0CxB,OACEE,EAACrC,EAAY,CACXsC,IAAKH,EAAMG,IAAG,cACc,SAAfH,EAAM5B,KAAe,aA3CjB,MACnB,GACO,aADCA,EAEJ,OAAO4B,EAAMI,WAyCHC,GAAc,UACjBJ,EACT9B,KAAM6B,EAAM7B,KACZmC,IAjBW,MACb,OAAQlC,GACN,IAAK,OACL,IAAK,QACH,OAAO4B,EAAMM,IACf,QACE,SAWGC,GACLnC,KAAM4B,EAAM5B,KACZoC,QAtCK,UADCpC,EAEG,WAGA,mBAIO,MAClB,OAAQA,GACN,IAAK,OACH,OAAO4B,EAAMS,KACf,IAAK,WACH,OAAOT,EAAMU,SACf,QACE,OAAO,OAyBRC"}
@@ -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",flex:"1 0 0",alignSelf:"stretch"},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"),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}}}});
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 flex: '1 0 0',\n alignSelf: 'stretch',\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","flex","alignSelf","sizeSmall","height","padding","fontStyle","fontFamily","desktop","body","fontSize","caption","lineHeight","letterSpacing","fontWeight","breakpoints","down","mobile","sizeMedium","gap","b1","sizeLarge","heading","h4"],"mappings":"uVAgBqCA,IAAgB,CACnDC,eAAgB,CACdC,KAAM,CACJC,UAAW,SACXC,cAAe,OACfC,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBC,KAAM,QACNC,UAAW,WAEbC,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,CAACrB,EAAUsB,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,CAACrB,EAAUsB,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,OACRN,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBC,KAAM,QACNC,UAAW,UACXiB,IAAK,MACLd,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAAA,WAAWC,QAAQc,QAC/BZ,SAAUA,EAAAA,SAASF,QAAQe,GAC3BX,WAAY,SACZC,cAAeA,EAAAA,cAAcL,QAAQe,GACrCT,WAAY,MACZ,CAACrB,EAAUsB,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAAA,WAAWU,OAAOK,QAC9BZ,SAAUA,EAAAA,SAASO,OAAOM,GAC1BX,WAAYA,EAAAA,WAAWK,OAAOM,GAC9BV,cAAeA,EAAAA,cAAcI,OAAOM"}
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,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 i}from"../../../themes/tokens/typography/letter-spacing.js";import{lineHeight as o}from"../../../themes/tokens/typography/line-height.js";const n=n=>({styleOverrides:{root:{textAlign:"center",textTransform:"none",display:"flex",alignItems:"center",justifyContent:"center",flex:"1 0 0",alignSelf:"stretch"},sizeSmall:{height:"32px",padding:"0px 12px",fontStyle:"normal",fontFamily:e.desktop.body,fontSize:t.desktop.caption,lineHeight:"normal",letterSpacing:i.desktop.caption,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:e.mobile.body,fontSize:t.mobile.caption,lineHeight:o.mobile.caption,letterSpacing:i.mobile.caption}},sizeMedium:{height:"48px",gap:"4px",padding:"0px 16px",fontStyle:"normal",fontFamily:e.desktop.body,fontSize:t.desktop.b1,lineHeight:"normal",letterSpacing:i.desktop.b1,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:e.mobile.body,fontSize:t.mobile.b1,lineHeight:o.mobile.b1,letterSpacing:i.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:i.desktop.h4,fontWeight:"600",[n.breakpoints.down("tablet")]:{fontFamily:e.mobile.heading,fontSize:t.mobile.h4,lineHeight:o.mobile.h4,letterSpacing:i.mobile.h4}}}});export{n as buttonStyleOverrides};
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};
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 flex: '1 0 0',\n alignSelf: 'stretch',\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","flex","alignSelf","sizeSmall","height","padding","fontStyle","fontFamily","desktop","body","fontSize","caption","lineHeight","letterSpacing","fontWeight","breakpoints","down","mobile","sizeMedium","gap","b1","sizeLarge","heading","h4"],"mappings":"6VAgBaA,EAAwBC,IAAgB,CACnDC,eAAgB,CACdC,KAAM,CACJC,UAAW,SACXC,cAAe,OACfC,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBC,KAAM,QACNC,UAAW,WAEbC,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,CAACrB,EAAUsB,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,CAACrB,EAAUsB,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAWU,OAAOR,KAC9BC,SAAUA,EAASO,OAAOG,GAC1BR,WAAYA,EAAWK,OAAOG,GAC9BP,cAAeA,EAAcI,OAAOG,KAGxCC,UAAW,CACTjB,OAAQ,OACRN,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBC,KAAM,QACNC,UAAW,UACXiB,IAAK,MACLd,QAAS,WACTC,UAAW,SACXC,WAAYA,EAAWC,QAAQc,QAC/BZ,SAAUA,EAASF,QAAQe,GAC3BX,WAAY,SACZC,cAAeA,EAAcL,QAAQe,GACrCT,WAAY,MACZ,CAACrB,EAAUsB,YAAYC,KAAK,WAAY,CACtCT,WAAYA,EAAWU,OAAOK,QAC9BZ,SAAUA,EAASO,OAAOM,GAC1BX,WAAYA,EAAWK,OAAOM,GAC9BV,cAAeA,EAAcI,OAAOM"}
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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var t=require("@mui/material/Button"),r=require("@mui/material/styles"),a=require("./getButtonStyles.cjs.js");const i=r.styled(t,{shouldForwardProp:e=>!["casingOverride","customVariant","tone"].includes(e)})((({theme:e,customVariant:t="primary",tone:r="brand",casingOverride:i="none",fullWidth:n=!1})=>{const o=a(e,t,r);return{...o.default,width:n?"100%":"fit-content",maxWidth:n?"100%":"fit-content",textTransform:i,transition:"all 0.2s ease-in-out",padding:"12px 24px","&: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=({children:t,className:r,disabled:a=!1,fdKey:o,form:s,fullWidth:d=!1,href:l,casingOverride:u="none",type:c="button",variant:f="primary",tone:m,target:p,startIcon:h,endIcon:v,onKeyDown:y,...x})=>e.jsx(i,{disableRipple:!0,casingOverride:u,className:r,customVariant:f,"data-fd":o,disabled:a,endIcon:v,form:s,fullWidth:d,href:l,startIcon:h,target:p,tone:m,type:c,variant:n[f],...x,children:t});exports.Button=o,exports.default=o;
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;
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 padding: '12px 24px',\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 children,\n className,\n disabled = false,\n fdKey,\n form,\n fullWidth = false,\n href,\n casingOverride = 'none',\n type = 'button',\n variant = 'primary',\n tone,\n target,\n startIcon,\n endIcon,\n onKeyDown,\n ...rest\n}: ButtonProps): JSX.Element => {\n return (\n <StyledButton\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 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 {...rest}\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","padding","hover","outline","focus","press","disabled","cursor","MUI_VARIANT_MAP","primary","secondary","tertiary","Button","children","className","fdKey","form","href","type","variant","target","startIcon","endIcon","onKeyDown","rest","_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,uBACZC,QAAS,YAET,UAAW,IAAKP,EAAOQ,OACvB,UAAW,CACTC,QAAS,QAGX,kBAAmB,IAAKT,EAAOU,OAC/B,WAAY,IAAKV,EAAOW,OACxB,aAAc,IAAKX,EAAOY,SAAUC,OAAQ,mBAI1CC,EAAkB,CACtBC,QAAS,YACTC,UAAW,WACXC,SAAU,QAGCC,EAAS,EACpBC,WACAC,YACAR,YAAW,EACXS,QACAC,OACAvB,aAAY,EACZwB,OACAzB,iBAAiB,OACjB0B,OAAO,SACPC,UAAU,UACV5B,OACA6B,SACAC,YACAC,UACAC,eACGC,KAGDC,MAAC1C,GACC2C,eAAa,EACblC,eAAgBA,EAChBsB,UAAWA,EACXxB,cAAe6B,EAAO,UACbJ,EACTT,SAAUA,EACVgB,QAASA,EACTN,KAAMA,EACNvB,UAAWA,EACXwB,KAAMA,EACNI,UAAWA,EAEXD,OAAQA,EACR7B,KAAMA,EACN2B,KAAMA,EACNC,QAASX,EAAgBW,MACrBK,EAAIX,SAEPA"}
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"}
@@ -18,7 +18,7 @@ interface ButtonProps extends Omit<ButtonProps$1, 'variant'> {
18
18
  startIcon?: react__default.ReactNode;
19
19
  endIcon?: react__default.ReactNode;
20
20
  }
21
- declare const Button: ({ children, className, disabled, fdKey, form, fullWidth, href, casingOverride, type, variant, tone, target, startIcon, endIcon, onKeyDown, ...rest }: ButtonProps) => JSX.Element;
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
22
 
23
23
  export { Button, Button as default };
24
24
  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 a from"./getButtonStyles.js";const i=r(e,{shouldForwardProp:t=>!["casingOverride","customVariant","tone"].includes(t)})((({theme:t,customVariant:e="primary",tone:r="brand",casingOverride:i="none",fullWidth:n=!1})=>{const o=a(t,e,r);return{...o.default,width:n?"100%":"fit-content",maxWidth:n?"100%":"fit-content",textTransform:i,transition:"all 0.2s ease-in-out",padding:"12px 24px","&: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=({children:e,className:r,disabled:a=!1,fdKey:o,form:s,fullWidth:d=!1,href:l,casingOverride:c="none",type:m="button",variant:u="primary",tone:f,target:p,startIcon:h,endIcon:y,onKeyDown:v,...b})=>t(i,{disableRipple:!0,casingOverride:c,className:r,customVariant:u,"data-fd":o,disabled:a,endIcon:y,form:s,fullWidth:d,href:l,startIcon:h,target:p,tone:f,type:m,variant:n[u],...b,children:e});export{o as Button,o 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,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};
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 padding: '12px 24px',\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 children,\n className,\n disabled = false,\n fdKey,\n form,\n fullWidth = false,\n href,\n casingOverride = 'none',\n type = 'button',\n variant = 'primary',\n tone,\n target,\n startIcon,\n endIcon,\n onKeyDown,\n ...rest\n}: ButtonProps): JSX.Element => {\n return (\n <StyledButton\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 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 {...rest}\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","padding","hover","outline","focus","press","disabled","cursor","MUI_VARIANT_MAP","primary","secondary","tertiary","Button","children","className","fdKey","form","href","type","variant","target","startIcon","endIcon","onKeyDown","rest","_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,uBACZC,QAAS,YAET,UAAW,IAAKP,EAAOQ,OACvB,UAAW,CACTC,QAAS,QAGX,kBAAmB,IAAKT,EAAOU,OAC/B,WAAY,IAAKV,EAAOW,OACxB,aAAc,IAAKX,EAAOY,SAAUC,OAAQ,mBAI1CC,EAAkB,CACtBC,QAAS,YACTC,UAAW,WACXC,SAAU,QAGCC,EAAS,EACpBC,WACAC,YACAR,YAAW,EACXS,QACAC,OACAvB,aAAY,EACZwB,OACAzB,iBAAiB,OACjB0B,OAAO,SACPC,UAAU,UACV5B,OACA6B,SACAC,YACAC,UACAC,eACGC,KAGDC,EAAC1C,GACC2C,eAAa,EACblC,eAAgBA,EAChBsB,UAAWA,EACXxB,cAAe6B,EAAO,UACbJ,EACTT,SAAUA,EACVgB,QAASA,EACTN,KAAMA,EACNvB,UAAWA,EACXwB,KAAMA,EACNI,UAAWA,EAEXD,OAAQA,EACR7B,KAAMA,EACN2B,KAAMA,EACNC,QAASX,EAAgBW,MACrBK,EAAIX,SAEPA"}
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,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@mui/material/Box"),t=require("@mui/material/Card"),i=require("@mui/material/CardContent"),n=require("@mui/material/CardMedia"),a=require("@mui/material/styles"),s=require("@mui/material/Typography"),o=require("../../../icons/ArrowRight02/index.cjs.js"),l=require("../Badge/index.cjs.js"),d=require("../IconContainer/index.cjs.js"),c=require("../Link/index.cjs.js");const h=a.styled(t)((({theme:e,type:r})=>({borderRadius:e.radius["radius-16"],border:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`,..."horizontal"===r&&{display:"flex",flexDirection:"row",overflow:"hidden"}}))),m=a.styled(i)((({theme:e,type:r})=>({"&:last-child":{paddingBottom:e.spacing(2)},..."horizontal"===r&&{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"}}))),p=a.styled(r)((({theme:e})=>({display:"flex",alignItems:"flex-start",gap:e.spacing(2),flex:1}))),u=a.styled(r)((()=>({flex:1,display:"flex",flexDirection:"column"}))),x=a.styled(s)((({theme:e})=>({marginBottom:e.spacing(1)}))),g=a.styled(r)((({theme:e})=>({marginTop:e.spacing(1.5)}))),y=a.styled(c.Link)((({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1)}))),f=a.styled(n)((({theme:e,type:r})=>({..."horizontal"===r?{width:200,height:"auto",borderRight:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`,borderBottom:"none",flexShrink:0}:{height:204,borderBottom:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`}}))),j=a.styled(r,{shouldForwardProp:e=>!["hasIcon","hasBadge"].includes(e)})((({theme:e,hasIcon:r,hasBadge:t})=>({display:"flex",flexDirection:"row",justifyContent:t&&!r?"flex-end":"space-between",alignItems:"flex-start",gap:e.spacing(2),marginBottom:e.spacing(1.5)})));module.exports=({fdKey:r,heading:t,content:i,imageSrc:n,icon:a,badge:c,link:k,onMouseEnter:w,onMouseLeave:b,type:B="vertical",...C})=>{if(a&&(q=a,q?.type!==d))throw new Error("Card icon prop must be an IconContainer component");var q;if(c&&!(e=>e?.type===l.Badge)(c))throw new Error("Card badge prop must be a Badge component");const v=!!c||!!a,I=()=>k?e.jsx(g,{children:e.jsx(y,{fdKey:`card-link-${k.label}`,href:k.href,iconRight:e.jsx(o,{}),onClick:k.onClick,underline:!1,children:k.label})}):null,M=()=>e.jsx(x,{variant:"h4Strong",children:t}),z=()=>e.jsx(s,{variant:"b1Weak",children:i});return e.jsxs(h,{"data-fd":r,type:B,...C,onMouseEnter:w,onMouseLeave:b,children:[n?e.jsx(f,{image:n,type:B}):null,e.jsx(m,{type:B,children:"horizontal"===B?e.jsxs(e.Fragment,{children:[e.jsxs(p,{children:[a&&a,e.jsxs(u,{children:[M(),z()]}),c&&c]}),I()]}):e.jsxs(e.Fragment,{children:[v&&e.jsxs(j,{hasBadge:!!c,hasIcon:!!a,children:[a&&a,c&&c]}),M(),z(),I()]})})]})};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/Box"),r=require("@mui/material/Card"),i=require("@mui/material/CardContent"),a=require("@mui/material/CardMedia"),n=require("@mui/material/styles"),s=require("@mui/material/Typography"),o=require("../../../icons/ArrowRight02/index.cjs.js"),l=require("../Badge/index.cjs.js"),d=require("../IconContainer/index.cjs.js"),c=require("../Link/index.cjs.js");const m=n.styled(r)((({theme:e,type:t})=>({borderRadius:e.radius["radius-16"],border:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`,..."horizontal"===t&&{display:"flex",flexDirection:"row",overflow:"hidden"}}))),h=n.styled(i)((({theme:e,type:t})=>({"&:last-child":{paddingBottom:e.spacing(2)},..."horizontal"===t&&{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"}}))),p=n.styled(t)((({theme:e})=>({display:"flex",alignItems:"flex-start",gap:e.spacing(2),flex:1}))),x=n.styled(t)((()=>({flex:1,display:"flex",flexDirection:"column"}))),u=n.styled(s)((({theme:e})=>({marginBottom:e.spacing(1)}))),g=n.styled(s)((({theme:e})=>({color:e.palette.semantic.text["text-weak"]}))),y=n.styled(t)((({theme:e})=>({marginTop:e.spacing(1.5)}))),f=n.styled(c.Link)((({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1)}))),j=n.styled(a)((({theme:e,type:t})=>({..."horizontal"===t?{width:200,height:"auto",borderRight:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`,borderBottom:"none",flexShrink:0}:{height:204,borderBottom:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`}}))),k=n.styled(t,{shouldForwardProp:e=>!["hasIcon","hasBadge"].includes(e)})((({theme:e,hasIcon:t,hasBadge:r})=>({display:"flex",flexDirection:"row",justifyContent:r&&!t?"flex-end":"space-between",alignItems:"flex-start",gap:e.spacing(2),marginBottom:e.spacing(1.5)})));module.exports=({fdKey:t,heading:r,content:i,imageSrc:a,imageAlt:n,icon:s,badge:c,link:w,onMouseEnter:b,onMouseLeave:B,type:C="vertical",...q})=>{if(s&&(v=s,v?.type!==d))throw new Error("Card icon prop must be an IconContainer component");var v;if(c&&!(e=>e?.type===l.Badge)(c))throw new Error("Card badge prop must be a Badge component");const I=!!c||!!s,M=()=>w?e.jsx(y,{children:e.jsx(f,{fdKey:`card-link-${w.label}`,href:w.href,iconRight:e.jsx(o,{}),onClick:w.onClick,underline:!1,children:w.label})}):null,z=()=>r?e.jsx(u,{variant:"h4Strong",children:r}):null,D=()=>e.jsx(g,{variant:"b1Weak",children:i});return e.jsxs(m,{"data-fd":t,type:C,...q,onMouseEnter:b,onMouseLeave:B,children:[a?e.jsx(j,{alt:n||"",component:"img",image:a,type:C}):null,e.jsx(h,{type:C,children:"horizontal"===C?e.jsxs(e.Fragment,{children:[e.jsxs(p,{children:[s&&s,e.jsxs(x,{children:[z(),D()]}),c&&c]}),M()]}):e.jsxs(e.Fragment,{children:[I&&e.jsxs(k,{hasBadge:!!c,hasIcon:!!s,children:[s&&s,c&&c]}),z(),D(),M()]})})]})};
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/Card/index.tsx"],"sourcesContent":["\nimport Box from '@mui/material/Box';\nimport MuiCard from '@mui/material/Card';\nimport CardContent from '@mui/material/CardContent';\nimport CardMedia from '@mui/material/CardMedia';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nimport RightArrowIcon from '../../../icons/ArrowRight02';\nimport Badge from '../Badge';\nimport IconContainer from '../IconContainer';\nimport Link, { type LinkProps } from '../Link';\n\nexport interface CardProps {\n fdKey?: string;\n heading: string;\n content: string;\n imageSrc?: string;\n icon?: React.ReactElement<typeof IconContainer>;\n badge?: React.ReactElement<typeof Badge>;\n link?: {\n label: string;\n href?: string;\n onClick?: () => void;\n }\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n type?: 'horizontal' | 'vertical';\n}\n\nconst StyledCard = styled(MuiCard)<{ type?: 'horizontal' | 'vertical' }>(({ theme, type }) => ({\n borderRadius: theme.radius['radius-16'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n ...(type === 'horizontal' && {\n display: 'flex',\n flexDirection: 'row',\n overflow: 'hidden',\n }),\n}));\n\nconst StyledCardContent = styled(CardContent)<{ type?: 'horizontal' | 'vertical' }>(({ theme, type }) => ({\n '&:last-child': {\n paddingBottom: theme.spacing(2),\n },\n ...(type === 'horizontal' && {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n }),\n}));\n\nconst StyledHorizontalContentWrapper = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'flex-start',\n gap: theme.spacing(2),\n flex: 1,\n}));\n\nconst StyledHorizontalTextContent = styled(Box)(() => ({\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n}));\n\nconst StyledHeading = styled(Typography)(({ theme }) => ({\n marginBottom: theme.spacing(1),\n}));\n\nconst StyledLinkContainer = styled(Box)(({ theme }) => ({\n marginTop: theme.spacing(1.5),\n}));\n\nconst StyledLink = styled(Link)<{ component?: LinkProps['component'] }>(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n}));\n\nconst StyledCardMedia = styled(CardMedia)<{ type?: 'horizontal' | 'vertical' }>(({ theme, type }) => ({\n ...(type === 'horizontal' ? {\n width: 200,\n height: 'auto',\n borderRight: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n borderBottom: 'none',\n flexShrink: 0,\n } : {\n height: 204,\n borderBottom: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n }),\n}));\n\ninterface StyledTopContentContainerProps {\n hasIcon: boolean;\n hasBadge: boolean;\n}\n\nconst StyledTopContentContainer = styled(Box, {\n shouldForwardProp: (prop) => !['hasIcon', 'hasBadge'].includes(prop as string),\n})<StyledTopContentContainerProps>(({ theme, hasIcon, hasBadge }) => {\n\n const onlyHasRightContent = hasBadge && !hasIcon;\n return {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: onlyHasRightContent ? 'flex-end' : 'space-between',\n alignItems: 'flex-start',\n gap: theme.spacing(2),\n marginBottom: theme.spacing(1.5),\n }\n});\n\n// Validation function to ensure only IconContainer components are passed\nconst isValidIconContainer = (element: React.ReactElement): boolean => {\n return element?.type === IconContainer;\n};\n\nconst isValidBadge = (element: React.ReactElement): boolean => {\n return element?.type === Badge;\n};\n\nconst Card = ({\n fdKey,\n heading,\n content,\n imageSrc,\n icon,\n badge,\n link,\n onMouseEnter,\n onMouseLeave,\n type = 'vertical',\n ...rest\n}: CardProps): React.ReactElement => {\n if (icon && !isValidIconContainer(icon)) {\n throw new Error('Card icon prop must be an IconContainer component');\n }\n if (badge && !isValidBadge(badge)) {\n throw new Error('Card badge prop must be a Badge component');\n }\n\n const hasTopContent = !!badge || !!icon;\n\n const renderImage = (): React.ReactElement | null => {\n if (!imageSrc) return null;\n return <StyledCardMedia image={imageSrc} type={type} />;\n };\n\n const renderLink = (): React.ReactElement | null => {\n if (!link) return null;\n return (\n <StyledLinkContainer>\n <StyledLink\n fdKey={`card-link-${link.label}`}\n href={link.href}\n iconRight={<RightArrowIcon />}\n onClick={link.onClick}\n underline={false}\n >\n {link.label}\n </StyledLink>\n </StyledLinkContainer>\n );\n };\n\n const renderHeading = (): React.ReactElement => {\n return (\n <StyledHeading variant=\"h4Strong\">\n {heading}\n </StyledHeading>\n );\n };\n\n const renderContent = (): React.ReactElement => {\n return (\n <Typography variant=\"b1Weak\">\n {content}\n </Typography>\n );\n };\n\n const renderHorizontalContent = (): React.ReactElement => {\n return (\n <>\n <StyledHorizontalContentWrapper>\n {icon && icon}\n <StyledHorizontalTextContent>\n {renderHeading()}\n {renderContent()}\n </StyledHorizontalTextContent>\n {badge && badge}\n </StyledHorizontalContentWrapper>\n {renderLink()}\n </>\n );\n };\n\n const renderVerticalContent = (): React.ReactElement => {\n return (\n <>\n {hasTopContent && (\n <StyledTopContentContainer hasBadge={!!badge} hasIcon={!!icon}>\n {icon && icon}\n {badge && badge}\n </StyledTopContentContainer>\n )}\n {renderHeading()}\n {renderContent()}\n {renderLink()}\n </>\n );\n };\n\n const renderCardContent = (): React.ReactElement => {\n if (type === 'horizontal') {\n return renderHorizontalContent();\n }\n return renderVerticalContent();\n };\n\n return (\n <StyledCard data-fd={fdKey} type={type} {...rest} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n {renderImage()}\n <StyledCardContent type={type}>\n {renderCardContent()}\n </StyledCardContent>\n </StyledCard>\n );\n};\n\nexport default Card;"],"names":["StyledCard","styled","MuiCard","theme","type","borderRadius","radius","border","palette","semantic","stroke","display","flexDirection","overflow","StyledCardContent","CardContent","paddingBottom","spacing","flex","justifyContent","StyledHorizontalContentWrapper","Box","alignItems","gap","StyledHorizontalTextContent","StyledHeading","Typography","marginBottom","StyledLinkContainer","marginTop","StyledLink","Link","StyledCardMedia","CardMedia","width","height","borderRight","borderBottom","flexShrink","StyledTopContentContainer","shouldForwardProp","prop","includes","hasIcon","hasBadge","fdKey","heading","content","imageSrc","icon","badge","link","onMouseEnter","onMouseLeave","rest","element","IconContainer","Error","Badge","isValidBadge","hasTopContent","renderLink","_jsx","label","href","iconRight","RightArrowIcon","onClick","underline","renderHeading","variant","children","renderContent","_jsxs","image","_Fragment"],"mappings":"yaA8BA,MAAMA,EAAaC,EAAAA,OAAOC,EAAPD,EAAsD,EAAGE,QAAOC,WAAM,CACvFC,aAAcF,EAAMG,OAAO,aAC3BC,OAAQ,aAAaJ,EAAMK,QAAQC,SAASC,OAAO,oBACtC,eAATN,GAAyB,CAC3BO,QAAS,OACTC,cAAe,MACfC,SAAU,cAIRC,EAAoBb,EAAAA,OAAOc,EAAPd,EAA0D,EAAGE,QAAOC,WAAM,CAClG,eAAgB,CACdY,cAAeb,EAAMc,QAAQ,OAElB,eAATb,GAAyB,CAC3Bc,KAAM,EACNP,QAAS,OACTC,cAAe,SACfO,eAAgB,qBAIdC,EAAiCnB,EAAAA,OAAOoB,EAAPpB,EAAY,EAAGE,YAAO,CAC3DQ,QAAS,OACTW,WAAY,aACZC,IAAKpB,EAAMc,QAAQ,GACnBC,KAAM,MAGFM,EAA8BvB,EAAAA,OAAOoB,EAAPpB,EAAY,KAAA,CAC9CiB,KAAM,EACNP,QAAS,OACTC,cAAe,aAGXa,EAAgBxB,EAAAA,OAAOyB,EAAPzB,EAAmB,EAAGE,YAAO,CACjDwB,aAAcxB,EAAMc,QAAQ,OAGxBW,EAAsB3B,EAAAA,OAAOoB,EAAPpB,EAAY,EAAGE,YAAO,CAChD0B,UAAW1B,EAAMc,QAAQ,SAGrBa,EAAa7B,EAAAA,OAAO8B,EAAAA,KAAP9B,EAAqD,EAAGE,YAAO,CAChFQ,QAAS,OACTW,WAAY,SACZC,IAAKpB,EAAMc,QAAQ,OAGfe,EAAkB/B,EAAAA,OAAOgC,EAAPhC,EAAwD,EAAGE,QAAOC,WAAM,IACjF,eAATA,EAAwB,CAC1B8B,MAAO,IACPC,OAAQ,OACRC,YAAa,aAAajC,EAAMK,QAAQC,SAASC,OAAO,iBACxD2B,aAAc,OACdC,WAAY,GACV,CACFH,OAAQ,IACRE,aAAc,aAAalC,EAAMK,QAAQC,SAASC,OAAO,sBASvD6B,EAA4BtC,EAAAA,OAAOoB,EAAK,CAC5CmB,kBAAoBC,IAAU,CAAC,UAAW,YAAYC,SAASD,IAD/BxC,EAEC,EAAGE,QAAOwC,UAASC,eAG7C,CACLjC,QAAS,OACTC,cAAe,MACfO,eAJ0ByB,IAAaD,EAID,WAAa,gBACnDrB,WAAY,aACZC,IAAKpB,EAAMc,QAAQ,GACnBU,aAAcxB,EAAMc,QAAQ,wBAanB,EACX4B,QACAC,UACAC,UACAC,WACAC,OACAC,QACAC,OACAC,eACAC,eACAjD,OAAO,cACJkD,MAEH,GAAIL,IArBwBM,EAqBMN,EApB3BM,GAASnD,OAASoD,GAqBvB,MAAM,IAAIC,MAAM,qDAtBS,IAACF,EAwB5B,GAAIL,IApBe,CAACK,GACbA,GAASnD,OAASsD,EAAAA,MAmBXC,CAAaT,GACzB,MAAM,IAAIO,MAAM,6CAGlB,MAAMG,IAAkBV,KAAWD,EAO7BY,EAAa,IACZV,EAEHW,EAAAA,IAAClC,YACCkC,EAAAA,IAAChC,GACCe,MAAO,aAAaM,EAAKY,QACzBC,KAAMb,EAAKa,KACXC,UAAWH,EAAAA,IAACI,EAAc,CAAA,GAC1BC,QAAShB,EAAKgB,QACdC,WAAW,WAEVjB,EAAKY,UAVM,KAgBdM,EAAgB,IAElBP,EAAAA,IAACrC,EAAa,CAAC6C,QAAQ,WAAUC,SAC9BzB,IAKD0B,EAAgB,IAElBV,EAAAA,IAACpC,EAAU,CAAC4C,QAAQ,SAAQC,SACzBxB,IA4CP,OACE0B,OAACzE,EAAU,CAAA,UAAU6C,EAAOzC,KAAMA,KAAUkD,EAAMF,aAAcA,EAAcC,aAAcA,YA7EvFL,EACEc,EAAAA,IAAC9B,EAAe,CAAC0C,MAAO1B,EAAU5C,KAAMA,IADzB,KA+EpB0D,EAAAA,IAAChD,EAAiB,CAACV,KAAMA,WATd,eAATA,EA/BFqE,OAAAE,EAAAA,SAAA,CAAAJ,SAAA,CACEE,EAAAA,KAACrD,EAA8B,CAAAmD,SAAA,CAC5BtB,GAAQA,EACTwB,EAAAA,KAACjD,EAA2B,CAAA+C,SAAA,CACzBF,IACAG,OAEFtB,GAASA,KAEXW,OAOHY,EAAAA,KAAAE,EAAAA,SAAA,CAAAJ,SAAA,CACGX,GACCa,EAAAA,KAAClC,EAAyB,CAACK,WAAYM,EAAOP,UAAWM,EAAIsB,SAAA,CAC1DtB,GAAQA,EACRC,GAASA,KAGbmB,IACAG,IACAX"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/Card/index.tsx"],"sourcesContent":["import Box from '@mui/material/Box';\nimport MuiCard from '@mui/material/Card';\nimport CardContent from '@mui/material/CardContent';\nimport CardMedia from '@mui/material/CardMedia';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nimport RightArrowIcon from '../../../icons/ArrowRight02';\nimport Badge from '../Badge';\nimport IconContainer from '../IconContainer';\nimport Link, { type LinkProps } from '../Link';\n\nexport interface CardProps {\n fdKey?: string;\n heading?: string;\n content: string;\n imageSrc?: string;\n imageAlt?: string;\n icon?: React.ReactElement<typeof IconContainer>;\n badge?: React.ReactElement<typeof Badge>;\n link?: {\n label: string;\n href?: string;\n onClick?: () => void;\n };\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n type?: 'horizontal' | 'vertical';\n}\n\nconst StyledCard = styled(MuiCard)<{ type?: 'horizontal' | 'vertical' }>(({ theme, type }) => ({\n borderRadius: theme.radius['radius-16'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n ...(type === 'horizontal' && {\n display: 'flex',\n flexDirection: 'row',\n overflow: 'hidden',\n }),\n}));\n\nconst StyledCardContent = styled(CardContent)<{ type?: 'horizontal' | 'vertical' }>(({ theme, type }) => ({\n '&:last-child': {\n paddingBottom: theme.spacing(2),\n },\n ...(type === 'horizontal' && {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n }),\n}));\n\nconst StyledHorizontalContentWrapper = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'flex-start',\n gap: theme.spacing(2),\n flex: 1,\n}));\n\nconst StyledHorizontalTextContent = styled(Box)(() => ({\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n}));\n\nconst StyledHeading = styled(Typography)(({ theme }) => ({\n marginBottom: theme.spacing(1),\n}));\n\nconst StyledContent = styled(Typography)(({ theme }) => ({\n color: theme.palette.semantic.text['text-weak'],\n}));\n\nconst StyledLinkContainer = styled(Box)(({ theme }) => ({\n marginTop: theme.spacing(1.5),\n}));\n\nconst StyledLink = styled(Link)<{ component?: LinkProps['component'] }>(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n}));\n\nconst StyledCardMedia = styled(CardMedia)<{\n alt?: string;\n component?: string;\n type?: 'horizontal' | 'vertical';\n}>(({ theme, type }) => ({\n ...(type === 'horizontal'\n ? {\n width: 200,\n height: 'auto',\n borderRight: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n borderBottom: 'none',\n flexShrink: 0,\n }\n : {\n height: 204,\n borderBottom: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n }),\n}));\n\ninterface StyledTopContentContainerProps {\n hasIcon: boolean;\n hasBadge: boolean;\n}\n\nconst StyledTopContentContainer = styled(Box, {\n shouldForwardProp: (prop) => !['hasIcon', 'hasBadge'].includes(prop as string),\n})<StyledTopContentContainerProps>(({ theme, hasIcon, hasBadge }) => {\n const onlyHasRightContent = hasBadge && !hasIcon;\n return {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: onlyHasRightContent ? 'flex-end' : 'space-between',\n alignItems: 'flex-start',\n gap: theme.spacing(2),\n marginBottom: theme.spacing(1.5),\n };\n});\n\n// Validation function to ensure only IconContainer components are passed\nconst isValidIconContainer = (element: React.ReactElement): boolean => {\n return element?.type === IconContainer;\n};\n\nconst isValidBadge = (element: React.ReactElement): boolean => {\n return element?.type === Badge;\n};\n\nconst Card = ({\n fdKey,\n heading,\n content,\n imageSrc,\n imageAlt,\n icon,\n badge,\n link,\n onMouseEnter,\n onMouseLeave,\n type = 'vertical',\n ...rest\n}: CardProps): React.ReactElement => {\n if (icon && !isValidIconContainer(icon)) {\n throw new Error('Card icon prop must be an IconContainer component');\n }\n if (badge && !isValidBadge(badge)) {\n throw new Error('Card badge prop must be a Badge component');\n }\n\n const hasTopContent = !!badge || !!icon;\n\n const renderImage = (): React.ReactElement | null => {\n if (!imageSrc) return null;\n return <StyledCardMedia alt={imageAlt || ''} component=\"img\" image={imageSrc} type={type} />;\n };\n\n const renderLink = (): React.ReactElement | null => {\n if (!link) return null;\n return (\n <StyledLinkContainer>\n <StyledLink\n fdKey={`card-link-${link.label}`}\n href={link.href}\n iconRight={<RightArrowIcon />}\n onClick={link.onClick}\n underline={false}\n >\n {link.label}\n </StyledLink>\n </StyledLinkContainer>\n );\n };\n\n const renderHeading = (): React.ReactElement | null => {\n if (!heading) return null;\n return <StyledHeading variant=\"h4Strong\">{heading}</StyledHeading>;\n };\n\n const renderContent = (): React.ReactElement => {\n return <StyledContent variant=\"b1Weak\">{content}</StyledContent>;\n };\n\n const renderHorizontalContent = (): React.ReactElement => {\n return (\n <>\n <StyledHorizontalContentWrapper>\n {icon && icon}\n <StyledHorizontalTextContent>\n {renderHeading()}\n {renderContent()}\n </StyledHorizontalTextContent>\n {badge && badge}\n </StyledHorizontalContentWrapper>\n {renderLink()}\n </>\n );\n };\n\n const renderVerticalContent = (): React.ReactElement => {\n return (\n <>\n {hasTopContent && (\n <StyledTopContentContainer hasBadge={!!badge} hasIcon={!!icon}>\n {icon && icon}\n {badge && badge}\n </StyledTopContentContainer>\n )}\n {renderHeading()}\n {renderContent()}\n {renderLink()}\n </>\n );\n };\n\n const renderCardContent = (): React.ReactElement => {\n if (type === 'horizontal') {\n return renderHorizontalContent();\n }\n return renderVerticalContent();\n };\n\n return (\n <StyledCard data-fd={fdKey} type={type} {...rest} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n {renderImage()}\n <StyledCardContent type={type}>{renderCardContent()}</StyledCardContent>\n </StyledCard>\n );\n};\n\nexport default Card;\n"],"names":["StyledCard","styled","MuiCard","theme","type","borderRadius","radius","border","palette","semantic","stroke","display","flexDirection","overflow","StyledCardContent","CardContent","paddingBottom","spacing","flex","justifyContent","StyledHorizontalContentWrapper","Box","alignItems","gap","StyledHorizontalTextContent","StyledHeading","Typography","marginBottom","StyledContent","color","text","StyledLinkContainer","marginTop","StyledLink","Link","StyledCardMedia","CardMedia","width","height","borderRight","borderBottom","flexShrink","StyledTopContentContainer","shouldForwardProp","prop","includes","hasIcon","hasBadge","fdKey","heading","content","imageSrc","imageAlt","icon","badge","link","onMouseEnter","onMouseLeave","rest","element","IconContainer","Error","Badge","isValidBadge","hasTopContent","renderLink","_jsx","label","href","iconRight","RightArrowIcon","onClick","underline","renderHeading","variant","children","renderContent","_jsxs","alt","component","image","_Fragment"],"mappings":"yaA8BA,MAAMA,EAAaC,EAAAA,OAAOC,EAAPD,EAAsD,EAAGE,QAAOC,WAAM,CACvFC,aAAcF,EAAMG,OAAO,aAC3BC,OAAQ,aAAaJ,EAAMK,QAAQC,SAASC,OAAO,oBACtC,eAATN,GAAyB,CAC3BO,QAAS,OACTC,cAAe,MACfC,SAAU,cAIRC,EAAoBb,EAAAA,OAAOc,EAAPd,EAA0D,EAAGE,QAAOC,WAAM,CAClG,eAAgB,CACdY,cAAeb,EAAMc,QAAQ,OAElB,eAATb,GAAyB,CAC3Bc,KAAM,EACNP,QAAS,OACTC,cAAe,SACfO,eAAgB,qBAIdC,EAAiCnB,EAAAA,OAAOoB,EAAPpB,EAAY,EAAGE,YAAO,CAC3DQ,QAAS,OACTW,WAAY,aACZC,IAAKpB,EAAMc,QAAQ,GACnBC,KAAM,MAGFM,EAA8BvB,EAAAA,OAAOoB,EAAPpB,EAAY,KAAA,CAC9CiB,KAAM,EACNP,QAAS,OACTC,cAAe,aAGXa,EAAgBxB,EAAAA,OAAOyB,EAAPzB,EAAmB,EAAGE,YAAO,CACjDwB,aAAcxB,EAAMc,QAAQ,OAGxBW,EAAgB3B,EAAAA,OAAOyB,EAAPzB,EAAmB,EAAGE,YAAO,CACjD0B,MAAO1B,EAAMK,QAAQC,SAASqB,KAAK,iBAG/BC,EAAsB9B,EAAAA,OAAOoB,EAAPpB,EAAY,EAAGE,YAAO,CAChD6B,UAAW7B,EAAMc,QAAQ,SAGrBgB,EAAahC,EAAAA,OAAOiC,EAAAA,KAAPjC,EAAqD,EAAGE,YAAO,CAChFQ,QAAS,OACTW,WAAY,SACZC,IAAKpB,EAAMc,QAAQ,OAGfkB,EAAkBlC,EAAAA,OAAOmC,EAAPnC,EAIrB,EAAGE,QAAOC,WAAM,IACJ,eAATA,EACA,CACEiC,MAAO,IACPC,OAAQ,OACRC,YAAa,aAAapC,EAAMK,QAAQC,SAASC,OAAO,iBACxD8B,aAAc,OACdC,WAAY,GAEd,CACEH,OAAQ,IACRE,aAAc,aAAarC,EAAMK,QAAQC,SAASC,OAAO,sBAS3DgC,EAA4BzC,EAAAA,OAAOoB,EAAK,CAC5CsB,kBAAoBC,IAAU,CAAC,UAAW,YAAYC,SAASD,IAD/B3C,EAEC,EAAGE,QAAO2C,UAASC,eAE7C,CACLpC,QAAS,OACTC,cAAe,MACfO,eAJ0B4B,IAAaD,EAID,WAAa,gBACnDxB,WAAY,aACZC,IAAKpB,EAAMc,QAAQ,GACnBU,aAAcxB,EAAMc,QAAQ,wBAanB,EACX+B,QACAC,UACAC,UACAC,WACAC,WACAC,OACAC,QACAC,OACAC,eACAC,eACArD,OAAO,cACJsD,MAEH,GAAIL,IAtBwBM,EAsBMN,EArB3BM,GAASvD,OAASwD,GAsBvB,MAAM,IAAIC,MAAM,qDAvBS,IAACF,EAyB5B,GAAIL,IArBe,CAACK,GACbA,GAASvD,OAAS0D,EAAAA,MAoBXC,CAAaT,GACzB,MAAM,IAAIO,MAAM,6CAGlB,MAAMG,IAAkBV,KAAWD,EAO7BY,EAAa,IACZV,EAEHW,EAAAA,IAACnC,YACCmC,EAAAA,IAACjC,GACCe,MAAO,aAAaO,EAAKY,QACzBC,KAAMb,EAAKa,KACXC,UAAWH,EAAAA,IAACI,EAAc,CAAA,GAC1BC,QAAShB,EAAKgB,QACdC,WAAW,WAEVjB,EAAKY,UAVM,KAgBdM,EAAgB,IACfxB,EACEiB,EAAAA,IAACzC,EAAa,CAACiD,QAAQ,WAAUC,SAAE1B,IADrB,KAIjB2B,EAAgB,IACbV,EAAAA,IAACtC,EAAa,CAAC8C,QAAQ,SAAQC,SAAEzB,IA0C1C,OACE2B,OAAC7E,EAAU,CAAA,UAAUgD,EAAO5C,KAAMA,KAAUsD,EAAMF,aAAcA,EAAcC,aAAcA,YAtEvFN,EACEe,EAAAA,IAAC/B,EAAe,CAAC2C,IAAK1B,GAAY,GAAI2B,UAAU,MAAMC,MAAO7B,EAAU/C,KAAMA,IAD9D,KAwEpB8D,EAAAA,IAACpD,EAAiB,CAACV,KAAMA,WATd,eAATA,EA/BFyE,OAAAI,EAAAA,SAAA,CAAAN,SAAA,CACEE,EAAAA,KAACzD,EAA8B,CAAAuD,SAAA,CAC5BtB,GAAQA,EACTwB,EAAAA,KAACrD,EAA2B,CAAAmD,SAAA,CACzBF,IACAG,OAEFtB,GAASA,KAEXW,OAOHY,EAAAA,KAAAI,EAAAA,SAAA,CAAAN,SAAA,CACGX,GACCa,EAAAA,KAACnC,EAAyB,CAACK,WAAYO,EAAOR,UAAWO,EAAIsB,SAAA,CAC1DtB,GAAQA,EACRC,GAASA,KAGbmB,IACAG,IACAX"}
@@ -3,9 +3,10 @@ import IconContainer from '../IconContainer/index.js';
3
3
 
4
4
  interface CardProps {
5
5
  fdKey?: string;
6
- heading: string;
6
+ heading?: string;
7
7
  content: string;
8
8
  imageSrc?: string;
9
+ imageAlt?: string;
9
10
  icon?: React.ReactElement<typeof IconContainer>;
10
11
  badge?: React.ReactElement<typeof Badge>;
11
12
  link?: {
@@ -17,7 +18,7 @@ interface CardProps {
17
18
  onMouseLeave?: () => void;
18
19
  type?: 'horizontal' | 'vertical';
19
20
  }
20
- declare const Card: ({ fdKey, heading, content, imageSrc, icon, badge, link, onMouseEnter, onMouseLeave, type, ...rest }: CardProps) => React.ReactElement;
21
+ declare const Card: ({ fdKey, heading, content, imageSrc, imageAlt, icon, badge, link, onMouseEnter, onMouseLeave, type, ...rest }: CardProps) => React.ReactElement;
21
22
 
22
23
  export { Card as default };
23
24
  export type { CardProps };
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import i from"@mui/material/Box";import o from"@mui/material/Card";import a from"@mui/material/CardContent";import n from"@mui/material/CardMedia";import{styled as l}from"@mui/material/styles";import m from"@mui/material/Typography";import d from"../../../icons/ArrowRight02/index.js";import{Badge as s}from"../Badge/index.js";import p from"../IconContainer/index.js";import{Link as c}from"../Link/index.js";const h=l(o)((({theme:e,type:t})=>({borderRadius:e.radius["radius-16"],border:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`,..."horizontal"===t&&{display:"flex",flexDirection:"row",overflow:"hidden"}}))),f=l(a)((({theme:e,type:t})=>({"&:last-child":{paddingBottom:e.spacing(2)},..."horizontal"===t&&{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"}}))),g=l(i)((({theme:e})=>({display:"flex",alignItems:"flex-start",gap:e.spacing(2),flex:1}))),u=l(i)((()=>({flex:1,display:"flex",flexDirection:"column"}))),x=l(m)((({theme:e})=>({marginBottom:e.spacing(1)}))),y=l(i)((({theme:e})=>({marginTop:e.spacing(1.5)}))),k=l(c)((({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1)}))),w=l(n)((({theme:e,type:t})=>({..."horizontal"===t?{width:200,height:"auto",borderRight:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`,borderBottom:"none",flexShrink:0}:{height:204,borderBottom:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`}}))),b=l(i,{shouldForwardProp:e=>!["hasIcon","hasBadge"].includes(e)})((({theme:e,hasIcon:t,hasBadge:r})=>({display:"flex",flexDirection:"row",justifyContent:r&&!t?"flex-end":"space-between",alignItems:"flex-start",gap:e.spacing(2),marginBottom:e.spacing(1.5)}))),C=({fdKey:i,heading:o,content:a,imageSrc:n,icon:l,badge:c,link:C,onMouseEnter:B,onMouseLeave:I,type:j="vertical",...v})=>{if(l&&(M=l,M?.type!==p))throw new Error("Card icon prop must be an IconContainer component");var M;if(c&&!(e=>e?.type===s)(c))throw new Error("Card badge prop must be a Badge component");const z=!!c||!!l,D=()=>C?t(y,{children:t(k,{fdKey:`card-link-${C.label}`,href:C.href,iconRight:t(d,{}),onClick:C.onClick,underline:!1,children:C.label})}):null,E=()=>t(x,{variant:"h4Strong",children:o}),R=()=>t(m,{variant:"b1Weak",children:a});return e(h,{"data-fd":i,type:j,...v,onMouseEnter:B,onMouseLeave:I,children:[n?t(w,{image:n,type:j}):null,t(f,{type:j,children:e(r,"horizontal"===j?{children:[e(g,{children:[l&&l,e(u,{children:[E(),R()]}),c&&c]}),D()]}:{children:[z&&e(b,{hasBadge:!!c,hasIcon:!!l,children:[l&&l,c&&c]}),E(),R(),D()]})})]})};export{C as default};
1
+ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import o from"@mui/material/Box";import r from"@mui/material/Card";import a from"@mui/material/CardContent";import n from"@mui/material/CardMedia";import{styled as l}from"@mui/material/styles";import m from"@mui/material/Typography";import s from"../../../icons/ArrowRight02/index.js";import{Badge as d}from"../Badge/index.js";import p from"../IconContainer/index.js";import{Link as c}from"../Link/index.js";const h=l(r)((({theme:e,type:t})=>({borderRadius:e.radius["radius-16"],border:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`,..."horizontal"===t&&{display:"flex",flexDirection:"row",overflow:"hidden"}}))),f=l(a)((({theme:e,type:t})=>({"&:last-child":{paddingBottom:e.spacing(2)},..."horizontal"===t&&{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"}}))),g=l(o)((({theme:e})=>({display:"flex",alignItems:"flex-start",gap:e.spacing(2),flex:1}))),u=l(o)((()=>({flex:1,display:"flex",flexDirection:"column"}))),x=l(m)((({theme:e})=>({marginBottom:e.spacing(1)}))),y=l(m)((({theme:e})=>({color:e.palette.semantic.text["text-weak"]}))),k=l(o)((({theme:e})=>({marginTop:e.spacing(1.5)}))),w=l(c)((({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1)}))),b=l(n)((({theme:e,type:t})=>({..."horizontal"===t?{width:200,height:"auto",borderRight:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`,borderBottom:"none",flexShrink:0}:{height:204,borderBottom:`1px solid ${e.palette.semantic.stroke["stroke-weak"]}`}}))),C=l(o,{shouldForwardProp:e=>!["hasIcon","hasBadge"].includes(e)})((({theme:e,hasIcon:t,hasBadge:i})=>({display:"flex",flexDirection:"row",justifyContent:i&&!t?"flex-end":"space-between",alignItems:"flex-start",gap:e.spacing(2),marginBottom:e.spacing(1.5)}))),B=({fdKey:o,heading:r,content:a,imageSrc:n,imageAlt:l,icon:m,badge:c,link:B,onMouseEnter:I,onMouseLeave:j,type:v="vertical",...M})=>{if(m&&(z=m,z?.type!==p))throw new Error("Card icon prop must be an IconContainer component");var z;if(c&&!(e=>e?.type===d)(c))throw new Error("Card badge prop must be a Badge component");const D=!!c||!!m,E=()=>B?t(k,{children:t(w,{fdKey:`card-link-${B.label}`,href:B.href,iconRight:t(s,{}),onClick:B.onClick,underline:!1,children:B.label})}):null,R=()=>r?t(x,{variant:"h4Strong",children:r}):null,$=()=>t(y,{variant:"b1Weak",children:a});return e(h,{"data-fd":o,type:v,...M,onMouseEnter:I,onMouseLeave:j,children:[n?t(b,{alt:l||"",component:"img",image:n,type:v}):null,t(f,{type:v,children:e(i,"horizontal"===v?{children:[e(g,{children:[m&&m,e(u,{children:[R(),$()]}),c&&c]}),E()]}:{children:[D&&e(C,{hasBadge:!!c,hasIcon:!!m,children:[m&&m,c&&c]}),R(),$(),E()]})})]})};export{B as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Card/index.tsx"],"sourcesContent":["\nimport Box from '@mui/material/Box';\nimport MuiCard from '@mui/material/Card';\nimport CardContent from '@mui/material/CardContent';\nimport CardMedia from '@mui/material/CardMedia';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nimport RightArrowIcon from '../../../icons/ArrowRight02';\nimport Badge from '../Badge';\nimport IconContainer from '../IconContainer';\nimport Link, { type LinkProps } from '../Link';\n\nexport interface CardProps {\n fdKey?: string;\n heading: string;\n content: string;\n imageSrc?: string;\n icon?: React.ReactElement<typeof IconContainer>;\n badge?: React.ReactElement<typeof Badge>;\n link?: {\n label: string;\n href?: string;\n onClick?: () => void;\n }\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n type?: 'horizontal' | 'vertical';\n}\n\nconst StyledCard = styled(MuiCard)<{ type?: 'horizontal' | 'vertical' }>(({ theme, type }) => ({\n borderRadius: theme.radius['radius-16'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n ...(type === 'horizontal' && {\n display: 'flex',\n flexDirection: 'row',\n overflow: 'hidden',\n }),\n}));\n\nconst StyledCardContent = styled(CardContent)<{ type?: 'horizontal' | 'vertical' }>(({ theme, type }) => ({\n '&:last-child': {\n paddingBottom: theme.spacing(2),\n },\n ...(type === 'horizontal' && {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n }),\n}));\n\nconst StyledHorizontalContentWrapper = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'flex-start',\n gap: theme.spacing(2),\n flex: 1,\n}));\n\nconst StyledHorizontalTextContent = styled(Box)(() => ({\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n}));\n\nconst StyledHeading = styled(Typography)(({ theme }) => ({\n marginBottom: theme.spacing(1),\n}));\n\nconst StyledLinkContainer = styled(Box)(({ theme }) => ({\n marginTop: theme.spacing(1.5),\n}));\n\nconst StyledLink = styled(Link)<{ component?: LinkProps['component'] }>(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n}));\n\nconst StyledCardMedia = styled(CardMedia)<{ type?: 'horizontal' | 'vertical' }>(({ theme, type }) => ({\n ...(type === 'horizontal' ? {\n width: 200,\n height: 'auto',\n borderRight: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n borderBottom: 'none',\n flexShrink: 0,\n } : {\n height: 204,\n borderBottom: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n }),\n}));\n\ninterface StyledTopContentContainerProps {\n hasIcon: boolean;\n hasBadge: boolean;\n}\n\nconst StyledTopContentContainer = styled(Box, {\n shouldForwardProp: (prop) => !['hasIcon', 'hasBadge'].includes(prop as string),\n})<StyledTopContentContainerProps>(({ theme, hasIcon, hasBadge }) => {\n\n const onlyHasRightContent = hasBadge && !hasIcon;\n return {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: onlyHasRightContent ? 'flex-end' : 'space-between',\n alignItems: 'flex-start',\n gap: theme.spacing(2),\n marginBottom: theme.spacing(1.5),\n }\n});\n\n// Validation function to ensure only IconContainer components are passed\nconst isValidIconContainer = (element: React.ReactElement): boolean => {\n return element?.type === IconContainer;\n};\n\nconst isValidBadge = (element: React.ReactElement): boolean => {\n return element?.type === Badge;\n};\n\nconst Card = ({\n fdKey,\n heading,\n content,\n imageSrc,\n icon,\n badge,\n link,\n onMouseEnter,\n onMouseLeave,\n type = 'vertical',\n ...rest\n}: CardProps): React.ReactElement => {\n if (icon && !isValidIconContainer(icon)) {\n throw new Error('Card icon prop must be an IconContainer component');\n }\n if (badge && !isValidBadge(badge)) {\n throw new Error('Card badge prop must be a Badge component');\n }\n\n const hasTopContent = !!badge || !!icon;\n\n const renderImage = (): React.ReactElement | null => {\n if (!imageSrc) return null;\n return <StyledCardMedia image={imageSrc} type={type} />;\n };\n\n const renderLink = (): React.ReactElement | null => {\n if (!link) return null;\n return (\n <StyledLinkContainer>\n <StyledLink\n fdKey={`card-link-${link.label}`}\n href={link.href}\n iconRight={<RightArrowIcon />}\n onClick={link.onClick}\n underline={false}\n >\n {link.label}\n </StyledLink>\n </StyledLinkContainer>\n );\n };\n\n const renderHeading = (): React.ReactElement => {\n return (\n <StyledHeading variant=\"h4Strong\">\n {heading}\n </StyledHeading>\n );\n };\n\n const renderContent = (): React.ReactElement => {\n return (\n <Typography variant=\"b1Weak\">\n {content}\n </Typography>\n );\n };\n\n const renderHorizontalContent = (): React.ReactElement => {\n return (\n <>\n <StyledHorizontalContentWrapper>\n {icon && icon}\n <StyledHorizontalTextContent>\n {renderHeading()}\n {renderContent()}\n </StyledHorizontalTextContent>\n {badge && badge}\n </StyledHorizontalContentWrapper>\n {renderLink()}\n </>\n );\n };\n\n const renderVerticalContent = (): React.ReactElement => {\n return (\n <>\n {hasTopContent && (\n <StyledTopContentContainer hasBadge={!!badge} hasIcon={!!icon}>\n {icon && icon}\n {badge && badge}\n </StyledTopContentContainer>\n )}\n {renderHeading()}\n {renderContent()}\n {renderLink()}\n </>\n );\n };\n\n const renderCardContent = (): React.ReactElement => {\n if (type === 'horizontal') {\n return renderHorizontalContent();\n }\n return renderVerticalContent();\n };\n\n return (\n <StyledCard data-fd={fdKey} type={type} {...rest} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n {renderImage()}\n <StyledCardContent type={type}>\n {renderCardContent()}\n </StyledCardContent>\n </StyledCard>\n );\n};\n\nexport default Card;"],"names":["StyledCard","styled","MuiCard","theme","type","borderRadius","radius","border","palette","semantic","stroke","display","flexDirection","overflow","StyledCardContent","CardContent","paddingBottom","spacing","flex","justifyContent","StyledHorizontalContentWrapper","Box","alignItems","gap","StyledHorizontalTextContent","StyledHeading","Typography","marginBottom","StyledLinkContainer","marginTop","StyledLink","Link","StyledCardMedia","CardMedia","width","height","borderRight","borderBottom","flexShrink","StyledTopContentContainer","shouldForwardProp","prop","includes","hasIcon","hasBadge","Card","fdKey","heading","content","imageSrc","icon","badge","link","onMouseEnter","onMouseLeave","rest","element","IconContainer","Error","Badge","isValidBadge","hasTopContent","renderLink","_jsx","label","href","iconRight","RightArrowIcon","onClick","underline","renderHeading","variant","children","renderContent","_jsxs","image","_Fragment"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Card/index.tsx"],"sourcesContent":["import Box from '@mui/material/Box';\nimport MuiCard from '@mui/material/Card';\nimport CardContent from '@mui/material/CardContent';\nimport CardMedia from '@mui/material/CardMedia';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nimport RightArrowIcon from '../../../icons/ArrowRight02';\nimport Badge from '../Badge';\nimport IconContainer from '../IconContainer';\nimport Link, { type LinkProps } from '../Link';\n\nexport interface CardProps {\n fdKey?: string;\n heading?: string;\n content: string;\n imageSrc?: string;\n imageAlt?: string;\n icon?: React.ReactElement<typeof IconContainer>;\n badge?: React.ReactElement<typeof Badge>;\n link?: {\n label: string;\n href?: string;\n onClick?: () => void;\n };\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n type?: 'horizontal' | 'vertical';\n}\n\nconst StyledCard = styled(MuiCard)<{ type?: 'horizontal' | 'vertical' }>(({ theme, type }) => ({\n borderRadius: theme.radius['radius-16'],\n border: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n ...(type === 'horizontal' && {\n display: 'flex',\n flexDirection: 'row',\n overflow: 'hidden',\n }),\n}));\n\nconst StyledCardContent = styled(CardContent)<{ type?: 'horizontal' | 'vertical' }>(({ theme, type }) => ({\n '&:last-child': {\n paddingBottom: theme.spacing(2),\n },\n ...(type === 'horizontal' && {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n }),\n}));\n\nconst StyledHorizontalContentWrapper = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'flex-start',\n gap: theme.spacing(2),\n flex: 1,\n}));\n\nconst StyledHorizontalTextContent = styled(Box)(() => ({\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n}));\n\nconst StyledHeading = styled(Typography)(({ theme }) => ({\n marginBottom: theme.spacing(1),\n}));\n\nconst StyledContent = styled(Typography)(({ theme }) => ({\n color: theme.palette.semantic.text['text-weak'],\n}));\n\nconst StyledLinkContainer = styled(Box)(({ theme }) => ({\n marginTop: theme.spacing(1.5),\n}));\n\nconst StyledLink = styled(Link)<{ component?: LinkProps['component'] }>(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n}));\n\nconst StyledCardMedia = styled(CardMedia)<{\n alt?: string;\n component?: string;\n type?: 'horizontal' | 'vertical';\n}>(({ theme, type }) => ({\n ...(type === 'horizontal'\n ? {\n width: 200,\n height: 'auto',\n borderRight: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n borderBottom: 'none',\n flexShrink: 0,\n }\n : {\n height: 204,\n borderBottom: `1px solid ${theme.palette.semantic.stroke['stroke-weak']}`,\n }),\n}));\n\ninterface StyledTopContentContainerProps {\n hasIcon: boolean;\n hasBadge: boolean;\n}\n\nconst StyledTopContentContainer = styled(Box, {\n shouldForwardProp: (prop) => !['hasIcon', 'hasBadge'].includes(prop as string),\n})<StyledTopContentContainerProps>(({ theme, hasIcon, hasBadge }) => {\n const onlyHasRightContent = hasBadge && !hasIcon;\n return {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: onlyHasRightContent ? 'flex-end' : 'space-between',\n alignItems: 'flex-start',\n gap: theme.spacing(2),\n marginBottom: theme.spacing(1.5),\n };\n});\n\n// Validation function to ensure only IconContainer components are passed\nconst isValidIconContainer = (element: React.ReactElement): boolean => {\n return element?.type === IconContainer;\n};\n\nconst isValidBadge = (element: React.ReactElement): boolean => {\n return element?.type === Badge;\n};\n\nconst Card = ({\n fdKey,\n heading,\n content,\n imageSrc,\n imageAlt,\n icon,\n badge,\n link,\n onMouseEnter,\n onMouseLeave,\n type = 'vertical',\n ...rest\n}: CardProps): React.ReactElement => {\n if (icon && !isValidIconContainer(icon)) {\n throw new Error('Card icon prop must be an IconContainer component');\n }\n if (badge && !isValidBadge(badge)) {\n throw new Error('Card badge prop must be a Badge component');\n }\n\n const hasTopContent = !!badge || !!icon;\n\n const renderImage = (): React.ReactElement | null => {\n if (!imageSrc) return null;\n return <StyledCardMedia alt={imageAlt || ''} component=\"img\" image={imageSrc} type={type} />;\n };\n\n const renderLink = (): React.ReactElement | null => {\n if (!link) return null;\n return (\n <StyledLinkContainer>\n <StyledLink\n fdKey={`card-link-${link.label}`}\n href={link.href}\n iconRight={<RightArrowIcon />}\n onClick={link.onClick}\n underline={false}\n >\n {link.label}\n </StyledLink>\n </StyledLinkContainer>\n );\n };\n\n const renderHeading = (): React.ReactElement | null => {\n if (!heading) return null;\n return <StyledHeading variant=\"h4Strong\">{heading}</StyledHeading>;\n };\n\n const renderContent = (): React.ReactElement => {\n return <StyledContent variant=\"b1Weak\">{content}</StyledContent>;\n };\n\n const renderHorizontalContent = (): React.ReactElement => {\n return (\n <>\n <StyledHorizontalContentWrapper>\n {icon && icon}\n <StyledHorizontalTextContent>\n {renderHeading()}\n {renderContent()}\n </StyledHorizontalTextContent>\n {badge && badge}\n </StyledHorizontalContentWrapper>\n {renderLink()}\n </>\n );\n };\n\n const renderVerticalContent = (): React.ReactElement => {\n return (\n <>\n {hasTopContent && (\n <StyledTopContentContainer hasBadge={!!badge} hasIcon={!!icon}>\n {icon && icon}\n {badge && badge}\n </StyledTopContentContainer>\n )}\n {renderHeading()}\n {renderContent()}\n {renderLink()}\n </>\n );\n };\n\n const renderCardContent = (): React.ReactElement => {\n if (type === 'horizontal') {\n return renderHorizontalContent();\n }\n return renderVerticalContent();\n };\n\n return (\n <StyledCard data-fd={fdKey} type={type} {...rest} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n {renderImage()}\n <StyledCardContent type={type}>{renderCardContent()}</StyledCardContent>\n </StyledCard>\n );\n};\n\nexport default Card;\n"],"names":["StyledCard","styled","MuiCard","theme","type","borderRadius","radius","border","palette","semantic","stroke","display","flexDirection","overflow","StyledCardContent","CardContent","paddingBottom","spacing","flex","justifyContent","StyledHorizontalContentWrapper","Box","alignItems","gap","StyledHorizontalTextContent","StyledHeading","Typography","marginBottom","StyledContent","color","text","StyledLinkContainer","marginTop","StyledLink","Link","StyledCardMedia","CardMedia","width","height","borderRight","borderBottom","flexShrink","StyledTopContentContainer","shouldForwardProp","prop","includes","hasIcon","hasBadge","Card","fdKey","heading","content","imageSrc","imageAlt","icon","badge","link","onMouseEnter","onMouseLeave","rest","element","IconContainer","Error","Badge","isValidBadge","hasTopContent","renderLink","_jsx","label","href","iconRight","RightArrowIcon","onClick","underline","renderHeading","variant","children","renderContent","_jsxs","alt","component","image","_Fragment"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),i=require("@mui/material/Box"),l=require("@mui/material/Checkbox"),t=require("@mui/material/FormControlLabel"),r=require("@mui/material/styles"),s=require("../../../icons/Remove/index.cjs.js"),o=require("../../../icons/Tick/index.cjs.js"),a=require("../../../themes/tokens/typography/font-family.cjs.js"),n=require("../../../themes/typography.cjs.js");const d=r.styled(i,{shouldForwardProp:e=>"size"!==e&&"valid"!==e&&"disabled"!==e})((({theme:e,size:i,valid:l,disabled:t})=>{const r=e.spacing("small"===i?3:4);return{width:r,height:r,borderRadius:e.radius["radius-4"],border:`1px solid ${e.palette.semantic.stroke["stroke-strong"]}`,backgroundColor:"transparent",position:"relative",...t&&{border:`1px solid ${e.palette.semantic.stroke["stroke-disabled"]}`,backgroundColor:e.palette.semantic.fill["fill-inverse-strong"]},...!l&&!t&&{border:`2px solid ${e.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:e.palette.semantic.fill["fill-error-weak"]},...!t&&{"&::before":{content:'""',width:r,height:r,inset:l?"-1px 0 0 -1px":"-2px 0 0 -2px",position:"absolute",borderRadius:e.radius["radius-4"],pointerEvents:"none"},"input:hover ~ &::before":{backgroundColor:e.palette.semantic.fill["fill-hover"]},"input:active ~ &::before":{backgroundColor:e.palette.semantic.fill["fill-press"]},"input:focus ~ &":{outline:`2px solid ${e.palette.semantic.stroke["stroke-focus"]}`,outlineOffset:"2px"}}}})),c=r.styled(i,{shouldForwardProp:e=>"size"!==e&&"valid"!==e&&"disabled"!==e})((({theme:e,size:i,valid:l,disabled:t})=>{const r=e.spacing("small"===i?3:4);return{width:r,height:r,borderRadius:e.radius["radius-4"],backgroundColor:e.palette.semantic.fill["fill-selected"],position:"relative",...t&&{backgroundColor:e.palette.semantic.fill["fill-disabled"]},...!l&&!t&&{backgroundColor:e.palette.semantic.fill["fill-error-strong"]},...!t&&{"&::before":{content:'""',inset:0,position:"absolute",borderRadius:e.radius["radius-4"],pointerEvents:"none"},"input:hover ~ &::before":{backgroundColor:e.palette.semantic.fill["fill-hover"]},"input:active ~ &::before":{backgroundColor:e.palette.semantic.fill["fill-press"]},"input:focus ~ &":{outline:`2px solid ${e.palette.semantic.stroke["stroke-focus"]}`,outlineOffset:"2px"}},display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:r,height:r,color:e.palette.semantic.fill["fill-inverse-strong"],flexShrink:0,display:"block",overflow:"visible","& g, & path":{transform:"scale(1.08)",transformOrigin:"center"}}}})),p=r.styled(t,{shouldForwardProp:e=>!["size","valid"].includes(e)})((({theme:e,size:i})=>({alignItems:"center",display:"flex",justifyContent:"flex-start",margin:0,padding:0,..."small"===i&&{gap:e.spacing(1)},..."medium"===i&&{gap:e.spacing(1.5)},"& .MuiTypography-root":{..."small"===i&&{...n.typography.captionWeak,[e.breakpoints.down("tablet")]:{fontFamily:a.fontFamily.mobile.body,...n.getMobileTextStyle("caption")}}}}))),u=r.styled(l,{shouldForwardProp:e=>"valid"!==e})((({theme:e,valid:i,disabled:l})=>({padding:0,margin:0,...!i&&!l&&{color:e.palette.semantic.fill["fill-error-strong"],"&.Mui-checked":{color:e.palette.semantic.fill["fill-error-strong"]}}})));module.exports=({fdKey:i,label:l,size:t="medium",valid:r=!0,disabled:a,...n})=>e.jsx(p,{control:e.jsx(u,{disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,checkedIcon:e.jsx(c,{disabled:a,size:t,valid:r,children:e.jsx(o,{})}),"data-fd":i,icon:e.jsx(d,{disabled:a,size:t,valid:r}),indeterminateIcon:e.jsx(c,{disabled:a,size:t,valid:r,children:e.jsx(s,{})}),size:t,valid:r,...n}),"data-fd":`${i}-label`,disabled:a,label:l,size:t});
1
+ "use strict";var e=require("react/jsx-runtime"),i=require("@mui/material/Box"),l=require("@mui/material/Checkbox"),t=require("@mui/material/FormControlLabel"),r=require("@mui/material/styles"),s=require("../../../icons/Remove/index.cjs.js"),o=require("../../../icons/Tick/index.cjs.js"),a=require("../../../themes/tokens/typography/font-family.cjs.js"),n=require("../../../themes/typography.cjs.js");const d=r.styled(i,{shouldForwardProp:e=>"size"!==e&&"valid"!==e&&"disabled"!==e})((({theme:e,size:i,valid:l,disabled:t})=>{const r=e.spacing("small"===i?3:4);return{width:r,height:r,borderRadius:e.radius["radius-4"],border:`1px solid ${e.palette.semantic.stroke["stroke-strong"]}`,backgroundColor:e.palette.semantic.fill["fill-inverse-strong"],position:"relative",...t&&{border:`1px solid ${e.palette.semantic.stroke["stroke-disabled"]}`,backgroundColor:e.palette.semantic.fill["fill-inverse-strong"]},...!l&&!t&&{border:`2px solid ${e.palette.semantic.stroke["stroke-error-strong"]}`,backgroundColor:e.palette.semantic.fill["fill-error-weak"]},...!t&&{"&::before":{content:'""',width:r,height:r,inset:l?"-1px 0 0 -1px":"-2px 0 0 -2px",position:"absolute",borderRadius:e.radius["radius-4"],pointerEvents:"none"},"input:hover ~ &::before":{backgroundColor:e.palette.semantic.fill["fill-hover"]},"input:active ~ &::before":{backgroundColor:e.palette.semantic.fill["fill-press"]},"input:focus ~ &":{outline:`2px solid ${e.palette.semantic.stroke["stroke-focus"]}`,outlineOffset:"2px"}}}})),c=r.styled(i,{shouldForwardProp:e=>"size"!==e&&"valid"!==e&&"disabled"!==e})((({theme:e,size:i,valid:l,disabled:t})=>{const r=e.spacing("small"===i?3:4);return{width:r,height:r,borderRadius:e.radius["radius-4"],backgroundColor:e.palette.semantic.fill["fill-selected"],position:"relative",...t&&{backgroundColor:e.palette.semantic.fill["fill-disabled"]},...!l&&!t&&{backgroundColor:e.palette.semantic.fill["fill-error-strong"]},...!t&&{"&::before":{content:'""',inset:0,position:"absolute",borderRadius:e.radius["radius-4"],pointerEvents:"none"},"input:hover ~ &::before":{backgroundColor:e.palette.semantic.fill["fill-hover"]},"input:active ~ &::before":{backgroundColor:e.palette.semantic.fill["fill-press"]},"input:focus ~ &":{outline:`2px solid ${e.palette.semantic.stroke["stroke-focus"]}`,outlineOffset:"2px"}},display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:r,height:r,color:e.palette.semantic.fill["fill-inverse-strong"],flexShrink:0,display:"block",overflow:"visible","& g, & path":{transform:"scale(1.08)",transformOrigin:"center"}}}})),p=r.styled(t,{shouldForwardProp:e=>!["size","valid"].includes(e)})((({theme:e,size:i})=>({alignItems:"center",display:"flex",justifyContent:"flex-start",margin:0,padding:0,..."small"===i&&{gap:e.spacing(1)},..."medium"===i&&{gap:e.spacing(1.5)},"& .MuiTypography-root":{..."small"===i&&{...n.typography.captionWeak,[e.breakpoints.down("tablet")]:{fontFamily:a.fontFamily.mobile.body,...n.getMobileTextStyle("caption")}}}}))),u=r.styled(l,{shouldForwardProp:e=>"valid"!==e})((({theme:e,valid:i,disabled:l})=>({padding:0,margin:0,...!i&&!l&&{color:e.palette.semantic.fill["fill-error-strong"],"&.Mui-checked":{color:e.palette.semantic.fill["fill-error-strong"]}}})));module.exports=({fdKey:i,label:l,size:t="medium",valid:r=!0,disabled:a,...n})=>e.jsx(p,{control:e.jsx(u,{disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,checkedIcon:e.jsx(c,{disabled:a,size:t,valid:r,children:e.jsx(o,{})}),"data-fd":i,icon:e.jsx(d,{disabled:a,size:t,valid:r}),indeterminateIcon:e.jsx(c,{disabled:a,size:t,valid:r,children:e.jsx(s,{})}),size:t,valid:r,...n}),"data-fd":`${i}-label`,disabled:a,label:l,size:t});
2
2
  //# sourceMappingURL=index.cjs.js.map