@flipdish/portal-library 5.9.1 → 6.0.1

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 (226) hide show
  1. package/dist/02aa6e71ecb2b9b2.svg +29 -0
  2. package/dist/a79a4dce3f63ccbe.svg +29 -0
  3. package/dist/adapters/DateFns.cjs.js +2 -0
  4. package/dist/adapters/DateFns.cjs.js.map +1 -0
  5. package/dist/adapters/DateFns.d.ts +2 -0
  6. package/dist/adapters/DateFns.js +2 -0
  7. package/dist/adapters/DateFns.js.map +1 -0
  8. package/dist/adapters/Dayjs.cjs.js +2 -0
  9. package/dist/adapters/Dayjs.cjs.js.map +1 -0
  10. package/dist/adapters/Dayjs.d.ts +2 -0
  11. package/dist/adapters/Dayjs.js +2 -0
  12. package/dist/adapters/Dayjs.js.map +1 -0
  13. package/dist/adapters/Moment.cjs.js +2 -0
  14. package/dist/adapters/Moment.cjs.js.map +1 -0
  15. package/dist/adapters/Moment.d.ts +2 -0
  16. package/dist/adapters/Moment.js +2 -0
  17. package/dist/adapters/Moment.js.map +1 -0
  18. package/dist/assets/images/flipdish-icon-dark.svg.cjs.js +2 -0
  19. package/dist/assets/images/flipdish-icon-dark.svg.cjs.js.map +1 -0
  20. package/dist/assets/images/flipdish-icon-dark.svg.js +2 -0
  21. package/dist/assets/images/flipdish-icon-dark.svg.js.map +1 -0
  22. package/dist/assets/images/flipdish-icon.svg.cjs.js +2 -0
  23. package/dist/assets/images/flipdish-icon.svg.cjs.js.map +1 -0
  24. package/dist/assets/images/flipdish-icon.svg.js +2 -0
  25. package/dist/assets/images/flipdish-icon.svg.js.map +1 -0
  26. package/dist/assets/images/flipdish-logo-dark.svg.cjs.js +2 -0
  27. package/dist/assets/images/flipdish-logo-dark.svg.cjs.js.map +1 -0
  28. package/dist/assets/images/flipdish-logo-dark.svg.js +2 -0
  29. package/dist/assets/images/flipdish-logo-dark.svg.js.map +1 -0
  30. package/dist/assets/images/flipdish-logo.svg.cjs.js +2 -0
  31. package/dist/assets/images/flipdish-logo.svg.cjs.js.map +1 -0
  32. package/dist/assets/images/flipdish-logo.svg.js +2 -0
  33. package/dist/assets/images/flipdish-logo.svg.js.map +1 -0
  34. package/dist/assets/images/flipdish-powered-by-dark.svg.cjs.js +2 -0
  35. package/dist/assets/images/flipdish-powered-by-dark.svg.cjs.js.map +1 -0
  36. package/dist/assets/images/flipdish-powered-by-dark.svg.js +2 -0
  37. package/dist/assets/images/flipdish-powered-by-dark.svg.js.map +1 -0
  38. package/dist/assets/images/flipdish-powered-by.svg.cjs.js +2 -0
  39. package/dist/assets/images/flipdish-powered-by.svg.cjs.js.map +1 -0
  40. package/dist/assets/images/flipdish-powered-by.svg.js +2 -0
  41. package/dist/assets/images/flipdish-powered-by.svg.js.map +1 -0
  42. package/dist/components/Spacer/index.cjs.js +1 -1
  43. package/dist/components/Spacer/index.cjs.js.map +1 -1
  44. package/dist/components/Spacer/index.d.ts +1 -1
  45. package/dist/components/Spacer/index.js +1 -1
  46. package/dist/components/Spacer/index.js.map +1 -1
  47. package/dist/components/atoms/Checkbox/index.cjs.js +1 -1
  48. package/dist/components/atoms/Checkbox/index.cjs.js.map +1 -1
  49. package/dist/components/atoms/Checkbox/index.d.ts +11 -2
  50. package/dist/components/atoms/Checkbox/index.js +1 -1
  51. package/dist/components/atoms/Checkbox/index.js.map +1 -1
  52. package/dist/components/atoms/CircularProgress/index.cjs.js +1 -1
  53. package/dist/components/atoms/CircularProgress/index.cjs.js.map +1 -1
  54. package/dist/components/atoms/CircularProgress/index.d.ts +32 -2
  55. package/dist/components/atoms/CircularProgress/index.js +1 -1
  56. package/dist/components/atoms/CircularProgress/index.js.map +1 -1
  57. package/dist/components/atoms/DatePicker/CalendarHeader.cjs.js +2 -0
  58. package/dist/components/atoms/DatePicker/CalendarHeader.cjs.js.map +1 -0
  59. package/dist/components/atoms/DatePicker/CalendarHeader.d.ts +6 -0
  60. package/dist/components/atoms/DatePicker/CalendarHeader.js +2 -0
  61. package/dist/components/atoms/DatePicker/CalendarHeader.js.map +1 -0
  62. package/dist/components/atoms/DatePicker/index.cjs.js +2 -0
  63. package/dist/components/atoms/DatePicker/index.cjs.js.map +1 -0
  64. package/dist/components/atoms/DatePicker/index.d.ts +17 -0
  65. package/dist/components/atoms/DatePicker/index.js +2 -0
  66. package/dist/components/atoms/DatePicker/index.js.map +1 -0
  67. package/dist/components/atoms/FlipdishLogo/index.cjs.js +2 -0
  68. package/dist/components/atoms/FlipdishLogo/index.cjs.js.map +1 -0
  69. package/dist/components/atoms/FlipdishLogo/index.d.ts +80 -0
  70. package/dist/components/atoms/FlipdishLogo/index.js +2 -0
  71. package/dist/components/atoms/FlipdishLogo/index.js.map +1 -0
  72. package/dist/components/atoms/LinearProgress/index.cjs.js +1 -1
  73. package/dist/components/atoms/LinearProgress/index.cjs.js.map +1 -1
  74. package/dist/components/atoms/LinearProgress/index.d.ts +2 -1
  75. package/dist/components/atoms/LinearProgress/index.js +1 -1
  76. package/dist/components/atoms/LinearProgress/index.js.map +1 -1
  77. package/dist/components/atoms/Link/getLinkStyles.cjs.js +2 -0
  78. package/dist/components/atoms/Link/getLinkStyles.cjs.js.map +1 -0
  79. package/dist/components/atoms/Link/getLinkStyles.d.ts +14 -0
  80. package/dist/components/atoms/Link/getLinkStyles.js +2 -0
  81. package/dist/components/atoms/Link/getLinkStyles.js.map +1 -0
  82. package/dist/components/atoms/Link/index.cjs.js +1 -1
  83. package/dist/components/atoms/Link/index.cjs.js.map +1 -1
  84. package/dist/components/atoms/Link/index.d.ts +26 -2
  85. package/dist/components/atoms/Link/index.js +1 -1
  86. package/dist/components/atoms/Link/index.js.map +1 -1
  87. package/dist/components/atoms/MenuItem/index.cjs.js +1 -1
  88. package/dist/components/atoms/MenuItem/index.cjs.js.map +1 -1
  89. package/dist/components/atoms/MenuItem/index.d.ts +38 -2
  90. package/dist/components/atoms/MenuItem/index.js +1 -1
  91. package/dist/components/atoms/MenuItem/index.js.map +1 -1
  92. package/dist/components/atoms/Select/index.cjs.js +1 -1
  93. package/dist/components/atoms/Select/index.cjs.js.map +1 -1
  94. package/dist/components/atoms/Select/index.d.ts +1 -1
  95. package/dist/components/atoms/Select/index.js +1 -1
  96. package/dist/components/atoms/Select/index.js.map +1 -1
  97. package/dist/components/atoms/Slider/index.cjs.js +2 -0
  98. package/dist/components/atoms/Slider/index.cjs.js.map +1 -0
  99. package/dist/components/atoms/Slider/index.d.ts +17 -0
  100. package/dist/components/atoms/Slider/index.js +2 -0
  101. package/dist/components/atoms/Slider/index.js.map +1 -0
  102. package/dist/components/atoms/Slot/index.cjs.js +2 -0
  103. package/dist/components/atoms/Slot/index.cjs.js.map +1 -0
  104. package/dist/components/atoms/Slot/index.d.ts +3 -0
  105. package/dist/components/atoms/Slot/index.js +2 -0
  106. package/dist/components/atoms/Slot/index.js.map +1 -0
  107. package/dist/components/atoms/TextArea/index.cjs.js +2 -0
  108. package/dist/components/atoms/TextArea/index.cjs.js.map +1 -0
  109. package/dist/components/atoms/TextArea/index.d.ts +9 -0
  110. package/dist/components/atoms/TextArea/index.js +2 -0
  111. package/dist/components/atoms/TextArea/index.js.map +1 -0
  112. package/dist/components/atoms/TextField/index.cjs.js +1 -1
  113. package/dist/components/atoms/TextField/index.cjs.js.map +1 -1
  114. package/dist/components/atoms/TextField/index.d.ts +6 -8
  115. package/dist/components/atoms/TextField/index.js +1 -1
  116. package/dist/components/atoms/TextField/index.js.map +1 -1
  117. package/dist/components/molecules/Alert/index.cjs.js +1 -1
  118. package/dist/components/molecules/Alert/index.cjs.js.map +1 -1
  119. package/dist/components/molecules/Alert/index.js +1 -1
  120. package/dist/components/molecules/Alert/index.js.map +1 -1
  121. package/dist/components/molecules/AlertSnackbar/index.cjs.js +2 -0
  122. package/dist/components/molecules/AlertSnackbar/index.cjs.js.map +1 -0
  123. package/dist/components/molecules/AlertSnackbar/index.d.ts +56 -0
  124. package/dist/components/molecules/AlertSnackbar/index.js +2 -0
  125. package/dist/components/molecules/AlertSnackbar/index.js.map +1 -0
  126. package/dist/components/molecules/ButtonGroup/index.cjs.js +1 -1
  127. package/dist/components/molecules/ButtonGroup/index.cjs.js.map +1 -1
  128. package/dist/components/molecules/ButtonGroup/index.js +1 -1
  129. package/dist/components/molecules/ButtonGroup/index.js.map +1 -1
  130. package/dist/components/molecules/CheckboxGroup/index.cjs.js +2 -0
  131. package/dist/components/molecules/CheckboxGroup/index.cjs.js.map +1 -0
  132. package/dist/components/molecules/CheckboxGroup/index.d.ts +27 -0
  133. package/dist/components/molecules/CheckboxGroup/index.js +2 -0
  134. package/dist/components/molecules/CheckboxGroup/index.js.map +1 -0
  135. package/dist/components/molecules/Modal/index.cjs.js +1 -1
  136. package/dist/components/molecules/Modal/index.cjs.js.map +1 -1
  137. package/dist/components/molecules/Modal/index.d.ts +2 -2
  138. package/dist/components/molecules/Modal/index.js +1 -1
  139. package/dist/components/molecules/Modal/index.js.map +1 -1
  140. package/dist/components/molecules/Pagination/index.cjs.js +2 -0
  141. package/dist/components/molecules/Pagination/index.cjs.js.map +1 -0
  142. package/dist/components/molecules/Pagination/index.d.ts +27 -0
  143. package/dist/components/molecules/Pagination/index.js +2 -0
  144. package/dist/components/molecules/Pagination/index.js.map +1 -0
  145. package/dist/components/molecules/ProgressStepper/index.cjs.js +1 -1
  146. package/dist/components/molecules/ProgressStepper/index.cjs.js.map +1 -1
  147. package/dist/components/molecules/ProgressStepper/index.js +1 -1
  148. package/dist/components/molecules/ProgressStepper/index.js.map +1 -1
  149. package/dist/components/molecules/QuantitySelector/index.cjs.js +2 -0
  150. package/dist/components/molecules/QuantitySelector/index.cjs.js.map +1 -0
  151. package/dist/components/molecules/QuantitySelector/index.d.ts +47 -0
  152. package/dist/components/molecules/QuantitySelector/index.js +2 -0
  153. package/dist/components/molecules/QuantitySelector/index.js.map +1 -0
  154. package/dist/components/molecules/TextBlock/index.cjs.js +2 -0
  155. package/dist/components/molecules/TextBlock/index.cjs.js.map +1 -0
  156. package/dist/components/molecules/TextBlock/index.d.ts +49 -0
  157. package/dist/components/molecules/TextBlock/index.js +2 -0
  158. package/dist/components/molecules/TextBlock/index.js.map +1 -0
  159. package/dist/components/organisms/ImageUploadWidget/components/ImageDropZone.cjs.js +1 -1
  160. package/dist/components/organisms/ImageUploadWidget/components/ImageDropZone.cjs.js.map +1 -1
  161. package/dist/components/organisms/ImageUploadWidget/components/ImageDropZone.js +1 -1
  162. package/dist/components/organisms/ImageUploadWidget/components/ImageDropZone.js.map +1 -1
  163. package/dist/providers/DateTimeLocalizationProvider.cjs.js +1 -1
  164. package/dist/providers/DateTimeLocalizationProvider.cjs.js.map +1 -1
  165. package/dist/providers/DateTimeLocalizationProvider.d.ts +4 -5
  166. package/dist/providers/DateTimeLocalizationProvider.js +1 -1
  167. package/dist/providers/DateTimeLocalizationProvider.js.map +1 -1
  168. package/dist/themes/flipdishPublicTheme.cjs.js +1 -1
  169. package/dist/themes/flipdishPublicTheme.cjs.js.map +1 -1
  170. package/dist/themes/flipdishPublicTheme.js +1 -1
  171. package/dist/themes/flipdishPublicTheme.js.map +1 -1
  172. package/dist/themes/overrides/checkboxOverrides.cjs.js +2 -0
  173. package/dist/themes/overrides/checkboxOverrides.cjs.js.map +1 -0
  174. package/dist/themes/overrides/checkboxOverrides.d.ts +5 -0
  175. package/dist/themes/overrides/checkboxOverrides.js +2 -0
  176. package/dist/themes/overrides/checkboxOverrides.js.map +1 -0
  177. package/dist/themes/overrides/formControlLabelOverrides.cjs.js +2 -0
  178. package/dist/themes/overrides/formControlLabelOverrides.cjs.js.map +1 -0
  179. package/dist/themes/overrides/formControlLabelOverrides.d.ts +5 -0
  180. package/dist/themes/overrides/formControlLabelOverrides.js +2 -0
  181. package/dist/themes/overrides/formControlLabelOverrides.js.map +1 -0
  182. package/dist/themes/overrides/formHelperTextOverrides.cjs.js +1 -1
  183. package/dist/themes/overrides/formHelperTextOverrides.cjs.js.map +1 -1
  184. package/dist/themes/overrides/formHelperTextOverrides.d.ts +1 -1
  185. package/dist/themes/overrides/formHelperTextOverrides.js +1 -1
  186. package/dist/themes/overrides/formHelperTextOverrides.js.map +1 -1
  187. package/dist/themes/overrides/formLabelOverrides.cjs.js +2 -0
  188. package/dist/themes/overrides/formLabelOverrides.cjs.js.map +1 -0
  189. package/dist/themes/overrides/formLabelOverrides.d.ts +5 -0
  190. package/dist/themes/overrides/formLabelOverrides.js +2 -0
  191. package/dist/themes/overrides/formLabelOverrides.js.map +1 -0
  192. package/dist/themes/overrides/inputBaseOverrides.cjs.js +1 -1
  193. package/dist/themes/overrides/inputBaseOverrides.cjs.js.map +1 -1
  194. package/dist/themes/overrides/inputBaseOverrides.js +1 -1
  195. package/dist/themes/overrides/inputBaseOverrides.js.map +1 -1
  196. package/dist/themes/overrides/listItemTextOverrides.cjs.js +2 -0
  197. package/dist/themes/overrides/listItemTextOverrides.cjs.js.map +1 -0
  198. package/dist/themes/overrides/listItemTextOverrides.d.ts +5 -0
  199. package/dist/themes/overrides/listItemTextOverrides.js +2 -0
  200. package/dist/themes/overrides/listItemTextOverrides.js.map +1 -0
  201. package/dist/themes/overrides/menuItemOverrides.cjs.js +1 -1
  202. package/dist/themes/overrides/menuItemOverrides.cjs.js.map +1 -1
  203. package/dist/themes/overrides/menuItemOverrides.d.ts +1 -1
  204. package/dist/themes/overrides/menuItemOverrides.js +1 -1
  205. package/dist/themes/overrides/menuItemOverrides.js.map +1 -1
  206. package/dist/themes/overrides/menuOverrides.cjs.js +2 -0
  207. package/dist/themes/overrides/menuOverrides.cjs.js.map +1 -0
  208. package/dist/themes/overrides/menuOverrides.d.ts +5 -0
  209. package/dist/themes/overrides/menuOverrides.js +2 -0
  210. package/dist/themes/overrides/menuOverrides.js.map +1 -0
  211. package/dist/themes/overrides/selectOverrides.cjs.js +1 -1
  212. package/dist/themes/overrides/selectOverrides.cjs.js.map +1 -1
  213. package/dist/themes/overrides/selectOverrides.js +1 -1
  214. package/dist/themes/overrides/selectOverrides.js.map +1 -1
  215. package/dist/themes/overrides/textFieldOverrides.cjs.js +1 -1
  216. package/dist/themes/overrides/textFieldOverrides.cjs.js.map +1 -1
  217. package/dist/themes/overrides/textFieldOverrides.d.ts +2 -2
  218. package/dist/themes/overrides/textFieldOverrides.js +1 -1
  219. package/dist/themes/overrides/textFieldOverrides.js.map +1 -1
  220. package/dist/themes/theme.d.ts +6 -6
  221. package/dist/utilities/numericUtilities.cjs.js +2 -0
  222. package/dist/utilities/numericUtilities.cjs.js.map +1 -0
  223. package/dist/utilities/numericUtilities.d.ts +10 -0
  224. package/dist/utilities/numericUtilities.js +2 -0
  225. package/dist/utilities/numericUtilities.js.map +1 -0
  226. package/package.json +6 -3
@@ -1,2 +1,2 @@
1
- import{jsxs as t,jsx as r}from"react/jsx-runtime";import e from"@mui/material/Box";import{Button as i}from"../../atoms/Button/index.js";import a from"@mui/material/Grid2";import{LinearProgress as o}from"../../atoms/LinearProgress/index.js";import s from"@mui/material/Typography";import p from"../../../icons/ArrowLeft02/index.js";import{styled as m}from"@mui/material/styles";const n=m(i)((({theme:t})=>({textDecoration:"none",padding:0,maxWidth:"none",height:"24px",[t.breakpoints.up("tablet")]:{maxWidth:"unset"}}))),d=({step:i,totalSteps:m,backButtonProps:d,title:l})=>t(a,{"data-testid":"progress-stepper-container",mt:3,children:[r(e,{mb:2,children:d&&t(n,{"data-testid":"progress-stepper-back-button",disabled:d.disabled,fdKey:"progress-stepper-back-button",onClick:d.onClick,variant:"tertiary",children:[r(p,{}),d.label]})}),r(e,{mb:1,children:r(s,{"data-testid":"progress-stepper-title",variant:"b1Strong",children:l||`Step ${i} of ${m}`})}),r(e,{"data-testid":"progress-stepper-bars",sx:{display:"flex",gap:.5},children:Array.from({length:m},((t,r)=>r+1)).map((t=>r(e,{sx:{width:"100%"},children:r(o,{color:"primary",value:t<=i?100:0,variant:"determinate"},`${t}-progress-stepper`)},`${t}-progress-stepper-box`)))})]});export{d as default};
1
+ import{jsxs as t,jsx as e}from"react/jsx-runtime";import r from"@mui/material/Box";import{Button as i}from"../../atoms/Button/index.js";import a from"@mui/material/Grid2";import{LinearProgress as o}from"../../atoms/LinearProgress/index.js";import s from"@mui/material/Typography";import p from"../../../icons/ArrowLeft02/index.js";import{styled as m}from"@mui/material/styles";const n=m(i)((({theme:t})=>({textDecoration:"none",padding:0,maxWidth:"none",height:"24px",[t.breakpoints.up("tablet")]:{maxWidth:"unset"}}))),d=({step:i,totalSteps:m,backButtonProps:d,title:l})=>t(a,{"data-testid":"progress-stepper-container",mt:3,children:[e(r,{mb:2,children:d&&t(n,{"data-testid":"progress-stepper-back-button",disabled:d.disabled,fdKey:"progress-stepper-back-button",onClick:d.onClick,variant:"tertiary",children:[e(p,{}),d.label]})}),e(r,{mb:1,children:e(s,{"data-testid":"progress-stepper-title",variant:"b1Strong",children:l||`Step ${i} of ${m}`})}),e(r,{"data-testid":"progress-stepper-bars",sx:{display:"flex",gap:.5},children:Array.from({length:m},((t,e)=>e+1)).map((t=>e(r,{sx:{width:"100%"},children:e(o,{value:t<=i?100:0,variant:"determinate"},`${t}-progress-stepper`)},`${t}-progress-stepper-box`)))})]});export{d as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/molecules/ProgressStepper/index.tsx"],"sourcesContent":["import Box from '@fd/components/atoms/Box';\nimport Button from '@fd/components/atoms/Button';\nimport Grid from '@fd/components/atoms/Grid';\nimport LinearProgress from '@fd/components/atoms/LinearProgress';\nimport Typography from '@fd/components/atoms/Typography';\nimport ArrowLeft02 from '@fd/icons/ArrowLeft02';\nimport styled from '@fd/utilities/styledUtilities';\n\ninterface IProgressStepper {\n step: number;\n totalSteps: number;\n backButtonProps?: {\n disabled?: boolean;\n onClick: () => void;\n label: string;\n };\n title?: string;\n}\n\nconst BackButton = styled(Button)(({ theme }) => ({\n textDecoration: 'none',\n padding: 0,\n maxWidth: 'none',\n height: '24px',\n [theme.breakpoints.up('tablet')]: {\n maxWidth: 'unset',\n },\n}));\n\nconst ProgressStepper: React.FC<IProgressStepper> = ({\n step,\n totalSteps,\n backButtonProps,\n title,\n}) => {\n return (\n <Grid data-testid=\"progress-stepper-container\" mt={3}>\n <Box mb={2}>\n {backButtonProps && (\n <BackButton\n data-testid=\"progress-stepper-back-button\"\n disabled={backButtonProps.disabled}\n fdKey=\"progress-stepper-back-button\"\n onClick={backButtonProps.onClick}\n variant=\"tertiary\"\n >\n <ArrowLeft02 />\n {backButtonProps.label}\n </BackButton>\n )}\n </Box>\n <Box mb={1}>\n <Typography data-testid=\"progress-stepper-title\" variant=\"b1Strong\">\n {title || `Step ${step} of ${totalSteps}`}\n </Typography>\n </Box>\n <Box data-testid=\"progress-stepper-bars\" sx={{ display: 'flex', gap: 0.5 }}>\n {Array.from({ length: totalSteps }, (_, index) => index + 1).map((stepNumber) => (\n <Box key={`${stepNumber}-progress-stepper-box`} sx={{ width: '100%' }}>\n <LinearProgress\n key={`${stepNumber}-progress-stepper`}\n color=\"primary\"\n value={stepNumber <= step ? 100 : 0}\n variant=\"determinate\"\n />\n </Box>\n ))}\n </Box>\n </Grid>\n );\n};\n\nexport default ProgressStepper;\n"],"names":["BackButton","styled","Button","theme","textDecoration","padding","maxWidth","height","breakpoints","up","ProgressStepper","step","totalSteps","backButtonProps","title","_jsxs","Grid","mt","children","_jsx","Box","mb","disabled","fdKey","onClick","variant","ArrowLeft02","label","Typography","sx","display","gap","Array","from","length","_","index","map","stepNumber","width","LinearProgress","color","value"],"mappings":"yXAmBA,MAAMA,EAAaC,EAAOC,EAAPD,EAAe,EAAGE,YAAO,CAC1CC,eAAgB,OAChBC,QAAS,EACTC,SAAU,OACVC,OAAQ,OACR,CAACJ,EAAMK,YAAYC,GAAG,WAAY,CAChCH,SAAU,aAIRI,EAA8C,EAClDC,OACAC,aACAC,kBACAC,WAGEC,EAACC,iBAAiB,6BAA6BC,GAAI,EAACC,SAAA,CAClDC,EAACC,EAAG,CAACC,GAAI,EAACH,SACPL,GACCE,EAACf,iBACa,+BACZsB,SAAUT,EAAgBS,SAC1BC,MAAM,+BACNC,QAASX,EAAgBW,QACzBC,QAAQ,WAAUP,SAAA,CAElBC,EAACO,EAAW,CAAA,GACXb,EAAgBc,WAIvBR,EAACC,EAAG,CAACC,GAAI,EAACH,SACRC,EAACS,EAAU,CAAA,cAAa,yBAAyBH,QAAQ,oBACtDX,GAAS,QAAQH,QAAWC,QAGjCO,EAACC,EAAG,CAAA,cAAa,wBAAwBS,GAAI,CAAEC,QAAS,OAAQC,IAAK,IAAKb,SACvEc,MAAMC,KAAK,CAAEC,OAAQtB,IAAc,CAACuB,EAAGC,IAAUA,EAAQ,IAAGC,KAAKC,GAChEnB,EAACC,EAAG,CAA4CS,GAAI,CAAEU,MAAO,QAAQrB,SACnEC,EAACqB,EAAc,CAEbC,MAAM,UACNC,MAAOJ,GAAc3B,EAAO,IAAM,EAClCc,QAAQ,eAHH,GAAGa,uBAFF,GAAGA"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/molecules/ProgressStepper/index.tsx"],"sourcesContent":["import Box from '@fd/components/atoms/Box';\nimport Button from '@fd/components/atoms/Button';\nimport Grid from '@fd/components/atoms/Grid';\nimport LinearProgress from '@fd/components/atoms/LinearProgress';\nimport Typography from '@fd/components/atoms/Typography';\nimport ArrowLeft02 from '@fd/icons/ArrowLeft02';\nimport styled from '@fd/utilities/styledUtilities';\n\ninterface IProgressStepper {\n step: number;\n totalSteps: number;\n backButtonProps?: {\n disabled?: boolean;\n onClick: () => void;\n label: string;\n };\n title?: string;\n}\n\nconst BackButton = styled(Button)(({ theme }) => ({\n textDecoration: 'none',\n padding: 0,\n maxWidth: 'none',\n height: '24px',\n [theme.breakpoints.up('tablet')]: {\n maxWidth: 'unset',\n },\n}));\n\nconst ProgressStepper: React.FC<IProgressStepper> = ({\n step,\n totalSteps,\n backButtonProps,\n title,\n}) => {\n return (\n <Grid data-testid=\"progress-stepper-container\" mt={3}>\n <Box mb={2}>\n {backButtonProps && (\n <BackButton\n data-testid=\"progress-stepper-back-button\"\n disabled={backButtonProps.disabled}\n fdKey=\"progress-stepper-back-button\"\n onClick={backButtonProps.onClick}\n variant=\"tertiary\"\n >\n <ArrowLeft02 />\n {backButtonProps.label}\n </BackButton>\n )}\n </Box>\n <Box mb={1}>\n <Typography data-testid=\"progress-stepper-title\" variant=\"b1Strong\">\n {title || `Step ${step} of ${totalSteps}`}\n </Typography>\n </Box>\n <Box data-testid=\"progress-stepper-bars\" sx={{ display: 'flex', gap: 0.5 }}>\n {Array.from({ length: totalSteps }, (_, index) => index + 1).map((stepNumber) => (\n <Box key={`${stepNumber}-progress-stepper-box`} sx={{ width: '100%' }}>\n <LinearProgress\n key={`${stepNumber}-progress-stepper`}\n value={stepNumber <= step ? 100 : 0}\n variant=\"determinate\"\n />\n </Box>\n ))}\n </Box>\n </Grid>\n );\n};\n\nexport default ProgressStepper;\n"],"names":["BackButton","styled","Button","theme","textDecoration","padding","maxWidth","height","breakpoints","up","ProgressStepper","step","totalSteps","backButtonProps","title","_jsxs","Grid","mt","children","_jsx","Box","mb","disabled","fdKey","onClick","variant","ArrowLeft02","label","Typography","sx","display","gap","Array","from","length","_","index","map","stepNumber","width","LinearProgress","value"],"mappings":"yXAmBA,MAAMA,EAAaC,EAAOC,EAAPD,EAAe,EAAGE,YAAO,CAC1CC,eAAgB,OAChBC,QAAS,EACTC,SAAU,OACVC,OAAQ,OACR,CAACJ,EAAMK,YAAYC,GAAG,WAAY,CAChCH,SAAU,aAIRI,EAA8C,EAClDC,OACAC,aACAC,kBACAC,WAGEC,EAACC,iBAAiB,6BAA6BC,GAAI,EAACC,SAAA,CAClDC,EAACC,EAAG,CAACC,GAAI,EAACH,SACPL,GACCE,EAACf,iBACa,+BACZsB,SAAUT,EAAgBS,SAC1BC,MAAM,+BACNC,QAASX,EAAgBW,QACzBC,QAAQ,qBAERN,EAACO,MACAb,EAAgBc,WAIvBR,EAACC,GAAIC,GAAI,EAACH,SACRC,EAACS,EAAU,CAAA,cAAa,yBAAyBH,QAAQ,WAAUP,SAChEJ,GAAS,QAAQH,QAAWC,QAGjCO,EAACC,iBAAgB,wBAAwBS,GAAI,CAAEC,QAAS,OAAQC,IAAK,IAAKb,SACvEc,MAAMC,KAAK,CAAEC,OAAQtB,IAAc,CAACuB,EAAGC,IAAUA,EAAQ,IAAGC,KAAKC,GAChEnB,EAACC,EAAG,CAA4CS,GAAI,CAAEU,MAAO,QAAQrB,SACnEC,EAACqB,EAAc,CAEbC,MAAOH,GAAc3B,EAAO,IAAM,EAClCc,QAAQ,eAFH,GAAGa,uBAFF,GAAGA"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@mui/material/InputLabel"),r=require("@mui/material/styles"),i=require("../../../utilities/numericUtilities.cjs.js"),o=require("../../../icons/Add/index.cjs.js"),s=require("../../../icons/CancelCircle/index.cjs.js"),a=require("../../../icons/Remove/index.cjs.js"),n=require("@mui/material/Box"),l=require("../../atoms/IconButton/index.cjs.js"),d=require("../../atoms/TextField/index.cjs.js"),u=require("@mui/material/Typography");const c=r.styled(n)((()=>({display:"flex",flexDirection:"column"}))),p=r.styled(n,{shouldForwardProp:e=>!["isDisabled","isError"].includes(e)})((({theme:e,isDisabled:t,isError:r})=>({display:"flex",alignItems:"stretch",boxShadow:e.customShadows?.raised,border:(t?"1px":r?"2px":"1px")+" solid",borderColor:t?e.palette.semantic.stroke["stroke-disabled"]:r?e.palette.semantic.stroke["stroke-error-strong"]:e.palette.semantic.stroke["stroke-strong"],borderRadius:e.radius["radius-8"],overflow:"visible",position:"relative",backgroundColor:e.palette.semantic.fill["fill-inverse-strong"],marginTop:e.spacing(.5)}))),b=r.styled(l.IconButton)((({theme:e})=>({border:"none",boxShadow:"none",borderRadius:0,padding:0,"&&:focus, &&:focus-visible":{outline:"none",borderRadius:0,zIndex:2},"&&:focus::after, &&:focus-visible::after":{content:'""',position:"absolute",top:-4.5,right:-2.5,bottom:-4.5,left:-4.5,border:`2px solid ${e.palette.semantic.stroke["stroke-focus"]}`,borderRadius:0,pointerEvents:"none",zIndex:3},"&&:first-of-type:focus::after, &&:first-of-type:focus-visible::after":{borderTopLeftRadius:e.radius["radius-12"],borderBottomLeftRadius:e.radius["radius-12"]},"&&:last-of-type:focus::after, &&:last-of-type:focus-visible::after":{borderTopRightRadius:e.radius["radius-12"],borderBottomRightRadius:e.radius["radius-12"],left:-2.5,right:-4.5},"&:hover":{boxShadow:"none",borderRadius:0},"&.Mui-disabled":{backgroundColor:e.palette.semantic.fill["fill-inverse-strong"],border:"none",boxShadow:"none"},"&.Mui-disabled > svg":{color:e.palette.semantic.icon["icon-disabled"]}}))),m=r.styled(n)((({theme:e})=>({display:"flex",alignItems:"stretch",width:72,minWidth:56,backgroundColor:e.palette.semantic.fill["fill-inverse-strong"],position:"relative",borderRadius:0,"&:focus-within::after":{content:'""',position:"absolute",top:-4,right:-2,bottom:-4,left:-2,border:`2px solid ${e.palette.semantic.stroke["stroke-focus"]}`,borderRadius:0,pointerEvents:"none",zIndex:3}}))),x=r.styled(d.TextField,{shouldForwardProp:e=>"isError"!==e})((({theme:e,isError:t=!1})=>({marginTop:"-4px",marginBottom:"-4px",'& [role="textbox"], & input':{textAlign:"center",outline:"none"},"& .MuiOutlinedInput-root":{border:"none",boxShadow:"none",outline:"none",borderRadius:0,backgroundColor:t?e.palette.semantic.fill["fill-error-weak"]:"transparent","&.Mui-disabled":{backgroundColor:"transparent"},"&.Mui-focused":{outline:"none !important"},"&:focus-within":{outline:"none !important"},"&:focus":{outline:"none !important",boxShadow:"none !important"},"&:hover":{background:"none !important",backgroundImage:"none !important"},"& fieldset":{border:"0 !important",borderRadius:0},"&:hover fieldset":{border:"0 !important"},"&.Mui-focused fieldset":{border:"0"}},"& .MuiOutlinedInput-input":{outline:"none",boxShadow:"none","&:focus":{outline:"none",boxShadow:"none"},"&.Mui-disabled":{color:e.palette.semantic.text["text-disabled"],WebkitTextFillColor:e.palette.semantic.text["text-disabled"]}},"& input:focus":{outline:"none !important",boxShadow:"none !important"}}))),f=r.styled("div",{shouldForwardProp:e=>!["isDisabled","isError"].includes(e)})((({theme:e,isDisabled:t=!1,isError:r=!1})=>({width:1,alignSelf:"stretch",backgroundColor:t?e.palette.semantic.stroke["stroke-disabled"]:r?e.palette.semantic.stroke["stroke-error-strong"]:e.palette.semantic.stroke["stroke-strong"]}))),h=r.styled(s)((({theme:e})=>({color:e.palette.semantic.icon["icon-error"]}))),g=r.styled(n)((({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),marginTop:e.spacing(.5)}))),v=r.styled(u)((({theme:e})=>({color:e.palette.semantic.text["text-error"]}))),y=r.styled(u,{shouldForwardProp:e=>"isDisabled"!==e})((({theme:e,isDisabled:t=!1})=>({color:t?e.palette.semantic.text["text-disabled"]:e.palette.semantic.text["text-weak"]}))),j=({value:r,onChange:s,min:n,max:l,step:d,disabled:u=!1,fdKey:j,label:k="",hint:w="",required:R=!1,valid:q=!0,errorMessage:C="",decreaseAriaLabel:S,increaseAriaLabel:E,valueAriaLabel:I})=>{const D=!u&&r>n,M=!u&&r<l;return e.jsxs(c,{children:[k&&e.jsx(t,{disabled:u,htmlFor:j?`${j}-input`:"quantity-input",required:R,children:k}),w&&e.jsx(y,{isDisabled:u,variant:"caption",children:w}),!q&&!!C&&e.jsxs(g,{children:[e.jsx(h,{}),e.jsx(v,{variant:"captionStrong",children:C})]}),e.jsxs(p,{"data-fd":j,isDisabled:u,isError:!q,role:"group",children:[e.jsx(b,{"aria-label":S,disabled:!D,fdKey:j?`${j}-decrement`:void 0,onClick:()=>{if(!D)return;const e=i.clamp(r-d,n,l);void 0!==e&&s(e)},tone:q?"neutral":"destructive",variant:"tertiary",children:e.jsx(a,{})}),e.jsx(f,{isDisabled:u,isError:!q}),e.jsx(m,{children:e.jsx(x,{fullWidth:!0,"aria-label":I,disabled:u,fdKey:j?`${j}-input`:"quantity-input",isError:!q,label:"",onChange:e=>{const t=e.target.value;if(""===t)return void s(n);const r=i.clamp(Number(t),n,l);void 0!==r&&s(r)},value:String(r)})}),e.jsx(f,{isDisabled:u,isError:!q}),e.jsx(b,{"aria-label":E,disabled:!M,fdKey:j?`${j}-increment`:void 0,onClick:()=>{if(!M)return;const e=i.clamp(r+d,n,l);void 0!==e&&s(e)},tone:q?"neutral":"destructive",variant:"tertiary",children:e.jsx(o,{})})]})]})};exports.QuantitySelector=j,exports.default=j;
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/molecules/QuantitySelector/index.tsx"],"sourcesContent":["import MuiInputLabel from '@mui/material/InputLabel';\nimport { styled } from '@mui/material/styles';\n\nimport { clamp } from '@fd/utilities/numericUtilities';\nimport type { ChangeEvent } from 'react';\n\nimport AddIcon from '../../../icons/Add';\nimport CancelCircleIcon from '../../../icons/CancelCircle';\nimport RemoveIcon from '../../../icons/Remove';\nimport Box from '../../atoms/Box';\nimport IconButton from '../../atoms/IconButton';\nimport TextField from '../../atoms/TextField';\nimport Typography from '../../atoms/Typography';\n\n/**\n * Props for the QuantitySelector component.\n * Controls a numeric input with increment/decrement buttons and min/max bounds.\n */\nexport interface QuantitySelectorProps {\n /** Current numeric value */\n value: number;\n /** Callback fired when the value changes */\n onChange: (nextValue: number) => void;\n /** Minimum allowed value */\n min: number;\n /** Maximum allowed value */\n max: number;\n /** Amount to increment/decrement on button clicks */\n step: number;\n /** Whether the control is disabled */\n disabled?: boolean;\n /** Unique identifier for testing/tracking */\n fdKey?: string;\n /** Label text displayed above the control */\n label?: string;\n /** Hint text displayed below the label */\n hint?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the current value is valid */\n valid?: boolean;\n /** Error message to display when valid is false */\n errorMessage?: string;\n /** Localized aria-label for the decrement button */\n decreaseAriaLabel: string;\n /** Localized aria-label for the increment button */\n increaseAriaLabel: string;\n /** Localized aria-label for the numeric input field */\n valueAriaLabel: string;\n}\n\nconst OuterContainer = styled(Box)(() => ({\n display: 'flex',\n flexDirection: 'column'\n}));\n\nconst InnerContainer = styled(Box, {\n shouldForwardProp: (prop) => !['isDisabled', 'isError'].includes(prop as string),\n})<{ isDisabled?: boolean; isError?: boolean }>(({ theme, isDisabled, isError }) => ({\n display: 'flex',\n alignItems: 'stretch',\n boxShadow: theme.customShadows?.raised,\n // Disabled state should overwrite all (including error thickness)\n border: `${isDisabled ? '1px' : isError ? '2px' : '1px'} solid`,\n borderColor: isDisabled\n ? theme.palette.semantic.stroke['stroke-disabled']\n : isError\n ? theme.palette.semantic.stroke['stroke-error-strong']\n : theme.palette.semantic.stroke['stroke-strong'],\n borderRadius: theme.radius['radius-8'],\n overflow: 'visible',\n position: 'relative',\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n marginTop: theme.spacing(0.5),\n}));\n\nconst ActionButton = styled(IconButton)(({ theme }) => ({\n border: 'none',\n boxShadow: 'none',\n borderRadius: 0,\n padding: 0,\n // Limit transitions to avoid perceived zoom effects\n // Robust square focus indicator drawn inside using a pseudo-element\n '&&:focus, &&:focus-visible': {\n outline: 'none',\n borderRadius: 0,\n zIndex: 2,\n },\n '&&:focus::after, &&:focus-visible::after': {\n content: '\"\"',\n position: 'absolute',\n top: -4.5,\n right: -2.5,\n bottom: -4.5,\n left: -4.5,\n border: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n borderRadius: 0,\n pointerEvents: 'none',\n zIndex: 3,\n },\n // Round external corners when focusing the edge buttons\n '&&:first-of-type:focus::after, &&:first-of-type:focus-visible::after': {\n borderTopLeftRadius: theme.radius['radius-12'],\n borderBottomLeftRadius: theme.radius['radius-12'],\n },\n '&&:last-of-type:focus::after, &&:last-of-type:focus-visible::after': {\n borderTopRightRadius: theme.radius['radius-12'],\n borderBottomRightRadius: theme.radius['radius-12'],\n left: -2.5,\n right: -4.5,\n },\n '&:hover': {\n boxShadow: 'none',\n borderRadius: 0,\n },\n '&.Mui-disabled': {\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n border: 'none',\n boxShadow: 'none'\n },\n '&.Mui-disabled > svg': {\n color: theme.palette.semantic.icon['icon-disabled'],\n },\n}));\nconst ValueContainer = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'stretch',\n width: 72,\n minWidth: 56,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n position: 'relative',\n borderRadius: 0,\n // Draw an outer square focus ring for the input area\n '&:focus-within::after': {\n content: '\"\"',\n position: 'absolute',\n top: -4,\n right: -2,\n bottom: -4,\n left: -2,\n border: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n borderRadius: 0,\n pointerEvents: 'none',\n zIndex: 3,\n },\n}));\nconst ValueField = styled(TextField, {\n shouldForwardProp: (prop) => prop !== 'isError',\n})<{ isError?: boolean }>(({ theme, isError = false }) => ({\n marginTop: '-4px',\n marginBottom: '-4px',\n '& [role=\"textbox\"], & input': {\n textAlign: 'center',\n outline: 'none',\n },\n '& .MuiOutlinedInput-root': {\n border: 'none',\n boxShadow: 'none',\n outline: 'none',\n borderRadius: 0,\n backgroundColor: isError ? theme.palette.semantic.fill['fill-error-weak'] : 'transparent',\n // Ensure disabled overrides error background\n '&.Mui-disabled': {\n backgroundColor: 'transparent',\n },\n // Remove MUI's internal focus ring; the ring is applied on ValueContainer instead\n '&.Mui-focused': {\n outline: 'none !important',\n },\n '&:focus-within': {\n outline: 'none !important',\n },\n '&:focus': {\n outline: 'none !important',\n boxShadow: 'none !important',\n },\n '&:hover': {\n background: 'none !important',\n backgroundImage: 'none !important',\n },\n '& fieldset': {\n border: '0 !important',\n borderRadius: 0,\n },\n '&:hover fieldset': {\n border: '0 !important',\n },\n '&.Mui-focused fieldset': {\n border: '0',\n },\n },\n '& .MuiOutlinedInput-input': {\n outline: 'none',\n boxShadow: 'none',\n '&:focus': {\n outline: 'none',\n boxShadow: 'none',\n },\n '&.Mui-disabled': {\n color: theme.palette.semantic.text['text-disabled'],\n WebkitTextFillColor: theme.palette.semantic.text['text-disabled'],\n },\n },\n '& input:focus': {\n outline: 'none !important',\n boxShadow: 'none !important',\n },\n}));\n\nconst VerticalDivider = styled('div', {\n shouldForwardProp: (prop) => !['isDisabled', 'isError'].includes(prop as string),\n})<{ isDisabled?: boolean; isError?: boolean }>(({ theme, isDisabled = false, isError = false }) => ({\n width: 1,\n alignSelf: 'stretch',\n backgroundColor: isDisabled\n ? theme.palette.semantic.stroke['stroke-disabled']\n : isError\n ? theme.palette.semantic.stroke['stroke-error-strong']\n : theme.palette.semantic.stroke['stroke-strong'],\n}));\n\nconst ErrorIcon = styled(CancelCircleIcon)(({ theme }) => ({\n color: theme.palette.semantic.icon['icon-error'],\n}));\n\nconst ErrorRow = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n marginTop: theme.spacing(0.5)\n}));\n\nconst ErrorText = styled(Typography)(({ theme }) => ({\n color: theme.palette.semantic.text['text-error']\n}));\n\nconst HintText = styled(Typography, {\n shouldForwardProp: (prop) => prop !== 'isDisabled',\n})<{ isDisabled?: boolean }>(({ theme, isDisabled = false }) => ({\n color: isDisabled ? theme.palette.semantic.text['text-disabled'] : theme.palette.semantic.text['text-weak'],\n}));\n\n/**\n * A quantity selector component with increment/decrement buttons and a numeric input field.\n * Provides min/max clamping, step-based adjustments, and optional label/hint/error display.\n *\n * @param props - Component props\n * @returns A quantity selector control\n */\nexport const QuantitySelector = ({\n value,\n onChange,\n min,\n max,\n step,\n disabled = false,\n fdKey,\n label = \"\",\n hint = \"\",\n required = false,\n valid = true,\n errorMessage = '',\n decreaseAriaLabel,\n increaseAriaLabel,\n valueAriaLabel,\n}: QuantitySelectorProps): JSX.Element => {\n const canDecrement = !disabled && value > min;\n const canIncrement = !disabled && value < max;\n\n const handleDecrement = (): void => {\n if (!canDecrement) return;\n const next = clamp(value - step, min, max);\n if (next === undefined) return;\n onChange(next);\n };\n\n const handleIncrement = (): void => {\n if (!canIncrement) return;\n const next = clamp(value + step, min, max);\n if (next === undefined) return;\n onChange(next);\n };\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>): void => {\n const raw = e.target.value;\n if (raw === '') {\n onChange(min);\n return;\n }\n const parsed = clamp(Number(raw), min, max)\n if (parsed === undefined) return;\n onChange(parsed);\n };\n\n return (\n <OuterContainer>\n {label && (\n <MuiInputLabel disabled={disabled} htmlFor={fdKey ? `${fdKey}-input` : 'quantity-input'} required={required}>\n {label}\n </MuiInputLabel>\n\n )}\n {hint && (\n <HintText isDisabled={disabled} variant=\"caption\">\n {hint}\n </HintText>)}\n {!valid && !!errorMessage && (\n <ErrorRow>\n <ErrorIcon />\n <ErrorText variant=\"captionStrong\">\n {errorMessage}\n </ErrorText>\n </ErrorRow>\n )}\n <InnerContainer data-fd={fdKey} isDisabled={disabled} isError={!valid} role=\"group\">\n <ActionButton\n aria-label={decreaseAriaLabel}\n disabled={!canDecrement}\n fdKey={fdKey ? `${fdKey}-decrement` : undefined}\n onClick={handleDecrement}\n tone={valid ? 'neutral' : 'destructive'}\n variant=\"tertiary\"\n >\n <RemoveIcon />\n </ActionButton>\n <VerticalDivider isDisabled={disabled} isError={!valid} />\n <ValueContainer>\n <ValueField\n fullWidth\n aria-label={valueAriaLabel}\n disabled={disabled}\n fdKey={fdKey ? `${fdKey}-input` : 'quantity-input'}\n isError={!valid}\n label=\"\"\n onChange={handleInputChange}\n value={String(value)}\n />\n </ValueContainer>\n <VerticalDivider isDisabled={disabled} isError={!valid} />\n <ActionButton\n aria-label={increaseAriaLabel}\n disabled={!canIncrement}\n fdKey={fdKey ? `${fdKey}-increment` : undefined}\n onClick={handleIncrement}\n tone={valid ? 'neutral' : 'destructive'}\n variant=\"tertiary\"\n >\n <AddIcon />\n </ActionButton>\n </InnerContainer>\n </OuterContainer>\n );\n};\n\nexport default QuantitySelector;\n"],"names":["OuterContainer","styled","Box","display","flexDirection","InnerContainer","shouldForwardProp","prop","includes","theme","isDisabled","isError","alignItems","boxShadow","customShadows","raised","border","borderColor","palette","semantic","stroke","borderRadius","radius","overflow","position","backgroundColor","fill","marginTop","spacing","ActionButton","IconButton","padding","outline","zIndex","content","top","right","bottom","left","pointerEvents","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","color","icon","ValueContainer","width","minWidth","ValueField","TextField","marginBottom","textAlign","background","backgroundImage","text","WebkitTextFillColor","VerticalDivider","alignSelf","ErrorIcon","CancelCircleIcon","ErrorRow","gap","ErrorText","Typography","HintText","QuantitySelector","value","onChange","min","max","step","disabled","fdKey","label","hint","required","valid","errorMessage","decreaseAriaLabel","increaseAriaLabel","valueAriaLabel","canDecrement","canIncrement","_jsxs","children","_jsx","MuiInputLabel","htmlFor","variant","role","undefined","onClick","next","clamp","tone","RemoveIcon","fullWidth","e","raw","target","parsed","Number","String","AddIcon"],"mappings":"giBAmDA,MAAMA,EAAiBC,EAAAA,OAAOC,EAAPD,EAAY,KAAA,CACjCE,QAAS,OACTC,cAAe,aAGXC,EAAiBJ,EAAAA,OAAOC,EAAK,CACjCI,kBAAoBC,IAAU,CAAC,aAAc,WAAWC,SAASD,IAD5CN,EAEyB,EAAGQ,QAAOC,aAAYC,cAAS,CAC7ER,QAAS,OACTS,WAAY,UACZC,UAAWJ,EAAMK,eAAeC,OAEhCC,QAAWN,EAAa,MAAQC,EAAU,MAAQ,OAA1C,SACRM,YAAaP,EACTD,EAAMS,QAAQC,SAASC,OAAO,mBAC9BT,EACEF,EAAMS,QAAQC,SAASC,OAAO,uBAC9BX,EAAMS,QAAQC,SAASC,OAAO,iBACpCC,aAAcZ,EAAMa,OAAO,YAC3BC,SAAU,UACVC,SAAU,WACVC,gBAAiBhB,EAAMS,QAAQC,SAASO,KAAK,uBAC7CC,UAAWlB,EAAMmB,QAAQ,QAGrBC,EAAe5B,EAAAA,OAAO6B,EAAAA,WAAP7B,EAAmB,EAAGQ,YAAO,CAChDO,OAAQ,OACRH,UAAW,OACXQ,aAAc,EACdU,QAAS,EAGT,6BAA8B,CAC5BC,QA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C,EAAAA,IAACrC,EAAU,CACTgD,WAAS,EAAA,aACGhB,EACZT,SAAUA,EACVC,MAAOA,EAAQ,GAAGA,UAAgB,iBAClC9D,SAAUkE,EACVH,MAAM,GACNN,SAnDiB8B,IACzB,MAAMC,EAAMD,EAAEE,OAAOjC,MACrB,GAAY,KAARgC,EAEF,YADA/B,EAASC,GAGX,MAAMgC,EAASP,EAAAA,MAAMQ,OAAOH,GAAM9B,EAAKC,QACxBqB,IAAXU,GACJjC,EAASiC,IA4CDlC,MAAOoC,OAAOpC,OAGlBmB,EAAAA,IAAC7B,EAAe,CAAC/C,WAAY8D,EAAU7D,SAAUkE,IACjDS,MAACzD,EAAY,CAAA,aACCmD,EACZR,UAAWW,EACXV,MAAOA,EAAQ,GAAGA,mBAAoBkB,EACtCC,QAnEgB,KACtB,IAAKT,EAAc,OACnB,MAAMU,EAAOC,EAAAA,MAAM3B,EAAQI,EAAMF,EAAKC,QACzBqB,IAATE,GACJzB,EAASyB,IAgEHE,KAAMlB,EAAQ,UAAY,cAC1BY,QAAQ,WAAUJ,SAElBC,EAAAA,IAACkB,EAAO,CAAA"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Props for the QuantitySelector component.
3
+ * Controls a numeric input with increment/decrement buttons and min/max bounds.
4
+ */
5
+ interface QuantitySelectorProps {
6
+ /** Current numeric value */
7
+ value: number;
8
+ /** Callback fired when the value changes */
9
+ onChange: (nextValue: number) => void;
10
+ /** Minimum allowed value */
11
+ min: number;
12
+ /** Maximum allowed value */
13
+ max: number;
14
+ /** Amount to increment/decrement on button clicks */
15
+ step: number;
16
+ /** Whether the control is disabled */
17
+ disabled?: boolean;
18
+ /** Unique identifier for testing/tracking */
19
+ fdKey?: string;
20
+ /** Label text displayed above the control */
21
+ label?: string;
22
+ /** Hint text displayed below the label */
23
+ hint?: string;
24
+ /** Whether the field is required */
25
+ required?: boolean;
26
+ /** Whether the current value is valid */
27
+ valid?: boolean;
28
+ /** Error message to display when valid is false */
29
+ errorMessage?: string;
30
+ /** Localized aria-label for the decrement button */
31
+ decreaseAriaLabel: string;
32
+ /** Localized aria-label for the increment button */
33
+ increaseAriaLabel: string;
34
+ /** Localized aria-label for the numeric input field */
35
+ valueAriaLabel: string;
36
+ }
37
+ /**
38
+ * A quantity selector component with increment/decrement buttons and a numeric input field.
39
+ * Provides min/max clamping, step-based adjustments, and optional label/hint/error display.
40
+ *
41
+ * @param props - Component props
42
+ * @returns A quantity selector control
43
+ */
44
+ declare const QuantitySelector: ({ value, onChange, min, max, step, disabled, fdKey, label, hint, required, valid, errorMessage, decreaseAriaLabel, increaseAriaLabel, valueAriaLabel, }: QuantitySelectorProps) => JSX.Element;
45
+
46
+ export { QuantitySelector, QuantitySelector as default };
47
+ export type { QuantitySelectorProps };
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import o from"@mui/material/InputLabel";import{styled as r}from"@mui/material/styles";import{clamp as i}from"../../../utilities/numericUtilities.js";import a from"../../../icons/Add/index.js";import n from"../../../icons/CancelCircle/index.js";import s from"../../../icons/Remove/index.js";import l from"@mui/material/Box";import{IconButton as d}from"../../atoms/IconButton/index.js";import{TextField as u}from"../../atoms/TextField/index.js";import c from"@mui/material/Typography";const p=r(l)((()=>({display:"flex",flexDirection:"column"}))),m=r(l,{shouldForwardProp:e=>!["isDisabled","isError"].includes(e)})((({theme:e,isDisabled:t,isError:o})=>({display:"flex",alignItems:"stretch",boxShadow:e.customShadows?.raised,border:(t?"1px":o?"2px":"1px")+" solid",borderColor:t?e.palette.semantic.stroke["stroke-disabled"]:o?e.palette.semantic.stroke["stroke-error-strong"]:e.palette.semantic.stroke["stroke-strong"],borderRadius:e.radius["radius-8"],overflow:"visible",position:"relative",backgroundColor:e.palette.semantic.fill["fill-inverse-strong"],marginTop:e.spacing(.5)}))),b=r(d)((({theme:e})=>({border:"none",boxShadow:"none",borderRadius:0,padding:0,"&&:focus, &&:focus-visible":{outline:"none",borderRadius:0,zIndex:2},"&&:focus::after, &&:focus-visible::after":{content:'""',position:"absolute",top:-4.5,right:-2.5,bottom:-4.5,left:-4.5,border:`2px solid ${e.palette.semantic.stroke["stroke-focus"]}`,borderRadius:0,pointerEvents:"none",zIndex:3},"&&:first-of-type:focus::after, &&:first-of-type:focus-visible::after":{borderTopLeftRadius:e.radius["radius-12"],borderBottomLeftRadius:e.radius["radius-12"]},"&&:last-of-type:focus::after, &&:last-of-type:focus-visible::after":{borderTopRightRadius:e.radius["radius-12"],borderBottomRightRadius:e.radius["radius-12"],left:-2.5,right:-4.5},"&:hover":{boxShadow:"none",borderRadius:0},"&.Mui-disabled":{backgroundColor:e.palette.semantic.fill["fill-inverse-strong"],border:"none",boxShadow:"none"},"&.Mui-disabled > svg":{color:e.palette.semantic.icon["icon-disabled"]}}))),f=r(l)((({theme:e})=>({display:"flex",alignItems:"stretch",width:72,minWidth:56,backgroundColor:e.palette.semantic.fill["fill-inverse-strong"],position:"relative",borderRadius:0,"&:focus-within::after":{content:'""',position:"absolute",top:-4,right:-2,bottom:-4,left:-2,border:`2px solid ${e.palette.semantic.stroke["stroke-focus"]}`,borderRadius:0,pointerEvents:"none",zIndex:3}}))),h=r(u,{shouldForwardProp:e=>"isError"!==e})((({theme:e,isError:t=!1})=>({marginTop:"-4px",marginBottom:"-4px",'& [role="textbox"], & input':{textAlign:"center",outline:"none"},"& .MuiOutlinedInput-root":{border:"none",boxShadow:"none",outline:"none",borderRadius:0,backgroundColor:t?e.palette.semantic.fill["fill-error-weak"]:"transparent","&.Mui-disabled":{backgroundColor:"transparent"},"&.Mui-focused":{outline:"none !important"},"&:focus-within":{outline:"none !important"},"&:focus":{outline:"none !important",boxShadow:"none !important"},"&:hover":{background:"none !important",backgroundImage:"none !important"},"& fieldset":{border:"0 !important",borderRadius:0},"&:hover fieldset":{border:"0 !important"},"&.Mui-focused fieldset":{border:"0"}},"& .MuiOutlinedInput-input":{outline:"none",boxShadow:"none","&:focus":{outline:"none",boxShadow:"none"},"&.Mui-disabled":{color:e.palette.semantic.text["text-disabled"],WebkitTextFillColor:e.palette.semantic.text["text-disabled"]}},"& input:focus":{outline:"none !important",boxShadow:"none !important"}}))),x=r("div",{shouldForwardProp:e=>!["isDisabled","isError"].includes(e)})((({theme:e,isDisabled:t=!1,isError:o=!1})=>({width:1,alignSelf:"stretch",backgroundColor:t?e.palette.semantic.stroke["stroke-disabled"]:o?e.palette.semantic.stroke["stroke-error-strong"]:e.palette.semantic.stroke["stroke-strong"]}))),g=r(n)((({theme:e})=>({color:e.palette.semantic.icon["icon-error"]}))),v=r(l)((({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),marginTop:e.spacing(.5)}))),k=r(c)((({theme:e})=>({color:e.palette.semantic.text["text-error"]}))),w=r(c,{shouldForwardProp:e=>"isDisabled"!==e})((({theme:e,isDisabled:t=!1})=>({color:t?e.palette.semantic.text["text-disabled"]:e.palette.semantic.text["text-weak"]}))),y=({value:r,onChange:n,min:l,max:d,step:u,disabled:c=!1,fdKey:y,label:R="",hint:C="",required:S=!1,valid:E=!0,errorMessage:D="",decreaseAriaLabel:I,increaseAriaLabel:M,valueAriaLabel:T})=>{const j=!c&&r>l,F=!c&&r<d;return e(p,{children:[R&&t(o,{disabled:c,htmlFor:y?`${y}-input`:"quantity-input",required:S,children:R}),C&&t(w,{isDisabled:c,variant:"caption",children:C}),!E&&!!D&&e(v,{children:[t(g,{}),t(k,{variant:"captionStrong",children:D})]}),e(m,{"data-fd":y,isDisabled:c,isError:!E,role:"group",children:[t(b,{"aria-label":I,disabled:!j,fdKey:y?`${y}-decrement`:void 0,onClick:()=>{if(!j)return;const e=i(r-u,l,d);void 0!==e&&n(e)},tone:E?"neutral":"destructive",variant:"tertiary",children:t(s,{})}),t(x,{isDisabled:c,isError:!E}),t(f,{children:t(h,{fullWidth:!0,"aria-label":T,disabled:c,fdKey:y?`${y}-input`:"quantity-input",isError:!E,label:"",onChange:e=>{const t=e.target.value;if(""===t)return void n(l);const o=i(Number(t),l,d);void 0!==o&&n(o)},value:String(r)})}),t(x,{isDisabled:c,isError:!E}),t(b,{"aria-label":M,disabled:!F,fdKey:y?`${y}-increment`:void 0,onClick:()=>{if(!F)return;const e=i(r+u,l,d);void 0!==e&&n(e)},tone:E?"neutral":"destructive",variant:"tertiary",children:t(a,{})})]})]})};export{y as QuantitySelector,y as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/molecules/QuantitySelector/index.tsx"],"sourcesContent":["import MuiInputLabel from '@mui/material/InputLabel';\nimport { styled } from '@mui/material/styles';\n\nimport { clamp } from '@fd/utilities/numericUtilities';\nimport type { ChangeEvent } from 'react';\n\nimport AddIcon from '../../../icons/Add';\nimport CancelCircleIcon from '../../../icons/CancelCircle';\nimport RemoveIcon from '../../../icons/Remove';\nimport Box from '../../atoms/Box';\nimport IconButton from '../../atoms/IconButton';\nimport TextField from '../../atoms/TextField';\nimport Typography from '../../atoms/Typography';\n\n/**\n * Props for the QuantitySelector component.\n * Controls a numeric input with increment/decrement buttons and min/max bounds.\n */\nexport interface QuantitySelectorProps {\n /** Current numeric value */\n value: number;\n /** Callback fired when the value changes */\n onChange: (nextValue: number) => void;\n /** Minimum allowed value */\n min: number;\n /** Maximum allowed value */\n max: number;\n /** Amount to increment/decrement on button clicks */\n step: number;\n /** Whether the control is disabled */\n disabled?: boolean;\n /** Unique identifier for testing/tracking */\n fdKey?: string;\n /** Label text displayed above the control */\n label?: string;\n /** Hint text displayed below the label */\n hint?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the current value is valid */\n valid?: boolean;\n /** Error message to display when valid is false */\n errorMessage?: string;\n /** Localized aria-label for the decrement button */\n decreaseAriaLabel: string;\n /** Localized aria-label for the increment button */\n increaseAriaLabel: string;\n /** Localized aria-label for the numeric input field */\n valueAriaLabel: string;\n}\n\nconst OuterContainer = styled(Box)(() => ({\n display: 'flex',\n flexDirection: 'column'\n}));\n\nconst InnerContainer = styled(Box, {\n shouldForwardProp: (prop) => !['isDisabled', 'isError'].includes(prop as string),\n})<{ isDisabled?: boolean; isError?: boolean }>(({ theme, isDisabled, isError }) => ({\n display: 'flex',\n alignItems: 'stretch',\n boxShadow: theme.customShadows?.raised,\n // Disabled state should overwrite all (including error thickness)\n border: `${isDisabled ? '1px' : isError ? '2px' : '1px'} solid`,\n borderColor: isDisabled\n ? theme.palette.semantic.stroke['stroke-disabled']\n : isError\n ? theme.palette.semantic.stroke['stroke-error-strong']\n : theme.palette.semantic.stroke['stroke-strong'],\n borderRadius: theme.radius['radius-8'],\n overflow: 'visible',\n position: 'relative',\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n marginTop: theme.spacing(0.5),\n}));\n\nconst ActionButton = styled(IconButton)(({ theme }) => ({\n border: 'none',\n boxShadow: 'none',\n borderRadius: 0,\n padding: 0,\n // Limit transitions to avoid perceived zoom effects\n // Robust square focus indicator drawn inside using a pseudo-element\n '&&:focus, &&:focus-visible': {\n outline: 'none',\n borderRadius: 0,\n zIndex: 2,\n },\n '&&:focus::after, &&:focus-visible::after': {\n content: '\"\"',\n position: 'absolute',\n top: -4.5,\n right: -2.5,\n bottom: -4.5,\n left: -4.5,\n border: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n borderRadius: 0,\n pointerEvents: 'none',\n zIndex: 3,\n },\n // Round external corners when focusing the edge buttons\n '&&:first-of-type:focus::after, &&:first-of-type:focus-visible::after': {\n borderTopLeftRadius: theme.radius['radius-12'],\n borderBottomLeftRadius: theme.radius['radius-12'],\n },\n '&&:last-of-type:focus::after, &&:last-of-type:focus-visible::after': {\n borderTopRightRadius: theme.radius['radius-12'],\n borderBottomRightRadius: theme.radius['radius-12'],\n left: -2.5,\n right: -4.5,\n },\n '&:hover': {\n boxShadow: 'none',\n borderRadius: 0,\n },\n '&.Mui-disabled': {\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n border: 'none',\n boxShadow: 'none'\n },\n '&.Mui-disabled > svg': {\n color: theme.palette.semantic.icon['icon-disabled'],\n },\n}));\nconst ValueContainer = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'stretch',\n width: 72,\n minWidth: 56,\n backgroundColor: theme.palette.semantic.fill['fill-inverse-strong'],\n position: 'relative',\n borderRadius: 0,\n // Draw an outer square focus ring for the input area\n '&:focus-within::after': {\n content: '\"\"',\n position: 'absolute',\n top: -4,\n right: -2,\n bottom: -4,\n left: -2,\n border: `2px solid ${theme.palette.semantic.stroke['stroke-focus']}`,\n borderRadius: 0,\n pointerEvents: 'none',\n zIndex: 3,\n },\n}));\nconst ValueField = styled(TextField, {\n shouldForwardProp: (prop) => prop !== 'isError',\n})<{ isError?: boolean }>(({ theme, isError = false }) => ({\n marginTop: '-4px',\n marginBottom: '-4px',\n '& [role=\"textbox\"], & input': {\n textAlign: 'center',\n outline: 'none',\n },\n '& .MuiOutlinedInput-root': {\n border: 'none',\n boxShadow: 'none',\n outline: 'none',\n borderRadius: 0,\n backgroundColor: isError ? theme.palette.semantic.fill['fill-error-weak'] : 'transparent',\n // Ensure disabled overrides error background\n '&.Mui-disabled': {\n backgroundColor: 'transparent',\n },\n // Remove MUI's internal focus ring; the ring is applied on ValueContainer instead\n '&.Mui-focused': {\n outline: 'none !important',\n },\n '&:focus-within': {\n outline: 'none !important',\n },\n '&:focus': {\n outline: 'none !important',\n boxShadow: 'none !important',\n },\n '&:hover': {\n background: 'none !important',\n backgroundImage: 'none !important',\n },\n '& fieldset': {\n border: '0 !important',\n borderRadius: 0,\n },\n '&:hover fieldset': {\n border: '0 !important',\n },\n '&.Mui-focused fieldset': {\n border: '0',\n },\n },\n '& .MuiOutlinedInput-input': {\n outline: 'none',\n boxShadow: 'none',\n '&:focus': {\n outline: 'none',\n boxShadow: 'none',\n },\n '&.Mui-disabled': {\n color: theme.palette.semantic.text['text-disabled'],\n WebkitTextFillColor: theme.palette.semantic.text['text-disabled'],\n },\n },\n '& input:focus': {\n outline: 'none !important',\n boxShadow: 'none !important',\n },\n}));\n\nconst VerticalDivider = styled('div', {\n shouldForwardProp: (prop) => !['isDisabled', 'isError'].includes(prop as string),\n})<{ isDisabled?: boolean; isError?: boolean }>(({ theme, isDisabled = false, isError = false }) => ({\n width: 1,\n alignSelf: 'stretch',\n backgroundColor: isDisabled\n ? theme.palette.semantic.stroke['stroke-disabled']\n : isError\n ? theme.palette.semantic.stroke['stroke-error-strong']\n : theme.palette.semantic.stroke['stroke-strong'],\n}));\n\nconst ErrorIcon = styled(CancelCircleIcon)(({ theme }) => ({\n color: theme.palette.semantic.icon['icon-error'],\n}));\n\nconst ErrorRow = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n marginTop: theme.spacing(0.5)\n}));\n\nconst ErrorText = styled(Typography)(({ theme }) => ({\n color: theme.palette.semantic.text['text-error']\n}));\n\nconst HintText = styled(Typography, {\n shouldForwardProp: (prop) => prop !== 'isDisabled',\n})<{ isDisabled?: boolean }>(({ theme, isDisabled = false }) => ({\n color: isDisabled ? theme.palette.semantic.text['text-disabled'] : theme.palette.semantic.text['text-weak'],\n}));\n\n/**\n * A quantity selector component with increment/decrement buttons and a numeric input field.\n * Provides min/max clamping, step-based adjustments, and optional label/hint/error display.\n *\n * @param props - Component props\n * @returns A quantity selector control\n */\nexport const QuantitySelector = ({\n value,\n onChange,\n min,\n max,\n step,\n disabled = false,\n fdKey,\n label = \"\",\n hint = \"\",\n required = false,\n valid = true,\n errorMessage = '',\n decreaseAriaLabel,\n increaseAriaLabel,\n valueAriaLabel,\n}: QuantitySelectorProps): JSX.Element => {\n const canDecrement = !disabled && value > min;\n const canIncrement = !disabled && value < max;\n\n const handleDecrement = (): void => {\n if (!canDecrement) return;\n const next = clamp(value - step, min, max);\n if (next === undefined) return;\n onChange(next);\n };\n\n const handleIncrement = (): void => {\n if (!canIncrement) return;\n const next = clamp(value + step, min, max);\n if (next === undefined) return;\n onChange(next);\n };\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>): void => {\n const raw = e.target.value;\n if (raw === '') {\n onChange(min);\n return;\n }\n const parsed = clamp(Number(raw), min, max)\n if (parsed === undefined) return;\n onChange(parsed);\n };\n\n return (\n <OuterContainer>\n {label && (\n <MuiInputLabel disabled={disabled} htmlFor={fdKey ? `${fdKey}-input` : 'quantity-input'} required={required}>\n {label}\n </MuiInputLabel>\n\n )}\n {hint && (\n <HintText isDisabled={disabled} variant=\"caption\">\n {hint}\n </HintText>)}\n {!valid && !!errorMessage && (\n <ErrorRow>\n <ErrorIcon />\n <ErrorText variant=\"captionStrong\">\n {errorMessage}\n </ErrorText>\n </ErrorRow>\n )}\n <InnerContainer data-fd={fdKey} isDisabled={disabled} isError={!valid} role=\"group\">\n <ActionButton\n aria-label={decreaseAriaLabel}\n disabled={!canDecrement}\n fdKey={fdKey ? `${fdKey}-decrement` : undefined}\n onClick={handleDecrement}\n tone={valid ? 'neutral' : 'destructive'}\n variant=\"tertiary\"\n >\n <RemoveIcon />\n </ActionButton>\n <VerticalDivider isDisabled={disabled} isError={!valid} />\n <ValueContainer>\n <ValueField\n fullWidth\n aria-label={valueAriaLabel}\n disabled={disabled}\n fdKey={fdKey ? `${fdKey}-input` : 'quantity-input'}\n isError={!valid}\n label=\"\"\n onChange={handleInputChange}\n value={String(value)}\n />\n </ValueContainer>\n <VerticalDivider isDisabled={disabled} isError={!valid} />\n <ActionButton\n aria-label={increaseAriaLabel}\n disabled={!canIncrement}\n fdKey={fdKey ? `${fdKey}-increment` : undefined}\n onClick={handleIncrement}\n tone={valid ? 'neutral' : 'destructive'}\n variant=\"tertiary\"\n >\n <AddIcon />\n </ActionButton>\n </InnerContainer>\n </OuterContainer>\n );\n};\n\nexport default QuantitySelector;\n"],"names":["OuterContainer","styled","Box","display","flexDirection","InnerContainer","shouldForwardProp","prop","includes","theme","isDisabled","isError","alignItems","boxShadow","customShadows","raised","border","borderColor","palette","semantic","stroke","borderRadius","radius","overflow","position","backgroundColor","fill","marginTop","spacing","ActionButton","IconButton","padding","outline","zIndex","content","top","right","bottom","left","pointerEvents","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","color","icon","ValueContainer","width","minWidth","ValueField","TextField","marginBottom","textAlign","background","backgroundImage","text","WebkitTextFillColor","VerticalDivider","alignSelf","ErrorIcon","CancelCircleIcon","ErrorRow","gap","ErrorText","Typography","HintText","QuantitySelector","value","onChange","min","max","step","disabled","fdKey","label","hint","required","valid","errorMessage","decreaseAriaLabel","increaseAriaLabel","valueAriaLabel","canDecrement","canIncrement","_jsxs","children","_jsx","MuiInputLabel","htmlFor","variant","role","undefined","onClick","next","clamp","tone","RemoveIcon","fullWidth","e","raw","target","parsed","Number","String","AddIcon"],"mappings":"qhBAmDA,MAAMA,EAAiBC,EAAOC,EAAPD,EAAY,KAAA,CACjCE,QAAS,OACTC,cAAe,aAGXC,EAAiBJ,EAAOC,EAAK,CACjCI,kBAAoBC,IAAU,CAAC,aAAc,WAAWC,SAASD,IAD5CN,EAEyB,EAAGQ,QAAOC,aAAYC,cAAS,CAC7ER,QAAS,OACTS,WAAY,UACZC,UAAWJ,EAAMK,eAAeC,OAEhCC,QAAWN,EAAa,MAAQC,EAAU,MAAQ,OAA1C,SACRM,YAAaP,EACTD,EAAMS,QAAQC,SAASC,OAAO,mBAC9BT,EACEF,EAAMS,QAAQC,SAASC,OAAO,uBAC9BX,EAAMS,QAAQC,SAASC,OAAO,iBACpCC,aAAcZ,EAAMa,OAAO,YAC3BC,SAAU,UACVC,SAAU,WACVC,gBAAiBhB,EAAMS,QAAQC,SAASO,KAAK,uBAC7CC,UAAWlB,EAAMmB,QAAQ,QAGrBC,EAAe5B,EAAO6B,EAAP7B,EAAmB,EAAGQ,YAAO,CAChDO,OAAQ,OACRH,UAAW,OACXQ,aAAc,EACdU,QAAS,EAGT,6BAA8B,CAC5BC,QAAS,OACTX,aAAc,EACdY,OAAQ,GAEV,2CAA4C,CAC1CC,QAAS,KACTV,SAAU,WACVW,KAAK,IAC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AASC,GAGX,MAAMgC,EAASP,EAAMQ,OAAOH,GAAM9B,EAAKC,QACxBqB,IAAXU,GACJjC,EAASiC,IA4CDlC,MAAOoC,OAAOpC,OAGlBmB,EAAC7B,EAAe,CAAC/C,WAAY8D,EAAU7D,SAAUkE,IACjDS,EAACzD,EAAY,CAAA,aACCmD,EACZR,UAAWW,EACXV,MAAOA,EAAQ,GAAGA,mBAAoBkB,EACtCC,QAnEgB,KACtB,IAAKT,EAAc,OACnB,MAAMU,EAAOC,EAAM3B,EAAQI,EAAMF,EAAKC,QACzBqB,IAATE,GACJzB,EAASyB,IAgEHE,KAAMlB,EAAQ,UAAY,cAC1BY,QAAQ,WAAUJ,SAElBC,EAACkB,EAAO,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var t=require("@mui/material/styles"),i=require("@mui/material/Box"),n=require("../../atoms/IconContainer/index.cjs.js"),r=require("../../atoms/Link/index.cjs.js"),a=require("@mui/material/Typography");const l=t.styled(i,{shouldForwardProp:e=>!["align"].includes(e)})((({theme:e,align:t="left"})=>({display:"flex",flexDirection:"column",gap:e.spacing(2),paddingTop:e.spacing(2),alignItems:"center"===t?"center":"flex-start",textAlign:"center"===t?"center":"left"}))),s=t.styled(i)((({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(1),width:"100%"}))),o=({className:t,icon:i=!0,iconAriaLabel:o="Icon",heading:c=!0,secondaryText:d=!0,textLink:x=!0,headingValue:p,secondaryTextValue:m,iconComponent:u,textLinkContent:g="Label",textLinkHref:h,align:f="left",fdKey:y})=>{const k=h&&""!==h.trim()&&"#"!==h;return(void 0).DEV&&x&&!k&&console.warn('TextBlock: textLink is enabled but textLinkHref is missing, empty, or set to "#". The link will not be rendered. Please provide a valid href when textLink is true.'),e.jsxs(l,{align:f,className:t,"data-fd":y,"data-testid":y,children:[i&&u&&e.jsx(n,{ariaLabel:o,icon:u,style:"filled",tone:"brand"}),(c||d)&&e.jsxs(s,{children:[c&&e.jsx(a,{sx:e=>({color:e.palette.semantic?.text?.["text-strong"]||e.palette.text.primary,margin:0}),variant:"h3Strong",children:p}),d&&e.jsx(a,{sx:e=>({color:e.palette.semantic?.text?.["text-weak"]||e.palette.text.secondary,margin:0}),variant:"b1Weak",children:m})]}),x&&k&&e.jsx(r.Link,{fdKey:y?`${y}-link`:"text-block-link",href:h,size:"body",sx:{whiteSpace:"nowrap"},tone:"Brand",underline:!0,weight:"bold",children:g})]})};exports.TextBlock=o,exports.default=o;
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/molecules/TextBlock/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport Box from '@fd/components/atoms/Box';\nimport IconContainer from '@fd/components/atoms/IconContainer';\nimport Link from '@fd/components/atoms/Link';\nimport Typography from '@fd/components/atoms/Typography';\n\n/**\n * Props for the TextBlock component.\n * Displays a flexible content block with optional icon, heading, secondary text, and link.\n */\nexport interface TextBlockProps {\n /** Optional CSS class name for custom styling */\n className?: string;\n /** Controls visibility of the icon */\n icon?: boolean;\n /** Accessible label for the icon (used by screen readers) */\n iconAriaLabel?: string;\n /** Controls visibility of the heading */\n heading?: boolean;\n /** Controls visibility of the secondary text */\n secondaryText?: boolean;\n /** Controls visibility of the text link */\n textLink?: boolean;\n /** Text content for the heading */\n headingValue?: string;\n /** Text content for the secondary text */\n secondaryTextValue?: string;\n /** React node to render as the icon */\n iconComponent?: React.ReactNode;\n /** Text content for the link */\n textLinkContent?: string;\n /** URL for the text link */\n textLinkHref?: string;\n /** Horizontal alignment of content */\n align?: 'center' | 'left';\n /** Unique identifier for data-fd and data-testid attributes */\n fdKey?: string;\n}\n\nconst StyledContainer = styled(Box, {\n shouldForwardProp: (prop) => !['align'].includes(prop as string),\n})<{ align?: 'center' | 'left' }>(({ theme, align = 'left' }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(2),\n paddingTop: theme.spacing(2),\n alignItems: align === 'center' ? 'center' : 'flex-start',\n textAlign: align === 'center' ? 'center' : 'left',\n}));\n\nconst StyledTextContainer = styled(Box)(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(1),\n width: '100%',\n}));\n\n/**\n * TextBlock component for displaying flexible content blocks with optional elements.\n *\n * This component provides a flexible layout for displaying content with optional icon,\n * heading, secondary text, and link elements. All elements can be individually controlled\n * for visibility and content, making it suitable for various use cases like feature cards,\n * informational blocks, or call-to-action sections.\n *\n * @param props - Component props\n * @returns A styled content block with optional icon, heading, secondary text, and link\n */\nexport const TextBlock: React.FC<TextBlockProps> = ({\n className,\n icon = true,\n iconAriaLabel = 'Icon',\n heading = true,\n secondaryText = true,\n textLink = true,\n headingValue,\n secondaryTextValue,\n iconComponent,\n textLinkContent = 'Label',\n textLinkHref,\n align = 'left',\n fdKey,\n}) => {\n // Validate textLinkHref when textLink is enabled\n const isValidHref = textLinkHref && textLinkHref.trim() !== '' && textLinkHref !== '#';\n\n if (import.meta.env.DEV && textLink && !isValidHref) {\n console.warn(\n 'TextBlock: textLink is enabled but textLinkHref is missing, empty, or set to \"#\". ' +\n 'The link will not be rendered. Please provide a valid href when textLink is true.'\n );\n }\n\n return (\n <StyledContainer align={align} className={className} data-fd={fdKey} data-testid={fdKey}>\n {icon && iconComponent && (\n <IconContainer\n ariaLabel={iconAriaLabel}\n icon={iconComponent}\n style=\"filled\"\n tone=\"brand\"\n />\n )}\n\n {(heading || secondaryText) && (\n <StyledTextContainer>\n {heading && (\n <Typography\n sx={(theme) => ({\n color:\n theme.palette.semantic?.text?.['text-strong'] ||\n theme.palette.text.primary,\n margin: 0,\n })}\n variant=\"h3Strong\"\n >\n {headingValue}\n </Typography>\n )}\n {secondaryText && (\n <Typography\n sx={(theme) => ({\n color:\n theme.palette.semantic?.text?.['text-weak'] ||\n theme.palette.text.secondary,\n margin: 0,\n })}\n variant=\"b1Weak\"\n >\n {secondaryTextValue}\n </Typography>\n )}\n </StyledTextContainer>\n )}\n\n {textLink && isValidHref && (\n <Link\n fdKey={fdKey ? `${fdKey}-link` : 'text-block-link'}\n href={textLinkHref}\n size=\"body\"\n sx={{ whiteSpace: 'nowrap' }}\n tone=\"Brand\"\n underline={true}\n weight=\"bold\"\n >\n {textLinkContent}\n </Link>\n )}\n </StyledContainer>\n );\n};\n\nexport default TextBlock;\n"],"names":["StyledContainer","styled","Box","shouldForwardProp","prop","includes","theme","align","display","flexDirection","gap","spacing","paddingTop","alignItems","textAlign","StyledTextContainer","width","TextBlock","className","icon","iconAriaLabel","heading","secondaryText","textLink","headingValue","secondaryTextValue","iconComponent","textLinkContent","textLinkHref","fdKey","isValidHref","trim","undefined","DEV","console","warn","_jsxs","children","_jsx","IconContainer","ariaLabel","style","tone","Typography","sx","color","palette","semantic","text","primary","margin","variant","secondary","Link","href","size","whiteSpace","underline","weight"],"mappings":"kUA0CA,MAAMA,EAAkBC,EAAAA,OAAOC,EAAK,CAChCC,kBAAoBC,IAAU,CAAC,SAASC,SAASD,IAD7BH,EAEU,EAAGK,QAAOC,QAAQ,WAAQ,CACxDC,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,GACnBC,WAAYN,EAAMK,QAAQ,GAC1BE,WAAsB,WAAVN,EAAqB,SAAW,aAC5CO,UAAqB,WAAVP,EAAqB,SAAW,WAGzCQ,EAAsBd,EAAAA,OAAOC,EAAPD,EAAY,EAAGK,YAAO,CAC9CE,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,GACnBK,MAAO,WAcEC,EAAsC,EAC/CC,YACAC,QAAO,EACPC,gBAAgB,OAChBC,WAAU,EACVC,iBAAgB,EAChBC,YAAW,EACXC,eACAC,qBACAC,gBACAC,kBAAkB,QAClBC,eACArB,QAAQ,OACRsB,YAGA,MAAMC,EAAcF,GAAwC,KAAxBA,EAAaG,QAAkC,MAAjBH,EASlE,YAPII,GAAgBC,KAAOV,IAAaO,GACpCI,QAAQC,KACJ,uKAMJC,EAAAA,KAACpC,EAAe,CAACO,MAAOA,EAAOW,UAAWA,EAAS,UAAWW,EAAK,cAAeA,EAAKQ,SAAA,CAClFlB,GAAQO,GACLY,EAAAA,IAACC,EAAa,CACVC,UAAWpB,EACXD,KAAMO,EACNe,MAAM,SACNC,KAAK,WAIXrB,GAAWC,IACTc,EAAAA,KAACrB,EAAmB,CAAAsB,SAAA,CACfhB,GACGiB,EAAAA,IAACK,EAAU,CACPC,GAAKtC,IAAK,CACNuC,MACIvC,EAAMwC,QAAQC,UAAUC,OAAO,gBAC/B1C,EAAMwC,QAAQE,KAAKC,QACvBC,OAAQ,IAEZC,QAAQ,oBAEP3B,IAGRF,GACGgB,EAAAA,IAACK,GACGC,GAAKtC,IAAK,CACNuC,MACIvC,EAAMwC,QAAQC,UAAUC,OAAO,cAC/B1C,EAAMwC,QAAQE,KAAKI,UACvBF,OAAQ,IAEZC,QAAQ,SAAQd,SAEfZ,OAMhBF,GAAYO,GACTQ,EAAAA,IAACe,EAAAA,KAAI,CACDxB,MAAOA,EAAQ,GAAGA,SAAe,kBACjCyB,KAAM1B,EACN2B,KAAK,OACLX,GAAI,CAAEY,WAAY,UAClBd,KAAK,QACLe,WAAW,EACXC,OAAO,OAAMrB,SAEZV"}
@@ -0,0 +1,49 @@
1
+ import react__default from 'react';
2
+
3
+ /**
4
+ * Props for the TextBlock component.
5
+ * Displays a flexible content block with optional icon, heading, secondary text, and link.
6
+ */
7
+ interface TextBlockProps {
8
+ /** Optional CSS class name for custom styling */
9
+ className?: string;
10
+ /** Controls visibility of the icon */
11
+ icon?: boolean;
12
+ /** Accessible label for the icon (used by screen readers) */
13
+ iconAriaLabel?: string;
14
+ /** Controls visibility of the heading */
15
+ heading?: boolean;
16
+ /** Controls visibility of the secondary text */
17
+ secondaryText?: boolean;
18
+ /** Controls visibility of the text link */
19
+ textLink?: boolean;
20
+ /** Text content for the heading */
21
+ headingValue?: string;
22
+ /** Text content for the secondary text */
23
+ secondaryTextValue?: string;
24
+ /** React node to render as the icon */
25
+ iconComponent?: react__default.ReactNode;
26
+ /** Text content for the link */
27
+ textLinkContent?: string;
28
+ /** URL for the text link */
29
+ textLinkHref?: string;
30
+ /** Horizontal alignment of content */
31
+ align?: 'center' | 'left';
32
+ /** Unique identifier for data-fd and data-testid attributes */
33
+ fdKey?: string;
34
+ }
35
+ /**
36
+ * TextBlock component for displaying flexible content blocks with optional elements.
37
+ *
38
+ * This component provides a flexible layout for displaying content with optional icon,
39
+ * heading, secondary text, and link elements. All elements can be individually controlled
40
+ * for visibility and content, making it suitable for various use cases like feature cards,
41
+ * informational blocks, or call-to-action sections.
42
+ *
43
+ * @param props - Component props
44
+ * @returns A styled content block with optional icon, heading, secondary text, and link
45
+ */
46
+ declare const TextBlock: react__default.FC<TextBlockProps>;
47
+
48
+ export { TextBlock, TextBlock as default };
49
+ export type { TextBlockProps };
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import"react";import{styled as i}from"@mui/material/styles";import n from"@mui/material/Box";import a from"../../atoms/IconContainer/index.js";import{Link as r}from"../../atoms/Link/index.js";import o from"@mui/material/Typography";const l=i(n,{shouldForwardProp:e=>!["align"].includes(e)})((({theme:e,align:t="left"})=>({display:"flex",flexDirection:"column",gap:e.spacing(2),paddingTop:e.spacing(2),alignItems:"center"===t?"center":"flex-start",textAlign:"center"===t?"center":"left"}))),s=i(n)((({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(1),width:"100%"}))),c=({className:i,icon:n=!0,iconAriaLabel:c="Icon",heading:m=!0,secondaryText:d=!0,textLink:p=!0,headingValue:x,secondaryTextValue:f,iconComponent:g,textLinkContent:h="Label",textLinkHref:u,align:k="left",fdKey:y})=>{const b=u&&""!==u.trim()&&"#"!==u;return import.meta.env.DEV&&p&&!b&&console.warn('TextBlock: textLink is enabled but textLinkHref is missing, empty, or set to "#". The link will not be rendered. Please provide a valid href when textLink is true.'),e(l,{align:k,className:i,"data-fd":y,"data-testid":y,children:[n&&g&&t(a,{ariaLabel:c,icon:g,style:"filled",tone:"brand"}),(m||d)&&e(s,{children:[m&&t(o,{sx:e=>({color:e.palette.semantic?.text?.["text-strong"]||e.palette.text.primary,margin:0}),variant:"h3Strong",children:x}),d&&t(o,{sx:e=>({color:e.palette.semantic?.text?.["text-weak"]||e.palette.text.secondary,margin:0}),variant:"b1Weak",children:f})]}),p&&b&&t(r,{fdKey:y?`${y}-link`:"text-block-link",href:u,size:"body",sx:{whiteSpace:"nowrap"},tone:"Brand",underline:!0,weight:"bold",children:h})]})};export{c as TextBlock,c as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/molecules/TextBlock/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport Box from '@fd/components/atoms/Box';\nimport IconContainer from '@fd/components/atoms/IconContainer';\nimport Link from '@fd/components/atoms/Link';\nimport Typography from '@fd/components/atoms/Typography';\n\n/**\n * Props for the TextBlock component.\n * Displays a flexible content block with optional icon, heading, secondary text, and link.\n */\nexport interface TextBlockProps {\n /** Optional CSS class name for custom styling */\n className?: string;\n /** Controls visibility of the icon */\n icon?: boolean;\n /** Accessible label for the icon (used by screen readers) */\n iconAriaLabel?: string;\n /** Controls visibility of the heading */\n heading?: boolean;\n /** Controls visibility of the secondary text */\n secondaryText?: boolean;\n /** Controls visibility of the text link */\n textLink?: boolean;\n /** Text content for the heading */\n headingValue?: string;\n /** Text content for the secondary text */\n secondaryTextValue?: string;\n /** React node to render as the icon */\n iconComponent?: React.ReactNode;\n /** Text content for the link */\n textLinkContent?: string;\n /** URL for the text link */\n textLinkHref?: string;\n /** Horizontal alignment of content */\n align?: 'center' | 'left';\n /** Unique identifier for data-fd and data-testid attributes */\n fdKey?: string;\n}\n\nconst StyledContainer = styled(Box, {\n shouldForwardProp: (prop) => !['align'].includes(prop as string),\n})<{ align?: 'center' | 'left' }>(({ theme, align = 'left' }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(2),\n paddingTop: theme.spacing(2),\n alignItems: align === 'center' ? 'center' : 'flex-start',\n textAlign: align === 'center' ? 'center' : 'left',\n}));\n\nconst StyledTextContainer = styled(Box)(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(1),\n width: '100%',\n}));\n\n/**\n * TextBlock component for displaying flexible content blocks with optional elements.\n *\n * This component provides a flexible layout for displaying content with optional icon,\n * heading, secondary text, and link elements. All elements can be individually controlled\n * for visibility and content, making it suitable for various use cases like feature cards,\n * informational blocks, or call-to-action sections.\n *\n * @param props - Component props\n * @returns A styled content block with optional icon, heading, secondary text, and link\n */\nexport const TextBlock: React.FC<TextBlockProps> = ({\n className,\n icon = true,\n iconAriaLabel = 'Icon',\n heading = true,\n secondaryText = true,\n textLink = true,\n headingValue,\n secondaryTextValue,\n iconComponent,\n textLinkContent = 'Label',\n textLinkHref,\n align = 'left',\n fdKey,\n}) => {\n // Validate textLinkHref when textLink is enabled\n const isValidHref = textLinkHref && textLinkHref.trim() !== '' && textLinkHref !== '#';\n\n if (import.meta.env.DEV && textLink && !isValidHref) {\n console.warn(\n 'TextBlock: textLink is enabled but textLinkHref is missing, empty, or set to \"#\". ' +\n 'The link will not be rendered. Please provide a valid href when textLink is true.'\n );\n }\n\n return (\n <StyledContainer align={align} className={className} data-fd={fdKey} data-testid={fdKey}>\n {icon && iconComponent && (\n <IconContainer\n ariaLabel={iconAriaLabel}\n icon={iconComponent}\n style=\"filled\"\n tone=\"brand\"\n />\n )}\n\n {(heading || secondaryText) && (\n <StyledTextContainer>\n {heading && (\n <Typography\n sx={(theme) => ({\n color:\n theme.palette.semantic?.text?.['text-strong'] ||\n theme.palette.text.primary,\n margin: 0,\n })}\n variant=\"h3Strong\"\n >\n {headingValue}\n </Typography>\n )}\n {secondaryText && (\n <Typography\n sx={(theme) => ({\n color:\n theme.palette.semantic?.text?.['text-weak'] ||\n theme.palette.text.secondary,\n margin: 0,\n })}\n variant=\"b1Weak\"\n >\n {secondaryTextValue}\n </Typography>\n )}\n </StyledTextContainer>\n )}\n\n {textLink && isValidHref && (\n <Link\n fdKey={fdKey ? `${fdKey}-link` : 'text-block-link'}\n href={textLinkHref}\n size=\"body\"\n sx={{ whiteSpace: 'nowrap' }}\n tone=\"Brand\"\n underline={true}\n weight=\"bold\"\n >\n {textLinkContent}\n </Link>\n )}\n </StyledContainer>\n );\n};\n\nexport default TextBlock;\n"],"names":["StyledContainer","styled","Box","shouldForwardProp","prop","includes","theme","align","display","flexDirection","gap","spacing","paddingTop","alignItems","textAlign","StyledTextContainer","width","TextBlock","className","icon","iconAriaLabel","heading","secondaryText","textLink","headingValue","secondaryTextValue","iconComponent","textLinkContent","textLinkHref","fdKey","isValidHref","trim","env","DEV","console","warn","_jsxs","children","_jsx","IconContainer","ariaLabel","style","tone","Typography","sx","color","palette","semantic","text","primary","margin","variant","secondary","Link","href","size","whiteSpace","underline","weight"],"mappings":"0RA0CA,MAAMA,EAAkBC,EAAOC,EAAK,CAChCC,kBAAoBC,IAAU,CAAC,SAASC,SAASD,IAD7BH,EAEU,EAAGK,QAAOC,QAAQ,WAAQ,CACxDC,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,GACnBC,WAAYN,EAAMK,QAAQ,GAC1BE,WAAsB,WAAVN,EAAqB,SAAW,aAC5CO,UAAqB,WAAVP,EAAqB,SAAW,WAGzCQ,EAAsBd,EAAOC,EAAPD,EAAY,EAAGK,YAAO,CAC9CE,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,GACnBK,MAAO,WAcEC,EAAsC,EAC/CC,YACAC,QAAO,EACPC,gBAAgB,OAChBC,WAAU,EACVC,iBAAgB,EAChBC,YAAW,EACXC,eACAC,qBACAC,gBACAC,kBAAkB,QAClBC,eACArB,QAAQ,OACRsB,YAGA,MAAMC,EAAcF,GAAwC,KAAxBA,EAAaG,QAAkC,MAAjBH,EASlE,mBAPgBI,IAAIC,KAAOV,IAAaO,GACpCI,QAAQC,KACJ,uKAMJC,EAACpC,EAAe,CAACO,MAAOA,EAAOW,UAAWA,EAAS,UAAWW,EAAK,cAAeA,EAAKQ,SAAA,CAClFlB,GAAQO,GACLY,EAACC,EAAa,CACVC,UAAWpB,EACXD,KAAMO,EACNe,MAAM,SACNC,KAAK,WAIXrB,GAAWC,IACTc,EAACrB,EAAmB,CAAAsB,SAAA,CACfhB,GACGiB,EAACK,EAAU,CACPC,GAAKtC,IAAK,CACNuC,MACIvC,EAAMwC,QAAQC,UAAUC,OAAO,gBAC/B1C,EAAMwC,QAAQE,KAAKC,QACvBC,OAAQ,IAEZC,QAAQ,oBAEP3B,IAGRF,GACGgB,EAACK,GACGC,GAAKtC,IAAK,CACNuC,MACIvC,EAAMwC,QAAQC,UAAUC,OAAO,cAC/B1C,EAAMwC,QAAQE,KAAKI,UACvBF,OAAQ,IAEZC,QAAQ,SAAQd,SAEfZ,OAMhBF,GAAYO,GACTQ,EAACe,EAAI,CACDxB,MAAOA,EAAQ,GAAGA,SAAe,kBACjCyB,KAAM1B,EACN2B,KAAK,OACLX,GAAI,CAAEY,WAAY,UAClBd,KAAK,QACLe,WAAW,EACXC,OAAO,OAAMrB,SAEZV"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),i=require("@mui/material/Box/Box"),t=require("@mui/material/Stack/Stack"),o=require("@mui/material/styles/styled"),n=require("@mui/material/Typography/Typography"),r=require("../../../atoms/TextField/index.cjs.js"),l=require("react-images-uploading");const a=o(i)((({theme:e})=>({flex:"1",display:"flex",flexDirection:"column",height:"100%",boxSizing:"border-box",alignItems:"center",justifyContent:"space-between",padding:"12px",borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.10)",background:"#FAFAFA",[e.breakpoints.only("mobile")]:{justifyContent:"center",gap:"32px"}}))),d=o(i)({display:"flex",flexDirection:"column",width:"48px",height:"48px",padding:"0px",justifyContent:"center",alignItems:"center",borderRadius:"32px",backgroundColor:"rgba(0, 0, 0, 0.04)"}),s=o(n)({color:"rgba(0, 0, 0, 0.90)",fontFamily:"Roboto",fontSize:"16px",fontStyle:"normal",fontWeight:"600",lineHeight:"24px",letterSpacing:"0px",textDecoration:"underline",textDecorationStyle:"solid",textDecorationSkipInk:"auto",textDecorationThickness:"auto",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",cursor:"pointer"}),c=o(n)({fontFamily:"Roboto",fontSize:"14px",fontStyle:"normal",fontWeight:400,lineHeight:"20px",letterSpacing:"0px",textAlign:"center"}),g=o("img")({maxWidth:"100%",maxHeight:"100%",borderRadius:"4px",objectFit:"cover"}),p=o("form")({width:"100%",maxWidth:"400px"}),x=["jpg","jpeg","png","gif","bmp"];module.exports=({selectedImage:i,onImageSelect:o,uploadingError:n,allowImageLinkUpload:C,imageLink:m,onImageLinkChange:h=()=>{},onUploadImageLink:u=()=>{}})=>{const f=e=>{e.preventDefault(),u(m)};return e.jsx(l,{acceptType:x,onChange:e=>{const i=e[0];i&&o(i)},value:i?[i]:[],children:({onImageUpload:o,dragProps:l})=>{const x=`Error occurred while uploading image: ${n?.message?n.message:""}`;return i?.dataURL?e.jsx(g,{src:i.dataURL}):e.jsxs(a,{...l,children:[e.jsx(d,{children:e.jsxs("svg",{fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("title",{children:"Upload icon"}),e.jsx("path",{clipRule:"evenodd",d:"M17.8453 2.18282C16.4851 1.99996 14.7504 1.99998 12.5745 2H12.4255C10.2496 1.99998 8.51485 1.99996 7.15471 2.18282C5.75034 2.37164 4.59652 2.77175 3.68413 3.68414C2.77174 4.59653 2.37164 5.75034 2.18282 7.15471C1.99996 8.51485 1.99998 10.2496 2 12.4255V12.5745C1.99998 14.7504 1.99996 16.4851 2.18282 17.8453C2.37164 19.2497 2.77177 20.4035 3.68415 21.3159C4.59654 22.2283 5.75034 22.6284 7.15472 22.8172C8.51486 23 10.2496 23 12.4256 23H12.5744C14.7504 23 16.4851 23 17.8453 22.8172C19.2496 22.6284 20.4035 22.2282 21.3159 21.3159C22.2283 20.4035 22.6284 19.2496 22.8172 17.8453C23 16.4851 23 14.7504 23 12.5744V12.4256C23 10.2496 23 8.51486 22.8172 7.15472C22.6284 5.75034 22.2283 4.59651 21.3159 3.68412C20.4035 2.77174 19.2497 2.37164 17.8453 2.18282ZM5.09835 5.09835C5.57721 4.61949 6.23861 4.32398 7.42121 4.16499C8.63258 4.00212 10.2326 4 12.5 4C14.7674 4 16.3674 4.00212 17.5788 4.16499C18.7614 4.32399 19.4228 4.6195 19.9017 5.09836C20.3805 5.57722 20.676 6.23862 20.835 7.42121C20.9943 8.60603 20.9998 10.1626 21 12.3519C19.6026 11.7105 18.2505 11.4471 16.9403 11.5088C15.1642 11.5923 13.5635 12.2683 12.1227 13.2344C9.67205 14.8776 7.51569 17.4909 5.59833 19.8145L5.34633 20.1197C5.25795 20.0517 5.17577 19.9791 5.09836 19.9017C4.6195 19.4228 4.32399 18.7614 4.16499 17.5788C4.00212 16.3674 4 14.7674 4 12.5C4 10.2326 4.00212 8.63258 4.16499 7.42121C4.32398 6.23861 4.6195 5.5772 5.09835 5.09835ZM20.993 14.5995C19.5215 13.7462 18.2137 13.4511 17.0342 13.5065C15.7231 13.5682 14.4707 14.068 13.2366 14.8955C11.1229 16.3128 9.2346 18.5584 7.3582 20.8263L7.42121 20.835C8.63258 20.9979 10.2326 21 12.5 21C14.7674 21 16.3674 20.9979 17.5788 20.835C18.7614 20.676 19.4228 20.3805 19.9017 19.9017C20.3805 19.4228 20.676 18.7614 20.835 17.5788C20.9423 16.7808 20.9798 15.8143 20.993 14.5995Z",fill:"black",fillOpacity:"0.45",fillRule:"evenodd"}),e.jsx("path",{clipRule:"evenodd",d:"M10.5 8C10.5 6.61929 9.38071 5.5 8 5.5C7.72212 5.5 7.45482 5.54534 7.20511 5.62902C6.21409 5.96113 5.5 6.89717 5.5 8C5.5 8.84194 5.91619 9.58667 6.55407 10.0397C6.96226 10.3296 7.46123 10.5 8 10.5C9.38071 10.5 10.5 9.38071 10.5 8ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5Z",fill:"black",fillOpacity:"0.45",fillRule:"evenodd"})]})}),e.jsxs(t,{alignItems:"center",direction:"column",gap:"8px",width:"100%",children:[e.jsx(s,{onClick:o,children:"Select an image"}),e.jsxs(c,{color:"rgba(0, 0, 0, 0.90)",children:["OR drop it here",C&&" OR paste the image URL below"]}),C&&e.jsx(p,{"data-testid":"image-link-form",onSubmit:f,children:e.jsx(r,{fullWidth:!0,fdKey:"img-link",onChange:e=>h(e.target.value),placeholder:"Enter image URL",value:m})})]}),e.jsx(c,{color:"rgba(0, 0, 0, 0.60)",children:"Minimum dimensions: 1280 × 720 - up to 10 MB"}),e.jsx(c,{color:"rgba(184, 0, 34, 0.80)",sx:e=>({overflowY:"scroll",height:"30px",[e.breakpoints.only("mobile")]:{height:"120px"}}),children:n?x:""})]})}})};
1
+ "use strict";var e=require("react/jsx-runtime"),i=require("@mui/material/Box/Box"),t=require("@mui/material/Stack/Stack"),o=require("@mui/material/styles/styled"),n=require("@mui/material/Typography/Typography"),r=require("../../../atoms/TextField/index.cjs.js"),l=require("react-images-uploading");const a=o(i)((({theme:e})=>({flex:"1",display:"flex",flexDirection:"column",height:"100%",boxSizing:"border-box",alignItems:"center",justifyContent:"space-between",padding:"12px",borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.10)",background:"#FAFAFA",[e.breakpoints.only("mobile")]:{justifyContent:"center",gap:"32px"}}))),d=o(i)({display:"flex",flexDirection:"column",width:"48px",height:"48px",padding:"0px",justifyContent:"center",alignItems:"center",borderRadius:"32px",backgroundColor:"rgba(0, 0, 0, 0.04)"}),s=o(n)({color:"rgba(0, 0, 0, 0.90)",fontFamily:"Roboto",fontSize:"16px",fontStyle:"normal",fontWeight:"600",lineHeight:"24px",letterSpacing:"0px",textDecoration:"underline",textDecorationStyle:"solid",textDecorationSkipInk:"auto",textDecorationThickness:"auto",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",cursor:"pointer"}),c=o(n)({fontFamily:"Roboto",fontSize:"14px",fontStyle:"normal",fontWeight:400,lineHeight:"20px",letterSpacing:"0px",textAlign:"center"}),g=o("img")({maxWidth:"100%",maxHeight:"100%",borderRadius:"4px",objectFit:"cover"}),p=o("form")({width:"100%",maxWidth:"400px"}),x=["jpg","jpeg","png","gif","bmp"];module.exports=({selectedImage:i,onImageSelect:o,uploadingError:n,allowImageLinkUpload:C,imageLink:m,onImageLinkChange:h=()=>{},onUploadImageLink:u=()=>{}})=>{const f=e=>{e.preventDefault(),u(m)};return e.jsx(l,{acceptType:x,onChange:e=>{const i=e[0];i&&o(i)},value:i?[i]:[],children:({onImageUpload:o,dragProps:l})=>{const x=`Error occurred while uploading image: ${n?.message?n.message:""}`;return i?.dataURL?e.jsx(g,{src:i.dataURL}):e.jsxs(a,{...l,children:[e.jsx(d,{children:e.jsxs("svg",{fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("title",{children:"Upload icon"}),e.jsx("path",{clipRule:"evenodd",d:"M17.8453 2.18282C16.4851 1.99996 14.7504 1.99998 12.5745 2H12.4255C10.2496 1.99998 8.51485 1.99996 7.15471 2.18282C5.75034 2.37164 4.59652 2.77175 3.68413 3.68414C2.77174 4.59653 2.37164 5.75034 2.18282 7.15471C1.99996 8.51485 1.99998 10.2496 2 12.4255V12.5745C1.99998 14.7504 1.99996 16.4851 2.18282 17.8453C2.37164 19.2497 2.77177 20.4035 3.68415 21.3159C4.59654 22.2283 5.75034 22.6284 7.15472 22.8172C8.51486 23 10.2496 23 12.4256 23H12.5744C14.7504 23 16.4851 23 17.8453 22.8172C19.2496 22.6284 20.4035 22.2282 21.3159 21.3159C22.2283 20.4035 22.6284 19.2496 22.8172 17.8453C23 16.4851 23 14.7504 23 12.5744V12.4256C23 10.2496 23 8.51486 22.8172 7.15472C22.6284 5.75034 22.2283 4.59651 21.3159 3.68412C20.4035 2.77174 19.2497 2.37164 17.8453 2.18282ZM5.09835 5.09835C5.57721 4.61949 6.23861 4.32398 7.42121 4.16499C8.63258 4.00212 10.2326 4 12.5 4C14.7674 4 16.3674 4.00212 17.5788 4.16499C18.7614 4.32399 19.4228 4.6195 19.9017 5.09836C20.3805 5.57722 20.676 6.23862 20.835 7.42121C20.9943 8.60603 20.9998 10.1626 21 12.3519C19.6026 11.7105 18.2505 11.4471 16.9403 11.5088C15.1642 11.5923 13.5635 12.2683 12.1227 13.2344C9.67205 14.8776 7.51569 17.4909 5.59833 19.8145L5.34633 20.1197C5.25795 20.0517 5.17577 19.9791 5.09836 19.9017C4.6195 19.4228 4.32399 18.7614 4.16499 17.5788C4.00212 16.3674 4 14.7674 4 12.5C4 10.2326 4.00212 8.63258 4.16499 7.42121C4.32398 6.23861 4.6195 5.5772 5.09835 5.09835ZM20.993 14.5995C19.5215 13.7462 18.2137 13.4511 17.0342 13.5065C15.7231 13.5682 14.4707 14.068 13.2366 14.8955C11.1229 16.3128 9.2346 18.5584 7.3582 20.8263L7.42121 20.835C8.63258 20.9979 10.2326 21 12.5 21C14.7674 21 16.3674 20.9979 17.5788 20.835C18.7614 20.676 19.4228 20.3805 19.9017 19.9017C20.3805 19.4228 20.676 18.7614 20.835 17.5788C20.9423 16.7808 20.9798 15.8143 20.993 14.5995Z",fill:"black",fillOpacity:"0.45",fillRule:"evenodd"}),e.jsx("path",{clipRule:"evenodd",d:"M10.5 8C10.5 6.61929 9.38071 5.5 8 5.5C7.72212 5.5 7.45482 5.54534 7.20511 5.62902C6.21409 5.96113 5.5 6.89717 5.5 8C5.5 8.84194 5.91619 9.58667 6.55407 10.0397C6.96226 10.3296 7.46123 10.5 8 10.5C9.38071 10.5 10.5 9.38071 10.5 8ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5Z",fill:"black",fillOpacity:"0.45",fillRule:"evenodd"})]})}),e.jsxs(t,{alignItems:"center",direction:"column",gap:"8px",width:"100%",children:[e.jsx(s,{onClick:o,children:"Select an image"}),e.jsxs(c,{color:"rgba(0, 0, 0, 0.90)",children:["OR drop it here",C&&" OR paste the image URL below"]}),C&&e.jsx(p,{"data-testid":"image-link-form",onSubmit:f,children:e.jsx(r.TextField,{fullWidth:!0,fdKey:"img-link",onChange:e=>h(e.target.value),placeholder:"Enter image URL",value:m})})]}),e.jsx(c,{color:"rgba(0, 0, 0, 0.60)",children:"Minimum dimensions: 1280 × 720 - up to 10 MB"}),e.jsx(c,{color:"rgba(184, 0, 34, 0.80)",sx:e=>({overflowY:"scroll",height:"30px",[e.breakpoints.only("mobile")]:{height:"120px"}}),children:n?x:""})]})}})};
2
2
  //# sourceMappingURL=ImageDropZone.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageDropZone.cjs.js","sources":["../../../../../src/components/organisms/ImageUploadWidget/components/ImageDropZone.tsx"],"sourcesContent":["import Box from '@mui/material/Box/Box';\nimport Stack from '@mui/material/Stack/Stack';\nimport styled from '@mui/material/styles/styled';\nimport Typography from '@mui/material/Typography/Typography';\n\nimport TextField from '@fd/components/atoms/TextField';\nimport ReactImageUploading, { type ImageListType, type ImageType } from 'react-images-uploading';\n\nconst StyledUploadAreaContainer = styled(Box)(({ theme }) => ({\n flex: '1',\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '12px',\n borderRadius: '4px',\n border: '1px solid rgba(0, 0, 0, 0.10)',\n background: '#FAFAFA',\n [theme.breakpoints.only('mobile')]: {\n justifyContent: 'center',\n gap: '32px',\n }\n}));\n\nconst StyledIconContainer = styled(Box)({\n display: 'flex',\n flexDirection: 'column',\n width: '48px',\n height: '48px',\n padding: '0px',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: '32px',\n backgroundColor: 'rgba(0, 0, 0, 0.04)',\n});\n\nconst StyledPrimaryText = styled(Typography)({\n color: 'rgba(0, 0, 0, 0.90)',\n fontFamily: 'Roboto',\n fontSize: '16px',\n fontStyle: 'normal',\n fontWeight: '600',\n lineHeight: '24px',\n letterSpacing: '0px',\n textDecoration: 'underline',\n textDecorationStyle: 'solid',\n textDecorationSkipInk: 'auto',\n textDecorationThickness: 'auto',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n cursor: 'pointer',\n});\n\nconst StyledSecondaryText = styled(Typography)({\n fontFamily: 'Roboto',\n fontSize: '14px',\n fontStyle: 'normal',\n fontWeight: 400,\n lineHeight: '20px',\n letterSpacing: '0px',\n textAlign: 'center',\n});\n\nconst StyledImageComponent = styled('img')({\n maxWidth: '100%',\n maxHeight: '100%',\n borderRadius: '4px',\n objectFit: 'cover',\n});\n\nconst StyledForm = styled('form')({\n width: '100%',\n maxWidth: '400px',\n})\n\ninterface ImageDropZoneProps {\n selectedImage: ImageType | null;\n onImageSelect: (selectedImage: ImageType) => void;\n allowImageLinkUpload: boolean;\n imageLink: string;\n onUploadImageLink?: (link: string) => void;\n onImageLinkChange?: (link: string) => void;\n uploadingError: Error | null;\n}\n\nconst allowedFileTypes = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];\n\nconst ImageDropZone: React.FC<ImageDropZoneProps> = ({\n selectedImage,\n onImageSelect,\n uploadingError,\n allowImageLinkUpload,\n imageLink,\n onImageLinkChange = (): void => {},\n onUploadImageLink = (): void => {},\n}) => {\n const handleImageSelect = (value: ImageListType): void => {\n const firstImage = value[0] as ImageType | undefined;\n if (firstImage) {\n onImageSelect(firstImage);\n }\n };\n\n const handleImageLinkUpload = (e: React.FormEvent): void => {\n e.preventDefault();\n onUploadImageLink(imageLink);\n }\n\n return (\n <ReactImageUploading acceptType={allowedFileTypes} onChange={handleImageSelect} value={selectedImage ? [selectedImage] : []}>\n {({ onImageUpload, dragProps }) => {\n const uploadErrorMessage = `Error occurred while uploading image: ${uploadingError?.message ? uploadingError.message : ''}`;\n\n if (selectedImage?.dataURL) {\n return <StyledImageComponent src={selectedImage.dataURL} />;\n }\n\n return (\n <StyledUploadAreaContainer {...dragProps}>\n <StyledIconContainer>\n <svg fill=\"none\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>Upload icon</title>\n <path\n clipRule=\"evenodd\"\n d=\"M17.8453 2.18282C16.4851 1.99996 14.7504 1.99998 12.5745 2H12.4255C10.2496 1.99998 8.51485 1.99996 7.15471 2.18282C5.75034 2.37164 4.59652 2.77175 3.68413 3.68414C2.77174 4.59653 2.37164 5.75034 2.18282 7.15471C1.99996 8.51485 1.99998 10.2496 2 12.4255V12.5745C1.99998 14.7504 1.99996 16.4851 2.18282 17.8453C2.37164 19.2497 2.77177 20.4035 3.68415 21.3159C4.59654 22.2283 5.75034 22.6284 7.15472 22.8172C8.51486 23 10.2496 23 12.4256 23H12.5744C14.7504 23 16.4851 23 17.8453 22.8172C19.2496 22.6284 20.4035 22.2282 21.3159 21.3159C22.2283 20.4035 22.6284 19.2496 22.8172 17.8453C23 16.4851 23 14.7504 23 12.5744V12.4256C23 10.2496 23 8.51486 22.8172 7.15472C22.6284 5.75034 22.2283 4.59651 21.3159 3.68412C20.4035 2.77174 19.2497 2.37164 17.8453 2.18282ZM5.09835 5.09835C5.57721 4.61949 6.23861 4.32398 7.42121 4.16499C8.63258 4.00212 10.2326 4 12.5 4C14.7674 4 16.3674 4.00212 17.5788 4.16499C18.7614 4.32399 19.4228 4.6195 19.9017 5.09836C20.3805 5.57722 20.676 6.23862 20.835 7.42121C20.9943 8.60603 20.9998 10.1626 21 12.3519C19.6026 11.7105 18.2505 11.4471 16.9403 11.5088C15.1642 11.5923 13.5635 12.2683 12.1227 13.2344C9.67205 14.8776 7.51569 17.4909 5.59833 19.8145L5.34633 20.1197C5.25795 20.0517 5.17577 19.9791 5.09836 19.9017C4.6195 19.4228 4.32399 18.7614 4.16499 17.5788C4.00212 16.3674 4 14.7674 4 12.5C4 10.2326 4.00212 8.63258 4.16499 7.42121C4.32398 6.23861 4.6195 5.5772 5.09835 5.09835ZM20.993 14.5995C19.5215 13.7462 18.2137 13.4511 17.0342 13.5065C15.7231 13.5682 14.4707 14.068 13.2366 14.8955C11.1229 16.3128 9.2346 18.5584 7.3582 20.8263L7.42121 20.835C8.63258 20.9979 10.2326 21 12.5 21C14.7674 21 16.3674 20.9979 17.5788 20.835C18.7614 20.676 19.4228 20.3805 19.9017 19.9017C20.3805 19.4228 20.676 18.7614 20.835 17.5788C20.9423 16.7808 20.9798 15.8143 20.993 14.5995Z\"\n fill=\"black\"\n fillOpacity=\"0.45\"\n fillRule=\"evenodd\"\n />\n <path\n clipRule=\"evenodd\"\n d=\"M10.5 8C10.5 6.61929 9.38071 5.5 8 5.5C7.72212 5.5 7.45482 5.54534 7.20511 5.62902C6.21409 5.96113 5.5 6.89717 5.5 8C5.5 8.84194 5.91619 9.58667 6.55407 10.0397C6.96226 10.3296 7.46123 10.5 8 10.5C9.38071 10.5 10.5 9.38071 10.5 8ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5Z\"\n fill=\"black\"\n fillOpacity=\"0.45\"\n fillRule=\"evenodd\"\n />\n </svg>\n </StyledIconContainer>\n <Stack alignItems=\"center\" direction=\"column\" gap=\"8px\" width=\"100%\">\n <StyledPrimaryText onClick={onImageUpload}>Select an image</StyledPrimaryText>\n <StyledSecondaryText color=\"rgba(0, 0, 0, 0.90)\">\n OR drop it here{allowImageLinkUpload && ' OR paste the image URL below'}\n </StyledSecondaryText>\n {allowImageLinkUpload &&\n <StyledForm data-testid='image-link-form' onSubmit={handleImageLinkUpload}>\n <TextField fullWidth fdKey='img-link' onChange={(e) => onImageLinkChange(e.target.value)} placeholder=\"Enter image URL\" value={imageLink} />\n </StyledForm>\n }\n </Stack>\n <StyledSecondaryText color=\"rgba(0, 0, 0, 0.60)\">Minimum dimensions: 1280 × 720 - up to 10 MB</StyledSecondaryText>\n <StyledSecondaryText\n color=\"rgba(184, 0, 34, 0.80)\"\n sx={(theme) => ({\n overflowY: 'scroll',\n height: '30px',\n [theme.breakpoints.only('mobile')]: {\n height: '120px'\n }\n })}\n >\n {uploadingError ? uploadErrorMessage : ''}\n </StyledSecondaryText>\n </StyledUploadAreaContainer>\n );\n }}\n </ReactImageUploading>\n );\n};\n\nexport default ImageDropZone;\n"],"names":["StyledUploadAreaContainer","styled","Box","theme","flex","display","flexDirection","height","boxSizing","alignItems","justifyContent","padding","borderRadius","border","background","breakpoints","only","gap","StyledIconContainer","width","backgroundColor","StyledPrimaryText","Typography","color","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","letterSpacing","textDecoration","textDecorationStyle","textDecorationSkipInk","textDecorationThickness","textUnderlineOffset","textUnderlinePosition","cursor","StyledSecondaryText","textAlign","StyledImageComponent","maxWidth","maxHeight","objectFit","StyledForm","allowedFileTypes","selectedImage","onImageSelect","uploadingError","allowImageLinkUpload","imageLink","onImageLinkChange","onUploadImageLink","handleImageLinkUpload","e","preventDefault","_jsx","ReactImageUploading","acceptType","onChange","value","firstImage","children","onImageUpload","dragProps","uploadErrorMessage","message","dataURL","src","_jsxs","fill","viewBox","xmlns","clipRule","d","fillOpacity","fillRule","Stack","direction","onClick","onSubmit","TextField","fullWidth","fdKey","target","placeholder","sx","overflowY"],"mappings":"2SAQA,MAAMA,EAA4BC,EAAOC,EAAPD,EAAY,EAAGE,YAAO,CACtDC,KAAM,IACNC,QAAS,OACTC,cAAe,SACfC,OAAQ,OACRC,UAAW,aACXC,WAAY,SACZC,eAAg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ACVX,EAAAA,IAAChB,EAAoB,CAAC4B,IAAKtB,EAAcqB,UAIhDE,EAAAA,KAACpE,EAAyB,IAAK+D,EAASF,SAAA,CACtCN,EAAAA,IAACrC,EAAmB,CAAA2C,SAClBO,EAAAA,KAAA,MAAA,CAAKC,KAAK,OAAO9D,OAAO,KAAK+D,QAAQ,YAAYnD,MAAM,KAAKoD,MAAM,6BAA4BV,SAAA,CAC5FN,EAAAA,IAAA,QAAA,CAAAM,SAAA,gBACAN,EAAAA,IAAA,OAAA,CACEiB,SAAS,UACTC,EAAE,uwDACFJ,KAAK,QACLK,YAAY,OACZC,SAAS,YAEXpB,MAAA,OAAA,CACEiB,SAAS,UACTC,EAAE,wWACFJ,KAAK,QACLK,YAAY,OACZC,SAAS,iBAIfP,EAAAA,KAACQ,EAAK,CAACnE,WAAW,SAASoE,UAAU,SAAS5D,IAAI,MAAME,MAAM,OAAM0C,SAAA,CAClEN,MAAClC,EAAiB,CAACyD,QAAShB,EAAaD,SAAA,oBACzCO,EAAAA,KAAC/B,EAAmB,CAACd,MAAM,sBAAqBsC,SAAA,CAAA,kBAC9Bb,GAAwB,mCAEzCA,GACCO,MAACZ,EAAU,CAAA,cAAa,kBAAkBoC,SAAU3B,EAAqBS,SACvEN,EAAAA,IAACyB,EAAS,CAACC,aAAUC,MAAM,WAAWxB,SAAWL,GAAMH,EAAkBG,EAAE8B,OAAOxB,OAAQyB,YAAY,kBAAkBzB,MAAOV,SAIrIM,EAAAA,IAAClB,EAAmB,CAACd,MAAM,sBAAqBsC,SAAA,iDAChDN,MAAClB,EAAmB,CAClBd,MAAM,yBACN8D,GAAKlF,IAAK,CACRmF,UAAW,SACX/E,OAAQ,OACR,CAACJ,EAAMY,YAAYC,KAAK,WAAY,CAClCT,OAAQ,WAEVsD,SAEDd,EAAiBiB,EAAqB"}
1
+ {"version":3,"file":"ImageDropZone.cjs.js","sources":["../../../../../src/components/organisms/ImageUploadWidget/components/ImageDropZone.tsx"],"sourcesContent":["import Box from '@mui/material/Box/Box';\nimport Stack from '@mui/material/Stack/Stack';\nimport styled from '@mui/material/styles/styled';\nimport Typography from '@mui/material/Typography/Typography';\n\nimport TextField from '@fd/components/atoms/TextField';\nimport ReactImageUploading, { type ImageListType, type ImageType } from 'react-images-uploading';\n\nconst StyledUploadAreaContainer = styled(Box)(({ theme }) => ({\n flex: '1',\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '12px',\n borderRadius: '4px',\n border: '1px solid rgba(0, 0, 0, 0.10)',\n background: '#FAFAFA',\n [theme.breakpoints.only('mobile')]: {\n justifyContent: 'center',\n gap: '32px',\n }\n}));\n\nconst StyledIconContainer = styled(Box)({\n display: 'flex',\n flexDirection: 'column',\n width: '48px',\n height: '48px',\n padding: '0px',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: '32px',\n backgroundColor: 'rgba(0, 0, 0, 0.04)',\n});\n\nconst StyledPrimaryText = styled(Typography)({\n color: 'rgba(0, 0, 0, 0.90)',\n fontFamily: 'Roboto',\n fontSize: '16px',\n fontStyle: 'normal',\n fontWeight: '600',\n lineHeight: '24px',\n letterSpacing: '0px',\n textDecoration: 'underline',\n textDecorationStyle: 'solid',\n textDecorationSkipInk: 'auto',\n textDecorationThickness: 'auto',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n cursor: 'pointer',\n});\n\nconst StyledSecondaryText = styled(Typography)({\n fontFamily: 'Roboto',\n fontSize: '14px',\n fontStyle: 'normal',\n fontWeight: 400,\n lineHeight: '20px',\n letterSpacing: '0px',\n textAlign: 'center',\n});\n\nconst StyledImageComponent = styled('img')({\n maxWidth: '100%',\n maxHeight: '100%',\n borderRadius: '4px',\n objectFit: 'cover',\n});\n\nconst StyledForm = styled('form')({\n width: '100%',\n maxWidth: '400px',\n})\n\ninterface ImageDropZoneProps {\n selectedImage: ImageType | null;\n onImageSelect: (selectedImage: ImageType) => void;\n allowImageLinkUpload: boolean;\n imageLink: string;\n onUploadImageLink?: (link: string) => void;\n onImageLinkChange?: (link: string) => void;\n uploadingError: Error | null;\n}\n\nconst allowedFileTypes = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];\n\nconst ImageDropZone: React.FC<ImageDropZoneProps> = ({\n selectedImage,\n onImageSelect,\n uploadingError,\n allowImageLinkUpload,\n imageLink,\n onImageLinkChange = (): void => {},\n onUploadImageLink = (): void => {},\n}) => {\n const handleImageSelect = (value: ImageListType): void => {\n const firstImage = value[0] as ImageType | undefined;\n if (firstImage) {\n onImageSelect(firstImage);\n }\n };\n\n const handleImageLinkUpload = (e: React.FormEvent): void => {\n e.preventDefault();\n onUploadImageLink(imageLink);\n }\n\n return (\n <ReactImageUploading acceptType={allowedFileTypes} onChange={handleImageSelect} value={selectedImage ? [selectedImage] : []}>\n {({ onImageUpload, dragProps }) => {\n const uploadErrorMessage = `Error occurred while uploading image: ${uploadingError?.message ? uploadingError.message : ''}`;\n\n if (selectedImage?.dataURL) {\n return <StyledImageComponent src={selectedImage.dataURL} />;\n }\n\n return (\n <StyledUploadAreaContainer {...dragProps}>\n <StyledIconContainer>\n <svg fill=\"none\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>Upload icon</title>\n <path\n clipRule=\"evenodd\"\n d=\"M17.8453 2.18282C16.4851 1.99996 14.7504 1.99998 12.5745 2H12.4255C10.2496 1.99998 8.51485 1.99996 7.15471 2.18282C5.75034 2.37164 4.59652 2.77175 3.68413 3.68414C2.77174 4.59653 2.37164 5.75034 2.18282 7.15471C1.99996 8.51485 1.99998 10.2496 2 12.4255V12.5745C1.99998 14.7504 1.99996 16.4851 2.18282 17.8453C2.37164 19.2497 2.77177 20.4035 3.68415 21.3159C4.59654 22.2283 5.75034 22.6284 7.15472 22.8172C8.51486 23 10.2496 23 12.4256 23H12.5744C14.7504 23 16.4851 23 17.8453 22.8172C19.2496 22.6284 20.4035 22.2282 21.3159 21.3159C22.2283 20.4035 22.6284 19.2496 22.8172 17.8453C23 16.4851 23 14.7504 23 12.5744V12.4256C23 10.2496 23 8.51486 22.8172 7.15472C22.6284 5.75034 22.2283 4.59651 21.3159 3.68412C20.4035 2.77174 19.2497 2.37164 17.8453 2.18282ZM5.09835 5.09835C5.57721 4.61949 6.23861 4.32398 7.42121 4.16499C8.63258 4.00212 10.2326 4 12.5 4C14.7674 4 16.3674 4.00212 17.5788 4.16499C18.7614 4.32399 19.4228 4.6195 19.9017 5.09836C20.3805 5.57722 20.676 6.23862 20.835 7.42121C20.9943 8.60603 20.9998 10.1626 21 12.3519C19.6026 11.7105 18.2505 11.4471 16.9403 11.5088C15.1642 11.5923 13.5635 12.2683 12.1227 13.2344C9.67205 14.8776 7.51569 17.4909 5.59833 19.8145L5.34633 20.1197C5.25795 20.0517 5.17577 19.9791 5.09836 19.9017C4.6195 19.4228 4.32399 18.7614 4.16499 17.5788C4.00212 16.3674 4 14.7674 4 12.5C4 10.2326 4.00212 8.63258 4.16499 7.42121C4.32398 6.23861 4.6195 5.5772 5.09835 5.09835ZM20.993 14.5995C19.5215 13.7462 18.2137 13.4511 17.0342 13.5065C15.7231 13.5682 14.4707 14.068 13.2366 14.8955C11.1229 16.3128 9.2346 18.5584 7.3582 20.8263L7.42121 20.835C8.63258 20.9979 10.2326 21 12.5 21C14.7674 21 16.3674 20.9979 17.5788 20.835C18.7614 20.676 19.4228 20.3805 19.9017 19.9017C20.3805 19.4228 20.676 18.7614 20.835 17.5788C20.9423 16.7808 20.9798 15.8143 20.993 14.5995Z\"\n fill=\"black\"\n fillOpacity=\"0.45\"\n fillRule=\"evenodd\"\n />\n <path\n clipRule=\"evenodd\"\n d=\"M10.5 8C10.5 6.61929 9.38071 5.5 8 5.5C7.72212 5.5 7.45482 5.54534 7.20511 5.62902C6.21409 5.96113 5.5 6.89717 5.5 8C5.5 8.84194 5.91619 9.58667 6.55407 10.0397C6.96226 10.3296 7.46123 10.5 8 10.5C9.38071 10.5 10.5 9.38071 10.5 8ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5Z\"\n fill=\"black\"\n fillOpacity=\"0.45\"\n fillRule=\"evenodd\"\n />\n </svg>\n </StyledIconContainer>\n <Stack alignItems=\"center\" direction=\"column\" gap=\"8px\" width=\"100%\">\n <StyledPrimaryText onClick={onImageUpload}>Select an image</StyledPrimaryText>\n <StyledSecondaryText color=\"rgba(0, 0, 0, 0.90)\">\n OR drop it here{allowImageLinkUpload && ' OR paste the image URL below'}\n </StyledSecondaryText>\n {allowImageLinkUpload &&\n <StyledForm data-testid='image-link-form' onSubmit={handleImageLinkUpload}>\n <TextField fullWidth fdKey='img-link' onChange={(e) => onImageLinkChange(e.target.value)} placeholder=\"Enter image URL\" value={imageLink} />\n </StyledForm>\n }\n </Stack>\n <StyledSecondaryText color=\"rgba(0, 0, 0, 0.60)\">Minimum dimensions: 1280 × 720 - up to 10 MB</StyledSecondaryText>\n <StyledSecondaryText\n color=\"rgba(184, 0, 34, 0.80)\"\n sx={(theme) => ({\n overflowY: 'scroll',\n height: '30px',\n [theme.breakpoints.only('mobile')]: {\n height: '120px'\n }\n })}\n >\n {uploadingError ? uploadErrorMessage : ''}\n </StyledSecondaryText>\n </StyledUploadAreaContainer>\n );\n }}\n </ReactImageUploading>\n );\n};\n\nexport default ImageDropZone;\n"],"names":["StyledUploadAreaContainer","styled","Box","theme","flex","display","flexDirection","height","boxSizing","alignItems","justifyContent","padding","borderRadius","border","background","breakpoints","only","gap","StyledIconContainer","width","backgroundColor","StyledPrimaryText","Typography","color","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","letterSpacing","textDecoration","textDecorationStyle","textDecorationSkipInk","textDecorationThickness","textUnderlineOffset","textUnderlinePosition","cursor","StyledSecondaryText","textAlign","StyledImageComponent","maxWidth","maxHeight","objectFit","StyledForm","allowedFileTypes","selectedImage","onImageSelect","uploadingError","allowImageLinkUpload","imageLink","onImageLinkChange","onUploadImageLink","handleImageLinkUpload","e","preventDefault","_jsx","ReactImageUploading","acceptType","onChange","value","firstImage","children","onImageUpload","dragProps","uploadErrorMessage","message","dataURL","src","_jsxs","fill","viewBox","xmlns","clipRule","d","fillOpacity","fillRule","Stack","direction","onClick","onSubmit","TextField","fullWidth","fdKey","target","placeholder","sx","overflowY"],"mappings":"2SAQA,MAAMA,EAA4BC,EAAOC,EAAPD,EAAY,EAAGE,YAAO,CACtDC,KAAM,IACNC,QAAS,OACTC,cAAe,SACfC,OAAQ,OACRC,UAAW,aACXC,WAAY,SACZC,eAAgB,gBAChBC,QAAS,OACTC,aAAc,MACdC,OAAQ,gCACRC,WAAY,UACZ,CAACX,EAAMY,YAAYC,KAAK,WAAY,CAClCN,eAAgB,SAChBO,IAAK,YAIHC,EAAsBjB,EAAOC,EAAPD,CAAY,CACtCI,QAAS,OACTC,cAAe,SACfa,MAAO,OACPZ,OAAQ,OACRI,QAAS,MACTD,eAAgB,SAChBD,WAAY,SACZG,aAAc,OACdQ,gBAAiB,wBAGbC,EAAoBpB,EAAOqB,EAAPrB,CAAmB,CAC3CsB,MAAO,sBACPC,WAAY,SACZC,SAAU,OACVC,UAAW,SACXC,WAAY,MACZC,WAAY,OACZC,cAAe,MACfC,eAAgB,YAChBC,oBAAqB,QACrBC,sBAAuB,OACvBC,wBAAyB,OACzBC,oBAAqB,MACrBC,sBAAuB,YACvBC,OAAQ,YAGJC,EAAsBpC,EAAOqB,EAAPrB,CAAmB,CAC7CuB,WAAY,SACZC,SAAU,OACVC,UAAW,SACXC,WAAY,IACZC,WAAY,OACZC,cAAe,MACfS,UAAW,WAGPC,EAAuBtC,EAAO,MAAPA,CAAc,CACzCuC,SAAU,OACVC,UAAW,OACX7B,aAAc,MACd8B,UAAW,UAGPC,EAAa1C,EAAO,OAAPA,CAAe,CAChCkB,MAAO,OACPqB,SAAU,UAaNI,EAAmB,CAAC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M,WAAWxB,SAAWL,GAAMH,EAAkBG,EAAE8B,OAAOxB,OAAQyB,YAAY,kBAAkBzB,MAAOV,SAIrIM,EAAAA,IAAClB,EAAmB,CAACd,MAAM,sBAAqBsC,SAAA,iDAChDN,MAAClB,EAAmB,CAClBd,MAAM,yBACN8D,GAAKlF,IAAK,CACRmF,UAAW,SACX/E,OAAQ,OACR,CAACJ,EAAMY,YAAYC,KAAK,WAAY,CAClCT,OAAQ,WAEVsD,SAEDd,EAAiBiB,EAAqB"}
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import i from"@mui/material/Box/Box";import o from"@mui/material/Stack/Stack";import n from"@mui/material/styles/styled";import r from"@mui/material/Typography/Typography";import l from"../../../atoms/TextField/index.js";import a from"react-images-uploading";const d=n(i)((({theme:e})=>({flex:"1",display:"flex",flexDirection:"column",height:"100%",boxSizing:"border-box",alignItems:"center",justifyContent:"space-between",padding:"12px",borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.10)",background:"#FAFAFA",[e.breakpoints.only("mobile")]:{justifyContent:"center",gap:"32px"}}))),p=n(i)({display:"flex",flexDirection:"column",width:"48px",height:"48px",padding:"0px",justifyContent:"center",alignItems:"center",borderRadius:"32px",backgroundColor:"rgba(0, 0, 0, 0.04)"}),c=n(r)({color:"rgba(0, 0, 0, 0.90)",fontFamily:"Roboto",fontSize:"16px",fontStyle:"normal",fontWeight:"600",lineHeight:"24px",letterSpacing:"0px",textDecoration:"underline",textDecorationStyle:"solid",textDecorationSkipInk:"auto",textDecorationThickness:"auto",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",cursor:"pointer"}),m=n(r)({fontFamily:"Roboto",fontSize:"14px",fontStyle:"normal",fontWeight:400,lineHeight:"20px",letterSpacing:"0px",textAlign:"center"}),g=n("img")({maxWidth:"100%",maxHeight:"100%",borderRadius:"4px",objectFit:"cover"}),C=n("form")({width:"100%",maxWidth:"400px"}),s=["jpg","jpeg","png","gif","bmp"],h=({selectedImage:i,onImageSelect:n,uploadingError:r,allowImageLinkUpload:h,imageLink:x,onImageLinkChange:f=()=>{},onUploadImageLink:u=()=>{}})=>{const b=e=>{e.preventDefault(),u(x)};return e(a,{acceptType:s,onChange:e=>{const t=e[0];t&&n(t)},value:i?[i]:[],children:({onImageUpload:n,dragProps:a})=>{const s=`Error occurred while uploading image: ${r?.message?r.message:""}`;return i?.dataURL?e(g,{src:i.dataURL}):t(d,{...a,children:[e(p,{children:t("svg",{fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[e("title",{children:"Upload icon"}),e("path",{clipRule:"evenodd",d:"M17.8453 2.18282C16.4851 1.99996 14.7504 1.99998 12.5745 2H12.4255C10.2496 1.99998 8.51485 1.99996 7.15471 2.18282C5.75034 2.37164 4.59652 2.77175 3.68413 3.68414C2.77174 4.59653 2.37164 5.75034 2.18282 7.15471C1.99996 8.51485 1.99998 10.2496 2 12.4255V12.5745C1.99998 14.7504 1.99996 16.4851 2.18282 17.8453C2.37164 19.2497 2.77177 20.4035 3.68415 21.3159C4.59654 22.2283 5.75034 22.6284 7.15472 22.8172C8.51486 23 10.2496 23 12.4256 23H12.5744C14.7504 23 16.4851 23 17.8453 22.8172C19.2496 22.6284 20.4035 22.2282 21.3159 21.3159C22.2283 20.4035 22.6284 19.2496 22.8172 17.8453C23 16.4851 23 14.7504 23 12.5744V12.4256C23 10.2496 23 8.51486 22.8172 7.15472C22.6284 5.75034 22.2283 4.59651 21.3159 3.68412C20.4035 2.77174 19.2497 2.37164 17.8453 2.18282ZM5.09835 5.09835C5.57721 4.61949 6.23861 4.32398 7.42121 4.16499C8.63258 4.00212 10.2326 4 12.5 4C14.7674 4 16.3674 4.00212 17.5788 4.16499C18.7614 4.32399 19.4228 4.6195 19.9017 5.09836C20.3805 5.57722 20.676 6.23862 20.835 7.42121C20.9943 8.60603 20.9998 10.1626 21 12.3519C19.6026 11.7105 18.2505 11.4471 16.9403 11.5088C15.1642 11.5923 13.5635 12.2683 12.1227 13.2344C9.67205 14.8776 7.51569 17.4909 5.59833 19.8145L5.34633 20.1197C5.25795 20.0517 5.17577 19.9791 5.09836 19.9017C4.6195 19.4228 4.32399 18.7614 4.16499 17.5788C4.00212 16.3674 4 14.7674 4 12.5C4 10.2326 4.00212 8.63258 4.16499 7.42121C4.32398 6.23861 4.6195 5.5772 5.09835 5.09835ZM20.993 14.5995C19.5215 13.7462 18.2137 13.4511 17.0342 13.5065C15.7231 13.5682 14.4707 14.068 13.2366 14.8955C11.1229 16.3128 9.2346 18.5584 7.3582 20.8263L7.42121 20.835C8.63258 20.9979 10.2326 21 12.5 21C14.7674 21 16.3674 20.9979 17.5788 20.835C18.7614 20.676 19.4228 20.3805 19.9017 19.9017C20.3805 19.4228 20.676 18.7614 20.835 17.5788C20.9423 16.7808 20.9798 15.8143 20.993 14.5995Z",fill:"black",fillOpacity:"0.45",fillRule:"evenodd"}),e("path",{clipRule:"evenodd",d:"M10.5 8C10.5 6.61929 9.38071 5.5 8 5.5C7.72212 5.5 7.45482 5.54534 7.20511 5.62902C6.21409 5.96113 5.5 6.89717 5.5 8C5.5 8.84194 5.91619 9.58667 6.55407 10.0397C6.96226 10.3296 7.46123 10.5 8 10.5C9.38071 10.5 10.5 9.38071 10.5 8ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5Z",fill:"black",fillOpacity:"0.45",fillRule:"evenodd"})]})}),t(o,{alignItems:"center",direction:"column",gap:"8px",width:"100%",children:[e(c,{onClick:n,children:"Select an image"}),t(m,{color:"rgba(0, 0, 0, 0.90)",children:["OR drop it here",h&&" OR paste the image URL below"]}),h&&e(C,{"data-testid":"image-link-form",onSubmit:b,children:e(l,{fullWidth:!0,fdKey:"img-link",onChange:e=>f(e.target.value),placeholder:"Enter image URL",value:x})})]}),e(m,{color:"rgba(0, 0, 0, 0.60)",children:"Minimum dimensions: 1280 × 720 - up to 10 MB"}),e(m,{color:"rgba(184, 0, 34, 0.80)",sx:e=>({overflowY:"scroll",height:"30px",[e.breakpoints.only("mobile")]:{height:"120px"}}),children:r?s:""})]})}})};export{h as default};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import i from"@mui/material/Box/Box";import o from"@mui/material/Stack/Stack";import n from"@mui/material/styles/styled";import r from"@mui/material/Typography/Typography";import{TextField as l}from"../../../atoms/TextField/index.js";import a from"react-images-uploading";const d=n(i)((({theme:e})=>({flex:"1",display:"flex",flexDirection:"column",height:"100%",boxSizing:"border-box",alignItems:"center",justifyContent:"space-between",padding:"12px",borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.10)",background:"#FAFAFA",[e.breakpoints.only("mobile")]:{justifyContent:"center",gap:"32px"}}))),p=n(i)({display:"flex",flexDirection:"column",width:"48px",height:"48px",padding:"0px",justifyContent:"center",alignItems:"center",borderRadius:"32px",backgroundColor:"rgba(0, 0, 0, 0.04)"}),c=n(r)({color:"rgba(0, 0, 0, 0.90)",fontFamily:"Roboto",fontSize:"16px",fontStyle:"normal",fontWeight:"600",lineHeight:"24px",letterSpacing:"0px",textDecoration:"underline",textDecorationStyle:"solid",textDecorationSkipInk:"auto",textDecorationThickness:"auto",textUnderlineOffset:"25%",textUnderlinePosition:"from-font",cursor:"pointer"}),m=n(r)({fontFamily:"Roboto",fontSize:"14px",fontStyle:"normal",fontWeight:400,lineHeight:"20px",letterSpacing:"0px",textAlign:"center"}),g=n("img")({maxWidth:"100%",maxHeight:"100%",borderRadius:"4px",objectFit:"cover"}),C=n("form")({width:"100%",maxWidth:"400px"}),s=["jpg","jpeg","png","gif","bmp"],h=({selectedImage:i,onImageSelect:n,uploadingError:r,allowImageLinkUpload:h,imageLink:x,onImageLinkChange:f=()=>{},onUploadImageLink:u=()=>{}})=>{const b=e=>{e.preventDefault(),u(x)};return e(a,{acceptType:s,onChange:e=>{const t=e[0];t&&n(t)},value:i?[i]:[],children:({onImageUpload:n,dragProps:a})=>{const s=`Error occurred while uploading image: ${r?.message?r.message:""}`;return i?.dataURL?e(g,{src:i.dataURL}):t(d,{...a,children:[e(p,{children:t("svg",{fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[e("title",{children:"Upload icon"}),e("path",{clipRule:"evenodd",d:"M17.8453 2.18282C16.4851 1.99996 14.7504 1.99998 12.5745 2H12.4255C10.2496 1.99998 8.51485 1.99996 7.15471 2.18282C5.75034 2.37164 4.59652 2.77175 3.68413 3.68414C2.77174 4.59653 2.37164 5.75034 2.18282 7.15471C1.99996 8.51485 1.99998 10.2496 2 12.4255V12.5745C1.99998 14.7504 1.99996 16.4851 2.18282 17.8453C2.37164 19.2497 2.77177 20.4035 3.68415 21.3159C4.59654 22.2283 5.75034 22.6284 7.15472 22.8172C8.51486 23 10.2496 23 12.4256 23H12.5744C14.7504 23 16.4851 23 17.8453 22.8172C19.2496 22.6284 20.4035 22.2282 21.3159 21.3159C22.2283 20.4035 22.6284 19.2496 22.8172 17.8453C23 16.4851 23 14.7504 23 12.5744V12.4256C23 10.2496 23 8.51486 22.8172 7.15472C22.6284 5.75034 22.2283 4.59651 21.3159 3.68412C20.4035 2.77174 19.2497 2.37164 17.8453 2.18282ZM5.09835 5.09835C5.57721 4.61949 6.23861 4.32398 7.42121 4.16499C8.63258 4.00212 10.2326 4 12.5 4C14.7674 4 16.3674 4.00212 17.5788 4.16499C18.7614 4.32399 19.4228 4.6195 19.9017 5.09836C20.3805 5.57722 20.676 6.23862 20.835 7.42121C20.9943 8.60603 20.9998 10.1626 21 12.3519C19.6026 11.7105 18.2505 11.4471 16.9403 11.5088C15.1642 11.5923 13.5635 12.2683 12.1227 13.2344C9.67205 14.8776 7.51569 17.4909 5.59833 19.8145L5.34633 20.1197C5.25795 20.0517 5.17577 19.9791 5.09836 19.9017C4.6195 19.4228 4.32399 18.7614 4.16499 17.5788C4.00212 16.3674 4 14.7674 4 12.5C4 10.2326 4.00212 8.63258 4.16499 7.42121C4.32398 6.23861 4.6195 5.5772 5.09835 5.09835ZM20.993 14.5995C19.5215 13.7462 18.2137 13.4511 17.0342 13.5065C15.7231 13.5682 14.4707 14.068 13.2366 14.8955C11.1229 16.3128 9.2346 18.5584 7.3582 20.8263L7.42121 20.835C8.63258 20.9979 10.2326 21 12.5 21C14.7674 21 16.3674 20.9979 17.5788 20.835C18.7614 20.676 19.4228 20.3805 19.9017 19.9017C20.3805 19.4228 20.676 18.7614 20.835 17.5788C20.9423 16.7808 20.9798 15.8143 20.993 14.5995Z",fill:"black",fillOpacity:"0.45",fillRule:"evenodd"}),e("path",{clipRule:"evenodd",d:"M10.5 8C10.5 6.61929 9.38071 5.5 8 5.5C7.72212 5.5 7.45482 5.54534 7.20511 5.62902C6.21409 5.96113 5.5 6.89717 5.5 8C5.5 8.84194 5.91619 9.58667 6.55407 10.0397C6.96226 10.3296 7.46123 10.5 8 10.5C9.38071 10.5 10.5 9.38071 10.5 8ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5Z",fill:"black",fillOpacity:"0.45",fillRule:"evenodd"})]})}),t(o,{alignItems:"center",direction:"column",gap:"8px",width:"100%",children:[e(c,{onClick:n,children:"Select an image"}),t(m,{color:"rgba(0, 0, 0, 0.90)",children:["OR drop it here",h&&" OR paste the image URL below"]}),h&&e(C,{"data-testid":"image-link-form",onSubmit:b,children:e(l,{fullWidth:!0,fdKey:"img-link",onChange:e=>f(e.target.value),placeholder:"Enter image URL",value:x})})]}),e(m,{color:"rgba(0, 0, 0, 0.60)",children:"Minimum dimensions: 1280 × 720 - up to 10 MB"}),e(m,{color:"rgba(184, 0, 34, 0.80)",sx:e=>({overflowY:"scroll",height:"30px",[e.breakpoints.only("mobile")]:{height:"120px"}}),children:r?s:""})]})}})};export{h as default};
2
2
  //# sourceMappingURL=ImageDropZone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageDropZone.js","sources":["../../../../../src/components/organisms/ImageUploadWidget/components/ImageDropZone.tsx"],"sourcesContent":["import Box from '@mui/material/Box/Box';\nimport Stack from '@mui/material/Stack/Stack';\nimport styled from '@mui/material/styles/styled';\nimport Typography from '@mui/material/Typography/Typography';\n\nimport TextField from '@fd/components/atoms/TextField';\nimport ReactImageUploading, { type ImageListType, type ImageType } from 'react-images-uploading';\n\nconst StyledUploadAreaContainer = styled(Box)(({ theme }) => ({\n flex: '1',\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '12px',\n borderRadius: '4px',\n border: '1px solid rgba(0, 0, 0, 0.10)',\n background: '#FAFAFA',\n [theme.breakpoints.only('mobile')]: {\n justifyContent: 'center',\n gap: '32px',\n }\n}));\n\nconst StyledIconContainer = styled(Box)({\n display: 'flex',\n flexDirection: 'column',\n width: '48px',\n height: '48px',\n padding: '0px',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: '32px',\n backgroundColor: 'rgba(0, 0, 0, 0.04)',\n});\n\nconst StyledPrimaryText = styled(Typography)({\n color: 'rgba(0, 0, 0, 0.90)',\n fontFamily: 'Roboto',\n fontSize: '16px',\n fontStyle: 'normal',\n fontWeight: '600',\n lineHeight: '24px',\n letterSpacing: '0px',\n textDecoration: 'underline',\n textDecorationStyle: 'solid',\n textDecorationSkipInk: 'auto',\n textDecorationThickness: 'auto',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n cursor: 'pointer',\n});\n\nconst StyledSecondaryText = styled(Typography)({\n fontFamily: 'Roboto',\n fontSize: '14px',\n fontStyle: 'normal',\n fontWeight: 400,\n lineHeight: '20px',\n letterSpacing: '0px',\n textAlign: 'center',\n});\n\nconst StyledImageComponent = styled('img')({\n maxWidth: '100%',\n maxHeight: '100%',\n borderRadius: '4px',\n objectFit: 'cover',\n});\n\nconst StyledForm = styled('form')({\n width: '100%',\n maxWidth: '400px',\n})\n\ninterface ImageDropZoneProps {\n selectedImage: ImageType | null;\n onImageSelect: (selectedImage: ImageType) => void;\n allowImageLinkUpload: boolean;\n imageLink: string;\n onUploadImageLink?: (link: string) => void;\n onImageLinkChange?: (link: string) => void;\n uploadingError: Error | null;\n}\n\nconst allowedFileTypes = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];\n\nconst ImageDropZone: React.FC<ImageDropZoneProps> = ({\n selectedImage,\n onImageSelect,\n uploadingError,\n allowImageLinkUpload,\n imageLink,\n onImageLinkChange = (): void => {},\n onUploadImageLink = (): void => {},\n}) => {\n const handleImageSelect = (value: ImageListType): void => {\n const firstImage = value[0] as ImageType | undefined;\n if (firstImage) {\n onImageSelect(firstImage);\n }\n };\n\n const handleImageLinkUpload = (e: React.FormEvent): void => {\n e.preventDefault();\n onUploadImageLink(imageLink);\n }\n\n return (\n <ReactImageUploading acceptType={allowedFileTypes} onChange={handleImageSelect} value={selectedImage ? [selectedImage] : []}>\n {({ onImageUpload, dragProps }) => {\n const uploadErrorMessage = `Error occurred while uploading image: ${uploadingError?.message ? uploadingError.message : ''}`;\n\n if (selectedImage?.dataURL) {\n return <StyledImageComponent src={selectedImage.dataURL} />;\n }\n\n return (\n <StyledUploadAreaContainer {...dragProps}>\n <StyledIconContainer>\n <svg fill=\"none\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>Upload icon</title>\n <path\n clipRule=\"evenodd\"\n d=\"M17.8453 2.18282C16.4851 1.99996 14.7504 1.99998 12.5745 2H12.4255C10.2496 1.99998 8.51485 1.99996 7.15471 2.18282C5.75034 2.37164 4.59652 2.77175 3.68413 3.68414C2.77174 4.59653 2.37164 5.75034 2.18282 7.15471C1.99996 8.51485 1.99998 10.2496 2 12.4255V12.5745C1.99998 14.7504 1.99996 16.4851 2.18282 17.8453C2.37164 19.2497 2.77177 20.4035 3.68415 21.3159C4.59654 22.2283 5.75034 22.6284 7.15472 22.8172C8.51486 23 10.2496 23 12.4256 23H12.5744C14.7504 23 16.4851 23 17.8453 22.8172C19.2496 22.6284 20.4035 22.2282 21.3159 21.3159C22.2283 20.4035 22.6284 19.2496 22.8172 17.8453C23 16.4851 23 14.7504 23 12.5744V12.4256C23 10.2496 23 8.51486 22.8172 7.15472C22.6284 5.75034 22.2283 4.59651 21.3159 3.68412C20.4035 2.77174 19.2497 2.37164 17.8453 2.18282ZM5.09835 5.09835C5.57721 4.61949 6.23861 4.32398 7.42121 4.16499C8.63258 4.00212 10.2326 4 12.5 4C14.7674 4 16.3674 4.00212 17.5788 4.16499C18.7614 4.32399 19.4228 4.6195 19.9017 5.09836C20.3805 5.57722 20.676 6.23862 20.835 7.42121C20.9943 8.60603 20.9998 10.1626 21 12.3519C19.6026 11.7105 18.2505 11.4471 16.9403 11.5088C15.1642 11.5923 13.5635 12.2683 12.1227 13.2344C9.67205 14.8776 7.51569 17.4909 5.59833 19.8145L5.34633 20.1197C5.25795 20.0517 5.17577 19.9791 5.09836 19.9017C4.6195 19.4228 4.32399 18.7614 4.16499 17.5788C4.00212 16.3674 4 14.7674 4 12.5C4 10.2326 4.00212 8.63258 4.16499 7.42121C4.32398 6.23861 4.6195 5.5772 5.09835 5.09835ZM20.993 14.5995C19.5215 13.7462 18.2137 13.4511 17.0342 13.5065C15.7231 13.5682 14.4707 14.068 13.2366 14.8955C11.1229 16.3128 9.2346 18.5584 7.3582 20.8263L7.42121 20.835C8.63258 20.9979 10.2326 21 12.5 21C14.7674 21 16.3674 20.9979 17.5788 20.835C18.7614 20.676 19.4228 20.3805 19.9017 19.9017C20.3805 19.4228 20.676 18.7614 20.835 17.5788C20.9423 16.7808 20.9798 15.8143 20.993 14.5995Z\"\n fill=\"black\"\n fillOpacity=\"0.45\"\n fillRule=\"evenodd\"\n />\n <path\n clipRule=\"evenodd\"\n d=\"M10.5 8C10.5 6.61929 9.38071 5.5 8 5.5C7.72212 5.5 7.45482 5.54534 7.20511 5.62902C6.21409 5.96113 5.5 6.89717 5.5 8C5.5 8.84194 5.91619 9.58667 6.55407 10.0397C6.96226 10.3296 7.46123 10.5 8 10.5C9.38071 10.5 10.5 9.38071 10.5 8ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5Z\"\n fill=\"black\"\n fillOpacity=\"0.45\"\n fillRule=\"evenodd\"\n />\n </svg>\n </StyledIconContainer>\n <Stack alignItems=\"center\" direction=\"column\" gap=\"8px\" width=\"100%\">\n <StyledPrimaryText onClick={onImageUpload}>Select an image</StyledPrimaryText>\n <StyledSecondaryText color=\"rgba(0, 0, 0, 0.90)\">\n OR drop it here{allowImageLinkUpload && ' OR paste the image URL below'}\n </StyledSecondaryText>\n {allowImageLinkUpload &&\n <StyledForm data-testid='image-link-form' onSubmit={handleImageLinkUpload}>\n <TextField fullWidth fdKey='img-link' onChange={(e) => onImageLinkChange(e.target.value)} placeholder=\"Enter image URL\" value={imageLink} />\n </StyledForm>\n }\n </Stack>\n <StyledSecondaryText color=\"rgba(0, 0, 0, 0.60)\">Minimum dimensions: 1280 × 720 - up to 10 MB</StyledSecondaryText>\n <StyledSecondaryText\n color=\"rgba(184, 0, 34, 0.80)\"\n sx={(theme) => ({\n overflowY: 'scroll',\n height: '30px',\n [theme.breakpoints.only('mobile')]: {\n height: '120px'\n }\n })}\n >\n {uploadingError ? uploadErrorMessage : ''}\n </StyledSecondaryText>\n </StyledUploadAreaContainer>\n );\n }}\n </ReactImageUploading>\n );\n};\n\nexport default ImageDropZone;\n"],"names":["StyledUploadAreaContainer","styled","Box","theme","flex","display","flexDirection","height","boxSizing","alignItems","justifyContent","padding","borderRadius","border","background","breakpoints","only","gap","StyledIconContainer","width","backgroundColor","StyledPrimaryText","Typography","color","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","letterSpacing","textDecoration","textDecorationStyle","textDecorationSkipInk","textDecorationThickness","textUnderlineOffset","textUnderlinePosition","cursor","StyledSecondaryText","textAlign","StyledImageComponent","maxWidth","maxHeight","objectFit","StyledForm","allowedFileTypes","ImageDropZone","selectedImage","onImageSelect","uploadingError","allowImageLinkUpload","imageLink","onImageLinkChange","onUploadImageLink","handleImageLinkUpload","e","preventDefault","_jsx","ReactImageUploading","acceptType","onChange","value","firstImage","children","onImageUpload","dragProps","uploadErrorMessage","message","dataURL","src","_jsxs","fill","viewBox","xmlns","clipRule","d","fillOpacity","fillRule","Stack","direction","onClick","onSubmit","TextField","fullWidth","fdKey","target","placeholder","sx","overflowY"],"mappings":"qTAQA,MAAMA,EAA4BC,EAAOC,EAAPD,EAAY,EAAGE,YAAO,CACtDC,KAAM,IACNC,QAAS,OACTC,cAAe,SACfC,OAAQ,OACRC,UAAW,aACXC,WAAY,SACZC,eAAgB,gBAChBC,QAAS,OACTC,aAAc,MACdC,OAAQ,gCACRC,WAAY,UACZ,CAACX,EAAMY,YAAYC,KAAK,WAAY,CAClCN,eAAgB,SAChBO,IAAK,YAIHC,EAAsBjB,EAAOC,EAAPD,CAAY,CACtCI,QAAS,OACTC,cAAe,SACfa,MAAO,OACPZ,OAAQ,OACRI,QAAS,MACTD,eAAgB,SAChBD,WAAY,SACZG,aAAc,OACdQ,gBAAiB,wBAGbC,EAAoBpB,EAAOqB,EAAPrB,CAAmB,CAC3CsB,MAAO,sBACPC,WAAY,SACZC,SAAU,OACVC,UAAW,SACXC,WAAY,MACZC,WAAY,OACZC,cAAe,MACfC,eAAgB,YAChBC,oBAAqB,QACrBC,sBAAuB,OACvBC,wBAAyB,OACzBC,oBAAqB,MACrBC,sBAAuB,YACvBC,OAAQ,YAGJC,EAAsBpC,EAAOqB,EAAPrB,CAAmB,CAC7CuB,WAAY,SACZC,SAAU,OACVC,UAAW,SACXC,WAAY,IACZC,WAAY,OACZC,cAAe,MACfS,UAAW,WAGPC,EAAuBtC,EAAO,M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AAU,CAAA,cAAa,kBAAkBqC,SAAU3B,EAAqBS,SACvEN,EAACyB,EAAS,CAACC,aAAUC,MAAM,WAAWxB,SAAWL,GAAMH,EAAkBG,EAAE8B,OAAOxB,OAAQyB,YAAY,kBAAkBzB,MAAOV,SAIrIM,EAACnB,EAAmB,CAACd,MAAM,sBAAqBuC,SAAA,iDAChDN,EAACnB,EAAmB,CAClBd,MAAM,yBACN+D,GAAKnF,IAAK,CACRoF,UAAW,SACXhF,OAAQ,OACR,CAACJ,EAAMY,YAAYC,KAAK,WAAY,CAClCT,OAAQ,WAEVuD,SAEDd,EAAiBiB,EAAqB"}
1
+ {"version":3,"file":"ImageDropZone.js","sources":["../../../../../src/components/organisms/ImageUploadWidget/components/ImageDropZone.tsx"],"sourcesContent":["import Box from '@mui/material/Box/Box';\nimport Stack from '@mui/material/Stack/Stack';\nimport styled from '@mui/material/styles/styled';\nimport Typography from '@mui/material/Typography/Typography';\n\nimport TextField from '@fd/components/atoms/TextField';\nimport ReactImageUploading, { type ImageListType, type ImageType } from 'react-images-uploading';\n\nconst StyledUploadAreaContainer = styled(Box)(({ theme }) => ({\n flex: '1',\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '12px',\n borderRadius: '4px',\n border: '1px solid rgba(0, 0, 0, 0.10)',\n background: '#FAFAFA',\n [theme.breakpoints.only('mobile')]: {\n justifyContent: 'center',\n gap: '32px',\n }\n}));\n\nconst StyledIconContainer = styled(Box)({\n display: 'flex',\n flexDirection: 'column',\n width: '48px',\n height: '48px',\n padding: '0px',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: '32px',\n backgroundColor: 'rgba(0, 0, 0, 0.04)',\n});\n\nconst StyledPrimaryText = styled(Typography)({\n color: 'rgba(0, 0, 0, 0.90)',\n fontFamily: 'Roboto',\n fontSize: '16px',\n fontStyle: 'normal',\n fontWeight: '600',\n lineHeight: '24px',\n letterSpacing: '0px',\n textDecoration: 'underline',\n textDecorationStyle: 'solid',\n textDecorationSkipInk: 'auto',\n textDecorationThickness: 'auto',\n textUnderlineOffset: '25%',\n textUnderlinePosition: 'from-font',\n cursor: 'pointer',\n});\n\nconst StyledSecondaryText = styled(Typography)({\n fontFamily: 'Roboto',\n fontSize: '14px',\n fontStyle: 'normal',\n fontWeight: 400,\n lineHeight: '20px',\n letterSpacing: '0px',\n textAlign: 'center',\n});\n\nconst StyledImageComponent = styled('img')({\n maxWidth: '100%',\n maxHeight: '100%',\n borderRadius: '4px',\n objectFit: 'cover',\n});\n\nconst StyledForm = styled('form')({\n width: '100%',\n maxWidth: '400px',\n})\n\ninterface ImageDropZoneProps {\n selectedImage: ImageType | null;\n onImageSelect: (selectedImage: ImageType) => void;\n allowImageLinkUpload: boolean;\n imageLink: string;\n onUploadImageLink?: (link: string) => void;\n onImageLinkChange?: (link: string) => void;\n uploadingError: Error | null;\n}\n\nconst allowedFileTypes = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];\n\nconst ImageDropZone: React.FC<ImageDropZoneProps> = ({\n selectedImage,\n onImageSelect,\n uploadingError,\n allowImageLinkUpload,\n imageLink,\n onImageLinkChange = (): void => {},\n onUploadImageLink = (): void => {},\n}) => {\n const handleImageSelect = (value: ImageListType): void => {\n const firstImage = value[0] as ImageType | undefined;\n if (firstImage) {\n onImageSelect(firstImage);\n }\n };\n\n const handleImageLinkUpload = (e: React.FormEvent): void => {\n e.preventDefault();\n onUploadImageLink(imageLink);\n }\n\n return (\n <ReactImageUploading acceptType={allowedFileTypes} onChange={handleImageSelect} value={selectedImage ? [selectedImage] : []}>\n {({ onImageUpload, dragProps }) => {\n const uploadErrorMessage = `Error occurred while uploading image: ${uploadingError?.message ? uploadingError.message : ''}`;\n\n if (selectedImage?.dataURL) {\n return <StyledImageComponent src={selectedImage.dataURL} />;\n }\n\n return (\n <StyledUploadAreaContainer {...dragProps}>\n <StyledIconContainer>\n <svg fill=\"none\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>Upload icon</title>\n <path\n clipRule=\"evenodd\"\n d=\"M17.8453 2.18282C16.4851 1.99996 14.7504 1.99998 12.5745 2H12.4255C10.2496 1.99998 8.51485 1.99996 7.15471 2.18282C5.75034 2.37164 4.59652 2.77175 3.68413 3.68414C2.77174 4.59653 2.37164 5.75034 2.18282 7.15471C1.99996 8.51485 1.99998 10.2496 2 12.4255V12.5745C1.99998 14.7504 1.99996 16.4851 2.18282 17.8453C2.37164 19.2497 2.77177 20.4035 3.68415 21.3159C4.59654 22.2283 5.75034 22.6284 7.15472 22.8172C8.51486 23 10.2496 23 12.4256 23H12.5744C14.7504 23 16.4851 23 17.8453 22.8172C19.2496 22.6284 20.4035 22.2282 21.3159 21.3159C22.2283 20.4035 22.6284 19.2496 22.8172 17.8453C23 16.4851 23 14.7504 23 12.5744V12.4256C23 10.2496 23 8.51486 22.8172 7.15472C22.6284 5.75034 22.2283 4.59651 21.3159 3.68412C20.4035 2.77174 19.2497 2.37164 17.8453 2.18282ZM5.09835 5.09835C5.57721 4.61949 6.23861 4.32398 7.42121 4.16499C8.63258 4.00212 10.2326 4 12.5 4C14.7674 4 16.3674 4.00212 17.5788 4.16499C18.7614 4.32399 19.4228 4.6195 19.9017 5.09836C20.3805 5.57722 20.676 6.23862 20.835 7.42121C20.9943 8.60603 20.9998 10.1626 21 12.3519C19.6026 11.7105 18.2505 11.4471 16.9403 11.5088C15.1642 11.5923 13.5635 12.2683 12.1227 13.2344C9.67205 14.8776 7.51569 17.4909 5.59833 19.8145L5.34633 20.1197C5.25795 20.0517 5.17577 19.9791 5.09836 19.9017C4.6195 19.4228 4.32399 18.7614 4.16499 17.5788C4.00212 16.3674 4 14.7674 4 12.5C4 10.2326 4.00212 8.63258 4.16499 7.42121C4.32398 6.23861 4.6195 5.5772 5.09835 5.09835ZM20.993 14.5995C19.5215 13.7462 18.2137 13.4511 17.0342 13.5065C15.7231 13.5682 14.4707 14.068 13.2366 14.8955C11.1229 16.3128 9.2346 18.5584 7.3582 20.8263L7.42121 20.835C8.63258 20.9979 10.2326 21 12.5 21C14.7674 21 16.3674 20.9979 17.5788 20.835C18.7614 20.676 19.4228 20.3805 19.9017 19.9017C20.3805 19.4228 20.676 18.7614 20.835 17.5788C20.9423 16.7808 20.9798 15.8143 20.993 14.5995Z\"\n fill=\"black\"\n fillOpacity=\"0.45\"\n fillRule=\"evenodd\"\n />\n <path\n clipRule=\"evenodd\"\n d=\"M10.5 8C10.5 6.61929 9.38071 5.5 8 5.5C7.72212 5.5 7.45482 5.54534 7.20511 5.62902C6.21409 5.96113 5.5 6.89717 5.5 8C5.5 8.84194 5.91619 9.58667 6.55407 10.0397C6.96226 10.3296 7.46123 10.5 8 10.5C9.38071 10.5 10.5 9.38071 10.5 8ZM8 7.5C7.72386 7.5 7.5 7.72386 7.5 8C7.5 8.27614 7.72386 8.5 8 8.5C8.27614 8.5 8.5 8.27614 8.5 8C8.5 7.72386 8.27614 7.5 8 7.5Z\"\n fill=\"black\"\n fillOpacity=\"0.45\"\n fillRule=\"evenodd\"\n />\n </svg>\n </StyledIconContainer>\n <Stack alignItems=\"center\" direction=\"column\" gap=\"8px\" width=\"100%\">\n <StyledPrimaryText onClick={onImageUpload}>Select an image</StyledPrimaryText>\n <StyledSecondaryText color=\"rgba(0, 0, 0, 0.90)\">\n OR drop it here{allowImageLinkUpload && ' OR paste the image URL below'}\n </StyledSecondaryText>\n {allowImageLinkUpload &&\n <StyledForm data-testid='image-link-form' onSubmit={handleImageLinkUpload}>\n <TextField fullWidth fdKey='img-link' onChange={(e) => onImageLinkChange(e.target.value)} placeholder=\"Enter image URL\" value={imageLink} />\n </StyledForm>\n }\n </Stack>\n <StyledSecondaryText color=\"rgba(0, 0, 0, 0.60)\">Minimum dimensions: 1280 × 720 - up to 10 MB</StyledSecondaryText>\n <StyledSecondaryText\n color=\"rgba(184, 0, 34, 0.80)\"\n sx={(theme) => ({\n overflowY: 'scroll',\n height: '30px',\n [theme.breakpoints.only('mobile')]: {\n height: '120px'\n }\n })}\n >\n {uploadingError ? uploadErrorMessage : ''}\n </StyledSecondaryText>\n </StyledUploadAreaContainer>\n );\n }}\n </ReactImageUploading>\n );\n};\n\nexport default ImageDropZone;\n"],"names":["StyledUploadAreaContainer","styled","Box","theme","flex","display","flexDirection","height","boxSizing","alignItems","justifyContent","padding","borderRadius","border","background","breakpoints","only","gap","StyledIconContainer","width","backgroundColor","StyledPrimaryText","Typography","color","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","letterSpacing","textDecoration","textDecorationStyle","textDecorationSkipInk","textDecorationThickness","textUnderlineOffset","textUnderlinePosition","cursor","StyledSecondaryText","textAlign","StyledImageComponent","maxWidth","maxHeight","objectFit","StyledForm","allowedFileTypes","ImageDropZone","selectedImage","onImageSelect","uploadingError","allowImageLinkUpload","imageLink","onImageLinkChange","onUploadImageLink","handleImageLinkUpload","e","preventDefault","_jsx","ReactImageUploading","acceptType","onChange","value","firstImage","children","onImageUpload","dragProps","uploadErrorMessage","message","dataURL","src","_jsxs","fill","viewBox","xmlns","clipRule","d","fillOpacity","fillRule","Stack","direction","onClick","onSubmit","TextField","fullWidth","fdKey","target","placeholder","sx","overflowY"],"mappings":"kUAQA,MAAMA,EAA4BC,EAAOC,EAAPD,EAAY,EAAGE,YAAO,CACtDC,KAAM,IACNC,QAAS,OACTC,cAAe,SACfC,OAAQ,OACRC,UAAW,aACXC,WAAY,SACZC,eAAgB,gBAChBC,QAAS,OACTC,aAAc,MACdC,OAAQ,gCACRC,WAAY,UACZ,CAACX,EAAMY,YAAYC,KAAK,WAAY,CAClCN,eAAgB,SAChBO,IAAK,YAIHC,EAAsBjB,EAAOC,EAAPD,CAAY,CACtCI,QAAS,OACTC,cAAe,SACfa,MAAO,OACPZ,OAAQ,OACRI,QAAS,MACTD,eAAgB,SAChBD,WAAY,SACZG,aAAc,OACdQ,gBAAiB,wBAGbC,EAAoBpB,EAAOqB,EAAPrB,CAA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AAK,QACLK,YAAY,OACZC,SAAS,YAEXpB,EAAA,OAAA,CACEiB,SAAS,UACTC,EAAE,wWACFJ,KAAK,QACLK,YAAY,OACZC,SAAS,iBAIfP,EAACQ,EAAK,CAACpE,WAAW,SAASqE,UAAU,SAAS7D,IAAI,MAAME,MAAM,OAAM2C,SAAA,CAClEN,EAACnC,EAAiB,CAAC0D,QAAShB,EAAaD,SAAA,oBACzCO,EAAChC,EAAmB,CAACd,MAAM,sBAAqBuC,SAAA,CAAA,kBAC9Bb,GAAwB,mCAEzCA,GACCO,EAACb,EAAU,CAAA,cAAa,kBAAkBqC,SAAU3B,EAAqBS,SACvEN,EAACyB,EAAS,CAACC,aAAUC,MAAM,WAAWxB,SAAWL,GAAMH,EAAkBG,EAAE8B,OAAOxB,OAAQyB,YAAY,kBAAkBzB,MAAOV,SAIrIM,EAACnB,EAAmB,CAACd,MAAM,sBAAqBuC,SAAA,iDAChDN,EAACnB,EAAmB,CAClBd,MAAM,yBACN+D,GAAKnF,IAAK,CACRoF,UAAW,SACXhF,OAAQ,OACR,CAACJ,EAAMY,YAAYC,KAAK,WAAY,CAClCT,OAAQ,WAEVuD,SAEDd,EAAiBiB,EAAqB"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime");require("react");var r=require("@mui/x-date-pickers/AdapterMoment"),i=require("@mui/x-date-pickers/LocalizationProvider");module.exports=({children:t})=>e.jsx(i.LocalizationProvider,{dateAdapter:r.AdapterMoment,children:t});
1
+ "use strict";var r=require("react/jsx-runtime"),e=require("@mui/x-date-pickers/LocalizationProvider");module.exports=({children:i,...o})=>r.jsx(e.LocalizationProvider,{...o,children:i});
2
2
  //# sourceMappingURL=DateTimeLocalizationProvider.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeLocalizationProvider.cjs.js","sources":["../../src/providers/DateTimeLocalizationProvider.tsx"],"sourcesContent":["import { type ReactNode } from 'react';\nimport { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\n\nconst DateTimeLocalizationProvider = ({ children }: { children: ReactNode }) => {\n return <LocalizationProvider dateAdapter={AdapterMoment}>{children}</LocalizationProvider>;\n};\n\nexport default DateTimeLocalizationProvider;\n"],"names":["children","_jsx","LocalizationProvider","dateAdapter","AdapterMoment"],"mappings":"yLAIqC,EAAGA,cAC7BC,EAAAA,IAACC,EAAAA,qBAAoB,CAACC,YAAaC,EAAAA,cAAaJ,SAAGA"}
1
+ {"version":3,"file":"DateTimeLocalizationProvider.cjs.js","sources":["../../src/providers/DateTimeLocalizationProvider.tsx"],"sourcesContent":["\nimport { LocalizationProvider, type LocalizationProviderProps } from '@mui/x-date-pickers/LocalizationProvider';\nimport type { PickerValidDate } from '@mui/x-date-pickers/models/pickers';\n\ntype DateTimeLocalizationProviderProps<TDate extends PickerValidDate, TLocale> = LocalizationProviderProps<TDate, TLocale>;\n\nconst DateTimeLocalizationProvider: React.FC<DateTimeLocalizationProviderProps<PickerValidDate, string>> = ({ children, ...props }) => {\n return <LocalizationProvider {...props}>{children}</LocalizationProvider>;\n};\n\nexport default DateTimeLocalizationProvider;\n"],"names":["children","props","_jsx","LocalizationProvider"],"mappings":"qHAM2G,EAAGA,cAAaC,KAChHC,EAAAA,IAACC,EAAAA,qBAAoB,IAAKF,EAAKD,SAAGA"}
@@ -1,8 +1,7 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode } from 'react';
1
+ import { LocalizationProviderProps } from '@mui/x-date-pickers/LocalizationProvider';
2
+ import { PickerValidDate } from '@mui/x-date-pickers/models/pickers';
3
3
 
4
- declare const DateTimeLocalizationProvider: ({ children }: {
5
- children: ReactNode;
6
- }) => react_jsx_runtime.JSX.Element;
4
+ type DateTimeLocalizationProviderProps<TDate extends PickerValidDate, TLocale> = LocalizationProviderProps<TDate, TLocale>;
5
+ declare const DateTimeLocalizationProvider: React.FC<DateTimeLocalizationProviderProps<PickerValidDate, string>>;
7
6
 
8
7
  export { DateTimeLocalizationProvider as default };
@@ -1,2 +1,2 @@
1
- import{jsx as r}from"react/jsx-runtime";import"react";import{AdapterMoment as t}from"@mui/x-date-pickers/AdapterMoment";import{LocalizationProvider as e}from"@mui/x-date-pickers/LocalizationProvider";const i=({children:i})=>r(e,{dateAdapter:t,children:i});export{i as default};
1
+ import{jsx as r}from"react/jsx-runtime";import{LocalizationProvider as i}from"@mui/x-date-pickers/LocalizationProvider";const e=({children:e,...o})=>r(i,{...o,children:e});export{e as default};
2
2
  //# sourceMappingURL=DateTimeLocalizationProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeLocalizationProvider.js","sources":["../../src/providers/DateTimeLocalizationProvider.tsx"],"sourcesContent":["import { type ReactNode } from 'react';\nimport { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\n\nconst DateTimeLocalizationProvider = ({ children }: { children: ReactNode }) => {\n return <LocalizationProvider dateAdapter={AdapterMoment}>{children}</LocalizationProvider>;\n};\n\nexport default DateTimeLocalizationProvider;\n"],"names":["DateTimeLocalizationProvider","children","_jsx","LocalizationProvider","dateAdapter","AdapterMoment"],"mappings":"wMAIA,MAAMA,EAA+B,EAAGC,cAC7BC,EAACC,EAAoB,CAACC,YAAaC,EAAaJ,SAAGA"}
1
+ {"version":3,"file":"DateTimeLocalizationProvider.js","sources":["../../src/providers/DateTimeLocalizationProvider.tsx"],"sourcesContent":["\nimport { LocalizationProvider, type LocalizationProviderProps } from '@mui/x-date-pickers/LocalizationProvider';\nimport type { PickerValidDate } from '@mui/x-date-pickers/models/pickers';\n\ntype DateTimeLocalizationProviderProps<TDate extends PickerValidDate, TLocale> = LocalizationProviderProps<TDate, TLocale>;\n\nconst DateTimeLocalizationProvider: React.FC<DateTimeLocalizationProviderProps<PickerValidDate, string>> = ({ children, ...props }) => {\n return <LocalizationProvider {...props}>{children}</LocalizationProvider>;\n};\n\nexport default DateTimeLocalizationProvider;\n"],"names":["DateTimeLocalizationProvider","children","props","_jsx","LocalizationProvider"],"mappings":"wHAMA,MAAMA,EAAqG,EAAGC,cAAaC,KAChHC,EAACC,EAAoB,IAAKF,EAAKD,SAAGA"}