@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 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Slider/utils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,SAAS,CAAC,CAAC,MAAM,CACrB,KAAU;IAEV,KAAK,IAAI,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CAAC;SAC/B;QACD,MAAM,CAAC,IAAI,CAAC;YACV,KAAK;YACL,GAAG;YACH,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;KACJ;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAE,IAAY,EAAU,EAAE;;IAC/F,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAE/C,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC","sourcesContent":["import SliderProps, { TickDefinition } from './Slider.types';\n\n/**\n * Generator that returns triple of subsequent values in the given array.\n * @param array source array\n * @returns triple of previous, current and next value on every call\n */\nexport function* triple<T>(\n array: T[]\n): Generator<{ prev?: T; current: T; next?: T }, undefined, unknown> {\n for (let i = 0; i < array.length; i += 1) {\n yield { prev: array[i - 1], current: array[i], next: array[i + 1] };\n }\n return undefined;\n}\n\n/**\n * The function accepts ticks map and produces an array of tick definitions. The definition\n * consist of tick value, its label and starting and ending index.\n * Function can stretch the ticks regions to allow more text to fit in the cell.\n * To calculate the stretched regions: {min} and {max} values produce the line which is then\n * divided to equal segments. These segments have indices that correspond to CSS grid cells.\n * Then the indices are optimized in the way that every segment is stretched by the half of length\n * between current tick's index and previous tick's index or next tick's index whichever is smaller.\n * |______________|__________|________________________|\n * 1------^ ^----2----^^----3----^ ^------------4\n * @param ticksMap ticks configuration to calculate ticks definition from\n * @param min minimum allowed value in the range\n * @param max maximum allowed value in the range\n * @param stretch flag indicating the regions should be stretched\n * @returns ticks definitions array\n */\nexport const calculateTicksRegions = (\n ticksMap: NonNullable<SliderProps['ticks']>,\n min: number,\n max: number,\n stretch: boolean\n): TickDefinition[] => {\n // calculate initial positions for every tick, the tick segment has the width = 1\n const defs = Object.entries(ticksMap)\n .filter(([tickValue]) => Number(tickValue) >= min && Number(tickValue) <= max)\n .sort(([tickValue1], [tickValue2]) => Number(tickValue1) - Number(tickValue2))\n .map(([tickValue, tickLabel]) => {\n const cell = Number(tickValue) - min + 1; // shift by 'min' value and increment to always start from 1\n const cellStart = cell;\n const cellEnd = cellStart + 1;\n return {\n start: cellStart,\n end: cellEnd,\n value: Number(tickValue),\n label: tickLabel\n };\n });\n\n if (!stretch) return defs;\n\n const maxCell = max - min + 2;\n\n const result = [];\n // extend the tick segments one by one\n // eslint-disable-next-line no-restricted-syntax\n for (const { prev, current, next } of triple(defs)) {\n let start = current.start;\n let end = current.end;\n if (start === 1) {\n // if the tick is marginal (starting) - expand to the 'right'\n end = next ? Math.floor((next.start - end) / 2) + end : maxCell;\n } else if (end === maxCell) {\n // if the tick is marginal (ending) - expand to the 'left'\n start = prev ? Math.floor((start - prev.end) / 2) + prev.end : 1;\n } else {\n // calculate length between current and prev / next tick and choose the smaller value\n const length = Math.min(start - (prev?.end ?? 1), (next?.start ?? maxCell) - end);\n // expand the segment to the left\n start -= Math.floor(length / 2);\n // expand to the right\n end += Math.floor(length / 2);\n }\n result.push({\n start,\n end,\n value: current.value,\n label: current.label\n });\n }\n\n return result;\n};\n\n/**\n * Function for given input returns nearest discrete value from a series {min, max}\n * @param input the value to look for nearest value\n * @param step step value determining discrete series\n * @param min minimal value in the series\n * @param max maximum value in the series\n * @returns nearest value as a number\n */\nexport const getNearestValue = (input: number, min: number, max: number, step: number): number => {\n const output = Math.round(input / step) * step;\n\n const decimals = step.toString().split('.')[1]?.length;\n return Number(output.toFixed(decimals || 0));\n};\n"]}
1
+ {"version":3,"file":"utils.js","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from '../../utils';\n\nimport SliderProps, { TickDefinition } from './Slider.types';\n\n/**\n * The function accepts ticks map and produces an array of tick definitions. The definition\n * consist of tick value, its label and starting and ending index.\n * Function can stretch the ticks regions to allow more text to fit in the cell.\n * To calculate the stretched regions: {min} and {max} values produce the line which is then\n * divided to equal segments. These segments have indices that correspond to CSS grid cells.\n * Then the indices are optimized in the way that every segment is stretched by the half of length\n * between current tick's index and previous tick's index or next tick's index whichever is smaller.\n * |______________|__________|________________________|\n * 1------^ ^----2----^^----3----^ ^------------4\n * @param ticksMap ticks configuration to calculate ticks definition from\n * @param min minimum allowed value in the range\n * @param max maximum allowed value in the range\n * @param step step in the range\n * @param stretch flag indicating the regions should be stretched\n * @returns ticks definitions array\n */\nexport const calculateTicksRegions = (\n ticksMap: NonNullable<SliderProps['ticks']>,\n min: number,\n max: number,\n step: number,\n stretch: boolean\n): TickDefinition[] => {\n // calculate initial positions for every tick, the tick segment has the width = 1\n const defs = Object.entries(ticksMap)\n .filter(([tickValue]) => Number(tickValue) >= min && Number(tickValue) <= max)\n .sort(([tickValue1], [tickValue2]) => Number(tickValue1) - Number(tickValue2))\n .map(([tickValue, tickLabel]) => {\n const cell = (Number(tickValue) - min) / step + 1; // shift by 'min' value, divide by a step and increment, as index starts from 1\n const cellStart = cell;\n const cellEnd = cellStart + 1;\n return {\n start: cellStart,\n end: cellEnd,\n value: Number(tickValue),\n label: tickLabel\n };\n });\n\n if (!stretch) return defs;\n\n const maxCell = (max - min) / step + 2;\n\n const result = [];\n // extend the tick segments one by one\n // eslint-disable-next-line no-restricted-syntax\n for (const { prev, current, next } of triple(defs)) {\n let start = current.start;\n let end = current.end;\n if (start === 1) {\n // if the tick is marginal (starting) - expand to the 'right'\n end = next ? Math.floor((next.start - end) / 2) + end : maxCell;\n } else if (end === maxCell) {\n // if the tick is marginal (ending) - expand to the 'left'\n start = prev ? Math.floor((start - prev.end) / 2) + prev.end : 1;\n } else {\n // calculate length between current and prev / next tick and choose the smaller value\n const length = Math.min(start - (prev?.end ?? 1), (next?.start ?? maxCell) - end);\n // expand the segment to the left\n start -= Math.floor(length / 2);\n // expand to the right\n end += Math.floor(length / 2);\n }\n result.push({\n start,\n end,\n value: current.value,\n label: current.label\n });\n }\n\n return result;\n};\n\n/**\n * Function for given input returns nearest discrete value from a series {min, max}\n * @param input the value to look for nearest value\n * @param step step value determining discrete series\n * @param min minimal value in the series\n * @param max maximum value in the series\n * @returns nearest value as a number\n */\nexport const getNearestValue = (input: number, min: number, max: number, step: number): number => {\n const output = Math.round(input / step) * step;\n\n const decimals = step.toString().split('.')[1]?.length;\n return Number(output.toFixed(decimals || 0));\n};\n\n/**\n * Function calculates minimum length of the field where any value from the set of possible values will fit in.\n * @param min minimum value\n * @param max maximum value\n * @param step step in range\n * @returns minimum number of characters the field needs\n */\nexport const calculateValueLength = (min: number, max: number, step: number): number => {\n const [minIntegerPart, minDecimalPart = ''] = min.toString().split('.');\n const [maxIntegerPart, maxDecimalPart = ''] = max.toString().split('.');\n const stepDecimalPart = step.toString().split('.')[1] ?? '';\n return (\n Math.max(minIntegerPart.length, maxIntegerPart.length) +\n Math.max(maxDecimalPart.length, minDecimalPart.length, stepDecimalPart.length) +\n (maxDecimalPart || minDecimalPart || stepDecimalPart\n ? 1 // if there's decimal part, reserve a space for the separator\n : 0)\n );\n};\n"]}
@@ -1,9 +1,9 @@
1
- import { FunctionComponent, ReactNode, Ref } from 'react';
1
+ import { FunctionComponent, ReactNode, Ref, ElementType } from 'react';
2
2
  import { GridContainerProps } from '../Grid';
3
- import { ForwardProps } from '../../types';
4
- export interface SummaryItemProps {
3
+ import { ForwardProps, NoChildrenProp } from '../../types';
4
+ export interface SummaryItemProps extends NoChildrenProp {
5
5
  /** Region for the primary information. */
6
- primary: ReactNode;
6
+ primary: NonNullable<ReactNode>;
7
7
  /** Region for displaying supporting metadata. */
8
8
  secondary?: ReactNode;
9
9
  /** Region for an Avatar, Icon, or other supporting visual. */
@@ -17,7 +17,7 @@ export interface SummaryItemProps {
17
17
  */
18
18
  overflowStrategy?: 'wrap' | 'ellipsis';
19
19
  /** HTML tag to render the SummaryItem's element with. */
20
- as?: string;
20
+ as?: ElementType;
21
21
  /** Ref for the SummaryItem. */
22
22
  ref?: Ref<HTMLElement>;
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryItem.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryItem/SummaryItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAA+B,MAAM,OAAO,CAAC;AAGvF,OAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,WAAW,gBAAgB;IAC/B,0CAA0C;IAC1C,OAAO,EAAE,SAAS,CAAC;IACnB,iDAAiD;IACjD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,oDAAoD;IACpD,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACvC,yDAAyD;IACzD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,+BAA+B;IAC/B,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,yGAOxB,CAAC;AAIF,eAAO,MAAM,aAAa;;uBAEL,gBAAgB,CAAC,kBAAkB,CAAC;SAiBvD,CAAC;AAIH,eAAO,MAAM,eAAe;uBACP,gBAAgB,CAAC,kBAAkB,CAAC;SAYvD,CAAC;AAEH,eAAO,MAAM,wBAAwB,yGAEpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,yGAAe,CAAC;AAgB9C,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAA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imary = styled(Grid)(({ theme, isString, overflowStrategy }
17
17
  return css `
18
18
  ${overflowStrategy === 'ellipsis'
19
19
  ? css `
20
+ white-space: nowrap;
20
21
  overflow: hidden;
21
22
  text-overflow: ellipsis;
22
23
  `
@@ -54,15 +55,12 @@ const getAreas = ({ secondary, visual, actions }) => {
54
55
  return `"${visual ? 'visual ' : ''}primary${actions ? ' actions' : ''}"${secondary ? `\n"${visual ? 'visual ' : ''}secondary${actions ? ' actions' : ''}"` : ''}`;
55
56
  };
56
57
  const SummaryItem = forwardRef(({ visual, primary, secondary, actions, container, overflowStrategy = 'wrap', as, ...restProps }, ref) => {
57
- return (_jsxs(Grid, Object.assign({}, restProps, { ref: ref, container: {
58
+ return (_jsxs(Grid, { ...restProps, ref: ref, container: {
58
59
  cols: getColumns({ visual, actions }),
59
60
  colGap: 2,
60
61
  areas: getAreas({ secondary, visual, actions }),
61
62
  ...container
62
- }, as: StyledSummaryItem, forwardedAs: as }, { children: [visual && (_jsx(Grid, Object.assign({ as: StyledVisual, item: { area: 'visual', alignSelf: 'center' } }, { children: visual }), void 0)),
63
- _jsx(StyledPrimary, Object.assign({ item: { area: 'primary', alignSelf: secondary ? 'end' : 'center' }, isString: typeof primary === 'string', overflowStrategy: overflowStrategy }, { children: primary }), void 0),
64
- secondary && (_jsx(StyledSecondary, Object.assign({ item: { area: 'secondary', alignSelf: 'start' }, overflowStrategy: overflowStrategy }, { children: secondary }), void 0)),
65
- actions && (_jsx(Grid, Object.assign({ as: StyledSummaryItemActions, item: { area: 'actions', alignSelf: 'center' } }, { children: actions }), void 0))] }), void 0));
63
+ }, as: StyledSummaryItem, forwardedAs: as, children: [visual && (_jsx(Grid, { as: StyledVisual, item: { area: 'visual', alignSelf: 'center' }, children: visual }, void 0)), _jsx(StyledPrimary, { item: { area: 'primary', alignSelf: secondary ? 'end' : 'center' }, isString: typeof primary === 'string', overflowStrategy: overflowStrategy, children: primary }, void 0), secondary && (_jsx(StyledSecondary, { item: { area: 'secondary', alignSelf: 'start' }, overflowStrategy: overflowStrategy, children: secondary }, void 0)), actions && (_jsx(Grid, { as: StyledSummaryItemActions, item: { area: 'actions', alignSelf: 'center' }, children: actions }, void 0))] }, void 0));
66
64
  });
67
65
  export default SummaryItem;
68
66
  //# sourceMappingURL=SummaryItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryItem.js","sourceRoot":"","sources":["../../../src/components/SummaryItem/SummaryItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqC,UAAU,EAAmB,MAAM,OAAO,CAAC;AACvF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,IAA4B,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAwBjD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;MAChC,kBAAkB;;;;;;CAMvB,CAAC;AAEF,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAGtC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAAE;IAC3C,OAAO,GAAG,CAAA;MACN,gBAAgB,KAAK,UAAU;QAC/B,CAAC,CAAC,GAAG,CAAA;;;SAGF;QACH,CAAC,CAAC,GAAG,CAAA;;SAEF;;MAEH,QAAQ;QACV,GAAG,CAAA;qBACc,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;KACtD;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,CAExC,CAAC,EAAE,gBAAgB,EAAE,EAAE,EAAE;IAC1B,O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;YACT,IAAI,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;YACrC,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;YAC/C,GAAG,SAAS;SACb,EACD,EAAE,EAAE,iBAAiB,EACrB,WAAW,EAAE,EAAE,iBAEd,MAAM,IAAI,CACT,KAAC,IAAI,kBAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAClE,MAAM,YACF,CACR;YACD,KAAC,aAAa,kBACZ,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,EAClE,QAAQ,EAAE,OAAO,OAAO,KAAK,QAAQ,EACrC,gBAAgB,EAAE,gBAAgB,gBAEjC,OAAO,YACM;YACf,SAAS,IAAI,CACZ,KAAC,eAAe,kBACd,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,EAC/C,gBAAgB,EAAE,gBAAgB,gBAEjC,SAAS,YACM,CACnB;YACA,OAAO,IAAI,CACV,KAAC,IAAI,kBAAC,EAAE,EAAE,wBAAwB,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAC/E,OAAO,YACH,CACR,aACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { FunctionComponent, ReactNode, Ref, forwardRef, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Grid, { GridContainerProps } from '../Grid';\nimport { defaultThemeProp } from '../../theme';\nimport { ForwardProps } from '../../types';\nimport { StyledProgressRing } from '../Progress';\n\nexport interface SummaryItemProps {\n /** Region for the primary information. */\n primary: ReactNode;\n /** Region for displaying supporting metadata. */\n secondary?: ReactNode;\n /** Region for an Avatar, Icon, or other supporting visual. */\n visual?: ReactNode;\n /** Region for adding Actions, Buttons, or Links. */\n actions?: ReactNode;\n /* Override the default Grid container props on SummaryItem. */\n container?: GridContainerProps;\n /**\n * Determines how the text within primary and secondary fields should handle overflow.\n * @default \"wrap\"\n */\n overflowStrategy?: 'wrap' | 'ellipsis';\n /** HTML tag to render the SummaryItem's element with. */\n as?: string;\n /** Ref for the SummaryItem. */\n ref?: Ref<HTMLElement>;\n}\n\nexport const StyledVisual = styled.div`\n > ${StyledProgressRing}, img {\n display: block;\n object-fit: cover;\n width: 2rem;\n height: 2rem;\n }\n`;\n\nStyledVisual.defaultProps = defaultThemeProp;\n\nexport const StyledPrimary = styled(Grid)<{\n isString?: boolean;\n overflowStrategy?: SummaryItemProps['overflowStrategy'];\n}>(({ theme, isString, overflowStrategy }) => {\n return css`\n ${overflowStrategy === 'ellipsis'\n ? css`\n overflow: hidden;\n text-overflow: ellipsis;\n `\n : css`\n word-break: break-word;\n `}\n\n ${isString &&\n css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `}\n `;\n});\n\nStyledPrimary.defaultProps = defaultThemeProp;\n\nexport const StyledSecondary = styled(Grid)<{\n overflowStrategy?: SummaryItemProps['overflowStrategy'];\n}>(({ overflowStrategy }) => {\n return css`\n ${overflowStrategy === 'ellipsis'\n ? css`\n overflow: hidden;\n text-overflow: ellipsis;\n `\n : css`\n word-break: break-word;\n `}\n `;\n});\n\nexport const StyledSummaryItemActions = styled.div`\n white-space: nowrap;\n`;\n\nexport const StyledSummaryItem = styled.div``;\n\nconst getColumns = ({ visual, actions }: Pick<SummaryItemProps, 'visual' | 'actions'>) => {\n return `${visual ? 'auto ' : ''}minmax(0, 1fr)${actions ? ' auto' : ''}`;\n};\n\nconst getAreas = ({\n secondary,\n visual,\n actions\n}: Pick<SummaryItemProps, 'secondary' | 'visual' | 'actions'>) => {\n return `\"${visual ? 'visual ' : ''}primary${actions ? ' actions' : ''}\"${\n secondary ? `\\n\"${visual ? 'visual ' : ''}secondary${actions ? ' actions' : ''}\"` : ''\n }`;\n};\n\nconst SummaryItem: FunctionComponent<SummaryItemProps & ForwardProps> = forwardRef(\n (\n {\n visual,\n primary,\n secondary,\n actions,\n container,\n overflowStrategy = 'wrap',\n as,\n ...restProps\n }: PropsWithoutRef<SummaryItemProps>,\n ref: SummaryItemProps['ref']\n ) => {\n return (\n <Grid\n {...restProps}\n ref={ref}\n container={{\n cols: getColumns({ visual, actions }),\n colGap: 2,\n areas: getAreas({ secondary, visual, actions }),\n ...container\n }}\n as={StyledSummaryItem}\n forwardedAs={as}\n >\n {visual && (\n <Grid as={StyledVisual} item={{ area: 'visual', alignSelf: 'center' }}>\n {visual}\n </Grid>\n )}\n <StyledPrimary\n item={{ area: 'primary', alignSelf: secondary ? 'end' : 'center' }}\n isString={typeof primary === 'string'}\n overflowStrategy={overflowStrategy}\n >\n {primary}\n </StyledPrimary>\n {secondary && (\n <StyledSecondary\n item={{ area: 'secondary', alignSelf: 'start' }}\n overflowStrategy={overflowStrategy}\n >\n {secondary}\n </StyledSecondary>\n )}\n {actions && (\n <Grid as={StyledSummaryItemActions} item={{ area: 'actions', alignSelf: 'center' }}>\n {actions}\n </Grid>\n )}\n </Grid>\n );\n }\n);\n\nexport default SummaryItem;\n"]}
1
+ {"version":3,"file":"SummaryItem.js","sourceRoot":"","sources":["../../../src/components/SummaryItem/SummaryItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqC,UAAU,EAAgC,MAAM,OAAO,CAAC;AACpG,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,IAA4B,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAwBjD,MAAM,CAAC,MAAM,YAAY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QAAQ,EACrC,gBAAgB,EAAE,gBAAgB,YAEjC,OAAO,WACM,EACf,SAAS,IAAI,CACZ,KAAC,eAAe,IACd,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,EAC/C,gBAAgB,EAAE,gBAAgB,YAEjC,SAAS,WACM,CACnB,EACA,OAAO,IAAI,CACV,KAAC,IAAI,IAAC,EAAE,EAAE,wBAAwB,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAC/E,OAAO,WACH,CACR,YACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { FunctionComponent, ReactNode, Ref, forwardRef, PropsWithoutRef, ElementType } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Grid, { GridContainerProps } from '../Grid';\nimport { defaultThemeProp } from '../../theme';\nimport { ForwardProps, NoChildrenProp } from '../../types';\nimport { StyledProgressRing } from '../Progress';\n\nexport interface SummaryItemProps extends NoChildrenProp {\n /** Region for the primary information. */\n primary: NonNullable<ReactNode>;\n /** Region for displaying supporting metadata. */\n secondary?: ReactNode;\n /** Region for an Avatar, Icon, or other supporting visual. */\n visual?: ReactNode;\n /** Region for adding Actions, Buttons, or Links. */\n actions?: ReactNode;\n /* Override the default Grid container props on SummaryItem. */\n container?: GridContainerProps;\n /**\n * Determines how the text within primary and secondary fields should handle overflow.\n * @default \"wrap\"\n */\n overflowStrategy?: 'wrap' | 'ellipsis';\n /** HTML tag to render the SummaryItem's element with. */\n as?: ElementType;\n /** Ref for the SummaryItem. */\n ref?: Ref<HTMLElement>;\n}\n\nexport const StyledVisual = styled.div`\n > ${StyledProgressRing}, img {\n display: block;\n object-fit: cover;\n width: 2rem;\n height: 2rem;\n }\n`;\n\nStyledVisual.defaultProps = defaultThemeProp;\n\nexport const StyledPrimary = styled(Grid)<{\n isString?: boolean;\n overflowStrategy?: SummaryItemProps['overflowStrategy'];\n}>(({ theme, isString, overflowStrategy }) => {\n return css`\n ${overflowStrategy === 'ellipsis'\n ? css`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `\n : css`\n word-break: break-word;\n `}\n\n ${isString &&\n css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `}\n `;\n});\n\nStyledPrimary.defaultProps = defaultThemeProp;\n\nexport const StyledSecondary = styled(Grid)<{\n overflowStrategy?: SummaryItemProps['overflowStrategy'];\n}>(({ overflowStrategy }) => {\n return css`\n ${overflowStrategy === 'ellipsis'\n ? css`\n overflow: hidden;\n text-overflow: ellipsis;\n `\n : css`\n word-break: break-word;\n `}\n `;\n});\n\nexport const StyledSummaryItemActions = styled.div`\n white-space: nowrap;\n`;\n\nexport const StyledSummaryItem = styled.div``;\n\nconst getColumns = ({ visual, actions }: Pick<SummaryItemProps, 'visual' | 'actions'>) => {\n return `${visual ? 'auto ' : ''}minmax(0, 1fr)${actions ? ' auto' : ''}`;\n};\n\nconst getAreas = ({\n secondary,\n visual,\n actions\n}: Pick<SummaryItemProps, 'secondary' | 'visual' | 'actions'>) => {\n return `\"${visual ? 'visual ' : ''}primary${actions ? ' actions' : ''}\"${\n secondary ? `\\n\"${visual ? 'visual ' : ''}secondary${actions ? ' actions' : ''}\"` : ''\n }`;\n};\n\nconst SummaryItem: FunctionComponent<SummaryItemProps & ForwardProps> = forwardRef(\n (\n {\n visual,\n primary,\n secondary,\n actions,\n container,\n overflowStrategy = 'wrap',\n as,\n ...restProps\n }: PropsWithoutRef<SummaryItemProps>,\n ref: SummaryItemProps['ref']\n ) => {\n return (\n <Grid\n {...restProps}\n ref={ref}\n container={{\n cols: getColumns({ visual, actions }),\n colGap: 2,\n areas: getAreas({ secondary, visual, actions }),\n ...container\n }}\n as={StyledSummaryItem}\n forwardedAs={as}\n >\n {visual && (\n <Grid as={StyledVisual} item={{ area: 'visual', alignSelf: 'center' }}>\n {visual}\n </Grid>\n )}\n <StyledPrimary\n item={{ area: 'primary', alignSelf: secondary ? 'end' : 'center' }}\n isString={typeof primary === 'string'}\n overflowStrategy={overflowStrategy}\n >\n {primary}\n </StyledPrimary>\n {secondary && (\n <StyledSecondary\n item={{ area: 'secondary', alignSelf: 'start' }}\n overflowStrategy={overflowStrategy}\n >\n {secondary}\n </StyledSecondary>\n )}\n {actions && (\n <Grid as={StyledSummaryItemActions} item={{ area: 'actions', alignSelf: 'center' }}>\n {actions}\n </Grid>\n )}\n </Grid>\n );\n }\n);\n\nexport default SummaryItem;\n"]}
@@ -1,7 +1,8 @@
1
1
  import { Ref, FC } from 'react';
2
- import { NoItemsProps } from '../NoItems';
2
+ import { EmptyStateProps } from '../EmptyState';
3
3
  import { ForwardProps, NoChildrenProp, OmitStrict, Action } from '../../types';
4
4
  import SummaryItem, { SummaryItemProps } from '../SummaryItem';
5
+ import type { ErrorStateProps } from '../ErrorState';
5
6
  export interface SummaryListProps extends NoChildrenProp {
6
7
  /** Name of the utility to be used as its heading along with associated actions and aria attributes. */
7
8
  name?: string;
@@ -18,7 +19,12 @@ export interface SummaryListProps extends NoChildrenProp {
18
19
  /** User click initiated callback for when to show view all modal. List lengths less than the count prop will display a "View all" button with this function is bound to. */
19
20
  onViewAll?: (callback: Function) => void;
20
21
  /** A simple message to display when there are no items. */
21
- noItemsText?: NoItemsProps['message'];
22
+ noItemsText?: EmptyStateProps['message'];
23
+ /**
24
+ * Indicate an error occurred while acquiring data for the list.
25
+ * The default error state may be overridden with custom props.
26
+ */
27
+ error?: boolean | ErrorStateProps;
22
28
  /** Ref for the SummaryList's root element. */
23
29
  ref?: Ref<HTMLElement>;
24
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryList.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryList/SummaryList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,GAAG,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAStE,OAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACnD,OAA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AapC,CAAC;AAIF,eAAO,MAAM,qBAAqB,EAAE,OAAO,WAS1C,CAAC;AAIF,eAAO,MAAM,gBAAgB,cAAe,KAAK,gBAAgB,EAAE,OAAO,CAAC,gBAe1E,CAAC;AAEF,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,YAAY,CAiEpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -7,13 +7,14 @@ import Text from '../Text';
7
7
  import Count from '../Badges/Count';
8
8
  import Icon from '../Icon';
9
9
  import Card, { CardHeader, CardContent, CardFooter } from '../Card';
10
- import NoItems from '../NoItems';
10
+ import EmptyState from '../EmptyState';
11
11
  import { omitProps } from '../../styles';
12
12
  import { useI18n } from '../../hooks';
13
13
  import { defaultThemeProp } from '../../theme';
14
14
  import SummaryItem from '../SummaryItem';
15
15
  import Progress from '../Progress';
16
16
  import Button from '../Button';
17
+ import ErrorState from '../ErrorState';
17
18
  export const StyledSummaryListContent = styled(CardContent).withConfig(omitProps('loading'))(({ theme, loading }) => css `
18
19
  ${loading &&
19
20
  css `
@@ -35,23 +36,21 @@ export const StyledSummaryListItem = styled(SummaryItem)(({ theme }) => css `
35
36
  StyledSummaryListItem.defaultProps = defaultThemeProp;
36
37
  export const SummaryListItems = ({ items }) => {
37
38
  return (_jsx("ul", { children: items.map(({ id, actions: itemActions, ...restItemProps }) => {
38
- return (_jsx(StyledSummaryListItem, Object.assign({}, restItemProps, { forwardedAs: 'li', actions: itemActions && _jsx(Actions, { items: itemActions }, void 0) }), id));
39
+ return (_jsx(StyledSummaryListItem, { ...restItemProps, forwardedAs: 'li', actions: itemActions && _jsx(Actions, { items: itemActions }, void 0) }, id));
39
40
  }) }, void 0));
40
41
  };
41
- const SummaryList = forwardRef(({ icon, name, count, actions, items, onViewAll, loading, noItemsText, ...restProps }, ref) => {
42
+ const SummaryList = forwardRef(({ icon, name, count, actions, items, onViewAll, loading, noItemsText, error, ...restProps }, ref) => {
42
43
  const t = useI18n();
43
44
  const content = useMemo(() => {
44
45
  if (loading) {
45
46
  return (_jsx(Progress, { placement: 'local', message: typeof loading === 'string' ? loading : undefined }, void 0));
46
47
  }
47
- return items.length > 0 ? (_jsx(SummaryListItems, { items: items }, void 0)) : (_jsx(NoItems, { message: noItemsText }, void 0));
48
- }, [loading, items, noItemsText]);
49
- return (_jsxs(Card, Object.assign({ ref: ref }, restProps, { children: [(icon || name || typeof count === 'number' || actions) && (_jsxs(CardHeader, { children: [_jsxs(Flex, Object.assign({ container: { alignItems: 'center', gap: 1 } }, { children: [icon && _jsx(Icon, { name: icon }, void 0),
50
- name && _jsx(Text, Object.assign({ variant: 'h2' }, { children: name }), void 0),
51
- typeof count === 'number' && _jsx(Count, { children: count }, void 0)] }), void 0),
52
- actions && _jsx(Actions, { items: actions }, void 0)] }, void 0)),
53
- _jsx(StyledSummaryListContent, Object.assign({ loading: loading }, { children: content }), void 0),
54
- typeof count === 'number' && count > items.length && onViewAll && (_jsx(CardFooter, Object.assign({ justify: 'center' }, { children: _jsx(Button, Object.assign({ variant: 'link', "aria-label": name ? t('view_all_noun', name) : t('view_all'), onClick: onViewAll }, { children: t('view_all') }), void 0) }), void 0))] }), void 0));
48
+ if (error) {
49
+ return _jsx(ErrorState, { ...(error === true ? {} : error) }, void 0);
50
+ }
51
+ return items.length > 0 ? (_jsx(SummaryListItems, { items: items }, void 0)) : (_jsx(EmptyState, { message: noItemsText }, void 0));
52
+ }, [loading, items, noItemsText, error]);
53
+ return (_jsxs(Card, { ref: ref, ...restProps, children: [(icon || name || typeof count === 'number' || actions) && (_jsxs(CardHeader, { children: [_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [icon && _jsx(Icon, { name: icon }, void 0), name && _jsx(Text, { variant: 'h2', children: name }, void 0), typeof count === 'number' && _jsx(Count, { children: count }, void 0)] }, void 0), actions && _jsx(Actions, { items: actions }, void 0)] }, void 0)), _jsx(StyledSummaryListContent, { loading: loading, children: content }, void 0), !error && typeof count === 'number' && count > items.length && onViewAll && (_jsx(CardFooter, { justify: 'center', children: _jsx(Button, { variant: 'link', "aria-label": name ? t('view_all_noun', [name.toLowerCase()]) : t('view_all'), onClick: onViewAll, children: t('view_all') }, void 0) }, void 0))] }, void 0));
55
54
  });
56
55
  export default SummaryList;
57
56
  //# sourceMappingURL=SummaryList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryList.js","sourceRoot":"","sources":["../../../src/components/SummaryList/SummaryList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA4B,OAAO,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,OAAyB,MAAM,YAAY,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,WAAiC,MAAM,gBAAgB,CAAC;AAC/D,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,MAAM,MAAM,WAAW,CAAC;AA8B/B,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,UAAU,CACpE,SAAS,CAAC,SAAS,CAAC,CACrB,CACC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;MACvB,OAAO;IACT,GAAG,CAAA;;KAEF;;;uCAGkC,KAAK,CAAC,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SAAS,gBAEjB,CAAC,CAAC,UAAU,CAAC,YACP,YACE,CACd,aACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, Ref, FC, useMemo } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Actions from '../Actions';\nimport Flex from '../Flex';\nimport Text from '../Text';\nimport Count from '../Badges/Count';\nimport Icon from '../Icon';\nimport Card, { CardHeader, CardContent, CardFooter } from '../Card';\nimport NoItems, { NoItemsProps } from '../NoItems';\nimport { ForwardProps, NoChildrenProp, OmitStrict, Action } from '../../types';\nimport { omitProps } from '../../styles';\nimport { useI18n } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport SummaryItem, { SummaryItemProps } from '../SummaryItem';\nimport Progress from '../Progress';\nimport Button from '../Button';\n\nexport interface SummaryListProps extends NoChildrenProp {\n /** Name of the utility to be used as its heading along with associated actions and aria attributes. */\n name?: string;\n /** Identifier for the icon within Pega icons. */\n icon?: string;\n /** Integer representing the total count of items for a list utility dataset. */\n count?: number;\n /** Top level actions for the utility. If more than one action is passed a consolidated ActionMenu will be generated. */\n actions?: Action[];\n /** If the utility is in a state of fetching data. */\n loading?: boolean | string;\n /** An array of SummaryListItem objects to render. Pass an appropriately limited length array with a desired sort order based on design system defaults or config. */\n items: SummaryListItem[];\n /** User click initiated callback for when to show view all modal. List lengths less than the count prop will display a \"View all\" button with this function is bound to. */\n onViewAll?: (callback: Function) => void;\n /** A simple message to display when there are no items. */\n noItemsText?: NoItemsProps['message'];\n /** Ref for the SummaryList's root element. */\n ref?: Ref<HTMLElement>;\n}\n\nexport interface SummaryListItem extends OmitStrict<SummaryItemProps, 'actions'>, ForwardProps {\n /** A unique id to represent the item. */\n id: string;\n /** A set of Actions to render alongside the item. If more than one action is passed a consolidated ActionMenu will be generated. */\n actions?: Action[];\n}\n\nexport const StyledSummaryListContent = styled(CardContent).withConfig<{ loading?: boolean }>(\n omitProps('loading')\n)(\n ({ theme, loading }) => css`\n ${loading &&\n css`\n min-height: 4rem;\n `}\n\n &:not(:last-child) > ul > li:last-child {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n `\n);\n\nStyledSummaryListContent.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryListItem: typeof SummaryItem = styled(SummaryItem)(\n ({ theme }) =>\n css`\n padding: ${theme.base.spacing} 0;\n\n &:not(:last-child) {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n `\n);\n\nStyledSummaryListItem.defaultProps = defaultThemeProp;\n\nexport const SummaryListItems = ({ items }: Pick<SummaryListProps, 'items'>) => {\n return (\n <ul>\n {items.map(({ id, actions: itemActions, ...restItemProps }) => {\n return (\n <StyledSummaryListItem\n key={id}\n {...restItemProps}\n forwardedAs='li'\n actions={itemActions && <Actions items={itemActions} />}\n />\n );\n })}\n </ul>\n );\n};\n\nconst SummaryList: FC<SummaryListProps & ForwardProps> = forwardRef(\n (\n {\n icon,\n name,\n count,\n actions,\n items,\n onViewAll,\n loading,\n noItemsText,\n ...restProps\n }: PropsWithoutRef<SummaryListProps>,\n ref: SummaryListProps['ref']\n ) => {\n const t = useI18n();\n\n const content = useMemo(() => {\n if (loading) {\n return (\n <Progress placement='local' message={typeof loading === 'string' ? loading : undefined} />\n );\n }\n\n return items.length > 0 ? (\n <SummaryListItems items={items} />\n ) : (\n <NoItems message={noItemsText} />\n );\n }, [loading, items, noItemsText]);\n\n return (\n <Card ref={ref} {...restProps}>\n {(icon || name || typeof count === 'number' || actions) && (\n <CardHeader>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n {icon && <Icon name={icon} />}\n {name && <Text variant='h2'>{name}</Text>}\n {typeof count === 'number' && <Count>{count}</Count>}\n </Flex>\n {actions && <Actions items={actions} />}\n </CardHeader>\n )}\n\n <StyledSummaryListContent loading={loading}>{content}</StyledSummaryListContent>\n\n {typeof count === 'number' && count > items.length && onViewAll && (\n <CardFooter justify='center'>\n <Button\n variant='link'\n aria-label={name ? t('view_all_noun', name) : t('view_all')}\n onClick={onViewAll}\n >\n {t('view_all')}\n </Button>\n </CardFooter>\n )}\n </Card>\n );\n }\n);\n\nexport default SummaryList;\n"]}
1
+ {"version":3,"file":"SummaryList.js","sourceRoot":"","sources":["../../../src/components/SummaryList/SummaryList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA4B,OAAO,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,UAA+B,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,WAAiC,MAAM,gBAAgB,CAAC;AAC/D,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,UAAU,MAAM,eAAe,CAAC;AAoCvC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,UAAU,CACpE,SAAS,CAAC,SAAS,CAAC,CACrB,CACC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;MACvB,OAAO;IACT,GAAG,CAAA;;KAEF;;;uCAGkC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAA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O,EAAC,MAAM,gBACF,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,EAC3E,OAAO,EAAE,SAAS,YAEjB,CAAC,CAAC,UAAU,CAAC,WACP,WACE,CACd,YACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, Ref, FC, useMemo } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Actions from '../Actions';\nimport Flex from '../Flex';\nimport Text from '../Text';\nimport Count from '../Badges/Count';\nimport Icon from '../Icon';\nimport Card, { CardHeader, CardContent, CardFooter } from '../Card';\nimport EmptyState, { EmptyStateProps } from '../EmptyState';\nimport { ForwardProps, NoChildrenProp, OmitStrict, Action } from '../../types';\nimport { omitProps } from '../../styles';\nimport { useI18n } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport SummaryItem, { SummaryItemProps } from '../SummaryItem';\nimport Progress from '../Progress';\nimport Button from '../Button';\nimport ErrorState from '../ErrorState';\nimport type { ErrorStateProps } from '../ErrorState';\n\nexport interface SummaryListProps extends NoChildrenProp {\n /** Name of the utility to be used as its heading along with associated actions and aria attributes. */\n name?: string;\n /** Identifier for the icon within Pega icons. */\n icon?: string;\n /** Integer representing the total count of items for a list utility dataset. */\n count?: number;\n /** Top level actions for the utility. If more than one action is passed a consolidated ActionMenu will be generated. */\n actions?: Action[];\n /** If the utility is in a state of fetching data. */\n loading?: boolean | string;\n /** An array of SummaryListItem objects to render. Pass an appropriately limited length array with a desired sort order based on design system defaults or config. */\n items: SummaryListItem[];\n /** User click initiated callback for when to show view all modal. List lengths less than the count prop will display a \"View all\" button with this function is bound to. */\n onViewAll?: (callback: Function) => void;\n /** A simple message to display when there are no items. */\n noItemsText?: EmptyStateProps['message'];\n /**\n * Indicate an error occurred while acquiring data for the list.\n * The default error state may be overridden with custom props.\n */\n error?: boolean | ErrorStateProps;\n /** Ref for the SummaryList's root element. */\n ref?: Ref<HTMLElement>;\n}\n\nexport interface SummaryListItem extends OmitStrict<SummaryItemProps, 'actions'>, ForwardProps {\n /** A unique id to represent the item. */\n id: string;\n /** A set of Actions to render alongside the item. If more than one action is passed a consolidated ActionMenu will be generated. */\n actions?: Action[];\n}\n\nexport const StyledSummaryListContent = styled(CardContent).withConfig<{ loading?: boolean }>(\n omitProps('loading')\n)(\n ({ theme, loading }) => css`\n ${loading &&\n css`\n min-height: 4rem;\n `}\n\n &:not(:last-child) > ul > li:last-child {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n `\n);\n\nStyledSummaryListContent.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryListItem: typeof SummaryItem = styled(SummaryItem)(\n ({ theme }) =>\n css`\n padding: ${theme.base.spacing} 0;\n\n &:not(:last-child) {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n `\n);\n\nStyledSummaryListItem.defaultProps = defaultThemeProp;\n\nexport const SummaryListItems = ({ items }: Pick<SummaryListProps, 'items'>) => {\n return (\n <ul>\n {items.map(({ id, actions: itemActions, ...restItemProps }) => {\n return (\n <StyledSummaryListItem\n key={id}\n {...restItemProps}\n forwardedAs='li'\n actions={itemActions && <Actions items={itemActions} />}\n />\n );\n })}\n </ul>\n );\n};\n\nconst SummaryList: FC<SummaryListProps & ForwardProps> = forwardRef(\n (\n {\n icon,\n name,\n count,\n actions,\n items,\n onViewAll,\n loading,\n noItemsText,\n error,\n ...restProps\n }: PropsWithoutRef<SummaryListProps>,\n ref: SummaryListProps['ref']\n ) => {\n const t = useI18n();\n\n const content = useMemo(() => {\n if (loading) {\n return (\n <Progress placement='local' message={typeof loading === 'string' ? loading : undefined} />\n );\n }\n\n if (error) {\n return <ErrorState {...(error === true ? {} : error)} />;\n }\n\n return items.length > 0 ? (\n <SummaryListItems items={items} />\n ) : (\n <EmptyState message={noItemsText} />\n );\n }, [loading, items, noItemsText, error]);\n\n return (\n <Card ref={ref} {...restProps}>\n {(icon || name || typeof count === 'number' || actions) && (\n <CardHeader>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n {icon && <Icon name={icon} />}\n {name && <Text variant='h2'>{name}</Text>}\n {typeof count === 'number' && <Count>{count}</Count>}\n </Flex>\n {actions && <Actions items={actions} />}\n </CardHeader>\n )}\n\n <StyledSummaryListContent loading={loading}>{content}</StyledSummaryListContent>\n\n {!error && typeof count === 'number' && count > items.length && onViewAll && (\n <CardFooter justify='center'>\n <Button\n variant='link'\n aria-label={name ? t('view_all_noun', [name.toLowerCase()]) : t('view_all')}\n onClick={onViewAll}\n >\n {t('view_all')}\n </Button>\n </CardFooter>\n )}\n </Card>\n );\n }\n);\n\nexport default SummaryList;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { Ref, FC } from 'react';
2
2
  import { SearchInputProps } from '../SearchInput';
3
- import { ForwardProps } from '../../types';
3
+ import type { ForwardProps } from '../../types';
4
4
  import { SummaryListProps } from './SummaryList';
5
5
  export interface ViewAllProps extends Pick<SummaryListProps, 'loading' | 'actions' | 'items'> {
6
6
  searchInputProps?: SearchInputProps;
@@ -1 +1 @@
1
- {"version":3,"file":"ViewAll.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryList/ViewAll.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,GAAG,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC3F,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAgBD,eAAO,MAAM,aAAa;aAAoC,YAAY,CAAC,SAAS,CAAC;SASpF,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,YAAY,GAAG,YAAY,CAiDnD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ViewAll.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryList/ViewAll.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,GAAG,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAM5C,OAAoB,EAAE,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AAMlF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC3F,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAoBD,eAAO,MAAM,aAAa;aAAoC,YAAY,CAAC,SAAS,CAAC;SAapF,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,YAAY,GAAG,YAAY,CAoBnD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -3,12 +3,14 @@ import { forwardRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
4
  import Actions from '../Actions';
5
5
  import Flex from '../Flex';
6
- import SearchInput from '../SearchInput';
7
- import NoItems from '../NoItems';
6
+ import EmptyState from '../EmptyState';
7
+ import SearchInput, { StyledSearchInput } from '../SearchInput';
8
8
  import { defaultThemeProp } from '../../theme';
9
- import SummaryItem from '../SummaryItem';
10
9
  import Progress from '../Progress';
10
+ import { StyledCard } from '../Card';
11
+ import { StyledCardContent } from '../Card/CardContent';
11
12
  import { omitProps } from '../../styles';
13
+ import SummaryList from './SummaryList';
12
14
  const StyledToolbar = styled.div(({ theme: { base } }) => {
13
15
  return css `
14
16
  position: sticky;
@@ -18,23 +20,25 @@ const StyledToolbar = styled.div(({ theme: { base } }) => {
18
20
  margin-bottom: ${base.spacing};
19
21
  transform: translateY(calc(-0.5 * ${base.spacing}));
20
22
  padding: ${base.spacing} 0;
23
+
24
+ ${StyledSearchInput} {
25
+ flex-grow: 1;
26
+ }
21
27
  `;
22
28
  });
23
29
  StyledToolbar.defaultProps = defaultThemeProp;
24
30
  export const StyledViewAll = styled.div.withConfig(omitProps('loading'))(({ loading }) => css `
31
+ ${StyledCardContent}:not(${StyledCard} ${StyledCard} > ${StyledCardContent}) {
32
+ padding: 0;
33
+ }
34
+
25
35
  ${loading &&
26
36
  css `
27
37
  min-height: 8rem;
28
38
  `}
29
39
  `);
30
40
  const SearchableList = forwardRef(({ loading, actions, items, searchInputProps, ...restProps }, ref) => {
31
- return (_jsxs(StyledViewAll, Object.assign({ ref: ref, loading: loading }, restProps, { children: [!loading && (searchInputProps || actions) && (_jsxs(Flex, Object.assign({ container: { alignItems: 'center', gap: 2 }, as: StyledToolbar }, { children: [searchInputProps && (_jsx(Flex, Object.assign({ item: { grow: 1 } }, { children: _jsx(SearchInput, { onSearchChange: searchInputProps.onSearchChange }, void 0) }), void 0)),
32
- actions && _jsx(Actions, { iconOnly: false, items: actions }, void 0)] }), void 0)),
33
- loading && _jsx(Progress, { placement: 'local' }, void 0),
34
- !loading &&
35
- (items.length ? (_jsx(Flex, Object.assign({ as: 'ul', container: { direction: 'column', gap: 2 } }, { children: items.map(({ primary, secondary, visual, overflowStrategy, id, actions: itemActions, ...restItemProps }) => {
36
- return (_jsx(SummaryItem, Object.assign({}, restItemProps, { visual: visual, primary: primary, secondary: secondary, overflowStrategy: overflowStrategy, actions: itemActions && _jsx(Actions, { items: itemActions }, void 0) }), id));
37
- }) }), void 0)) : (_jsx(NoItems, {}, void 0)))] }), void 0));
41
+ return (_jsxs(StyledViewAll, { ref: ref, loading: loading, ...restProps, children: [!loading && (searchInputProps || actions) && (_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 2 }, as: StyledToolbar, children: [searchInputProps && (_jsx(Flex, { container: { alignItems: 'center', gap: 1 }, item: { grow: 1 }, children: _jsx(SearchInput, { onSearchChange: searchInputProps.onSearchChange }, void 0) }, void 0)), actions && _jsx(Actions, { iconOnly: false, items: actions }, void 0)] }, void 0)), loading && _jsx(Progress, { placement: 'local' }, void 0), !loading && (items.length ? _jsx(SummaryList, { items: items }, void 0) : _jsx(EmptyState, {}, void 0))] }, void 0));
38
42
  });
39
43
  export default SearchableList;
40
44
  //# sourceMappingURL=ViewAll.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewAll.js","sourceRoot":"","sources":["../../../src/components/SummaryList/ViewAll.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,OAAO,CAAC;AAC5C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,WAAiC,MAAM,gBAAgB,CAAC;AAC/D,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AASzC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;IACvD,OAAO,GAAG,CAAA;;;;wBAIY,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;qBACrC,IAAI,CAAC,OAAO;wCACO,IAAI,CAAC,OAAO;eACrC,IAAI,CAAC,OAA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C,GAAG,CACR,CAAC,EACC,OAAO,EACP,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,EAAE,EACF,OAAO,EAAE,WAAW,EACpB,GAAG,aAAa,EACjB,EAAE,EAAE;wBACH,OAAO,CACL,KAAC,WAAW,oBAEN,aAAa,IACjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,WAAW,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,WAAW,WAAI,KANlD,EAAE,CAOP,CACH,CAAC;oBACJ,CAAC,CACF,YACI,CACR,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,aAAG,CACZ,CAAC,aACU,CACjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, Ref, FC } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Actions from '../Actions';\nimport Flex from '../Flex';\nimport SearchInput, { SearchInputProps } from '../SearchInput';\nimport NoItems from '../NoItems';\nimport { ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport SummaryItem from '../SummaryItem';\nimport Progress from '../Progress';\nimport { omitProps } from '../../styles';\n\nimport { SummaryListProps } from './SummaryList';\n\nexport interface ViewAllProps extends Pick<SummaryListProps, 'loading' | 'actions' | 'items'> {\n searchInputProps?: SearchInputProps;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledToolbar = styled.div(({ theme: { base } }) => {\n return css`\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: ${base.palette['primary-background']};\n margin-bottom: ${base.spacing};\n transform: translateY(calc(-0.5 * ${base.spacing}));\n padding: ${base.spacing} 0;\n `;\n});\n\nStyledToolbar.defaultProps = defaultThemeProp;\n\nexport const StyledViewAll = styled.div.withConfig<{ loading: ViewAllProps['loading'] }>(\n omitProps('loading')\n)(\n ({ loading }) => css`\n ${loading &&\n css`\n min-height: 8rem;\n `}\n `\n);\n\nconst SearchableList: FC<ViewAllProps & ForwardProps> = forwardRef(\n ({ loading, actions, items, searchInputProps, ...restProps }, ref: ViewAllProps['ref']) => {\n return (\n <StyledViewAll ref={ref} loading={loading} {...restProps}>\n {!loading && (searchInputProps || actions) && (\n <Flex container={{ alignItems: 'center', gap: 2 }} as={StyledToolbar}>\n {searchInputProps && (\n <Flex item={{ grow: 1 }}>\n <SearchInput onSearchChange={searchInputProps.onSearchChange} />\n </Flex>\n )}\n {actions && <Actions iconOnly={false} items={actions} />}\n </Flex>\n )}\n\n {loading && <Progress placement='local' />}\n {!loading &&\n (items.length ? (\n <Flex as='ul' container={{ direction: 'column', gap: 2 }}>\n {items.map(\n ({\n primary,\n secondary,\n visual,\n overflowStrategy,\n id,\n actions: itemActions,\n ...restItemProps\n }) => {\n return (\n <SummaryItem\n key={id}\n {...restItemProps}\n visual={visual}\n primary={primary}\n secondary={secondary}\n overflowStrategy={overflowStrategy}\n actions={itemActions && <Actions items={itemActions} />}\n />\n );\n }\n )}\n </Flex>\n ) : (\n <NoItems />\n ))}\n </StyledViewAll>\n );\n }\n);\n\nexport default SearchableList;\n"]}
1
+ {"version":3,"file":"ViewAll.js","sourceRoot":"","sources":["../../../src/components/SummaryList/ViewAll.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,OAAO,CAAC;AAC5C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,WAAW,EAAE,EAAoB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,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AAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAClE,KAAC,WAAW,IAAC,cAAc,EAAE,gBAAgB,CAAC,cAAc,WAAI,WAC3D,CACR,EACA,OAAO,IAAI,KAAC,OAAO,IAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,WAAI,YACnD,CACR,EAEA,OAAO,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,WAAG,EACzC,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,WAAI,CAAC,CAAC,CAAC,KAAC,UAAU,aAAG,CAAC,YAC9D,CACjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, Ref, FC } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Actions from '../Actions';\nimport Flex from '../Flex';\nimport EmptyState from '../EmptyState';\nimport SearchInput, { SearchInputProps, StyledSearchInput } from '../SearchInput';\nimport { defaultThemeProp } from '../../theme';\nimport Progress from '../Progress';\nimport { StyledCard } from '../Card';\nimport { StyledCardContent } from '../Card/CardContent';\nimport { omitProps } from '../../styles';\nimport type { ForwardProps } from '../../types';\n\nimport SummaryList, { SummaryListProps } from './SummaryList';\n\nexport interface ViewAllProps extends Pick<SummaryListProps, 'loading' | 'actions' | 'items'> {\n searchInputProps?: SearchInputProps;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledToolbar = styled.div(({ theme: { base } }) => {\n return css`\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: ${base.palette['primary-background']};\n margin-bottom: ${base.spacing};\n transform: translateY(calc(-0.5 * ${base.spacing}));\n padding: ${base.spacing} 0;\n\n ${StyledSearchInput} {\n flex-grow: 1;\n }\n `;\n});\n\nStyledToolbar.defaultProps = defaultThemeProp;\n\nexport const StyledViewAll = styled.div.withConfig<{ loading: ViewAllProps['loading'] }>(\n omitProps('loading')\n)(\n ({ loading }) => css`\n ${StyledCardContent}:not(${StyledCard} ${StyledCard} > ${StyledCardContent}) {\n padding: 0;\n }\n\n ${loading &&\n css`\n min-height: 8rem;\n `}\n `\n);\n\nconst SearchableList: FC<ViewAllProps & ForwardProps> = forwardRef(\n ({ loading, actions, items, searchInputProps, ...restProps }, ref: ViewAllProps['ref']) => {\n return (\n <StyledViewAll ref={ref} loading={loading} {...restProps}>\n {!loading && (searchInputProps || actions) && (\n <Flex container={{ justify: 'between', alignItems: 'center', gap: 2 }} as={StyledToolbar}>\n {searchInputProps && (\n <Flex container={{ alignItems: 'center', gap: 1 }} item={{ grow: 1 }}>\n <SearchInput onSearchChange={searchInputProps.onSearchChange} />\n </Flex>\n )}\n {actions && <Actions iconOnly={false} items={actions} />}\n </Flex>\n )}\n\n {loading && <Progress placement='local' />}\n {!loading && (items.length ? <SummaryList items={items} /> : <EmptyState />)}\n </StyledViewAll>\n );\n }\n);\n\nexport default SearchableList;\n"]}
@@ -1,7 +1,7 @@
1
1
  import { ChangeEvent, FunctionComponent, Ref } from 'react';
2
- import { BaseProps, ForwardProps } from '../../types';
2
+ import type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
3
3
  import { FormControlProps } from '../FormControl';
4
- export interface SwitchProps extends BaseProps {
4
+ export interface SwitchProps extends BaseProps, NoChildrenProp {
5
5
  /**
6
6
  * Sets DOM id for the control and associates label element via 'for' attribute.
7
7
  * If an id is not pass, a random id will be generated for any render.
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAIzF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEtD,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AC;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC;;;OAGG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACtD,iCAAiC;IACjC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,WAAW,2GAwEvB,CAAC;AAIF,eAAO,MAAM,WAAW,2GAkEvB,CAAC;AAIF,eAAO,MAAM,YAAY,yGAAe,CAAC;AAEzC,QAAA,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,GAAG,YAAY,CAyBzD,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,13 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { hideVisually } from 'polished';
4
+ import { hideVisually, readableColor } from 'polished';
5
5
  import { defaultThemeProp } from '../../theme';
6
6
  import { useDirection, useUID } from '../../hooks';
7
7
  import Flex from '../Flex';
8
8
  import { getHoverColors } from '../../styles';
9
+ import Icon, { StyledIcon, registerIcon } from '../Icon';
10
+ import * as checkIcon from '../Icon/icons/check.icon';
11
+ import { tryCatch } from '../../utils';
12
+ registerIcon(checkIcon);
9
13
  export const SwitchLabel = styled.label(({ theme: { base, components: { switch: { width, height, 'touch-width': touchWidth, 'touch-height': touchHeight, off } } } }) => {
10
- const { ltr } = useDirection();
11
14
  return css `
12
15
  position: relative;
13
16
  cursor: pointer;
@@ -20,19 +23,27 @@ export const SwitchLabel = styled.label(({ theme: { base, components: { switch:
20
23
  height: ${touchHeight};
21
24
  }
22
25
 
26
+ /** Checkmark */
27
+ & > ${StyledIcon} {
28
+ position: absolute;
29
+ inset-inline-end: calc(0.5 * ${width} + 0.25rem);
30
+ height: calc(0.5 * ${height});
31
+ width: calc(0.5 * ${height});
32
+
33
+ @media (pointer: coarse) {
34
+ inset-inline-end: calc(0.5 * ${touchWidth} + 0.25rem);
35
+ height: calc(0.5 * ${touchHeight});
36
+ width: calc(0.5 * ${touchHeight});
37
+ }
38
+ }
39
+
23
40
  /** Track */
24
41
  &::before {
25
42
  position: absolute;
26
43
  content: '';
44
+ inset-inline-end: 0;
27
45
  width: ${width};
28
46
  height: ${height};
29
- ${ltr
30
- ? css `
31
- right: 0;
32
- `
33
- : css `
34
- left: 0;
35
- `}
36
47
  background-color: ${off.color};
37
48
  transition: background-color calc(0.5 * ${base.animation.speed})
38
49
  ${base.animation.timing.ease};
@@ -48,62 +59,63 @@ export const SwitchLabel = styled.label(({ theme: { base, components: { switch:
48
59
  &::after {
49
60
  position: absolute;
50
61
  content: '';
62
+ inset-inline-end: calc(${width} - ${height} + 0.0625rem);
51
63
  height: calc(${height} - 0.125rem);
52
64
  width: calc(${height} - 0.125rem);
53
- ${ltr
54
- ? css `
55
- right: calc(${width} - ${height} + 0.0625rem);
56
- `
57
- : css `
58
- left: 0.0625rem;
59
- `}
60
65
  background-color: ${base.palette['primary-background']};
61
66
  transition: transform calc(0.5 * ${base.animation.speed}) ${base.animation.timing.ease};
62
67
  border-radius: calc(9999 * ${base['border-radius']});
63
68
 
64
69
  @media (pointer: coarse) {
70
+ inset-inline-end: calc(${touchWidth} - ${touchHeight} + 0.0625rem);
65
71
  height: calc(${touchHeight} - 0.125rem);
66
72
  width: calc(${touchHeight} - 0.125rem);
67
- ${ltr &&
68
- css `
69
- right: calc(${touchWidth} - ${touchHeight} + 0.0625rem);
70
- `}
71
73
  }
72
74
  }
73
75
  `;
74
76
  });
75
77
  SwitchLabel.defaultProps = defaultThemeProp;
76
78
  export const SwitchInput = styled.input(({ theme: { base, components: { 'form-control': { ':focus': { 'box-shadow': shadow } }, switch: { height, width, 'touch-height': touchHeight, 'touch-width': touchWidth, on, off } } } }) => {
77
- const onHoverColor = getHoverColors(on.color).background;
78
- const offHoverColor = getHoverColors(off.color).background;
79
+ const { ltr } = useDirection();
80
+ const checkmarkColor = tryCatch(() => readableColor(on.color));
81
+ const onHoverColors = getHoverColors(on.color);
82
+ const offHoverColors = getHoverColors(off.color);
79
83
  return css `
80
84
  ${hideVisually}
81
85
 
82
86
  & + ${SwitchLabel} {
83
- min-height: ${base.sizes['touch-mouse']};
87
+ min-height: ${base['hit-area']['mouse-min']};
84
88
  @media (pointer: coarse) {
85
- min-height: ${base.sizes['touch-finger']};
89
+ min-height: ${base['hit-area']['finger-min']};
86
90
  }
87
91
  }
88
92
 
93
+ & + ${SwitchLabel} > ${StyledIcon} {
94
+ color: ${checkmarkColor};
95
+ }
96
+
89
97
  &:checked + ${SwitchLabel}::before {
90
98
  background-color: ${on.color};
91
99
  }
92
100
 
93
101
  &:checked + ${SwitchLabel}::after {
94
- transform: translateX(calc(${width} - ${height}));
102
+ transform: translateX(calc((${width} - ${height}) * ${ltr ? '1' : '-1'}));
95
103
 
96
104
  @media (pointer: coarse) {
97
- transform: translateX(calc(${touchWidth} - ${touchHeight}));
105
+ transform: translateX(calc((${touchWidth} - ${touchHeight}) * ${ltr ? '1' : '-1'}));
98
106
  }
99
107
  }
100
108
 
109
+ &:hover + ${SwitchLabel} > ${StyledIcon} {
110
+ color: ${onHoverColors.foreground};
111
+ }
112
+
101
113
  &:hover:checked + ${SwitchLabel}::before {
102
- background-color: ${onHoverColor};
114
+ background-color: ${onHoverColors.background};
103
115
  }
104
116
 
105
117
  &:hover + ${SwitchLabel}::before {
106
- background-color: ${offHoverColor};
118
+ background-color: ${offHoverColors.background};
107
119
  }
108
120
 
109
121
  &:focus + ${SwitchLabel}::before {
@@ -120,8 +132,7 @@ export const StyledSwitch = styled.div ``;
120
132
  const Switch = forwardRef((props, ref) => {
121
133
  const uid = useUID();
122
134
  const { id = uid, label, disabled = false, on = false, onChange, ...restProps } = props;
123
- return (_jsxs(StyledSwitch, { children: [_jsx(SwitchInput, Object.assign({}, restProps, { id: id, type: 'checkbox', role: 'switch', checked: on, "aria-checked": on, disabled: disabled, onChange: onChange, ref: ref }), void 0),
124
- _jsx(Flex, Object.assign({ container: { alignItems: 'center' }, as: SwitchLabel, htmlFor: id }, { children: label }), void 0)] }, void 0));
135
+ return (_jsxs(StyledSwitch, { children: [_jsx(SwitchInput, { ...restProps, id: id, type: 'checkbox', role: 'switch', checked: on, "aria-checked": on, disabled: disabled, onChange: onChange, ref: ref }, void 0), _jsxs(Flex, { container: { alignItems: 'center' }, as: SwitchLabel, htmlFor: id, children: [label, on && _jsx(Icon, { name: 'check' }, void 0)] }, void 0)] }, void 0));
125
136
  });
126
137
  export default Switch;
127
138
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,UAAU,EAA2C,MAAM,OAAO,CAAC;AACzF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA0B9C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CACrC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EACJ,UAAU,EAAE,EACV,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,EACvF,EACF,EACF,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAC/B,OAAO,G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W,EAAE,OAAO,EAAE,EAAE,gBACpE,KAAK,YACD,YACM,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { ChangeEvent, forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { FormControlProps } from '../FormControl';\nimport { useDirection, useUID } from '../../hooks';\nimport Flex from '../Flex';\nimport { getHoverColors } from '../../styles';\n\nexport interface SwitchProps extends BaseProps {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /**\n * Disables the control.\n * @default false\n */\n disabled?: FormControlProps['disabled'];\n /**\n * Sets checked prop via onChange.\n * @default false\n */\n on?: boolean;\n /** Callback that is triggered when the Switch is toggled. */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Ref for the input element. */\n ref?: Ref<HTMLInputElement>;\n}\n\nexport const SwitchLabel = styled.label(\n ({\n theme: {\n base,\n components: {\n switch: { width, height, 'touch-width': touchWidth, 'touch-height': touchHeight, off }\n }\n }\n }) => {\n const { ltr } = useDirection();\n return css`\n position: relative;\n cursor: pointer;\n padding-inline-end: calc(${width} + 0.5rem);\n height: ${height};\n width: 100%;\n\n @media (pointer: coarse) {\n padding-inline-end: calc(${touchWidth} + 0.5rem);\n height: ${touchHeight};\n }\n\n /** Track */\n &::before {\n position: absolute;\n content: '';\n width: ${width};\n height: ${height};\n ${ltr\n ? css`\n right: 0;\n `\n : css`\n left: 0;\n `}\n background-color: ${off.color};\n transition: background-color calc(0.5 * ${base.animation.speed})\n ${base.animation.timing.ease};\n border-radius: calc(9999 * ${base['border-radius']});\n\n @media (pointer: coarse) {\n width: ${touchWidth};\n height: ${touchHeight};\n }\n }\n\n /** Switch */\n &::after {\n position: absolute;\n content: '';\n height: calc(${height} - 0.125rem);\n width: calc(${height} - 0.125rem);\n ${ltr\n ? css`\n right: calc(${width} - ${height} + 0.0625rem);\n `\n : css`\n left: 0.0625rem;\n `}\n background-color: ${base.palette['primary-background']};\n transition: transform calc(0.5 * ${base.animation.speed}) ${base.animation.timing.ease};\n border-radius: calc(9999 * ${base['border-radius']});\n\n @media (pointer: coarse) {\n height: calc(${touchHeight} - 0.125rem);\n width: calc(${touchHeight} - 0.125rem);\n ${ltr &&\n css`\n right: calc(${touchWidth} - ${touchHeight} + 0.0625rem);\n `}\n }\n }\n `;\n }\n);\n\nSwitchLabel.defaultProps = defaultThemeProp;\n\nexport const SwitchInput = styled.input(\n ({\n theme: {\n base,\n components: {\n 'form-control': {\n ':focus': { 'box-shadow': shadow }\n },\n switch: { height, width, 'touch-height': touchHeight, 'touch-width': touchWidth, on, off }\n }\n }\n }) => {\n const onHoverColor = getHoverColors(on.color).background;\n const offHoverColor = getHoverColors(off.color).background;\n\n return css`\n ${hideVisually}\n\n & + ${SwitchLabel} {\n min-height: ${base.sizes['touch-mouse']};\n @media (pointer: coarse) {\n min-height: ${base.sizes['touch-finger']};\n }\n }\n\n &:checked + ${SwitchLabel}::before {\n background-color: ${on.color};\n }\n\n &:checked + ${SwitchLabel}::after {\n transform: translateX(calc(${width} - ${height}));\n\n @media (pointer: coarse) {\n transform: translateX(calc(${touchWidth} - ${touchHeight}));\n }\n }\n\n &:hover:checked + ${SwitchLabel}::before {\n background-color: ${onHoverColor};\n }\n\n &:hover + ${SwitchLabel}::before {\n background-color: ${offHoverColor};\n }\n\n &:focus + ${SwitchLabel}::before {\n box-shadow: ${shadow};\n }\n\n &:disabled + ${SwitchLabel} {\n opacity: ${base['disabled-opacity']};\n }\n `;\n }\n);\n\nSwitchInput.defaultProps = defaultThemeProp;\n\nexport const StyledSwitch = styled.div``;\n\nconst Switch: FunctionComponent<SwitchProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SwitchProps>, ref: SwitchProps['ref']) => {\n const uid = useUID();\n const { id = uid, label, disabled = false, on = false, onChange, ...restProps } = props;\n\n return (\n <StyledSwitch>\n <SwitchInput\n {...restProps}\n id={id}\n type='checkbox'\n role='switch'\n checked={on}\n aria-checked={on}\n disabled={disabled}\n onChange={onChange}\n ref={ref}\n />\n <Flex container={{ alignItems: 'center' }} as={SwitchLabel} htmlFor={id}>\n {label}\n </Flex>\n </StyledSwitch>\n );\n }\n);\n\nexport default Switch;\n"]}
1
+ {"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,UAAU,EAA2C,MAAM,OAAO,CAAC;AACzF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,YAAY,CAAC,SAAS,CAAC,CAAC;AA0BxB,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CACrC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EACJ,UAAU,EAAE,EACV,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,EACvF,EACF,EACF,EAAE,EAAE;I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X,KAAC,WAAW,OACN,SAAS,EACb,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,EAAE,kBACG,EAAE,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,WACR,EACF,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,aACpE,KAAK,EACL,EAAE,IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,WAAG,YACvB,YACM,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { ChangeEvent, forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually, readableColor } from 'polished';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { FormControlProps } from '../FormControl';\nimport { useDirection, useUID } from '../../hooks';\nimport Flex from '../Flex';\nimport { getHoverColors } from '../../styles';\nimport Icon, { StyledIcon, registerIcon } from '../Icon';\nimport * as checkIcon from '../Icon/icons/check.icon';\nimport { tryCatch } from '../../utils';\n\nregisterIcon(checkIcon);\n\nexport interface SwitchProps extends BaseProps, NoChildrenProp {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /**\n * Disables the control.\n * @default false\n */\n disabled?: FormControlProps['disabled'];\n /**\n * Sets checked prop via onChange.\n * @default false\n */\n on?: boolean;\n /** Callback that is triggered when the Switch is toggled. */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Ref for the input element. */\n ref?: Ref<HTMLInputElement>;\n}\n\nexport const SwitchLabel = styled.label(\n ({\n theme: {\n base,\n components: {\n switch: { width, height, 'touch-width': touchWidth, 'touch-height': touchHeight, off }\n }\n }\n }) => {\n return css`\n position: relative;\n cursor: pointer;\n padding-inline-end: calc(${width} + 0.5rem);\n height: ${height};\n width: 100%;\n\n @media (pointer: coarse) {\n padding-inline-end: calc(${touchWidth} + 0.5rem);\n height: ${touchHeight};\n }\n\n /** Checkmark */\n & > ${StyledIcon} {\n position: absolute;\n inset-inline-end: calc(0.5 * ${width} + 0.25rem);\n height: calc(0.5 * ${height});\n width: calc(0.5 * ${height});\n\n @media (pointer: coarse) {\n inset-inline-end: calc(0.5 * ${touchWidth} + 0.25rem);\n height: calc(0.5 * ${touchHeight});\n width: calc(0.5 * ${touchHeight});\n }\n }\n\n /** Track */\n &::before {\n position: absolute;\n content: '';\n inset-inline-end: 0;\n width: ${width};\n height: ${height};\n background-color: ${off.color};\n transition: background-color calc(0.5 * ${base.animation.speed})\n ${base.animation.timing.ease};\n border-radius: calc(9999 * ${base['border-radius']});\n\n @media (pointer: coarse) {\n width: ${touchWidth};\n height: ${touchHeight};\n }\n }\n\n /** Switch */\n &::after {\n position: absolute;\n content: '';\n inset-inline-end: calc(${width} - ${height} + 0.0625rem);\n height: calc(${height} - 0.125rem);\n width: calc(${height} - 0.125rem);\n background-color: ${base.palette['primary-background']};\n transition: transform calc(0.5 * ${base.animation.speed}) ${base.animation.timing.ease};\n border-radius: calc(9999 * ${base['border-radius']});\n\n @media (pointer: coarse) {\n inset-inline-end: calc(${touchWidth} - ${touchHeight} + 0.0625rem);\n height: calc(${touchHeight} - 0.125rem);\n width: calc(${touchHeight} - 0.125rem);\n }\n }\n `;\n }\n);\n\nSwitchLabel.defaultProps = defaultThemeProp;\n\nexport const SwitchInput = styled.input(\n ({\n theme: {\n base,\n components: {\n 'form-control': {\n ':focus': { 'box-shadow': shadow }\n },\n switch: { height, width, 'touch-height': touchHeight, 'touch-width': touchWidth, on, off }\n }\n }\n }) => {\n const { ltr } = useDirection();\n\n const checkmarkColor = tryCatch(() => readableColor(on.color));\n\n const onHoverColors = getHoverColors(on.color);\n const offHoverColors = getHoverColors(off.color);\n\n return css`\n ${hideVisually}\n\n & + ${SwitchLabel} {\n min-height: ${base['hit-area']['mouse-min']};\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n }\n\n & + ${SwitchLabel} > ${StyledIcon} {\n color: ${checkmarkColor};\n }\n\n &:checked + ${SwitchLabel}::before {\n background-color: ${on.color};\n }\n\n &:checked + ${SwitchLabel}::after {\n transform: translateX(calc((${width} - ${height}) * ${ltr ? '1' : '-1'}));\n\n @media (pointer: coarse) {\n transform: translateX(calc((${touchWidth} - ${touchHeight}) * ${ltr ? '1' : '-1'}));\n }\n }\n\n &:hover + ${SwitchLabel} > ${StyledIcon} {\n color: ${onHoverColors.foreground};\n }\n\n &:hover:checked + ${SwitchLabel}::before {\n background-color: ${onHoverColors.background};\n }\n\n &:hover + ${SwitchLabel}::before {\n background-color: ${offHoverColors.background};\n }\n\n &:focus + ${SwitchLabel}::before {\n box-shadow: ${shadow};\n }\n\n &:disabled + ${SwitchLabel} {\n opacity: ${base['disabled-opacity']};\n }\n `;\n }\n);\n\nSwitchInput.defaultProps = defaultThemeProp;\n\nexport const StyledSwitch = styled.div``;\n\nconst Switch: FunctionComponent<SwitchProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SwitchProps>, ref: SwitchProps['ref']) => {\n const uid = useUID();\n const { id = uid, label, disabled = false, on = false, onChange, ...restProps } = props;\n\n return (\n <StyledSwitch>\n <SwitchInput\n {...restProps}\n id={id}\n type='checkbox'\n role='switch'\n checked={on}\n aria-checked={on}\n disabled={disabled}\n onChange={onChange}\n ref={ref}\n />\n <Flex container={{ alignItems: 'center' }} as={SwitchLabel} htmlFor={id}>\n {label}\n {on && <Icon name='check' />}\n </Flex>\n </StyledSwitch>\n );\n }\n);\n\nexport default Switch;\n"]}