@pega/cosmos-react-core 7.0.0-build.9.1 → 7.0.0-rc.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 (750) hide show
  1. package/lib/components/AIButton/AIButton.d.ts +30 -2
  2. package/lib/components/AIButton/AIButton.d.ts.map +1 -1
  3. package/lib/components/AIButton/AIButton.js +7 -6
  4. package/lib/components/AIButton/AIButton.js.map +1 -1
  5. package/lib/components/Actions/Actions.d.ts +1 -1
  6. package/lib/components/Actions/Actions.d.ts.map +1 -1
  7. package/lib/components/Actions/Actions.js +6 -3
  8. package/lib/components/Actions/Actions.js.map +1 -1
  9. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  10. package/lib/components/AppShell/AppHeader.js +9 -7
  11. package/lib/components/AppShell/AppHeader.js.map +1 -1
  12. package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppHeader.styles.js +26 -19
  14. package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  16. package/lib/components/AppShell/AppShell.js +17 -5
  17. package/lib/components/AppShell/AppShell.js.map +1 -1
  18. package/lib/components/AppShell/AppShell.styles.d.ts +5 -1
  19. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  20. package/lib/components/AppShell/AppShell.styles.js +50 -11
  21. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  22. package/lib/components/AppShell/AppShell.types.d.ts +4 -0
  23. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  24. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  25. package/lib/components/AppShell/AppShellContext.d.ts +3 -1
  26. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  27. package/lib/components/AppShell/AppShellContext.js +3 -1
  28. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  29. package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
  30. package/lib/components/AppShell/AppShellList.styles.js +1 -0
  31. package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
  32. package/lib/components/AppShell/AppShellSearch.styles.d.ts.map +1 -1
  33. package/lib/components/AppShell/AppShellSearch.styles.js +2 -0
  34. package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -1
  35. package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
  36. package/lib/components/AppShell/NavigationList.js +3 -3
  37. package/lib/components/AppShell/NavigationList.js.map +1 -1
  38. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  39. package/lib/components/AppShell/NavigationListItemWrapper.js +1 -0
  40. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  41. package/lib/components/AppShell/Operator.d.ts +1 -1
  42. package/lib/components/AppShell/style-utils.d.ts +3 -0
  43. package/lib/components/AppShell/style-utils.d.ts.map +1 -1
  44. package/lib/components/AppShell/style-utils.js +40 -1
  45. package/lib/components/AppShell/style-utils.js.map +1 -1
  46. package/lib/components/Avatar/Avatar.d.ts +2 -2
  47. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  48. package/lib/components/Avatar/Avatar.js +19 -19
  49. package/lib/components/Avatar/Avatar.js.map +1 -1
  50. package/lib/components/Avatar/Avatar.test-ids.d.ts +1 -1
  51. package/lib/components/Avatar/Avatar.test-ids.d.ts.map +1 -1
  52. package/lib/components/Backdrop/Backdrop.d.ts +1 -1
  53. package/lib/components/Backdrop/Backdrop.test-ids.d.ts +1 -1
  54. package/lib/components/Backdrop/Backdrop.test-ids.d.ts.map +1 -1
  55. package/lib/components/Badges/Alert.d.ts +1 -1
  56. package/lib/components/Badges/Badges.test-ids.d.ts +6 -6
  57. package/lib/components/Badges/Badges.test-ids.d.ts.map +1 -1
  58. package/lib/components/Badges/Count.d.ts +1 -1
  59. package/lib/components/Badges/Keyboard.d.ts +1 -1
  60. package/lib/components/Badges/Selection.d.ts +1 -1
  61. package/lib/components/Badges/Selection.d.ts.map +1 -1
  62. package/lib/components/Badges/Selection.js +23 -20
  63. package/lib/components/Badges/Selection.js.map +1 -1
  64. package/lib/components/Badges/Status.d.ts +1 -1
  65. package/lib/components/Badges/Status.d.ts.map +1 -1
  66. package/lib/components/Badges/Status.js +0 -1
  67. package/lib/components/Badges/Status.js.map +1 -1
  68. package/lib/components/Badges/Tag.d.ts +1 -1
  69. package/lib/components/Banner/Banner.d.ts +1 -1
  70. package/lib/components/Banner/Banner.d.ts.map +1 -1
  71. package/lib/components/Banner/Banner.js +3 -1
  72. package/lib/components/Banner/Banner.js.map +1 -1
  73. package/lib/components/Banner/Banner.test-ids.d.ts +1 -1
  74. package/lib/components/Banner/Banner.test-ids.d.ts.map +1 -1
  75. package/lib/components/Button/Button.d.ts +1 -1
  76. package/lib/components/Button/Button.d.ts.map +1 -1
  77. package/lib/components/Button/Button.js +87 -58
  78. package/lib/components/Button/Button.js.map +1 -1
  79. package/lib/components/Card/Card.d.ts.map +1 -1
  80. package/lib/components/Card/Card.js +8 -0
  81. package/lib/components/Card/Card.js.map +1 -1
  82. package/lib/components/Checkbox/Checkbox.d.ts +3 -33
  83. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  84. package/lib/components/Checkbox/Checkbox.js +1 -5
  85. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  86. package/lib/components/ColorPicker/ColorPicker.d.ts +6 -23
  87. package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  88. package/lib/components/ColorPicker/ColorPicker.js +3 -4
  89. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  90. package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +1 -1
  91. package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -1
  92. package/lib/components/ComboBox/ComboBox.d.ts +2 -4
  93. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  94. package/lib/components/ComboBox/ComboBox.js +8 -5
  95. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  96. package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
  97. package/lib/components/ComboBox/ComboBox.styles.js +7 -1
  98. package/lib/components/ComboBox/ComboBox.styles.js.map +1 -1
  99. package/lib/components/ComboBox/ComboBox.types.d.ts +8 -26
  100. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  101. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  102. package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
  103. package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
  104. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  105. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +21 -32
  106. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  107. package/lib/components/CompositeInput/CompositeInput.d.ts +2 -3
  108. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
  109. package/lib/components/CompositeInput/CompositeInput.js +2 -3
  110. package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
  111. package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +1 -1
  112. package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -1
  113. package/lib/components/CompositeInput/CompositeInput.types.d.ts +4 -13
  114. package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -1
  115. package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -1
  116. package/lib/components/Configuration/Configuration.d.ts +1 -0
  117. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  118. package/lib/components/Configuration/Configuration.js +58 -30
  119. package/lib/components/Configuration/Configuration.js.map +1 -1
  120. package/lib/components/Configuration/ThemeOverride.d.ts +11 -0
  121. package/lib/components/Configuration/ThemeOverride.d.ts.map +1 -0
  122. package/lib/components/Configuration/ThemeOverride.js +23 -0
  123. package/lib/components/Configuration/ThemeOverride.js.map +1 -0
  124. package/lib/components/Configuration/connected-watcher.d.ts +17 -0
  125. package/lib/components/Configuration/connected-watcher.d.ts.map +1 -0
  126. package/lib/components/Configuration/connected-watcher.js +13 -0
  127. package/lib/components/Configuration/connected-watcher.js.map +1 -0
  128. package/lib/components/Configuration/index.d.ts +1 -0
  129. package/lib/components/Configuration/index.d.ts.map +1 -1
  130. package/lib/components/Configuration/index.js +1 -0
  131. package/lib/components/Configuration/index.js.map +1 -1
  132. package/lib/components/Configuration/withConfiguration.d.ts.map +1 -1
  133. package/lib/components/Configuration/withConfiguration.js.map +1 -1
  134. package/lib/components/CreditCard/CreditCard.types.d.ts +5 -25
  135. package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
  136. package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
  137. package/lib/components/CreditCard/CreditCardDisplay.d.ts +2 -4
  138. package/lib/components/CreditCard/CreditCardDisplay.d.ts.map +1 -1
  139. package/lib/components/CreditCard/CreditCardDisplay.js +1 -2
  140. package/lib/components/CreditCard/CreditCardDisplay.js.map +1 -1
  141. package/lib/components/CreditCard/CreditCardInput.d.ts +15 -5
  142. package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
  143. package/lib/components/CreditCard/CreditCardInput.js +1 -2
  144. package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
  145. package/lib/components/Currency/Currency.test-ids.d.ts +1 -1
  146. package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -1
  147. package/lib/components/Currency/CurrencyInput.d.ts +1 -1
  148. package/lib/components/Currency/CurrencyInput.js +1 -1
  149. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  150. package/lib/components/Currency/CurrencyInput.types.d.ts +1 -1
  151. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  152. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  153. package/lib/components/DangerButton/DangerButton.js +2 -2
  154. package/lib/components/DangerButton/DangerButton.js.map +1 -1
  155. package/lib/components/DateTime/DateTime.test-ids.d.ts +11 -11
  156. package/lib/components/DateTime/DateTime.test-ids.d.ts.map +1 -1
  157. package/lib/components/DateTime/DateTime.test-ids.js +5 -1
  158. package/lib/components/DateTime/DateTime.test-ids.js.map +1 -1
  159. package/lib/components/DateTime/Input/DateInput.d.ts +1 -1
  160. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  161. package/lib/components/DateTime/Input/DateInput.js +30 -27
  162. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  163. package/lib/components/DateTime/Input/DateRangeInput.d.ts +1 -1
  164. package/lib/components/DateTime/Input/DateRangeInput.js +2 -2
  165. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  166. package/lib/components/DateTime/Input/DateTime.styles.d.ts +1 -0
  167. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  168. package/lib/components/DateTime/Input/DateTime.styles.js +24 -16
  169. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  170. package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -1
  171. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  172. package/lib/components/DateTime/Input/DateTimeInput.js +26 -25
  173. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  174. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +1 -1
  175. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts +1 -1
  176. package/lib/components/DateTime/Input/MonthInput.d.ts +1 -1
  177. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  178. package/lib/components/DateTime/Input/MonthInput.js +21 -10
  179. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  180. package/lib/components/DateTime/Input/PartInput.d.ts +1 -1
  181. package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
  182. package/lib/components/DateTime/Input/PartInput.js +13 -7
  183. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  184. package/lib/components/DateTime/Input/QuarterInput.d.ts +1 -1
  185. package/lib/components/DateTime/Input/TimeInput.d.ts +1 -1
  186. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  187. package/lib/components/DateTime/Input/TimeInput.js +2 -7
  188. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  189. package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -1
  190. package/lib/components/DateTime/Input/TimeRangeInput.js +3 -3
  191. package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
  192. package/lib/components/DateTime/Input/WeekInput.d.ts +1 -1
  193. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  194. package/lib/components/DateTime/Input/WeekInput.js +17 -6
  195. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  196. package/lib/components/DateTime/Input/utils.d.ts +2 -2
  197. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  198. package/lib/components/DateTime/Input/utils.js +5 -2
  199. package/lib/components/DateTime/Input/utils.js.map +1 -1
  200. package/lib/components/DateTime/Picker/DatePicker.d.ts +1 -1
  201. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  202. package/lib/components/DateTime/Picker/DatePicker.js +28 -17
  203. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  204. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +1 -0
  205. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -1
  206. package/lib/components/DateTime/Picker/DatePicker.styles.js +13 -5
  207. package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -1
  208. package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
  209. package/lib/components/DateTime/Picker/DateRangePicker.js +18 -11
  210. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  211. package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
  212. package/lib/components/DateTime/Picker/TimePicker.js +2 -1
  213. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  214. package/lib/components/DateTime/Picker/utils.d.ts +9 -0
  215. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  216. package/lib/components/DateTime/Picker/utils.js +16 -0
  217. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  218. package/lib/components/DateTime/index.d.ts +1 -1
  219. package/lib/components/DateTime/index.d.ts.map +1 -1
  220. package/lib/components/DateTime/index.js +1 -1
  221. package/lib/components/DateTime/index.js.map +1 -1
  222. package/lib/components/DateTime/utils.d.ts +1 -0
  223. package/lib/components/DateTime/utils.d.ts.map +1 -1
  224. package/lib/components/DateTime/utils.js +13 -11
  225. package/lib/components/DateTime/utils.js.map +1 -1
  226. package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
  227. package/lib/components/Email/EmailDisplay.js +2 -2
  228. package/lib/components/Email/EmailDisplay.js.map +1 -1
  229. package/lib/components/EmptyState/EmptyState.d.ts.map +1 -1
  230. package/lib/components/EmptyState/EmptyState.js +5 -2
  231. package/lib/components/EmptyState/EmptyState.js.map +1 -1
  232. package/lib/components/FieldGroup/FieldGroup.d.ts +6 -0
  233. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  234. package/lib/components/FieldGroup/FieldGroup.js +37 -15
  235. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  236. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  237. package/lib/components/FieldGroup/FieldGroupList.js +39 -20
  238. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  239. package/lib/components/FieldValueList/FieldValueList.d.ts +14 -10
  240. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  241. package/lib/components/FieldValueList/FieldValueList.js +13 -5
  242. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  243. package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts +2 -2
  244. package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts.map +1 -1
  245. package/lib/components/FieldValueList/index.d.ts +1 -1
  246. package/lib/components/FieldValueList/index.d.ts.map +1 -1
  247. package/lib/components/FieldValueList/index.js.map +1 -1
  248. package/lib/components/File/CompactList.d.ts +15 -0
  249. package/lib/components/File/CompactList.d.ts.map +1 -0
  250. package/lib/components/File/CompactList.js +21 -0
  251. package/lib/components/File/CompactList.js.map +1 -0
  252. package/lib/components/File/File.test-ids.d.ts +1 -1
  253. package/lib/components/File/File.test-ids.d.ts.map +1 -1
  254. package/lib/components/File/FileDisplay.d.ts +5 -0
  255. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  256. package/lib/components/File/FileDisplay.js +2 -2
  257. package/lib/components/File/FileDisplay.js.map +1 -1
  258. package/lib/components/File/FileDisplayList.d.ts +4 -2
  259. package/lib/components/File/FileDisplayList.d.ts.map +1 -1
  260. package/lib/components/File/FileDisplayList.js +9 -3
  261. package/lib/components/File/FileDisplayList.js.map +1 -1
  262. package/lib/components/File/FileInput.d.ts +32 -8
  263. package/lib/components/File/FileInput.d.ts.map +1 -1
  264. package/lib/components/File/FileInput.js +169 -74
  265. package/lib/components/File/FileInput.js.map +1 -1
  266. package/lib/components/File/FileInput.styles.d.ts +26 -0
  267. package/lib/components/File/FileInput.styles.d.ts.map +1 -0
  268. package/lib/components/File/FileInput.styles.js +166 -0
  269. package/lib/components/File/FileInput.styles.js.map +1 -0
  270. package/lib/components/File/FileItem.d.ts +16 -0
  271. package/lib/components/File/FileItem.d.ts.map +1 -1
  272. package/lib/components/File/FileItem.js +82 -27
  273. package/lib/components/File/FileItem.js.map +1 -1
  274. package/lib/components/File/FileList.d.ts +9 -3
  275. package/lib/components/File/FileList.d.ts.map +1 -1
  276. package/lib/components/File/FileList.js +53 -9
  277. package/lib/components/File/FileList.js.map +1 -1
  278. package/lib/components/File/FileUploadItem.d.ts +4 -0
  279. package/lib/components/File/FileUploadItem.d.ts.map +1 -1
  280. package/lib/components/File/FileUploadItem.js +42 -38
  281. package/lib/components/File/FileUploadItem.js.map +1 -1
  282. package/lib/components/Flex/Flex.js.map +1 -1
  283. package/lib/components/Form/Form.d.ts +1 -1
  284. package/lib/components/Form/Form.test-ids.d.ts +1 -1
  285. package/lib/components/Form/Form.test-ids.d.ts.map +1 -1
  286. package/lib/components/FormField/FormField.d.ts +2 -2
  287. package/lib/components/FormField/FormField.d.ts.map +1 -1
  288. package/lib/components/FormField/FormField.js +62 -64
  289. package/lib/components/FormField/FormField.js.map +1 -1
  290. package/lib/components/FormField/FormField.test-ids.d.ts +1 -1
  291. package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
  292. package/lib/components/Fullscreen/Fullscreen.d.ts +18 -0
  293. package/lib/components/Fullscreen/Fullscreen.d.ts.map +1 -0
  294. package/lib/components/Fullscreen/Fullscreen.js +56 -0
  295. package/lib/components/Fullscreen/Fullscreen.js.map +1 -0
  296. package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts +2 -0
  297. package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts.map +1 -0
  298. package/lib/components/Fullscreen/Fullscreen.test-ids.js +3 -0
  299. package/lib/components/Fullscreen/Fullscreen.test-ids.js.map +1 -0
  300. package/lib/components/Fullscreen/FullscreenButton.d.ts +6 -0
  301. package/lib/components/Fullscreen/FullscreenButton.d.ts.map +1 -0
  302. package/lib/components/Fullscreen/FullscreenButton.js +33 -0
  303. package/lib/components/Fullscreen/FullscreenButton.js.map +1 -0
  304. package/lib/components/Fullscreen/index.d.ts +4 -0
  305. package/lib/components/Fullscreen/index.d.ts.map +1 -0
  306. package/lib/components/Fullscreen/index.js +4 -0
  307. package/lib/components/Fullscreen/index.js.map +1 -0
  308. package/lib/components/HTML/HTML.d.ts +1 -1
  309. package/lib/components/HTML/HTML.test-ids.d.ts +1 -1
  310. package/lib/components/HTML/HTML.test-ids.d.ts.map +1 -1
  311. package/lib/components/Icon/Icon.d.ts.map +1 -1
  312. package/lib/components/Icon/Icon.js +2 -2
  313. package/lib/components/Icon/Icon.js.map +1 -1
  314. package/lib/components/Icon/iconNames.d.ts +1 -1
  315. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  316. package/lib/components/Icon/iconNames.js +2 -0
  317. package/lib/components/Icon/iconNames.js.map +1 -1
  318. package/lib/components/Icon/icons/calendar-now.icon.d.ts +5 -0
  319. package/lib/components/Icon/icons/calendar-now.icon.d.ts.map +1 -0
  320. package/lib/components/Icon/icons/calendar-now.icon.js +7 -0
  321. package/lib/components/Icon/icons/calendar-now.icon.js.map +1 -0
  322. package/lib/components/Icon/icons/preview.icon.d.ts +5 -0
  323. package/lib/components/Icon/icons/preview.icon.d.ts.map +1 -0
  324. package/lib/components/Icon/icons/preview.icon.js +7 -0
  325. package/lib/components/Icon/icons/preview.icon.js.map +1 -0
  326. package/lib/components/Icon/streamline-icons/arrow-down.icon.d.ts.map +1 -1
  327. package/lib/components/Icon/streamline-icons/arrow-down.icon.js +1 -1
  328. package/lib/components/Icon/streamline-icons/arrow-down.icon.js.map +1 -1
  329. package/lib/components/Icon/streamline-icons/arrow-left.icon.d.ts.map +1 -1
  330. package/lib/components/Icon/streamline-icons/arrow-left.icon.js +1 -1
  331. package/lib/components/Icon/streamline-icons/arrow-left.icon.js.map +1 -1
  332. package/lib/components/Icon/streamline-icons/arrow-right.icon.d.ts.map +1 -1
  333. package/lib/components/Icon/streamline-icons/arrow-right.icon.js +1 -1
  334. package/lib/components/Icon/streamline-icons/arrow-right.icon.js.map +1 -1
  335. package/lib/components/Icon/streamline-icons/arrow-up.icon.d.ts.map +1 -1
  336. package/lib/components/Icon/streamline-icons/arrow-up.icon.js +1 -1
  337. package/lib/components/Icon/streamline-icons/arrow-up.icon.js.map +1 -1
  338. package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts +5 -0
  339. package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts.map +1 -0
  340. package/lib/components/Icon/streamline-icons/calendar-now.icon.js +7 -0
  341. package/lib/components/Icon/streamline-icons/calendar-now.icon.js.map +1 -0
  342. package/lib/components/Icon/streamline-icons/caret-down.icon.d.ts.map +1 -1
  343. package/lib/components/Icon/streamline-icons/caret-down.icon.js +1 -1
  344. package/lib/components/Icon/streamline-icons/caret-down.icon.js.map +1 -1
  345. package/lib/components/Icon/streamline-icons/caret-left.icon.d.ts.map +1 -1
  346. package/lib/components/Icon/streamline-icons/caret-left.icon.js +1 -1
  347. package/lib/components/Icon/streamline-icons/caret-left.icon.js.map +1 -1
  348. package/lib/components/Icon/streamline-icons/caret-right.icon.d.ts.map +1 -1
  349. package/lib/components/Icon/streamline-icons/caret-right.icon.js +1 -1
  350. package/lib/components/Icon/streamline-icons/caret-right.icon.js.map +1 -1
  351. package/lib/components/Icon/streamline-icons/caret-up.icon.d.ts.map +1 -1
  352. package/lib/components/Icon/streamline-icons/caret-up.icon.js +1 -1
  353. package/lib/components/Icon/streamline-icons/caret-up.icon.js.map +1 -1
  354. package/lib/components/Icon/streamline-icons/case-solid.icon.js +1 -1
  355. package/lib/components/Icon/streamline-icons/case-solid.icon.js.map +1 -1
  356. package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js +1 -1
  357. package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js.map +1 -1
  358. package/lib/components/Icon/streamline-icons/clock-solid.icon.js +1 -1
  359. package/lib/components/Icon/streamline-icons/clock-solid.icon.js.map +1 -1
  360. package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.d.ts.map +1 -1
  361. package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js +1 -1
  362. package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js.map +1 -1
  363. package/lib/components/Icon/streamline-icons/dock.icon.d.ts +5 -0
  364. package/lib/components/Icon/streamline-icons/dock.icon.d.ts.map +1 -0
  365. package/lib/components/Icon/streamline-icons/dock.icon.js +7 -0
  366. package/lib/components/Icon/streamline-icons/dock.icon.js.map +1 -0
  367. package/lib/components/Icon/streamline-icons/expression.icon.d.ts +5 -0
  368. package/lib/components/Icon/streamline-icons/expression.icon.d.ts.map +1 -0
  369. package/lib/components/Icon/streamline-icons/expression.icon.js +7 -0
  370. package/lib/components/Icon/streamline-icons/expression.icon.js.map +1 -0
  371. package/lib/components/Icon/streamline-icons/indent.icon.d.ts +5 -0
  372. package/lib/components/Icon/streamline-icons/indent.icon.d.ts.map +1 -0
  373. package/lib/components/Icon/streamline-icons/indent.icon.js +7 -0
  374. package/lib/components/Icon/streamline-icons/indent.icon.js.map +1 -0
  375. package/lib/components/Icon/streamline-icons/information-solid.icon.js +1 -1
  376. package/lib/components/Icon/streamline-icons/information-solid.icon.js.map +1 -1
  377. package/lib/components/Icon/streamline-icons/list-number.icon.d.ts +5 -0
  378. package/lib/components/Icon/streamline-icons/list-number.icon.d.ts.map +1 -0
  379. package/lib/components/Icon/streamline-icons/list-number.icon.js +7 -0
  380. package/lib/components/Icon/streamline-icons/list-number.icon.js.map +1 -0
  381. package/lib/components/Icon/streamline-icons/open.icon.d.ts.map +1 -1
  382. package/lib/components/Icon/streamline-icons/open.icon.js +1 -1
  383. package/lib/components/Icon/streamline-icons/open.icon.js.map +1 -1
  384. package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js +1 -1
  385. package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js.map +1 -1
  386. package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js +1 -1
  387. package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js.map +1 -1
  388. package/lib/components/Icon/streamline-icons/undock.icon.d.ts +5 -0
  389. package/lib/components/Icon/streamline-icons/undock.icon.d.ts.map +1 -0
  390. package/lib/components/Icon/streamline-icons/undock.icon.js +7 -0
  391. package/lib/components/Icon/streamline-icons/undock.icon.js.map +1 -0
  392. package/lib/components/Icon/streamline-icons/unindent.icon.d.ts +5 -0
  393. package/lib/components/Icon/streamline-icons/unindent.icon.d.ts.map +1 -0
  394. package/lib/components/Icon/streamline-icons/unindent.icon.js +7 -0
  395. package/lib/components/Icon/streamline-icons/unindent.icon.js.map +1 -0
  396. package/lib/components/Icon/streamline-icons/warn-solid.icon.js +1 -1
  397. package/lib/components/Icon/streamline-icons/warn-solid.icon.js.map +1 -1
  398. package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
  399. package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
  400. package/lib/components/Icon/streamlineIconNames.js +7 -0
  401. package/lib/components/Icon/streamlineIconNames.js.map +1 -1
  402. package/lib/components/IconPicker/IconPicker.d.ts +7 -1
  403. package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
  404. package/lib/components/IconPicker/IconPicker.js +20 -14
  405. package/lib/components/IconPicker/IconPicker.js.map +1 -1
  406. package/lib/components/Input/Input.d.ts +5 -8
  407. package/lib/components/Input/Input.d.ts.map +1 -1
  408. package/lib/components/Input/Input.js +2 -3
  409. package/lib/components/Input/Input.js.map +1 -1
  410. package/lib/components/Input/Input.test-ids.d.ts +1 -1
  411. package/lib/components/Input/Input.test-ids.d.ts.map +1 -1
  412. package/lib/components/Lightbox/Lightbox.d.ts +1 -1
  413. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
  414. package/lib/components/Lightbox/Lightbox.js +13 -6
  415. package/lib/components/Lightbox/Lightbox.js.map +1 -1
  416. package/lib/components/Lightbox/Lightbox.styles.d.ts +1 -1
  417. package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
  418. package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
  419. package/lib/components/Lightbox/Lightbox.types.d.ts +1 -1
  420. package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
  421. package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
  422. package/lib/components/Link/Link.d.ts +5 -2
  423. package/lib/components/Link/Link.d.ts.map +1 -1
  424. package/lib/components/Link/Link.js +45 -17
  425. package/lib/components/Link/Link.js.map +1 -1
  426. package/lib/components/Link/Link.test-ids.d.ts +1 -1
  427. package/lib/components/Link/Link.test-ids.d.ts.map +1 -1
  428. package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
  429. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  430. package/lib/components/ListToolbar/ListToolbar.js +8 -7
  431. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  432. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  433. package/lib/components/ListToolbar/ListToolbar.styles.js +5 -5
  434. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  435. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +1 -1
  436. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -1
  437. package/lib/components/ListToolbar/ListToolbar.test-ids.js +4 -1
  438. package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -1
  439. package/lib/components/ListToolbar/ListToolbar.types.d.ts +7 -3
  440. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  441. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  442. package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -1
  443. package/lib/components/ListToolbar/PresetMenuPopover.js +2 -2
  444. package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -1
  445. package/lib/components/ListToolbar/helpers.d.ts.map +1 -1
  446. package/lib/components/ListToolbar/helpers.js.map +1 -1
  447. package/lib/components/Location/CurrentLocationButton.d.ts +1 -6
  448. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  449. package/lib/components/Location/CurrentLocationButton.js +10 -20
  450. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  451. package/lib/components/Location/Location.test-ids.d.ts +1 -1
  452. package/lib/components/Location/Location.test-ids.d.ts.map +1 -1
  453. package/lib/components/Location/Location.types.d.ts +49 -17
  454. package/lib/components/Location/Location.types.d.ts.map +1 -1
  455. package/lib/components/Location/Location.types.js +9 -1
  456. package/lib/components/Location/Location.types.js.map +1 -1
  457. package/lib/components/Location/LocationDisplay.d.ts +5 -4
  458. package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
  459. package/lib/components/Location/LocationDisplay.js +17 -4
  460. package/lib/components/Location/LocationDisplay.js.map +1 -1
  461. package/lib/components/Location/LocationInput.d.ts +23 -18
  462. package/lib/components/Location/LocationInput.d.ts.map +1 -1
  463. package/lib/components/Location/LocationInput.js +37 -15
  464. package/lib/components/Location/LocationInput.js.map +1 -1
  465. package/lib/components/Location/LocationView.d.ts +26 -12
  466. package/lib/components/Location/LocationView.d.ts.map +1 -1
  467. package/lib/components/Location/LocationView.js +103 -50
  468. package/lib/components/Location/LocationView.js.map +1 -1
  469. package/lib/components/Location/index.d.ts +2 -2
  470. package/lib/components/Location/index.d.ts.map +1 -1
  471. package/lib/components/Location/index.js +1 -1
  472. package/lib/components/Location/index.js.map +1 -1
  473. package/lib/components/Location/utils.d.ts +2 -2
  474. package/lib/components/Location/utils.d.ts.map +1 -1
  475. package/lib/components/Location/utils.js +67 -38
  476. package/lib/components/Location/utils.js.map +1 -1
  477. package/lib/components/Menu/Menu.context.d.ts.map +1 -1
  478. package/lib/components/Menu/Menu.context.js +1 -0
  479. package/lib/components/Menu/Menu.context.js.map +1 -1
  480. package/lib/components/Menu/Menu.d.ts +1 -1
  481. package/lib/components/Menu/Menu.d.ts.map +1 -1
  482. package/lib/components/Menu/Menu.js +6 -2
  483. package/lib/components/Menu/Menu.js.map +1 -1
  484. package/lib/components/Menu/Menu.styles.d.ts +0 -1
  485. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  486. package/lib/components/Menu/Menu.styles.js +2 -9
  487. package/lib/components/Menu/Menu.styles.js.map +1 -1
  488. package/lib/components/Menu/Menu.test-ids.d.ts +2 -2
  489. package/lib/components/Menu/Menu.test-ids.d.ts.map +1 -1
  490. package/lib/components/Menu/Menu.types.d.ts +14 -2
  491. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  492. package/lib/components/Menu/Menu.types.js.map +1 -1
  493. package/lib/components/Menu/Menu.utils.d.ts +4 -0
  494. package/lib/components/Menu/Menu.utils.d.ts.map +1 -0
  495. package/lib/components/Menu/Menu.utils.js +6 -0
  496. package/lib/components/Menu/Menu.utils.js.map +1 -0
  497. package/lib/components/Menu/MenuGroup.js +2 -2
  498. package/lib/components/Menu/MenuGroup.js.map +1 -1
  499. package/lib/components/Menu/MenuItem.d.ts +1 -1
  500. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  501. package/lib/components/Menu/MenuItem.js +3 -3
  502. package/lib/components/Menu/MenuItem.js.map +1 -1
  503. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  504. package/lib/components/Menu/MenuList.js +3 -3
  505. package/lib/components/Menu/MenuList.js.map +1 -1
  506. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  507. package/lib/components/Menu/NavItemsList.js +1 -3
  508. package/lib/components/Menu/NavItemsList.js.map +1 -1
  509. package/lib/components/Menu/index.d.ts +1 -0
  510. package/lib/components/Menu/index.d.ts.map +1 -1
  511. package/lib/components/Menu/index.js +1 -0
  512. package/lib/components/Menu/index.js.map +1 -1
  513. package/lib/components/MenuButton/MenuButton.d.ts +8 -1
  514. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  515. package/lib/components/MenuButton/MenuButton.js +24 -14
  516. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  517. package/lib/components/MenuButton/MenuButton.test-ids.d.ts +1 -1
  518. package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -1
  519. package/lib/components/MetaList/MetaList.d.ts +1 -1
  520. package/lib/components/MetaList/MetaList.test-ids.d.ts +1 -1
  521. package/lib/components/MetaList/MetaList.test-ids.d.ts.map +1 -1
  522. package/lib/components/Modal/Modal.d.ts.map +1 -1
  523. package/lib/components/Modal/Modal.js +31 -7
  524. package/lib/components/Modal/Modal.js.map +1 -1
  525. package/lib/components/Modal/Modal.styles.d.ts +3 -1
  526. package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
  527. package/lib/components/Modal/Modal.styles.js +34 -17
  528. package/lib/components/Modal/Modal.styles.js.map +1 -1
  529. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  530. package/lib/components/Modal/ModalManager.js +5 -1
  531. package/lib/components/Modal/ModalManager.js.map +1 -1
  532. package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
  533. package/lib/components/MultiStepForm/MultiStepForm.js +28 -1
  534. package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
  535. package/lib/components/Number/Number.test-ids.d.ts +2 -2
  536. package/lib/components/Number/Number.test-ids.d.ts.map +1 -1
  537. package/lib/components/Number/NumberDisplay.d.ts +5 -8
  538. package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
  539. package/lib/components/Number/NumberDisplay.js +1 -2
  540. package/lib/components/Number/NumberDisplay.js.map +1 -1
  541. package/lib/components/Number/NumberInput.d.ts +2 -4
  542. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  543. package/lib/components/Number/NumberInput.js +15 -7
  544. package/lib/components/Number/NumberInput.js.map +1 -1
  545. package/lib/components/Number/NumberInput.types.d.ts +12 -30
  546. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  547. package/lib/components/Number/NumberInput.types.js.map +1 -1
  548. package/lib/components/Number/NumberRangeInput.d.ts +2 -4
  549. package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
  550. package/lib/components/Number/NumberRangeInput.js +7 -72
  551. package/lib/components/Number/NumberRangeInput.js.map +1 -1
  552. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +3 -1
  553. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
  554. package/lib/components/PageTemplates/CategorySubPage.styles.js +2 -0
  555. package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
  556. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  557. package/lib/components/PageTemplates/DashboardPage.js +41 -6
  558. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  559. package/lib/components/PageTemplates/PageTemplates.d.ts +1 -0
  560. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  561. package/lib/components/PageTemplates/PageTemplates.js +85 -31
  562. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  563. package/lib/components/Phone/Phone.test-ids.d.ts +1 -1
  564. package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -1
  565. package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
  566. package/lib/components/Phone/PhoneDisplay.js +2 -2
  567. package/lib/components/Phone/PhoneDisplay.js.map +1 -1
  568. package/lib/components/Phone/PhoneInput.d.ts +1 -1
  569. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  570. package/lib/components/Phone/PhoneInput.js +20 -5
  571. package/lib/components/Phone/PhoneInput.js.map +1 -1
  572. package/lib/components/Popover/Popover.d.ts +2 -0
  573. package/lib/components/Popover/Popover.d.ts.map +1 -1
  574. package/lib/components/Popover/Popover.js +20 -3
  575. package/lib/components/Popover/Popover.js.map +1 -1
  576. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  577. package/lib/components/Popover/Popover.styles.js +2 -2
  578. package/lib/components/Popover/Popover.styles.js.map +1 -1
  579. package/lib/components/Popover/modifiers.d.ts.map +1 -1
  580. package/lib/components/Popover/modifiers.js +11 -5
  581. package/lib/components/Popover/modifiers.js.map +1 -1
  582. package/lib/components/Progress/Progress.d.ts.map +1 -1
  583. package/lib/components/Progress/Progress.js +2 -2
  584. package/lib/components/Progress/Progress.js.map +1 -1
  585. package/lib/components/Progress/Progress.styles.d.ts +1 -1
  586. package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
  587. package/lib/components/Progress/Progress.styles.js +7 -7
  588. package/lib/components/Progress/Progress.styles.js.map +1 -1
  589. package/lib/components/Progress/Progress.types.d.ts +4 -0
  590. package/lib/components/Progress/Progress.types.d.ts.map +1 -1
  591. package/lib/components/Progress/Progress.types.js.map +1 -1
  592. package/lib/components/RadioCheck/RadioCheck.d.ts +6 -30
  593. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  594. package/lib/components/RadioCheck/RadioCheck.js +1 -2
  595. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  596. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
  597. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +1 -1
  598. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  599. package/lib/components/SearchInput/SearchInput.d.ts +19 -6
  600. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  601. package/lib/components/SearchInput/SearchInput.js +5 -1
  602. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  603. package/lib/components/SearchInput/SearchInput.styles.d.ts +3 -3
  604. package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
  605. package/lib/components/SearchInput/SearchInput.styles.js +15 -15
  606. package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
  607. package/lib/components/Select/Select.d.ts +1 -1
  608. package/lib/components/Select/Select.test-ids.d.ts +1 -1
  609. package/lib/components/Select/Select.test-ids.d.ts.map +1 -1
  610. package/lib/components/Slider/Slider.d.ts +1 -1
  611. package/lib/components/Slider/Slider.js +1 -1
  612. package/lib/components/Slider/Slider.js.map +1 -1
  613. package/lib/components/Slider/Slider.styles.d.ts +1 -1
  614. package/lib/components/Slider/Slider.test-ids.d.ts +1 -1
  615. package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -1
  616. package/lib/components/SummaryItem/SummaryItem.d.ts +6 -1
  617. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  618. package/lib/components/SummaryItem/SummaryItem.js +13 -5
  619. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  620. package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts +1 -1
  621. package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts.map +1 -1
  622. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  623. package/lib/components/SummaryList/SummaryList.js +9 -9
  624. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  625. package/lib/components/Tabs/Tab.d.ts +7 -3
  626. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  627. package/lib/components/Tabs/Tab.js +83 -23
  628. package/lib/components/Tabs/Tab.js.map +1 -1
  629. package/lib/components/Tabs/TabPanel.d.ts +13 -2
  630. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  631. package/lib/components/Tabs/TabPanel.js +60 -5
  632. package/lib/components/Tabs/TabPanel.js.map +1 -1
  633. package/lib/components/Tabs/Tabs.d.ts +0 -1
  634. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  635. package/lib/components/Tabs/Tabs.js +97 -35
  636. package/lib/components/Tabs/Tabs.js.map +1 -1
  637. package/lib/components/Tabs/Tabs.styles.d.ts +17 -0
  638. package/lib/components/Tabs/Tabs.styles.d.ts.map +1 -0
  639. package/lib/components/Tabs/Tabs.styles.js +110 -0
  640. package/lib/components/Tabs/Tabs.styles.js.map +1 -0
  641. package/lib/components/Tabs/TabsContext.d.ts +6 -0
  642. package/lib/components/Tabs/TabsContext.d.ts.map +1 -0
  643. package/lib/components/Tabs/TabsContext.js +6 -0
  644. package/lib/components/Tabs/TabsContext.js.map +1 -0
  645. package/lib/components/Tabs/index.d.ts +1 -0
  646. package/lib/components/Tabs/index.d.ts.map +1 -1
  647. package/lib/components/Tabs/index.js +1 -0
  648. package/lib/components/Tabs/index.js.map +1 -1
  649. package/lib/components/Text/Text.js +1 -1
  650. package/lib/components/Text/Text.js.map +1 -1
  651. package/lib/components/TextArea/TextArea.d.ts +1 -1
  652. package/lib/components/TextArea/TextArea.test-ids.d.ts +1 -1
  653. package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -1
  654. package/lib/components/Toaster/Toaster.d.ts +1 -1
  655. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  656. package/lib/components/Toaster/Toaster.js +117 -21
  657. package/lib/components/Toaster/Toaster.js.map +1 -1
  658. package/lib/components/Toaster/Toaster.test-ids.d.ts +1 -1
  659. package/lib/components/Toaster/Toaster.test-ids.d.ts.map +1 -1
  660. package/lib/components/Toaster/Toaster.types.d.ts +17 -4
  661. package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
  662. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  663. package/lib/components/Tooltip/Tooltip.d.ts +8 -3
  664. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  665. package/lib/components/Tooltip/Tooltip.js +20 -5
  666. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  667. package/lib/components/Tooltip/Tooltip.test-ids.d.ts +1 -1
  668. package/lib/components/Tooltip/Tooltip.test-ids.d.ts.map +1 -1
  669. package/lib/components/Tree/StandardTree.styles.d.ts +1 -1
  670. package/lib/components/Tree/Tree.d.ts +1 -1
  671. package/lib/components/Tree/Tree.test-ids.d.ts +2 -2
  672. package/lib/components/Tree/Tree.test-ids.d.ts.map +1 -1
  673. package/lib/hooks/index.d.ts +2 -0
  674. package/lib/hooks/index.d.ts.map +1 -1
  675. package/lib/hooks/index.js +2 -0
  676. package/lib/hooks/index.js.map +1 -1
  677. package/lib/hooks/useArrows.d.ts.map +1 -1
  678. package/lib/hooks/useArrows.js +3 -1
  679. package/lib/hooks/useArrows.js.map +1 -1
  680. package/lib/hooks/useEvent.d.ts +5 -0
  681. package/lib/hooks/useEvent.d.ts.map +1 -1
  682. package/lib/hooks/useEvent.js.map +1 -1
  683. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  684. package/lib/hooks/useFocusWithin.js +14 -8
  685. package/lib/hooks/useFocusWithin.js.map +1 -1
  686. package/lib/hooks/useI18n.d.ts +155 -4
  687. package/lib/hooks/useI18n.d.ts.map +1 -1
  688. package/lib/hooks/useRefMap.d.ts +8 -0
  689. package/lib/hooks/useRefMap.d.ts.map +1 -0
  690. package/lib/hooks/useRefMap.js +27 -0
  691. package/lib/hooks/useRefMap.js.map +1 -0
  692. package/lib/hooks/useScrollToggle.d.ts.map +1 -1
  693. package/lib/hooks/useScrollToggle.js +1 -0
  694. package/lib/hooks/useScrollToggle.js.map +1 -1
  695. package/lib/hooks/useSimpleStoreInstance.d.ts +9 -0
  696. package/lib/hooks/useSimpleStoreInstance.d.ts.map +1 -0
  697. package/lib/hooks/useSimpleStoreInstance.js +13 -0
  698. package/lib/hooks/useSimpleStoreInstance.js.map +1 -0
  699. package/lib/hooks/useTestIds.d.ts +1 -1
  700. package/lib/hooks/useTestIds.d.ts.map +1 -1
  701. package/lib/hooks/useTestIds.js +1 -1
  702. package/lib/hooks/useTestIds.js.map +1 -1
  703. package/lib/i18n/default.d.ts +155 -4
  704. package/lib/i18n/default.d.ts.map +1 -1
  705. package/lib/i18n/default.js +178 -11
  706. package/lib/i18n/default.js.map +1 -1
  707. package/lib/i18n/i18n.d.ts +155 -4
  708. package/lib/i18n/i18n.d.ts.map +1 -1
  709. package/lib/index.d.ts +2 -0
  710. package/lib/index.d.ts.map +1 -1
  711. package/lib/index.js +2 -0
  712. package/lib/index.js.map +1 -1
  713. package/lib/styles/GlobalStyle.d.ts +1 -1
  714. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  715. package/lib/styles/GlobalStyle.js +6 -1
  716. package/lib/styles/GlobalStyle.js.map +1 -1
  717. package/lib/styles/mixins.d.ts +3 -0
  718. package/lib/styles/mixins.d.ts.map +1 -0
  719. package/lib/styles/mixins.js +14 -0
  720. package/lib/styles/mixins.js.map +1 -0
  721. package/lib/theme/ThemeMachine.d.ts.map +1 -1
  722. package/lib/theme/ThemeMachine.js.map +1 -1
  723. package/lib/theme/theme.d.ts +18 -24
  724. package/lib/theme/theme.d.ts.map +1 -1
  725. package/lib/theme/themeDefinition.json +9 -14
  726. package/lib/theme/themeOverrides.schema.json +13 -18
  727. package/lib/types/types.d.ts +6 -4
  728. package/lib/types/types.d.ts.map +1 -1
  729. package/lib/types/types.js.map +1 -1
  730. package/lib/utils/createStringMatcher.d.ts +1 -1
  731. package/lib/utils/createStringMatcher.d.ts.map +1 -1
  732. package/lib/utils/createStringMatcher.js +4 -1
  733. package/lib/utils/createStringMatcher.js.map +1 -1
  734. package/lib/utils/formatListToLocaleString.d.ts.map +1 -1
  735. package/lib/utils/formatListToLocaleString.js +5 -2
  736. package/lib/utils/formatListToLocaleString.js.map +1 -1
  737. package/lib/utils/index.d.ts +1 -0
  738. package/lib/utils/index.d.ts.map +1 -1
  739. package/lib/utils/index.js +1 -0
  740. package/lib/utils/index.js.map +1 -1
  741. package/lib/utils/isPositionWithinRect.d.ts +12 -0
  742. package/lib/utils/isPositionWithinRect.d.ts.map +1 -0
  743. package/lib/utils/isPositionWithinRect.js +11 -0
  744. package/lib/utils/isPositionWithinRect.js.map +1 -0
  745. package/lib/utils/withTestIds.d.ts +1 -1
  746. package/package.json +10 -7
  747. package/lib/components/Location/types.d.ts +0 -45
  748. package/lib/components/Location/types.d.ts.map +0 -1
  749. package/lib/components/Location/types.js +0 -10
  750. package/lib/components/Location/types.js.map +0 -1
@@ -1,67 +1,41 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
3
- import styled, { css } from 'styled-components';
4
- import { hideVisually } from 'polished';
5
- import { useConsolidatedRef, useI18n, useUID, useDirection, useTestIds } from '../../hooks';
6
- import FormControl from '../FormControl';
7
- import { defaultThemeProp } from '../../theme';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
+ import { MetaList, VisuallyHiddenText } from '@pega/cosmos-react-core';
4
+ import { useConsolidatedRef, useI18n, useUID, useTestIds, usePrevious, useElement, useModalManager, useModalContext } from '../../hooks';
8
5
  import Flex from '../Flex';
9
6
  import Text from '../Text';
10
7
  import Icon, { registerIcon } from '../Icon';
11
8
  import * as paperClipIcon from '../Icon/icons/paper-clip.icon';
12
- import FormField from '../FormField';
13
- import Grid from '../Grid';
14
- import { getFocusables, withTestIds } from '../../utils';
9
+ import { getActiveElement, getFocusables, withTestIds } from '../../utils';
10
+ import Tooltip from '../Tooltip';
11
+ import Button from '../Button';
12
+ import Modal, {} from '../Modal';
15
13
  import { getFileInputTestIds } from './File.test-ids';
16
14
  import FileList from './FileList';
17
15
  import FileItem from './FileItem';
16
+ import { StyledBareButton, StyledDropZone, StyledFileInput, StyledIconWrapper, StyledAttachedFileCount, StyledSingleFileWrapper, StyledUploadStatus, StyledFlex, StyledFormField, StyledFileInputControl, StyledDownloadAllButton } from './FileInput.styles';
18
17
  registerIcon(paperClipIcon);
19
- export const StyledDropZone = styled(FormControl)(({ dragOver, theme: { base: { spacing }, components } }) => {
20
- return css `
21
- padding: calc(2 * ${spacing});
22
- height: ${components.input.height};
23
- border-style: dashed;
24
- cursor: pointer;
25
-
26
- ${dragOver &&
27
- css `
28
- border-style: solid;
29
- `}
30
- `;
31
- });
32
- StyledDropZone.defaultProps = defaultThemeProp;
33
- export const StyledFileInput = styled.div(({ theme }) => {
34
- return css `
35
- position: relative;
36
-
37
- input {
38
- ${hideVisually}
39
- }
40
-
41
- input:enabled:focus + ${StyledDropZone} {
42
- box-shadow: ${theme.components['form-control'][':focus']['box-shadow']};
43
- }
44
- `;
45
- });
46
- StyledFileInput.defaultProps = defaultThemeProp;
47
- const StyledInteractiveText = styled.span(({ theme }) => {
48
- return css `
49
- color: ${theme.base.palette.interactive};
50
- `;
51
- });
52
- StyledInteractiveText.defaultProps = defaultThemeProp;
53
- const StyledSingleFileWrapper = styled.div `
54
- display: contents;
55
- `;
56
- const FileInput = forwardRef(function FileInput(props, ref) {
18
+ const Component = props => {
19
+ const { compact, multiple, status, count, dragOver = false, readOnly } = props;
20
+ const t = useI18n();
21
+ const attachedFileCount = multiple && count ? (_jsx(StyledAttachedFileCount, { children: t('number_of_items', [count], { count }) })) : undefined;
22
+ return (_jsxs(_Fragment, { children: [_jsx(StyledUploadStatus, { item: { grow: 1 }, container: { justify: compact && multiple ? 'start' : 'center', alignItems: 'center' }, status: status, dragOver: dragOver, readOnly: readOnly, children: _jsx(Text, { variant: 'secondary', children: compact
23
+ ? attachedFileCount
24
+ : t('file_upload_text_main', [
25
+ t(multiple ? 'file_upload_text_multiple' : 'file_upload_text_one')
26
+ ]) }) }), _jsx(StyledIconWrapper, { container: { justify: 'center', alignItems: 'center' }, children: _jsx(Icon, { name: 'paper-clip' }) })] }));
27
+ };
28
+ const BaseFileInput = forwardRef(function FileInput(props, ref) {
57
29
  const uid = useUID();
58
- const { testId, id = uid, label, labelHidden, info, required = false, disabled = false, files, onFilesAdded, multiple = false, status, additionalInfo, accept, ...restProps } = props;
30
+ const { testId, id = uid, label, labelHidden, info, required = false, disabled = false, readOnly = false, files, onDownloadAll, onFilesAdded, multiple = false, status, additionalInfo, accept, compact = false, previewFromActions = false, ...restProps } = props;
59
31
  const testIds = useTestIds(testId, getFileInputTestIds);
60
- const icon = _jsx(Icon, { name: 'paper-clip' });
32
+ const [target, setTarget] = useElement();
61
33
  const inputRef = useConsolidatedRef(ref);
62
34
  const fileItemListRef = useRef();
63
- // Tracks whether at least one file is uploaded -- used for updating the focus to DropZone when the files are deleted
64
- const isFilesAdded = useRef(false);
35
+ const activeElement = getActiveElement();
36
+ const activeElementInList = fileItemListRef.current?.contains(activeElement);
37
+ const isInputActiveElement = activeElement === inputRef.current;
38
+ const compactWithSingleAttach = compact && !multiple;
65
39
  const onChange = useCallback((e) => {
66
40
  if (e.target.files) {
67
41
  onFilesAdded?.(Array.from(e.target.files));
@@ -79,40 +53,161 @@ const FileInput = forwardRef(function FileInput(props, ref) {
79
53
  }, [onFilesAdded]);
80
54
  const t = useI18n();
81
55
  const [dragOver, setDragOver] = useState(false);
82
- const { ltr, rtl } = useDirection();
83
56
  const hideFileInput = !multiple && files && files.length > 0;
84
- const fileInput = (_jsxs(StyledFileInput, { children: [_jsx("input", { "data-testid": testIds.control, ...restProps, ref: inputRef, type: 'file', id: id, disabled: disabled, onChange: onChange, multiple: multiple, accept: Array.isArray(accept) ? accept.join(',') : accept }), _jsxs(Flex, { container: { alignItems: 'center', justify: 'center' }, item: { grow: 1 }, as: StyledDropZone, dragOver: dragOver, onClick: () => {
57
+ const fileInput = (_jsxs(StyledFileInput, { children: [_jsx("input", { "data-testid": testIds.control, ...restProps, ref: inputRef, type: 'file', id: id, required: required, disabled: disabled, readOnly: readOnly, onChange: onChange, onFocus: () => {
58
+ if (target) {
59
+ target.dispatchEvent(new Event('focusin'));
60
+ }
61
+ }, onBlur: () => {
62
+ if (target) {
63
+ target.dispatchEvent(new Event('focusout'));
64
+ }
65
+ }, multiple: multiple, accept: Array.isArray(accept) ? accept.join(',') : accept, "aria-describedby": `${id}-info`, onClick: readOnly
66
+ ? e => {
67
+ e.preventDefault();
68
+ }
69
+ : undefined }), _jsx(Flex, { container: true, as: StyledDropZone, disabled: disabled, readOnly: readOnly, onClick: () => {
85
70
  inputRef.current?.focus();
86
- inputRef.current?.click();
87
- }, onDragOver: (e) => {
88
- e.preventDefault();
89
- }, onDragEnter: () => setDragOver(true), onDragLeave: () => setDragOver(false), onDrop: (e) => {
90
- e.preventDefault();
91
- setDragOver(false);
92
- onFilesAdded?.(Array.from(e.dataTransfer.files));
93
- }, children: [ltr && icon, _jsxs(Text, { variant: 'primary', children: ["\u00A0", t('file_upload_text_main', [
94
- _jsx(StyledInteractiveText, { children: t(multiple ? 'file_upload_text_multiple' : 'file_upload_text_one') })
95
- ]), "\u00A0"] }), rtl && icon] })] }));
96
- const fileItemList = hideFileInput ? (_jsx(StyledSingleFileWrapper, { "data-testid": testIds.files, ref: element => {
71
+ if (!readOnly) {
72
+ inputRef.current?.click();
73
+ }
74
+ }, ...(!disabled && !readOnly
75
+ ? {
76
+ onDragOver: (e) => {
77
+ e.preventDefault();
78
+ },
79
+ onDragEnter: () => setDragOver(true),
80
+ onDragLeave: () => setDragOver(false),
81
+ onDrop: (e) => {
82
+ e.preventDefault();
83
+ setDragOver(false);
84
+ const fileList = Array.from(e.dataTransfer.files);
85
+ onFilesAdded?.(multiple ? fileList : fileList.slice(0, 1));
86
+ }
87
+ }
88
+ : undefined), compactMode: compact, ref: setTarget, children: _jsx(Component, { compact: compact, multiple: multiple, status: status, dragOver: dragOver, readOnly: readOnly }) }), compactWithSingleAttach && target && (_jsx(Tooltip, { target: target, describeTarget: true, children: t('file_upload_text_main', [t('file_upload_text_one')]) }))] }));
89
+ const getReadOnlyFile = (file) => {
90
+ const readOnlyFile = { ...file };
91
+ delete readOnlyFile.onCancel;
92
+ delete readOnlyFile.onEdit;
93
+ delete readOnlyFile.onDelete;
94
+ delete readOnlyFile.progress;
95
+ return readOnlyFile;
96
+ };
97
+ const fileItemList = hideFileInput ? (_jsx(StyledSingleFileWrapper, { "data-testid": testIds.files, compact: compact, ref: element => {
97
98
  if (element)
98
99
  fileItemListRef.current = element;
99
- }, children: _jsx(FileItem, { ...files[0] }) })) : (_jsx(FileList, { type: 'item', items: files ?? [], "data-testid": testIds.files, ref: element => {
100
+ }, children: _jsx(FileItem, { ...(readOnly ? getReadOnlyFile(files[0]) : files[0]), compact: compact, previewFromActions: compactWithSingleAttach && previewFromActions, disabled: disabled }) })) : (_jsx(FileList, { type: 'item', items: readOnly
101
+ ? files?.map(file => {
102
+ return getReadOnlyFile(file);
103
+ }) ?? []
104
+ : files ?? [], "data-testid": testIds.files, disabled: disabled, ref: element => {
100
105
  if (element)
101
106
  fileItemListRef.current = element;
102
107
  } }));
108
+ const prevFiles = usePrevious(files);
103
109
  useEffect(() => {
104
- if (files && files.length > 0 && !isFilesAdded.current)
105
- isFilesAdded.current = true;
106
- else if (files?.length === 0 && isFilesAdded.current) {
107
- isFilesAdded.current = false;
108
- inputRef.current?.focus();
109
- }
110
- if (hideFileInput && fileItemListRef.current) {
110
+ if (!multiple &&
111
+ prevFiles?.length === 0 &&
112
+ files?.length === 1 &&
113
+ fileItemListRef.current &&
114
+ isInputActiveElement) {
111
115
  getFocusables(fileItemListRef.current)[0]?.focus();
112
116
  }
117
+ if (prevFiles?.length === 1 && files?.length === 0 && activeElementInList) {
118
+ inputRef.current?.focus();
119
+ }
113
120
  }, [files]);
114
121
  const renderElement = hideFileInput ? fileItemList : fileInput;
115
- return (_jsxs(Grid, { container: { rowGap: hideFileInput ? undefined : 1 }, children: [label ? (_jsx(FormField, { testId: testIds, label: label, labelHidden: labelHidden, id: id, info: info, required: required, disabled: !hideFileInput && disabled, status: status, additionalInfo: additionalInfo, children: renderElement })) : (renderElement), !hideFileInput && fileItemList] }));
122
+ const fileInputInfoActions = useMemo(() => {
123
+ if (info && !onDownloadAll) {
124
+ return info;
125
+ }
126
+ const downloadAllButton = (_jsx(Button, { onClick: onDownloadAll, variant: 'link', children: t('download_all') }));
127
+ if (onDownloadAll && !info && files && files.length > 1 && multiple) {
128
+ return downloadAllButton;
129
+ }
130
+ if (info && onDownloadAll) {
131
+ if (files && files.length > 1 && multiple) {
132
+ return _jsx(MetaList, { items: [info, downloadAllButton] });
133
+ }
134
+ return info;
135
+ }
136
+ }, [info, onDownloadAll]);
137
+ return (_jsxs(Flex, { container: { rowGap: hideFileInput ? undefined : 1, direction: 'column' }, as: StyledFileInputControl, status: status, children: [label ? (_jsx(StyledFormField, { testId: testIds, label: _jsxs(_Fragment, { children: [label, readOnly && _jsx(VisuallyHiddenText, { children: t('read_only') })] }), labelHidden: labelHidden, id: id, info: fileInputInfoActions, required: required, disabled: !hideFileInput && disabled, readOnly: readOnly, status: status, additionalInfo: additionalInfo, compactMode: compactWithSingleAttach, children: _jsxs(_Fragment, { children: [renderElement, readOnly && files && files.length > 1 && multiple && (_jsx(StyledDownloadAllButton, { variant: 'link', onClick: onDownloadAll, children: t('download_all') }))] }) })) : (renderElement), multiple && !compact && files && files.length > 0 && fileItemList] }));
138
+ });
139
+ const AttachFilesModal = ({ modalContent, modal, readOnly }) => {
140
+ const t = useI18n();
141
+ const { dismiss } = useModalContext();
142
+ const formActions = (_jsxs(_Fragment, { children: [_jsx(Button, { disabled: modal?.loading, onClick: () => {
143
+ if (modal?.onCancel)
144
+ modal.onCancel({ close: dismiss });
145
+ }, children: t('cancel') }), _jsx(Button, { disabled: modal?.loading, type: 'submit', variant: 'primary', onClick: () => {
146
+ if (modal?.onSubmit)
147
+ modal.onSubmit({ close: dismiss });
148
+ }, children: t('submit') })] }));
149
+ return (_jsx(Modal, { progress: modal?.loading, heading: t('attach_files'), actions: !readOnly ? formActions : undefined, onBeforeOpen: modal?.onBeforeOpen, children: modalContent }));
150
+ };
151
+ const FileInput = forwardRef(function FileInput(props, ref) {
152
+ const uid = useUID();
153
+ const { modal, count, ...baseFileInputProps } = props;
154
+ const { id = uid, label, labelHidden, info, required = false, disabled = false, readOnly = false, onFilesAdded, multiple = false, status, additionalInfo, compact = false } = baseFileInputProps;
155
+ const t = useI18n();
156
+ const [dragOver, setDragOver] = useState(false);
157
+ const [buttonEl, setButtonEl] = useElement();
158
+ const { create } = useModalManager();
159
+ const modalMethods = useRef();
160
+ let modalContent;
161
+ if (compact && multiple) {
162
+ modalContent = (_jsx(BaseFileInput, { ...baseFileInputProps, multiple: true, compact: false, labelHidden: false, ref: ref }));
163
+ }
164
+ const modalProps = {
165
+ modal,
166
+ modalContent
167
+ };
168
+ useEffect(() => {
169
+ if (compact && multiple && modal) {
170
+ modalMethods.current?.update({
171
+ modal,
172
+ modalContent,
173
+ readOnly
174
+ });
175
+ }
176
+ }, [compact, multiple, modal, readOnly, modalProps]);
177
+ useEffect(() => {
178
+ return () => {
179
+ if (modalMethods.current) {
180
+ modalMethods.current?.dismiss();
181
+ modalMethods.current?.unmount();
182
+ }
183
+ };
184
+ }, []);
185
+ if (compact && multiple) {
186
+ const render = (_jsxs(Flex, { container: true, children: [_jsx(StyledBareButton, { id: id, onClick: () => {
187
+ modalMethods.current = create(AttachFilesModal, { ...modalProps, readOnly }, { dismissible: readOnly });
188
+ }, "aria-label": count && count > 0
189
+ ? `${t('attach_review')} ${t('number_of_items', [count], { count })}`
190
+ : undefined, "aria-describedby": `${id}-info`, disabled: disabled, ...(!disabled && !readOnly
191
+ ? {
192
+ onDragOver: (e) => {
193
+ e.preventDefault();
194
+ },
195
+ onDragEnter: () => setDragOver(true),
196
+ onDragLeave: () => setDragOver(false),
197
+ onDrop: (e) => {
198
+ e.preventDefault();
199
+ setDragOver(false);
200
+ onFilesAdded?.(Array.from(e.dataTransfer.files));
201
+ if (buttonEl)
202
+ buttonEl.click();
203
+ }
204
+ }
205
+ : undefined), ref: setButtonEl, children: _jsx(StyledFlex, { container: true, children: _jsx(Component, { compact: compact, multiple: multiple, status: status, count: count, dragOver: dragOver, readOnly: readOnly }) }) }), buttonEl && (_jsx(Tooltip, { target: buttonEl, describeTarget: count === 0, children: count && count > 0
206
+ ? t('attach_review')
207
+ : t('file_upload_text_main', [t('file_upload_text_multiple')]) }))] }));
208
+ return label ? (_jsx(StyledFormField, { label: label, labelHidden: labelHidden, id: id, info: info, required: required, disabled: disabled, readOnly: readOnly, status: status, additionalInfo: additionalInfo, compactMode: true, children: render })) : (render);
209
+ }
210
+ return _jsx(BaseFileInput, { ...baseFileInputProps, ref: ref });
116
211
  });
117
212
  export default withTestIds(FileInput, getFileInputTestIds);
118
213
  //# sourceMappingURL=FileInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.js","sourceRoot":"","sources":["../../../src/components/File/FileInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AASxC,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,IAAI,MAAM,SAAS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,EAAE,KAAK,EAAE,CAAC;SACpD;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,aAAa,GAAG,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;IAE/D,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,aACvD,KAAK,CAAC,CAAC,CAAC,CACP,KAAC,SAAS,IACR,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,aAAa,IAAI,QAAQ,EACpC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,YAE7B,aAAa,GACJ,CACb,CAAC,CAAC,CAAC,CACF,aAAa,CACd,EACA,CAAC,aAAa,IAAI,YAAY,IAC1B,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport type { FunctionComponent, Ref, ChangeEvent, PropsWithoutRef, DragEvent } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport type {\n BaseProps,\n ForwardProps,\n NoChildrenProp,\n PropsWithDefaults,\n TestIdProp\n} from '../../types';\nimport { useConsolidatedRef, useI18n, useUID, useDirection, useTestIds } from '../../hooks';\nimport FormControl from '../FormControl';\nimport type { FormControlProps } from '../FormControl';\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport Text from '../Text';\nimport Icon, { registerIcon } from '../Icon';\nimport * as paperClipIcon from '../Icon/icons/paper-clip.icon';\nimport FormField from '../FormField';\nimport Grid from '../Grid';\nimport { getFocusables, withTestIds } from '../../utils';\n\nimport type { FileItemProps } from './FileItem';\nimport { getFileInputTestIds } from './File.test-ids';\nimport FileList from './FileList';\nimport FileItem from './FileItem';\n\nregisterIcon(paperClipIcon);\n\ntype FileInputPropsWithDefaults = PropsWithDefaults<FileInputProps>;\n\nexport interface FileInputProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** Called when files are added either via the input or drop zone. */\n onFilesAdded?: (files: File[]) => void;\n /**\n * Allow multiple files to be selected from the OS specific file browser.\n * NOTE: This does not restrict multiple files from being added via drag and drop.\n * Restrict multi file drag and drop via onFilesAdded and custom info message.\n * @default false\n */\n multiple?: boolean;\n /** An array of files that have been uploaded. */\n files?: FileItemProps[];\n /**\n * Specify allowed file types.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept}\n */\n accept?: string | string[];\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** Ref for the input element within the component's dom structure. */\n ref?: Ref<HTMLInputElement>;\n}\n\nexport const StyledDropZone = styled(FormControl)<{ dragOver: boolean }>(\n ({\n dragOver,\n theme: {\n base: { spacing },\n components\n }\n }) => {\n return css`\n padding: calc(2 * ${spacing});\n height: ${components.input.height};\n border-style: dashed;\n cursor: pointer;\n\n ${dragOver &&\n css`\n border-style: solid;\n `}\n `;\n }\n);\n\nStyledDropZone.defaultProps = defaultThemeProp;\n\nexport const StyledFileInput = styled.div<FileInputPropsWithDefaults & ForwardProps>(\n ({ theme }) => {\n return css`\n position: relative;\n\n input {\n ${hideVisually}\n }\n\n input:enabled:focus + ${StyledDropZone} {\n box-shadow: ${theme.components['form-control'][':focus']['box-shadow']};\n }\n `;\n }\n);\n\nStyledFileInput.defaultProps = defaultThemeProp;\n\nconst StyledInteractiveText = styled.span(({ theme }) => {\n return css`\n color: ${theme.base.palette.interactive};\n `;\n});\n\nStyledInteractiveText.defaultProps = defaultThemeProp;\n\nconst StyledSingleFileWrapper = styled.div`\n display: contents;\n`;\n\nconst FileInput: FunctionComponent<FileInputProps & ForwardProps> = forwardRef(function FileInput(\n props: PropsWithoutRef<FileInputProps>,\n ref: FileInputProps['ref']\n) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n label,\n labelHidden,\n info,\n required = false,\n disabled = false,\n files,\n onFilesAdded,\n multiple = false,\n status,\n additionalInfo,\n accept,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getFileInputTestIds);\n\n const icon = <Icon name='paper-clip' />;\n const inputRef = useConsolidatedRef(ref);\n const fileItemListRef = useRef<HTMLDivElement>();\n\n // Tracks whether at least one file is uploaded -- used for updating the focus to DropZone when the files are deleted\n const isFilesAdded = useRef(false);\n\n const onChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files) {\n onFilesAdded?.(Array.from(e.target.files));\n }\n /**\n * WHY are we doing this?\n * We are not working with the \"value\" prop of the input but rather the File instances that are created.\n * The consumer of this component should manage an array or File(s) and allow for a user to remove a selected file.\n * Since we can not modify the input value of files for browser security reasons,\n * and since setting the files property is less than ideal, we reset/toggle the input to a fresh state after a render.\n * This enables onChange to fire even if the user had just previously selected a file, removed it, and selected it again.\n */\n if (inputRef.current) inputRef.current.value = '';\n },\n [onFilesAdded]\n );\n\n const t = useI18n();\n const [dragOver, setDragOver] = useState(false);\n const { ltr, rtl } = useDirection();\n const hideFileInput = !multiple && files && files.length > 0;\n\n const fileInput = (\n <StyledFileInput>\n <input\n data-testid={testIds.control}\n {...restProps}\n ref={inputRef}\n type='file'\n id={id}\n disabled={disabled}\n onChange={onChange}\n multiple={multiple}\n accept={Array.isArray(accept) ? accept.join(',') : accept}\n />\n <Flex\n container={{ alignItems: 'center', justify: 'center' }}\n item={{ grow: 1 }}\n as={StyledDropZone}\n dragOver={dragOver}\n onClick={() => {\n inputRef.current?.focus();\n inputRef.current?.click();\n }}\n onDragOver={(e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n }}\n onDragEnter={() => setDragOver(true)}\n onDragLeave={() => setDragOver(false)}\n onDrop={(e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n setDragOver(false);\n onFilesAdded?.(Array.from(e.dataTransfer.files));\n }}\n >\n {ltr && icon}\n <Text variant='primary'>\n &nbsp;\n {t('file_upload_text_main', [\n <StyledInteractiveText>\n {t(multiple ? 'file_upload_text_multiple' : 'file_upload_text_one')}\n </StyledInteractiveText>\n ])}\n &nbsp;\n </Text>\n {rtl && icon}\n </Flex>\n </StyledFileInput>\n );\n\n const fileItemList = hideFileInput ? (\n <StyledSingleFileWrapper\n data-testid={testIds.files}\n ref={element => {\n if (element) fileItemListRef.current = element;\n }}\n >\n <FileItem {...files[0]} />\n </StyledSingleFileWrapper>\n ) : (\n <FileList\n type='item'\n items={files ?? []}\n data-testid={testIds.files}\n ref={element => {\n if (element) fileItemListRef.current = element;\n }}\n />\n );\n\n useEffect(() => {\n if (files && files.length > 0 && !isFilesAdded.current) isFilesAdded.current = true;\n else if (files?.length === 0 && isFilesAdded.current) {\n isFilesAdded.current = false;\n inputRef.current?.focus();\n }\n\n if (hideFileInput && fileItemListRef.current) {\n getFocusables(fileItemListRef.current)[0]?.focus();\n }\n }, [files]);\n\n const renderElement = hideFileInput ? fileItemList : fileInput;\n\n return (\n <Grid container={{ rowGap: hideFileInput ? undefined : 1 }}>\n {label ? (\n <FormField\n testId={testIds}\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n required={required}\n disabled={!hideFileInput && disabled}\n status={status}\n additionalInfo={additionalInfo}\n >\n {renderElement}\n </FormField>\n ) : (\n renderElement\n )}\n {!hideFileInput && fileItemList}\n </Grid>\n );\n});\n\nexport default withTestIds(FileInput, getFileInputTestIds);\n"]}
1
+ {"version":3,"file":"FileInput.js","sourceRoot":"","sources":["../../../src/components/File/FileInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtF,OAAO,EACL,QAAQ,EAGR,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,kBAAkB,EAClB,OAAO,EACP,MAAM,EACN,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,KAAK,EAAE,EAAqB,MAAM,UAAU,CAAC;AAGpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACv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,YAEhB,KAAC,UAAU,IAAC,SAAS,kBACnB,KAAC,SAAS,IACR,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACS,GACI,EAClB,QAAQ,IAAI,CACX,KAAC,OAAO,IAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,KAAK,CAAC,YACnD,KAAK,IAAI,KAAK,GAAG,CAAC;wBACjB,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC;wBACpB,CAAC,CAAC,CAAC,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,GACxD,CACX,IACI,CACR,CAAC;QAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,WAAW,kBAEV,MAAM,GACS,CACnB,CAAC,CAAC,CAAC,CACF,MAAM,CACP,CAAC;KACH;IAED,OAAO,KAAC,aAAa,OAAK,kBAAkB,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AAC7D,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { FunctionComponent, Ref, ChangeEvent, PropsWithoutRef, DragEvent } from 'react';\n\nimport {\n MetaList,\n type FileListProps,\n type ModalProps,\n VisuallyHiddenText\n} from '@pega/cosmos-react-core';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp, OmitStrict, TestIdProp } from '../../types';\nimport {\n useConsolidatedRef,\n useI18n,\n useUID,\n useTestIds,\n usePrevious,\n useElement,\n useModalManager,\n useModalContext\n} from '../../hooks';\nimport type { FormControlProps } from '../FormControl';\nimport Flex from '../Flex';\nimport Text from '../Text';\nimport Icon, { registerIcon } from '../Icon';\nimport * as paperClipIcon from '../Icon/icons/paper-clip.icon';\nimport { getActiveElement, getFocusables, withTestIds } from '../../utils';\nimport Tooltip from '../Tooltip';\nimport Button from '../Button';\nimport Modal, { type ModalMethods } from '../Modal';\n\nimport type { FileItemProps } from './FileItem';\nimport { getFileInputTestIds } from './File.test-ids';\nimport FileList from './FileList';\nimport FileItem from './FileItem';\nimport {\n StyledBareButton,\n StyledDropZone,\n StyledFileInput,\n StyledIconWrapper,\n StyledAttachedFileCount,\n StyledSingleFileWrapper,\n StyledUploadStatus,\n StyledFlex,\n StyledFormField,\n StyledFileInputControl,\n StyledDownloadAllButton\n} from './FileInput.styles';\n\nregisterIcon(paperClipIcon);\n\n/** Props to be used when rendering compact variant for multiple FileInput. */\ninterface MultiAttachCompactProps {\n /** Modal props */\n modal?: Pick<ModalProps, 'onBeforeOpen'> & {\n /** Callback for cancel button */\n onCancel: ({ close }: { close: () => void }) => void;\n /** Callback for submit button */\n onSubmit: ({ close }: { close: () => void }) => void;\n /** If true renders loading indicator inside Modal. */\n loading?: boolean;\n };\n /** Conveys the number of files attached */\n count?: number;\n}\n\ninterface ComponentProps\n extends Pick<BaseFileInputProps, 'compact' | 'multiple' | 'status' | 'readOnly'>,\n Pick<MultiAttachCompactProps, 'count'> {\n dragOver?: boolean;\n}\n\ninterface BaseFileInputProps\n extends BaseProps,\n NoChildrenProp,\n TestIdProp,\n Pick<FileItemProps, 'previewFromActions'>,\n Pick<FileListProps, 'onDownloadAll'> {\n /** Called when files are added either via the input or drop zone. */\n onFilesAdded?: (files: File[]) => void;\n /**\n * Allow multiple files to be selected from the OS specific file browser.\n * NOTE: This does not restrict multiple files from being added via drag and drop.\n * Restrict multi file drag and drop via onFilesAdded and custom info message.\n * @default false\n */\n multiple?: boolean;\n /**\n * Renders compact variant.\n * @default false\n */\n compact?: boolean;\n /** An array of files that have been uploaded. */\n files?: OmitStrict<FileItemProps, 'previewFromActions'>[];\n /**\n * Specify allowed file types.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept}\n */\n accept?: string | string[];\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** Ref for the input element within the component's dom structure. */\n ref?: Ref<HTMLInputElement>;\n}\n\nexport interface FileInputProps extends BaseFileInputProps, MultiAttachCompactProps {}\n\nconst Component: FunctionComponent<ComponentProps> = props => {\n const { compact, multiple, status, count, dragOver = false, readOnly } = props;\n const t = useI18n();\n\n const attachedFileCount =\n multiple && count ? (\n <StyledAttachedFileCount>{t('number_of_items', [count], { count })}</StyledAttachedFileCount>\n ) : undefined;\n\n return (\n <>\n <StyledUploadStatus\n item={{ grow: 1 }}\n container={{ justify: compact && multiple ? 'start' : 'center', alignItems: 'center' }}\n status={status}\n dragOver={dragOver}\n readOnly={readOnly}\n >\n <Text variant='secondary'>\n {compact\n ? attachedFileCount\n : t('file_upload_text_main', [\n t(multiple ? 'file_upload_text_multiple' : 'file_upload_text_one')\n ])}\n </Text>\n </StyledUploadStatus>\n\n <StyledIconWrapper container={{ justify: 'center', alignItems: 'center' }}>\n <Icon name='paper-clip' />\n </StyledIconWrapper>\n </>\n );\n};\n\nconst BaseFileInput: FunctionComponent<BaseFileInputProps & ForwardProps> = forwardRef(\n function FileInput(props: PropsWithoutRef<BaseFileInputProps>, ref: BaseFileInputProps['ref']) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n label,\n labelHidden,\n info,\n required = false,\n disabled = false,\n readOnly = false,\n files,\n onDownloadAll,\n onFilesAdded,\n multiple = false,\n status,\n additionalInfo,\n accept,\n compact = false,\n previewFromActions = false,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getFileInputTestIds);\n const [target, setTarget] = useElement<HTMLElement>();\n\n const inputRef = useConsolidatedRef(ref);\n const fileItemListRef = useRef<HTMLDivElement>();\n const activeElement = getActiveElement();\n const activeElementInList = fileItemListRef.current?.contains(activeElement);\n const isInputActiveElement = activeElement === inputRef.current;\n const compactWithSingleAttach = compact && !multiple;\n\n const onChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files) {\n onFilesAdded?.(Array.from(e.target.files));\n }\n /**\n * WHY are we doing this?\n * We are not working with the \"value\" prop of the input but rather the File instances that are created.\n * The consumer of this component should manage an array or File(s) and allow for a user to remove a selected file.\n * Since we can not modify the input value of files for browser security reasons,\n * and since setting the files property is less than ideal, we reset/toggle the input to a fresh state after a render.\n * This enables onChange to fire even if the user had just previously selected a file, removed it, and selected it again.\n */\n if (inputRef.current) inputRef.current.value = '';\n },\n [onFilesAdded]\n );\n\n const t = useI18n();\n const [dragOver, setDragOver] = useState(false);\n const hideFileInput = !multiple && files && files.length > 0;\n\n const fileInput = (\n <StyledFileInput>\n <input\n data-testid={testIds.control}\n {...restProps}\n ref={inputRef}\n type='file'\n id={id}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onChange}\n onFocus={() => {\n if (target) {\n target.dispatchEvent(new Event('focusin'));\n }\n }}\n onBlur={() => {\n if (target) {\n target.dispatchEvent(new Event('focusout'));\n }\n }}\n multiple={multiple}\n accept={Array.isArray(accept) ? accept.join(',') : accept}\n aria-describedby={`${id}-info`}\n onClick={\n readOnly\n ? e => {\n e.preventDefault();\n }\n : undefined\n }\n />\n <Flex\n container\n as={StyledDropZone}\n disabled={disabled}\n readOnly={readOnly}\n onClick={() => {\n inputRef.current?.focus();\n if (!readOnly) {\n inputRef.current?.click();\n }\n }}\n {...(!disabled && !readOnly\n ? {\n onDragOver: (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n },\n onDragEnter: () => setDragOver(true),\n onDragLeave: () => setDragOver(false),\n onDrop: (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n setDragOver(false);\n\n const fileList = Array.from(e.dataTransfer.files);\n onFilesAdded?.(multiple ? fileList : fileList.slice(0, 1));\n }\n }\n : undefined)}\n compactMode={compact}\n ref={setTarget}\n >\n <Component\n compact={compact}\n multiple={multiple}\n status={status}\n dragOver={dragOver}\n readOnly={readOnly}\n />\n </Flex>\n {compactWithSingleAttach && target && (\n <Tooltip target={target} describeTarget>\n {t('file_upload_text_main', [t('file_upload_text_one')])}\n </Tooltip>\n )}\n </StyledFileInput>\n );\n\n const getReadOnlyFile = (file: FileItemProps) => {\n const readOnlyFile = { ...file };\n delete readOnlyFile.onCancel;\n delete readOnlyFile.onEdit;\n delete readOnlyFile.onDelete;\n delete readOnlyFile.progress;\n return readOnlyFile;\n };\n\n const fileItemList = hideFileInput ? (\n <StyledSingleFileWrapper\n data-testid={testIds.files}\n compact={compact}\n ref={element => {\n if (element) fileItemListRef.current = element;\n }}\n >\n <FileItem\n {...(readOnly ? getReadOnlyFile(files[0]) : files[0])}\n compact={compact}\n previewFromActions={compactWithSingleAttach && previewFromActions}\n disabled={disabled}\n />\n </StyledSingleFileWrapper>\n ) : (\n <FileList\n type='item'\n items={\n readOnly\n ? files?.map(file => {\n return getReadOnlyFile(file);\n }) ?? []\n : files ?? []\n }\n data-testid={testIds.files}\n disabled={disabled}\n ref={element => {\n if (element) fileItemListRef.current = element;\n }}\n />\n );\n\n const prevFiles = usePrevious(files);\n useEffect(() => {\n if (\n !multiple &&\n prevFiles?.length === 0 &&\n files?.length === 1 &&\n fileItemListRef.current &&\n isInputActiveElement\n ) {\n getFocusables(fileItemListRef.current)[0]?.focus();\n }\n\n if (prevFiles?.length === 1 && files?.length === 0 && activeElementInList) {\n inputRef.current?.focus();\n }\n }, [files]);\n\n const renderElement = hideFileInput ? fileItemList : fileInput;\n\n const fileInputInfoActions = useMemo(() => {\n if (info && !onDownloadAll) {\n return info;\n }\n\n const downloadAllButton = (\n <Button onClick={onDownloadAll} variant='link'>\n {t('download_all')}\n </Button>\n );\n\n if (onDownloadAll && !info && files && files.length > 1 && multiple) {\n return downloadAllButton;\n }\n\n if (info && onDownloadAll) {\n if (files && files.length > 1 && multiple) {\n return <MetaList items={[info, downloadAllButton]} />;\n }\n return info;\n }\n }, [info, onDownloadAll]);\n\n return (\n <Flex\n container={{ rowGap: hideFileInput ? undefined : 1, direction: 'column' }}\n as={StyledFileInputControl}\n status={status}\n >\n {label ? (\n <StyledFormField\n testId={testIds}\n label={\n <>\n {label}\n {readOnly && <VisuallyHiddenText>{t('read_only')}</VisuallyHiddenText>}\n </>\n }\n labelHidden={labelHidden}\n id={id}\n info={fileInputInfoActions}\n required={required}\n disabled={!hideFileInput && disabled}\n readOnly={readOnly}\n status={status}\n additionalInfo={additionalInfo}\n compactMode={compactWithSingleAttach}\n >\n <>\n {renderElement}\n {readOnly && files && files.length > 1 && multiple && (\n <StyledDownloadAllButton variant='link' onClick={onDownloadAll}>\n {t('download_all')}\n </StyledDownloadAllButton>\n )}\n </>\n </StyledFormField>\n ) : (\n renderElement\n )}\n {multiple && !compact && files && files.length > 0 && fileItemList}\n </Flex>\n );\n }\n);\n\nconst AttachFilesModal: FunctionComponent<\n {\n modalContent?: JSX.Element;\n readOnly: FileInputProps['readOnly'];\n } & Pick<MultiAttachCompactProps, 'modal'>\n> = ({ modalContent, modal, readOnly }) => {\n const t = useI18n();\n const { dismiss } = useModalContext();\n\n const formActions = (\n <>\n <Button\n disabled={modal?.loading}\n onClick={() => {\n if (modal?.onCancel) modal.onCancel({ close: dismiss });\n }}\n >\n {t('cancel')}\n </Button>\n\n <Button\n disabled={modal?.loading}\n type='submit'\n variant='primary'\n onClick={() => {\n if (modal?.onSubmit) modal.onSubmit({ close: dismiss });\n }}\n >\n {t('submit')}\n </Button>\n </>\n );\n\n return (\n <Modal\n progress={modal?.loading}\n heading={t('attach_files')}\n actions={!readOnly ? formActions : undefined}\n onBeforeOpen={modal?.onBeforeOpen}\n >\n {modalContent}\n </Modal>\n );\n};\n\nconst FileInput: FunctionComponent<FileInputProps & ForwardProps> = forwardRef(function FileInput(\n props: PropsWithoutRef<FileInputProps>,\n ref: FileInputProps['ref']\n) {\n const uid = useUID();\n const { modal, count, ...baseFileInputProps } = props;\n\n const {\n id = uid,\n label,\n labelHidden,\n info,\n required = false,\n disabled = false,\n readOnly = false,\n onFilesAdded,\n multiple = false,\n status,\n additionalInfo,\n compact = false\n } = baseFileInputProps;\n\n const t = useI18n();\n const [dragOver, setDragOver] = useState(false);\n const [buttonEl, setButtonEl] = useElement<HTMLButtonElement>();\n const { create } = useModalManager();\n const modalMethods = useRef<ModalMethods>();\n\n let modalContent: JSX.Element | undefined;\n\n if (compact && multiple) {\n modalContent = (\n <BaseFileInput\n {...baseFileInputProps}\n multiple\n compact={false}\n labelHidden={false}\n ref={ref}\n />\n );\n }\n\n const modalProps = {\n modal,\n modalContent\n };\n\n useEffect(() => {\n if (compact && multiple && modal) {\n modalMethods.current?.update({\n modal,\n modalContent,\n readOnly\n });\n }\n }, [compact, multiple, modal, readOnly, modalProps]);\n\n useEffect(() => {\n return () => {\n if (modalMethods.current) {\n modalMethods.current?.dismiss();\n modalMethods.current?.unmount();\n }\n };\n }, []);\n\n if (compact && multiple) {\n const render = (\n <Flex container>\n <StyledBareButton\n id={id}\n onClick={() => {\n modalMethods.current = create(\n AttachFilesModal,\n { ...modalProps, readOnly },\n { dismissible: readOnly }\n );\n }}\n aria-label={\n count && count > 0\n ? `${t('attach_review')} ${t('number_of_items', [count], { count })}`\n : undefined\n }\n aria-describedby={`${id}-info`}\n disabled={disabled}\n {...(!disabled && !readOnly\n ? {\n onDragOver: (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n },\n onDragEnter: () => setDragOver(true),\n onDragLeave: () => setDragOver(false),\n onDrop: (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n setDragOver(false);\n onFilesAdded?.(Array.from(e.dataTransfer.files));\n if (buttonEl) buttonEl.click();\n }\n }\n : undefined)}\n ref={setButtonEl}\n >\n <StyledFlex container>\n <Component\n compact={compact}\n multiple={multiple}\n status={status}\n count={count}\n dragOver={dragOver}\n readOnly={readOnly}\n />\n </StyledFlex>\n </StyledBareButton>\n {buttonEl && (\n <Tooltip target={buttonEl} describeTarget={count === 0}>\n {count && count > 0\n ? t('attach_review')\n : t('file_upload_text_main', [t('file_upload_text_multiple')])}\n </Tooltip>\n )}\n </Flex>\n );\n\n return label ? (\n <StyledFormField\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n status={status}\n additionalInfo={additionalInfo}\n compactMode\n >\n {render}\n </StyledFormField>\n ) : (\n render\n );\n }\n\n return <BaseFileInput {...baseFileInputProps} ref={ref} />;\n});\n\nexport default withTestIds(FileInput, getFileInputTestIds);\n"]}
@@ -0,0 +1,26 @@
1
+ import { type FormControlProps } from '../FormControl';
2
+ import type { FileInputProps } from './FileInput';
3
+ export declare const StyledDropZone: import("styled-components").StyledComponent<import("react").FunctionComponent<FormControlProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {
4
+ compactMode: FileInputProps['compact'];
5
+ }, never>;
6
+ export declare const StyledUploadStatus: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Flex").FlexProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {
7
+ status: FormControlProps['status'];
8
+ readOnly: FormControlProps['readOnly'];
9
+ dragOver: boolean;
10
+ }, never>;
11
+ export declare const StyledIconWrapper: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Flex").FlexProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
12
+ export declare const StyledFileInput: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
13
+ export declare const StyledSingleFileWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
14
+ compact: FileInputProps['compact'];
15
+ }, never>;
16
+ export declare const StyledAttachedFileCount: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
17
+ export declare const StyledFlex: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Flex").FlexProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
18
+ export declare const StyledBareButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button/BareButton").BareButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
19
+ export declare const StyledFormField: import("styled-components").StyledComponent<import("react").FC<import("../FormField").FormFieldProps & import("../..").ForwardProps> & {
20
+ getTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
21
+ }, import("styled-components").DefaultTheme, {
22
+ compactMode: FileInputProps['compact'];
23
+ }, never>;
24
+ export declare const StyledFileInputControl: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Flex").FlexProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, Pick<FormControlProps, "status">, never>;
25
+ export declare const StyledDownloadAllButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button").ButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
26
+ //# sourceMappingURL=FileInput.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileInput.styles.d.ts","sourceRoot":"","sources":["../../../src/components/File/FileInput.styles.ts"],"names":[],"mappings":"AAGA,OAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AASpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,cAAc;iBAAsC,cAAc,CAAC,SAAS,CAAC;SAuBxF,CAAC;AAIH,eAAO,MAAM,kBAAkB;YACrB,gBAAgB,CAAC,QAAQ,CAAC;cACxB,gBAAgB,CAAC,UAAU,CAAC;cAC5B,OAAO;SAwCjB,CAAC;AAIH,eAAO,MAAM,iBAAiB,iMAa5B,CAAC;AAIH,eAAO,MAAM,eAAe,yGAgC3B,CAAC;AAIF,eAAO,MAAM,uBAAuB;aAAyB,cAAc,CAAC,SAAS,CAAC;SAarF,CAAC;AAEF,eAAO,MAAM,uBAAuB,0GAWnC,CAAC;AAIF,eAAO,MAAM,UAAU,iMAEtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,oNAwC3B,CAAC;AAIH,eAAO,MAAM,eAAe;;;iBAAoC,cAAc,CAAC,SAAS,CAAC;SASvF,CAAC;AAEH,eAAO,MAAM,sBAAsB,+NAejC,CAAC;AAIH,eAAO,MAAM,uBAAuB,qMAWlC,CAAC"}
@@ -0,0 +1,166 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { hideVisually } from 'polished';
3
+ import FormControl, {} from '../FormControl';
4
+ import { defaultThemeProp } from '../../theme';
5
+ import Flex from '../Flex';
6
+ import BareButton from '../Button/BareButton';
7
+ import FormField, { StyledFormFieldInfo } from '../FormField';
8
+ import { StyledMetaListItem } from '../MetaList/MetaList';
9
+ import Button from '../Button';
10
+ import { calculateFontSize } from '../../styles';
11
+ import { StyledFileItem } from './FileItem';
12
+ export const StyledDropZone = styled(FormControl)(({ compactMode, theme: { base: { 'hit-area': { 'finger-min': fingerMin, compact } }, components } }) => {
13
+ return css `
14
+ height: ${components.input.height};
15
+ border: none;
16
+ cursor: pointer;
17
+
18
+ ${compactMode &&
19
+ css `
20
+ height: ${compact};
21
+ `}
22
+
23
+ @media (pointer: coarse) {
24
+ height: ${fingerMin};
25
+ }
26
+ `;
27
+ });
28
+ StyledDropZone.defaultProps = defaultThemeProp;
29
+ export const StyledUploadStatus = styled(Flex)(({ dragOver, status, readOnly, theme: { base: { 'border-radius': borderRadius }, components: { 'form-field': formField, 'form-control': { 'border-color': borderColor, ':hover': { 'border-color': hoverBorderColor } } } } }) => {
30
+ return css `
31
+ border: 0.0625rem dashed ${borderColor};
32
+ border-start-start-radius: calc(0.5 * ${borderRadius});
33
+ border-end-start-radius: calc(0.5 * ${borderRadius});
34
+ ${!readOnly &&
35
+ css `
36
+ ${status &&
37
+ css `
38
+ border-color: ${formField[status]['status-color']};
39
+ `};
40
+
41
+ ${dragOver &&
42
+ css `
43
+ border-style: solid;
44
+ `}
45
+
46
+ &:hover:not([disabled]):not(:focus, :focus-within) {
47
+ ${!status &&
48
+ css `
49
+ border-color: ${hoverBorderColor};
50
+ `}
51
+ }
52
+ `}
53
+ `;
54
+ });
55
+ StyledUploadStatus.defaultProps = defaultThemeProp;
56
+ export const StyledIconWrapper = styled(Flex)(({ theme: { base: { 'border-radius': borderRadius }, components } }) => {
57
+ return css `
58
+ border: 0.0625rem solid ${components['form-control']['border-color']};
59
+ border-start-end-radius: calc(0.5 * ${borderRadius});
60
+ border-end-end-radius: calc(0.5 * ${borderRadius});
61
+ border-inline-start: none;
62
+ aspect-ratio: 1 / 1;
63
+ `;
64
+ });
65
+ StyledIconWrapper.defaultProps = defaultThemeProp;
66
+ export const StyledFileInput = styled.div(({ theme: { components: { 'form-control': { 'border-color': borderColor, ':focus': { 'box-shadow': boxShadow } } } } }) => {
67
+ return css `
68
+ position: relative;
69
+
70
+ input {
71
+ ${hideVisually}
72
+ }
73
+
74
+ input:enabled:focus + ${StyledDropZone} {
75
+ box-shadow: ${boxShadow};
76
+
77
+ > ${StyledIconWrapper} {
78
+ border: none;
79
+ }
80
+ > ${StyledUploadStatus} {
81
+ border-block: none;
82
+ border-inline-start: none;
83
+ border-inline-end: 0.0625rem dashed ${borderColor};
84
+ }
85
+ }
86
+ `;
87
+ });
88
+ StyledFileInput.defaultProps = defaultThemeProp;
89
+ export const StyledSingleFileWrapper = styled.div(({ compact }) => {
90
+ return css `
91
+ display: contents;
92
+
93
+ ${compact &&
94
+ css `
95
+ > ${StyledFileItem} {
96
+ width: 25ch;
97
+ }
98
+ `};
99
+ `;
100
+ });
101
+ export const StyledAttachedFileCount = styled.span(({ theme: { base: { palette, spacing } } }) => {
102
+ return css `
103
+ padding-inline-start: ${spacing};
104
+ color: ${palette.interactive};
105
+ `;
106
+ });
107
+ StyledAttachedFileCount.defaultProps = defaultThemeProp;
108
+ export const StyledFlex = styled(Flex) `
109
+ height: inherit;
110
+ `;
111
+ export const StyledBareButton = styled(BareButton)(({ theme: { base: { palette, 'hit-area': { 'finger-min': fingerMin, compact }, 'border-radius': baseRadius }, components: { 'form-control': { 'border-color': borderColor, 'border-radius': radius, ':focus': { 'box-shadow': boxShadow } } } } }) => {
112
+ return css `
113
+ height: ${compact};
114
+ width: 25ch;
115
+ cursor: pointer;
116
+ border-radius: calc(${baseRadius} * ${radius});
117
+ background-color: ${palette['primary-background']};
118
+
119
+ @media (pointer: coarse) {
120
+ height: ${fingerMin};
121
+ }
122
+
123
+ &:focus {
124
+ box-shadow: ${boxShadow};
125
+
126
+ ${StyledIconWrapper} {
127
+ border: none;
128
+ }
129
+ ${StyledUploadStatus} {
130
+ border-block: none;
131
+ border-inline-start: none;
132
+ border-inline-end: 0.0625rem dashed ${borderColor};
133
+ }
134
+ }
135
+ `;
136
+ });
137
+ StyledBareButton.defaultProps = defaultThemeProp;
138
+ export const StyledFormField = styled(FormField)(({ compactMode }) => {
139
+ return css `
140
+ ${compactMode &&
141
+ css `
142
+ width: 25ch;
143
+ `};
144
+ `;
145
+ });
146
+ export const StyledFileInputControl = styled(Flex)(({ theme: { base: { spacing }, components: { 'form-field': formField } }, status }) => {
147
+ return css `
148
+ ${StyledFormFieldInfo} {
149
+ margin-block-start: calc(0.5 * ${spacing});
150
+ ${StyledMetaListItem}:first-child {
151
+ color: ${status && formField[status]['status-color']};
152
+ }
153
+ }
154
+ `;
155
+ });
156
+ StyledFileInputControl.defaultProps = defaultThemeProp;
157
+ export const StyledDownloadAllButton = styled(Button)(({ theme: { base: { 'font-size': fontSize, 'font-scale': fontScale, spacing } } }) => {
158
+ const { xxs: infoFontSize } = calculateFontSize(fontSize, fontScale);
159
+ return css `
160
+ font-size: ${infoFontSize};
161
+ margin-block-start: calc(0.5 * ${spacing});
162
+ align-self: flex-start;
163
+ `;
164
+ });
165
+ StyledDownloadAllButton.defaultProps = defaultThemeProp;
166
+ //# sourceMappingURL=FileInput.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileInput.styles.js","sourceRoot":"","sources":["../../../src/components/File/FileInput.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,WAAW,EAAE,EAAyB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,SAAS,EAAE,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CA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AAC,YAAY,GAAG,gBAAgB,CAAC;AAEvD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EACrD,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,EAClE,EACF,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,iBAAiB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACrE,OAAO,GAAG,CAAA;iBACK,YAAY;qCACQ,OAAO;;GAEzC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport FormControl, { type FormControlProps } from '../FormControl';\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport BareButton from '../Button/BareButton';\nimport FormField, { StyledFormFieldInfo } from '../FormField';\nimport { StyledMetaListItem } from '../MetaList/MetaList';\nimport Button from '../Button';\nimport { calculateFontSize } from '../../styles';\n\nimport type { FileInputProps } from './FileInput';\nimport { StyledFileItem } from './FileItem';\n\nexport const StyledDropZone = styled(FormControl)<{ compactMode: FileInputProps['compact'] }>(({\n compactMode,\n theme: {\n base: {\n 'hit-area': { 'finger-min': fingerMin, compact }\n },\n components\n }\n}) => {\n return css`\n height: ${components.input.height};\n border: none;\n cursor: pointer;\n\n ${compactMode &&\n css`\n height: ${compact};\n `}\n\n @media (pointer: coarse) {\n height: ${fingerMin};\n }\n `;\n});\n\nStyledDropZone.defaultProps = defaultThemeProp;\n\nexport const StyledUploadStatus = styled(Flex)<{\n status: FormControlProps['status'];\n readOnly: FormControlProps['readOnly'];\n dragOver: boolean;\n}>(({\n dragOver,\n status,\n readOnly,\n theme: {\n base: { 'border-radius': borderRadius },\n components: {\n 'form-field': formField,\n 'form-control': {\n 'border-color': borderColor,\n ':hover': { 'border-color': hoverBorderColor }\n }\n }\n }\n}) => {\n return css`\n border: 0.0625rem dashed ${borderColor};\n border-start-start-radius: calc(0.5 * ${borderRadius});\n border-end-start-radius: calc(0.5 * ${borderRadius});\n ${!readOnly &&\n css`\n ${status &&\n css`\n border-color: ${formField[status]['status-color']};\n `};\n\n ${dragOver &&\n css`\n border-style: solid;\n `}\n\n &:hover:not([disabled]):not(:focus, :focus-within) {\n ${!status &&\n css`\n border-color: ${hoverBorderColor};\n `}\n }\n `}\n `;\n});\n\nStyledUploadStatus.defaultProps = defaultThemeProp;\n\nexport const StyledIconWrapper = styled(Flex)(({\n theme: {\n base: { 'border-radius': borderRadius },\n components\n }\n}) => {\n return css`\n border: 0.0625rem solid ${components['form-control']['border-color']};\n border-start-end-radius: calc(0.5 * ${borderRadius});\n border-end-end-radius: calc(0.5 * ${borderRadius});\n border-inline-start: none;\n aspect-ratio: 1 / 1;\n `;\n});\n\nStyledIconWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledFileInput = styled.div(\n ({\n theme: {\n components: {\n 'form-control': {\n 'border-color': borderColor,\n ':focus': { 'box-shadow': boxShadow }\n }\n }\n }\n }) => {\n return css`\n position: relative;\n\n input {\n ${hideVisually}\n }\n\n input:enabled:focus + ${StyledDropZone} {\n box-shadow: ${boxShadow};\n\n > ${StyledIconWrapper} {\n border: none;\n }\n > ${StyledUploadStatus} {\n border-block: none;\n border-inline-start: none;\n border-inline-end: 0.0625rem dashed ${borderColor};\n }\n }\n `;\n }\n);\n\nStyledFileInput.defaultProps = defaultThemeProp;\n\nexport const StyledSingleFileWrapper = styled.div<{ compact: FileInputProps['compact'] }>(\n ({ compact }) => {\n return css`\n display: contents;\n\n ${compact &&\n css`\n > ${StyledFileItem} {\n width: 25ch;\n }\n `};\n `;\n }\n);\n\nexport const StyledAttachedFileCount = styled.span(\n ({\n theme: {\n base: { palette, spacing }\n }\n }) => {\n return css`\n padding-inline-start: ${spacing};\n color: ${palette.interactive};\n `;\n }\n);\n\nStyledAttachedFileCount.defaultProps = defaultThemeProp;\n\nexport const StyledFlex = styled(Flex)`\n height: inherit;\n`;\n\nexport const StyledBareButton = styled(BareButton)(({\n theme: {\n base: {\n palette,\n 'hit-area': { 'finger-min': fingerMin, compact },\n 'border-radius': baseRadius\n },\n components: {\n 'form-control': {\n 'border-color': borderColor,\n 'border-radius': radius,\n ':focus': { 'box-shadow': boxShadow }\n }\n }\n }\n}) => {\n return css`\n height: ${compact};\n width: 25ch;\n cursor: pointer;\n border-radius: calc(${baseRadius} * ${radius});\n background-color: ${palette['primary-background']};\n\n @media (pointer: coarse) {\n height: ${fingerMin};\n }\n\n &:focus {\n box-shadow: ${boxShadow};\n\n ${StyledIconWrapper} {\n border: none;\n }\n ${StyledUploadStatus} {\n border-block: none;\n border-inline-start: none;\n border-inline-end: 0.0625rem dashed ${borderColor};\n }\n }\n `;\n});\n\nStyledBareButton.defaultProps = defaultThemeProp;\n\nexport const StyledFormField = styled(FormField)<{ compactMode: FileInputProps['compact'] }>(({\n compactMode\n}) => {\n return css`\n ${compactMode &&\n css`\n width: 25ch;\n `};\n `;\n});\n\nexport const StyledFileInputControl = styled(Flex)<Pick<FormControlProps, 'status'>>(({\n theme: {\n base: { spacing },\n components: { 'form-field': formField }\n },\n status\n}) => {\n return css`\n ${StyledFormFieldInfo} {\n margin-block-start: calc(0.5 * ${spacing});\n ${StyledMetaListItem}:first-child {\n color: ${status && formField[status]['status-color']};\n }\n }\n `;\n});\n\nStyledFileInputControl.defaultProps = defaultThemeProp;\n\nexport const StyledDownloadAllButton = styled(Button)(({\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale, spacing }\n }\n}) => {\n const { xxs: infoFontSize } = calculateFontSize(fontSize, fontScale);\n return css`\n font-size: ${infoFontSize};\n margin-block-start: calc(0.5 * ${spacing});\n align-self: flex-start;\n `;\n});\n\nStyledDownloadAllButton.defaultProps = defaultThemeProp;\n"]}