@pega/cosmos-react-core 2.0.0-dev.9.2 → 2.0.0-rc.2

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 (810) hide show
  1. package/README.md +3 -3
  2. package/lib/components/Actions/Actions.js +1 -1
  3. package/lib/components/Actions/Actions.js.map +1 -1
  4. package/lib/components/AppShell/AppHeader.d.ts +2 -1
  5. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  6. package/lib/components/AppShell/AppHeader.js +4 -9
  7. package/lib/components/AppShell/AppHeader.js.map +1 -1
  8. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  9. package/lib/components/AppShell/AppShell.js +89 -62
  10. package/lib/components/AppShell/AppShell.js.map +1 -1
  11. package/lib/components/AppShell/AppShell.styles.d.ts +19 -16
  12. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShell.styles.js +227 -173
  14. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.types.d.ts +7 -7
  16. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  17. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  18. package/lib/components/AppShell/AppShellContext.d.ts +3 -0
  19. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  20. package/lib/components/AppShell/AppShellContext.js +3 -1
  21. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  22. package/lib/components/AppShell/AppShellList.d.ts +4 -3
  23. package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
  24. package/lib/components/AppShell/AppShellList.js +24 -19
  25. package/lib/components/AppShell/AppShellList.js.map +1 -1
  26. package/lib/components/AppShell/Drawer.d.ts.map +1 -1
  27. package/lib/components/AppShell/Drawer.js +7 -8
  28. package/lib/components/AppShell/Drawer.js.map +1 -1
  29. package/lib/components/AppShell/Operator.js +3 -5
  30. package/lib/components/AppShell/Operator.js.map +1 -1
  31. package/lib/components/AppShell/SkipNavigation.d.ts.map +1 -1
  32. package/lib/components/AppShell/SkipNavigation.js +30 -39
  33. package/lib/components/AppShell/SkipNavigation.js.map +1 -1
  34. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  35. package/lib/components/Avatar/Avatar.js +5 -4
  36. package/lib/components/Avatar/Avatar.js.map +1 -1
  37. package/lib/components/Backdrop/Backdrop.d.ts +1 -1
  38. package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
  39. package/lib/components/Backdrop/Backdrop.js +7 -6
  40. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  41. package/lib/components/Badges/Alert.d.ts +2 -2
  42. package/lib/components/Badges/Alert.d.ts.map +1 -1
  43. package/lib/components/Badges/Alert.js +1 -1
  44. package/lib/components/Badges/Alert.js.map +1 -1
  45. package/lib/components/Badges/Count.js +1 -1
  46. package/lib/components/Badges/Count.js.map +1 -1
  47. package/lib/components/Badges/Selection.d.ts.map +1 -1
  48. package/lib/components/Badges/Selection.js +10 -9
  49. package/lib/components/Badges/Selection.js.map +1 -1
  50. package/lib/components/Badges/Status.d.ts +2 -2
  51. package/lib/components/Badges/Status.d.ts.map +1 -1
  52. package/lib/components/Badges/Status.js +1 -1
  53. package/lib/components/Badges/Status.js.map +1 -1
  54. package/lib/components/Badges/Tag.js +1 -1
  55. package/lib/components/Badges/Tag.js.map +1 -1
  56. package/lib/components/Banner/Banner.d.ts +2 -2
  57. package/lib/components/Banner/Banner.d.ts.map +1 -1
  58. package/lib/components/Banner/Banner.js +6 -8
  59. package/lib/components/Banner/Banner.js.map +1 -1
  60. package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
  61. package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
  62. package/lib/components/Boolean/BooleanDisplay.js +1 -2
  63. package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
  64. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
  65. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  66. package/lib/components/Breadcrumbs/Breadcrumbs.js +13 -11
  67. package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  68. package/lib/components/Button/BareButton.d.ts.map +1 -1
  69. package/lib/components/Button/BareButton.js +21 -2
  70. package/lib/components/Button/BareButton.js.map +1 -1
  71. package/lib/components/Button/BareRoleButton.d.ts +12 -0
  72. package/lib/components/Button/BareRoleButton.d.ts.map +1 -0
  73. package/lib/components/Button/BareRoleButton.js +20 -0
  74. package/lib/components/Button/BareRoleButton.js.map +1 -0
  75. package/lib/components/Button/Button.d.ts +5 -0
  76. package/lib/components/Button/Button.d.ts.map +1 -1
  77. package/lib/components/Button/Button.js +34 -10
  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 +3 -2
  81. package/lib/components/Card/Card.js.map +1 -1
  82. package/lib/components/Card/CardContent.d.ts.map +1 -1
  83. package/lib/components/Card/CardContent.js +5 -4
  84. package/lib/components/Card/CardContent.js.map +1 -1
  85. package/lib/components/Card/CardFooter.d.ts.map +1 -1
  86. package/lib/components/Card/CardFooter.js +5 -4
  87. package/lib/components/Card/CardFooter.js.map +1 -1
  88. package/lib/components/Card/CardHeader.d.ts +3 -1
  89. package/lib/components/Card/CardHeader.d.ts.map +1 -1
  90. package/lib/components/Card/CardHeader.js +9 -7
  91. package/lib/components/Card/CardHeader.js.map +1 -1
  92. package/lib/components/Card/CardMedia.js +1 -1
  93. package/lib/components/Card/CardMedia.js.map +1 -1
  94. package/lib/components/Card/CollapsibleCard.d.ts.map +1 -1
  95. package/lib/components/Card/CollapsibleCard.js +5 -7
  96. package/lib/components/Card/CollapsibleCard.js.map +1 -1
  97. package/lib/components/Card/SelectableCard.js +1 -1
  98. package/lib/components/Card/SelectableCard.js.map +1 -1
  99. package/lib/components/Checkbox/Checkbox.d.ts +2 -2
  100. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  101. package/lib/components/Checkbox/Checkbox.js +1 -1
  102. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  103. package/lib/components/ColorPicker/ColorPicker.d.ts +2 -2
  104. package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  105. package/lib/components/ColorPicker/ColorPicker.js +8 -11
  106. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  107. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  108. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  109. package/lib/components/ComboBox/ComboBox.js +30 -33
  110. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  111. package/lib/components/ComboBox/ComboBox.types.d.ts +2 -1
  112. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  113. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  114. package/lib/components/ComboBox/ComboBoxInput.js +4 -4
  115. package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
  116. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  117. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +23 -29
  118. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  119. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  120. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +16 -12
  121. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  122. package/lib/components/Configuration/Configuration.js +11 -13
  123. package/lib/components/Configuration/Configuration.js.map +1 -1
  124. package/lib/components/Currency/CurrencyDisplay.d.ts +6 -2
  125. package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
  126. package/lib/components/Currency/CurrencyDisplay.js +11 -7
  127. package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
  128. package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
  129. package/lib/components/Currency/CurrencyInput.js +16 -16
  130. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  131. package/lib/components/Currency/CurrencyInput.types.d.ts +6 -2
  132. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  133. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  134. package/lib/components/Currency/utils.d.ts +12 -1
  135. package/lib/components/Currency/utils.d.ts.map +1 -1
  136. package/lib/components/Currency/utils.js +30 -2
  137. package/lib/components/Currency/utils.js.map +1 -1
  138. package/lib/components/DateTime/DateTime.types.d.ts +2 -1
  139. package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
  140. package/lib/components/DateTime/DateTime.types.js.map +1 -1
  141. package/lib/components/DateTime/DateTimeDisplay.d.ts +1 -1
  142. package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
  143. package/lib/components/DateTime/DateTimeDisplay.js +14 -3
  144. package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
  145. package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
  146. package/lib/components/DateTime/DurationDisplay.js +11 -6
  147. package/lib/components/DateTime/DurationDisplay.js.map +1 -1
  148. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  149. package/lib/components/DateTime/Input/DateInput.js +25 -27
  150. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  151. package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
  152. package/lib/components/DateTime/Input/DateRangeInput.js +10 -16
  153. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  154. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  155. package/lib/components/DateTime/Input/DateTime.styles.js +14 -3
  156. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  157. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  158. package/lib/components/DateTime/Input/DateTimeInput.js +42 -42
  159. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  160. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
  161. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
  162. package/lib/components/DateTime/Input/DayOfWeekInput.js +7 -5
  163. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  164. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
  165. package/lib/components/DateTime/Input/Duration/DurationInput.js +3 -3
  166. package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
  167. package/lib/components/DateTime/Input/Duration/NumberUnit.js +4 -5
  168. package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
  169. package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
  170. package/lib/components/DateTime/Input/Duration/Time.js +12 -15
  171. package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
  172. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  173. package/lib/components/DateTime/Input/MonthInput.js +12 -17
  174. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  175. package/lib/components/DateTime/Input/PartInput.js +3 -4
  176. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  177. package/lib/components/DateTime/Input/QuarterInput.d.ts +9 -0
  178. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -0
  179. package/lib/components/DateTime/Input/QuarterInput.js +102 -0
  180. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -0
  181. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  182. package/lib/components/DateTime/Input/TimeInput.js +26 -30
  183. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  184. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  185. package/lib/components/DateTime/Input/WeekInput.js +22 -23
  186. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  187. package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts.map +1 -1
  188. package/lib/components/DateTime/Input/useAutoFocusNextInput.js +8 -9
  189. package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
  190. package/lib/components/DateTime/Input/usePickerButton.js +4 -4
  191. package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
  192. package/lib/components/DateTime/Input/utils.d.ts +7 -0
  193. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  194. package/lib/components/DateTime/Input/utils.js +52 -10
  195. package/lib/components/DateTime/Input/utils.js.map +1 -1
  196. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  197. package/lib/components/DateTime/Picker/Calendar.js +47 -72
  198. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  199. package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -2
  200. package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
  201. package/lib/components/DateTime/Picker/Calendar.styles.js +16 -7
  202. package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
  203. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  204. package/lib/components/DateTime/Picker/DatePicker.js +13 -17
  205. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  206. package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
  207. package/lib/components/DateTime/Picker/DateRangePicker.js +13 -17
  208. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  209. package/lib/components/DateTime/Picker/TimePicker.js +9 -10
  210. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  211. package/lib/components/DateTime/Picker/Weeks.js +9 -11
  212. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  213. package/lib/components/DateTime/Picker/utils.d.ts +1 -0
  214. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  215. package/lib/components/DateTime/Picker/utils.js +3 -0
  216. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  217. package/lib/components/DateTime/index.d.ts +2 -0
  218. package/lib/components/DateTime/index.d.ts.map +1 -1
  219. package/lib/components/DateTime/index.js +1 -0
  220. package/lib/components/DateTime/index.js.map +1 -1
  221. package/lib/components/Drawer/Drawer.js +6 -6
  222. package/lib/components/Drawer/Drawer.js.map +1 -1
  223. package/lib/components/Email/EmailDisplay.d.ts +2 -2
  224. package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
  225. package/lib/components/Email/EmailDisplay.js +2 -2
  226. package/lib/components/Email/EmailDisplay.js.map +1 -1
  227. package/lib/components/EmojiPicker/EmojiDisplay.d.ts.map +1 -1
  228. package/lib/components/EmojiPicker/EmojiDisplay.js +1 -1
  229. package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
  230. package/lib/components/EmojiPicker/EmojiPicker.js +3 -4
  231. package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
  232. package/lib/components/EmptyState/EmptyState.d.ts +14 -0
  233. package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
  234. package/lib/components/{NoItems/NoItems.js → EmptyState/EmptyState.js} +11 -8
  235. package/lib/components/EmptyState/EmptyState.js.map +1 -0
  236. package/lib/components/EmptyState/index.d.ts +4 -0
  237. package/lib/components/EmptyState/index.d.ts.map +1 -0
  238. package/lib/components/EmptyState/index.js +3 -0
  239. package/lib/components/EmptyState/index.js.map +1 -0
  240. package/lib/components/ErrorState/ErrorState.d.ts +16 -0
  241. package/lib/components/ErrorState/ErrorState.d.ts.map +1 -0
  242. package/lib/components/ErrorState/ErrorState.js +31 -0
  243. package/lib/components/ErrorState/ErrorState.js.map +1 -0
  244. package/lib/components/ErrorState/index.d.ts +4 -0
  245. package/lib/components/ErrorState/index.d.ts.map +1 -0
  246. package/lib/components/ErrorState/index.js +3 -0
  247. package/lib/components/ErrorState/index.js.map +1 -0
  248. package/lib/components/ExpandCollapse/ExpandCollapse.js +5 -5
  249. package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  250. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  251. package/lib/components/FieldGroup/FieldGroup.js +6 -7
  252. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  253. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  254. package/lib/components/FieldGroup/FieldGroupList.js +7 -6
  255. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  256. package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
  257. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  258. package/lib/components/FieldValueList/FieldValueList.js +5 -7
  259. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  260. package/lib/components/File/FileDisplay.d.ts +6 -3
  261. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  262. package/lib/components/File/FileDisplay.js +7 -7
  263. package/lib/components/File/FileDisplay.js.map +1 -1
  264. package/lib/components/File/FileInput.d.ts +3 -3
  265. package/lib/components/File/FileInput.d.ts.map +1 -1
  266. package/lib/components/File/FileInput.js +18 -19
  267. package/lib/components/File/FileInput.js.map +1 -1
  268. package/lib/components/File/FileItem.d.ts +0 -2
  269. package/lib/components/File/FileItem.d.ts.map +1 -1
  270. package/lib/components/File/FileItem.js +3 -4
  271. package/lib/components/File/FileItem.js.map +1 -1
  272. package/lib/components/File/FileUploadItem.d.ts +4 -2
  273. package/lib/components/File/FileUploadItem.d.ts.map +1 -1
  274. package/lib/components/File/FileUploadItem.js +58 -20
  275. package/lib/components/File/FileUploadItem.js.map +1 -1
  276. package/lib/components/File/FileVisual.d.ts +7 -16
  277. package/lib/components/File/FileVisual.d.ts.map +1 -1
  278. package/lib/components/File/FileVisual.js +44 -47
  279. package/lib/components/File/FileVisual.js.map +1 -1
  280. package/lib/components/File/utils.js +2 -3
  281. package/lib/components/File/utils.js.map +1 -1
  282. package/lib/components/Flex/Flex.d.ts +17 -7
  283. package/lib/components/Flex/Flex.d.ts.map +1 -1
  284. package/lib/components/Flex/Flex.js +25 -9
  285. package/lib/components/Flex/Flex.js.map +1 -1
  286. package/lib/components/Form/Form.d.ts +7 -1
  287. package/lib/components/Form/Form.d.ts.map +1 -1
  288. package/lib/components/Form/Form.js +5 -4
  289. package/lib/components/Form/Form.js.map +1 -1
  290. package/lib/components/FormControl/FormControl.d.ts +1 -1
  291. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  292. package/lib/components/FormControl/FormControl.js +1 -1
  293. package/lib/components/FormControl/FormControl.js.map +1 -1
  294. package/lib/components/FormField/FormField.d.ts +5 -7
  295. package/lib/components/FormField/FormField.d.ts.map +1 -1
  296. package/lib/components/FormField/FormField.js +9 -19
  297. package/lib/components/FormField/FormField.js.map +1 -1
  298. package/lib/components/Grid/Grid.d.ts +1 -1
  299. package/lib/components/Grid/Grid.d.ts.map +1 -1
  300. package/lib/components/Grid/Grid.js +17 -21
  301. package/lib/components/Grid/Grid.js.map +1 -1
  302. package/lib/components/Icon/Icon.js +3 -5
  303. package/lib/components/Icon/Icon.js.map +1 -1
  304. package/lib/components/Icon/iconNames.d.ts +1 -1
  305. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  306. package/lib/components/Icon/iconNames.js +2 -0
  307. package/lib/components/Icon/iconNames.js.map +1 -1
  308. package/lib/components/Icon/icons/compass-solid.icon.js +1 -2
  309. package/lib/components/Icon/icons/compass-solid.icon.js.map +1 -1
  310. package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js +1 -4
  311. package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js.map +1 -1
  312. package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js +1 -2
  313. package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js.map +1 -1
  314. package/lib/components/Icon/icons/dataviz-waterfall.icon.js +1 -5
  315. package/lib/components/Icon/icons/dataviz-waterfall.icon.js.map +1 -1
  316. package/lib/components/Icon/icons/dock.icon.d.ts +4 -0
  317. package/lib/components/Icon/icons/dock.icon.d.ts.map +1 -0
  318. package/lib/components/Icon/icons/dock.icon.js +6 -0
  319. package/lib/components/Icon/icons/dock.icon.js.map +1 -0
  320. package/lib/components/Icon/icons/filetype-text.icon.js +1 -4
  321. package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
  322. package/lib/components/Icon/icons/folder-dollar.icon.js +1 -2
  323. package/lib/components/Icon/icons/folder-dollar.icon.js.map +1 -1
  324. package/lib/components/Icon/icons/freeze-column.icon.js +1 -2
  325. package/lib/components/Icon/icons/freeze-column.icon.js.map +1 -1
  326. package/lib/components/Icon/icons/galaxy.icon.js +1 -3
  327. package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
  328. package/lib/components/Icon/icons/grad-solid.icon.js +1 -2
  329. package/lib/components/Icon/icons/grad-solid.icon.js.map +1 -1
  330. package/lib/components/Icon/icons/grad.icon.js +1 -5
  331. package/lib/components/Icon/icons/grad.icon.js.map +1 -1
  332. package/lib/components/Icon/icons/list-number.icon.js +1 -6
  333. package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
  334. package/lib/components/Icon/icons/list.icon.js +1 -6
  335. package/lib/components/Icon/icons/list.icon.js.map +1 -1
  336. package/lib/components/Icon/icons/pin.icon.js +1 -2
  337. package/lib/components/Icon/icons/pin.icon.js.map +1 -1
  338. package/lib/components/Icon/icons/search-solid.icon.js +1 -2
  339. package/lib/components/Icon/icons/search-solid.icon.js.map +1 -1
  340. package/lib/components/Icon/icons/tracer.icon.js +1 -2
  341. package/lib/components/Icon/icons/tracer.icon.js.map +1 -1
  342. package/lib/components/Icon/icons/tribox-solid.icon.js +1 -3
  343. package/lib/components/Icon/icons/tribox-solid.icon.js.map +1 -1
  344. package/lib/components/Icon/icons/tribox.icon.js +1 -3
  345. package/lib/components/Icon/icons/tribox.icon.js.map +1 -1
  346. package/lib/components/Icon/icons/undock.icon.d.ts +4 -0
  347. package/lib/components/Icon/icons/undock.icon.d.ts.map +1 -0
  348. package/lib/components/Icon/icons/undock.icon.js +6 -0
  349. package/lib/components/Icon/icons/undock.icon.js.map +1 -0
  350. package/lib/components/Image/Image.js +1 -1
  351. package/lib/components/Image/Image.js.map +1 -1
  352. package/lib/components/Image/index.d.ts +1 -1
  353. package/lib/components/Image/index.d.ts.map +1 -1
  354. package/lib/components/Image/index.js +1 -0
  355. package/lib/components/Image/index.js.map +1 -1
  356. package/lib/components/Input/Input.d.ts +2 -2
  357. package/lib/components/Input/Input.d.ts.map +1 -1
  358. package/lib/components/Input/Input.js +13 -13
  359. package/lib/components/Input/Input.js.map +1 -1
  360. package/lib/components/Input/Input.styles.js +2 -2
  361. package/lib/components/Input/Input.styles.js.map +1 -1
  362. package/lib/components/Label/Label.js +1 -1
  363. package/lib/components/Label/Label.js.map +1 -1
  364. package/lib/components/Lightbox/Lightbox.d.ts +6 -0
  365. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -0
  366. package/lib/components/Lightbox/Lightbox.js +129 -0
  367. package/lib/components/Lightbox/Lightbox.js.map +1 -0
  368. package/lib/components/Lightbox/Lightbox.styles.d.ts +11 -0
  369. package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -0
  370. package/lib/components/Lightbox/Lightbox.styles.js +166 -0
  371. package/lib/components/Lightbox/Lightbox.styles.js.map +1 -0
  372. package/lib/components/Lightbox/Lightbox.types.d.ts +42 -0
  373. package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -0
  374. package/lib/components/Lightbox/Lightbox.types.js +2 -0
  375. package/lib/components/Lightbox/Lightbox.types.js.map +1 -0
  376. package/lib/components/Lightbox/index.d.ts +3 -0
  377. package/lib/components/Lightbox/index.d.ts.map +1 -0
  378. package/lib/components/Lightbox/index.js +2 -0
  379. package/lib/components/Lightbox/index.js.map +1 -0
  380. package/lib/components/Link/Link.js +5 -8
  381. package/lib/components/Link/Link.js.map +1 -1
  382. package/lib/components/List/CommaSeparatedList.d.ts +15 -0
  383. package/lib/components/List/CommaSeparatedList.d.ts.map +1 -0
  384. package/lib/components/List/CommaSeparatedList.js +61 -0
  385. package/lib/components/List/CommaSeparatedList.js.map +1 -0
  386. package/lib/components/List/List.d.ts +30 -0
  387. package/lib/components/List/List.d.ts.map +1 -0
  388. package/lib/components/List/List.js +56 -0
  389. package/lib/components/List/List.js.map +1 -0
  390. package/lib/components/List/OrderedList.d.ts +6 -0
  391. package/lib/components/List/OrderedList.d.ts.map +1 -0
  392. package/lib/components/List/OrderedList.js +6 -0
  393. package/lib/components/List/OrderedList.js.map +1 -0
  394. package/lib/components/List/UnorderedList.d.ts +6 -0
  395. package/lib/components/List/UnorderedList.d.ts.map +1 -0
  396. package/lib/components/List/UnorderedList.js +6 -0
  397. package/lib/components/List/UnorderedList.js.map +1 -0
  398. package/lib/components/List/index.d.ts +5 -0
  399. package/lib/components/List/index.d.ts.map +1 -0
  400. package/lib/components/List/index.js +4 -0
  401. package/lib/components/List/index.js.map +1 -0
  402. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  403. package/lib/components/Location/CurrentLocationButton.js +7 -7
  404. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  405. package/lib/components/Location/Location.types.d.ts +2 -1
  406. package/lib/components/Location/Location.types.d.ts.map +1 -1
  407. package/lib/components/Location/Location.types.js.map +1 -1
  408. package/lib/components/Location/LocationDisplay.js +8 -9
  409. package/lib/components/Location/LocationDisplay.js.map +1 -1
  410. package/lib/components/Location/LocationInput.js +27 -28
  411. package/lib/components/Location/LocationInput.js.map +1 -1
  412. package/lib/components/Location/LocationView.js +8 -13
  413. package/lib/components/Location/LocationView.js.map +1 -1
  414. package/lib/components/Location/utils.js +11 -15
  415. package/lib/components/Location/utils.js.map +1 -1
  416. package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
  417. package/lib/components/Menu/FlyoutMenuList.js +12 -15
  418. package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
  419. package/lib/components/Menu/Menu.context.d.ts.map +1 -1
  420. package/lib/components/Menu/Menu.context.js +2 -0
  421. package/lib/components/Menu/Menu.context.js.map +1 -1
  422. package/lib/components/Menu/Menu.d.ts.map +1 -1
  423. package/lib/components/Menu/Menu.js +89 -46
  424. package/lib/components/Menu/Menu.js.map +1 -1
  425. package/lib/components/Menu/Menu.styles.d.ts +11 -0
  426. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  427. package/lib/components/Menu/Menu.styles.js +202 -3
  428. package/lib/components/Menu/Menu.styles.js.map +1 -1
  429. package/lib/components/Menu/Menu.types.d.ts +30 -12
  430. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  431. package/lib/components/Menu/Menu.types.js.map +1 -1
  432. package/lib/components/Menu/MenuGroup.d.ts +6 -0
  433. package/lib/components/Menu/MenuGroup.d.ts.map +1 -0
  434. package/lib/components/Menu/MenuGroup.js +17 -0
  435. package/lib/components/Menu/MenuGroup.js.map +1 -0
  436. package/lib/components/Menu/MenuItem.d.ts +0 -3
  437. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  438. package/lib/components/Menu/MenuItem.js +57 -164
  439. package/lib/components/Menu/MenuItem.js.map +1 -1
  440. package/lib/components/Menu/MenuList.d.ts +1 -1
  441. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  442. package/lib/components/Menu/MenuList.js +28 -30
  443. package/lib/components/Menu/MenuList.js.map +1 -1
  444. package/lib/components/Menu/MenuListHeader.d.ts +0 -1
  445. package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
  446. package/lib/components/Menu/MenuListHeader.js +7 -55
  447. package/lib/components/Menu/MenuListHeader.js.map +1 -1
  448. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  449. package/lib/components/Menu/NavItemsList.js +2 -3
  450. package/lib/components/Menu/NavItemsList.js.map +1 -1
  451. package/lib/components/Menu/helpers.d.ts +13 -12
  452. package/lib/components/Menu/helpers.d.ts.map +1 -1
  453. package/lib/components/Menu/helpers.js +40 -36
  454. package/lib/components/Menu/helpers.js.map +1 -1
  455. package/lib/components/Menu/index.d.ts +2 -3
  456. package/lib/components/Menu/index.d.ts.map +1 -1
  457. package/lib/components/Menu/index.js +1 -2
  458. package/lib/components/Menu/index.js.map +1 -1
  459. package/lib/components/MenuButton/MenuButton.d.ts +3 -1
  460. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  461. package/lib/components/MenuButton/MenuButton.js +13 -14
  462. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  463. package/lib/components/MetaList/MetaList.d.ts +13 -4
  464. package/lib/components/MetaList/MetaList.d.ts.map +1 -1
  465. package/lib/components/MetaList/MetaList.js +34 -20
  466. package/lib/components/MetaList/MetaList.js.map +1 -1
  467. package/lib/components/Modal/Contexts.d.ts.map +1 -1
  468. package/lib/components/Modal/Contexts.js +3 -0
  469. package/lib/components/Modal/Contexts.js.map +1 -1
  470. package/lib/components/Modal/DockedModals.d.ts.map +1 -1
  471. package/lib/components/Modal/DockedModals.js +5 -4
  472. package/lib/components/Modal/DockedModals.js.map +1 -1
  473. package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
  474. package/lib/components/Modal/MinimizedModal.js +53 -38
  475. package/lib/components/Modal/MinimizedModal.js.map +1 -1
  476. package/lib/components/Modal/Modal.d.ts +1 -6
  477. package/lib/components/Modal/Modal.d.ts.map +1 -1
  478. package/lib/components/Modal/Modal.js +82 -134
  479. package/lib/components/Modal/Modal.js.map +1 -1
  480. package/lib/components/Modal/Modal.styles.d.ts +9 -0
  481. package/lib/components/Modal/Modal.styles.d.ts.map +1 -0
  482. package/lib/components/Modal/Modal.styles.js +135 -0
  483. package/lib/components/Modal/Modal.styles.js.map +1 -0
  484. package/lib/components/Modal/Modal.types.d.ts +56 -5
  485. package/lib/components/Modal/Modal.types.d.ts.map +1 -1
  486. package/lib/components/Modal/Modal.types.js.map +1 -1
  487. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  488. package/lib/components/Modal/ModalManager.js +74 -65
  489. package/lib/components/Modal/ModalManager.js.map +1 -1
  490. package/lib/components/MultiStep/MultiStep.d.ts.map +1 -1
  491. package/lib/components/MultiStep/MultiStep.js +10 -12
  492. package/lib/components/MultiStep/MultiStep.js.map +1 -1
  493. package/lib/components/MultiStep/MultiStep.styles.js +1 -1
  494. package/lib/components/MultiStep/MultiStep.styles.js.map +1 -1
  495. package/lib/components/MultiStep/MultiStep.types.d.ts +4 -2
  496. package/lib/components/MultiStep/MultiStep.types.d.ts.map +1 -1
  497. package/lib/components/MultiStep/MultiStep.types.js.map +1 -1
  498. package/lib/components/Number/NumberDisplay.d.ts +2 -2
  499. package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
  500. package/lib/components/Number/NumberDisplay.js +1 -1
  501. package/lib/components/Number/NumberDisplay.js.map +1 -1
  502. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  503. package/lib/components/Number/NumberInput.js +18 -25
  504. package/lib/components/Number/NumberInput.js.map +1 -1
  505. package/lib/components/Number/NumberInput.styles.d.ts +2 -2
  506. package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
  507. package/lib/components/Number/NumberInput.types.d.ts +2 -2
  508. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  509. package/lib/components/Number/NumberInput.types.js.map +1 -1
  510. package/lib/components/Number/utils.js +2 -3
  511. package/lib/components/Number/utils.js.map +1 -1
  512. package/lib/components/PageTemplates/CategorySubPage.d.ts +1 -1
  513. package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
  514. package/lib/components/PageTemplates/CategorySubPage.js +8 -18
  515. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  516. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +1 -1
  517. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
  518. package/lib/components/PageTemplates/DashboardPage.d.ts +7 -1
  519. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  520. package/lib/components/PageTemplates/DashboardPage.js +48 -28
  521. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  522. package/lib/components/PageTemplates/PageTemplates.d.ts +15 -6
  523. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  524. package/lib/components/PageTemplates/PageTemplates.js +89 -79
  525. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  526. package/lib/components/PageTemplates/index.d.ts +3 -0
  527. package/lib/components/PageTemplates/index.d.ts.map +1 -1
  528. package/lib/components/PageTemplates/index.js +1 -0
  529. package/lib/components/PageTemplates/index.js.map +1 -1
  530. package/lib/components/Pagination/Pagination.d.ts +2 -2
  531. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  532. package/lib/components/Pagination/Pagination.js +7 -6
  533. package/lib/components/Pagination/Pagination.js.map +1 -1
  534. package/lib/components/Paragraph/ParagraphDisplay.d.ts +11 -0
  535. package/lib/components/Paragraph/ParagraphDisplay.d.ts.map +1 -0
  536. package/lib/components/Paragraph/ParagraphDisplay.js +11 -0
  537. package/lib/components/Paragraph/ParagraphDisplay.js.map +1 -0
  538. package/lib/components/Paragraph/index.d.ts +3 -0
  539. package/lib/components/Paragraph/index.d.ts.map +1 -0
  540. package/lib/components/Paragraph/index.js +2 -0
  541. package/lib/components/Paragraph/index.js.map +1 -0
  542. package/lib/components/Phone/PhoneDisplay.d.ts +2 -2
  543. package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
  544. package/lib/components/Phone/PhoneDisplay.js +2 -3
  545. package/lib/components/Phone/PhoneDisplay.js.map +1 -1
  546. package/lib/components/Phone/PhoneInput.d.ts +2 -2
  547. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  548. package/lib/components/Phone/PhoneInput.js +18 -17
  549. package/lib/components/Phone/PhoneInput.js.map +1 -1
  550. package/lib/components/Phone/utils.js +2 -3
  551. package/lib/components/Phone/utils.js.map +1 -1
  552. package/lib/components/Popover/Popover.d.ts +0 -4
  553. package/lib/components/Popover/Popover.d.ts.map +1 -1
  554. package/lib/components/Popover/Popover.js +11 -122
  555. package/lib/components/Popover/Popover.js.map +1 -1
  556. package/lib/components/Popover/Popover.styles.d.ts +5 -0
  557. package/lib/components/Popover/Popover.styles.d.ts.map +1 -0
  558. package/lib/components/Popover/Popover.styles.js +116 -0
  559. package/lib/components/Popover/Popover.styles.js.map +1 -0
  560. package/lib/components/Popover/PopoverManager.js +2 -2
  561. package/lib/components/Popover/PopoverManager.js.map +1 -1
  562. package/lib/components/Popover/index.d.ts +1 -1
  563. package/lib/components/Popover/index.d.ts.map +1 -1
  564. package/lib/components/Popover/index.js +1 -1
  565. package/lib/components/Popover/index.js.map +1 -1
  566. package/lib/components/Progress/Bar.js +2 -2
  567. package/lib/components/Progress/Bar.js.map +1 -1
  568. package/lib/components/Progress/Ellipsis.d.ts +1 -1
  569. package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
  570. package/lib/components/Progress/Ellipsis.js +48 -50
  571. package/lib/components/Progress/Ellipsis.js.map +1 -1
  572. package/lib/components/Progress/Progress.js +3 -4
  573. package/lib/components/Progress/Progress.js.map +1 -1
  574. package/lib/components/Progress/Progress.types.d.ts +2 -2
  575. package/lib/components/Progress/Progress.types.d.ts.map +1 -1
  576. package/lib/components/Progress/Progress.types.js.map +1 -1
  577. package/lib/components/Progress/Ring.d.ts +1 -1
  578. package/lib/components/Progress/Ring.d.ts.map +1 -1
  579. package/lib/components/Progress/Ring.js +40 -40
  580. package/lib/components/Progress/Ring.js.map +1 -1
  581. package/lib/components/RadioButton/RadioButton.d.ts +2 -2
  582. package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
  583. package/lib/components/RadioButton/RadioButton.js +1 -1
  584. package/lib/components/RadioButton/RadioButton.js.map +1 -1
  585. package/lib/components/RadioCheck/RadioCheck.d.ts +2 -2
  586. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  587. package/lib/components/RadioCheck/RadioCheck.js +7 -8
  588. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  589. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +4 -0
  590. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
  591. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +19 -18
  592. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  593. package/lib/components/Rating/Rating.d.ts +2 -2
  594. package/lib/components/Rating/Rating.d.ts.map +1 -1
  595. package/lib/components/Rating/Rating.js +6 -7
  596. package/lib/components/Rating/Rating.js.map +1 -1
  597. package/lib/components/SearchInput/SearchInput.d.ts +4 -4
  598. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  599. package/lib/components/SearchInput/SearchInput.js +14 -14
  600. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  601. package/lib/components/Select/Option.js +1 -1
  602. package/lib/components/Select/Option.js.map +1 -1
  603. package/lib/components/Select/Select.d.ts.map +1 -1
  604. package/lib/components/Select/Select.js +15 -16
  605. package/lib/components/Select/Select.js.map +1 -1
  606. package/lib/components/Sentiment/Sentiment.d.ts +2 -2
  607. package/lib/components/Sentiment/Sentiment.d.ts.map +1 -1
  608. package/lib/components/Sentiment/Sentiment.js +1 -2
  609. package/lib/components/Sentiment/Sentiment.js.map +1 -1
  610. package/lib/components/Skeleton/LineSkeleton.js +1 -1
  611. package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
  612. package/lib/components/Skeleton/ParagraphSkeleton.js +1 -1
  613. package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
  614. package/lib/components/Skeleton/RectangleSkeleton.js +1 -1
  615. package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
  616. package/lib/components/Slider/Slider.d.ts.map +1 -1
  617. package/lib/components/Slider/Slider.js +12 -19
  618. package/lib/components/Slider/Slider.js.map +1 -1
  619. package/lib/components/Slider/Slider.styles.d.ts +4 -1
  620. package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
  621. package/lib/components/Slider/Slider.styles.js +17 -5
  622. package/lib/components/Slider/Slider.styles.js.map +1 -1
  623. package/lib/components/Slider/Slider.types.d.ts +2 -2
  624. package/lib/components/Slider/Slider.types.d.ts.map +1 -1
  625. package/lib/components/Slider/Slider.types.js.map +1 -1
  626. package/lib/components/Slider/SliderTicks.d.ts +1 -0
  627. package/lib/components/Slider/SliderTicks.d.ts.map +1 -1
  628. package/lib/components/Slider/SliderTicks.js +19 -12
  629. package/lib/components/Slider/SliderTicks.js.map +1 -1
  630. package/lib/components/Slider/utils.d.ts +10 -11
  631. package/lib/components/Slider/utils.d.ts.map +1 -1
  632. package/lib/components/Slider/utils.js +24 -18
  633. package/lib/components/Slider/utils.js.map +1 -1
  634. package/lib/components/SummaryItem/SummaryItem.d.ts +5 -5
  635. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  636. package/lib/components/SummaryItem/SummaryItem.js +3 -5
  637. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  638. package/lib/components/SummaryList/SummaryList.d.ts +8 -2
  639. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  640. package/lib/components/SummaryList/SummaryList.js +10 -11
  641. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  642. package/lib/components/SummaryList/ViewAll.d.ts +1 -1
  643. package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
  644. package/lib/components/SummaryList/ViewAll.js +14 -10
  645. package/lib/components/SummaryList/ViewAll.js.map +1 -1
  646. package/lib/components/Switch/Switch.d.ts +2 -2
  647. package/lib/components/Switch/Switch.d.ts.map +1 -1
  648. package/lib/components/Switch/Switch.js +41 -30
  649. package/lib/components/Switch/Switch.js.map +1 -1
  650. package/lib/components/Table/Table.d.ts +2 -2
  651. package/lib/components/Table/Table.d.ts.map +1 -1
  652. package/lib/components/Table/Table.js +14 -13
  653. package/lib/components/Table/Table.js.map +1 -1
  654. package/lib/components/Tabs/Tab.d.ts +1 -1
  655. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  656. package/lib/components/Tabs/Tab.js +9 -7
  657. package/lib/components/Tabs/Tab.js.map +1 -1
  658. package/lib/components/Tabs/TabPanel.d.ts +10 -2
  659. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  660. package/lib/components/Tabs/TabPanel.js +24 -8
  661. package/lib/components/Tabs/TabPanel.js.map +1 -1
  662. package/lib/components/Tabs/Tabs.d.ts +1 -0
  663. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  664. package/lib/components/Tabs/Tabs.js +22 -18
  665. package/lib/components/Tabs/Tabs.js.map +1 -1
  666. package/lib/components/Tabs/Tabs.types.d.ts +2 -2
  667. package/lib/components/Tabs/Tabs.types.d.ts.map +1 -1
  668. package/lib/components/Tabs/Tabs.types.js.map +1 -1
  669. package/lib/components/Text/Text.d.ts +1 -1
  670. package/lib/components/Text/Text.d.ts.map +1 -1
  671. package/lib/components/Text/Text.js +2 -2
  672. package/lib/components/Text/Text.js.map +1 -1
  673. package/lib/components/TextArea/TextArea.d.ts +2 -2
  674. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  675. package/lib/components/TextArea/TextArea.js +31 -30
  676. package/lib/components/TextArea/TextArea.js.map +1 -1
  677. package/lib/components/Toaster/Toaster.d.ts +8 -36
  678. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  679. package/lib/components/Toaster/Toaster.js +97 -102
  680. package/lib/components/Toaster/Toaster.js.map +1 -1
  681. package/lib/components/Tooltip/Tooltip.d.ts +6 -1
  682. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  683. package/lib/components/Tooltip/Tooltip.js +6 -13
  684. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  685. package/lib/components/Tree/StandardTree.d.ts +6 -0
  686. package/lib/components/Tree/StandardTree.d.ts.map +1 -0
  687. package/lib/components/Tree/StandardTree.js +175 -0
  688. package/lib/components/Tree/StandardTree.js.map +1 -0
  689. package/lib/components/Tree/StandardTree.styles.d.ts +13 -0
  690. package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -0
  691. package/lib/components/Tree/StandardTree.styles.js +155 -0
  692. package/lib/components/Tree/StandardTree.styles.js.map +1 -0
  693. package/lib/components/Tree/StandardTree.types.d.ts +25 -0
  694. package/lib/components/Tree/StandardTree.types.d.ts.map +1 -0
  695. package/lib/components/Tree/StandardTree.types.js +2 -0
  696. package/lib/components/Tree/StandardTree.types.js.map +1 -0
  697. package/lib/components/Tree/Tree.d.ts +35 -49
  698. package/lib/components/Tree/Tree.d.ts.map +1 -1
  699. package/lib/components/Tree/Tree.js +18 -56
  700. package/lib/components/Tree/Tree.js.map +1 -1
  701. package/lib/components/Tree/helpers.d.ts +19 -0
  702. package/lib/components/Tree/helpers.d.ts.map +1 -0
  703. package/lib/components/Tree/helpers.js +180 -0
  704. package/lib/components/Tree/helpers.js.map +1 -0
  705. package/lib/components/Tree/index.d.ts +4 -2
  706. package/lib/components/Tree/index.d.ts.map +1 -1
  707. package/lib/components/Tree/index.js +3 -1
  708. package/lib/components/Tree/index.js.map +1 -1
  709. package/lib/components/URL/URLDisplay.d.ts +2 -2
  710. package/lib/components/URL/URLDisplay.d.ts.map +1 -1
  711. package/lib/components/URL/URLDisplay.js +2 -2
  712. package/lib/components/URL/URLDisplay.js.map +1 -1
  713. package/lib/hooks/index.d.ts +7 -4
  714. package/lib/hooks/index.d.ts.map +1 -1
  715. package/lib/hooks/index.js +7 -3
  716. package/lib/hooks/index.js.map +1 -1
  717. package/lib/hooks/useActiveDescendant.d.ts +17 -3
  718. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  719. package/lib/hooks/useActiveDescendant.js +86 -64
  720. package/lib/hooks/useActiveDescendant.js.map +1 -1
  721. package/lib/hooks/useAutoResize.d.ts.map +1 -1
  722. package/lib/hooks/useAutoResize.js +6 -7
  723. package/lib/hooks/useAutoResize.js.map +1 -1
  724. package/lib/hooks/useBreakpoint.js +2 -4
  725. package/lib/hooks/useBreakpoint.js.map +1 -1
  726. package/lib/hooks/useDraggable.d.ts +8 -0
  727. package/lib/hooks/useDraggable.d.ts.map +1 -0
  728. package/lib/hooks/useDraggable.js +64 -0
  729. package/lib/hooks/useDraggable.js.map +1 -0
  730. package/lib/hooks/useFocusWithin.d.ts +1 -1
  731. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  732. package/lib/hooks/useFocusWithin.js +29 -24
  733. package/lib/hooks/useFocusWithin.js.map +1 -1
  734. package/lib/hooks/useI18n.d.ts +505 -170
  735. package/lib/hooks/useI18n.d.ts.map +1 -1
  736. package/lib/hooks/useI18n.js +2 -2
  737. package/lib/hooks/useI18n.js.map +1 -1
  738. package/lib/hooks/useLongPress.d.ts +16 -0
  739. package/lib/hooks/useLongPress.d.ts.map +1 -0
  740. package/lib/hooks/useLongPress.js +59 -0
  741. package/lib/hooks/useLongPress.js.map +1 -0
  742. package/lib/hooks/useOuterEvent.js +1 -1
  743. package/lib/hooks/useOuterEvent.js.map +1 -1
  744. package/lib/hooks/useOverride.js +1 -1
  745. package/lib/hooks/useOverride.js.map +1 -1
  746. package/lib/hooks/useScrollStick.js +14 -3
  747. package/lib/hooks/useScrollStick.js.map +1 -1
  748. package/lib/hooks/useScrollToggle.d.ts +6 -0
  749. package/lib/hooks/useScrollToggle.d.ts.map +1 -0
  750. package/lib/hooks/useScrollToggle.js +40 -0
  751. package/lib/hooks/useScrollToggle.js.map +1 -0
  752. package/lib/hooks/useTransitionState.d.ts +39 -0
  753. package/lib/hooks/useTransitionState.d.ts.map +1 -0
  754. package/lib/hooks/useTransitionState.js +56 -0
  755. package/lib/hooks/useTransitionState.js.map +1 -0
  756. package/lib/i18n/default.d.ts +583 -0
  757. package/lib/i18n/default.d.ts.map +1 -0
  758. package/lib/i18n/default.js +627 -0
  759. package/lib/i18n/default.js.map +1 -0
  760. package/lib/i18n/i18n.d.ts +988 -318
  761. package/lib/i18n/i18n.d.ts.map +1 -1
  762. package/lib/i18n/i18n.js +1 -1
  763. package/lib/i18n/i18n.js.map +1 -1
  764. package/lib/i18n/index.d.ts +1 -0
  765. package/lib/i18n/index.d.ts.map +1 -1
  766. package/lib/i18n/index.js.map +1 -1
  767. package/lib/i18n/translate.d.ts +29 -4
  768. package/lib/i18n/translate.d.ts.map +1 -1
  769. package/lib/i18n/translate.js +21 -8
  770. package/lib/i18n/translate.js.map +1 -1
  771. package/lib/index.d.ts +8 -2
  772. package/lib/index.d.ts.map +1 -1
  773. package/lib/index.js +8 -2
  774. package/lib/index.js.map +1 -1
  775. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  776. package/lib/styles/GlobalStyle.js +2 -26
  777. package/lib/styles/GlobalStyle.js.map +1 -1
  778. package/lib/theme/ThemeMachine.js +7 -1
  779. package/lib/theme/ThemeMachine.js.map +1 -1
  780. package/lib/theme/index.d.ts +1 -0
  781. package/lib/theme/index.d.ts.map +1 -1
  782. package/lib/theme/index.js +1 -0
  783. package/lib/theme/index.js.map +1 -1
  784. package/lib/theme/theme.d.ts +83 -53
  785. package/lib/theme/theme.d.ts.map +1 -1
  786. package/lib/theme/themeDefinition.json +50 -30
  787. package/lib/theme/themeOverrides.schema.json +24 -3
  788. package/lib/theme/themes/buildTheme.json +3 -39
  789. package/lib/theme/themes/darkTheme.json +6 -0
  790. package/lib/theme/themes/legacyBuildTheme.json +50 -0
  791. package/lib/types/types.d.ts +6 -1
  792. package/lib/types/types.d.ts.map +1 -1
  793. package/lib/types/types.js.map +1 -1
  794. package/lib/utils/utils.d.ts +41 -4
  795. package/lib/utils/utils.d.ts.map +1 -1
  796. package/lib/utils/utils.js +55 -9
  797. package/lib/utils/utils.js.map +1 -1
  798. package/package.json +10 -11
  799. package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts +0 -3
  800. package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts.map +0 -1
  801. package/lib/components/DateTime/Input/useButtonAriaLabel.js +0 -33
  802. package/lib/components/DateTime/Input/useButtonAriaLabel.js.map +0 -1
  803. package/lib/components/NoItems/NoItems.d.ts +0 -14
  804. package/lib/components/NoItems/NoItems.d.ts.map +0 -1
  805. package/lib/components/NoItems/NoItems.js.map +0 -1
  806. package/lib/components/NoItems/index.d.ts +0 -4
  807. package/lib/components/NoItems/index.d.ts.map +0 -1
  808. package/lib/components/NoItems/index.js +0 -3
  809. package/lib/components/NoItems/index.js.map +0 -1
  810. package/lib/i18n/default.json +0 -246
@@ -1,29 +1,63 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef, useMemo } from 'react';
2
+ import { forwardRef, useMemo, useState } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
4
  import Button from '../Button';
5
5
  import Icon from '../Icon';
6
6
  import MenuButton from '../MenuButton';
7
7
  import MetaList from '../MetaList';
8
- import SummaryItem from '../SummaryItem';
9
- import Progress from '../Progress';
8
+ import SummaryItem, { StyledPrimary, StyledSecondary, StyledSummaryItemActions, StyledVisual } from '../SummaryItem';
9
+ import Progress, { StyledProgressRing } from '../Progress';
10
10
  import Text from '../Text';
11
11
  import { defaultThemeProp } from '../../theme';
12
12
  import { useI18n } from '../../hooks';
13
- import { getKindFromMimeType, getMimeTypeFromFile } from './utils';
14
13
  import FileVisual from './FileVisual';
15
- const StyledFileUploadItem = styled.li(props => {
16
- const { theme } = props;
14
+ import { getKindFromMimeType, getMimeTypeFromFile } from './utils';
15
+ const StyledFileUploadItem = styled(SummaryItem)(({ hasThumbnail, theme }) => {
17
16
  return css `
18
- border: 0.0625rem solid ${theme.base.palette['border-line']};
19
- background-color: ${theme.base.palette['primary-background']};
20
- padding: calc(0.5 * ${theme.base.spacing});
21
- `;
17
+ border: 0.0625rem solid ${theme.base.palette['border-line']};
18
+ border-radius: calc(0.5 * ${theme.base['border-radius']});
19
+ background-color: ${theme.base.palette['primary-background']};
20
+ padding: calc(0.5 * ${theme.base.spacing});
21
+ min-height: 3rem;
22
+
23
+ ${StyledProgressRing} {
24
+ height: ${theme.components.input.height};
25
+ width: ${theme.components.input.height};
26
+ }
27
+
28
+ ${hasThumbnail &&
29
+ css `
30
+ height: calc(6rem + ${theme.base.spacing});
31
+ grid-row: span 2;
32
+ grid-template-columns: auto minmax(0, 1fr) auto;
33
+
34
+ ${StyledVisual} {
35
+ align-self: auto;
36
+ width: calc(6rem - 0.125rem);
37
+ height: calc(6rem - 0.125rem);
38
+ }
39
+
40
+ ${StyledPrimary} {
41
+ align-self: start;
42
+ margin-block-start: calc(0.5 * ${theme.base.spacing});
43
+ }
44
+
45
+ ${StyledSecondary} {
46
+ grid-area: primary;
47
+ align-self: center;
48
+ margin-block-start: calc(1.5 * ${theme.base.spacing});
49
+ }
50
+
51
+ ${StyledSummaryItemActions} {
52
+ align-self: start;
53
+ }
54
+ `}
55
+ `;
22
56
  });
23
57
  StyledFileUploadItem.defaultProps = defaultThemeProp;
24
- const FileUploadItem = forwardRef((props, ref) => {
25
- const { name, meta, error = false, progress, thumbnail, onCancel, onEdit, onPreview, onDownload, onDelete, ...restProps } = props;
58
+ const FileUploadItem = forwardRef(({ name, meta, error = false, progress, thumbnail, onCancel, onEdit, onPreview, onDownload, onDelete, size, ...restProps }, ref) => {
26
59
  const t = useI18n();
60
+ const [thumbnailError, setThumbnailError] = useState(false);
27
61
  const definedActions = useMemo(() => [
28
62
  { fn: onCancel, text: t('cancel'), icon: 'times' },
29
63
  { fn: onEdit, text: t('edit'), icon: 'pencil' },
@@ -33,18 +67,21 @@ const FileUploadItem = forwardRef((props, ref) => {
33
67
  ].filter((action) => !!action.fn), [onCancel, onEdit, onPreview, onDownload, onDelete]);
34
68
  let metaContent = meta;
35
69
  let actions;
70
+ const type = getKindFromMimeType(getMimeTypeFromFile(name) ?? '');
36
71
  if (typeof progress === 'number' && progress < 100) {
37
- metaContent = `${t('uploading')}...${Math.floor(progress)}%`;
72
+ metaContent = `${t('uploading')}…${Math.floor(progress)}%`;
38
73
  }
39
74
  if (Array.isArray(metaContent)) {
40
- metaContent = (_jsx(MetaList, { items: metaContent.map(item => (_jsx(Text, Object.assign({ variant: 'secondary', status: error ? 'error' : undefined }, { children: item }), item === null || item === void 0 ? void 0 : item.toString()))) }, void 0));
75
+ metaContent = (_jsx(MetaList, { items: metaContent.map((item, i) => (
76
+ // eslint-disable-next-line react/no-array-index-key
77
+ _jsx(Text, { variant: 'secondary', status: error ? 'error' : undefined, children: item }, i))) }, void 0));
41
78
  }
42
79
  else if (typeof metaContent === 'string') {
43
- metaContent = (_jsx(Text, Object.assign({ variant: 'secondary', status: error ? 'error' : undefined }, { children: metaContent }), void 0));
80
+ metaContent = (_jsx(Text, { variant: 'secondary', status: error ? 'error' : undefined, children: metaContent }, void 0));
44
81
  }
45
82
  if (definedActions.length === 1) {
46
83
  const action = definedActions[0];
47
- actions = (_jsx(Button, Object.assign({ icon: true, variant: 'simple', onClick: () => { var _a; return (_a = action.fn) === null || _a === void 0 ? void 0 : _a.call(action, name); }, "aria-label": `${action.text} ${name}` }, { children: _jsx(Icon, { name: action.icon }, void 0) }), void 0));
84
+ actions = (_jsx(Button, { icon: true, variant: 'simple', onClick: () => action.fn?.(name), "aria-label": `${action.text} ${name}`, children: _jsx(Icon, { name: action.icon }, void 0) }, void 0));
48
85
  }
49
86
  else if (definedActions.length > 1) {
50
87
  actions = (_jsx(MenuButton, { text: t('actions'), iconOnly: true, icon: 'more', variant: 'simple', menu: {
@@ -61,10 +98,11 @@ const FileUploadItem = forwardRef((props, ref) => {
61
98
  if (typeof progress === 'number' && progress !== 100) {
62
99
  return _jsx(Progress, { value: progress, placement: 'inline', variant: 'ring' }, void 0);
63
100
  }
64
- const type = getMimeTypeFromFile(name);
65
- return _jsx(FileVisual, { type: getKindFromMimeType(type !== null && type !== void 0 ? type : ''), thumbnail: thumbnail }, void 0);
66
- }, [progress, thumbnail, name]);
67
- return (_jsx(SummaryItem, Object.assign({}, restProps, { as: StyledFileUploadItem, ref: ref, visual: visual, primary: name, secondary: metaContent, actions: actions, error: error }), void 0));
101
+ return (_jsx(FileVisual, { type: type, thumbnail: thumbnailError ? undefined : thumbnail, onThumbnailError: () => {
102
+ setThumbnailError(true);
103
+ } }, void 0));
104
+ }, [progress, thumbnail, thumbnailError]);
105
+ return (_jsx(StyledFileUploadItem, { ...restProps, forwardedAs: 'li', hasThumbnail: thumbnail && !thumbnailError && (progress === 100 || progress === undefined) && !error, ref: ref, visual: visual, primary: name, secondary: metaContent, actions: actions, overflowStrategy: 'ellipsis' }, void 0));
68
106
  });
69
107
  export default FileUploadItem;
70
108
  //# sourceMappingURL=FileUploadItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploadItem.js","sourceRoot":"","sources":["../../../src/components/File/FileUploadItem.tsx"],"names":[],"mappings":";AAAA,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AC;oBAClB,CAAC;iBACF,CAAC,CAAC;aACJ,WACD,CACH,CAAC;KACH;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QAC1B,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,GAAG,EAAE;YACpD,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAC,QAAQ,EAAC,OAAO,EAAC,MAAM,WAAG,CAAC;SACxE;QACD,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACvC,OAAO,KAAC,UAAU,IAAC,IAAI,EAAE,mBAAmB,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,WAAI,CAAC;IACrF,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAEhC,OAAO,CACL,KAAC,WAAW,oBACN,SAAS,IACb,EAAE,EAAE,oBAAoB,EACxB,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,YACZ,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, FC, Ref, ReactElement, useMemo, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport MenuButton from '../MenuButton';\nimport MetaList from '../MetaList';\nimport SummaryItem from '../SummaryItem';\nimport Progress from '../Progress';\nimport Text from '../Text';\nimport { ForwardProps, BaseProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { useI18n } from '../../hooks';\n\nimport { getKindFromMimeType, getMimeTypeFromFile } from './utils';\nimport FileVisual from './FileVisual';\n\nexport interface FileUploadItemProps extends BaseProps {\n /** Name of the file. */\n name: string;\n /** A FileUploadVisual element to represent the file. */\n visual?: ReactElement;\n /** Additional information about the file. If progress prop is passed and its value is less than 100, this region is instead used for the upload progress indicator. */\n meta?: string | string[];\n /** When passed, will render a single icon button for yet to be or in progress uploads. Use this action to trigger xhr request termination. */\n onCancel?: (name: FileUploadItemProps['name']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onEdit?: (name: FileUploadItemProps['name']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onPreview?: (name: FileUploadItemProps['name']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onDownload?: (name: FileUploadItemProps['name']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onDelete?: (name: FileUploadItemProps['name']) => void;\n /**\n * Set if there is an error uploading or processing the file. Applies error styling to the meta string passed.\n * @default false\n */\n error?: boolean;\n /** A string to be used as an image src for a attachment thumbnail. Falls back to a provided icon or the default attachment icon. */\n thumbnail?: string;\n /** If the attachment is in an upload state, pass progress as a number between 0-100 representing the percentage of progress. */\n progress?: number;\n /** A ref to the file item's HTMLLIElement. */\n ref?: Ref<HTMLLIElement>;\n}\n\ninterface FileAction {\n fn: (name: FileUploadItemProps['name']) => void;\n text: string;\n icon: string;\n}\n\nconst StyledFileUploadItem = styled.li(props => {\n const { theme } = props;\n\n return css`\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n background-color: ${theme.base.palette['primary-background']};\n padding: calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledFileUploadItem.defaultProps = defaultThemeProp;\n\nconst FileUploadItem: FC<FileUploadItemProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<FileUploadItemProps>, ref: FileUploadItemProps['ref']) => {\n const {\n name,\n meta,\n error = false,\n progress,\n thumbnail,\n onCancel,\n onEdit,\n onPreview,\n onDownload,\n onDelete,\n ...restProps\n } = props;\n\n const t = useI18n();\n\n const definedActions: FileAction[] = useMemo(\n () =>\n [\n { fn: onCancel, text: t('cancel'), icon: 'times' },\n { fn: onEdit, text: t('edit'), icon: 'pencil' },\n { fn: onPreview, text: t('preview'), icon: 'eye' },\n { fn: onDownload, text: t('download'), icon: 'download' },\n { fn: onDelete, text: t('delete'), icon: 'trash' }\n ].filter<FileAction>((action): action is FileAction => !!action.fn),\n [onCancel, onEdit, onPreview, onDownload, onDelete]\n );\n\n let metaContent: ReactNode = meta;\n let actions: ReactElement | undefined;\n\n if (typeof progress === 'number' && progress < 100) {\n metaContent = `${t('uploading')}...${Math.floor(progress)}%`;\n }\n\n if (Array.isArray(metaContent)) {\n metaContent = (\n <MetaList\n items={metaContent.map(item => (\n <Text key={item?.toString()} variant='secondary' status={error ? 'error' : undefined}>\n {item}\n </Text>\n ))}\n />\n );\n } else if (typeof metaContent === 'string') {\n metaContent = (\n <Text variant='secondary' status={error ? 'error' : undefined}>\n {metaContent}\n </Text>\n );\n }\n\n if (definedActions.length === 1) {\n const action = definedActions[0];\n\n actions = (\n <Button\n icon\n variant='simple'\n onClick={() => action.fn?.(name)}\n aria-label={`${action.text} ${name}`}\n >\n <Icon name={action.icon} />\n </Button>\n );\n } else if (definedActions.length > 1) {\n actions = (\n <MenuButton\n text={t('actions')}\n iconOnly\n icon='more'\n variant='simple'\n menu={{\n items: definedActions.map(action => ({\n id: action.text,\n primary: action.text,\n onClick: () => {\n action.fn(name);\n }\n }))\n }}\n />\n );\n }\n\n const visual = useMemo(() => {\n if (typeof progress === 'number' && progress !== 100) {\n return <Progress value={progress} placement='inline' variant='ring' />;\n }\n const type = getMimeTypeFromFile(name);\n return <FileVisual type={getKindFromMimeType(type ?? '')} thumbnail={thumbnail} />;\n }, [progress, thumbnail, name]);\n\n return (\n <SummaryItem\n {...restProps}\n as={StyledFileUploadItem}\n ref={ref}\n visual={visual}\n primary={name}\n secondary={metaContent}\n actions={actions}\n error={error}\n />\n );\n }\n);\n\nexport default FileUploadItem;\n"]}
1
+ {"version":3,"file":"FileUploadItem.js","sourceRo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AoB,OACf,SAAS,EACb,WAAW,EAAC,IAAI,EAChB,YAAY,EACV,SAAS,IAAI,CAAC,cAAc,IAAI,CAAC,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,SAAS,CAAC,IAAI,CAAC,KAAK,EAExF,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAC,UAAU,WAC3B,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import {\n forwardRef,\n PropsWithoutRef,\n FC,\n Ref,\n ReactElement,\n useMemo,\n useState,\n ReactNode\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport MenuButton from '../MenuButton';\nimport MetaList from '../MetaList';\nimport SummaryItem, {\n StyledPrimary,\n StyledSecondary,\n StyledSummaryItemActions,\n StyledVisual\n} from '../SummaryItem';\nimport Progress, { StyledProgressRing } from '../Progress';\nimport Text from '../Text';\nimport { ForwardProps, BaseProps, NoChildrenProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { useI18n } from '../../hooks';\n\nimport FileVisual from './FileVisual';\nimport { getKindFromMimeType, getMimeTypeFromFile } from './utils';\n\nexport interface FileUploadItemProps extends BaseProps, NoChildrenProp {\n /** Name of the file. */\n name: string;\n /** A FileUploadVisual element to represent the file. */\n visual?: ReactElement;\n /** Additional information about the file. If progress prop is passed and its value is less than 100, this region is instead used for the upload progress indicator. */\n meta?: string | string[];\n /** When passed, will render a single icon button for yet to be or in progress uploads. Use this action to trigger xhr request termination. */\n onCancel?: (name: FileUploadItemProps['name']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onEdit?: (name: FileUploadItemProps['name']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onPreview?: (name: FileUploadItemProps['name']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onDownload?: (name: FileUploadItemProps['name']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onDelete?: (name: FileUploadItemProps['name']) => void;\n /**\n * Set if there is an error uploading or processing the file. Applies error styling to the meta string passed.\n * @default false\n */\n error?: boolean;\n /** A string to be used as an image src for a attachment thumbnail. Falls back to a provided icon or the default attachment icon. */\n thumbnail?: string;\n /** If the attachment is in an upload state, pass progress as a number between 0-100 representing the percentage of progress. */\n progress?: number;\n /** The size of the file. */\n size?: number;\n /** A ref to the file item's HTMLLIElement. */\n ref?: Ref<HTMLLIElement>;\n}\n\ninterface FileAction {\n fn: (name: FileUploadItemProps['name']) => void;\n text: string;\n icon: string;\n}\n\nconst StyledFileUploadItem = styled(SummaryItem)<{ hasThumbnail: boolean }>(\n ({ hasThumbnail, theme }) => {\n return css`\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n background-color: ${theme.base.palette['primary-background']};\n padding: calc(0.5 * ${theme.base.spacing});\n min-height: 3rem;\n\n ${StyledProgressRing} {\n height: ${theme.components.input.height};\n width: ${theme.components.input.height};\n }\n\n ${hasThumbnail &&\n css`\n height: calc(6rem + ${theme.base.spacing});\n grid-row: span 2;\n grid-template-columns: auto minmax(0, 1fr) auto;\n\n ${StyledVisual} {\n align-self: auto;\n width: calc(6rem - 0.125rem);\n height: calc(6rem - 0.125rem);\n }\n\n ${StyledPrimary} {\n align-self: start;\n margin-block-start: calc(0.5 * ${theme.base.spacing});\n }\n\n ${StyledSecondary} {\n grid-area: primary;\n align-self: center;\n margin-block-start: calc(1.5 * ${theme.base.spacing});\n }\n\n ${StyledSummaryItemActions} {\n align-self: start;\n }\n `}\n `;\n }\n);\n\nStyledFileUploadItem.defaultProps = defaultThemeProp;\n\nconst FileUploadItem: FC<FileUploadItemProps & ForwardProps> = forwardRef(\n (\n {\n name,\n meta,\n error = false,\n progress,\n thumbnail,\n onCancel,\n onEdit,\n onPreview,\n onDownload,\n onDelete,\n size,\n ...restProps\n }: PropsWithoutRef<FileUploadItemProps>,\n ref: FileUploadItemProps['ref']\n ) => {\n const t = useI18n();\n const [thumbnailError, setThumbnailError] = useState(false);\n\n const definedActions: FileAction[] = useMemo(\n () =>\n [\n { fn: onCancel, text: t('cancel'), icon: 'times' },\n { fn: onEdit, text: t('edit'), icon: 'pencil' },\n { fn: onPreview, text: t('preview'), icon: 'eye' },\n { fn: onDownload, text: t('download'), icon: 'download' },\n { fn: onDelete, text: t('delete'), icon: 'trash' }\n ].filter<FileAction>((action): action is FileAction => !!action.fn),\n [onCancel, onEdit, onPreview, onDownload, onDelete]\n );\n\n let metaContent: ReactNode = meta;\n let actions: ReactElement | undefined;\n\n const type = getKindFromMimeType(getMimeTypeFromFile(name) ?? '');\n\n if (typeof progress === 'number' && progress < 100) {\n metaContent = `${t('uploading')}…${Math.floor(progress)}%`;\n }\n\n if (Array.isArray(metaContent)) {\n metaContent = (\n <MetaList\n items={metaContent.map((item, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <Text key={i} variant='secondary' status={error ? 'error' : undefined}>\n {item}\n </Text>\n ))}\n />\n );\n } else if (typeof metaContent === 'string') {\n metaContent = (\n <Text variant='secondary' status={error ? 'error' : undefined}>\n {metaContent}\n </Text>\n );\n }\n\n if (definedActions.length === 1) {\n const action = definedActions[0];\n\n actions = (\n <Button\n icon\n variant='simple'\n onClick={() => action.fn?.(name)}\n aria-label={`${action.text} ${name}`}\n >\n <Icon name={action.icon} />\n </Button>\n );\n } else if (definedActions.length > 1) {\n actions = (\n <MenuButton\n text={t('actions')}\n iconOnly\n icon='more'\n variant='simple'\n menu={{\n items: definedActions.map(action => ({\n id: action.text,\n primary: action.text,\n onClick: () => {\n action.fn(name);\n }\n }))\n }}\n />\n );\n }\n\n const visual = useMemo(() => {\n if (typeof progress === 'number' && progress !== 100) {\n return <Progress value={progress} placement='inline' variant='ring' />;\n }\n\n return (\n <FileVisual\n type={type}\n thumbnail={thumbnailError ? undefined : thumbnail}\n onThumbnailError={() => {\n setThumbnailError(true);\n }}\n />\n );\n }, [progress, thumbnail, thumbnailError]);\n\n return (\n <StyledFileUploadItem\n {...restProps}\n forwardedAs='li'\n hasThumbnail={\n thumbnail && !thumbnailError && (progress === 100 || progress === undefined) && !error\n }\n ref={ref}\n visual={visual}\n primary={name}\n secondary={metaContent}\n actions={actions}\n overflowStrategy='ellipsis'\n />\n );\n }\n);\n\nexport default FileUploadItem;\n"]}
@@ -1,28 +1,19 @@
1
- import { FC, Ref } from 'react';
1
+ import { FC, Ref, SyntheticEvent } from 'react';
2
2
  import { DefaultTheme } from 'styled-components';
3
- import { ForwardProps, BaseProps, PropsWithDefaults } from '../../types';
4
- import { ButtonProps } from '../Button';
3
+ import { ForwardProps, BaseProps } from '../../types';
5
4
  import { AttachmentType } from './utils';
6
5
  export interface FileVisualProps extends BaseProps {
7
6
  /** Attachment/File type, it has an impact on background color and icon rendered. */
8
7
  type: AttachmentType;
9
8
  /** A string to be used as an image src for a attachment thumbnail. */
10
9
  thumbnail?: string;
11
- /** Disabled means, the button is not interactive. */
12
- disabled?: ButtonProps['disabled'];
10
+ /** Called when a thumbnail encounters an error while loading. */
11
+ onThumbnailError?: (e: SyntheticEvent<HTMLImageElement>) => void;
13
12
  /** Reference to a button element. */
14
- ref?: Ref<HTMLButtonElement>;
15
- /**
16
- * FileVisual size.
17
- * @default "s"
18
- */
19
- size?: 's' | 'l';
13
+ ref?: Ref<HTMLDivElement>;
20
14
  }
21
- declare type FileVisualPropsWithDefaults = PropsWithDefaults<FileVisualProps, 'size'>;
22
- export declare const StyledFileVisual: import("styled-components").StyledComponent<"div", DefaultTheme, Pick<FileVisualPropsWithDefaults, "size"> & {
23
- thumbnail?: FileVisualProps['thumbnail'];
24
- aType: AttachmentType;
25
- }, never>;
15
+ export declare const StyledFileVisual: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
16
+ export declare const StyledIconFrame: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
26
17
  declare const FileVisual: FC<FileVisualProps & ForwardProps>;
27
18
  export default FileVisual;
28
19
  //# sourceMappingURL=FileVisual.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileVisual.d.ts","sourceRoot":"","sources":["../../../src/components/File/FileVisual.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,EAAE,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAe,EAAO,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAc,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrF,OAAO,EAAE,WAAW,EAAgB,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,oFAAoF;IACpF,IAAI,EAAE,cAAc,CAAC;IACrB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACnC,qCAAqC;IACrC,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;CAClB;AACD,aAAK,2BAA2B,GAAG,iBAAiB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAqE9E,eAAO,MAAM,gBAAgB;gBAEb,eAAe,CAAC,WAAW,CAAC;WACjC,cAAc;SA+BvB,CAAC;AAIH,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,GAAG,YAAY,CAoBlD,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"FileVisual.d.ts","sourceRoot":"","sources":["../../../src/components/File/FileVisual.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,EAAE,EAAE,GAAG,EAAiB,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAe,EAAO,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAc,MAAM,aAAa,CAAC;AAMlE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,oFAAoF;IACpF,IAAI,EAAE,cAAc,CAAC;IACrB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACjE,qCAAqC;IACrC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAmED,eAAO,MAAM,gBAAgB,6EAAe,CAAC;AAE7C,eAAO,MAAM,eAAe,6EAY1B,CAAC;AAsBH,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,GAAG,YAAY,CAoClD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,104 +1,101 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
4
  import Icon from '../Icon';
5
5
  import { defaultThemeProp } from '../../theme';
6
- import { StyledText } from '../Text';
7
- import { StyledButton } from '../Button';
6
+ import Flex from '../Flex';
7
+ import Image, { StyledImage } from '../Image';
8
+ import { useTheme } from '../../hooks';
8
9
  const mapping = {
9
10
  generic: {
10
11
  iconName: 'paper-clip',
11
- backgroundColor: 'slate-dark'
12
+ backgroundColor: 'slate.dark'
12
13
  },
13
14
  video: {
14
15
  iconName: 'play-solid',
15
- backgroundColor: 'slate-dark'
16
+ backgroundColor: 'slate.dark'
16
17
  },
17
18
  audio: {
18
19
  iconName: 'speaker-on-solid',
19
- backgroundColor: 'slate-dark'
20
+ backgroundColor: 'slate.dark'
20
21
  },
21
22
  document: {
22
23
  iconName: 'filetype-text',
23
- backgroundColor: 'blue-medium'
24
+ backgroundColor: 'blue.medium'
24
25
  },
25
26
  message: {
26
27
  iconName: 'mail-solid',
27
- backgroundColor: 'blue-dark'
28
+ backgroundColor: 'blue.dark'
28
29
  },
29
30
  pdf: {
30
31
  text: 'PDF',
31
- backgroundColor: 'red-medium'
32
+ backgroundColor: 'red.medium'
32
33
  },
33
34
  spreadsheet: {
34
35
  iconName: 'grid-solid',
35
- backgroundColor: 'green-medium'
36
+ backgroundColor: 'green.medium'
36
37
  },
37
38
  presentation: {
38
39
  iconName: 'slideshow-solid',
39
- backgroundColor: 'orange-medium'
40
+ backgroundColor: 'orange.medium'
40
41
  },
41
42
  link: {
42
43
  iconName: 'chain',
43
- backgroundColor: 'purple-dark'
44
+ backgroundColor: 'purple.dark'
44
45
  },
45
46
  archive: {
46
47
  iconName: 'archive-solid',
47
- backgroundColor: 'slate-dark'
48
+ backgroundColor: 'slate.dark'
48
49
  },
49
50
  database: {
50
51
  iconName: 'disc-stack-solid',
51
- backgroundColor: 'slate-dark'
52
+ backgroundColor: 'slate.dark'
52
53
  },
53
54
  image: {
54
55
  iconName: 'picture-solid',
55
- backgroundColor: 'slate-dark'
56
+ backgroundColor: 'slate.dark'
56
57
  },
57
58
  text: {
58
59
  iconName: 'filetype-text',
59
- backgroundColor: 'slate-dark'
60
+ backgroundColor: 'slate.dark'
60
61
  }
61
62
  };
62
- const sizeConverter = {
63
- s: 1,
64
- l: 1.375
65
- };
66
- export const StyledFileVisual = styled.div(({ theme, thumbnail, size, aType }) => {
67
- var _a;
68
- const [color, lightness] = mapping[aType].backgroundColor.split('-', 2);
69
- const backgroundColor = theme.base.colors[color];
70
- const sizeMultiplier = (_a = sizeConverter[size]) !== null && _a !== void 0 ? _a : 1;
63
+ export const StyledFileVisual = styled.div ``;
64
+ export const StyledIconFrame = styled(StyledFileVisual)(({ theme }) => {
71
65
  return css `
72
- background-color: ${backgroundColor[lightness]};
66
+ background-color: var(--bg);
73
67
  color: ${theme.base.palette.light};
74
- border-color: transparent;
75
- height: calc(${sizeMultiplier} * ${theme.components.input.height});
76
- width: calc(${sizeMultiplier} * ${theme.components.input.height});
68
+ height: ${theme.components.input.height};
69
+ width: ${theme.components.input.height};
77
70
  border-radius: calc(0.25 * ${theme.base['border-radius']});
78
71
  font-size: calc(0.7 * ${theme.base['font-size']});
79
72
  font-weight: ${theme.base['font-weight']['semi-bold']};
80
- overflow: hidden;
81
- opacity: 1;
82
- ${thumbnail &&
83
- css `
84
- background-image: url(${thumbnail});
85
- background-size: contain;
86
- `}
73
+ user-select: none;
74
+ -webkit-user-select: none;
75
+ `;
76
+ });
77
+ StyledIconFrame.defaultProps = defaultThemeProp;
78
+ const StyledThumbnailFrame = styled(StyledFileVisual)(({ theme }) => {
79
+ return css `
80
+ background-color: ${theme.base.palette['app-background']};
81
+ height: 100%;
82
+ width: 100%;
87
83
 
88
- ${StyledText} {
89
- color: inherit;
90
- white-space: nowrap;
84
+ ${StyledImage} {
85
+ margin: auto;
86
+ height: unset;
87
+ width: unset;
88
+ max-height: 100%;
89
+ max-width: 100%;
91
90
  }
92
91
  `;
93
92
  });
94
- StyledFileVisual.defaultProps = defaultThemeProp;
95
- const FileVisual = forwardRef((props, ref) => {
96
- const { type, thumbnail, size, disabled, ...restProps } = props;
97
- return (_jsxs(StyledFileVisual, Object.assign({}, restProps, { as: StyledButton, ref: ref, icon: true, aType: type }, {
98
- thumbnail,
99
- disabled
100
- }, { children: [mapping[type].iconName && _jsx(Icon, { name: mapping[type].iconName }, void 0),
101
- mapping[type].text] }), void 0));
93
+ StyledThumbnailFrame.defaultProps = defaultThemeProp;
94
+ const FileVisual = forwardRef(({ type, thumbnail, onThumbnailError, ...restProps }, ref) => {
95
+ const visualConfig = mapping[type];
96
+ const [color, lightness] = visualConfig.backgroundColor.split('.', 2);
97
+ const { base: { colors: { [color]: { [lightness]: backgroundColor } } } } = useTheme();
98
+ return thumbnail ? (_jsx(Flex, { ...restProps, as: StyledThumbnailFrame, container: true, children: _jsx(Image, { src: thumbnail, onError: onThumbnailError, alt: '' }, void 0) }, void 0)) : (_jsx(Flex, { ...restProps, as: StyledIconFrame, ref: ref, container: { justify: 'center', alignItems: 'center' }, style: { '--bg': backgroundColor }, children: visualConfig.iconName ? _jsx(Icon, { name: visualConfig.iconName }, void 0) : visualConfig.text }, void 0));
102
99
  });
103
100
  export default FileVisual;
104
101
  //# sourceMappingURL=FileVisual.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileVisual.js","sourceRoot":"","sources":["../../../src/components/File/FileVisual.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA4B,MAAM,OAAO,CAAC;AAC7D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAgB,MAAM,mBAAmB,CAAC;AAE9D,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAe,YAAY,EAAE,MAAM,WAAW,CAAC;AAyBtD,MAAM,OAAO,GAGT;IACF,OAAO,EAAE;QACP,QAAQ,EAAE,YAAY;QACtB,eAAe,EAAE,YAAY;KAC9B;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,YAAY;QACtB,eAAe,EAAE,YAAY;KAC9B;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,kBAAkB;QAC5B,eAAe,EAAE,YAAY;KAC9B;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,eAAe;QACzB,eAAe,EAAE,aAAa;KAC/B;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,YAAY;QACtB,eAAe,EAAE,WAAW;KAC7B;IACD,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,eAAe,EAAE,YAAY;KAC9B;IACD,WAAW,EAAE;QACX,QA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iCAClC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;4BAChC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;mBAChC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;;;MAGnD,SAAS;QACX,GAAG,CAAA;8BACuB,SAAS;;KAElC;;MAEC,UAAU;;;;GAIb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,UAAU,GAAuC,UAAU,CAC/D,CAAC,KAAuC,EAAE,GAA2B,EAAE,EAAE;IACvE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAChE,OAAO,CACL,MAAC,gBAAgB,oBACX,SAAS,IACb,EAAE,EAAE,YAAY,EAChB,GAAG,EAAE,GAAG,EACR,IAAI,QACJ,KAAK,EAAE,IAAI,IACP;QACF,SAAS;QACT,QAAQ;KACT,eAEA,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,KAAC,IAAI,IAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,QAAS,WAAI;YACjE,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,aACF,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, FC, Ref } from 'react';\nimport styled, { css, DefaultTheme } from 'styled-components';\n\nimport Icon from '../Icon';\nimport { ForwardProps, BaseProps, OmitStrict, PropsWithDefaults } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { StyledText } from '../Text';\nimport { ButtonProps, StyledButton } from '../Button';\n\nimport { AttachmentType } from './utils';\n\nexport interface FileVisualProps extends BaseProps {\n /** Attachment/File type, it has an impact on background color and icon rendered. */\n type: AttachmentType;\n /** A string to be used as an image src for a attachment thumbnail. */\n thumbnail?: string;\n /** Disabled means, the button is not interactive. */\n disabled?: ButtonProps['disabled'];\n /** Reference to a button element. */\n ref?: Ref<HTMLButtonElement>;\n /**\n * FileVisual size.\n * @default \"s\"\n */\n size?: 's' | 'l';\n}\ntype FileVisualPropsWithDefaults = PropsWithDefaults<FileVisualProps, 'size'>;\ntype ThemeColor = keyof OmitStrict<DefaultTheme['base']['colors'], 'white' | 'black'>;\ntype ThemeColorVariant = 'extra-light' | 'light' | 'medium' | 'dark' | 'extra-dark';\n\ntype BackgroundColor = `${ThemeColor}-${ThemeColorVariant}`;\n\nconst mapping: Record<\n AttachmentType,\n { iconName?: string; backgroundColor: BackgroundColor; text?: string }\n> = {\n generic: {\n iconName: 'paper-clip',\n backgroundColor: 'slate-dark'\n },\n video: {\n iconName: 'play-solid',\n backgroundColor: 'slate-dark'\n },\n audio: {\n iconName: 'speaker-on-solid',\n backgroundColor: 'slate-dark'\n },\n document: {\n iconName: 'filetype-text',\n backgroundColor: 'blue-medium'\n },\n message: {\n iconName: 'mail-solid',\n backgroundColor: 'blue-dark'\n },\n pdf: {\n text: 'PDF',\n backgroundColor: 'red-medium'\n },\n spreadsheet: {\n iconName: 'grid-solid',\n backgroundColor: 'green-medium'\n },\n presentation: {\n iconName: 'slideshow-solid',\n backgroundColor: 'orange-medium'\n },\n link: {\n iconName: 'chain',\n backgroundColor: 'purple-dark'\n },\n archive: {\n iconName: 'archive-solid',\n backgroundColor: 'slate-dark'\n },\n database: {\n iconName: 'disc-stack-solid',\n backgroundColor: 'slate-dark'\n },\n image: {\n iconName: 'picture-solid',\n backgroundColor: 'slate-dark'\n },\n text: {\n iconName: 'filetype-text',\n backgroundColor: 'slate-dark'\n }\n} as const;\n\nconst sizeConverter = {\n s: 1,\n l: 1.375\n};\n\nexport const StyledFileVisual = styled.div<\n Pick<FileVisualPropsWithDefaults, 'size'> & {\n thumbnail?: FileVisualProps['thumbnail'];\n aType: AttachmentType;\n }\n>(({ theme, thumbnail, size, aType }) => {\n const [color, lightness] = mapping[aType].backgroundColor.split('-', 2) as [\n ThemeColor,\n ThemeColorVariant\n ];\n const backgroundColor = theme.base.colors[color];\n const sizeMultiplier = sizeConverter[size] ?? 1;\n return css`\n background-color: ${backgroundColor[lightness]};\n color: ${theme.base.palette.light};\n border-color: transparent;\n height: calc(${sizeMultiplier} * ${theme.components.input.height});\n width: calc(${sizeMultiplier} * ${theme.components.input.height});\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n font-size: calc(0.7 * ${theme.base['font-size']});\n font-weight: ${theme.base['font-weight']['semi-bold']};\n overflow: hidden;\n opacity: 1;\n ${thumbnail &&\n css`\n background-image: url(${thumbnail});\n background-size: contain;\n `}\n\n ${StyledText} {\n color: inherit;\n white-space: nowrap;\n }\n `;\n});\n\nStyledFileVisual.defaultProps = defaultThemeProp;\n\nconst FileVisual: FC<FileVisualProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<FileVisualProps>, ref: FileVisualProps['ref']) => {\n const { type, thumbnail, size, disabled, ...restProps } = props;\n return (\n <StyledFileVisual\n {...restProps}\n as={StyledButton}\n ref={ref}\n icon\n aType={type}\n {...{\n thumbnail,\n disabled\n }}\n >\n {mapping[type].iconName && <Icon name={mapping[type].iconName!} />}\n {mapping[type].text}\n </StyledFileVisual>\n );\n }\n);\n\nexport default FileVisual;\n"]}
1
+ {"version":3,"file":"FileVisual.js","sourceRoot":"","sources":["../../../src/components/File/FileVisual.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2D,MAAM,OAAO,CAAC;AAC5F,OAAO,MAAM,EAAE,EAAE,GAAG,EAAgB,MAAM,mBAAmB,CAAC;AAE9D,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,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,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAC,EAAE,WAAG,WACtD,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,OACC,SAAS,EACb,EAAE,EAAE,eAAe,EACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,EACtD,KAAK,EAAE,EAAE,MAAM,EAAE,eAAe,EAAmB,YAElD,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,YAAY,CAAC,QAAQ,WAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,WAC7E,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, FC, Ref, CSSProperties, SyntheticEvent } from 'react';\nimport styled, { css, DefaultTheme } from 'styled-components';\n\nimport Icon from '../Icon';\nimport { ForwardProps, BaseProps, OmitStrict } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport Image, { StyledImage } from '../Image';\nimport { useTheme } from '../../hooks';\n\nimport { AttachmentType } from './utils';\n\nexport interface FileVisualProps extends BaseProps {\n /** Attachment/File type, it has an impact on background color and icon rendered. */\n type: AttachmentType;\n /** A string to be used as an image src for a attachment thumbnail. */\n thumbnail?: string;\n /** Called when a thumbnail encounters an error while loading. */\n onThumbnailError?: (e: SyntheticEvent<HTMLImageElement>) => void;\n /** Reference to a button element. */\n ref?: Ref<HTMLDivElement>;\n}\ntype ThemeColor = keyof OmitStrict<DefaultTheme['base']['colors'], 'white' | 'black'>;\ntype ThemeColorVariant = 'extra-light' | 'light' | 'medium' | 'dark' | 'extra-dark';\n\ntype BackgroundColor = `${ThemeColor}.${ThemeColorVariant}`;\n\nconst mapping: Record<\n AttachmentType,\n { backgroundColor: BackgroundColor } & (\n | { iconName: string; text?: never }\n | { iconName?: never; text: string }\n )\n> = {\n generic: {\n iconName: 'paper-clip',\n backgroundColor: 'slate.dark'\n },\n video: {\n iconName: 'play-solid',\n backgroundColor: 'slate.dark'\n },\n audio: {\n iconName: 'speaker-on-solid',\n backgroundColor: 'slate.dark'\n },\n document: {\n iconName: 'filetype-text',\n backgroundColor: 'blue.medium'\n },\n message: {\n iconName: 'mail-solid',\n backgroundColor: 'blue.dark'\n },\n pdf: {\n text: 'PDF',\n backgroundColor: 'red.medium'\n },\n spreadsheet: {\n iconName: 'grid-solid',\n backgroundColor: 'green.medium'\n },\n presentation: {\n iconName: 'slideshow-solid',\n backgroundColor: 'orange.medium'\n },\n link: {\n iconName: 'chain',\n backgroundColor: 'purple.dark'\n },\n archive: {\n iconName: 'archive-solid',\n backgroundColor: 'slate.dark'\n },\n database: {\n iconName: 'disc-stack-solid',\n backgroundColor: 'slate.dark'\n },\n image: {\n iconName: 'picture-solid',\n backgroundColor: 'slate.dark'\n },\n text: {\n iconName: 'filetype-text',\n backgroundColor: 'slate.dark'\n }\n} as const;\n\nexport const StyledFileVisual = styled.div``;\n\nexport const StyledIconFrame = styled(StyledFileVisual)(({ theme }) => {\n return css`\n background-color: var(--bg);\n color: ${theme.base.palette.light};\n height: ${theme.components.input.height};\n width: ${theme.components.input.height};\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n font-size: calc(0.7 * ${theme.base['font-size']});\n font-weight: ${theme.base['font-weight']['semi-bold']};\n user-select: none;\n -webkit-user-select: none;\n `;\n});\n\nStyledIconFrame.defaultProps = defaultThemeProp;\n\nconst StyledThumbnailFrame = styled(StyledFileVisual)(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['app-background']};\n height: 100%;\n width: 100%;\n\n ${StyledImage} {\n margin: auto;\n height: unset;\n width: unset;\n max-height: 100%;\n max-width: 100%;\n }\n `;\n});\n\nStyledThumbnailFrame.defaultProps = defaultThemeProp;\n\nconst FileVisual: FC<FileVisualProps & ForwardProps> = forwardRef(\n (\n { type, thumbnail, onThumbnailError, ...restProps }: PropsWithoutRef<FileVisualProps>,\n ref: FileVisualProps['ref']\n ) => {\n const visualConfig = mapping[type];\n\n const [color, lightness] = visualConfig.backgroundColor.split('.', 2) as [\n ThemeColor,\n ThemeColorVariant\n ];\n\n const {\n base: {\n colors: {\n [color]: { [lightness]: backgroundColor }\n }\n }\n } = useTheme();\n\n return thumbnail ? (\n <Flex {...restProps} as={StyledThumbnailFrame} container>\n <Image src={thumbnail} onError={onThumbnailError} alt='' />\n </Flex>\n ) : (\n <Flex\n {...restProps}\n as={StyledIconFrame}\n ref={ref}\n container={{ justify: 'center', alignItems: 'center' }}\n style={{ '--bg': backgroundColor } as CSSProperties}\n >\n {visualConfig.iconName ? <Icon name={visualConfig.iconName} /> : visualConfig.text}\n </Flex>\n );\n }\n);\n\nexport default FileVisual;\n"]}
@@ -5,9 +5,8 @@ import mimeTypes from './mimeTypes.json';
5
5
  * @returns mime type associated to the file.
6
6
  */
7
7
  export const getMimeTypeFromFile = (fileName) => {
8
- var _a;
9
- const fileExt = (_a = fileName.split('.').pop()) !== null && _a !== void 0 ? _a : fileName;
10
- return mimeTypes[fileExt];
8
+ const fileExt = fileName.split('.').pop() ?? fileName;
9
+ return mimeTypes[fileExt.toLowerCase()];
11
10
  };
12
11
  export const getKindFromMimeType = (mimeType) => {
13
12
  let type = 'generic';
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/File/utils.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAkBzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAgB,EAAsB,EAAE;;IAC1E,MAAM,OAAO,GAAG,MAAA,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,mCAAI,QAAQ,CAAC;IACtD,OAAQ,SAAoC,CAAC,OAAO,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAgB,EAAkB,EAAE;IACtE,IAAI,IAAI,GAAmB,SAAS,CAAC;IACrC,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,IAAI,GAAG,OAAO,CAAC;IAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,IAAI,GAAG,OAAO,CAAC;IAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,IAAI,GAAG,OAAO,CAAC;IAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,IAAI,GAAG,MAAM,CAAC;IAChD,IAAI,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,IAAI,GAAG,SAAS,CAAC;IACtD,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,IAAI,GAAG,KAAK,CAAC;IAC5C,IAAI,QAAQ,CAAC,KAAK,CAAC,iCAAiC,CAAC;QAAE,IAAI,GAAG,cAAc,CAAC;IAC7E,IAAI,QAAQ,CAAC,KAAK,CAAC,wBAAwB,CAAC;QAAE,IAAI,GAAG,aAAa,CAAC;IACnE,IAAI,QAAQ,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAAE,IAAI,GAAG,UAAU,CAAC;IAC1D,IAAI,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC;QAAE,IAAI,GAAG,UAAU,CAAC;IACzD,IAAI,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC;QAAE,IAAI,GAAG,SAAS,CAAC;IACnD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import mimeTypes from './mimeTypes.json';\n\nexport type AttachmentType =\n | 'generic'\n | 'image'\n | 'video'\n | 'audio'\n | 'pdf'\n | 'archive'\n | 'text'\n | 'message'\n | 'link'\n | 'pdf'\n | 'database'\n | 'document'\n | 'spreadsheet'\n | 'presentation';\n\n/**\n * Returns approximately correct mime type for given file based upon the extension. Only few extensions are recognized.\n * @param fileName file name or url to discover the mime type from.\n * @returns mime type associated to the file.\n */\nexport const getMimeTypeFromFile = (fileName: string): string | undefined => {\n const fileExt = fileName.split('.').pop() ?? fileName;\n return (mimeTypes as Record<string, string>)[fileExt];\n};\n\nexport const getKindFromMimeType = (mimeType: string): AttachmentType => {\n let type: AttachmentType = 'generic';\n if (mimeType.startsWith('video/')) type = 'video';\n if (mimeType.startsWith('audio/')) type = 'audio';\n if (mimeType.startsWith('image/')) type = 'image';\n if (mimeType.startsWith('text/')) type = 'text';\n if (mimeType.startsWith('message/')) type = 'message';\n if (mimeType.endsWith('/pdf')) type = 'pdf';\n if (mimeType.match(/powerpoint|presentation|impress/)) type = 'presentation';\n if (mimeType.match(/excel|spreadsheet|calc/)) type = 'spreadsheet';\n if (mimeType.match(/word|writer|text/)) type = 'document';\n if (mimeType.match(/access|database/)) type = 'database';\n if (mimeType.match(/zip|rar|7z/)) type = 'archive';\n return type;\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/File/utils.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAkBzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAgB,EAAsB,EAAE;IAC1E,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,QAAQ,CAAC;IACtD,OAAQ,SAAoC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AACtE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAgB,EAAkB,EAAE;IACtE,IAAI,IAAI,GAAmB,SAAS,CAAC;IACrC,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,IAAI,GAAG,OAAO,CAAC;IAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,IAAI,GAAG,OAAO,CAAC;IAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,IAAI,GAAG,OAAO,CAAC;IAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,IAAI,GAAG,MAAM,CAAC;IAChD,IAAI,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,IAAI,GAAG,SAAS,CAAC;IACtD,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,IAAI,GAAG,KAAK,CAAC;IAC5C,IAAI,QAAQ,CAAC,KAAK,CAAC,iCAAiC,CAAC;QAAE,IAAI,GAAG,cAAc,CAAC;IAC7E,IAAI,QAAQ,CAAC,KAAK,CAAC,wBAAwB,CAAC;QAAE,IAAI,GAAG,aAAa,CAAC;IACnE,IAAI,QAAQ,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAAE,IAAI,GAAG,UAAU,CAAC;IAC1D,IAAI,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC;QAAE,IAAI,GAAG,UAAU,CAAC;IACzD,IAAI,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC;QAAE,IAAI,GAAG,SAAS,CAAC;IACnD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import mimeTypes from './mimeTypes.json';\n\nexport type AttachmentType =\n | 'generic'\n | 'image'\n | 'video'\n | 'audio'\n | 'pdf'\n | 'archive'\n | 'text'\n | 'message'\n | 'link'\n | 'pdf'\n | 'database'\n | 'document'\n | 'spreadsheet'\n | 'presentation';\n\n/**\n * Returns approximately correct mime type for given file based upon the extension. Only few extensions are recognized.\n * @param fileName file name or url to discover the mime type from.\n * @returns mime type associated to the file.\n */\nexport const getMimeTypeFromFile = (fileName: string): string | undefined => {\n const fileExt = fileName.split('.').pop() ?? fileName;\n return (mimeTypes as Record<string, string>)[fileExt.toLowerCase()];\n};\n\nexport const getKindFromMimeType = (mimeType: string): AttachmentType => {\n let type: AttachmentType = 'generic';\n if (mimeType.startsWith('video/')) type = 'video';\n if (mimeType.startsWith('audio/')) type = 'audio';\n if (mimeType.startsWith('image/')) type = 'image';\n if (mimeType.startsWith('text/')) type = 'text';\n if (mimeType.startsWith('message/')) type = 'message';\n if (mimeType.endsWith('/pdf')) type = 'pdf';\n if (mimeType.match(/powerpoint|presentation|impress/)) type = 'presentation';\n if (mimeType.match(/excel|spreadsheet|calc/)) type = 'spreadsheet';\n if (mimeType.match(/word|writer|text/)) type = 'document';\n if (mimeType.match(/access|database/)) type = 'database';\n if (mimeType.match(/zip|rar|7z/)) type = 'archive';\n return type;\n};\n"]}
@@ -7,8 +7,8 @@ export interface FlexContainerProps {
7
7
  pad?: number | [topRightBottomLeft: number] | [topBottom: number, rightLeft: number] | [top: number, rightLeft: number, bottom: number] | [top: number, right: number, bottom: number, left: number];
8
8
  /** [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/) */
9
9
  direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
10
- /** [justify-content](https://css-tricks.com/almanac/properties/j/justify-content/) */
11
- justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
10
+ /** [justify-content](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */
11
+ justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch';
12
12
  /** [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/) */
13
13
  wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
14
14
  /** [align-items](https://css-tricks.com/almanac/properties/a/align-items/). */
@@ -46,15 +46,25 @@ export interface FlexItemProps {
46
46
  /** [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/) */
47
47
  basis?: string;
48
48
  }
49
- export interface FlexProps extends BaseProps, AsProp {
49
+ interface BaseFlexProps {
50
+ container?: FlexContainerProps | true;
51
+ item?: FlexItemProps;
52
+ }
53
+ export interface FlexProps extends BaseFlexProps, BaseProps, AsProp {
50
54
  /** Content for either a container or item. */
51
55
  children?: ReactNode;
52
- /** Display as flex. Passed as a boolean, only a display flex will be applied. Provide FlexContainer object props to enable flex functionality. */
53
- container?: FlexContainerProps | boolean;
54
- /** Use to leverage flex item functionality when rendered as a child of a flex container. Items can be containers as well. */
55
- item?: FlexItemProps;
56
56
  /** Ref for the flex element. */
57
57
  ref?: Ref<Element>;
58
+ /** Override props at extra small screen sizes and above. */
59
+ xs?: BaseFlexProps;
60
+ /** Override props at small screen sizes and above. */
61
+ sm?: BaseFlexProps;
62
+ /** Override props at medium screen sizes and above. */
63
+ md?: BaseFlexProps;
64
+ /** Override props at large screen sizes and above. */
65
+ lg?: BaseFlexProps;
66
+ /** Override props at extra large screen sizes and above. */
67
+ xl?: BaseFlexProps;
58
68
  }
59
69
  export declare const StyledFlex: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, FlexProps, never>;
60
70
  declare const Flex: FunctionComponent<FlexProps & ForwardProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG9D,MAAM,WAAW,kBAAkB;IACjC,8BAA8B;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yHAAyH;IACzH,GAAG,CAAC,EACA,MAAM,GACN,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAC5B,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,GACtC,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChD,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/D,o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AM,IAAI,EAAE,iBAAiB,CAAC,SAAS,GAAG,YAAY,CAIrD,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -23,7 +23,7 @@ const getContainerStyles = (container) => {
23
23
  return css `
24
24
  display: ${container.inline ? 'inline-flex' : 'flex'};
25
25
 
26
- ${typeof container.pad !== 'undefined' &&
26
+ ${container.pad !== undefined &&
27
27
  css `
28
28
  /* stylelint-disable function-name-case, function-whitespace-after */
29
29
  padding: ${({ theme: { base: { spacing } } }) => (Array.isArray(container.pad) ? container.pad : [container.pad])
@@ -68,17 +68,17 @@ const getContainerStyles = (container) => {
68
68
  }
69
69
  `}
70
70
 
71
- ${typeof container.gap !== 'undefined' &&
71
+ ${container.gap !== undefined &&
72
72
  css `
73
73
  gap: calc(${container.gap} * ${props => props.theme.base.spacing});
74
74
  `}
75
75
 
76
- ${typeof container.colGap !== 'undefined' &&
76
+ ${container.colGap !== undefined &&
77
77
  css `
78
78
  column-gap: calc(${container.colGap} * ${props => props.theme.base.spacing});
79
79
  `}
80
80
 
81
- ${typeof container.rowGap !== 'undefined' &&
81
+ ${container.rowGap !== undefined &&
82
82
  css `
83
83
  row-gap: calc(${container.rowGap} * ${props => props.theme.base.spacing});
84
84
  `}
@@ -114,15 +114,31 @@ const getItemStyles = (item) => {
114
114
  `}
115
115
  `;
116
116
  };
117
- export const StyledFlex = styled.div(({ container, item }) => {
117
+ const breakpointOrder = ['xs', 'sm', 'md', 'lg', 'xl'];
118
+ export const StyledFlex = styled.div(({ container, item, theme: { base: { breakpoints: themeBreakpoints } }, xs, sm, md, lg, xl }) => {
119
+ const breakpoints = {
120
+ xs,
121
+ sm,
122
+ md,
123
+ lg,
124
+ xl
125
+ };
118
126
  return css `
119
- ${getContainerStyles(container)}
120
- ${getItemStyles(item)}
121
- `;
127
+ ${getContainerStyles(container)}
128
+ ${getItemStyles(item)}
129
+
130
+ ${breakpointOrder.map(breakpoint => breakpoints[breakpoint] &&
131
+ css `
132
+ @media screen and (min-width: ${themeBreakpoints[breakpoint]}) {
133
+ ${getContainerStyles(breakpoints[breakpoint]?.container)}
134
+ ${getItemStyles(breakpoints[breakpoint]?.item)}
135
+ }
136
+ `)}
137
+ `;
122
138
  });
123
139
  StyledFlex.defaultProps = defaultThemeProp;
124
140
  const Flex = forwardRef((props, ref) => {
125
- return _jsx(StyledFlex, Object.assign({}, props, { ref: ref }), void 0);
141
+ return _jsx(StyledFlex, { ...props, ref: ref }, void 0);
126
142
  });
127
143
  export default Flex;
128
144
  //# sourceMappingURL=Flex.js.map